From 6326223288e634768b317369d6dd86a2643517b6 Mon Sep 17 00:00:00 2001 From: yanghaihang <1344638791@qq.com> Date: Wed, 10 May 2023 19:40:13 +0800 Subject: [PATCH] 5.10 --- pom.xml | 26 +++ .../CentralizedRequestController.java | 25 +++ .../PurchaseCatalogueController.java | 148 ++++++++++++++++++ .../controller/PurchaseListController.java | 20 +-- .../SupplierInformationController.java | 6 + .../WarehousingRecordFormController.java | 1 - .../reagent/dto/OutgoingContentsDTO.java | 23 ++- .../PeriodVerificationImplementationDTO.java | 3 + .../reagent/dto/PurchaseCatalogueDTO.java | 42 ++--- .../dto/StandardReserveSolutionFullDTO.java | 1 + .../reagent/dto/WarehousingRecordFormDTO.java | 5 +- .../reagent/entity/AppStartupRunner.java | 130 +++++++++++++++ .../platform/reagent/entity/BatchDetails.java | 10 +- .../reagent/entity/CatalogueDetails.java | 51 +++--- .../reagent/entity/CentralizedRequest.java | 8 + .../reagent/entity/OutgoingContents.java | 6 + .../PeriodVerificationImplementation.java | 5 + .../entity/ReagentConsumableInventory.java | 5 +- .../reagent/entity/ReagentConsumables.java | 2 +- .../reagent/entity/ReferenceMaterial.java | 8 + .../reagent/entity/ReviewAndApprove.java | 1 + .../reagent/entity/SupplierInformation.java | 14 ++ .../service/CentralizedRequestService.java | 2 + .../service/PurchaseCatalogueService.java | 2 + .../reagent/service/PurchaseListService.java | 4 +- .../service/impl/BatchDetailsServiceImpl.java | 6 - .../impl/CentralizedRequestServiceImpl.java | 21 ++- .../DeliveryRegistrationFormServiceImpl.java | 42 +++-- .../impl/DetailsOfCentralizedServiceImpl.java | 3 +- .../ProvideServicesOrSuppliesServiceImpl.java | 4 +- .../impl/PurchaseCatalogueServiceImpl.java | 58 ++++++- .../service/impl/PurchaseListServiceImpl.java | 27 +++- .../impl/PurchasingPlanServiceImpl.java | 5 +- ...ReagentConsumableInventoryServiceImpl.java | 12 +- .../impl/ReviewAndApproveServiceImpl.java | 42 +++++ ...tandardMaterialApplicationServiceImpl.java | 12 +- .../StandardReserveSolutionServiceImpl.java | 19 +-- .../WarehousingRecordFormServiceImpl.java | 90 +++++------ .../platform/reagent/vo/BatchDetailsVO.java | 2 - .../reagent/vo/CatalogueDetailsPrintVO.java | 17 ++ .../reagent/vo/PurchaseCataloguePrintVO.java | 23 +++ src/main/resources/bootstrap.yml | 2 +- .../resources/mapper/BatchDetailsMapper.xml | 3 + .../mapper/CatalogueDetailsMapper.xml | 1 + .../mapper/OutgoingContentsMapper.xml | 3 + ...PeriodVerificationImplementationMapper.xml | 1 + .../mapper/PurchaseCatalogueMapper.xml | 7 +- .../resources/mapper/PurchasingPlanMapper.xml | 20 +-- .../mapper/ReferenceMaterialMapper.xml | 2 + 49 files changed, 792 insertions(+), 178 deletions(-) create mode 100644 src/main/java/digital/laboratory/platform/reagent/entity/AppStartupRunner.java create mode 100644 src/main/java/digital/laboratory/platform/reagent/vo/CatalogueDetailsPrintVO.java create mode 100644 src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCataloguePrintVO.java diff --git a/pom.xml b/pom.xml index 3c0626d..9b7e9a4 100644 --- a/pom.xml +++ b/pom.xml @@ -110,6 +110,27 @@ org.springframework.boot spring-boot-starter-undertow + + + + com.deepoove + poi-tl + 1.12.0 + + + + + + org.springframework + spring-test + + + + + digital.laboratory.platform + dlp-common-remote-word2pdf + 2022.10.11-snapshots + @@ -130,6 +151,11 @@ RELEASE compile + + com.deepoove + poi-tl + 1.12.0 + diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java b/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java index b2daa19..b9b3689 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java @@ -231,6 +231,31 @@ public class CentralizedRequestController { } } + /** + * 修改(集中采购申请) + * + * @param auditAndApproveDTO (集中采购申请) + * @return R + */ + @ApiOperation(value = "审核集中采购申请", notes = "审核集中采购申请") + @SysLog("审核集中采购申请)") + @PutMapping("/audit") + @PreAuthorize("@pms.hasPermission('reagent_centralized_request_audit')") + public R auditById(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { + + Principal principal = theHttpServletRequest.getUserPrincipal(); + + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + CentralizedRequest centralizedRequest = centralizedRequestService.auditById(auditAndApproveDTO, dlpUser); + + if (centralizedRequest != null) { + return R.ok(centralizedRequest, "审核成功"); + } else { + return R.failed("审核失败"); + } + } + /** * 通过id删除(集中采购申请) * diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java index 0e1927c..eb86cfd 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java @@ -1,15 +1,24 @@ package digital.laboratory.platform.reagent.controller; import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.io.IoUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import com.deepoove.poi.XWPFTemplate; +import com.deepoove.poi.config.Configure; +import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; import com.fasterxml.jackson.annotation.JsonFormat; import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.feign.RemoteWord2PDFService; import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.mybatis.security.service.DLPUser; +import digital.laboratory.platform.common.oss.service.OssFile; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.PurchaseCatalogueDTO; import digital.laboratory.platform.reagent.dto.PurchaseCatalogueGetDTO; @@ -17,10 +26,15 @@ import digital.laboratory.platform.reagent.entity.CatalogueDetails; import digital.laboratory.platform.reagent.entity.PurchaseCatalogue; import digital.laboratory.platform.reagent.service.CatalogueDetailsService; import digital.laboratory.platform.reagent.service.PurchaseCatalogueService; +import digital.laboratory.platform.reagent.vo.CatalogueDetailsPrintVO; import digital.laboratory.platform.reagent.vo.CatalogueDetailsVO; +import digital.laboratory.platform.reagent.vo.PurchaseCataloguePrintVO; import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO; +import feign.Response; +import org.apache.commons.io.output.ByteArrayOutputStream; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.mock.web.MockMultipartFile; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -30,11 +44,14 @@ import org.springframework.web.bind.annotation.*; import springfox.documentation.swagger2.annotations.EnableSwagger2; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; import java.security.Principal; import java.sql.Date; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDateTime; +import java.util.HashMap; import java.util.List; /** @@ -54,12 +71,18 @@ import java.util.List; @RequiredArgsConstructor @RequestMapping("/purchase_catalogue") @Api(value = "purchase_catalogue", tags = "采购目录管理") +@SuppressWarnings("all") public class PurchaseCatalogueController { @Autowired private final PurchaseCatalogueService purchaseCatalogueService; @Autowired private final CatalogueDetailsService catalogueDetailsService; + @Autowired + private final RemoteWord2PDFService remoteWord2PDFService; + @Autowired + private final OssFile ossFile; + /** * 分页查询 * @@ -355,6 +378,131 @@ public class PurchaseCatalogueController { return R.failed("发布失败"); } } + + + /** + * 发布采购目录 + * + * @param purchaseCatalogueDTOList + * @return R + */ + @ApiOperation(value = "导入采购目录", notes = "导入采购目录") + @SysLog("导入采购目录") + @PostMapping("/import") +// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_release')") + public R getImport( @RequestBody List purchaseCatalogueDTOList, HttpServletRequest theHttpServletRequest) { + + PurchaseCatalogueVO anImport = purchaseCatalogueService.getImport(purchaseCatalogueDTOList); + + return R.ok(anImport); + } + + /**-------出库清单*/ + /** + * 出库清单 + * + * @param purchaseCatalogueId + * + * @return + */ + @ApiOperation(value = "采购目录打印", notes = "采购目录打印") + @SysLog("采购目录打印") + @PostMapping("/print") +// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')") + public void bizGetPDFInventory(String purchaseCatalogueId, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { + System.out.println("bizApplyWord................."); + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + PurchaseCatalogueVO purchaseCatalogueVO = purchaseCatalogueService.getPurchaseCatalogueVO(purchaseCatalogueId); + + List voList = purchaseCatalogueVO.getCatalogueDetailsListList(); + + if (voList.isEmpty()) { + throw new RuntimeException("未查询到相关信息"); + } + + String id = IdWorker.get32UUID().toUpperCase(); + + String applyFileName = "采购目录-"+id; + + String pdfFilePath = "document" + "/"+"purchaseCatalogue" + "/" + id + "/" + applyFileName + ".pdf"; + try { + //直接调用pdf方法 + purchaseCatalogueTablePDF(purchaseCatalogueVO,id,theHttpServletRequest,httpServletResponse); + ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream()); + httpServletResponse.setContentType(applyFileName); + } catch (Exception e) { + System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage())); + e.printStackTrace(); + } + } + + + private void purchaseCatalogueTablePDF(PurchaseCatalogueVO purchaseCatalogueVO, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + System.out.println("PurchaseCatalogueTablePDF................."); + + List voList = purchaseCatalogueVO.getCatalogueDetailsListList(); + + //----------------------------- + // 生成 word 版本的 采购目录 + + String applyFileName = "采购目录-"+id; + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ossFile.fileGet("template" + "/" + "试剂耗材集中采购目录模板.docx", bos); + + byte[] templateArray = bos.toByteArray(); + + ByteArrayInputStream bis = new ByteArrayInputStream(templateArray); + bos.close(); + + LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy(); + + Configure config = Configure.builder(). + bind("voList", policy).build(); + /** + * 循环表格 + */ + XWPFTemplate template = XWPFTemplate.compile(bis, config).render( + new HashMap() {{ + put("voList", voList); + put("id",purchaseCatalogueVO.getPurchaseCatalogueId()); + put("size",1); + put("secondaryAuditorName",purchaseCatalogueVO.getSecondaryAuditorName()); + put("auditTimeOfSecondary", LocalDateTimeUtil.format(purchaseCatalogueVO.getAuditTimeOfSecondary(), "yyyy年MM月dd日 ")); + put("name",LocalDateTimeUtil.format(LocalDateTime.now(),"yyyy年")+"~"+LocalDateTimeUtil.format(LocalDateTime.now().plusYears(1),"yyyy年")); + }} + ); + bis.close(); + + ByteArrayOutputStream fosWord = new ByteArrayOutputStream(); + template.write(fosWord); + template.close(); + + //------------ + ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray()); + fosWord.close(); + + //MockMultipartFile mockMultipartFile = new MockMultipartFile("file", entrustmentLetterFileName + ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fisWord); + MockMultipartFile mockMultipartFile = new MockMultipartFile("file", applyFileName + ".docx", "image/jpg", fisWord); + Response response = remoteWord2PDFService.word2pdf(mockMultipartFile); + fisWord.close(); + + + ByteArrayOutputStream outPDF = new ByteArrayOutputStream(); + IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE); + ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray()); + outPDF.close(); + + + ossFile.fileSave("document" + "/" + "purchaseCatalogue" + "/" + id + "/" + applyFileName + ".pdf", isPDF); + isPDF.close(); + + + System.out.println(String.format("转换为 PDF 结束")); + + } } diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java index b54be98..436aaf9 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java @@ -94,39 +94,35 @@ public class PurchaseListController { */ @ApiOperation(value = "修改采购清单明细", notes = "修改采购清单明细") @SysLog("修改采购清单明细" ) - @PostMapping + @PutMapping // @PreAuthorize("@pms.hasPermission('reagent_purchase_list_add')" ) - public R postAddObject(@RequestBody PurchaseListDTO purchaseListDTO, HttpServletRequest theHttpServletRequest) { + public R postAddObject(@RequestBody List purchaseListDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - PurchaseListDetailsVO purchaseListDetailsVO = purchaseListService.addDetails(purchaseListDTO); + purchaseListService.editById(purchaseListDTO); + + return R.ok("添加成功"); - if (purchaseListDetailsVO!=null) { - return R.ok(purchaseListDetailsVO, "保存成功"); - } - else { - return R.failed(purchaseListDetailsVO, "保存失败"); - } } /** * 新增(采购清单) - * @param id (采购清单) + * @param purchaseListDTOList (采购清单) * @return R */ @ApiOperation(value = "提交采购清单明细", notes = "提交采购清单明细") @SysLog("提交采购清单明细" ) @PutMapping("/commit") // @PreAuthorize("@pms.hasPermission('reagent_purchase_list_commit)" ) - public R commitById( String id, HttpServletRequest theHttpServletRequest) { + public R commitById(List purchaseListDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - PurchaseList purchaseList = purchaseListService.commitById(id); + PurchaseList purchaseList = purchaseListService.commitById(purchaseListDTOList); if (purchaseList!=null) { return R.ok(purchaseList, "提交成功"); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java b/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java index 735ecad..c8449c1 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java @@ -2,6 +2,7 @@ package digital.laboratory.platform.reagent.controller; import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.file.FileNameUtil; +import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -277,6 +278,11 @@ public class SupplierInformationController { String photograph = supplierInformation.getPhotograph(); + if (!StrUtil.isNotBlank(photograph)){ + + return R.failed(null); + } + if (photograph != null) { String path = "reagen_managment" + "/" + "supplierInformation/" + supplierInformation.getId(); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java index f5f1655..08373cb 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java @@ -49,7 +49,6 @@ import java.util.List; public class WarehousingRecordFormController { private final WarehousingRecordFormService warehousingRecordFormService; - private final WarehousingContentService warehousingContentService; private final ReagentConsumablesService reagentConsumablesService; diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/OutgoingContentsDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/OutgoingContentsDTO.java index 9531a94..57c934e 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/OutgoingContentsDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/OutgoingContentsDTO.java @@ -1,18 +1,39 @@ package digital.laboratory.platform.reagent.dto; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data public class OutgoingContentsDTO { + @ApiModelProperty(value = "(出库用途)") private Integer outboundUse; + + @ApiModelProperty(value = "(出库数量)") private Integer quantity; + + @ApiModelProperty(value = "(出库试剂耗材类ID)") private String reagentConsumableId; + + @ApiModelProperty(value = "(备注)") private String remarks; + + @ApiModelProperty(value = "(出库单ID)") private String deliveryRegistrationFormId; + + @ApiModelProperty(value = "(出库标准物质ID)") private String referenceMaterialId; + + @ApiModelProperty(value = "(标准物质编号)") private String number; - private boolean returnOrNot; + + @ApiModelProperty(value = "(批次ID)") private String batchDetailsId; + @ApiModelProperty(value = "(格子Id)") + private String latticeId; + + @ApiModelProperty(value = "(位置信息)") + private String location; + } diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationImplementationDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationImplementationDTO.java index 2bd5640..e5503ae 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationImplementationDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationImplementationDTO.java @@ -37,4 +37,7 @@ public class PeriodVerificationImplementationDTO { @ApiModelProperty(value="(偏差/不确定度)") private String deviationAndUncertainty; + + @ApiModelProperty(value="(不满足应用要求原因分析结果)") + private boolean causeOfDissatisfactionResult; } diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/PurchaseCatalogueDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/PurchaseCatalogueDTO.java index e43a1a6..9298388 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/PurchaseCatalogueDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/PurchaseCatalogueDTO.java @@ -15,59 +15,61 @@ public class PurchaseCatalogueDTO { /** * (品牌) */ - @ApiModelProperty(value="品牌") + @ApiModelProperty(value = "品牌") private String brand; - @ApiModelProperty(value="类别") + @ApiModelProperty(value = "类别") private String category; - @ApiModelProperty(value="偏差/不确定度") + @ApiModelProperty(value = "偏差/不确定度") private String deviationOrUncertainty; - @ApiModelProperty(value="编号") - private String number; - @ApiModelProperty(value="包装份数") + + @ApiModelProperty(value = "包装份数") private String packagedCopies; - @ApiModelProperty(value="采购目录ID") + @ApiModelProperty(value = "采购目录ID") private String purchaseCatalogueId; - @ApiModelProperty(value="采购目录编号") + @ApiModelProperty(value = "采购目录编号") private String purchaseCatalogueNumber; - @ApiModelProperty(value="试剂耗材名称") + @ApiModelProperty(value = "试剂耗材名称") private String reagentConsumableName; - @ApiModelProperty(value="种类)") + @ApiModelProperty(value = "种类)") private String species; - @ApiModelProperty(value="规格型号") + @ApiModelProperty(value = "规格型号") private String specificationAndModel; - @ApiModelProperty(value="标准值/纯度") + @ApiModelProperty(value = "标准值/纯度") private String standardValueOrPurity; - @ApiModelProperty(value="单价") + @ApiModelProperty(value = "单价") private Double unitPrice; - @ApiModelProperty(value="采购目录明细ID") + @ApiModelProperty(value = "采购目录明细ID") private String catalogueDetailsId; - @ApiModelProperty(value="试剂耗材Id") + @ApiModelProperty(value = "试剂耗材Id") private String reagentConsumableId; - @ApiModelProperty(value="存储条件") + @ApiModelProperty(value = "存储条件") private String storageCondition; - @ApiModelProperty(value="别名") + @ApiModelProperty(value = "别名") private String alias; - @ApiModelProperty(value="备注") + @ApiModelProperty(value = "备注") private String remark; - @ApiModelProperty(value="包装单位") + @ApiModelProperty(value = "包装单位") private String minimumUnit; - @ApiModelProperty(value="英文名") + @ApiModelProperty(value = "英文名") private String englishName; + @ApiModelProperty(value = "CAS 号") + private String casNumber; + } diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/StandardReserveSolutionFullDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/StandardReserveSolutionFullDTO.java index e015565..0445460 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/StandardReserveSolutionFullDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/StandardReserveSolutionFullDTO.java @@ -8,4 +8,5 @@ public class StandardReserveSolutionFullDTO { private String id; private String latticeId; private String warehousingRemarks; + private String location; } diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java index 157733e..2a983cb 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java @@ -52,7 +52,10 @@ public class WarehousingRecordFormDTO { private String limitDate; @ApiModelProperty(value = "(预警值)") - private Integer warning_value; + private Integer warningValue; + + @ApiModelProperty(value = "(位置信息)") + private String location; } diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/AppStartupRunner.java b/src/main/java/digital/laboratory/platform/reagent/entity/AppStartupRunner.java new file mode 100644 index 0000000..872a1d2 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/reagent/entity/AppStartupRunner.java @@ -0,0 +1,130 @@ +package digital.laboratory.platform.reagent.entity; + +import digital.laboratory.platform.common.core.constant.CommonConstants; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.sys.entity.Dictionary; +import digital.laboratory.platform.sys.feign.RemoteDictionaryService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * App 启动类 + * 当 Spring Application 启动完成后, 会调用这个类的 run() 方法进行一些最后的初始化。 + * 我们在这个方法中从数据库加载一些全局的配置 + * + * @author Zhang Xiaolong + */ + +@Component +@RequiredArgsConstructor +public class AppStartupRunner implements ApplicationRunner { + + // @Value("${dlp.entrustment.processDefinitionId}") + // public static String processDefinitionId; + + //public static boolean clientChoiceCheckers; + //public static boolean checkerChoiceApprovers; + //public static boolean singleOperateUser; + + // @Value("${dlp.entrustment.temporaryPath}") + //public static String temporaryPath; + + @Value("${dlp.entrustment.entrustmentLetterTemplate}") + public static String entrustmentLetterTemplate; + + private final RemoteDictionaryService remoteDictionaryService; + + public static Map entrustmentConfig = new HashMap<>(); + + public static String getCfg(String code) { + return entrustmentConfig.get(code); + } + + /** + * + * @param args 参数 + * @throws Exception 异常 + * + * // @SysLog("委托受理模块初始化") 这里不能使用 @SysLog(), 因为 SysLog 还没有初始化 + */ + @Override + public void run(ApplicationArguments args) throws Exception { +// BusinessCodeUtils.removeSymbols("x-*/)——0*&……%¥#@xasdf!*&^&%^ 中文、/+)(()\n\\xx\rx"); + + { + // 加载 entrustment 在字典中的配置 + R> r = remoteDictionaryService.getDictionaryByType(CommonConstants.DLP_TYPE_ENTRUSTMENT); + if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) { + List itemList = r.getData(); + for (Dictionary item : itemList) { + entrustmentConfig.put(item.getCode(), item.getLabel()); + } + } + + for (String key : entrustmentConfig.keySet()) { + System.out.println(String.format("entrustmentConfig[%s]=%s", key, entrustmentConfig.get(key))); + } + } + + // { + // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_PROCESS_DEFINITION_ID); + // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) { + // processDefinitionId = r.getData().get("label"); + // } + // } + // { + // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_CLIENT_CHOICE_CHECKERS); + // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) { + // clientChoiceCheckers = "1".equals(r.getData().get("label")); + // } + // } + // { + // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_CHECKER_CHOICE_APPROVERS); + // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) { + // checkerChoiceApprovers = "1".equals(r.getData().get("label")); + // } + // } + // { + // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_CLIENT_SINGLE_OPERATE_USER); + // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) { + // singleOperateUser = "1".equals(r.getData().get("label")); + // } + // } + // { + // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_TEMPORARY_PATH); + // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) { + // temporaryPath = r.getData().get("label"); + // } + // if (StrUtil.isEmpty(temporaryPath)) { + // temporaryPath =new File(System.getProperty("user.dir")+"/temp").getCanonicalPath(); + // } + // + // System.out.printf("临时目录是 %s%n", temporaryPath); + // File tempPathFile = new File(temporaryPath); + // if (! tempPathFile.exists()) { + // System.out.printf("临时目录 %s 不存在, 创建之...%n", tempPathFile.getCanonicalPath()); + // if (!tempPathFile.mkdirs()) { + // System.out.printf("创建临时目录 %s 失败!%n", tempPathFile.getCanonicalPath()); + // } + // } + // } + + // { + // R> r = remoteDictionaryService.innerGetById(CommonConstants.DLP_ENTRUSTMENT_LETTER_TEMPLATE_PATH); + // if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) { + // entrustmentLetterTemplate = r.getData().get("label"); + // } + // } + + } + + +} \ No newline at end of file diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java b/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java index 96bf04d..c626eb0 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java @@ -65,7 +65,10 @@ public class BatchDetails extends BaseEntity { * (有效日期) */ @ApiModelProperty(value="(有效日期)") - private Integer expirationDate; + private LocalDate expirationDate; + + @ApiModelProperty(value = "(存储期限)") + private String limitDate; /** * (定值结果) @@ -109,7 +112,10 @@ public class BatchDetails extends BaseEntity { @ApiModelProperty(value="(供应商ID)") private String supplierId; - + @ApiModelProperty(value = "(格子Id)") + private String latticeId; + @ApiModelProperty(value = "(位置信息)") + private String location; diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java b/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java index c5cda34..f60aae8 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java @@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableName; import digital.laboratory.platform.common.mybatis.base.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import java.io.Serializable; import java.time.LocalDateTime; + import lombok.Data; import lombok.EqualsAndHashCode; @@ -27,110 +29,115 @@ public class CatalogueDetails extends BaseEntity { /** * (品牌) */ - @ApiModelProperty(value="品牌)") + @ApiModelProperty(value = "品牌)") private String brand; /** * (英文名) */ - @ApiModelProperty(value="英文名)") + @ApiModelProperty(value = "英文名)") private String englishName; /** * (类别) */ - @ApiModelProperty(value="类别)") + @ApiModelProperty(value = "类别)") private String category; /** * 偏差/不确定度 */ - @ApiModelProperty(value="偏差/不确定度") + @ApiModelProperty(value = "偏差/不确定度") private String deviationOrUncertainty; /** * 包装份数 */ - @ApiModelProperty(value="包装份数") + @ApiModelProperty(value = "包装份数") private String packagedCopies; /** * 采购目录ID */ - @ApiModelProperty(value="采购目录ID") + @ApiModelProperty(value = "采购目录ID") private String purchaseCatalogueId; /** * (采购目录编号) */ - @ApiModelProperty(value="采购目录编号)") + @ApiModelProperty(value = "采购目录编号)") private String purchaseCatalogueNumber; /** * 试剂耗材名称 */ - @ApiModelProperty(value="试剂耗材名称") + @ApiModelProperty(value = "试剂耗材名称") private String reagentConsumableName; /** * 试剂耗材Id */ - @ApiModelProperty(value="试剂耗材Id") + @ApiModelProperty(value = "试剂耗材Id") private String reagentConsumableId; /** * (种类) */ - @ApiModelProperty(value="(种类)") + @ApiModelProperty(value = "(种类)") private String species; /** * (规格型号) */ - @ApiModelProperty(value="规格型号)") + @ApiModelProperty(value = "规格型号)") private String specificationAndModel; /** * (标准值/纯度) */ - @ApiModelProperty(value="标准值/纯度)") + @ApiModelProperty(value = "标准值/纯度)") private String standardValueOrPurity; /** * 单价 */ - @ApiModelProperty(value="单价") + @ApiModelProperty(value = "单价") private Double unitPrice; /** * 别名 */ - @ApiModelProperty(value="别名") - private String alias; + @ApiModelProperty(value = "别名") + private String alias; /** * 存储条件 */ - @ApiModelProperty(value="存储条件") - private String storageCondition; + @ApiModelProperty(value = "存储条件") + private String storageCondition; + /** + * CAS号 + */ + @ApiModelProperty(value = "CAS-号") + private String casNumber; /** * 备注 */ - @ApiModelProperty(value="备注") - private String remark; + @ApiModelProperty(value = "备注") + private String remark; /** * 包装单位 */ - @ApiModelProperty(value="包装单位") - private String minimumUnit; + @ApiModelProperty(value = "包装单位") + private String minimumUnit; /** * catalogueDetailsId */ @TableId(value = "catalogue_details_id", type = IdType.ASSIGN_UUID) - @ApiModelProperty(value="catalogueDetailsId") + @ApiModelProperty(value = "catalogueDetailsId") private String catalogueDetailsId; diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java b/src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java index fc440f6..139492e 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java @@ -60,6 +60,14 @@ public class CentralizedRequest extends BaseEntity { @ApiModelProperty(value="申请人名称") private String applicantName; + private boolean auditResult; + + private String auditOpinion; + + private String auditId; + + private LocalDateTime auditTime; + /** diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java b/src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java index d47efa5..6350e6b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java @@ -66,6 +66,12 @@ public class OutgoingContents extends BaseEntity { @ApiModelProperty(value = "(批次ID)") private String batchDetailsId; + + @ApiModelProperty(value = "(格子Id)") + private String latticeId; + @ApiModelProperty(value = "(位置信息)") + private String location; + /** * outgoingContentsId */ diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationImplementation.java b/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationImplementation.java index 67add42..aa0fe64 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationImplementation.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationImplementation.java @@ -48,6 +48,11 @@ public class PeriodVerificationImplementation extends BaseEntity { */ @ApiModelProperty(value="(不满足应用要求原因分析)") private String causeOfDissatisfaction; + /** + * (不满足应用要求原因分析) + */ + @ApiModelProperty(value="(不满足应用要求原因分析结果)") + private boolean causeOfDissatisfactionResult; /** * (核查时间) diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java index ac0f3aa..367e97b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java @@ -47,8 +47,7 @@ public class ReagentConsumableInventory extends BaseEntity { /** * (类别) */ - @ApiModelProperty(value = "(格子Id)") - private String latticeId; + /** * 偏差/不确定度 @@ -102,7 +101,7 @@ public class ReagentConsumableInventory extends BaseEntity { * (包装份数) */ @ApiModelProperty(value = "(包装份数)") - private String packagedCopies; + private Integer packagedCopies; /** * reagentConsumableInventoryId diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java index 6c71980..3c8b719 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java @@ -69,7 +69,7 @@ public class ReagentConsumables extends BaseEntity { * 包装份数 */ @ApiModelProperty(value="包装份数") - private String packagedCopies; + private Integer packagedCopies; /** * (标准值/纯度) */ diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java b/src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java index 5d0f3a3..4fee365 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java @@ -44,6 +44,14 @@ public class ReferenceMaterial extends BaseEntity { */ @ApiModelProperty(value="批次明细Id") private String batchDetailsId; + /** + * batchDetailsId + */ + @ApiModelProperty(value="格子ID") + private String latticeId; + + @ApiModelProperty(value="位置信息") + private String location; /** * id diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ReviewAndApprove.java b/src/main/java/digital/laboratory/platform/reagent/entity/ReviewAndApprove.java index d551320..32c4160 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ReviewAndApprove.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReviewAndApprove.java @@ -38,4 +38,5 @@ public class ReviewAndApprove { @ApiModelProperty(value="指导书数组") List instructionBookList; + List centralizedRequestVOList; } diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/SupplierInformation.java b/src/main/java/digital/laboratory/platform/reagent/entity/SupplierInformation.java index f23e488..7aae337 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/SupplierInformation.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/SupplierInformation.java @@ -8,6 +8,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import java.time.LocalDateTime; +import java.util.Objects; + import lombok.Data; import lombok.EqualsAndHashCode; @@ -117,4 +119,16 @@ public class SupplierInformation extends BaseEntity { private String id; + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SupplierInformation that = (SupplierInformation) o; + return Objects.equals(acceptableCondition, that.acceptableCondition) && Objects.equals(contactNumber, that.contactNumber) && Objects.equals(contactPersonName, that.contactPersonName) && Objects.equals(nameOfSupplier, that.nameOfSupplier) && Objects.equals(photographOfSupplier, that.photographOfSupplier) && Objects.equals(photograph, that.photograph) && Objects.equals(qualificationDocument, that.qualificationDocument) && Objects.equals(qualificationDocumentName, that.qualificationDocumentName) && Objects.equals(scopeOfSupply, that.scopeOfSupply) && Objects.equals(supplierCoding, that.supplierCoding) && Objects.equals(supplierIdNumber, that.supplierIdNumber) && Objects.equals(supplierName, that.supplierName) && Objects.equals(supplierTelephone, that.supplierTelephone) && Objects.equals(number, that.number) && Objects.equals(id, that.id); + } + + @Override + public int hashCode() { + return Objects.hash(acceptableCondition, contactNumber, contactPersonName, nameOfSupplier, photographOfSupplier, photograph, qualificationDocument, qualificationDocumentName, scopeOfSupply, supplierCoding, supplierIdNumber, supplierName, supplierTelephone, number, id); + } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java b/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java index 1d7c29c..d39b1c3 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java @@ -36,4 +36,6 @@ public interface CentralizedRequestService extends IService CentralizedRequestVO getCentralizedRequestVO(String centralizedRequestId); List getVOList(QueryWrapper qw); + + CentralizedRequest auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/PurchaseCatalogueService.java b/src/main/java/digital/laboratory/platform/reagent/service/PurchaseCatalogueService.java index 43ffd4f..65dd830 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/PurchaseCatalogueService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/PurchaseCatalogueService.java @@ -44,4 +44,6 @@ public interface PurchaseCatalogueService extends IService { PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId); Page getVOpage(String name); + + PurchaseCatalogueVO getImport(List purchaseCatalogueDTOList); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/PurchaseListService.java b/src/main/java/digital/laboratory/platform/reagent/service/PurchaseListService.java index db27036..d1959ed 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/PurchaseListService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/PurchaseListService.java @@ -25,8 +25,10 @@ public interface PurchaseListService extends IService { // PurchaseListVO getPurchaseList(String purchaseListId); + void editById(List purchaseListDTOList); + // - PurchaseList commitById(String id); + PurchaseList commitById(List purchaseListDTOList); PurchaseListDetailsVO addDetails(PurchaseListDTO purchaseListDTO); diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java index 7ed5f63..7c3cf44 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/BatchDetailsServiceImpl.java @@ -64,12 +64,6 @@ public class BatchDetailsServiceImpl extends ServiceImpl centralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); //查询状态为1的采购申请:已提交 - centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus,1); + centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus,2); List list = centralizedRequestService.list(centralizedRequestLambdaQueryWrapper); @@ -209,6 +210,24 @@ public class CentralizedRequestServiceImpl extends ServiceImpl purchaseCatalogueDTOList) { + + int i = 1; + String message = null; + try { + + for (PurchaseCatalogueDTO purchaseCatalogueDTO : purchaseCatalogueDTOList) { + + if (StrUtil.isNotBlank(purchaseCatalogueDTO.getBrand()) & + StrUtil.isNotBlank(purchaseCatalogueDTO.getEnglishName()) & + StrUtil.isNotBlank(purchaseCatalogueDTO.getCategory()) & + StrUtil.isNotBlank(purchaseCatalogueDTO.getEnglishName()) & + StrUtil.isNotBlank(purchaseCatalogueDTO.getPackagedCopies()) & + StrUtil.isNotBlank(purchaseCatalogueDTO.getReagentConsumableName()) & + StrUtil.isNotBlank(purchaseCatalogueDTO.getSpecies()) & + StrUtil.isNotBlank(purchaseCatalogueDTO.getSpecificationAndModel()) & + StrUtil.isNotBlank(purchaseCatalogueDTO.getStandardValueOrPurity()) & + purchaseCatalogueDTO.getUnitPrice() != 0 & + StrUtil.isNotBlank(purchaseCatalogueDTO.getAlias()) & + StrUtil.isNotBlank(purchaseCatalogueDTO.getStorageCondition()) & + StrUtil.isNotBlank(purchaseCatalogueDTO.getRemark()) & + StrUtil.isNotBlank(purchaseCatalogueDTO.getMinimumUnit())& + StrUtil.isNotBlank(purchaseCatalogueDTO.getCasNumber()) + + ) { + i++; + } else { + + message = message + "\n" + "第" + i + "条数据有误,请改正后重新导入"; + i++; + } + } + + } catch (RuntimeException e) { + + throw new RuntimeException(message); + } + + PurchaseCatalogueVO purchaseCatalogueVO = new PurchaseCatalogueVO(); + + List catalogueDetailsList = new ArrayList<>(); + + for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) { + + CatalogueDetails catalogueDetails = new CatalogueDetails(); + + BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails); + + catalogueDetailsList.add(catalogueDetails); + } + + purchaseCatalogueVO.setCatalogueDetailsListList(catalogueDetailsList); + + return purchaseCatalogueVO; + } + } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java index 1bb0b97..dda40db 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java @@ -85,11 +85,34 @@ public class PurchaseListServiceImpl extends ServiceImpl purchaseListDTOList){ + + for (PurchaseListDTO purchaseListDTO : purchaseListDTOList) { + + PurchaseListDetails byId = purchaseListDetailsService.getById(purchaseListDTO.getId()); + + byId.setSupplierId(purchaseListDTO.getSupplierId()); + + purchaseListDetailsService.updateById(byId); + } + } + @Transactional @Override//提交采购清单 - public PurchaseList commitById(String id) { + public PurchaseList commitById(List purchaseListDTOList) { + + for (PurchaseListDTO purchaseListDTO : purchaseListDTOList) { + + PurchaseListDetails byId = purchaseListDetailsService.getById(purchaseListDTO.getId()); + + byId.setSupplierId(purchaseListDTO.getSupplierId()); + + purchaseListDetailsService.updateById(byId); + } - PurchaseList purchaseList = purchaseListService.getById(id); + PurchaseList purchaseList = purchaseListService.getById(purchaseListDTOList.get(0).getPurchaseListId()); purchaseList.setStatus(1); diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java index 178e4c2..97d00d9 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchasingPlanServiceImpl.java @@ -107,19 +107,18 @@ public class PurchasingPlanServiceImpl extends ServiceImpl reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -147,10 +147,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -168,8 +164,10 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl periodVerificationImplementationVOS = new ArrayList<>(); //供应商评价待审核列表 List evaluationFormVOS = new ArrayList<>(); + //集中采购申请待审核列表 + List centralizedRequestVOList = new ArrayList<>(); + + if (permissions.contains("reagent_centralized_request_audit")){ + + LambdaQueryWrapper centralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); + + centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus,1); + + List list = centralizedRequestService.list(centralizedRequestLambdaQueryWrapper); + + for (CentralizedRequest centralizedRequest : list) { + + CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(centralizedRequest.getId()); + + centralizedRequestVOList.add(centralizedRequestVO); + } + + } if (permissions.contains("reagent_decentralized_request_primary")) { @@ -501,6 +523,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl evaluationFormVOS = new ArrayList<>(); + List centralizedRequestVOList = new ArrayList<>(); + + if (permissions.contains("reagent_centralized_request_audit")){ + + LambdaQueryWrapper centralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); + + centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus,2); + + List list = centralizedRequestService.list(centralizedRequestLambdaQueryWrapper); + + for (CentralizedRequest centralizedRequest : list) { + + CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(centralizedRequest.getId()); + + centralizedRequestVOList.add(centralizedRequestVO); + } + + } if (permissions.contains("reagent_decentralized_request_primary")) { @@ -958,6 +999,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl batchDetailsList = batchDetailsService.list(Wrappers.query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId()) + .eq("supplier_id",byId.getSupplierId())); + + if (batchDetailsList.size()==0){ + batchDetails.setBatch(1); + }else { + batchDetails.setBatch(batchDetailsList.size()+1); + } + if (one.getCategory().equals("试剂")|one.getCategory().equals("耗材")){ + batchDetails.setLocation(warehousingRecordFormDTO.getLocation()); + batchDetails.setLatticeId(warehousingRecordFormDTO.getLatticeId()); + } one.setTotalQuantity(one.getTotalQuantity() + batchDetails.getQuantity()); - one.setWarningValue(warehousingRecordFormDTO.getWarning_value()); + one.setWarningValue(warehousingRecordFormDTO.getWarningValue()); if (one.getCategory().equals("标准物质")) { for (int j = 0; j < batchDetails.getQuantity(); j++) { ReferenceMaterial referenceMaterial = new ReferenceMaterial(); - referenceMaterial.setId(IdWorker.get32UUID().toUpperCase()); - referenceMaterial.setReagentConsumableId(one.getReagentConsumableId()); - referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId()); - referenceMaterial.setReagentConsumableInventoryId(one.getReagentConsumableInventoryId()); - referenceMaterial.setStatus(0); + referenceMaterial.setLocation(warehousingRecordFormDTO.getLocation()); + referenceMaterial.setLatticeId(warehousingRecordFormDTO.getLatticeId()); Calendar calendar = Calendar.getInstance(); @@ -378,36 +378,30 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl supplierInformations = new ArrayList<>(); - String evaluationFormId = null; + //创建供应商评价表 + /* + 通过循环签收内容,获得所有的供应商列表 + 为每一个供应商创建一个评价表 + */ for (WarehousingContent warehousingContent : list) { SupplierInformation supplierInformation = supplierInformationService.getById(warehousingContent.getSupplierId()); - if (supplierInformations.size()==0){ - supplierInformations.add(supplierInformation); - EvaluationForm evaluationForm = evaluationFormService.addForm(supplierInformation.getId()); - provideServicesOrSuppliesService.addById(evaluationForm.getId(),warehousingContent.getReagentConsumableId()); - evaluationFormId=evaluationForm.getId(); - warehousingContent.setEvaluationFormId(evaluationForm.getId()); - - }else if (!(supplierInformations.contains(supplierInformation))){ + if (!supplierInformations.contains(supplierInformation)){ supplierInformations.add(supplierInformation); EvaluationForm evaluationForm = evaluationFormService.addForm(supplierInformation.getId()); warehousingContent.setEvaluationFormId(evaluationForm.getId()); - evaluationFormId=evaluationForm.getId(); provideServicesOrSuppliesService.addById(evaluationForm.getId(),warehousingContent.getReagentConsumableId()); }else { - provideServicesOrSuppliesService.addById(evaluationFormId,warehousingContent.getReagentConsumableId()); - } - } - - for (SupplierInformation supplierInformation : supplierInformations) { - - evaluationFormService.addForm(supplierInformation.getId()); - + LambdaQueryWrapper evaluationFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); + evaluationFormLambdaQueryWrapper.eq(EvaluationForm::getSupplierInformationId,supplierInformation.getId()) + .orderByDesc(EvaluationForm::getCreateTime); + List list1 = evaluationFormService.list(evaluationFormLambdaQueryWrapper); + provideServicesOrSuppliesService.addById(list1.get(0).getId(),warehousingContent.getReagentConsumableId()); + } } warehousingRecordForm.setStatus(2); diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/BatchDetailsVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/BatchDetailsVO.java index 8d4c68e..6e4d1c9 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/BatchDetailsVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/BatchDetailsVO.java @@ -18,6 +18,4 @@ public class BatchDetailsVO extends BatchDetails { @ApiModelProperty(value="标准物质列表") List referenceMaterialVOS; - @ApiModelProperty(value="到期时间") - private LocalDate maturityTime; } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/CatalogueDetailsPrintVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/CatalogueDetailsPrintVO.java new file mode 100644 index 0000000..2520d02 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/reagent/vo/CatalogueDetailsPrintVO.java @@ -0,0 +1,17 @@ +package digital.laboratory.platform.reagent.vo; + +import lombok.Data; + +@Data +public class CatalogueDetailsPrintVO { + + private Integer number; + + private String category; + + private String reagentConsumableName; + + private String brand; + + private String specificationAndModel; +} diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCataloguePrintVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCataloguePrintVO.java new file mode 100644 index 0000000..66a7c92 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCataloguePrintVO.java @@ -0,0 +1,23 @@ +package digital.laboratory.platform.reagent.vo; + +import lombok.Data; + +import java.time.LocalDate; +import java.util.List; + +@Data +public class PurchaseCataloguePrintVO { + + private String name; + + private String id; + + private String size; + + private String secondaryAuditorName; + + private LocalDate auditTimeOfSecondary; + + private List voList; + +} diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml index 88fe945..93f3a2b 100644 --- a/src/main/resources/bootstrap.yml +++ b/src/main/resources/bootstrap.yml @@ -58,7 +58,7 @@ spring: # 文件上传相关 支持阿里云、华为云、腾讯、minio oss: - endpoint: http://192.168.9.73:9000 + endpoint: http://192.168.9.74:9000 accessKey: dlp secretKey: 87990016 bucket-name: dlpfiles diff --git a/src/main/resources/mapper/BatchDetailsMapper.xml b/src/main/resources/mapper/BatchDetailsMapper.xml index c413021..801a5a7 100644 --- a/src/main/resources/mapper/BatchDetailsMapper.xml +++ b/src/main/resources/mapper/BatchDetailsMapper.xml @@ -25,6 +25,9 @@ + + + diff --git a/src/main/resources/mapper/CatalogueDetailsMapper.xml b/src/main/resources/mapper/CatalogueDetailsMapper.xml index c150703..31ba6f5 100644 --- a/src/main/resources/mapper/CatalogueDetailsMapper.xml +++ b/src/main/resources/mapper/CatalogueDetailsMapper.xml @@ -23,6 +23,7 @@ + diff --git a/src/main/resources/mapper/OutgoingContentsMapper.xml b/src/main/resources/mapper/OutgoingContentsMapper.xml index bdc2a17..8049677 100644 --- a/src/main/resources/mapper/OutgoingContentsMapper.xml +++ b/src/main/resources/mapper/OutgoingContentsMapper.xml @@ -19,6 +19,9 @@ + + + diff --git a/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml b/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml index d0511c5..116c9e2 100644 --- a/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml +++ b/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml @@ -33,6 +33,7 @@ + diff --git a/src/main/resources/mapper/PurchaseCatalogueMapper.xml b/src/main/resources/mapper/PurchaseCatalogueMapper.xml index 90bc395..01097f2 100644 --- a/src/main/resources/mapper/PurchaseCatalogueMapper.xml +++ b/src/main/resources/mapper/PurchaseCatalogueMapper.xml @@ -50,9 +50,10 @@ WHERE user.user_id=pc.create_by ) AS create_name , ( - SELECT org.name - FROM dlp_base.sys_org org - WHERE org.org_id in (select org_id from dlp_base.sys_user where user_id = pc.create_by)) AS org_name + select department + from dlp_base.sys_user + where user_id = pc.create_by) as department + FROM purchase_catalogue pc diff --git a/src/main/resources/mapper/PurchasingPlanMapper.xml b/src/main/resources/mapper/PurchasingPlanMapper.xml index a6a2ef2..e613538 100644 --- a/src/main/resources/mapper/PurchasingPlanMapper.xml +++ b/src/main/resources/mapper/PurchasingPlanMapper.xml @@ -42,11 +42,11 @@ (select user.name from dlp_base.sys_user user where user.user_id = pp.primary_auditor_id) as primary_auditor_name - , - (SELECT org.name - FROM dlp_base.sys_org org - WHERE org.org_id in (select org_id from dlp_base.sys_user where user_id = pp.create_id)) AS org_name, - ( + , ( + select department + from dlp_base.sys_user + where user_id = pp.create_by) as org_name + , ( select user.name from dlp_base.sys_user user where user.user_id = pp.approver_id) as approver_name @@ -58,18 +58,20 @@ - - ${ew.customSqlSegment} - ${ew.customSqlSegment} - SELECT pp.*, (select user.name from dlp_base.sys_user user diff --git a/src/main/resources/mapper/ReferenceMaterialMapper.xml b/src/main/resources/mapper/ReferenceMaterialMapper.xml index 007462c..2b702c8 100644 --- a/src/main/resources/mapper/ReferenceMaterialMapper.xml +++ b/src/main/resources/mapper/ReferenceMaterialMapper.xml @@ -15,5 +15,7 @@ + +