1.修改了打印委托书和确认书时,检材在未受理时的排序规则,从检材编号变为OrderNo。

2.修改了打印委托书和确认书的限制范围,现在应该是用户提交之后,审核人就可以在审核列表进行打印,并且每次打开都应该是重新生成,直到审核完成之后,就不会重新生成了。
3.删除检材之后,会重新生成鉴定要求
master
杨海航 2 months ago
parent b3efa0c2dc
commit 32bacff4cd
  1. 20
      src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentIdentificationMaterialServiceImpl.java
  2. 28
      src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentServiceImpl.java

@ -591,6 +591,7 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl<En
/**
* 更新检材是否审批通过
*
* @param identificationMaterial
* @param updateWrapper
* @param im
@ -1093,7 +1094,15 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl<En
if (attCount > 0) {
throw new RuntimeException(String.format("这个检材下有 %d 个附件, 必须先删除全部附件后才能删除检材物证!", attCount));
}
if (this.removeById(id)) {
String entrustId = entrustmentIdentificationMaterial.getEntrustmentId();
Entrustment entrustment = entrustmentService.getById(entrustId);
List<EntrustmentIdentificationMaterial> materialList = this.list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery().eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustId));
if (materialList != null && materialList.size() > 0) {
entrustment.setEntrustRequirement(entrustmentService.buildEntrustReq(materialList));
entrustmentService.updateById(entrustment);
}
return entrustmentIdentificationMaterial;
} else {
return null;
@ -1173,7 +1182,7 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl<En
@Override
@Transactional
public List<EntrustmentIdentificationMaterial> createNewIm(List<EntrustmentIdentificationMaterial> identificationMaterialList, DLPUser dlpUser) {
public List<EntrustmentIdentificationMaterial> createNewIm(List<EntrustmentIdentificationMaterial> identificationMaterialList, DLPUser dlpUser) {
Entrustment entrustment = entrustmentService.getById(identificationMaterialList.get(0).getEntrustmentId());
if (!dlpUser.isStaff() && entrustment.getStatus() != EntrustmentStatusConstants.ENTRUSTMENT_STATUS_CREATED.getStatus()) {
@ -1512,7 +1521,7 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl<En
Integer analysisOption = material.getAnalysisOption();
material.setQuantity(material.getQuantity().setScale(2, BigDecimal.ROUND_HALF_UP));
//2025-1-8日修改:在打印委托书或鉴定事项确认书时,将检测选项转换为中文名称后加上检测二字
material.setAnalysisOptionValue(AnalysisOptionEnums.fromCode(analysisOption).getChineseName()+"检测");
material.setAnalysisOptionValue(AnalysisOptionEnums.fromCode(analysisOption).getChineseName() + "检测");
material.setPrintDrawTime(LocalDateTimeUtil.format(material.getDrawTime(), "yyyy-MM-dd"));
List<DrugLite> candidateDrugs = material.getCandidateDrugs();
String drugsValue = "";
@ -1537,8 +1546,8 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl<En
* 将委托鉴定材料保存到第三方系统
*
* @param identificationMaterial 委托鉴定材料对象
* @param entrustment 委托对象
* @param id 材料唯一标识
* @param entrustment 委托对象
* @param id 材料唯一标识
*/
private void saveEntrustMaterialToThirdSys(EntrustmentIdentificationMaterial identificationMaterial, Entrustment entrustment, String id) {
EntrustOfThirdSys entrustOfThirdSys = synchronizeDataService.getOne(new LambdaQueryWrapper<EntrustOfThirdSys>().eq(EntrustOfThirdSys::getEntrustMainId, entrustment.getId()));
@ -1566,7 +1575,7 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl<En
* 设置委托鉴定材料的鉴定编号
*
* @param identificationMaterial 委托鉴定材料对象
* @param cj 案件事件对象
* @param cj 案件事件对象
*/
private void setMaterialIdentificationNo(EntrustmentIdentificationMaterial identificationMaterial, CaseEvent cj) {
if (StrUtil.isNotBlank(identificationMaterial.getEvidenceId())) {
@ -1582,6 +1591,7 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl<En
/**
* 校验案件信息是否合法
*
* @param identificationMaterial
* @return
*/

@ -443,7 +443,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
List<EntrustmentIdentificationMaterial> materialList = entrustmentIdentificationMaterialService.list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
.eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustId)
.orderByAsc(isAccepted != -1, EntrustmentIdentificationMaterial::getAcceptNo)
.orderByAsc(isAccepted == -1, EntrustmentIdentificationMaterial::getImNo));
.orderByAsc(isAccepted == -1, EntrustmentIdentificationMaterial::getOrderNo));
if (isAccepted != -1) {
// 受理过的才进行排序,否则采用检材编号排序
Collections.sort(materialList, new Comparator<EntrustmentIdentificationMaterial>() {
@ -497,7 +497,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
//构造委托部分需要的数据
dm.put("clientOrgName", entrustment.getClientOrgName());//委托单位
dm.put("identificationNo", entrustment.getAcceptNo());//受理编号
dm.put("year", entrustment.getEntrustmentTime().getYear());
dm.put("year", entrustment.getEntrustmentTime() != null ? entrustment.getEntrustmentTime().getYear() : LocalDate.now().getYear());
dm.put("materialDes", buildMaterialDes(materialList));//检材描述
dm.put("identifyReq", entrustment.getEntrustRequirement());//鉴定要求
@ -688,7 +688,9 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
eg.setAcceptNo(item.getAcceptNo());
eg.setIndexNo(item.getShortNameDes() + "检材");
eg.setMaterialName(item.getName());
eg.setFormName(StringUtils.isNotBlank(item.getColor()) ? item.getColor() + item.getFormName() : "" + item.getFormName());
// 先暂时去掉这个功能,他们可能
//eg.setFormName(StringUtils.isNotBlank(item.getColor()) ? item.getColor() + item.getFormName() : "" + item.getFormName());
eg.setFormName(item.getFormName());
eg.setSpecies(item.getTypeName());
eg.setPackComplete(item.getPackComplete());
eg.setDrugsValue(item.getDrugsValue());
@ -1893,7 +1895,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
}
if (entrustment.getStatus() != EntrustmentStatusConstants.ENTRUSTMENT_STATUS_WAITING_CONFIRM.getStatus()) {
throw new RuntimeException("委托不在待送检确认状态");
return null;
}
if (!dlpUser.isStaff()) {
@ -2117,7 +2119,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)) {
//这里加一下判断条件,由于贵阳市局这里的情况是审核的时候就需要查看委托书,所以为了保证每一次提交过来的委托都是最新的,所以在审核通过以前应该每次查看都是重新生成
if (!ossFile.objectExist(pdfFilePath) || ev.getStatus() < EntrustmentStatusConstants.ENTRUSTMENT_STATUS_WAITING_CONFIRM.getStatus()) {
GenerateEntrustmentLetterPDF(ev);
return pdfFilePath;
}
@ -2144,8 +2147,8 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
throw new RuntimeException(String.format("没有找到 id 为 %s 的委托", id));
}
if (ev.getStatus() < EntrustmentStatusConstants.ENTRUSTMENT_STATUS_WAITING_DELIVER.getStatus()) {
throw new RuntimeException("委托状态必须在[待送检]及之后才能打印鉴定委托书");
if (ev.getStatus() < EntrustmentStatusConstants.ENTRUSTMENT_STATUS_CREATED.getStatus()) {
throw new RuntimeException("委托状态必须在委托创建之后才能打印鉴定委托书");
}
if (!dlpUser.isStaff()) {
@ -2213,7 +2216,7 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
List<EntrustmentIdentificationMaterial> materialList = entrustmentIdentificationMaterialService.list(
Wrappers.<EntrustmentIdentificationMaterial>query()
.eq("entrustment_id", ev.getId())
.orderByAsc("create_time")
.orderByAsc("order_no")
);
entrustmentIdentificationMaterialService.conformityDrugs(materialList);
//设置检材描述
@ -2624,9 +2627,9 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
}
// 正在受理和已受理这2个状态下可以打印
if (ev.getStatus() != EntrustmentStatusConstants.ENTRUSTMENT_STATUS_WAITING_ACCEPT.getStatus() &&
ev.getStatus() != EntrustmentStatusConstants.ENTRUSTMENT_STATUS_ACCEPTED.getStatus()) {
throw new RuntimeException("委托不在[受理中]或[已受理]状态");
//这里再次修改一下,以前是待受理和已受理两个状态才能生成,由于贵阳市局这里的情况是需要在审核的时候查看确认书,所以如果状态是在委托提交以前我们才不允许生成
if (ev.getStatus() < EntrustmentStatusConstants.ENTRUSTMENT_STATUS_WAITING_CHECK_CLAIM.getStatus()) {
throw new RuntimeException("委托不在可以生成确认书的状态");
}
// if (!StrUtil.equalsIgnoreCase(ev.getClientOrgId(), dlpUser.getOrgId())) {
@ -2647,7 +2650,8 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
try {
//如果文件不存在,则生成,否则直接从OSS中获取
//if (!ossFile.objectExist(pdfFilePath)) {
if (!ossFile.objectExist(downFile)) {
//这里加一个判断,由于贵阳市局的确认书需要在审核的时候就能打印出来,为了保证每一次生成的确认书都是委托单位提交过来的最新版,所以我们在审核通过之前,每一次生成委托书都应该重新生成,审核成功以后就不用再重新生成了
if (!ossFile.objectExist(downFile) || ev.getStatus() < EntrustmentStatusConstants.ENTRUSTMENT_STATUS_WAITING_CONFIRM.getStatus()) {
if (this.generateIdentifyItemsBook(ev.getId())) {
ossFile.fileGet(downFile, httpServletResponse.getOutputStream());

Loading…
Cancel
Save