Merge remote-tracking branch 'origin/master'

master
杨海航 1 month ago
commit 55ee3eddb7
  1. BIN
      doc/assets/2025-01-15-10-04-01-image.png
  2. BIN
      doc/assets/2025-01-15-10-06-29-image.png
  3. BIN
      doc/assets/2025-01-15-10-06-52-image.png
  4. BIN
      doc/assets/2025-01-15-10-07-23-image.png
  5. 18
      doc/贵阳禁毒送检受理委托新增需求文档.md
  6. 7
      src/main/java/digital/laboratory/platform/entrustment/controller/EntrustmentController.java
  7. 13
      src/main/java/digital/laboratory/platform/entrustment/convert/DrugLiteConvert.java
  8. 8
      src/main/java/digital/laboratory/platform/entrustment/service/impl/AcceptServiceImpl.java
  9. 2
      src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustAlterApplyServiceImpl.java
  10. 232
      src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentServiceImpl.java
  11. 3
      src/main/java/digital/laboratory/platform/entrustment/vo/CaseEventVO.java
  12. 57
      src/main/resources/mapper/CaseEventMapper.xml

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

@ -299,6 +299,22 @@ DESC LIMIT 1;
## 20250102 在受理页面添加可以录入检材检出结果的功能
## 20250103 新增接口-判断当前委托保存的检材是否和用户当前页面填写的检材数量是否匹配,是则返回true,否返回false
## 20250103 新增接口-判断当前委托保存的检材是否和用户当前页面填写的检材数量是否匹配,是则返回true,否返回false
## 20250114 受理编号生成,有受理成功后在受理改为委托单位提交后,受理单位审核通过就生成
### 实现
修改了审核委托bizChecker_Apply的方法(digital.laboratory.platform.entrustment.service.impl.EntrustmentServiceImpl)
![](assets/2025-01-15-10-04-01-image.png)
受理成功的方法bizAccept_Apply注释了部分代码:
![](assets/2025-01-15-10-06-29-image.png)
![](assets/2025-01-15-10-06-52-image.png)
![](assets/2025-01-15-10-07-23-image.png)

@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import digital.laboratory.platform.common.core.constant.OSSDirectoryConstants;
import digital.laboratory.platform.common.core.exception.CheckedException;
import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
@ -1342,7 +1343,11 @@ public class EntrustmentController {
// System.out.println(String.format("theHttpServletRequest.toString()=%s", theHttpServletRequest.toString()));
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
return R.ok(entrustmentService.bizSubmitter_Apply(entrust, dlpUser), "委托提交成功");
try {
return R.ok(entrustmentService.bizSubmitter_Apply(entrust, dlpUser), "委托提交成功");
} catch (CheckedException e) {
return R.failed(e.getMessage());
}
}

@ -27,4 +27,17 @@ public class DrugLiteConvert {
return drugLiteList;
}
/**
* 将药物列表名称连接成字符串
*
* @param drugLitesJson 药物列表JSON格式
* @param delimiter 分隔符
* @return 连接后的字符串
*/
public static String joiningDrugListNameToStr(List<DrugLite> drugLitesJson, String delimiter) {
return convertDirtyLiteByJSON(drugLitesJson)
.stream()
.map(DrugLite::getName)
.collect(Collectors.joining(delimiter));
}
}

@ -11,6 +11,7 @@ import digital.laboratory.platform.entrustment.service.AcceptService;
import digital.laboratory.platform.entrustment.service.EntrustmentIdentificationMaterialService;
import digital.laboratory.platform.entrustment.service.EntrustmentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@ -34,6 +35,7 @@ public class AcceptServiceImpl implements AcceptService {
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean alertMaterialAcceptNo(EntrustmentIdentificationMaterial material) {
EntrustmentIdentificationMaterial identificationMaterial = entrustmentIdentificationMaterialService.getById(material.getId());
if (identificationMaterial == null) {
@ -70,6 +72,12 @@ public class AcceptServiceImpl implements AcceptService {
}
if (entrustmentIdentificationMaterialService.update(Wrappers.<EntrustmentIdentificationMaterial>lambdaUpdate()
.eq(EntrustmentIdentificationMaterial::getId, material.getId()).set(EntrustmentIdentificationMaterial::getAcceptNo, materialAcceptNo))) {
// 更新成功后,判断委托的受理编号是否和修改的检材受理后一致,不一致则更新
if (!entrustAcceptNo.equals(entrustment.getAcceptNo())) {
entrustmentService.update(Wrappers.<Entrustment>lambdaUpdate()
.eq(Entrustment::getId, entrustment.getId())
.set(Entrustment::getAcceptNo, entrustAcceptNo));
}
// 查询该委托下面的其他已经受理的检材
List<EntrustmentIdentificationMaterial> materialList = entrustmentIdentificationMaterialService.list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
.eq(EntrustmentIdentificationMaterial::getEntrustmentId, identificationMaterial.getEntrustmentId())

@ -260,7 +260,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
String renewDrugsStr = candidateDrugs.stream().map(DrugLite::getName).collect(Collectors.joining("、"));
Integer analysisOption = item.getAnalysisOption();
EntrustmentIdentificationMaterial oldMaterial = oldInfoMap.get(materialId);
String oldDrugsStr = DrugLiteConvert.convertDirtyLiteByJSON(oldMaterial.getCandidateDrugs()).stream().map(DrugLite::getName).collect(Collectors.joining("、"));
String oldDrugsStr = DrugLiteConvert.joiningDrugListNameToStr(oldMaterial.getCandidateDrugs(), "、");
// 判断有没有对这个检材进行修改oldMaterial.getName().equals(name) && oldMaterial.getAnalysisOption().equals(analysisOption) && oldDrugsStr.equals(renewDrugsStr)
boolean equalsName = oldMaterial.getName().equals(name);

@ -23,6 +23,7 @@ import com.deepoove.poi.data.Pictures;
import com.deepoove.poi.plugin.table.MultipleRowTableRenderPolicy;
import digital.laboratory.platform.common.core.constant.CommonConstants;
import digital.laboratory.platform.common.core.constant.OSSDirectoryConstants;
import digital.laboratory.platform.common.core.exception.CheckedException;
import digital.laboratory.platform.common.core.exception.ValidateCodeException;
import digital.laboratory.platform.common.core.util.ClassUtils;
import digital.laboratory.platform.common.core.util.R;
@ -497,7 +498,12 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
dm.put("caseBrief", caseEvent.getCaseBrief());
//构造委托部分需要的数据
dm.put("clientOrgName", entrustment.getClientOrgName());//委托单位
dm.put("identificationNo", entrustment.getAcceptNo());//受理编号
// 如果受理编号不为空,则生成[xxxx]x号,比如2025-8 -》 [2025]8号
if (StrUtil.isNotBlank(entrustment.getAcceptNo())) {
List<String> split = StrUtil.split(entrustment.getAcceptNo(), "-");
dm.put("identificationNo", String.format("[%s]%s号", split.get(0), split.get(1)));//受理编号
}
// dm.put("identificationNo", entrustment.getAcceptNo());//受理编号
dm.put("year", entrustment.getEntrustmentTime() != null ? entrustment.getEntrustmentTime().getYear() : LocalDate.now().getYear());
dm.put("materialDes", buildMaterialDes(materialList));//检材描述
@ -799,11 +805,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
EntrustmentIdentificationMaterial material = materialList.get(0);
retSb.append("对检材中是否含有")
.append(
DrugLiteConvert.convertDirtyLiteByJSON(
material.getCandidateDrugs()
).stream()
.map(DrugLite::getName)
.collect(Collectors.joining("、"))
DrugLiteConvert.joiningDrugListNameToStr(material.getCandidateDrugs(), "、")
)
.append("成分进行")
.append(AnalysisOptionEnums.fromCode(material.getAnalysisOption()).getChineseName())
@ -815,10 +817,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
Collectors.groupingBy(item ->
item.getAnalysisOption() +
"_" +
DrugLiteConvert.convertDirtyLiteByJSON(item.getCandidateDrugs())
.stream()
.map(DrugLite::getName)
.collect(Collectors.joining("")),
DrugLiteConvert.joiningDrugListNameToStr(item.getCandidateDrugs(), ""),
LinkedHashMap::new, // 返回有序map
Collectors.toList())
);
@ -827,11 +826,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
retSb.append("对1号至")
.append(materialList.size())
.append("号检材中是否含有")
.append(DrugLiteConvert.convertDirtyLiteByJSON(
material.getCandidateDrugs()
).stream()
.map(DrugLite::getName)
.collect(Collectors.joining("、")));
.append(DrugLiteConvert.joiningDrugListNameToStr(material.getCandidateDrugs(), "、"));
retSb.append("成分进行")
.append(AnalysisOptionEnums.fromCode(material.getAnalysisOption()).getChineseName())
.append("检测");
@ -992,7 +987,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
break;
}
try {
if (!ossFile.objectExist(retBookName)) {
if (!ossFile.objectExist(retBookName) || entrustment.getStatus() <= EntrustmentStatusConstants.ENTRUSTMENT_STATUS_WAITING_ACCEPT.getStatus()) {
//不存在就生成一个
if ((whatBook.equals("identItemBook") || whatBook.equals("identfyBook")) && this.generateIdentifyItemsBook(entrustId)) {
return retBookName;
@ -1059,24 +1054,6 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
return remoteGenerateWordService.genDeliverCertPhoto(entrustId, acceptNo, caseName, deliverer1Name, deliverer2Name);
}
// @Override
// public String getMaterialMergePhoto(String entrustId, Integer groupCount) {
// //String path=OSSDirectoryConstants.DOCUMENT_ACCEPT_DIRECTORY+"/"+entrustId+"/"+OSSDirectoryConstants.DOCUMENT_ACCEPT_DIRECTORY_DELIVER;
// //先判断如果没有生成,我们就生成,如果生成了,我们就直接取
// Entrustment entrustment = this.getById(entrustId);
// CaseEvent caseEvent = caseEventService.getById(entrustment.getCaseId());
// List<EntrustmentIdentificationMaterial> materialList = entrustmentIdentificationMaterialService
// .list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
// .eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustment.getId()));
// List<String> materialIds = new ArrayList<>();
// materialList.forEach(item -> {
// materialIds.add(item.getId());
// });
// String path = remoteGenerateWordService.genMaterialPhoto(entrustId, materialIds, caseEvent.getCaseName(), entrustment.getAcceptNo(), groupCount);
//
// return path;
// }
//
@Override
public Boolean historyDataToTransSys(String status, List<String> entrustIds) {
@ -1231,21 +1208,6 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
throw new RuntimeException("委托已经提交, 不能再进行修改");
}
// List<UpdateInfo> pis = entrustment.getProcessInfo();
// if (pis == null) {
// pis = new ArrayList<UpdateInfo>();
// }
// if (pis.size() == 0) {
// UpdateInfo pi = new UpdateInfo(dlpUser.getId(),
// dlpUser.getName(),
// dlpUser.getOrgId(),
// dlpUser.getOrgName(),
// "已创建",
// 1, entrustment.getStatus());
// pis.add(pi);
// }
// entrustment.setProcessInfo(pis);
System.out.println(String.format("保存委托, entrust.getCandidateDrugs()=%s", entrust.getCandidateDrugs()));
@ -1273,13 +1235,6 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
UpdateWrapper<Entrustment> updateWrapper = new UpdateWrapper<Entrustment>();
updateWrapper.eq("id", entrust.getId()); // 查询条件是 id 相等
// updateWrapper.set("case_id", entrust.getCaseId()); // CaseId 不能修改
// updateWrapper.set("entrustment_no", entrust.getEntrustmentNo()); // EntrustmentNo 不能修改
// updateWrapper.set("process_instance_id", entrust.getProcessInstanceId()); // 不能修改
// updateWrapper.set("entrustment_time", entrust.getEntrustmentTime()); // 不能修改
// updateWrapper.set("client_org_id", entrust.getClientOrgId());
// updateWrapper.set("submitter", entrust.getSubmitter());
// updateWrapper.set("submit_time", entrust.getsubmitTime());
updateWrapper.set("client_org_id", entrust.getClientOrgId());
updateWrapper.set("client_org_name", entrust.getClientOrgName());
updateWrapper.set("client_address", entrust.getClientAddress());
@ -1364,17 +1319,17 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
// 检查委托原来的状态
Entrustment entrustment = this.getById(entrust.getId());
if (entrustment == null) {
throw new RuntimeException(String.format("没有找到 id 为 %s 的委托", entrust.getId()));
throw new CheckedException(String.format("没有找到 id 为 %s 的委托", entrust.getId()));
}
if (entrustment.getStatus() != EntrustmentStatusConstants.ENTRUSTMENT_STATUS_CREATED.getStatus()) {
throw new RuntimeException("委托已经提交, 无须再次提交");
throw new CheckedException("委托已经提交, 无须再次提交");
}
if (dlpUser.isStaff() && dlpUser.HasPermission("EntrustmentAidInput")) {
// 是代录员, clientOrgId 由用户提供
if (StrUtil.isEmpty(entrust.getClientOrgId())) {
throw new RuntimeException("代录委托必须录入委托单位数据");
throw new CheckedException("代录委托必须录入委托单位数据");
}
}
@ -1396,7 +1351,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
entrustment.setCheckCandidateUser(candidateUser); // 不使用用户提交的候选人名单
} else {
if (StrUtil.isBlank(entrust.getCheckCandidateUser())) {
throw new RuntimeException("必须提供审批候选人名单");
throw new CheckedException("必须提供审批候选人名单");
}
entrustment.setCheckCandidateUser(entrust.getCheckCandidateUser()); // 使用用户提交的候选人名单
@ -1419,14 +1374,18 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
pis.add(pi);
entrustment.setProcessInfo(pis);
//-- 更新送检员表的信息
if (org.apache.commons.lang3.StringUtils.isNotBlank(entrust.getDeliverer1Name())) {
if (StringUtils.isNotBlank(entrust.getDeliverer1Name())) {
Deliverer deliverer1 = getDeliverer1(entrust, dlpUser);
remoteDeliverService.renew(deliverer1);
} else {
throw new CheckedException("送检人信息不能为空!");
}
if (org.apache.commons.lang3.StringUtils.isNotBlank(entrust.getDeliverer2Name())) {
if (StringUtils.isNotBlank(entrust.getDeliverer2Name())) {
Deliverer deliverer2 = getDeliverer2(entrust, dlpUser);
remoteDeliverService.renew(deliverer2);
}//-------------------
} else {
throw new CheckedException("送检人信息不能为空!");
}
entrustment.setDeliverer1Id(entrust.getDeliverer1Id());
entrustment.setDeliverer1Cert(entrust.getDeliverer1Cert());
entrustment.setDeliverer1Name(entrust.getDeliverer1Name());
@ -1447,7 +1406,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
.eq("entrustment_id", entrustment.getId())
.orderByAsc("create_time"));
if (materialList == null || materialList.size() == 0) {
throw new RuntimeException("请至少添加一个检材后再提交!");
throw new CheckedException("请至少添加一个检材后再提交!");
}
if (StrUtil.isBlank(entrust.getEntrustRequirement())) {
entrustment.setEntrustRequirement(this.buildEntrustReq(materialList));
@ -1586,23 +1545,27 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
// 审核任务已经提交了, 转到新的环节
int newStatus = -1; // 新的状态(环节)
{
newStatus = ProcessFlowMapper.getNextStatus(entrustment.getStatus(), opCode);
String currentAcceptNo = "";
if (opCode == 1) {
newStatus = ProcessFlowMapper.getNextStatus(entrustment.getStatus(), opCode);
}
if (newStatus == EntrustmentStatusConstants.ENTRUSTMENT_STATUS_CREATED.getStatus()) {
EntrustmentIdentificationMaterial im = new EntrustmentIdentificationMaterial();
im.setCheckPassed(0);
im.setApprovePassed(0);
im.setAcceptPassed(0);
im.setAcceptNo(null);
entrustmentIdentificationMaterialService.setEntrustmentIdentificationMaterialStatusByEntrustment(im, entrustment.getId());
}
if (opCode == 1 && StrUtil.isBlank(entrustment.getAcceptNo())) {
// 20250114 贵阳需求,审核通过后就生成受理编号
String yearStr = String.valueOf(LocalDateTime.now().getYear());
String maxEntrustAcceptNo = baseMapper.getMaxEntrustAcceptNo(yearStr);
currentAcceptNo = yearStr + "-" + (StrUtil.isBlank(maxEntrustAcceptNo) ? "1" : (Integer.parseInt(maxEntrustAcceptNo) + 1));
}
if (newStatus == EntrustmentStatusConstants.ENTRUSTMENT_STATUS_CREATED.getStatus()) {
EntrustmentIdentificationMaterial im = new EntrustmentIdentificationMaterial();
im.setCheckPassed(0);
im.setApprovePassed(0);
im.setAcceptPassed(0);
im.setAcceptNo(null);
entrustmentIdentificationMaterialService.setEntrustmentIdentificationMaterialStatusByEntrustment(im, entrustment.getId());
}
//退回后需标记
if (opCode == -1) {
entrustment.setReturnOrNot(-1);
@ -1611,18 +1574,18 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
//-------------------
// 更新数据库表数据
//-------------------
entrustment.setDestructiveAnalysis(entrust.getDestructiveAnalysis());
entrustment.setOtherIdentificationNotes(entrust.getOtherIdentificationNotes());
// entrustment.setDestructiveAnalysis(entrust.getDestructiveAnalysis());
// entrustment.setOtherIdentificationNotes(entrust.getOtherIdentificationNotes());
//entrustment.setOtherAgreement(entrust.getOtherAgreement());
entrustment.setAvoidIdentifier(entrust.getAvoidIdentifier());
entrustment.setComments(entrust.getComments());
// entrustment.setAvoidIdentifier(entrust.getAvoidIdentifier());
// entrustment.setComments(entrust.getComments());
entrustment.setCheckUser(dlpUser.getId());
entrustment.setCheckTime(LocalDateTime.now());
entrustment.setCheckComments(entrust.getCheckComments());
entrustment.setCheckTimes(entrustment.getCheckTimes() + 1); // 审核次数加 1
entrustment.setPreviousStatus(entrustment.getStatus()); // 可能是从其他环节转过来的, 一旦提交, 保存上一个状态
entrustment.setStatus(newStatus); // 新的状态(环节), 可能会是审批或提交前
// entrustment.setCheckUser(dlpUser.getId());
// entrustment.setCheckTime(LocalDateTime.now());
// entrustment.setCheckComments(entrust.getCheckComments());
// entrustment.setCheckTimes(entrustment.getCheckTimes() + 1); // 审核次数加 1
// entrustment.setPreviousStatus(entrustment.getStatus()); // 可能是从其他环节转过来的, 一旦提交, 保存上一个状态
// entrustment.setStatus(newStatus); // 新的状态(环节), 可能会是审批或提交前
List<UpdateInfo> pis = entrustment.getProcessInfo();
if (pis == null) {
@ -1647,28 +1610,28 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
pis.add(pi);
}
entrustment.setProcessInfo(pis);
// entrustment.setProcessInfo(pis);
UpdateWrapper<Entrustment> updateWrapper = new UpdateWrapper<Entrustment>();
updateWrapper.eq("id", entrustment.getId()); // 查询条件是 id 相等
updateWrapper.set("destructive_analysis", entrustment.getDestructiveAnalysis());
updateWrapper.set("other_identification_notes", entrustment.getOtherIdentificationNotes());
updateWrapper.set("destructive_analysis", entrust.getDestructiveAnalysis());
updateWrapper.set("other_identification_notes", entrust.getOtherIdentificationNotes());
updateWrapper.set("other_agreement", entrustment.getOtherAgreement());
updateWrapper.set("avoid_identifier", entrustment.getAvoidIdentifier(), "typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler");
updateWrapper.set("comments", entrustment.getComments());
updateWrapper.set("avoid_identifier", entrust.getAvoidIdentifier(), "typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler");
updateWrapper.set("comments", entrust.getComments());
updateWrapper.set("return_or_not", entrustment.getReturnOrNot());
updateWrapper.set("check_user", entrustment.getCheckUser());
updateWrapper.set("check_time", entrustment.getCheckTime());
updateWrapper.set("check_comments", entrustment.getCheckComments());
updateWrapper.set("check_times", entrustment.getCheckTimes());
updateWrapper.set("check_user", dlpUser.getId());
updateWrapper.set("check_time", LocalDateTime.now());
updateWrapper.set("check_comments", entrust.getCheckComments());
updateWrapper.set("check_times", entrustment.getCheckTimes() + 1); // 审核次数加 1
updateWrapper.set("approve_candidate_user", entrustment.getApproveCandidateUser());
updateWrapper.set("status", entrustment.getStatus());
updateWrapper.set("previous_status", entrustment.getPreviousStatus());
updateWrapper.set("status", newStatus); // 新的状态(环节), 可能会是审批或提交前
updateWrapper.set("previous_status", entrustment.getStatus()); // 可能是从其他环节转过来的, 一旦提交, 保存上一个状态
// updateWrapper.set("process_info", entrustment.getProcessInfo(), "javaType=String,jdbcType=VARCHAR,typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler");
updateWrapper.set("process_info", entrustment.getProcessInfo(), "javaType=String,jdbcType=VARCHAR,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler");
updateWrapper.set("process_info", pis, "javaType=String,jdbcType=VARCHAR,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler");
updateWrapper.set(StrUtil.isNotBlank(currentAcceptNo), "accept_no", currentAcceptNo);
if (!this.update(null, updateWrapper)) {
throw new RuntimeException("保存委托信息失败");
}
@ -2120,8 +2083,8 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
// 转换临时目录中的 word 文档为 PDF
String pdfFilePath = OSSDirectoryConstants.DOCUMENT_ENTRUSTMENT_DIRECTORY + "/" + ev.getId() + "/" + entrustmentLetterFileName + ".docx";
try {
//这里加一下判断条件,由于贵阳市局这里的情况是审核的时候就需要查看委托书,所以为了保证每一次提交过来的委托都是最新的,所以在审核通过以前应该每次查看都是重新生成
if (!ossFile.objectExist(pdfFilePath) || ev.getStatus() < EntrustmentStatusConstants.ENTRUSTMENT_STATUS_WAITING_CONFIRM.getStatus()) {
//这里加一下判断条件,由于贵阳市局这里的情况是审核的时候就需要查看委托书,所以为了保证每一次提交过来的委托都是最新的,所以在受理通过以前应该每次查看都是重新生成
if (!ossFile.objectExist(pdfFilePath) || ev.getStatus() <= EntrustmentStatusConstants.ENTRUSTMENT_STATUS_WAITING_ACCEPT.getStatus()) {
GenerateEntrustmentLetterPDF(ev);
return pdfFilePath;
}
@ -2184,6 +2147,11 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
throw new RuntimeException("保存委托日期失败");
}
}
// 如果受理编号不为空,则生成[xxxx]x号,比如2025-8 -》 [2025]8号
if (StrUtil.isNotBlank(ev.getAcceptNo())) {
List<String> split = StrUtil.split(ev.getAcceptNo(), "-");
dm.put("acceptNo", String.format("[%s]%s号", split.get(0), split.get(1)));
}
String oldIdentificationResult = ev.getOldIdentificationResult();
String oldIdentification = "";
switch (oldIdentificationResult) {
@ -2328,28 +2296,19 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
//-------------------
// 更新数据库表数据
//-------------------
entrustment.setDestructiveAnalysis(entrust.getDestructiveAnalysis());
entrustment.setOtherIdentificationNotes(entrust.getOtherIdentificationNotes());
entrustment.setAvoidIdentifier(entrust.getAvoidIdentifier());
entrustment.setOtherAgreement(entrust.getOtherAgreement());
entrustment.setComments(entrust.getComments());
entrustment.setAcceptUser(null); // 之前可能受理过, 现在后悔了, 置 null
entrustment.setAcceptTime(null); // 之前可能受理过, 现在后悔了, 置 null
entrustment.setAcceptComments(entrust.getAcceptComments());
UpdateWrapper<Entrustment> updateWrapper = new UpdateWrapper<Entrustment>();
updateWrapper.eq("id", entrustment.getId()); // 查询条件是 id 相等
updateWrapper.set("destructive_analysis", entrustment.getDestructiveAnalysis());
updateWrapper.set("other_identification_notes", entrustment.getOtherIdentificationNotes());
updateWrapper.set("avoid_identifier", entrustment.getAvoidIdentifier(), "typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler");
updateWrapper.set("other_agreement", entrustment.getOtherAgreement());
updateWrapper.set("comments", entrustment.getComments());
updateWrapper.set("destructive_analysis", entrust.getDestructiveAnalysis());
updateWrapper.set("other_identification_notes", entrust.getOtherIdentificationNotes());
updateWrapper.set("avoid_identifier", entrust.getAvoidIdentifier(), "typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler");
updateWrapper.set("other_agreement", entrust.getOtherAgreement());
updateWrapper.set("comments", entrust.getComments());
updateWrapper.set("accept_user", entrustment.getAcceptUser());
updateWrapper.set("accept_time", entrustment.getAcceptTime());
updateWrapper.set("accept_comments", entrustment.getAcceptComments());
updateWrapper.set("accept_user", null); // 之前可能受理过, 现在后悔了, 置 null
updateWrapper.set("accept_time", null);
updateWrapper.set("accept_comments", entrust.getAcceptComments());
if (!this.update(null, updateWrapper)) {
@ -2367,7 +2326,8 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
@Override
@GlobalTransactional
public Entrustment bizAccept_Apply(Entrustment entrust, Integer opCode, DLPUser dlpUser) {
String newEntrustAcceptNo = "";
// 20250114 贵阳禁毒需求,受理编号在提交审核时就生成
// String newEntrustAcceptNo = "";
if (opCode == null) {
throw new RuntimeException(String.format("受理必须提供 opCode"));
}
@ -2436,15 +2396,15 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
}
}
//从检材中取出委托的受理号
String materialAcceptNo = imList.get(0).getAcceptNo();
// 3-26 如果是大数据平台同步的委托,那么我们在受理完成的时候先生成一个空的受理编号,最后在同步大数据平台信息的时候会把这个编号赋值过去
// newEntrustAcceptNo = materialAcceptNo.substring(0, materialAcceptNo.lastIndexOf("-"));
entrustmentIdentificationMaterialService.getNewIdentificationMaterialNo(newEntrustAcceptNo);
if (entrustment.getDataSources() != 1) {
newEntrustAcceptNo = materialAcceptNo.substring(0, materialAcceptNo.lastIndexOf("-"));
} else {
newEntrustAcceptNo = "acceptNo";
}
// String materialAcceptNo = imList.get(0).getAcceptNo(); 20250114
// // 3-26 如果是大数据平台同步的委托,那么我们在受理完成的时候先生成一个空的受理编号,最后在同步大数据平台信息的时候会把这个编号赋值过去
//// newEntrustAcceptNo = materialAcceptNo.substring(0, materialAcceptNo.lastIndexOf("-"));
// entrustmentIdentificationMaterialService.getNewIdentificationMaterialNo(newEntrustAcceptNo);
// if (entrustment.getDataSources() != 1) {
// newEntrustAcceptNo = materialAcceptNo.substring(0, materialAcceptNo.lastIndexOf("-"));
// } else {
// newEntrustAcceptNo = "acceptNo";
// }
}
int newStatus = ProcessFlowMapper.getNextStatus(entrustment.getStatus(), opCode);
@ -2513,12 +2473,12 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
entrustment.setProcessInfo(pis);
//上面注释的代码前面已经设置过,不需要再设置一次,直接更新
if (StringUtils.isNotBlank(newEntrustAcceptNo)) {
entrustment.setAcceptNo(newEntrustAcceptNo);//设置受理编号
}
if (!StringUtils.isNotBlank(newEntrustAcceptNo) && opCode == 1) {
throw new RuntimeException("受理编号不能为空");
}
// if (StringUtils.isNotBlank(newEntrustAcceptNo)) { 20250114
// entrustment.setAcceptNo(newEntrustAcceptNo);//设置受理编号
// }
// if (!StringUtils.isNotBlank(newEntrustAcceptNo) && opCode == 1) {
// throw new RuntimeException("受理编号不能为空");
// }
entrustment.setIsTrans(1);//如果是通过我们系统进行受理,就让他不能再手动流转了
if (!this.updateById(entrustment)) {
throw new RuntimeException("保存委托信息失败");
@ -2660,7 +2620,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
//如果文件不存在,则生成,否则直接从OSS中获取
//if (!ossFile.objectExist(pdfFilePath)) {
//这里加一个判断,由于贵阳市局的确认书需要在审核的时候就能打印出来,为了保证每一次生成的确认书都是委托单位提交过来的最新版,所以我们在审核通过之前,每一次生成委托书都应该重新生成,审核成功以后就不用再重新生成了
if (!ossFile.objectExist(downFile) || ev.getStatus() < EntrustmentStatusConstants.ENTRUSTMENT_STATUS_WAITING_CONFIRM.getStatus()) {
if (!ossFile.objectExist(downFile) || ev.getStatus() <= EntrustmentStatusConstants.ENTRUSTMENT_STATUS_WAITING_ACCEPT.getStatus()) {
if (this.generateIdentifyItemsBook(ev.getId())) {
ossFile.fileGet(downFile, httpServletResponse.getOutputStream());

@ -25,6 +25,9 @@ public class CaseEventVO extends CaseEvent {
int caseEvidenceCount;
List<CaseEvidence> caseEvidenceList;
@ApiModelProperty("受理编号")
private String acceptNo;
@ApiModelProperty(value="委托类型: 0=常规毒品, 1=生物样本")
private Integer entrustmentType;
}

@ -82,40 +82,29 @@
<select id="getCaseVoPage" resultType="digital.laboratory.platform.entrustment.vo.CaseEventVO">
SELECT cj.*,
org.name AS case_org_name,
org.alias AS case_org_short_name,
(
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id=cj.create_by
) AS case_create_user_name,
(
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id=cj.update_by
) AS case_update_user_name,
(
SELECT area.name
FROM dlp_base.b_area area
WHERE area.id=cj.case_area
) AS case_area_name,
(
SELECT COUNT(*)
FROM b_entrustment e
WHERE e.case_id=cj.id
) AS case_entrustment_count,
(
SELECT COUNT(*)
FROM b_case_evidence ce
WHERE ce.case_id=cj.id
) AS case_evidence_count
FROM b_case_event cj
LEFT JOIN dlp_base.sys_org org on org.org_id=cj.case_own_org_id
${ew.customSqlSegment}
SELECT cj.*,
org.name AS case_org_name,
org.alias AS case_org_short_name,
e.accept_no,
(SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id=cj.create_by
) AS case_create_user_name
, (
SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id=cj.update_by
) AS case_update_user_name
, (
SELECT area.name
FROM dlp_base.b_area area
WHERE area.id=cj.case_area
) AS case_area_name
FROM b_case_event cj
LEFT JOIN dlp_base.sys_org org ON org.org_id=cj.case_own_org_id
LEFT JOIN b_entrustment e ON cj.id=e.case_id
${ew.customSqlSegment}
</select>

Loading…
Cancel
Save