添加了委托申请修改时可以修改的内容,并更正了修改记录,添加了送检时预览PDF版本鉴定委托书与鉴定事项确认书的接口
This commit is contained in:
@@ -2395,4 +2395,17 @@ public class EntrustmentController {
|
|||||||
Entrustment entrustment = entrustmentService.getById(id);
|
Entrustment entrustment = entrustmentService.getById(id);
|
||||||
return R.ok(entrustment);
|
return R.ok(entrustment);
|
||||||
}
|
}
|
||||||
|
@ApiOperation("预览鉴定事项确认书,只在送检单位填写完委托与检材后才能进行预览")
|
||||||
|
@GetMapping("/previewEntrustLetterPDF")
|
||||||
|
|
||||||
|
public void previewEntrustLetterPDF(String entrustId, HttpServletResponse servletResponse) throws Exception {
|
||||||
|
entrustmentService.previewEntrustLetterPDF(entrustId, servletResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("预览鉴定委托书,只在送检单位填写完委托与检材后才能进行预览")
|
||||||
|
@GetMapping("/previewEntrustPDF")
|
||||||
|
public void previewEntrustPDF(String entrustId, HttpServletResponse servletResponse) throws Exception {
|
||||||
|
entrustmentService.previewEntrustPDF(entrustId, servletResponse);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ public class ApprovedUpdateEntrustDTO {
|
|||||||
@ApiModelProperty(value = "委托检材列表")
|
@ApiModelProperty(value = "委托检材列表")
|
||||||
private List<MaterialDTO> materialList;
|
private List<MaterialDTO> materialList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "案发时间")
|
||||||
|
private LocalDateTime happenTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "委托类型,0:常规毒品,1:生物样本")
|
||||||
|
private Integer entrustmentType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否完成, true:已完成(标记该申请已完成,该申请将不在允许修改), false:未完成(不改变状态)")
|
@ApiModelProperty(value = "是否完成, true:已完成(标记该申请已完成,该申请将不在允许修改), false:未完成(不改变状态)")
|
||||||
private Boolean finished;
|
private Boolean finished;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
package digital.laboratory.platform.entrustment.dto;
|
package digital.laboratory.platform.entrustment.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import digital.laboratory.platform.entrustment.json.DynamicBigDecimalSerializer;
|
||||||
import digital.laboratory.platform.sys.entity.DrugLite;
|
import digital.laboratory.platform.sys.entity.DrugLite;
|
||||||
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;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
// 使用内部类MaterialDTO
|
// 使用内部类MaterialDTO
|
||||||
@@ -23,4 +27,32 @@ public class MaterialDTO {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "候选毒品列表(drug 对象的 json array)")
|
@ApiModelProperty(value = "候选毒品列表(drug 对象的 json array)")
|
||||||
private List<DrugLite> candidateDrugs;
|
private List<DrugLite> candidateDrugs;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "检材性状")
|
||||||
|
private String form;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "留存样个数--贵阳新增需求")
|
||||||
|
private Integer rtSampleQuantity;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "检材数量, 例如 3.8 克 或 4.5毫升")
|
||||||
|
@JsonSerialize(using = DynamicBigDecimalSerializer.class)
|
||||||
|
private BigDecimal quantity;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "计量单位, 例如 3.8 克 或 4.5毫升")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "提取时间--贵阳新增需求")
|
||||||
|
private LocalDateTime drawTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "提取地点--贵阳新增需求")
|
||||||
|
private String drawPlace;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "检材年龄,用于后续统计各年龄阶段的数据--贵阳新增需求")
|
||||||
|
private Integer materialAge;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "性别,针对生物样本检材")
|
||||||
|
private String biologyGender;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "检材类别")
|
||||||
|
private String typeName;
|
||||||
}
|
}
|
||||||
@@ -216,4 +216,8 @@ public interface EntrustmentService extends IService<Entrustment> {
|
|||||||
Boolean isEligibleForSubmission(String entrustId, Integer materialCount);
|
Boolean isEligibleForSubmission(String entrustId, Integer materialCount);
|
||||||
|
|
||||||
List<Deliverer> getDelivererList(DLPUser dlpUser);
|
List<Deliverer> getDelivererList(DLPUser dlpUser);
|
||||||
|
|
||||||
|
void previewEntrustLetterPDF(String entrustId, HttpServletResponse servletResponse) throws Exception;
|
||||||
|
|
||||||
|
void previewEntrustPDF(String entrustId, HttpServletResponse servletResponse) throws Exception;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package digital.laboratory.platform.entrustment.service.impl;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -35,6 +36,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@@ -81,6 +84,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存消息
|
* 保存消息
|
||||||
|
*
|
||||||
* @param dto 保存的参数
|
* @param dto 保存的参数
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -91,7 +95,6 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
if (isApplying(dto.getEntrustId())) {
|
if (isApplying(dto.getEntrustId())) {
|
||||||
throw new ValidateCodeException("该委托存在未完成的申请信息,请先完成其他申请后再进行申请修改!");
|
throw new ValidateCodeException("该委托存在未完成的申请信息,请先完成其他申请后再进行申请修改!");
|
||||||
}
|
}
|
||||||
|
|
||||||
EntrustAlterApply entrustAlterApply = new EntrustAlterApply();
|
EntrustAlterApply entrustAlterApply = new EntrustAlterApply();
|
||||||
if (StrUtil.isBlank(dto.getId())) {
|
if (StrUtil.isBlank(dto.getId())) {
|
||||||
entrustAlterApply.setEntrustId(dto.getEntrustId());
|
entrustAlterApply.setEntrustId(dto.getEntrustId());
|
||||||
@@ -121,6 +124,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 审批委托申请修改
|
* 审批委托申请修改
|
||||||
|
*
|
||||||
* @param approveDTO
|
* @param approveDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -155,6 +159,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改消息
|
* 修改消息
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -180,6 +185,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除委托申请修改消息
|
* 删除委托申请修改消息
|
||||||
|
*
|
||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -200,6 +206,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改委托案件简要、鉴定要求, 并删除已生成的鉴定事项确认书和委托书
|
* 修改委托案件简要、鉴定要求, 并删除已生成的鉴定事项确认书和委托书
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -214,12 +221,49 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
caseEventService.update(Wrappers.<CaseEvent>lambdaUpdate().eq(CaseEvent::getId, entrustment.getCaseId())
|
caseEventService.update(Wrappers.<CaseEvent>lambdaUpdate().eq(CaseEvent::getId, entrustment.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())
|
||||||
);
|
);
|
||||||
// 添加更新记录 | <br> 代表换行
|
// 添加更新记录 | <br> 代表换行
|
||||||
LocalDateTime opDate = null; // 操作的时间,这里也用来标识是否有更新
|
LocalDateTime opDate = null; // 操作的时间,这里也用来标识是否有更新
|
||||||
|
|
||||||
|
boolean isTypeName = false;
|
||||||
if (!oldCaseInfo.getCaseBrief().equals(dto.getCaseBrief())) {
|
if (!oldCaseInfo.getCaseBrief().equals(dto.getCaseBrief())) {
|
||||||
opDate = LocalDateTime.now();
|
opDate = LocalDateTime.now();
|
||||||
updateRecordBuilder.append(opDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).append("<br>案件更新记录:").append("<br>该委托案件的案件简要由 [").append(oldCaseInfo.getCaseBrief()).append("] 更改为 [").append(dto.getCaseBrief()).append("] 。");
|
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("] 。");
|
||||||
|
}
|
||||||
|
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("<br>案件更新记录:");
|
||||||
|
}
|
||||||
|
updateRecordBuilder.append("<br>该委托案件的案件名称由 [").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("<br>案件更新记录:");
|
||||||
|
}
|
||||||
|
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 (opDate == null) {
|
||||||
|
opDate = LocalDateTime.now();
|
||||||
|
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()); // 修改委托时间
|
||||||
|
|
||||||
|
if (dto.getEntrustmentType() != null && dto.getEntrustmentType() != entrustment.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("<br>案件更新记录:");
|
||||||
|
}
|
||||||
|
updateRecordBuilder.append("<br>该委托案件的委托类型由 [").append(entrustment.getEntrustmentType() == 0 ? "常规毒品" : "生物样本").append("] 更改为 [").append(dto.getEntrustmentType() == 0 ? "常规毒品" : "生物样本").append("] 。");
|
||||||
}
|
}
|
||||||
// 2.修改检材 信息
|
// 2.修改检材 信息
|
||||||
// 这里之所以要取未更新前的信息是为了留痕
|
// 这里之所以要取未更新前的信息是为了留痕
|
||||||
@@ -232,11 +276,12 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
dto.getMaterialList(),
|
dto.getMaterialList(),
|
||||||
oldInfoMap,
|
oldInfoMap,
|
||||||
updateRecordBuilder,
|
updateRecordBuilder,
|
||||||
opDate
|
opDate,
|
||||||
|
isTypeName
|
||||||
);
|
);
|
||||||
entrustmentIdentificationMaterialService.updateBatchById(entrustmentIdentificationMaterialList);
|
entrustmentIdentificationMaterialService.updateBatchById(entrustmentIdentificationMaterialList);
|
||||||
// 3. 更新委托鉴定要求和委托时间
|
// 3. 更新委托鉴定要求和委托时间
|
||||||
entrustment.setEntrustmentTime(dto.getEntrustmentTime()); // 修改委托时间
|
|
||||||
updateEntrustmentRequirement(entrustment, dto.getEntrustRequirement(), updateRecordBuilder, opDate);
|
updateEntrustmentRequirement(entrustment, dto.getEntrustRequirement(), updateRecordBuilder, opDate);
|
||||||
// 如果确认完成,则删除鉴定事项确认书和委托书,并更新申请状态为已完成
|
// 如果确认完成,则删除鉴定事项确认书和委托书,并更新申请状态为已完成
|
||||||
if (dto.getFinished()) {
|
if (dto.getFinished()) {
|
||||||
@@ -257,7 +302,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
* @param opDate
|
* @param opDate
|
||||||
* @return 更新后的委托鉴定材料对象列表
|
* @return 更新后的委托鉴定材料对象列表
|
||||||
*/
|
*/
|
||||||
private List<EntrustmentIdentificationMaterial> processUpdateEntrustMaterialInfo(List<MaterialDTO> materialList, Map<String, EntrustmentIdentificationMaterial> oldInfoMap, StringBuilder updateRecordBuilder, LocalDateTime opDate) {
|
private List<EntrustmentIdentificationMaterial> processUpdateEntrustMaterialInfo(List<MaterialDTO> materialList, Map<String, EntrustmentIdentificationMaterial> oldInfoMap, StringBuilder updateRecordBuilder, LocalDateTime opDate, boolean isTypeName) {
|
||||||
Integer index = 1;
|
Integer index = 1;
|
||||||
List<EntrustmentIdentificationMaterial> entrustmentIdentificationMaterialList = new ArrayList<>();
|
List<EntrustmentIdentificationMaterial> entrustmentIdentificationMaterialList = new ArrayList<>();
|
||||||
for (MaterialDTO item : materialList) {
|
for (MaterialDTO item : materialList) {
|
||||||
@@ -273,7 +318,25 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
boolean equalsName = oldMaterial.getName().equals(name);
|
boolean equalsName = oldMaterial.getName().equals(name);
|
||||||
boolean equalsAnalysisOption = oldMaterial.getAnalysisOption().equals(analysisOption);
|
boolean equalsAnalysisOption = oldMaterial.getAnalysisOption().equals(analysisOption);
|
||||||
boolean equalsDrugInfo = oldDrugsStr.equals(renewDrugsStr);
|
boolean equalsDrugInfo = oldDrugsStr.equals(renewDrugsStr);
|
||||||
if (equalsName && equalsAnalysisOption && equalsDrugInfo) {
|
boolean equalsForm = oldMaterial.getForm().equals(item.getForm());
|
||||||
|
BigDecimal oldQuantity = oldMaterial.getQuantity();
|
||||||
|
BigDecimal newQuantity = item.getQuantity();
|
||||||
|
// 设置保留两位小数,四舍五入
|
||||||
|
oldQuantity = oldQuantity.setScale(2, RoundingMode.HALF_UP);
|
||||||
|
newQuantity = newQuantity.setScale(2, RoundingMode.HALF_UP);
|
||||||
|
boolean equalsQuantity = oldQuantity.equals(newQuantity);
|
||||||
|
boolean equalsUnit = oldMaterial.getUnit().equals(item.getUnit());
|
||||||
|
boolean equalsDrawTime = oldMaterial.getDrawTime().equals(item.getDrawTime());
|
||||||
|
boolean equalsDrawPlace = oldMaterial.getDrawPlace().equals(item.getDrawPlace());
|
||||||
|
boolean equalsMaterialAge = true;
|
||||||
|
boolean equalsBiologyGender = true;
|
||||||
|
if (item.getMaterialAge() != null && oldMaterial.getMaterialAge() != null) {
|
||||||
|
equalsMaterialAge = oldMaterial.getMaterialAge().equals(item.getMaterialAge());
|
||||||
|
}
|
||||||
|
if (item.getBiologyGender() != null && oldMaterial.getBiologyGender() != null) {
|
||||||
|
equalsBiologyGender = oldMaterial.getBiologyGender().equals(item.getBiologyGender());
|
||||||
|
}
|
||||||
|
if (equalsName && equalsAnalysisOption && equalsDrugInfo && equalsForm && equalsQuantity && equalsUnit && equalsDrawTime && equalsDrawPlace && equalsMaterialAge && equalsBiologyGender) {
|
||||||
// 信息并没有修改,不操作
|
// 信息并没有修改,不操作
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -290,7 +353,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
.append("<br>")
|
.append("<br>")
|
||||||
.append(index++)
|
.append(index++)
|
||||||
.append(".原检材编号为 [")
|
.append(".原检材编号为 [")
|
||||||
.append(oldMaterial.getImNo())
|
.append(StringUtils.isNotBlank(oldMaterial.getAcceptNo()) ? oldMaterial.getAcceptNo() : oldMaterial.getImNo())
|
||||||
.append("] 的检材信息");
|
.append("] 的检材信息");
|
||||||
if (!equalsName) {
|
if (!equalsName) {
|
||||||
updateRecordBuilder
|
updateRecordBuilder
|
||||||
@@ -313,6 +376,63 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
.append("] 更改为 [")
|
.append("] 更改为 [")
|
||||||
.append(renewDrugsStr).append("]");
|
.append(renewDrugsStr).append("]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!equalsForm) {
|
||||||
|
updateRecordBuilder
|
||||||
|
.append("<br> - 性状由 [")
|
||||||
|
.append(oldMaterial.getForm())
|
||||||
|
.append("] 更改为 [")
|
||||||
|
.append(item.getForm()).append("]");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!equalsQuantity) {
|
||||||
|
updateRecordBuilder
|
||||||
|
.append("<br> - 重量/体积由 [")
|
||||||
|
.append(oldMaterial.getQuantity())
|
||||||
|
.append("] 更改为 [")
|
||||||
|
.append(item.getQuantity()).append("]");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!equalsUnit) {
|
||||||
|
updateRecordBuilder
|
||||||
|
.append("<br> - 单位由 [")
|
||||||
|
.append(oldMaterial.getUnit())
|
||||||
|
.append("] 更改为 [")
|
||||||
|
.append(item.getUnit()).append("]");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!equalsDrawTime) {
|
||||||
|
updateRecordBuilder
|
||||||
|
.append("<br> - 提取时间由 [")
|
||||||
|
.append(oldMaterial.getDrawTime())
|
||||||
|
.append("] 更改为 [")
|
||||||
|
.append(item.getDrawTime()).append("]");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!equalsDrawPlace) {
|
||||||
|
updateRecordBuilder
|
||||||
|
.append("<br> - 提取地点由 [")
|
||||||
|
.append(oldMaterial.getDrawPlace())
|
||||||
|
.append("] 更改为 [")
|
||||||
|
.append(item.getDrawPlace()).append("]");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!equalsMaterialAge) {
|
||||||
|
updateRecordBuilder
|
||||||
|
.append("<br> - 年龄由 [")
|
||||||
|
.append(oldMaterial.getMaterialAge())
|
||||||
|
.append("] 更改为 [")
|
||||||
|
.append(item.getMaterialAge()).append("]");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!equalsBiologyGender) {
|
||||||
|
updateRecordBuilder
|
||||||
|
.append("<br> - 性别由 [")
|
||||||
|
.append(oldMaterial.getBiologyGender())
|
||||||
|
.append("] 更改为 [")
|
||||||
|
.append(item.getBiologyGender()).append("]");
|
||||||
|
}
|
||||||
|
|
||||||
updateRecordBuilder.append("。");
|
updateRecordBuilder.append("。");
|
||||||
EntrustmentIdentificationMaterial entrustmentIdentificationMaterial = new EntrustmentIdentificationMaterial();
|
EntrustmentIdentificationMaterial entrustmentIdentificationMaterial = new EntrustmentIdentificationMaterial();
|
||||||
entrustmentIdentificationMaterial.setId(materialId);
|
entrustmentIdentificationMaterial.setId(materialId);
|
||||||
@@ -321,6 +441,27 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
entrustmentIdentificationMaterial.setAnalysisOption(analysisOption);
|
entrustmentIdentificationMaterial.setAnalysisOption(analysisOption);
|
||||||
// 因为检材的受理编号字段设置了null值也会更新,导致修改会把acceptNo更新为空, 为了防止这个情况,取出acceptNo在设置进去
|
// 因为检材的受理编号字段设置了null值也会更新,导致修改会把acceptNo更新为空, 为了防止这个情况,取出acceptNo在设置进去
|
||||||
entrustmentIdentificationMaterial.setAcceptNo(oldMaterial.getAcceptNo());
|
entrustmentIdentificationMaterial.setAcceptNo(oldMaterial.getAcceptNo());
|
||||||
|
entrustmentIdentificationMaterial.setForm(item.getForm());
|
||||||
|
entrustmentIdentificationMaterial.setFormName(item.getForm());
|
||||||
|
entrustmentIdentificationMaterial.setRtSampleQuantity(item.getRtSampleQuantity());
|
||||||
|
entrustmentIdentificationMaterial.setQuantity(item.getQuantity());
|
||||||
|
entrustmentIdentificationMaterial.setSample1RepeatWeigh(item.getQuantity());
|
||||||
|
entrustmentIdentificationMaterial.setUnit(item.getUnit());
|
||||||
|
entrustmentIdentificationMaterial.setDrawTime(item.getDrawTime());
|
||||||
|
entrustmentIdentificationMaterial.setDrawPlace(item.getDrawPlace());
|
||||||
|
if (isTypeName) {
|
||||||
|
if (oldMaterial.getTypeName().equals("常规毒品")) {
|
||||||
|
entrustmentIdentificationMaterial.setTypeName("生物样本");
|
||||||
|
} else if (oldMaterial.getTypeName().equals("生物样本")) {
|
||||||
|
entrustmentIdentificationMaterial.setTypeName("常规毒品");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (item.getMaterialAge() != null) {
|
||||||
|
entrustmentIdentificationMaterial.setMaterialAge(item.getMaterialAge());
|
||||||
|
}
|
||||||
|
if (item.getBiologyGender() != null) {
|
||||||
|
entrustmentIdentificationMaterial.setBiologyGender(item.getBiologyGender());
|
||||||
|
}
|
||||||
entrustmentIdentificationMaterialList.add(entrustmentIdentificationMaterial);
|
entrustmentIdentificationMaterialList.add(entrustmentIdentificationMaterial);
|
||||||
}
|
}
|
||||||
return entrustmentIdentificationMaterialList;
|
return entrustmentIdentificationMaterialList;
|
||||||
@@ -328,6 +469,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断当前委托是否在申请中的状态
|
* 判断当前委托是否在申请中的状态
|
||||||
|
*
|
||||||
* @param entrustId
|
* @param entrustId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -371,6 +513,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除委托书和鉴定事项确认书
|
* 删除委托书和鉴定事项确认书
|
||||||
|
*
|
||||||
* @param entrustmentNo
|
* @param entrustmentNo
|
||||||
* @param entrustmentId
|
* @param entrustmentId
|
||||||
*/
|
*/
|
||||||
@@ -427,6 +570,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 填充VO信息
|
* 填充VO信息
|
||||||
|
*
|
||||||
* @param e
|
* @param e
|
||||||
*/
|
*/
|
||||||
private void fillVOInfo(EntrustAlterApplyVO e) {
|
private void fillVOInfo(EntrustAlterApplyVO e) {
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ import digital.laboratory.platform.entrustment.entity.*;
|
|||||||
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;
|
||||||
import digital.laboratory.platform.entrustment.enums.EntrustStatusConstants;
|
import digital.laboratory.platform.entrustment.enums.EntrustStatusConstants;
|
||||||
import digital.laboratory.platform.entrustment.event.PushDataToLabsCareEvent;
|
|
||||||
import digital.laboratory.platform.entrustment.handler.AppStartupRunner;
|
import digital.laboratory.platform.entrustment.handler.AppStartupRunner;
|
||||||
import digital.laboratory.platform.entrustment.mapper.EntrustmentMapper;
|
import digital.laboratory.platform.entrustment.mapper.EntrustmentMapper;
|
||||||
import digital.laboratory.platform.entrustment.misc.ProcessFlowMapper;
|
import digital.laboratory.platform.entrustment.misc.ProcessFlowMapper;
|
||||||
@@ -3605,4 +3604,74 @@ public class EntrustmentServiceImpl extends ServiceImpl<EntrustmentMapper, Entru
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void previewEntrustLetterPDF(String entrustId, HttpServletResponse servletResponse) throws Exception {
|
||||||
|
EntrustmentVO ev = this.getEntrustmentVOById(entrustId);
|
||||||
|
List<EntrustmentIdentificationMaterial> materialList = entrustmentIdentificationMaterialService.list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
|
||||||
|
.eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustId));
|
||||||
|
|
||||||
|
if (materialList == null || materialList.size() == 0) {
|
||||||
|
throw new RuntimeException("请至少先添加一个检材后再进行打印!");
|
||||||
|
}
|
||||||
|
String identifyItemsConfirmLetterFileName = "鉴定事项确认书-" + ev.getEntrustmentNo();
|
||||||
|
String downFile = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + entrustId + "/" + identifyItemsConfirmLetterFileName + ".docx";
|
||||||
|
boolean ret = !ossFile.objectExist(downFile);
|
||||||
|
if (!ossFile.objectExist(downFile) || ev.getStatus() <= EntrustStatusConstants.ENTRUST_STATUS_WAITING_ACCEPT.getStatus()) {
|
||||||
|
this.generateIdentifyItemsBook(ev.getId());
|
||||||
|
}
|
||||||
|
String pdfFilePath = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + ev.getId() + "/" + identifyItemsConfirmLetterFileName + ".pdf";
|
||||||
|
|
||||||
|
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||||
|
ossFile.fileGet(downFile, fosWord);
|
||||||
|
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||||
|
fosWord.close();
|
||||||
|
// 转换临时目录中的 word 文档为 PDF
|
||||||
|
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", identifyItemsConfirmLetterFileName + ".docx", "image/jpg", fisWord);
|
||||||
|
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||||
|
fisWord.close();
|
||||||
|
org.apache.commons.io.output.ByteArrayOutputStream outPDF = new org.apache.commons.io.output.ByteArrayOutputStream();
|
||||||
|
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||||
|
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||||
|
outPDF.close();
|
||||||
|
ossFile.fileSave(pdfFilePath, isPDF);
|
||||||
|
isPDF.close();
|
||||||
|
ossFile.fileGet(pdfFilePath, servletResponse.getOutputStream());
|
||||||
|
System.out.println(String.format("转换为 PDF 结束"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void previewEntrustPDF(String entrustId, HttpServletResponse servletResponse) throws Exception {
|
||||||
|
EntrustmentVO ev = this.getEntrustmentVOById(entrustId);
|
||||||
|
List<EntrustmentIdentificationMaterial> materialList = entrustmentIdentificationMaterialService.list(Wrappers.<EntrustmentIdentificationMaterial>lambdaQuery()
|
||||||
|
.eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustId));
|
||||||
|
|
||||||
|
if (materialList == null || materialList.size() == 0) {
|
||||||
|
throw new RuntimeException("请至少先添加一个检材后再进行打印!");
|
||||||
|
}
|
||||||
|
String entrustmentLetterFileName = "鉴定委托书" + "-" + ev.getEntrustmentNo();
|
||||||
|
String downFile = OSSDirectoryConstants.DOCUMENT_ENTRUSTMENT_DIRECTORY + "/" + ev.getId() + "/" + entrustmentLetterFileName + ".docx";
|
||||||
|
boolean ret = !ossFile.objectExist(downFile);
|
||||||
|
if (!ossFile.objectExist(downFile) || ev.getStatus() <= EntrustStatusConstants.ENTRUST_STATUS_WAITING_ACCEPT.getStatus()) {
|
||||||
|
GenerateEntrustmentLetterPDF(ev);
|
||||||
|
}
|
||||||
|
String pdfFilePath = OSSDirectoryConstants.DOCUMENT_ENTRUSTMENT_DIRECTORY + "/" + ev.getId() + "/" + entrustmentLetterFileName + ".pdf";
|
||||||
|
|
||||||
|
ByteArrayOutputStream fosWord = new ByteArrayOutputStream();
|
||||||
|
ossFile.fileGet(downFile, fosWord);
|
||||||
|
ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray());
|
||||||
|
fosWord.close();
|
||||||
|
// 转换临时目录中的 word 文档为 PDF
|
||||||
|
MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "image/jpg", fisWord);
|
||||||
|
Response response = remoteWord2PDFService.word2pdf(mockMultipartFile);
|
||||||
|
fisWord.close();
|
||||||
|
org.apache.commons.io.output.ByteArrayOutputStream outPDF = new org.apache.commons.io.output.ByteArrayOutputStream();
|
||||||
|
IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE);
|
||||||
|
ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray());
|
||||||
|
outPDF.close();
|
||||||
|
ossFile.fileSave(pdfFilePath, isPDF);
|
||||||
|
isPDF.close();
|
||||||
|
ossFile.fileGet(pdfFilePath, servletResponse.getOutputStream());
|
||||||
|
System.out.println(String.format("转换为 PDF 结束"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
AND eaa.apply_org_id = #{query.clientOrgId}
|
AND eaa.apply_org_id = #{query.clientOrgId}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY eaa.apply_date DESC
|
ORDER BY eaa.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getEntrustAlterApplyVOOne"
|
<select id="getEntrustAlterApplyVOOne"
|
||||||
|
|||||||
Reference in New Issue
Block a user