20250715 更新
1.添加允许修改嫌疑人参数
This commit is contained in:
+4
@@ -1,6 +1,7 @@
|
|||||||
package digital.laboratory.platform.entrustment.dto;
|
package digital.laboratory.platform.entrustment.dto;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import digital.laboratory.platform.entrustment.entity.Suspect;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -37,6 +38,9 @@ public class ApprovedUpdateEntrustDTO {
|
|||||||
@ApiModelProperty(value = "委托检材列表")
|
@ApiModelProperty(value = "委托检材列表")
|
||||||
private List<MaterialDTO> materialList;
|
private List<MaterialDTO> materialList;
|
||||||
|
|
||||||
|
@ApiModelProperty("嫌疑人信息")
|
||||||
|
private List<Suspect> suspectList;
|
||||||
|
|
||||||
@ApiModelProperty(value = "案发时间")
|
@ApiModelProperty(value = "案发时间")
|
||||||
private LocalDateTime happenTime;
|
private LocalDateTime happenTime;
|
||||||
|
|
||||||
|
|||||||
+50
-42
@@ -20,7 +20,6 @@ import digital.laboratory.platform.entrustment.dto.EntrustAlterApplyDTO;
|
|||||||
import digital.laboratory.platform.entrustment.dto.MaterialDTO;
|
import digital.laboratory.platform.entrustment.dto.MaterialDTO;
|
||||||
import digital.laboratory.platform.entrustment.entity.CaseEvent;
|
import digital.laboratory.platform.entrustment.entity.CaseEvent;
|
||||||
import digital.laboratory.platform.entrustment.entity.EntrustAlterApply;
|
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.entity.EntrustmentIdentificationMaterial;
|
||||||
import digital.laboratory.platform.entrustment.enums.AnalysisOptionEnums;
|
import digital.laboratory.platform.entrustment.enums.AnalysisOptionEnums;
|
||||||
import digital.laboratory.platform.entrustment.enums.EntrustAlterApplyStatus;
|
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.EntrustmentIdentificationMaterialService;
|
||||||
import digital.laboratory.platform.entrustment.service.EntrustmentService;
|
import digital.laboratory.platform.entrustment.service.EntrustmentService;
|
||||||
import digital.laboratory.platform.entrustment.vo.EntrustAlterApplyVO;
|
import digital.laboratory.platform.entrustment.vo.EntrustAlterApplyVO;
|
||||||
|
import digital.laboratory.platform.entrustment.vo.EntrustmentVO;
|
||||||
import digital.laboratory.platform.sys.entity.DrugLite;
|
import digital.laboratory.platform.sys.entity.DrugLite;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -214,11 +214,11 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean updateEntrust(ApprovedUpdateEntrustDTO dto) {
|
public Boolean updateEntrust(ApprovedUpdateEntrustDTO dto) {
|
||||||
StringBuilder updateRecordBuilder = new StringBuilder(); // 更新记录
|
StringBuilder updateRecordBuilder = new StringBuilder(); // 更新记录
|
||||||
Entrustment entrustment = validUpdateInfoAndGetEntrustInfo(dto, updateRecordBuilder);
|
EntrustmentVO entrustVO = validUpdateInfoAndGetEntrustInfo(dto, updateRecordBuilder);
|
||||||
// 提取委托id
|
// 提取委托id
|
||||||
String entrustId = entrustment.getId();
|
String entrustId = entrustVO.getId();
|
||||||
CaseEvent oldCaseInfo = caseEventService.getById(entrustment.getCaseId());
|
CaseEvent oldCaseInfo = caseEventService.getById(entrustVO.getCaseId());
|
||||||
caseEventService.update(Wrappers.<CaseEvent>lambdaUpdate().eq(CaseEvent::getId, entrustment.getCaseId())
|
caseEventService.update(Wrappers.<CaseEvent>lambdaUpdate().eq(CaseEvent::getId, entrustVO.getCaseId())
|
||||||
.set(CaseEvent::getCaseBrief, dto.getCaseBrief())
|
.set(CaseEvent::getCaseBrief, dto.getCaseBrief())
|
||||||
.set(CaseEvent::getCaseName, dto.getCaseName())
|
.set(CaseEvent::getCaseName, dto.getCaseName())
|
||||||
.set(CaseEvent::getHappenTime, dto.getHappenTime())
|
.set(CaseEvent::getHappenTime, dto.getHappenTime())
|
||||||
@@ -228,42 +228,34 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
|
|
||||||
boolean isTypeName = false;
|
boolean isTypeName = false;
|
||||||
if (!oldCaseInfo.getCaseBrief().equals(dto.getCaseBrief())) {
|
if (!oldCaseInfo.getCaseBrief().equals(dto.getCaseBrief())) {
|
||||||
opDate = LocalDateTime.now();
|
opDate = initUpdateRecordInfo(opDate, updateRecordBuilder);
|
||||||
updateRecordBuilder.append(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("<br>案件更新记录:");
|
|
||||||
updateRecordBuilder.append("<br>该委托案件的案件简要由 [").append(oldCaseInfo.getCaseBrief()).append("] 更改为 [").append(dto.getCaseBrief()).append("] 。");
|
updateRecordBuilder.append("<br>该委托案件的案件简要由 [").append(oldCaseInfo.getCaseBrief()).append("] 更改为 [").append(dto.getCaseBrief()).append("] 。");
|
||||||
}
|
}
|
||||||
if (!oldCaseInfo.getCaseName().equals(dto.getCaseName())) {
|
if (!oldCaseInfo.getCaseName().equals(dto.getCaseName())) {
|
||||||
if (opDate == null) {
|
opDate = initUpdateRecordInfo(opDate, updateRecordBuilder);
|
||||||
opDate = LocalDateTime.now();
|
|
||||||
updateRecordBuilder.append(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("<br>案件更新记录:");
|
|
||||||
}
|
|
||||||
updateRecordBuilder.append("<br>该委托案件的案件名称由 [").append(oldCaseInfo.getCaseName()).append("] 更改为 [").append(dto.getCaseName()).append("] 。");
|
updateRecordBuilder.append("<br>该委托案件的案件名称由 [").append(oldCaseInfo.getCaseName()).append("] 更改为 [").append(dto.getCaseName()).append("] 。");
|
||||||
}
|
}
|
||||||
if (dto.getHappenTime() != null && !oldCaseInfo.getHappenTime().equals(dto.getHappenTime().toLocalDate())) {
|
if (dto.getHappenTime() != null && !oldCaseInfo.getHappenTime().equals(dto.getHappenTime().toLocalDate())) {
|
||||||
if (opDate == null) {
|
opDate = initUpdateRecordInfo(opDate, updateRecordBuilder);
|
||||||
opDate = LocalDateTime.now();
|
|
||||||
updateRecordBuilder.append(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("<br>案件更新记录:");
|
|
||||||
}
|
|
||||||
updateRecordBuilder.append("<br>该委托案件的案发时间由 [").append(oldCaseInfo.getHappenTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).append("] 更改为 [").append(dto.getHappenTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).append("] 。");
|
updateRecordBuilder.append("<br>该委托案件的案发时间由 [").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 (dto.getEntrustmentTime() != null && entrustVO.getEntrustmentTime().equals(dto.getEntrustmentTime())) {
|
||||||
if (opDate == null) {
|
opDate = initUpdateRecordInfo(opDate, updateRecordBuilder);
|
||||||
opDate = LocalDateTime.now();
|
updateRecordBuilder.append("<br>该委托案件的委托时间由 [").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("] 。");
|
||||||
updateRecordBuilder.append(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("<br>案件更新记录:");
|
|
||||||
}
|
|
||||||
updateRecordBuilder.append("<br>该委托案件的委托时间由 [").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("] 。");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
isTypeName = true;
|
||||||
entrustment.setEntrustmentType(dto.getEntrustmentType());
|
entrustVO.setEntrustmentType(dto.getEntrustmentType());
|
||||||
if (opDate == null) {
|
opDate = initUpdateRecordInfo(opDate, updateRecordBuilder);
|
||||||
opDate = LocalDateTime.now();
|
updateRecordBuilder.append("<br>该委托案件的委托类型由 [").append(entrustVO.getEntrustmentType() == 0 ? "常规毒品" : "生物样本").append("] 更改为 [").append(dto.getEntrustmentType() == 0 ? "常规毒品" : "生物样本").append("] 。");
|
||||||
updateRecordBuilder.append(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("<br>案件更新记录:");
|
}
|
||||||
}
|
|
||||||
updateRecordBuilder.append("<br>该委托案件的委托类型由 [").append(entrustment.getEntrustmentType() == 0 ? "常规毒品" : "生物样本").append("] 更改为 [").append(dto.getEntrustmentType() == 0 ? "常规毒品" : "生物样本").append("] 。");
|
// 更新嫌疑人信息
|
||||||
|
if (CollUtil.isNotEmpty(dto.getSuspectList())) {
|
||||||
|
|
||||||
}
|
}
|
||||||
// 2.修改检材 信息
|
// 2.修改检材 信息
|
||||||
// 这里之所以要取未更新前的信息是为了留痕
|
// 这里之所以要取未更新前的信息是为了留痕
|
||||||
@@ -282,17 +274,33 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
entrustmentIdentificationMaterialService.updateBatchById(entrustmentIdentificationMaterialList);
|
entrustmentIdentificationMaterialService.updateBatchById(entrustmentIdentificationMaterialList);
|
||||||
// 3. 更新委托鉴定要求和委托时间
|
// 3. 更新委托鉴定要求和委托时间
|
||||||
|
|
||||||
updateEntrustmentRequirement(entrustment, dto.getEntrustRequirement(), updateRecordBuilder, opDate);
|
updateEntrustmentRequirement(entrustVO, dto.getEntrustRequirement(), updateRecordBuilder, opDate);
|
||||||
// 如果确认完成,则删除鉴定事项确认书和委托书,并更新申请状态为已完成
|
// 如果确认完成,则删除鉴定事项确认书和委托书,并更新申请状态为已完成
|
||||||
if (dto.getFinished()) {
|
if (dto.getFinished()) {
|
||||||
// 4.删除鉴定事项确认书和委托书
|
// 4.删除鉴定事项确认书和委托书
|
||||||
deleteConfirmEntrustLetter(entrustment.getEntrustmentNo(), entrustId);
|
deleteConfirmEntrustLetter(entrustVO.getEntrustmentNo(), entrustId);
|
||||||
}
|
}
|
||||||
return super.update(Wrappers.<EntrustAlterApply>lambdaUpdate().eq(EntrustAlterApply::getId, dto.getId())
|
return super.update(Wrappers.<EntrustAlterApply>lambdaUpdate().eq(EntrustAlterApply::getId, dto.getId())
|
||||||
.set(EntrustAlterApply::getUpdateRecord, updateRecordBuilder.toString())
|
.set(EntrustAlterApply::getUpdateRecord, updateRecordBuilder.toString())
|
||||||
.set(dto.getFinished(), EntrustAlterApply::getStatus, EntrustAlterApplyStatus.FINISHED.getStatus()));
|
.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("<br>案件更新记录:");
|
||||||
|
}
|
||||||
|
return opDate;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理更新委托鉴定检材信息
|
* 处理更新委托鉴定检材信息
|
||||||
*
|
*
|
||||||
@@ -490,27 +498,27 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
/**
|
/**
|
||||||
* 更新鉴定要求
|
* 更新鉴定要求
|
||||||
*
|
*
|
||||||
* @param entrustment
|
* @param entrustVO
|
||||||
* @param entrustRequirement
|
* @param entrustRequirement
|
||||||
* @param updateRecordBuilder
|
* @param updateRecordBuilder
|
||||||
* @param opDate
|
* @param opDate
|
||||||
*/
|
*/
|
||||||
public void updateEntrustmentRequirement(Entrustment entrustment, String entrustRequirement, StringBuilder updateRecordBuilder, LocalDateTime opDate) {
|
public void updateEntrustmentRequirement(EntrustmentVO entrustVO, String entrustRequirement, StringBuilder updateRecordBuilder, LocalDateTime opDate) {
|
||||||
if (StrUtil.isNotBlank(entrustRequirement) && !entrustment.getEntrustRequirement().equals(entrustRequirement)) {
|
if (StrUtil.isNotBlank(entrustRequirement) && !entrustVO.getEntrustRequirement().equals(entrustRequirement)) {
|
||||||
if (opDate == null) {
|
if (opDate == null) {
|
||||||
// 等于null 证明前面的信息并没有修改
|
// 等于null 证明前面的信息并没有修改
|
||||||
opDate = LocalDateTime.now();
|
opDate = LocalDateTime.now();
|
||||||
updateRecordBuilder.append(opDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
updateRecordBuilder.append(opDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||||
}
|
}
|
||||||
updateRecordBuilder.append("<br>鉴定要求更新记录:").append("<br>原鉴定要求 [").append(entrustment.getEntrustRequirement()).append("] 修改为 [").append(entrustRequirement).append("]。");
|
updateRecordBuilder.append("<br>鉴定要求更新记录:").append("<br>原鉴定要求 [").append(entrustVO.getEntrustRequirement()).append("] 修改为 [").append(entrustRequirement).append("]。");
|
||||||
} else {
|
} else {
|
||||||
List<EntrustmentIdentificationMaterial> renewList = entrustmentIdentificationMaterialService.list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
|
List<EntrustmentIdentificationMaterial> renewList = entrustmentIdentificationMaterialService.list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
|
||||||
.eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustment.getId())
|
.eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustVO.getId())
|
||||||
.orderByAsc(EntrustmentIdentificationMaterial::getOrderNo));
|
.orderByAsc(EntrustmentIdentificationMaterial::getOrderNo));
|
||||||
entrustRequirement = entrustmentService.buildEntrustReq(renewList);
|
entrustRequirement = entrustmentService.buildEntrustReq(renewList);
|
||||||
}
|
}
|
||||||
entrustment.setEntrustRequirement(entrustRequirement);
|
entrustVO.setEntrustRequirement(entrustRequirement);
|
||||||
entrustmentService.updateById(entrustment);
|
entrustmentService.updateById(entrustVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -546,7 +554,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
* @param updateRecordBuilder 初始化
|
* @param updateRecordBuilder 初始化
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Entrustment validUpdateInfoAndGetEntrustInfo(ApprovedUpdateEntrustDTO dto, StringBuilder updateRecordBuilder) {
|
private EntrustmentVO validUpdateInfoAndGetEntrustInfo(ApprovedUpdateEntrustDTO dto, StringBuilder updateRecordBuilder) {
|
||||||
// 判断当前申请状态是否审核通过
|
// 判断当前申请状态是否审核通过
|
||||||
EntrustAlterApply entrustAlterApply = super.getById(dto.getId());
|
EntrustAlterApply entrustAlterApply = super.getById(dto.getId());
|
||||||
if (entrustAlterApply == null) {
|
if (entrustAlterApply == null) {
|
||||||
@@ -561,14 +569,14 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
}
|
}
|
||||||
// 状态合法,开始修改委托信息
|
// 状态合法,开始修改委托信息
|
||||||
// 1. 修改委托案件简要
|
// 1. 修改委托案件简要
|
||||||
Entrustment entrustment = entrustmentService.getById(dto.getEntrustId());
|
EntrustmentVO entrustVO = entrustmentService.getEntrustmentVOById(dto.getEntrustId());
|
||||||
if (entrustment == null) {
|
if (entrustVO == null) {
|
||||||
throw new ValidateCodeException("修改的委托记录不存在!");
|
throw new ValidateCodeException("修改的委托记录不存在!");
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(entrustAlterApply.getUpdateRecord())) {
|
if (StrUtil.isNotBlank(entrustAlterApply.getUpdateRecord())) {
|
||||||
updateRecordBuilder.append(entrustAlterApply.getUpdateRecord()).append("<br>");
|
updateRecordBuilder.append(entrustAlterApply.getUpdateRecord()).append("<br>");
|
||||||
}
|
}
|
||||||
return entrustment;
|
return entrustVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user