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