master
杨海航 3 days ago
parent 88e0a1b7a8
commit 7907bcc6c3
  1. 2
      src/main/java/digital/laboratory/platform/identifybook/controller/BusinessProcessRecordController.java
  2. 7
      src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookCommController.java
  3. 20
      src/main/java/digital/laboratory/platform/identifybook/service/impl/PushDataToLabsCareServiceImpl.java

@ -271,7 +271,7 @@ public class BusinessProcessRecordController {
commSaveTaskNotification(taskNotification); 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(), 6));
// applicationContext.publishEvent(new PushDataToLabsCareEvent(this, vo.getBusinessId(), 7)); // applicationContext.publishEvent(new PushDataToLabsCareEvent(this, vo.getBusinessId(), 7));
} }

@ -1,5 +1,6 @@
package digital.laboratory.platform.identifybook.controller; package digital.laboratory.platform.identifybook.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.Entrustment;
import digital.laboratory.platform.identifybook.entity.IdentifyBook; import digital.laboratory.platform.identifybook.entity.IdentifyBook;
import digital.laboratory.platform.identifybook.entity.IdentifyBookRelevance; 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.IEntrustmentService;
import digital.laboratory.platform.identifybook.service.IIdentifyBookRelevanceService; import digital.laboratory.platform.identifybook.service.IIdentifyBookRelevanceService;
import digital.laboratory.platform.identifybook.service.IIdentifyBookService; import digital.laboratory.platform.identifybook.service.IIdentifyBookService;
@ -19,6 +21,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -30,6 +33,7 @@ import java.math.BigDecimal;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Scanner; import java.util.Scanner;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -62,7 +66,7 @@ public class IdentifyBookCommController {
private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
private final ApplicationContext applicationContext;
@ApiOperation(value = "根据委托ID制作鉴定文书", notes = "根据委托ID制作鉴定文书") @ApiOperation(value = "根据委托ID制作鉴定文书", notes = "根据委托ID制作鉴定文书")
@ApiImplicitParam(name = "entrustId", value = "委托ID", required = true) @ApiImplicitParam(name = "entrustId", value = "委托ID", required = true)
@GetMapping("/makeIdentifyBook/{entrustId}") @GetMapping("/makeIdentifyBook/{entrustId}")
@ -77,6 +81,7 @@ public class IdentifyBookCommController {
if (entrustCaseDTO == null) { if (entrustCaseDTO == null) {
return R.failed("实验数据不满足生成文书!"); return R.failed("实验数据不满足生成文书!");
} else { } else {
applicationContext.publishEvent(new PushDataToLabsCareEvent(this, entrustId, Collections.synchronizedSet(CollUtil.newHashSet( 6))));
return R.ok(entrustCaseDTO, "生成鉴定文书成功!"); return R.ok(entrustCaseDTO, "生成鉴定文书成功!");
} }
} }

@ -121,6 +121,7 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
/** /**
* 推送定性报告数据 * 推送定性报告数据
*
* @param entrustId 委托id * @param entrustId 委托id
*/ */
@Override @Override
@ -128,6 +129,10 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
// 根据委托id获取鉴定审批信息 // 根据委托id获取鉴定审批信息
EntrustmentDTO entrustmentDTO = entrustService.getEntrustmentDTO(entrustId); EntrustmentDTO entrustmentDTO = entrustService.getEntrustmentDTO(entrustId);
if (!entrustmentDTO.getBusinessType().toString().equals(BusinessType.NPS_CASE.getBusinessType())) {
return;
}
// 构建jsonObject 参数 // 构建jsonObject 参数
JSONObject jsonObject = buildQualitativeReportJsonPayload(entrustmentDTO); JSONObject jsonObject = buildQualitativeReportJsonPayload(entrustmentDTO);
@ -151,6 +156,7 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
/** /**
* 推送鉴定报告审批表数据 * 推送鉴定报告审批表数据
*
* @param entrustId 委托id * @param entrustId 委托id
*/ */
@Override @Override
@ -183,6 +189,7 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
/** /**
* 推送归档报告信息数据 * 推送归档报告信息数据
*
* @param entrustId 委托id * @param entrustId 委托id
*/ */
@Override @Override
@ -219,7 +226,7 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
*/ */
private JSONObject buildQualitativeReportJsonPayload(EntrustmentDTO entrustmentDTO) { private JSONObject buildQualitativeReportJsonPayload(EntrustmentDTO entrustmentDTO) {
//获取到制作文书的实验数据 //获取到制作文书的实验数据
R<IdentificationBookDTO> identifyBookData= remoteTestToIdentifyService.getIdentifyBookDataByBusinessId(entrustmentDTO.getId()); R<IdentificationBookDTO> identifyBookData = remoteTestToIdentifyService.getIdentifyBookDataByBusinessId(entrustmentDTO.getId());
IdentificationBookDTO identificationBookDTO = identifyBookData.getData(); IdentificationBookDTO identificationBookDTO = identifyBookData.getData();
// 对受理编号进行分隔 // 对受理编号进行分隔
EntrustInfo entrustInfo = identificationBookDTO.getEntrustInfo(); EntrustInfo entrustInfo = identificationBookDTO.getEntrustInfo();
@ -271,7 +278,7 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
* 构建推送鉴定审批表的json数据 * 构建推送鉴定审批表的json数据
* *
* @param identifyBookApprove 鉴定文书审批表 * @param identifyBookApprove 鉴定文书审批表
* @param entrustmentDTO 委托信息 * @param entrustmentDTO 委托信息
* @return * @return
*/ */
private JSONObject buildAppraisalReportApprovalFormJsonPayload(IdentifyBookApprove identifyBookApprove, EntrustmentDTO entrustmentDTO) { private JSONObject buildAppraisalReportApprovalFormJsonPayload(IdentifyBookApprove identifyBookApprove, EntrustmentDTO entrustmentDTO) {
@ -357,7 +364,8 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
} finally { } finally {
try { try {
outputStream.close(); // 释放资源 outputStream.close(); // 释放资源
} catch (IOException ignored) {} } catch (IOException ignored) {
}
} }
return jsonObject; return jsonObject;
} }
@ -388,9 +396,9 @@ public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService
/** /**
* 更新推送标志 * 更新推送标志
* *
* @param entrust 委托对象 * @param entrust 委托对象
* @param pushType 推送类型 EntrustLetter 委托书 | ItemConfirmLetter 事项确认书 * @param pushType 推送类型 EntrustLetter 委托书 | ItemConfirmLetter 事项确认书
* @param newFlag 新的推送标志 * @param newFlag 新的推送标志
*/ */
private void updatePushFlag(Entrustment entrust, String pushType, String newFlag) { private void updatePushFlag(Entrustment entrust, String pushType, String newFlag) {
List<String> flagList = Optional.ofNullable(StrUtil.split(entrust.getPushFlag(), StrUtil.COMMA)) List<String> flagList = Optional.ofNullable(StrUtil.split(entrust.getPushFlag(), StrUtil.COMMA))

Loading…
Cancel
Save