20250819 更新
This commit is contained in:
@@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
// todo @EnableScheduling // 开启定时任务
|
||||
@EnableScheduling // 开启定时任务
|
||||
@EnableDLPSwagger2
|
||||
@EnableDLPFeignClients
|
||||
@EnableDiscoveryClient
|
||||
|
||||
@@ -6,7 +6,12 @@ import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ResultExcelDTO {
|
||||
public class
|
||||
|
||||
|
||||
|
||||
|
||||
ResultExcelDTO {
|
||||
Integer entrustType;
|
||||
List<String> oldResult;
|
||||
LocalDateTime startTime;
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
* 监听有关推送数据到LabsCare 平台的事件, 采用异步
|
||||
*/
|
||||
@Slf4j
|
||||
//@Component
|
||||
@Component
|
||||
public class PushDataToLabsCareEventListener implements ApplicationListener<PushDataToLabsCareEvent> {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -939,7 +939,8 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus
|
||||
|
||||
private void createDrugSheets(Workbook workbook, Map<String, List<EntrustmentIdentificationMaterialVO>> resultDataMap, Integer entrustType) {
|
||||
for (Map.Entry<String, List<EntrustmentIdentificationMaterialVO>> entry : resultDataMap.entrySet()) {
|
||||
String drugName = entry.getKey().replaceAll("[^\u4e00-\u9fa5a-zA-Z0-9]", "");
|
||||
// String drugName = entry.getKey().replaceAll("[^\u4e00-\u9fa5a-zA-Z0-9]", "");
|
||||
String drugName = entry.getKey();
|
||||
Sheet sheet = workbook.createSheet(drugName);
|
||||
|
||||
// 定义表头
|
||||
|
||||
@@ -2442,7 +2442,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
|
||||
throw new RuntimeException("保存委托信息失败");
|
||||
}
|
||||
// 异步处理
|
||||
processPushDataAndUpdateDoc(entrustment.getId());
|
||||
// processPushDataAndUpdateDoc(entrustment.getId());
|
||||
|
||||
//同步第三方禁毒系统的受理功能 开始--------------------------------------------------------------
|
||||
boolean isSuccess = true;
|
||||
@@ -2648,7 +2648,6 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
|
||||
|
||||
dm.put("entrustmentTime", LocalDateTimeUtil.format(ev.getEntrustmentTime(), "yyyy年MM月dd日"));
|
||||
|
||||
|
||||
List<EntrustmentIdentificationMaterialVO> ems = entrustmentIdentificationMaterialService.getEntrustmentIdentificationMaterialVOList(
|
||||
Wrappers.<EntrustmentIdentificationMaterial>query()
|
||||
.eq("entrustment_id", ev.getId()).orderByAsc("im_no"));
|
||||
@@ -2709,11 +2708,9 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
|
||||
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||
outPDF.close();
|
||||
|
||||
|
||||
ossFile.fileSave(OSSDirectoryConstants.DOCUMENT_ENTRUSTMENT_DIRECTORY + "/" + ev.getId() + "/" + identifyItemsConfirmLetterFileName + ".pdf", isPDF);
|
||||
isPDF.close();
|
||||
|
||||
|
||||
System.out.println("转换为 PDF 结束");
|
||||
|
||||
} catch (Exception e) {
|
||||
@@ -2722,6 +2719,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Entrustment bizSubmitter_AddEntrustment(Entrustment entrustment, DLPUser dlpUser) {
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package digital.laboratory.platform.entrustment.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import digital.laboratory.platform.common.core.exception.CheckedException;
|
||||
import digital.laboratory.platform.entrustment.config.properties.ApiPathProperties;
|
||||
@@ -39,7 +40,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2025/3/27 16:32
|
||||
*/
|
||||
@Slf4j
|
||||
//@Service
|
||||
@Service
|
||||
public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService {
|
||||
|
||||
@Resource
|
||||
@@ -72,9 +73,10 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
|
||||
/**
|
||||
* 做一个定时推送,对于推送失败的委托进行重新推送, 每天凌晨1点推送
|
||||
*/
|
||||
// @Scheduled(cron = "30 * * * * ?") // 测试
|
||||
@Scheduled(cron = "0 0 1 * * ?") // 每天凌晨 1 点执行
|
||||
@Scheduled(cron = "* */5 * * * ?") // 测试
|
||||
// @Scheduled(cron = "0 0 1 * * ?") // 每天凌晨 1 点执行
|
||||
public void timingPushDataToLabsCare() throws IllegalAccessException {
|
||||
log.info("开始推送数据到 LabsCare");
|
||||
// 查询受理后推送失败的委托
|
||||
List<EntrustmentVO> entrustmentList = entrustmentMapper.getEntrustmentVOList(
|
||||
Wrappers.<Entrustment>query()
|
||||
@@ -91,22 +93,28 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
|
||||
)
|
||||
);
|
||||
|
||||
Integer count = 0;
|
||||
for (EntrustmentVO entrustmentVO : entrustmentList) {
|
||||
String pushFlag = entrustmentVO.getPushFlag();
|
||||
if (StrUtil.isBlank(pushFlag)) {
|
||||
pushEntrustLetterData(entrustmentVO);
|
||||
pushItemConfirmLetterData(entrustmentVO);
|
||||
count++;
|
||||
count++;
|
||||
} else {
|
||||
List<String> flagList = StrUtil.split(pushFlag, StrUtil.COMMA).stream().filter(str -> str.contains("false")).collect(Collectors.toList());
|
||||
for (String flag : flagList) {
|
||||
if (flag.contains(ENTRUST_LETTER)) {
|
||||
pushEntrustLetterData(entrustmentVO);
|
||||
count++;
|
||||
} else {
|
||||
pushItemConfirmLetterData(entrustmentVO);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("成功推送 {} 条数据到 LabsCare", count);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,7 +207,6 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("afsj", entrustVO.getHappenTime()); // 案发时间
|
||||
jsonObject.set("ajmc", entrustVO.getCaseName()); // 案事件名称
|
||||
jsonObject.set("dwgz", entrustVO.getClientOrgName()); // 单位盖章
|
||||
jsonObject.set("jyaq", entrustVO.getCaseBrief()); // 简要案情
|
||||
jsonObject.set("sjdwfzr", entrustVO.getDeliverer1Name() + "、" + entrustVO.getDeliverer2Name()); // 单位负责人签名
|
||||
jsonObject.set("sjr1", entrustVO.getDeliverer1Name()); // 送检人
|
||||
@@ -208,7 +215,16 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
|
||||
jsonObject.set("sjr2dh", entrustVO.getDeliverer2Phone());
|
||||
jsonObject.set("slrq", entrustVO.getAcceptTime().format(formatter));
|
||||
jsonObject.set("wtdw", entrustVO.getClientOrgName());
|
||||
if (entrustVO.getEntrustmentTime() != null) {
|
||||
jsonObject.set("wtsj", entrustVO.getEntrustmentTime().format(formatter));
|
||||
} else {
|
||||
jsonObject.set("wtsj", entrustVO.getAcceptTime().format(formatter));
|
||||
}
|
||||
if (StringUtils.isNotBlank(entrustVO.getAcceptNo())) {
|
||||
jsonObject.set("dwgz", entrustVO.getAcceptNo()); // 单位盖章
|
||||
} else {
|
||||
jsonObject.set("dwgz", entrustVO.getClientOrgName());
|
||||
}
|
||||
jsonObject.set("yjdqk", entrustVO.getOldIdentificationResult());
|
||||
|
||||
// 组装材料信息
|
||||
|
||||
@@ -83,6 +83,6 @@ config:
|
||||
gyjd:
|
||||
labscare:
|
||||
api:
|
||||
host: http://gyga.gz.labscare.com
|
||||
host: http://83.3.9.45
|
||||
entrust-letter: /thirdparty/report-generate/jianDingWeiTuoShuReport/v1
|
||||
confirm-letter: /thirdparty/report-generate/jianDingShiXiangQueRenShuReport/v1
|
||||
|
||||
Reference in New Issue
Block a user