From 740dae2859b1679dd2d3fce136eb76d6eb8b0923 Mon Sep 17 00:00:00 2001 From: chen <2710907404@qq.com> Date: Fri, 3 Jan 2025 15:10:51 +0800 Subject: [PATCH] =?UTF-8?q?20250103=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 5 ---- .../controller/EntrustmentController.java | 25 ++++++++----------- .../dto/CheckoutResultExcelDTO.java | 15 ----------- .../service/EntrustmentService.java | 10 +++++++- ...rustMaterialCheckoutResultServiceImpl.java | 3 --- ...mentIdentificationMaterialServiceImpl.java | 3 +-- .../service/impl/EntrustmentServiceImpl.java | 23 +++++++++-------- 7 files changed, 33 insertions(+), 51 deletions(-) diff --git a/pom.xml b/pom.xml index 5f06e01..86f44bc 100644 --- a/pom.xml +++ b/pom.xml @@ -140,11 +140,6 @@ 2.11.0 - - cn.idev.excel - fastexcel - ${fastexcel.version} - diff --git a/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustmentController.java b/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustmentController.java index f3b230a..71c07b9 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustmentController.java +++ b/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustmentController.java @@ -2,10 +2,6 @@ package digital.laboratory.platform.entrustment.controller; import cn.hutool.core.lang.Assert; import com.amazonaws.services.s3.model.AmazonS3Exception; -// import com.jacob.activeX.ActiveXComponent; -// import com.jacob.com.ComThread; -// import com.jacob.com.Dispatch; -// import com.jacob.com.Variant; import digital.laboratory.platform.common.feign.RemoteGenerateWordService; import digital.laboratory.platform.common.feign.RemoteWord2PDFService; import digital.laboratory.platform.sys.dto.entrustment.CommonIdDto; @@ -32,16 +28,8 @@ import digital.laboratory.platform.entrustment.enums.EntrustmentStatusConstants; import digital.laboratory.platform.entrustment.vo.CaseEventVO; import digital.laboratory.platform.entrustment.vo.EntrustmentVO; import digital.laboratory.platform.sys.entity.SysUser; -// import fr.opensagres.poi.xwpf.converter.pdf.PdfConverter; -// import fr.opensagres.poi.xwpf.converter.pdf.PdfOptions; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; -// import org.jodconverter.JodConverter; -// import org.jodconverter.LocalConverter; -// import org.jodconverter.document.DefaultDocumentFormatRegistry; -// import org.jodconverter.office.LocalOfficeManager; -// import org.jodconverter.office.OfficeException; -// import org.jodconverter.office.OfficeUtils; import org.apache.commons.lang.StringUtils; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; @@ -80,8 +68,6 @@ import java.util.List; @Api(tags = "003-委托管理") @SuppressWarnings("all") public class EntrustmentController { -// @Autowired -// private final HttpServletRequest httpServletRequest; private final CaseEventService caseEventService; private final EntrustmentService entrustmentService; @@ -2372,4 +2358,15 @@ public class EntrustmentController { boolean success = entrustmentService.alertTimeFiledInfoByEntrustDate(entrustment); return success ? R.ok("修改成功") : R.failed("修改失败"); } + + @ApiOperation("20250103 - 新增判断当前委托保存的检材是否和用户当前页面填写的检材数量是否匹配,是则返回true,否返回false") + @GetMapping("/isEligibleForSubmission") + public R isEligibleForSubmission(@RequestParam("entrustId") String entrustId, @RequestParam("materialCount") Integer materialCount) { + Boolean allowSubmit = entrustmentService.isEligibleForSubmission(entrustId, materialCount); + if (allowSubmit) { + return R.ok(allowSubmit, "检材数量匹配,可以提交审核!"); + } else { + return R.ok(allowSubmit, "有检材未保存,请先保存检材后在提交!"); + } + } } diff --git a/src/main/java/digital/laboratory/platform/entrustment/dto/CheckoutResultExcelDTO.java b/src/main/java/digital/laboratory/platform/entrustment/dto/CheckoutResultExcelDTO.java index 64c8c24..6249cb8 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/dto/CheckoutResultExcelDTO.java +++ b/src/main/java/digital/laboratory/platform/entrustment/dto/CheckoutResultExcelDTO.java @@ -1,6 +1,5 @@ package digital.laboratory.platform.entrustment.dto; -import cn.idev.excel.annotation.ExcelProperty; import digital.laboratory.platform.sys.entity.DrugLite; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -14,58 +13,44 @@ import java.util.List; public class CheckoutResultExcelDTO { @ApiModelProperty("序号") - @ExcelProperty(value = "序号", index = 0) private Integer order; @ApiModelProperty("送检日期") - @ExcelProperty(value = "送检日期", index = 1) private String deliverTime; @ApiModelProperty("送检单位") - @ExcelProperty(value = "送检单位", index = 2) private String clientOrgName; @ApiModelProperty("检材采集地-省") - @ExcelProperty(value = "检材采集地", index = 3) private String provinceCollectPlace; @ApiModelProperty("检材采集地-市") - @ExcelProperty(value = "检材采集地", index = 4) private String cityCollectPlace; @ApiModelProperty(value="受理编号") - @ExcelProperty(value = "受理编号", index = 5) private String acceptNo; @ApiModelProperty(value = "委托检材顺序号,由系统根据录入顺序生成") - @ExcelProperty(value = "检材编号", index = 6) private Integer orderNo; @ApiModelProperty(value = "检材类别名称:继承所取物证的类别或从物证类别选择") - @ExcelProperty(value = "检材类型", index = 7) private String typeName; @ApiModelProperty(value = "检材颜色:继承所取物证颜色或手动填入") - @ExcelProperty(value = "检材颜色", index = 8) private String color; @ApiModelProperty(value = "检材性状名称:继承所取物证性状或从物证性状类别选择") - @ExcelProperty(value = "检材形态", index = 9) private String formName; @ApiModelProperty("定性结果") - @ExcelProperty(value = "定性结果", index = 10) private String qualitativeResult; @ApiModelProperty("定量结果") - @ExcelProperty(value = "定量结果", index = 11) private String quantitativeResult; @ApiModelProperty("其他鉴定结果") - @ExcelProperty(value = "其他鉴定结果", index = 12) private String otherResult; @ApiModelProperty("备注") - @ExcelProperty(value = "备注", index = 13) private String remark; } diff --git a/src/main/java/digital/laboratory/platform/entrustment/service/EntrustmentService.java b/src/main/java/digital/laboratory/platform/entrustment/service/EntrustmentService.java index 48d34e8..4f9df23 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/service/EntrustmentService.java +++ b/src/main/java/digital/laboratory/platform/entrustment/service/EntrustmentService.java @@ -55,7 +55,7 @@ public interface EntrustmentService extends IService { * 当流程进行到某个环节的时候, 需要某个用户对这个环节进行处理(通过或不通过)。 * 这里取可用的用户列表 *

- * 涉及到的环境有以下几个: + * 涉及到的环境有以下几个: * 1、创建委托及提交 * 委托的提交者就是委托的创建者。不存在不通过的可能。 * 2、审核 @@ -198,4 +198,12 @@ public interface EntrustmentService extends IService { * @return */ boolean alertTimeFiledInfoByEntrustDate(Entrustment entrustment); + + /** + * 判断当前保存的委托检材数量是否符合,决定是否可以提交委托审核 + * @param entrustId 委托id + * @param materialCount 当前用户所在的检材页面检材数量 + * @return + */ + Boolean isEligibleForSubmission(String entrustId, Integer materialCount); } diff --git a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustMaterialCheckoutResultServiceImpl.java b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustMaterialCheckoutResultServiceImpl.java index a0fde5b..0aee013 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustMaterialCheckoutResultServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustMaterialCheckoutResultServiceImpl.java @@ -1,9 +1,6 @@ package digital.laboratory.platform.entrustment.service.impl; import cn.hutool.core.collection.CollUtil; -import cn.idev.excel.FastExcel; -import cn.idev.excel.write.metadata.style.WriteCellStyle; -import cn.idev.excel.write.style.HorizontalCellStyleStrategy; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import digital.laboratory.platform.common.core.exception.CheckedException; diff --git a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentIdentificationMaterialServiceImpl.java b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentIdentificationMaterialServiceImpl.java index fc63155..ed969d3 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentIdentificationMaterialServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentIdentificationMaterialServiceImpl.java @@ -1173,7 +1173,7 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl createNewIm(List identificationMaterialList, DLPUser dlpUser) { + public List createNewIm(List identificationMaterialList, DLPUser dlpUser) { Entrustment entrustment = entrustmentService.getById(identificationMaterialList.get(0).getEntrustmentId()); if (!dlpUser.isStaff() && entrustment.getStatus() != EntrustmentStatusConstants.ENTRUSTMENT_STATUS_CREATED.getStatus()) { @@ -1264,7 +1264,6 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpllambdaUpdate() -// .eq(Entrustment::getId, entrust.getId()) -// .set(Entrustment::getSubmitTime, entrust.getSubmitTime().withYear(year).withMonth(monthValue).withDayOfMonth(dayValue)) -// .set(Entrustment::getCheckClaimTime, entrust.getCheckClaimTime().withYear(year).withMonth(monthValue).withDayOfMonth(dayValue)) -// .set(Entrustment::getCheckTime, entrust.getCheckTime().withYear(year).withMonth(monthValue).withDayOfMonth(dayValue)) -// .set(Entrustment::getApproveClaimTime, entrust.getApproveClaimTime().withYear(year).withMonth(monthValue).withDayOfMonth(dayValue)) -// .set(Entrustment::getApproveTime, entrust.getApproveTime().withYear(year).withMonth(monthValue).withDayOfMonth(dayValue)) -// .set(Entrustment::getDeliverConfirmTime, entrust.getDeliverConfirmTime().withYear(year).withMonth(monthValue).withDayOfMonth(dayValue)) -// .set(Entrustment::getAcceptTime, entrust.getAcceptTime().withYear(year).withMonth(monthValue).withDayOfMonth(dayValue)) -// .set(Entrustment::getCreateTime, entrust.getCreateTime().withYear(year).withMonth(monthValue).withDayOfMonth(dayValue)) -// .set(Entrustment::getProcessInfo, processInfoList)); + } + + /** + * 判断当前保存的委托检材数量是否符合,决定是否可以提交委托审核 + * @param entrustId 委托id + * @param materialCount 当前用户所在的检材页面检材数量 + * @return + */ + @Override + public Boolean isEligibleForSubmission(String entrustId, Integer materialCount) { + int count = (int) entrustmentIdentificationMaterialService.count(Wrappers.lambdaQuery().eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustId)); + return materialCount.equals(count); }