20250819 更新

master
杨海航 4 days ago
parent ba5b74f295
commit b38f8d3f1e
  1. 2
      src/main/java/digital/laboratory/platform/entrustment/EntrustmentApplication.java
  2. 7
      src/main/java/digital/laboratory/platform/entrustment/dto/ResultExcelDTO.java
  3. 2
      src/main/java/digital/laboratory/platform/entrustment/listener/PushDataToLabsCareEventListener.java
  4. 3
      src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustMaterialCheckoutResultServiceImpl.java
  5. 6
      src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentServiceImpl.java
  6. 26
      src/main/java/digital/laboratory/platform/entrustment/service/impl/PushDataToLabsCareServiceImpl.java
  7. 2
      src/main/resources/bootstrap.yml

@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
// todo @EnableScheduling // 开启定时任务 @EnableScheduling // 开启定时任务
@EnableDLPSwagger2 @EnableDLPSwagger2
@EnableDLPFeignClients @EnableDLPFeignClients
@EnableDiscoveryClient @EnableDiscoveryClient

@ -6,7 +6,12 @@ import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@Data @Data
public class ResultExcelDTO { public class
ResultExcelDTO {
Integer entrustType; Integer entrustType;
List<String> oldResult; List<String> oldResult;
LocalDateTime startTime; LocalDateTime startTime;

@ -16,7 +16,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

@ -939,7 +939,8 @@ public class EntrustMaterialCheckoutResultServiceImpl extends ServiceImpl<Entrus
private void createDrugSheets(Workbook workbook, Map<String, List<EntrustmentIdentificationMaterialVO>> resultDataMap, Integer entrustType) { private void createDrugSheets(Workbook workbook, Map<String, List<EntrustmentIdentificationMaterialVO>> resultDataMap, Integer entrustType) {
for (Map.Entry<String, List<EntrustmentIdentificationMaterialVO>> entry : resultDataMap.entrySet()) { 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); Sheet sheet = workbook.createSheet(drugName);
// 定义表头 // 定义表头

@ -2442,7 +2442,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
throw new RuntimeException("保存委托信息失败"); throw new RuntimeException("保存委托信息失败");
} }
// 异步处理 // 异步处理
processPushDataAndUpdateDoc(entrustment.getId()); // processPushDataAndUpdateDoc(entrustment.getId());
//同步第三方禁毒系统的受理功能 开始-------------------------------------------------------------- //同步第三方禁毒系统的受理功能 开始--------------------------------------------------------------
boolean isSuccess = true; boolean isSuccess = true;
@ -2648,7 +2648,6 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
dm.put("entrustmentTime", LocalDateTimeUtil.format(ev.getEntrustmentTime(), "yyyy年MM月dd日")); dm.put("entrustmentTime", LocalDateTimeUtil.format(ev.getEntrustmentTime(), "yyyy年MM月dd日"));
List<EntrustmentIdentificationMaterialVO> ems = entrustmentIdentificationMaterialService.getEntrustmentIdentificationMaterialVOList( List<EntrustmentIdentificationMaterialVO> ems = entrustmentIdentificationMaterialService.getEntrustmentIdentificationMaterialVOList(
Wrappers.<EntrustmentIdentificationMaterial>query() Wrappers.<EntrustmentIdentificationMaterial>query()
.eq("entrustment_id", ev.getId()).orderByAsc("im_no")); .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()); ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
outPDF.close(); outPDF.close();
ossFile.fileSave(OSSDirectoryConstants.DOCUMENT_ENTRUSTMENT_DIRECTORY + "/" + ev.getId() + "/" + identifyItemsConfirmLetterFileName + ".pdf", isPDF); ossFile.fileSave(OSSDirectoryConstants.DOCUMENT_ENTRUSTMENT_DIRECTORY + "/" + ev.getId() + "/" + identifyItemsConfirmLetterFileName + ".pdf", isPDF);
isPDF.close(); isPDF.close();
System.out.println("转换为 PDF 结束"); System.out.println("转换为 PDF 结束");
} catch (Exception e) { } catch (Exception e) {
@ -2722,6 +2719,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
} }
} }
@Override @Override
public Entrustment bizSubmitter_AddEntrustment(Entrustment entrustment, DLPUser dlpUser) { 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.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import digital.laboratory.platform.common.core.exception.CheckedException; import digital.laboratory.platform.common.core.exception.CheckedException;
import digital.laboratory.platform.entrustment.config.properties.ApiPathProperties; import digital.laboratory.platform.entrustment.config.properties.ApiPathProperties;
@ -39,7 +40,7 @@ import java.util.stream.Collectors;
* @date 2025/3/27 16:32 * @date 2025/3/27 16:32
*/ */
@Slf4j @Slf4j
//@Service @Service
public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService { public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService {
@Resource @Resource
@ -72,9 +73,10 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
/** /**
* 做一个定时推送对于推送失败的委托进行重新推送 每天凌晨1点推送 * 做一个定时推送对于推送失败的委托进行重新推送 每天凌晨1点推送
*/ */
// @Scheduled(cron = "30 * * * * ?") // 测试 @Scheduled(cron = "* */5 * * * ?") // 测试
@Scheduled(cron = "0 0 1 * * ?") // 每天凌晨 1 点执行 // @Scheduled(cron = "0 0 1 * * ?") // 每天凌晨 1 点执行
public void timingPushDataToLabsCare() throws IllegalAccessException { public void timingPushDataToLabsCare() throws IllegalAccessException {
log.info("开始推送数据到 LabsCare");
// 查询受理后推送失败的委托 // 查询受理后推送失败的委托
List<EntrustmentVO> entrustmentList = entrustmentMapper.getEntrustmentVOList( List<EntrustmentVO> entrustmentList = entrustmentMapper.getEntrustmentVOList(
Wrappers.<Entrustment>query() Wrappers.<Entrustment>query()
@ -91,22 +93,28 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
) )
); );
Integer count = 0;
for (EntrustmentVO entrustmentVO : entrustmentList) { for (EntrustmentVO entrustmentVO : entrustmentList) {
String pushFlag = entrustmentVO.getPushFlag(); String pushFlag = entrustmentVO.getPushFlag();
if (StrUtil.isBlank(pushFlag)) { if (StrUtil.isBlank(pushFlag)) {
pushEntrustLetterData(entrustmentVO); pushEntrustLetterData(entrustmentVO);
pushItemConfirmLetterData(entrustmentVO); pushItemConfirmLetterData(entrustmentVO);
count++;
count++;
} else { } else {
List<String> flagList = StrUtil.split(pushFlag, StrUtil.COMMA).stream().filter(str -> str.contains("false")).collect(Collectors.toList()); List<String> flagList = StrUtil.split(pushFlag, StrUtil.COMMA).stream().filter(str -> str.contains("false")).collect(Collectors.toList());
for (String flag : flagList) { for (String flag : flagList) {
if (flag.contains(ENTRUST_LETTER)) { if (flag.contains(ENTRUST_LETTER)) {
pushEntrustLetterData(entrustmentVO); pushEntrustLetterData(entrustmentVO);
count++;
} else { } else {
pushItemConfirmLetterData(entrustmentVO); pushItemConfirmLetterData(entrustmentVO);
count++;
} }
} }
} }
} }
log.info("成功推送 {} 条数据到 LabsCare", count);
} }
/** /**
@ -199,7 +207,6 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.set("afsj", entrustVO.getHappenTime()); // 案发时间 jsonObject.set("afsj", entrustVO.getHappenTime()); // 案发时间
jsonObject.set("ajmc", entrustVO.getCaseName()); // 案事件名称 jsonObject.set("ajmc", entrustVO.getCaseName()); // 案事件名称
jsonObject.set("dwgz", entrustVO.getClientOrgName()); // 单位盖章
jsonObject.set("jyaq", entrustVO.getCaseBrief()); // 简要案情 jsonObject.set("jyaq", entrustVO.getCaseBrief()); // 简要案情
jsonObject.set("sjdwfzr", entrustVO.getDeliverer1Name() + "、" + entrustVO.getDeliverer2Name()); // 单位负责人签名 jsonObject.set("sjdwfzr", entrustVO.getDeliverer1Name() + "、" + entrustVO.getDeliverer2Name()); // 单位负责人签名
jsonObject.set("sjr1", entrustVO.getDeliverer1Name()); // 送检人 jsonObject.set("sjr1", entrustVO.getDeliverer1Name()); // 送检人
@ -208,7 +215,16 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
jsonObject.set("sjr2dh", entrustVO.getDeliverer2Phone()); jsonObject.set("sjr2dh", entrustVO.getDeliverer2Phone());
jsonObject.set("slrq", entrustVO.getAcceptTime().format(formatter)); jsonObject.set("slrq", entrustVO.getAcceptTime().format(formatter));
jsonObject.set("wtdw", entrustVO.getClientOrgName()); jsonObject.set("wtdw", entrustVO.getClientOrgName());
jsonObject.set("wtsj", entrustVO.getEntrustmentTime().format(formatter)); 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()); jsonObject.set("yjdqk", entrustVO.getOldIdentificationResult());
// 组装材料信息 // 组装材料信息

@ -83,6 +83,6 @@ config:
gyjd: gyjd:
labscare: labscare:
api: api:
host: http://gyga.gz.labscare.com host: http://83.3.9.45
entrust-letter: /thirdparty/report-generate/jianDingWeiTuoShuReport/v1 entrust-letter: /thirdparty/report-generate/jianDingWeiTuoShuReport/v1
confirm-letter: /thirdparty/report-generate/jianDingShiXiangQueRenShuReport/v1 confirm-letter: /thirdparty/report-generate/jianDingShiXiangQueRenShuReport/v1

Loading…
Cancel
Save