|
|
|
@ -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));//检材描述
|
|
|
|
@ -1364,17 +1370,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 +1402,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 +1425,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 +1457,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)); |
|
|
|
@ -2184,6 +2194,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) { |
|
|
|
|