20250414 更新
1.推送数据取消
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package digital.laboratory.platform.inspection.controller;
|
package digital.laboratory.platform.inspection.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -106,27 +107,42 @@ public class EntrustInfoController {
|
|||||||
@GetMapping("/createInspectionRecord")
|
@GetMapping("/createInspectionRecord")
|
||||||
@ApiOperation(value = "生成检验记录", notes = "参数 :businessId、businessType:10001 或 10002")
|
@ApiOperation(value = "生成检验记录", notes = "参数 :businessId、businessType:10001 或 10002")
|
||||||
public R getPrintData(String businessId, String businessType) throws Exception {
|
public R getPrintData(String businessId, String businessType) throws Exception {
|
||||||
String fileName = "";
|
// String fileName = "";
|
||||||
if (businessType.equals(BusinessType.BOINT_CASE.getBusinessType())) {
|
// if (businessType.equals(BusinessType.BOINT_CASE.getBusinessType())) {
|
||||||
fileName = "生物样本检验记录.docx";
|
// fileName = "生物样本检验记录.docx";
|
||||||
} else {
|
// } else {
|
||||||
fileName = "缴获物检验记录.docx";
|
// fileName = "缴获物检验记录.docx";
|
||||||
}
|
// }
|
||||||
//判断是否生成了检验记录
|
// //判断是否生成了检验记录
|
||||||
List<String> fileNameList = ossFile.fileList(TestRecordFileUrl.TEST_RECORD_CATALOGUE.getFileUrl() + "/" + businessId);
|
// List<String> fileNameList = ossFile.fileList(TestRecordFileUrl.TEST_RECORD_CATALOGUE.getFileUrl() + "/" + businessId);
|
||||||
boolean isCreate = fileNameList.contains(fileName);
|
// boolean isCreate = fileNameList.contains(fileName);
|
||||||
//如果生成了 就直接返回word地址
|
// //如果生成了 就直接返回word地址
|
||||||
if (isCreate) {
|
// if (isCreate) {
|
||||||
return R.ok(TestRecordFileUrl.TEST_RECORD_CATALOGUE.getFileUrl() + "/" + businessId + "/" + fileName, "创建成功!");
|
// return R.ok(TestRecordFileUrl.TEST_RECORD_CATALOGUE.getFileUrl() + "/" + businessId + "/" + fileName, "创建成功!");
|
||||||
}
|
// }
|
||||||
//如果没有生成,那么现在创建检验记录
|
// //如果没有生成,那么现在创建检验记录
|
||||||
boolean ret = testRecordService.createInspectionRecord(businessId);
|
// boolean ret = testRecordService.createInspectionRecord(businessId);
|
||||||
if (ret) {
|
// if (ret) {
|
||||||
return R.ok(TestRecordFileUrl.TEST_RECORD_CATALOGUE.getFileUrl() + "/" + businessId + "/" + fileName, "创建成功!");
|
// return R.ok(TestRecordFileUrl.TEST_RECORD_CATALOGUE.getFileUrl() + "/" + businessId + "/" + fileName, "创建成功!");
|
||||||
|
//
|
||||||
|
// } else {
|
||||||
|
// return R.failed("创建失败!");
|
||||||
|
// }
|
||||||
|
// 获取OSS存储中的检验记录目录下的文件列表
|
||||||
|
List<String> list = ossFile.fileList(TestRecordFileUrl.TEST_RECORD_CATALOGUE.getFileUrl() + "/" + businessId + "/");
|
||||||
|
|
||||||
} else {
|
// 如果该目录下存在文件,则遍历查找是否有 .docx 结尾的文件
|
||||||
return R.failed("创建失败!");
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
|
for (String fileName : list) {
|
||||||
|
// 提取文件后缀名
|
||||||
|
String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||||
|
// 如果找到 .docx 文件,则直接返回文件路径
|
||||||
|
if (suffix.equals("docx")) {
|
||||||
|
return R.ok(TestRecordFileUrl.TEST_RECORD_CATALOGUE.getFileUrl() + "/" + businessId + "/" + fileName, "生成成功!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return R.failed("当前委托并未生成检验记录!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import javax.annotation.Resource;
|
|||||||
* @description: 推送数据到LabsCare平台接口管理
|
* @description: 推送数据到LabsCare平台接口管理
|
||||||
* @date 2025/4/3 10:48
|
* @date 2025/4/3 10:48
|
||||||
*/
|
*/
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/pushDataToLabsCare")
|
@RequestMapping("/pushDataToLabsCare")
|
||||||
@Api(tags = "19-推送数据到LabsCare平台接口管理", description = "推送数据到LabsCare平台接口管理")
|
@Api(tags = "19-推送数据到LabsCare平台接口管理", description = "推送数据到LabsCare平台接口管理")
|
||||||
public class PushDataToLabsCareController {
|
public class PushDataToLabsCareController {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
* 监听有关推送数据到LabsCare 平台的事件, 采用异步
|
* 监听有关推送数据到LabsCare 平台的事件, 采用异步
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
//@Component
|
||||||
public class PushDataToLabsCareEventListener implements ApplicationListener<PushDataToLabsCareEvent> {
|
public class PushDataToLabsCareEventListener implements ApplicationListener<PushDataToLabsCareEvent> {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import java.util.stream.Collectors;
|
|||||||
* @date 2025/3/31 9:31
|
* @date 2025/3/31 9:31
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
//@Service
|
||||||
public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService {
|
public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
|||||||
Reference in New Issue
Block a user