diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/BusinessProcessRecordController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/BusinessProcessRecordController.java index ee6f3f8..c49880b 100644 --- a/src/main/java/digital/laboratory/platform/identifybook/controller/BusinessProcessRecordController.java +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/BusinessProcessRecordController.java @@ -271,7 +271,7 @@ public class BusinessProcessRecordController { commSaveTaskNotification(taskNotification); // 发布推送事件 - applicationContext.publishEvent(new PushDataToLabsCareEvent(this, vo.getBusinessId(), Collections.synchronizedSet(CollUtil.newHashSet(5, 6)))); +// applicationContext.publishEvent(new PushDataToLabsCareEvent(this, vo.getBusinessId(), Collections.synchronizedSet(CollUtil.newHashSet( 6)))); // applicationContext.publishEvent(new PushDataToLabsCareEvent(this, vo.getBusinessId(), 6)); // applicationContext.publishEvent(new PushDataToLabsCareEvent(this, vo.getBusinessId(), 7)); } diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookCommController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookCommController.java index 6a79ccb..fad9ab3 100644 --- a/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookCommController.java +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookCommController.java @@ -1,5 +1,6 @@ package digital.laboratory.platform.identifybook.controller; +import cn.hutool.core.collection.CollUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -11,6 +12,7 @@ import digital.laboratory.platform.identifybook.dto.EntrustCaseDTO; import digital.laboratory.platform.identifybook.entity.Entrustment; import digital.laboratory.platform.identifybook.entity.IdentifyBook; import digital.laboratory.platform.identifybook.entity.IdentifyBookRelevance; +import digital.laboratory.platform.identifybook.event.PushDataToLabsCareEvent; import digital.laboratory.platform.identifybook.service.IEntrustmentService; import digital.laboratory.platform.identifybook.service.IIdentifyBookRelevanceService; import digital.laboratory.platform.identifybook.service.IIdentifyBookService; @@ -19,6 +21,7 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.context.ApplicationContext; import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -30,6 +33,7 @@ import java.math.BigDecimal; import java.net.HttpURLConnection; import java.net.URL; import java.text.SimpleDateFormat; +import java.util.Collections; import java.util.List; import java.util.Scanner; import java.util.stream.Collectors; @@ -62,7 +66,7 @@ public class IdentifyBookCommController { private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); - + private final ApplicationContext applicationContext; @ApiOperation(value = "根据委托ID制作鉴定文书", notes = "根据委托ID制作鉴定文书") @ApiImplicitParam(name = "entrustId", value = "委托ID", required = true) @GetMapping("/makeIdentifyBook/{entrustId}") @@ -77,6 +81,7 @@ public class IdentifyBookCommController { if (entrustCaseDTO == null) { return R.failed("实验数据不满足生成文书!"); } else { + applicationContext.publishEvent(new PushDataToLabsCareEvent(this, entrustId, Collections.synchronizedSet(CollUtil.newHashSet( 6)))); return R.ok(entrustCaseDTO, "生成鉴定文书成功!"); } } diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/PushDataToLabsCareServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/PushDataToLabsCareServiceImpl.java index e1eaf53..93f52a5 100644 --- a/src/main/java/digital/laboratory/platform/identifybook/service/impl/PushDataToLabsCareServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/PushDataToLabsCareServiceImpl.java @@ -121,6 +121,7 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService /** * 推送定性报告数据 + * * @param entrustId 委托id */ @Override @@ -128,6 +129,10 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService // 根据委托id获取鉴定审批信息 EntrustmentDTO entrustmentDTO = entrustService.getEntrustmentDTO(entrustId); + if (!entrustmentDTO.getBusinessType().toString().equals(BusinessType.NPS_CASE.getBusinessType())) { + return; + } + // 构建jsonObject 参数 JSONObject jsonObject = buildQualitativeReportJsonPayload(entrustmentDTO); @@ -151,6 +156,7 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService /** * 推送鉴定报告审批表数据 + * * @param entrustId 委托id */ @Override @@ -183,6 +189,7 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService /** * 推送归档报告信息数据 + * * @param entrustId 委托id */ @Override @@ -219,7 +226,7 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService */ private JSONObject buildQualitativeReportJsonPayload(EntrustmentDTO entrustmentDTO) { //获取到制作文书的实验数据 - R identifyBookData= remoteTestToIdentifyService.getIdentifyBookDataByBusinessId(entrustmentDTO.getId()); + R identifyBookData = remoteTestToIdentifyService.getIdentifyBookDataByBusinessId(entrustmentDTO.getId()); IdentificationBookDTO identificationBookDTO = identifyBookData.getData(); // 对受理编号进行分隔 EntrustInfo entrustInfo = identificationBookDTO.getEntrustInfo(); @@ -271,7 +278,7 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService * 构建推送鉴定审批表的json数据 * * @param identifyBookApprove 鉴定文书审批表 - * @param entrustmentDTO 委托信息 + * @param entrustmentDTO 委托信息 * @return */ private JSONObject buildAppraisalReportApprovalFormJsonPayload(IdentifyBookApprove identifyBookApprove, EntrustmentDTO entrustmentDTO) { @@ -357,7 +364,8 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService } finally { try { outputStream.close(); // 释放资源 - } catch (IOException ignored) {} + } catch (IOException ignored) { + } } return jsonObject; } @@ -388,9 +396,9 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService /** * 更新推送标志 * - * @param entrust 委托对象 - * @param pushType 推送类型 EntrustLetter 委托书 | ItemConfirmLetter 事项确认书 - * @param newFlag 新的推送标志 + * @param entrust 委托对象 + * @param pushType 推送类型 EntrustLetter 委托书 | ItemConfirmLetter 事项确认书 + * @param newFlag 新的推送标志 */ private void updatePushFlag(Entrustment entrust, String pushType, String newFlag) { List flagList = Optional.ofNullable(StrUtil.split(entrust.getPushFlag(), StrUtil.COMMA))