From 332d8104e4650b505bbde0cb85f1e4762a2e19b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B5=B7=E8=88=AA?= <11918452+yang-haihang@user.noreply.gitee.com> Date: Tue, 15 Jul 2025 09:50:56 +0800 Subject: [PATCH] =?UTF-8?q?20250715=20=E6=9B=B4=E6=96=B0=201.=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=85=81=E8=AE=B8=E4=BF=AE=E6=94=B9=E5=AB=8C=E7=96=91?= =?UTF-8?q?=E4=BA=BA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/ApprovedUpdateEntrustDTO.java | 4 + .../impl/EntrustAlterApplyServiceImpl.java | 92 ++++++++++--------- 2 files changed, 54 insertions(+), 42 deletions(-) diff --git a/src/main/java/digital/laboratory/platform/entrustment/dto/ApprovedUpdateEntrustDTO.java b/src/main/java/digital/laboratory/platform/entrustment/dto/ApprovedUpdateEntrustDTO.java index fb3d95a..8373ae5 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/dto/ApprovedUpdateEntrustDTO.java +++ b/src/main/java/digital/laboratory/platform/entrustment/dto/ApprovedUpdateEntrustDTO.java @@ -1,6 +1,7 @@ package digital.laboratory.platform.entrustment.dto; import com.fasterxml.jackson.annotation.JsonFormat; +import digital.laboratory.platform.entrustment.entity.Suspect; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -37,6 +38,9 @@ public class ApprovedUpdateEntrustDTO { @ApiModelProperty(value = "委托检材列表") private List materialList; + @ApiModelProperty("嫌疑人信息") + private List suspectList; + @ApiModelProperty(value = "案发时间") private LocalDateTime happenTime; diff --git a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustAlterApplyServiceImpl.java b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustAlterApplyServiceImpl.java index 0c37276..605a7c7 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustAlterApplyServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustAlterApplyServiceImpl.java @@ -20,7 +20,6 @@ import digital.laboratory.platform.entrustment.dto.EntrustAlterApplyDTO; import digital.laboratory.platform.entrustment.dto.MaterialDTO; import digital.laboratory.platform.entrustment.entity.CaseEvent; import digital.laboratory.platform.entrustment.entity.EntrustAlterApply; -import digital.laboratory.platform.entrustment.entity.Entrustment; import digital.laboratory.platform.entrustment.entity.EntrustmentIdentificationMaterial; import digital.laboratory.platform.entrustment.enums.AnalysisOptionEnums; import digital.laboratory.platform.entrustment.enums.EntrustAlterApplyStatus; @@ -31,6 +30,7 @@ import digital.laboratory.platform.entrustment.service.EntrustAlterApplyService; import digital.laboratory.platform.entrustment.service.EntrustmentIdentificationMaterialService; import digital.laboratory.platform.entrustment.service.EntrustmentService; import digital.laboratory.platform.entrustment.vo.EntrustAlterApplyVO; +import digital.laboratory.platform.entrustment.vo.EntrustmentVO; import digital.laboratory.platform.sys.entity.DrugLite; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -214,11 +214,11 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpllambdaUpdate().eq(CaseEvent::getId, entrustment.getCaseId()) + String entrustId = entrustVO.getId(); + CaseEvent oldCaseInfo = caseEventService.getById(entrustVO.getCaseId()); + caseEventService.update(Wrappers.lambdaUpdate().eq(CaseEvent::getId, entrustVO.getCaseId()) .set(CaseEvent::getCaseBrief, dto.getCaseBrief()) .set(CaseEvent::getCaseName, dto.getCaseName()) .set(CaseEvent::getHappenTime, dto.getHappenTime()) @@ -228,42 +228,34 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl案件更新记录:"); + opDate = initUpdateRecordInfo(opDate, updateRecordBuilder); updateRecordBuilder.append("
该委托案件的案件简要由 [").append(oldCaseInfo.getCaseBrief()).append("] 更改为 [").append(dto.getCaseBrief()).append("] 。"); } if (!oldCaseInfo.getCaseName().equals(dto.getCaseName())) { - if (opDate == null) { - opDate = LocalDateTime.now(); - updateRecordBuilder.append(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("
案件更新记录:"); - } + opDate = initUpdateRecordInfo(opDate, updateRecordBuilder); updateRecordBuilder.append("
该委托案件的案件名称由 [").append(oldCaseInfo.getCaseName()).append("] 更改为 [").append(dto.getCaseName()).append("] 。"); } if (dto.getHappenTime() != null && !oldCaseInfo.getHappenTime().equals(dto.getHappenTime().toLocalDate())) { - if (opDate == null) { - opDate = LocalDateTime.now(); - updateRecordBuilder.append(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("
案件更新记录:"); - } + opDate = initUpdateRecordInfo(opDate, updateRecordBuilder); updateRecordBuilder.append("
该委托案件的案发时间由 [").append(oldCaseInfo.getHappenTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).append("] 更改为 [").append(dto.getHappenTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).append("] 。"); } - if (dto.getEntrustmentTime() != null && entrustment.getEntrustmentTime().equals(dto.getEntrustmentTime())) { - if (opDate == null) { - opDate = LocalDateTime.now(); - updateRecordBuilder.append(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("
案件更新记录:"); - } - updateRecordBuilder.append("
该委托案件的委托时间由 [").append(entrustment.getEntrustmentTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("] 更改为 [").append(dto.getEntrustmentTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("] 。"); + if (dto.getEntrustmentTime() != null && entrustVO.getEntrustmentTime().equals(dto.getEntrustmentTime())) { + opDate = initUpdateRecordInfo(opDate, updateRecordBuilder); + updateRecordBuilder.append("
该委托案件的委托时间由 [").append(entrustVO.getEntrustmentTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("] 更改为 [").append(dto.getEntrustmentTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("] 。"); } - entrustment.setEntrustmentTime(dto.getEntrustmentTime()); // 修改委托时间 + entrustVO.setEntrustmentTime(dto.getEntrustmentTime()); // 修改委托时间 - if (dto.getEntrustmentType() != null && dto.getEntrustmentType() != entrustment.getEntrustmentType()) { + if (dto.getEntrustmentType() != null && dto.getEntrustmentType() != entrustVO.getEntrustmentType()) { isTypeName = true; - entrustment.setEntrustmentType(dto.getEntrustmentType()); - if (opDate == null) { - opDate = LocalDateTime.now(); - updateRecordBuilder.append(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("
案件更新记录:"); - } - updateRecordBuilder.append("
该委托案件的委托类型由 [").append(entrustment.getEntrustmentType() == 0 ? "常规毒品" : "生物样本").append("] 更改为 [").append(dto.getEntrustmentType() == 0 ? "常规毒品" : "生物样本").append("] 。"); + entrustVO.setEntrustmentType(dto.getEntrustmentType()); + opDate = initUpdateRecordInfo(opDate, updateRecordBuilder); + updateRecordBuilder.append("
该委托案件的委托类型由 [").append(entrustVO.getEntrustmentType() == 0 ? "常规毒品" : "生物样本").append("] 更改为 [").append(dto.getEntrustmentType() == 0 ? "常规毒品" : "生物样本").append("] 。"); + } + + // 更新嫌疑人信息 + if (CollUtil.isNotEmpty(dto.getSuspectList())) { + } // 2.修改检材 信息 // 这里之所以要取未更新前的信息是为了留痕 @@ -282,17 +274,33 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpllambdaUpdate().eq(EntrustAlterApply::getId, dto.getId()) .set(EntrustAlterApply::getUpdateRecord, updateRecordBuilder.toString()) .set(dto.getFinished(), EntrustAlterApply::getStatus, EntrustAlterApplyStatus.FINISHED.getStatus())); } + /** + * 初始化更新记录信息的方法 + * 此方法主要用于当操作日期为空时,初始化操作日期为当前时间,并更新记录信息 + * + * @param opDate 操作日期,可能为null + * @param updateRecordBuilder 更新记录的字符串构建器,用于累积更新记录信息 + * @return 返回初始化或更新后的操作日期 + */ + private LocalDateTime initUpdateRecordInfo(LocalDateTime opDate, StringBuilder updateRecordBuilder) { + if (opDate == null) { + opDate = LocalDateTime.now(); + updateRecordBuilder.append(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("
案件更新记录:"); + } + return opDate; + } + /** * 处理更新委托鉴定检材信息 * @@ -490,27 +498,27 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl鉴定要求更新记录:").append("
原鉴定要求 [").append(entrustment.getEntrustRequirement()).append("] 修改为 [").append(entrustRequirement).append("]。"); + updateRecordBuilder.append("
鉴定要求更新记录:").append("
原鉴定要求 [").append(entrustVO.getEntrustRequirement()).append("] 修改为 [").append(entrustRequirement).append("]。"); } else { List renewList = entrustmentIdentificationMaterialService.list(Wrappers.lambdaQuery() - .eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustment.getId()) + .eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustVO.getId()) .orderByAsc(EntrustmentIdentificationMaterial::getOrderNo)); entrustRequirement = entrustmentService.buildEntrustReq(renewList); } - entrustment.setEntrustRequirement(entrustRequirement); - entrustmentService.updateById(entrustment); + entrustVO.setEntrustRequirement(entrustRequirement); + entrustmentService.updateById(entrustVO); } /** @@ -546,7 +554,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl"); } - return entrustment; + return entrustVO; } /**