diff --git a/pom.xml b/pom.xml index 8b31e0f..09b05d9 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,8 @@ 5.7.1 + + @@ -33,6 +35,28 @@ spring-boot-starter-thymeleaf + + + + com.google.zxing + core + 3.5.0 + + + com.google.zxing + javase + 3.5.0 + + + + + + org.aspectj + aspectjweaver + 1.8.13 + + + @@ -41,6 +65,13 @@ 2021.1 + + + digital.laboratory.platform + dlp-admin-api + 2022.10.11-snapshots + + digital.laboratory.platform @@ -97,6 +128,7 @@ + @@ -151,6 +183,13 @@ dlp-admin-api 2022.10.11-snapshots + + + + + + + org.testng testng diff --git a/src/main/java/digital/laboratory/platform/reagent/ReagentManagmentApplication.java b/src/main/java/digital/laboratory/platform/reagent/ReagentManagmentApplication.java index e90583a..e848781 100644 --- a/src/main/java/digital/laboratory/platform/reagent/ReagentManagmentApplication.java +++ b/src/main/java/digital/laboratory/platform/reagent/ReagentManagmentApplication.java @@ -7,6 +7,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; @Configuration // ??? @EnableDLPSwagger2 @@ -14,12 +15,12 @@ import org.springframework.context.annotation.Configuration; @EnableDiscoveryClient @EnableDLPResourceServer @SpringBootApplication(scanBasePackages="digital.laboratory.platform") +@EnableScheduling public class ReagentManagmentApplication { public static void main(String[] args) { SpringApplication.run(ReagentManagmentApplication.class, args); - // System.out.println("\n\n\n"); // System.out.println("-----------------------------"); // System.out.println("end of Spring Application main()"); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/AcceptanceRecordFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/AcceptanceRecordFormController.java index 3e47150..567df91 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/AcceptanceRecordFormController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/AcceptanceRecordFormController.java @@ -69,7 +69,7 @@ public class AcceptanceRecordFormController { */ @ApiOperation(value = "通过id查询", notes = "通过id查询") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_get')" ) public R getById(String acceptanceRecordFormId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -88,7 +88,7 @@ public class AcceptanceRecordFormController { */ @ApiOperation(value = "分页查询验收任务", notes = "分页查询验收任务") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_page')" ) + @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_page')" ) public R> getAcceptanceRecordFormPage(Page page, String reagentConsumableName, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -111,7 +111,7 @@ public class AcceptanceRecordFormController { */ @ApiOperation(value = "分页查询验收记录", notes = "分页查询验收记录") @GetMapping("/recordPage") - // @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_recordPage')" ) + @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_recordPage')" ) public R> getAcceptanceRecordFormRecordPage(Page page, String reagentConsumableName, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -138,7 +138,7 @@ public class AcceptanceRecordFormController { @ApiOperation(value = "录入(验收记录表)", notes = "录入(验收记录表)") @SysLog("录入(验收记录表)") @PutMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_add')" ) + @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_add')" ) public R postAddObject(@RequestBody AcceptanceRecordFormDTO acceptanceRecordFormDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -255,7 +255,7 @@ public class AcceptanceRecordFormController { @ApiOperation(value = "验收记录打印", notes = "验收记录打印") @SysLog("验收记录打印") @PostMapping("/print") -// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')") + @PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_print')") public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("bizApplyWord................."); Principal principal = theHttpServletRequest.getUserPrincipal(); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java index 61d7093..611ae0b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java @@ -53,7 +53,7 @@ public class ApplicationForUseController { */ @ApiOperation(value = "通过id查询", notes = "通过id查询") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_application_for_use_get')") + @PreAuthorize("@pms.hasPermission('reagent_application_for_use_get')") public R getById( String applicationForUseId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -74,7 +74,7 @@ public class ApplicationForUseController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_application_for_use_page')") + @PreAuthorize("@pms.hasPermission('reagent_application_for_use_page')") public R> getApplicationForUsePage(Page page, ApplicationForUse applicationForUse, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -95,7 +95,7 @@ public class ApplicationForUseController { @ApiOperation(value = "新增(试剂耗材领用申请表)", notes = "新增(试剂耗材领用申请表)") @SysLog("新增(试剂耗材领用申请表)") @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_application_for_use_add')") + @PreAuthorize("@pms.hasPermission('reagent_application_for_use_add')") public R postAddObject(@RequestBody List applicationForUseDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -118,7 +118,7 @@ public class ApplicationForUseController { @ApiOperation(value = "修改(试剂耗材领用申请表)", notes = "修改(试剂耗材领用申请表)") @SysLog("修改(试剂耗材领用申请表)") @PutMapping -// @PreAuthorize("@pms.hasPermission('reagent_application_for_use_edit')") + @PreAuthorize("@pms.hasPermission('reagent_application_for_use_edit')") public R putUpdateById(@RequestBody List applicationForUseDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -141,7 +141,7 @@ public class ApplicationForUseController { @ApiOperation(value = "通过id删除(试剂耗材领用申请表)", notes = "通过id删除(试剂耗材领用申请表)") @SysLog("通过id删除(试剂耗材领用申请表)") @DeleteMapping() -// @PreAuthorize("@pms.hasPermission('reagent_application_for_use_del')") + @PreAuthorize("@pms.hasPermission('reagent_application_for_use_del')") public R deleteById( String applicationForUseId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -161,7 +161,7 @@ public class ApplicationForUseController { @ApiOperation(value = "提交试剂耗材领用申请表", notes = "提交试剂耗材领用申请表") @SysLog("修改试剂耗材领用申请表") @PostMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_application_for_use_commit')") + @PreAuthorize("@pms.hasPermission('reagent_application_for_use_commit')") public R commitById(@RequestBody List applicationForUseDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); 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 f2f56f5..860163b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import digital.laboratory.platform.common.core.util.R; 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.CentralizedRequestDTO; import digital.laboratory.platform.reagent.entity.CentralizedRequest; @@ -17,6 +18,7 @@ import digital.laboratory.platform.reagent.entity.DetailsOfCentralized; import digital.laboratory.platform.reagent.service.CentralizedRequestService; import digital.laboratory.platform.reagent.service.DetailsOfCentralizedService; import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; +import digital.laboratory.platform.reagent.vo.PurchaseRequestPrintVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.security.access.prepost.PreAuthorize; @@ -27,6 +29,7 @@ import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.security.Principal; import java.sql.Date; import java.util.List; @@ -48,6 +51,7 @@ import java.util.List; @RequiredArgsConstructor @RequestMapping("/centralized_request") @Api(value = "centralized_request", tags = "集中采购申请管理") +@SuppressWarnings("all") public class CentralizedRequestController { @Autowired @@ -56,6 +60,9 @@ public class CentralizedRequestController { @Autowired private final DetailsOfCentralizedService detailsOfCentralizedService; + @Autowired + private final OssFile ossFile; + /** * 通过id查询(集中采购申请) * @@ -64,7 +71,7 @@ public class CentralizedRequestController { */ @ApiOperation(value = "通过id查询集中采购申请", notes = "通过id查询集中采购申请") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_centralized_request_get')") + @PreAuthorize("@pms.hasPermission('reagent_centralized_request_get')") public R getById(String centralizedRequestId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -88,7 +95,7 @@ public class CentralizedRequestController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('CentralizedPurchaseRequestList')") + @PreAuthorize("@pms.hasPermission('CentralizedPurchaseRequestList')") public R> getCentralizedRequestPage(Page page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -110,7 +117,7 @@ public class CentralizedRequestController { */ @ApiOperation(value = "采购计划整合集中采购申请分页查询", notes = "采购计划整合集中采购申请分页查询") @GetMapping("/list") -// @PreAuthorize("@pms.hasPermission('centralized_request_list_plan')") + @PreAuthorize("@pms.hasPermission('centralized_request_list_plan')") public R> getCentralizedRequestVOPage(@JsonFormat(pattern = "yyyy-MM-dd") Date startTime, @JsonFormat(pattern = "yyyy-MM-dd") Date endTime, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -136,7 +143,7 @@ public class CentralizedRequestController { @ApiOperation(value = "保存集中采购申请", notes = "保存集中采购申请") @SysLog("新增集中采购申请") @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_centralized_request_add')") + @PreAuthorize("@pms.hasPermission('reagent_centralized_request_add')") public R postAddObject(@RequestBody List centralizedRequestDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -161,7 +168,7 @@ public class CentralizedRequestController { @ApiOperation(value = "新增集中采购申请明细", notes = "新增集中采购申请明细") @SysLog("新增集中采购申请明细") @PostMapping("/details") -// @PreAuthorize("@pms.hasPermission('reagent_details_of_centralized_add')") + @PreAuthorize("@pms.hasPermission('reagent_details_of_centralized_add')") public R postAddDetails(@RequestBody CentralizedRequestDTO centralizedRequestDto, HttpServletRequest theHttpServletRequest) { DetailsOfCentralized detailsOfCentralized = centralizedRequestService.addDetailsById(centralizedRequestDto); @@ -182,7 +189,7 @@ public class CentralizedRequestController { @ApiOperation(value = "提交集中采购申请", notes = "提交集中采购申请") @SysLog("提交集中采购申请") @PostMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_centralized_request_commit')") + @PreAuthorize("@pms.hasPermission('reagent_centralized_request_commit')") public R postCommitObject(@RequestBody List centralizedRequestDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -208,7 +215,7 @@ public class CentralizedRequestController { @ApiOperation(value = "修改集中采购申请明细", notes = "修改集中采购申请明细") @SysLog("修改(集中采购申请)") @PutMapping -// @PreAuthorize("@pms.hasPermission('reagent_centralized_request_edit')") + @PreAuthorize("@pms.hasPermission('reagent_centralized_request_edit')") public R putUpdateById(@RequestBody CentralizedRequestDTO centralizedRequestDto, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -258,7 +265,7 @@ public class CentralizedRequestController { @ApiOperation(value = "通过id删除集中采购申请", notes = "通过id删除集中采购申请") @SysLog("通过id删除集中采购申请") @DeleteMapping() -// @PreAuthorize("@pms.hasPermission('reagent_centralized_request_del')") + @PreAuthorize("@pms.hasPermission('reagent_centralized_request_del')") public R deleteById(String centralizedRequestId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -280,7 +287,7 @@ public class CentralizedRequestController { @ApiOperation(value = "通过id删除集中采购申请明细", notes = "通过id删除集中采购申请明细") @SysLog("通过id删除(集中采购申请)") @DeleteMapping("/details") -// @PreAuthorize("@pms.hasPermission('reagent_details_of_centralized_del')") + @PreAuthorize("@pms.hasPermission('reagent_details_of_centralized_del')") public R deleteDetailsById(String detailsOfCentralizedId, HttpServletRequest theHttpServletRequest) { DetailsOfCentralized oldDetailsOfCentralized = detailsOfCentralizedService.getById(detailsOfCentralizedId); @@ -291,6 +298,41 @@ public class CentralizedRequestController { return R.failed(oldDetailsOfCentralized, "删除失败"); } } + + /**-------标准物质停用报废销毁恢复降级使用审批表打印*/ + /** + * 标准物质停用报废销毁恢复降级使用审批表打印 + * + * @param id + * @return + */ + @ApiOperation(value = "标准物质采购申请表打印", notes = "标准物质采购申请表打印") + @SysLog("标准物质采购申请表打印") + @PostMapping("/print") + @PreAuthorize("@pms.hasPermission('purchase_request_print')") + public void bizGetPDFInventory(String id, String type,HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { + System.out.println("bizApplyWord................."); + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + List voList = centralizedRequestService.getPurchaseRequestPrintList(id, type); + + if (voList == null) { + throw new RuntimeException("未查询到相关信息"); + } + String applyFileName = "标准物质采购申请表-" + id; + + String pdfFilePath = "document" + "/" + "purchaseRequest" + "/" + id + "/" + applyFileName + ".pdf"; + try { + //直接调用pdf方法 + centralizedRequestService.purchaseRequestTablePDF(voList,id,type, 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(); + } + } } diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java b/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java index 6b3d34a..a128b12 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java @@ -66,7 +66,7 @@ public class CheckScheduleController { */ @ApiOperation(value = "通过id查询新增标准物质期间核查计划和确认表", notes = "通过id查询新增标准物质期间核查计划和确认表") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_check_schedule_get')" ) public R getById(String checkScheduleId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -85,7 +85,7 @@ public class CheckScheduleController { */ @ApiOperation(value = "分页查询新增标准物质期间核查计划和确认表", notes = "分页查询新增标准物质期间核查计划和确认表") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_page)" ) + @PreAuthorize("@pms.hasPermission('reagent_check_schedule_page')" ) public R> getCheckSchedulePage(Page page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") Date startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") Date endTime, String status, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -109,7 +109,7 @@ public class CheckScheduleController { @ApiOperation(value = "新增标准物质期间核查计划和确认表", notes = "新增标准物质期间核查计划和确认表") @SysLog("新增") @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_add')" ) + @PreAuthorize("@pms.hasPermission('reagent_check_schedule_add')" ) public R postAddObject(@RequestBody List periodVerificationPlanDTOS, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -133,7 +133,7 @@ public class CheckScheduleController { @ApiOperation(value = "修改标准物质期间核查计划和确认表", notes = "修改标准物质期间核查计划和确认表") @SysLog("修改") @PutMapping -// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_edit')" ) + @PreAuthorize("@pms.hasPermission('reagent_check_schedule_edit')" ) public R putUpdateById(@RequestBody List periodVerificationPlanDTOS, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -154,7 +154,7 @@ public class CheckScheduleController { @ApiOperation(value = "提交计划标准物质期间核查计划和确认表", notes = "提交计划标准物质期间核查计划和确认表") @SysLog("提交计划") @PostMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_commit')" ) + @PreAuthorize("@pms.hasPermission('reagent_check_schedule_commit')" ) public R commitById(@RequestBody List periodVerificationPlanDTOS, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -197,7 +197,7 @@ public class CheckScheduleController { @ApiOperation(value = "期间核查计划打印", notes = "期间核查计划打印") @SysLog("期间核查计划打印") @PostMapping("/print") -// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')") + @PreAuthorize("@pms.hasPermission('reagent_check_schedule_print')") public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("bizApplyWord................."); Principal principal = theHttpServletRequest.getUserPrincipal(); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java index 298510a..a88c751 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java @@ -85,7 +85,7 @@ public class ComplianceCheckController { */ @ApiOperation(value = "通过id查询", notes = "通过id查询") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_compliance_check_get')" ) public R getById(String complianceCheckId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -104,7 +104,7 @@ public class ComplianceCheckController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_page)") + @PreAuthorize("@pms.hasPermission('reagent_compliance_check_page')") public R> getComplianceCheckPage(Page page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, String reagentConsumableName, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -152,7 +152,7 @@ public class ComplianceCheckController { @ApiOperation(value = "手动新增符合性检查记录表(试剂耗材)", notes = "手动新增符合性检查记录表(试剂耗材)") @SysLog("新增(符合性检查记录表)") @PostMapping("/addList") -// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_add')") + @PreAuthorize("@pms.hasPermission('reagent_compliance_check_add')") public R> addCheckList(@RequestBody List complianceCheckDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -176,7 +176,7 @@ public class ComplianceCheckController { @ApiOperation(value = "通过id删除(符合性检查记录表)", notes = "通过id删除(符合性检查记录表)") @SysLog("通过id删除(符合性检查记录表)") @DeleteMapping() -// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_del')" ) + @PreAuthorize("@pms.hasPermission('reagent_compliance_check_del')" ) public R deleteById(String complianceCheckId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -200,7 +200,7 @@ public class ComplianceCheckController { @ApiOperation(value = "编辑符合性检查记录表", notes = "编辑符合性检查记录表") @SysLog("编辑符合性检查记录表") @PutMapping("/edit") -// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_edit)" ) + @PreAuthorize("@pms.hasPermission('reagent_compliance_check_edit')" ) public R editCheckById(@RequestBody ComplianceCheckDTO complianceCheckDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -224,7 +224,7 @@ public class ComplianceCheckController { @ApiOperation(value = "录入符合性检查方案", notes = "录入符合性检查方案") @SysLog("编辑符合性检查记录表") @PutMapping("/addScheme") -// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_input')" ) + @PreAuthorize("@pms.hasPermission('reagent_compliance_check_input')" ) public R addScheme(@RequestBody ComplianceCheckDTO complianceCheckDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -248,7 +248,7 @@ public class ComplianceCheckController { @ApiOperation(value = "提交符合性检查记录表", notes = "提交符合性检查记录表") @SysLog("提交符合性检查记录表") @PutMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_commit)" ) + @PreAuthorize("@pms.hasPermission('reagent_compliance_check_commit')" ) public R commitCheck(@RequestBody ComplianceCheckDTO complianceCheckDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -318,7 +318,7 @@ public class ComplianceCheckController { @ApiOperation(value = "试剂耗材符合性检查打印", notes = "试剂耗材符合性检查打印") @SysLog("试剂耗材符合性检查打印") @PostMapping("/print") -// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')") + @PreAuthorize("@pms.hasPermission('reagent_compliance_check_print')") public void bizGetPDFInventory(String complianceCheckId, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("bizApplyWord................."); Principal principal = theHttpServletRequest.getUserPrincipal(); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizedRequestController.java b/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizedRequestController.java index c1afd26..e6e4a8b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizedRequestController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizedRequestController.java @@ -14,13 +14,15 @@ import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.DecentralizedRequestDTO; import digital.laboratory.platform.reagent.dto.PurchaseListDTO; -import digital.laboratory.platform.reagent.entity.DecentralizeDetails; -import digital.laboratory.platform.reagent.entity.DecentralizedRequest; -import digital.laboratory.platform.reagent.entity.PurchaseList; +import digital.laboratory.platform.reagent.entity.*; import digital.laboratory.platform.reagent.service.DecentralizeDetailsService; import digital.laboratory.platform.reagent.service.DecentralizedRequestService; import digital.laboratory.platform.reagent.service.PurchaseListService; import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO; +import digital.laboratory.platform.reagent.vo.ProcurementContentVO; +import digital.laboratory.platform.reagent.vo.PurchaseRequestPrintVO; +import digital.laboratory.platform.reagent.vo.PurchasingPlanVO; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -32,6 +34,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.security.Principal; +import java.util.ArrayList; import java.util.List; /** @@ -61,6 +64,8 @@ public class DecentralizedRequestController { @Autowired private PurchaseListService purchaseListService; + + /** * 通过id查询(分散采购申请) * @@ -69,7 +74,7 @@ public class DecentralizedRequestController { */ @ApiOperation(value = "通过id查询分散采购申请", notes = "通过id查询分散采购申请") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')") + @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')") public R getById(String decentralizedRequestId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -88,7 +93,7 @@ public class DecentralizedRequestController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')") + @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')") public R> getDecentralizedRequestPage(Page page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime , @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -113,7 +118,7 @@ public class DecentralizedRequestController { @ApiOperation(value = "保存分散采购申请", notes = "保存分散采购申请") @SysLog("新增分散采购申请") @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_add')") + @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_add')") public R postAddObject(@RequestBody List decentralizedRequestDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -141,7 +146,7 @@ public class DecentralizedRequestController { @ApiOperation(value = "新增分散采购申请明细", notes = "新增分散采购申请明细") @SysLog("新增分散采购申请明细") @PostMapping("/addDetails") -// @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_add')") + @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_add')") public R addDetails(@RequestBody DecentralizedRequestDTO decentralizedRequestDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -169,7 +174,7 @@ public class DecentralizedRequestController { @ApiOperation(value = "修改分散采购申请明细", notes = "修改分散采购申请明细") @SysLog("修改(分散采购申请)") @PutMapping -// @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_edit')") + @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_edit')") public R putUpdateById(@RequestBody DecentralizedRequestDTO decentralizedRequestDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -192,7 +197,7 @@ public class DecentralizedRequestController { @ApiOperation(value = "通过id删除分散采购申请", notes = "通过id删除分散采购申请") @SysLog("通过id删除(分散采购申请)") @DeleteMapping() -// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_del')") + @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_del')") public R deleteById(String decentralizedRequestId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -213,7 +218,7 @@ public class DecentralizedRequestController { @ApiOperation(value = "通过id删除分散采购申请明细", notes = "通过id删除分散采购申请明细") @SysLog("通过id删除分散采购申请明细") @DeleteMapping("/details") -// @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_del')") + @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_del')") public R deleteDetailsById(String decentralizeDetailsId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -238,7 +243,7 @@ public class DecentralizedRequestController { @ApiOperation(value = "提交分散采购申请", notes = "提交分散采购申请") @SysLog("提交分散采购申请明细") @PutMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_commit')") + @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_commit')") public R commitById(@RequestBody List decentralizedRequestDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -330,7 +335,7 @@ public class DecentralizedRequestController { @ApiOperation(value = "审批分散采购申请", notes = "审批分散采购申请") @SysLog("审批分散采购申请明细") @PutMapping("/approve") -// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_approve')") + @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_approve')") public R approveRequest(@RequestBody AuditAndApproveDTO auditAndApproveDto, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -346,4 +351,6 @@ public class DecentralizedRequestController { return R.ok(decentralizedRequest, "审批成功"); } else return R.failed("审批失败"); } + + } diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/DeliveryRegistrationFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/DeliveryRegistrationFormController.java index 60b4e6c..ef5b905 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/DeliveryRegistrationFormController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/DeliveryRegistrationFormController.java @@ -58,7 +58,7 @@ public class DeliveryRegistrationFormController { */ @ApiOperation(value = "通过ID查询", notes = "通过ID查询") @GetMapping( ) -// @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_get')" ) public R getById(String deliveryRegistrationFormId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -75,7 +75,7 @@ public class DeliveryRegistrationFormController { */ @ApiOperation(value = "通过领取码查询", notes = "通过领取码查询") @GetMapping("/code") -// @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_get')" ) public R getDeliveryRegistrationFormVOByCode(String claimCode, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -93,7 +93,7 @@ public class DeliveryRegistrationFormController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page" ) -// @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_page')" ) + @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_page')" ) public R> getDeliveryRegistrationFormPage(Page page, DeliveryRegistrationForm deliveryRegistrationForm, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -126,7 +126,7 @@ public class DeliveryRegistrationFormController { @ApiOperation(value = "提交(试剂耗材出库登记表)", notes = "提交(试剂耗材出库登记表)") @SysLog("提交(试剂耗材出库登记表)" ) @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_commit')" ) + @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_commit')" ) public R postAddObject(@RequestBody List outgoingContentsDTOS, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/EvaluationFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/EvaluationFormController.java index 73db688..3e141b7 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/EvaluationFormController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/EvaluationFormController.java @@ -54,7 +54,7 @@ public class EvaluationFormController { @ApiOperation(value = "通过id查询(服务商/供应商评价表)", notes = "通过id查询(服务商/供应商评价表)") @SysLog("通过id查询(服务商/供应商评价表)" ) @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_evaluation_form_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_evaluation_form_get')" ) public R getEvaluationFormVO(String id, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -75,7 +75,7 @@ public class EvaluationFormController { @ApiOperation(value = "录入并提交(服务商/供应商评价表)", notes = "录入并提交(服务商/供应商评价表)") @SysLog("录入并提交(服务商/供应商评价表)" ) @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_evaluation_form_add')" ) + @PreAuthorize("@pms.hasPermission('reagent_evaluation_form_add')" ) public R postAddObject(@RequestBody EvaluationFormDTO evaluationFormDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java b/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java index 52ce993..37744f5 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java @@ -112,7 +112,7 @@ public class InstructionBookController { ossFile.fileGet(fileNames, httpServletResponse.getOutputStream()); - instructionBookService.save(instructionBook1); + instructionBookService.updateById(instructionBook1); return R.ok(instructionBook1, "上传成功"); } else return R.failed("上传失败"); @@ -188,11 +188,11 @@ public class InstructionBookController { @SysLog("审核(标准物质期间核查指导书)(标准物质期间核查指导书)") @PostMapping("/audit") @PreAuthorize("@pms.hasPermission('reagent_instruction_book_audit')") - public R auditById(AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + public R auditById(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - InstructionBook instructionBook = instructionBookService.auditById(auditAndApproveDTO, dlpUser); + InstructionBookVO instructionBook = instructionBookService.auditById(auditAndApproveDTO, dlpUser); InstructionBookVO vo = instructionBookService.getVO(instructionBook.getReferenceMaterialTypeId()); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java index 108b0ad..cf3e8ad 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java @@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.security.Principal; +import java.time.LocalDate; import java.util.List; /** @@ -62,7 +63,7 @@ public class PeriodVerificationImplementationController { */ @ApiOperation(value = "通过id查询", notes = "通过id查询") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_get')" ) public R getById(String periodVerificationImplementationId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -76,20 +77,20 @@ public class PeriodVerificationImplementationController { * 分页查询 * * @param page 分页对象 - * @param periodVerificationImplementation (标准物质期间核查实施情况及结果记录表) + * @param * @return */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_page')" ) - public R> getPeriodVerificationImplementationPage(Page page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, String referenceMaterialName, PeriodVerificationImplementation periodVerificationImplementation, HttpServletRequest theHttpServletRequest) { + @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_page')" ) + public R> getPeriodVerificationImplementationPage(Page page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") java.time.LocalDate endTime, String referenceMaterialName, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); IPage periodVerificationImplementationSList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.query() .like(StrUtil.isNotBlank(referenceMaterialName), "reference_material_name", referenceMaterialName) - .ge("create_time", startTime) - .le("create_time", endTime) + .ge(startTime!=null,"create_time", startTime) + .le(endTime!=null,"create_time", endTime) .orderByDesc("create_time") ); return R.ok(periodVerificationImplementationSList); @@ -106,7 +107,7 @@ public class PeriodVerificationImplementationController { @ApiOperation(value = "录入(标准物质期间核查实施情况及结果记录表)", notes = "录入((标准物质期间核查实施情况及结果记录表)") @SysLog("录入((标准物质期间核查实施情况及结果记录表)") @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_edit')" ) + @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_edit')" ) public R putUpdateById(@RequestBody PeriodVerificationImplementationDTO periodVerificationImplementationDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -153,7 +154,7 @@ public class PeriodVerificationImplementationController { @ApiOperation(value = "提交(标准物质期间核查实施情况及结果记录表)", notes = "提交(标准物质期间核查实施情况及结果记录表)") @SysLog("提交(标准物质期间核查实施情况及结果记录表)") @PostMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_commit')" ) + @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_commit')" ) public R commitById(@RequestBody PeriodVerificationImplementationDTO periodVerificationImplementationDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -201,7 +202,7 @@ public class PeriodVerificationImplementationController { @ApiOperation(value = "标准物质期间核查计划和确认表打印", notes = "标准物质期间核查计划和确认表打印") @SysLog("期间核查计划打印") @PostMapping("/print") -// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')") + @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_print')") public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("bizApplyWord................."); Principal principal = theHttpServletRequest.getUserPrincipal(); 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 e8af101..bf5674b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java @@ -91,7 +91,7 @@ public class PurchaseCatalogueController { */ @ApiOperation(value = "分页查询已发布的采购目录明细", notes = "分页查询已发布的采购目录明细") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_getPage')") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_pages')") public R> getPurchaseCataloguePage(String name,HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -112,7 +112,7 @@ public class PurchaseCatalogueController { */ @ApiOperation(value = "分页查询制定编辑的采购目录", notes = "分页查询制定编辑的采购目录") @GetMapping("/pages") -// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_getPage')") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_pages')") public R> getPurchaseCatalogueVOPage(Page page,@DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) { IPage purchaseCatalogueVOPage = purchaseCatalogueService.getPurchaseCatalogueVOPage(page, Wrappers.query().orderByDesc("create_time")); @@ -139,7 +139,7 @@ public class PurchaseCatalogueController { */ @ApiOperation(value = "主页点击一行通过id查询", notes = "主页点击一行通过id查询") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_get')") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_get')") public R getById(String purchaseCatalogueId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -167,7 +167,7 @@ public class PurchaseCatalogueController { @ApiOperation(value = "保存采购目录", notes = "保存采购目录") @SysLog("新增(采购目录)") @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_add')") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_add')") public R postAddObject(@RequestBody List purchaseCatalogueDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -193,7 +193,7 @@ public class PurchaseCatalogueController { @ApiOperation(value = "修改采购目录明细", notes = "修改采购目录明细") @SysLog("修改明细采购目录明细") @PutMapping -// @PreAuthorize("@pms.hasPermission('reagent_catalogue_details_edit')") + @PreAuthorize("@pms.hasPermission('reagent_catalogue_details_edit')") public R putUpdateById(@RequestBody PurchaseCatalogueDTO purchaseCatalogueDto, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -218,7 +218,7 @@ public class PurchaseCatalogueController { @ApiOperation(value = "创建采购目录明细", notes = "创建采购目录明细") @SysLog("创建采购目录明细") @PostMapping("/details") -// @PreAuthorize("@pms.hasPermission('reagent_catalogue_details_add')") + @PreAuthorize("@pms.hasPermission('reagent_catalogue_details_add')") public R addDetails(@RequestBody PurchaseCatalogueDTO purchaseCatalogueDto, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -243,7 +243,7 @@ public class PurchaseCatalogueController { @ApiOperation(value = "通过id删除采购目录", notes = "通过id删除采购目录") @SysLog("通过id删除采购目录") @DeleteMapping("/catalogue") -// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_del')") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_del')") public R deleteById(String purchaseCatalogueId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -267,7 +267,7 @@ public class PurchaseCatalogueController { @ApiOperation(value = "通过id删除采购目录明细", notes = "通过id删除采购目录明细") @SysLog("通过id删除采购目录") @DeleteMapping("/details") -// @PreAuthorize("@pms.hasPermission('reagent_catalogue_details_del')") + @PreAuthorize("@pms.hasPermission('reagent_catalogue_details_del')") public R deleteDetailsById(String catalogueDetailsId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -292,7 +292,7 @@ public class PurchaseCatalogueController { @ApiOperation(value = "提交采购目录", notes = "提交采购目录") @SysLog("提交采购目录") @PostMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_commit')") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_commit')") public R commitById(@RequestBody List purchaseCatalogueDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -367,7 +367,7 @@ public class PurchaseCatalogueController { @ApiOperation(value = "发布采购目录", notes = "发布采购目录") @SysLog("发布采购目录") @PutMapping("/release") -// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_release')") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_release')") public R releaseById( String purchaseCatalogueId, HttpServletRequest theHttpServletRequest) { PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.releaseCatalogue(purchaseCatalogueId); @@ -389,7 +389,7 @@ public class PurchaseCatalogueController { @ApiOperation(value = "导入采购目录", notes = "导入采购目录") @SysLog("导入采购目录") @PostMapping("/import") -// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_release')") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_import')") public R getImport( @RequestBody List purchaseCatalogueDTOList, HttpServletRequest theHttpServletRequest) { PurchaseCatalogueVO anImport = purchaseCatalogueService.getImport(purchaseCatalogueDTOList); @@ -408,7 +408,7 @@ public class PurchaseCatalogueController { @ApiOperation(value = "采购目录打印", notes = "采购目录打印") @SysLog("采购目录打印") @PostMapping("/print") -// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_print')") public void bizGetPDFInventory(String purchaseCatalogueId, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("bizApplyWord................."); Principal principal = theHttpServletRequest.getUserPrincipal(); 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 bbd8362..8d038d7 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java @@ -1,5 +1,6 @@ package digital.laboratory.platform.reagent.controller; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -8,13 +9,12 @@ import com.fasterxml.jackson.annotation.JsonFormat; import digital.laboratory.platform.common.core.util.R; 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.PurchaseListDTO; import digital.laboratory.platform.reagent.entity.PurchaseList; import digital.laboratory.platform.reagent.entity.PurchaseListDetails; import digital.laboratory.platform.reagent.service.PurchaseListService; -import digital.laboratory.platform.reagent.vo.PurchaseListDetailsVO; -import digital.laboratory.platform.reagent.vo.PurchaseListPageVO; -import digital.laboratory.platform.reagent.vo.PurchaseListVO; +import digital.laboratory.platform.reagent.vo.*; import org.joda.time.DateTime; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.security.access.prepost.PreAuthorize; @@ -38,105 +38,112 @@ import java.util.List; * * @author Zhang Xiaolong created at 2023-03-10 * @describe (采购清单) 前端控制器 - * + *

* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中 * 这里写什么: - * 为前端提供数据, 接受前端的数据 - * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理 - * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的 + * 为前端提供数据, 接受前端的数据 + * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理 + * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的 * 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换 */ @RestController @RequiredArgsConstructor -@RequestMapping("/purchase_list" ) +@RequestMapping("/purchase_list") @Api(value = "purchase_list", tags = "(采购清单)管理") public class PurchaseListController { - private final PurchaseListService purchaseListService; + private final PurchaseListService purchaseListService; + private final OssFile ossFile; - /** - * 通过id查询(采购清单) - * @param purchaseListId id - * @return R - */ - @ApiOperation(value = "通过id查询", notes = "通过id查询") - @GetMapping( ) -// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_get')" ) - public R getById(String purchaseListId, HttpServletRequest theHttpServletRequest) { + /** + * 通过id查询(采购清单) + * + * @param purchaseListId id + * @return R + */ + @ApiOperation(value = "通过id查询", notes = "通过id查询") + @GetMapping() + @PreAuthorize("@pms.hasPermission('reagent_purchase_list_get')") + public R getById(String purchaseListId, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); + Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - PurchaseListVO purchaseList = purchaseListService.getPurchaseList(purchaseListId); + PurchaseListVO purchaseList = purchaseListService.getPurchaseList(purchaseListId); - return R.ok(purchaseList); - } + return R.ok(purchaseList); + } - /** + /** * 分页查询 + * * @param page 分页对象 * @return */ @ApiOperation(value = "分页查询", notes = "分页查询") - @GetMapping("/page" ) -// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_page')" ) - public R> getPurchaseListPage(Page page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime , @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - IPage purchaseListSList = purchaseListService.getPurchaseListVOPage(page, Wrappers.query() - .ge(startTime!=null,"create_time",startTime) - .le(endTime!=null,"create_time",endTime) - .orderByDesc("create_time") - ); - return R.ok(purchaseListSList); + @GetMapping("/page") + @PreAuthorize("@pms.hasPermission('reagent_purchase_list_page')") + public R> getPurchaseListPage(Page page, Integer status, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) { + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + IPage purchaseListSList = purchaseListService.getPurchaseListVOPage(page, Wrappers.query() + .eq(status != null, "status", status) + .ge(startTime != null, "create_time", startTime) + .le(endTime != null, "create_time", endTime) + .orderByDesc("create_time") + ); + return R.ok(purchaseListSList); // return R.ok(purchaseListService.page(page, Wrappers.query(purchaseList))); } /** * 新增(采购清单) + * * @param purchaseListDTO (采购清单) * @return R */ @ApiOperation(value = "修改采购清单明细", notes = "修改采购清单明细") - @SysLog("修改采购清单明细" ) + @SysLog("修改采购清单明细") @PutMapping -// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_add')" ) - public R postAddObject(@RequestBody List purchaseListDTO, HttpServletRequest theHttpServletRequest) { + @PreAuthorize("@pms.hasPermission('reagent_purchase_list_add')") + public R postAddObject(@RequestBody List purchaseListDTO, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); + Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - purchaseListService.editById(purchaseListDTO); + purchaseListService.editById(purchaseListDTO); - return R.ok("添加成功"); + return R.ok("添加成功"); } - /** - * 新增(采购清单) - * @param id (采购清单) - * @return R - */ - @ApiOperation(value = "提交采购清单明细", notes = "提交采购清单明细") - @SysLog("提交采购清单明细" ) - @PutMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_commit)" ) - public R commitById(String id, HttpServletRequest theHttpServletRequest) { - - Principal principal = theHttpServletRequest.getUserPrincipal(); - - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - PurchaseList purchaseList = purchaseListService.commitById(id); - - if (purchaseList!=null) { - return R.ok(purchaseList, "提交成功"); - } - else { - return R.failed(purchaseList, "提交失败"); - } - } + + /** + * 新增(采购清单) + * + * @param id (采购清单) + * @return R + */ + @ApiOperation(value = "提交采购清单明细", notes = "提交采购清单明细") + @SysLog("提交采购清单明细") + @PutMapping("/commit") + @PreAuthorize("@pms.hasPermission('reagent_purchase_list_commit')") + public R commitById(String id, HttpServletRequest theHttpServletRequest) { + + Principal principal = theHttpServletRequest.getUserPrincipal(); + + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + PurchaseList purchaseList = purchaseListService.commitById(id); + + if (purchaseList != null) { + return R.ok(purchaseList, "提交成功"); + } else { + return R.failed(purchaseList, "提交失败"); + } + } + } diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PurchasingPlanController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PurchasingPlanController.java index 096e9eb..38c850b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchasingPlanController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/PurchasingPlanController.java @@ -84,7 +84,7 @@ public class PurchasingPlanController { */ @ApiOperation(value = "点击一行通过id查询采购计划明细", notes = "点击一行通过id查询采购计划明细") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')") + @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')") public R getById(String purchasingPlanId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -103,7 +103,7 @@ public class PurchasingPlanController { */ @ApiOperation(value = "查询换货信息", notes = "查询换货信息") @GetMapping("/replacement") -// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_replacemen')") + @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_replacemen')") public R getReplacementVO(String id, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -122,7 +122,7 @@ public class PurchasingPlanController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')") + @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')") public R> getPurchasingPlanPage(Page page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime, HttpServletRequest theHttpServletRequest) { @@ -156,7 +156,7 @@ public class PurchasingPlanController { @ApiOperation(value = "新增(采购计划)", notes = "新增(采购计划) 参数DTO:(detailsOfCentralizedId,quantity = ,)") @SysLog("新增(采购计划)") @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_add')" ) + @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_add')" ) public R postAddObject(@RequestBody List purchasingPlanDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -179,7 +179,7 @@ public class PurchasingPlanController { @ApiOperation(value = "修改采购计划明细", notes = "修改采购计划明细") @SysLog("修改(采购计划)") @PutMapping -// @PreAuthorize("@pms.hasPermission('reagent_procurement_content_edit')") + @PreAuthorize("@pms.hasPermission('reagent_procurement_content_edit')") public R putUpdateById(@RequestBody PurchasingPlanDTO purchasingPlanDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -204,7 +204,7 @@ public class PurchasingPlanController { @ApiOperation(value = "修改采购计划合并明细", notes = "修改采购计划合并明细") @SysLog("修改(采购计划)") @PutMapping("/details") -// @PreAuthorize("@pms.hasPermission('reagent_procurement_content_merge')") + @PreAuthorize("@pms.hasPermission('reagent_procurement_content_merge')") public R editDetails(@RequestBody PurchasingPlanDTO purchasingPlanDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -229,7 +229,7 @@ public class PurchasingPlanController { @ApiOperation(value = "通过id删除采购计划明细", notes = "通过id删除采购计划明细") @SysLog("通过id删除采购计划明细") @DeleteMapping("/content") -// @PreAuthorize("@pms.hasPermission('reagent_procurement_content_del')") + @PreAuthorize("@pms.hasPermission('reagent_procurement_content_del')") public R deleteContentById(String procurementContentId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -253,7 +253,7 @@ public class PurchasingPlanController { @ApiOperation(value = "提交采购计划", notes = "提交采购计划") @SysLog("修改(采购计划)") @PutMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_commit')") + @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_commit')") public R commitById(String purchasingPlanId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -278,7 +278,7 @@ public class PurchasingPlanController { @ApiOperation(value = "换货", notes = "换货") @SysLog("(换货)") @PutMapping("/replacement") -// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_replacemen')") + @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_replacemen')") public R replacementById(@RequestBody PurchasingPlanDTO purchasingPlanDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -354,7 +354,7 @@ public class PurchasingPlanController { @ApiOperation(value = "采购计划打印", notes = "采购计划打印") @SysLog("采购计划打印") @PostMapping("/print") -// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')") + @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_print')") public void bizGetPDFInventory(String purchasingPlanId, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("bizApplyWord................."); Principal principal = theHttpServletRequest.getUserPrincipal(); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java index 9507157..c79a0e7 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java @@ -11,12 +11,13 @@ import com.fasterxml.jackson.annotation.JsonFormat; import digital.laboratory.platform.common.core.util.R; 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.config.QRCodeUtils; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.service.ReagentConsumableInventoryService; import digital.laboratory.platform.reagent.service.ReferenceMaterialService; -import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO; -import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO; +import digital.laboratory.platform.reagent.vo.*; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -24,11 +25,14 @@ import lombok.RequiredArgsConstructor; import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.web.bind.annotation.*; +import javax.imageio.ImageIO; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; import java.io.IOException; import java.security.Principal; import java.sql.Date; +import java.util.ArrayList; import java.util.List; /** @@ -54,23 +58,7 @@ public class ReagentConsumableInventoryController { private final ReferenceMaterialService referenceMaterialService; - /** - * 通过id查询试剂耗材库存 - * - * @param reagentConsumableInventoryId id - * @return R - */ - @ApiOperation(value = "通过id查询", notes = "通过id查询") - @GetMapping("/{reagentConsumableInventoryId}") -// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')") - public R getById(@PathVariable("reagentConsumableInventoryId") String reagentConsumableInventoryId, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - ReagentConsumableInventory reagentConsumableInventory = reagentConsumableInventoryService.getById(reagentConsumableInventoryId); - return R.ok(reagentConsumableInventory); - //return R.ok(reagentConsumableInventoryService.getById(reagentConsumableInventoryId)); - } + private final OssFile ossFile; /** * @param @@ -78,7 +66,7 @@ public class ReagentConsumableInventoryController { */ @ApiOperation(value = "标准物质列表", notes = "标准物质列表") @GetMapping("/RList") -// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) public R> getReagentConsumableInventoryPage(Integer current, Integer size, String reagentConsumableName, Integer referenceMaterialStatus, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -93,20 +81,21 @@ public class ReagentConsumableInventoryController { } - Page allList = reagentConsumableInventoryService.getAllList(current, size, reagentConsumableInventoryQueryWrapper,referenceMaterialStatus); + Page allList = reagentConsumableInventoryService.getAllList(current, size, reagentConsumableInventoryQueryWrapper, referenceMaterialStatus); return R.ok(allList); // return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory))); } @ApiOperation(value = "标准物质管理列表", notes = "标准物质管理列表") @GetMapping("/standardList") -// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) public R> getReagentConsumableInventoryList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); IPage reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, Wrappers.query() - .like(StrUtil.isNotBlank(reagentConsumableName),"reagent_consumable_name",reagentConsumableName) + .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName) .eq("category", "标准物质").or() + .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName) .eq("category", "标准储备溶液")); return R.ok(reagentConsumableInventoryRMVOList); // return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory))); @@ -114,13 +103,14 @@ public class ReagentConsumableInventoryController { @ApiOperation(value = "试剂耗材管理列表", notes = "试剂耗材管理列表") @GetMapping("/List") -// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) public R> getList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); IPage reagentConsumableInventoryRMVOList = reagentConsumableInventoryService.getReagentConsumableInventoryRMVOList(page, Wrappers.query() - .like(StrUtil.isNotBlank(reagentConsumableName),"reagent_consumable_name",reagentConsumableName) + .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName) .eq("category", "试剂").or() + .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName) .eq("category", "耗材")); return R.ok(reagentConsumableInventoryRMVOList); // return R.ok(reagentConsumableInventoryService.page(page, Wrappers.query(reagentConsumableInventory))); @@ -133,12 +123,20 @@ public class ReagentConsumableInventoryController { */ @ApiOperation(value = "试剂耗材列表", notes = "试剂耗材列表") @GetMapping("/MList") -// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) - public R> getReferenceMaterialVOList(Integer current, Integer size, String reagentConsumableName, HttpServletRequest theHttpServletRequest) { + @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) + public R> getReferenceMaterialVOList(Page page, String reagentConsumableName, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - Page allRM = reagentConsumableInventoryService.getAllRM(current, size, reagentConsumableName); + QueryWrapper reagentConsumableInventoryQueryWrapper = new QueryWrapper<>(); + + IPage allRM = reagentConsumableInventoryService.getAllRM(page, reagentConsumableInventoryQueryWrapper + .eq("category", "试剂") + .like(!StrUtil.isEmpty(reagentConsumableName), "reagent_consumable_name", reagentConsumableName).or() + .eq("category", "耗材") + .like(!StrUtil.isEmpty(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)); + + return R.ok(allRM); } @@ -150,93 +148,124 @@ public class ReagentConsumableInventoryController { */ @ApiOperation(value = "试剂耗材/标准物质集合列表", notes = "试剂耗材/标准物质集合列表") @GetMapping("/full") -// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) - public R> getReagentConsumableInventoryFull( String category,String name, HttpServletRequest theHttpServletRequest) { + @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')" ) + public R> getReagentConsumableInventoryFull(String category, String name, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); QueryWrapper reagentConsumableInventoryQueryWrapper = new QueryWrapper<>(); - if (category!=null){ - reagentConsumableInventoryQueryWrapper.eq("category",category); + if (category != null) { + reagentConsumableInventoryQueryWrapper.eq("category", category); } - if (name!=null){ - reagentConsumableInventoryQueryWrapper.like("reagent_consumable_name",name); + if (name != null) { + reagentConsumableInventoryQueryWrapper.like("reagent_consumable_name", name); } List reagentConsumableInventoryFull = reagentConsumableInventoryService.getReagentConsumableInventoryFull(Wrappers.query() - .eq((StrUtil.isNotBlank(category)),"category",category) - .like((StrUtil.isNotBlank(name)),"reagent_consumable_name",name)); + .eq((StrUtil.isNotBlank(category)), "category", category) + .like((StrUtil.isNotBlank(name)), "reagent_consumable_name", name)); return R.ok(reagentConsumableInventoryFull); } + + /**-------标准物质一览表打印*/ /** - * 新增试剂耗材库存 + * 标准物质一览表打印 * - * @param reagentConsumableInventory 试剂耗材库存 - * @return R + * @param + * @return */ - @ApiOperation(value = "新增试剂耗材库存", notes = "新增试剂耗材库存") - @SysLog("新增试剂耗材库存") - @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_add')" ) - public R postAddObject(@RequestBody ReagentConsumableInventory reagentConsumableInventory, HttpServletRequest theHttpServletRequest) { + @ApiOperation(value = "标准物质一览表打印", notes = "标准物质一览表打印") + @SysLog("标准物质一览表打印") + @PostMapping("/print") + @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_print')") + public void bizGetPDFInventory( HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { + System.out.println("bizApplyWord................."); Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - reagentConsumableInventory.setReagentConsumableInventoryId(IdWorker.get32UUID().toUpperCase()); - if (reagentConsumableInventoryService.save(reagentConsumableInventory)) { - return R.ok(reagentConsumableInventory, "对象创建成功"); - } else { - return R.failed(reagentConsumableInventory, "对象创建失败"); + String id = IdWorker.get32UUID().toUpperCase(); + + List voList = referenceMaterialService.getReferenceMaterialList(); + + if (voList.isEmpty()) { + throw new RuntimeException("未查询到相关信息"); + } + + + String applyFileName = "标准物质一览表-" + id; + + String pdfFilePath = "document" + "/" + "referenceMaterial" + "/" + id + "/" + applyFileName + ".pdf"; + try { + //直接调用pdf方法 + reagentConsumableInventoryService.referenceMaterialTablePDF(voList, 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(); } } /** - * 修改试剂耗材库存 + * 生成 QRCODE 图像 * - * @param reagentConsumableInventory 试剂耗材库存 - * @return R + * @param code QRCODE字符串 + * + * @return R */ - @ApiOperation(value = "修改试剂耗材库存", notes = "修改试剂耗材库存") - @SysLog("修改试剂耗材库存") - @PutMapping -// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_edit')" ) - public R putUpdateById(@RequestBody ReagentConsumableInventory reagentConsumableInventory, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - if (reagentConsumableInventoryService.updateById(reagentConsumableInventory)) { - return R.ok(reagentConsumableInventory, "保存对象成功"); - } else { - return R.failed(reagentConsumableInventory, "保存对象失败"); + @ApiOperation(value = "生成 QRCODE 图像", notes = "生成 QRCODE 图像") + @GetMapping("/qrcode") + public void genQRCode(String code, HttpServletResponse httpServletResponse) throws IOException { + try { + // QR Code + httpServletResponse.setContentType("image/png"); + BufferedImage qrImage = QRCodeUtils.genQRCode(code, 150, 150); + ImageIO.write(qrImage, "png", httpServletResponse.getOutputStream()); + } catch (Exception e) { + httpServletResponse.sendError(501, e.toString()); } } /** - * 通过id删除试剂耗材库存 + * 生成 BARCODE 图像 + * + * @param code QRCODE字符串 * - * @param reagentConsumableInventoryId id - * @return R + * @return R */ - @ApiOperation(value = "通过id删除试剂耗材库存", notes = "通过id删除试剂耗材库存") - @SysLog("通过id删除试剂耗材库存") - @DeleteMapping() -// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_del')" ) - public R deleteById(String reagentConsumableInventoryId, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + @ApiOperation(value = "生成条形码", notes = "生成条形码") + @GetMapping("/code") + @PreAuthorize("@pms.hasAnyPermission('reagent_reagent_consumable_inventory_get')" ) - ReagentConsumableInventory oldReagentConsumableInventory = reagentConsumableInventoryService.getById(reagentConsumableInventoryId); + public String getBarCodeImageBase64( String code, HttpServletResponse httpServletResponse) throws IOException { + + + return reagentConsumableInventoryService.buildCodeLabelContent(code); - if (reagentConsumableInventoryService.removeById(reagentConsumableInventoryId)) { - return R.ok(oldReagentConsumableInventory, "对象删除成功"); - } else { - return R.failed(oldReagentConsumableInventory, "对象删除失败"); - } } + /** + * 生成 BARCODE 图像 + * + * @param code QRCODE字符串 + * + * @return R + */ + @ApiOperation(value = "扫码录入物品编码", notes = "扫码录入物品编码") + @PutMapping("/code") + @PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')") + public R setCode( String id,String code,HttpServletResponse httpServletResponse) { + + reagentConsumableInventoryService.setCode(id,code); + + return R.ok("录入成功"); + } + + + } diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumablesController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumablesController.java index 8f1f820..ae62ffe 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumablesController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumablesController.java @@ -54,14 +54,16 @@ public class ReagentConsumablesController { */ @ApiOperation(value = "分页查询试剂耗材类(包括标准物质)", notes = "分页查询试剂耗材类(包括标准物质)") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_reagent_consumables_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_reagent_consumables_get')" ) public R> getReagentConsumablesPage(Page page, String name, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); List list = reagentConsumablesService.list(Wrappers.query() - .eq("category", "试剂").or() - .eq("category", "耗材").or() + .eq("category", "试剂") + .like(StrUtil.isNotBlank(name), "reagent_consumable_name", name).or() + .eq("category", "耗材") + .like(StrUtil.isNotBlank(name), "reagent_consumable_name", name).or() .eq("category", "标准物质") .like(StrUtil.isNotBlank(name), "reagent_consumable_name", name) .orderByDesc("create_time") diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/RequisitionRecordController.java b/src/main/java/digital/laboratory/platform/reagent/controller/RequisitionRecordController.java index 1a27185..2cb85ec 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/RequisitionRecordController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/RequisitionRecordController.java @@ -52,7 +52,7 @@ public class RequisitionRecordController { @ApiOperation(value = "试剂耗材领用记录表打印", notes = "试剂耗材领用记录表打印") @SysLog("试剂耗材领用申请表打印") @PostMapping("/print") -// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')") + @PreAuthorize("@pms.hasPermission('reagent_application_for_use_print')") public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("bizApplyWord................."); Principal principal = theHttpServletRequest.getUserPrincipal(); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java index f55a486..9fb881b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java @@ -67,7 +67,7 @@ public class StandardMaterialApprovalFormController { */ @ApiOperation(value = "通过id查询", notes = "通过id查询") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" ) public R getById(String id, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -86,7 +86,7 @@ public class StandardMaterialApprovalFormController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_page)" ) + @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_page')" ) public R> getStandardMaterialApprovalFormPage(Page page, String referenceMaterialName, @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -112,7 +112,7 @@ public class StandardMaterialApprovalFormController { @ApiOperation(value = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)") @SysLog("新增(标准物质停用/报废销毁/恢复/降级使用审批表)") @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_add')" ) + @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_add')" ) public R postAddObject(@RequestBody StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -198,19 +198,28 @@ public class StandardMaterialApprovalFormController { @ApiOperation(value = "标准物质停用", notes = "标准物质停用") @SysLog("标准物质停用") @PostMapping("/deactivate") -// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_deactivate')" ) + @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_deactivate')" ) public R editById(String id, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); ReferenceMaterial byId = referenceMaterialService.getById(id); - byId.setStatus(-1); - - if (referenceMaterialService.updateById(byId)) { - return R.ok("停用成功"); + if (byId.getStatus() == -1) { + byId.setStatus(0); + if (referenceMaterialService.updateById(byId)) { + return R.ok("启用成功"); + } else { + return R.failed("启用失败"); + } } else { - return R.failed("停用失败"); + byId.setStatus(-1); + + if (referenceMaterialService.updateById(byId)) { + return R.ok("停用成功"); + } else { + return R.failed("停用失败"); + } } } @@ -224,7 +233,7 @@ public class StandardMaterialApprovalFormController { @ApiOperation(value = "标准物质停用报废销毁恢复降级使用审批表打印", notes = "标准物质停用报废销毁恢复降级使用审批表打印") @SysLog("标准物质停用报废销毁恢复降级使用审批表打印") @PostMapping("/print") -// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')") + @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_print')") public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("bizApplyWord................."); Principal principal = theHttpServletRequest.getUserPrincipal(); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java b/src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java index c4f9b48..69f52cb 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java @@ -67,7 +67,7 @@ public class StandardReserveSolutionController { */ @ApiOperation(value = "通过id查询", notes = "通过id查询") @GetMapping( ) -// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_get')" ) public R getById(String id, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -85,7 +85,7 @@ public class StandardReserveSolutionController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page" ) -// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_page')" ) public R> getStandardReserveSolutionPage(Page page, String solutionName, @DateTimeFormat(pattern = "yyyy-MM-dd")@JsonFormat(pattern = "yyyy-MM-dd") DateTime startTime, @DateTimeFormat(pattern = "yyyy-MM-dd")@JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime , HttpServletRequest theHttpServletRequest) throws ParseException { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -108,7 +108,7 @@ public class StandardReserveSolutionController { @ApiOperation(value = "新增(标准储备溶液配制及使用记录表)", notes = "新增(标准储备溶液配制及使用记录表)") @SysLog("新增(标准储备溶液配制及使用记录表)" ) @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_add')" ) + @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_add')" ) public R postAddObject(@RequestBody StandardReserveSolutionDTO standardReserveSolutionDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -127,7 +127,7 @@ public class StandardReserveSolutionController { @ApiOperation(value = "入库(标准储备溶液配制及使用记录表)", notes = "入库(标准储备溶液配制及使用记录表)") @SysLog("入库(标准储备溶液配制及使用记录表)" ) @PostMapping("warehousing") -// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_warehousing')" ) + @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_warehousing')" ) public R warehousingById(@RequestBody StandardReserveSolutionFullDTO standardReserveSolutionFullDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -146,7 +146,7 @@ public class StandardReserveSolutionController { */ @ApiOperation(value = "通过id查询标准储备溶液入库记录", notes = "通过id查询标准储备溶液入库记录") @GetMapping( "/full") -// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_full')" ) + @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_full')" ) public R getFullVOById(String id, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -168,7 +168,7 @@ public class StandardReserveSolutionController { @ApiOperation(value = "标准储备溶液配制及使用记录表打印", notes = "标准储备溶液配制及使用记录表打印") @SysLog("标准储备溶液配制及使用记录表打印") @PostMapping("/print") -// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')") + @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_print')") public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("bizApplyWord................."); Principal principal = theHttpServletRequest.getUserPrincipal(); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/StandardSolutionCurveController.java b/src/main/java/digital/laboratory/platform/reagent/controller/StandardSolutionCurveController.java index 776ebb9..86a261b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/StandardSolutionCurveController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/StandardSolutionCurveController.java @@ -66,7 +66,7 @@ public class StandardSolutionCurveController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_get')" ) public R> getStandardSolutionCurvePage(Page page, String solutionName, @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) { @@ -94,7 +94,7 @@ public class StandardSolutionCurveController { @ApiOperation(value = "新增(标准工作曲线溶液配置记录表)", notes = "新增(标准工作曲线溶液配置记录表)") @SysLog("新增(标准工作曲线溶液配置记录表)") @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_add')" ) + @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_add')" ) public R postAddObject(@RequestBody StandardSolutionCurveDTO standardSolutionCurveDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -118,7 +118,7 @@ public class StandardSolutionCurveController { @ApiOperation(value = "标准工作曲线溶液配置记录表打印", notes = "标准工作曲线溶液配置记录表打印") @SysLog("标准工作曲线溶液配置记录表打印") @PostMapping("/print") -// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')") + @PreAuthorize("@pms.hasPermission('reagent_standard_solution_curve_print')") public void bizGetPDFInventory(String idList, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { String[] ids = idList.split(","); 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 1e72f00..a78d4a6 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java @@ -70,7 +70,7 @@ public class SupplierInformationController { */ @ApiOperation(value = "通过id查询(服务商/供应商信息)", notes = "通过id查询(服务商/供应商信息)") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" ) public R getById(String supplierInformationId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -91,7 +91,7 @@ public class SupplierInformationController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_page')" ) + @PreAuthorize("@pms.hasPermission('reagent_supplier_information_page')" ) public R> getSupplierInformationPage(Page page, String supplierName, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -116,7 +116,7 @@ public class SupplierInformationController { @SysLog("新增服务商/供应商信息") @PostMapping @Transactional -// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_add')" ) + @PreAuthorize("@pms.hasPermission('reagent_supplier_information_add')" ) public R postAddObject(@RequestBody SupplierInformationDTO supplierInformationDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -142,7 +142,7 @@ public class SupplierInformationController { @ApiOperation(value = "修改服务商/供应商信息", notes = "修改服务商/供应商信息") @SysLog("修改服务商/供应商信息") @PutMapping -// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_edit')" ) + @PreAuthorize("@pms.hasPermission('reagent_supplier_information_edit')" ) public R putUpdateById(@RequestBody SupplierInformationDTO supplierInformationDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -159,51 +159,11 @@ public class SupplierInformationController { } - /** - * 上传供应人照片 - * - * @param id 上传供应人照片 - * @return R - */ - @ApiOperation(value = "上传供应人照片", notes = "上传供应人照片/供应商信息") - @SysLog("修改服务商/供应商信息") - @PostMapping("/upload/{id}") -// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_add')" ) - public R putUpdateById(@PathVariable("id") String id, @RequestPart(value = "file") MultipartFile file, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { - - Principal principal = theHttpServletRequest.getUserPrincipal(); - - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - SupplierInformation supplierInformation = supplierInformationService.getById(id); - - if (supplierInformation != null) { - - String path = "reagen_managment" + "/" + "supplierInformation" + "/" + supplierInformation.getId(); - String fileName = FileNameUtil.getName(file.getOriginalFilename()); - boolean r = ossFile.fileUpload(file, path); - Map ResultData = new HashMap<>(); - ResultData.put("fileName", fileName); - ResultData.put("path", path); - - if (r) { - //修改数据库 - supplierInformation.setPhotographOfSupplier(path); - supplierInformation.setPhotograph(fileName); - supplierInformationService.updateById(supplierInformation); - String fileNames = path + "/" + fileName; - ossFile.fileGet(fileNames, httpServletResponse.getOutputStream()); - return R.ok(supplierInformation, "上传成功"); - } else return R.failed("上传失败"); - - } else return null; - } - @ApiOperation(value = "上传资质文件", notes = "上传资质文件") @SysLog("上传资质文件") @PostMapping("/uploadQd") -// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_add')" ) + @PreAuthorize("@pms.hasPermission('reagent_supplier_information_add')" ) public R uploadById(String id, @RequestPart(value = "file", required = false) MultipartFile file, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -233,7 +193,7 @@ public class SupplierInformationController { @ApiOperation(value = "预览资质文件", notes = "预览资质文件") @SysLog("预览资质文件") @GetMapping("/downloadQd") -// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" ) public R downloadById(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -262,7 +222,7 @@ public class SupplierInformationController { @ApiOperation(value = "预览供应人照片", notes = "预览供应人照片") @SysLog("预览供应人照片") @GetMapping("/download") -// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" ) public R download(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -303,7 +263,7 @@ public class SupplierInformationController { notes = "上传供应商图片,使用fastjson 解析json 对象") @SysLog("上传供应商图片,使用fastjson 解析json 对象") @PostMapping(value = "/picture_base64/{id}") -// @PreAuthorize("@pms.hasAnyPermission('HairJobSampleCreate')") + @PreAuthorize("@pms.hasAnyPermission('reagent_supplier_information_add')") public R uploadPictureBase64(@PathVariable("id") String id, @RequestBody JSONObject jsonParam) throws Exception { // System.out.println(String.format("uploadPhotoObj: hairSampleId=%s jsonParam.size()=%d", hairSampleId, jsonParam.size())); SupplierInformation byId = supplierInformationService.getById(id); 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 679fa35..aa68379 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java @@ -66,7 +66,7 @@ public class WarehousingRecordFormController { */ @ApiOperation(value = "通过id查询入库信息", notes = "通过id查询入库信息") @GetMapping() -// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_get')" ) + @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_get')" ) public R getById(String warehousingRecordFormId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -85,7 +85,7 @@ public class WarehousingRecordFormController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')") + @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')") public R> getWarehousingRecordFormVOPage(Page page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -108,7 +108,7 @@ public class WarehousingRecordFormController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/pageWC") -// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')") + @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')") public R> getWarehousingContentVOPage(Page page, String name, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -135,7 +135,7 @@ public class WarehousingRecordFormController { @ApiOperation(value = "新增签收记录表", notes = "新增签收记录表") @SysLog("新增签收记录表") @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_add')") + @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_add')") public R postAddObject(@RequestBody List warehousingRecordFormDTOList, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/ApplicationForUseDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/ApplicationForUseDTO.java index 7500092..5caffd6 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/ApplicationForUseDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/ApplicationForUseDTO.java @@ -10,7 +10,7 @@ import java.util.List; public class ApplicationForUseDTO { @ApiModelProperty(value = "(标准物质编号)") - private String referenceMaterialNumber; + private String referenceMaterialId; @ApiModelProperty(value = "(备注)") diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/DecentralizedRequestDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/DecentralizedRequestDTO.java index 6254f08..4df705b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/DecentralizedRequestDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/DecentralizedRequestDTO.java @@ -64,7 +64,7 @@ public class DecentralizedRequestDTO { private String alias; @ApiModelProperty(value="备注") - private String remark; + private String remarks; @ApiModelProperty(value="(英文名)") private String englishName; diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApplicationDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApplicationDTO.java index 8d798a5..372af60 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApplicationDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApplicationDTO.java @@ -17,6 +17,9 @@ public class StandardMaterialApplicationDTO { @ApiModelProperty(value = "位置信息") private String location; + @ApiModelProperty(value = "柜子ID") + private String boxId; + @ApiModelProperty(value = "是否用完") private Boolean outOfUse; } 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 0445460..cf5d61f 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/StandardReserveSolutionFullDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/StandardReserveSolutionFullDTO.java @@ -9,4 +9,6 @@ public class StandardReserveSolutionFullDTO { private String latticeId; private String warehousingRemarks; private String location; + + private String boxId; } 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 72771b4..b60bc33 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java @@ -21,6 +21,9 @@ public class WarehousingRecordFormDTO { @ApiModelProperty(value = "批号") private String batchNumber; + @ApiModelProperty(value = "物品编码") + private String code; + @JsonFormat(pattern = "yyyy-MM-dd") @JSONField(format = "yyyy-MM-dd") @ApiModelProperty(value = "(生产日期)") @@ -60,5 +63,6 @@ public class WarehousingRecordFormDTO { @ApiModelProperty(value = "(保管人名称)") private String custodianName; - + @ApiModelProperty(value="柜子ID") + private String boxId; } diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/AppStartupRunner.java b/src/main/java/digital/laboratory/platform/reagent/entity/AppStartupRunner.java deleted file mode 100644 index 872a1d2..0000000 --- a/src/main/java/digital/laboratory/platform/reagent/entity/AppStartupRunner.java +++ /dev/null @@ -1,130 +0,0 @@ -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 c626eb0..bf3241c 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java @@ -103,7 +103,7 @@ public class BatchDetails extends BaseEntity { /** * (使用状态) */ - @ApiModelProperty(value="(使用状态)") + @ApiModelProperty(value="(使用状态 1 库存充足 -1 库存为0)") private Integer serviceStatus; /** @@ -117,6 +117,12 @@ public class BatchDetails extends BaseEntity { @ApiModelProperty(value = "(位置信息)") private String location; + @ApiModelProperty(value="柜子ID") + private String boxId; + + @ApiModelProperty(value="预警信息") + private String warningInformation; + 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 f60aae8..7eded43 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/CatalogueDetails.java @@ -121,6 +121,8 @@ public class CatalogueDetails extends BaseEntity { @ApiModelProperty(value = "CAS-号") private String casNumber; + @ApiModelProperty(value = "物品编码") + private String code; /** * 备注 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 44ccd56..d4221fb 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/CentralizedRequest.java @@ -36,8 +36,6 @@ public class CentralizedRequest extends BaseEntity { @ApiModelProperty(value="申请人ID") private String applicantId; - - /** * (申请日期) */ @@ -53,7 +51,7 @@ public class CentralizedRequest extends BaseEntity { /** * (状态) */ - @ApiModelProperty(value="状态(0:未提交,1:已提交,2:已被制定采购计划)") + @ApiModelProperty(value="状态(0:未提交,1:已提交,2:已审核 3:已被制定采购计划 ,4:已被制定采购清单)") private Integer status; /** 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 6350e6b..bdfc781 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/OutgoingContents.java @@ -63,6 +63,9 @@ public class OutgoingContents extends BaseEntity { @ApiModelProperty(value = "(标准物质ID)") private String referenceMaterialId; + @ApiModelProperty(value = "(出库编码)") + private String code; + @ApiModelProperty(value = "(批次ID)") private String batchDetailsId; @@ -72,6 +75,8 @@ public class OutgoingContents extends BaseEntity { @ApiModelProperty(value = "(位置信息)") private String location; + @ApiModelProperty(value="柜子ID") + private String boxId; /** * outgoingContentsId */ diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ProcurementContent.java b/src/main/java/digital/laboratory/platform/reagent/entity/ProcurementContent.java index 4a55ef3..cb4b250 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ProcurementContent.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ProcurementContent.java @@ -26,6 +26,7 @@ import lombok.EqualsAndHashCode; @ApiModel(value = "(采购内容)") public class ProcurementContent extends BaseEntity { + /** * (采购计划id) */ 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 4627fae..8a28ee6 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java @@ -27,6 +27,11 @@ import lombok.EqualsAndHashCode; @ApiModel(value = "试剂耗材库存") public class ReagentConsumableInventory extends BaseEntity { + @ApiModelProperty(value = "CAS-号") + private String casNumber; + + @ApiModelProperty(value = "物品编码") + private String code; /** * 名称 */ 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..b1e6724 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumables.java @@ -30,6 +30,11 @@ public class ReagentConsumables extends BaseEntity { @ApiModelProperty(value="品牌") private String brand; + @ApiModelProperty(value = "CAS-号") + private String casNumber; + + @ApiModelProperty(value = "物品编码") + private String code; /** * 类别 */ diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumablesSet.java b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumablesSet.java index 6bf4f50..63a512c 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumablesSet.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumablesSet.java @@ -34,7 +34,7 @@ public class ReagentConsumablesSet extends BaseEntity { private String applicationForUseId; @ApiModelProperty(value = "(标准物质编号)") - private String referenceMaterialNumber; + private String referenceMaterialId; @ApiModelProperty(value = "(出库明细ID)") private String outgoingContentId; 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 d088e6f..7134f1d 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReferenceMaterial.java @@ -27,10 +27,13 @@ public class ReferenceMaterial extends BaseEntity { */ @ApiModelProperty(value="标准物质编号") private String number; + + @ApiModelProperty(value="打印序列号") + private String code; /** * number */ - @ApiModelProperty(value="状态(0为可以使用,-1为停用,-2为降级使用、-3 已被领用") + @ApiModelProperty(value="状态(0为可以使用,-1为停用,-2为降级使用、-3 已被领用,-4 使用完毕,报废") private Integer status; /** @@ -53,6 +56,9 @@ public class ReferenceMaterial extends BaseEntity { @ApiModelProperty(value="位置信息") private String location; + @ApiModelProperty(value="柜子ID") + private String boxId; + /** * id */ @@ -63,7 +69,7 @@ public class ReferenceMaterial extends BaseEntity { @ApiModelProperty(value="试剂耗材(含标准物质)仓库表ID") private String reagentConsumableInventoryId; - @ApiModelProperty(value="试剂耗材(含标准物质)仓库表ID") + @ApiModelProperty(value="保管人名称") private String custodianName; } diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingBatchList.java b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingBatchList.java index 743cf05..858dacb 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingBatchList.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingBatchList.java @@ -32,6 +32,11 @@ public class WarehousingBatchList extends BaseEntity { */ @ApiModelProperty(value="(批次)") private Integer batch; + /** + * (批次) + */ + @ApiModelProperty(value="(批次)") + private String batchId; /** * (批号) diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java index 7623715..9dde6d9 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java @@ -38,6 +38,8 @@ public class WarehousingContent extends BaseEntity { @ApiModelProperty(value = "(总数量)") private Integer totalQuantity; + @ApiModelProperty(value = "物品编码") + private String code; /** * (签收记录表ID) */ @@ -78,5 +80,8 @@ public class WarehousingContent extends BaseEntity { @ApiModelProperty(value = "采购清单明细ID") private String purchaseListDetailsId; + + @ApiModelProperty(value = "预警值") + private Integer warningValue; } diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/DecentralizeDetailsMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/DecentralizeDetailsMapper.java index 3f3f3bd..fae7896 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/DecentralizeDetailsMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/DecentralizeDetailsMapper.java @@ -17,5 +17,5 @@ import java.util.List; @Mapper public interface DecentralizeDetailsMapper extends BaseMapper { - + List getDecentralizeDetailsList(String id); } diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/InstructionBookMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/InstructionBookMapper.java index 2e2e4b4..33fe580 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/InstructionBookMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/InstructionBookMapper.java @@ -2,6 +2,7 @@ package digital.laboratory.platform.reagent.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import digital.laboratory.platform.reagent.entity.InstructionBook; +import digital.laboratory.platform.reagent.vo.InstructionBookVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -14,4 +15,5 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface InstructionBookMapper extends BaseMapper { + InstructionBookVO getInstructionBookVO(String id); } diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java index a8c0b8a..f0706ee 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java @@ -5,10 +5,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; +import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO; import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO; +import digital.laboratory.platform.reagent.vo.UserVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 试剂耗材库存 Mapper 接口 * @@ -19,5 +23,7 @@ import org.apache.ibatis.annotations.Param; public interface ReagentConsumableInventoryMapper extends BaseMapper { IPage getReagentConsumableInventoryVOPage (IPagepage, @Param(Constants.WRAPPER) QueryWrapper qw); + IPage getReagentConsumableInventoryFullVOPage (IPagepage, @Param(Constants.WRAPPER) QueryWrapper qw); + List getUserList(); } diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/ReferenceMaterialMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/ReferenceMaterialMapper.java index a0ae96e..3803872 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/ReferenceMaterialMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/ReferenceMaterialMapper.java @@ -2,9 +2,12 @@ package digital.laboratory.platform.reagent.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import digital.laboratory.platform.reagent.entity.ReferenceMaterial; +import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * Mapper 接口 * @@ -14,4 +17,6 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface ReferenceMaterialMapper extends BaseMapper { + List getReferenceMaterialVOList (); + } 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 d39b1c3..662d5fb 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java @@ -9,7 +9,10 @@ import digital.laboratory.platform.reagent.dto.CentralizedRequestDTO; import digital.laboratory.platform.reagent.entity.CentralizedRequest; import digital.laboratory.platform.reagent.entity.DetailsOfCentralized; import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; +import digital.laboratory.platform.reagent.vo.PurchaseRequestPrintVO; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -38,4 +41,8 @@ public interface CentralizedRequestService extends IService List getVOList(QueryWrapper qw); CentralizedRequest auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser); + + List getPurchaseRequestPrintList(String id, String type); + + void purchaseRequestTablePDF(List voList, String id, String type, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception; } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/DecentralizeDetailsService.java b/src/main/java/digital/laboratory/platform/reagent/service/DecentralizeDetailsService.java index e5cab04..2a72e9a 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/DecentralizeDetailsService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/DecentralizeDetailsService.java @@ -3,6 +3,7 @@ package digital.laboratory.platform.reagent.service; import com.baomidou.mybatisplus.extension.service.IService; import digital.laboratory.platform.reagent.entity.DecentralizeDetails; import digital.laboratory.platform.reagent.vo.DecentralizeDetailsVO; +import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO; import java.util.List; @@ -16,4 +17,5 @@ public interface DecentralizeDetailsService extends IService getDecentralizeDetailsList (String decentralizedRequestId); + DecentralizedRequestVO getDecentralizedRequest(String id); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/InstructionBookService.java b/src/main/java/digital/laboratory/platform/reagent/service/InstructionBookService.java index b3e6884..381303a 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/InstructionBookService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/InstructionBookService.java @@ -14,7 +14,7 @@ import digital.laboratory.platform.reagent.vo.InstructionBookVO; */ public interface InstructionBookService extends IService { - InstructionBook auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser); + InstructionBookVO auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser); InstructionBookVO getVO(String id); } 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 3d3d2bd..3dd1244 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/PurchaseListService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/PurchaseListService.java @@ -10,8 +10,11 @@ import digital.laboratory.platform.reagent.entity.PurchaseListDetails; import digital.laboratory.platform.reagent.vo.PurchaseListDetailsVO; import digital.laboratory.platform.reagent.vo.PurchaseListPageVO; import digital.laboratory.platform.reagent.vo.PurchaseListVO; +import digital.laboratory.platform.reagent.vo.PurchaseRequestPrintVO; import org.apache.ibatis.annotations.Param; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -33,4 +36,5 @@ public interface PurchaseListService extends IService { PurchaseListDetailsVO addDetails(PurchaseListDTO purchaseListDTO); IPage getPurchaseListVOPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java b/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java index f147ec5..4d866cd 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java @@ -8,7 +8,11 @@ import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO; import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO; +import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO; +import digital.laboratory.platform.reagent.vo.UserVO; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -19,20 +23,23 @@ import java.util.List; */ public interface ReagentConsumableInventoryService extends IService { - Page getReagentConsumableInventoryVOList(Page page,String name); - ReagentConsumableInventory addById(String reagentConsumableId, Integer quantity); ReagentConsumableInventory reduceById(String reagentConsumableId, Integer quantity); - ReferenceMaterial deactivateById(String referenceMaterialId); - Page getAllList(Integer current, Integer size, QueryWrapper qw,Integer status); //分页查询试剂耗材 - Page getAllRM(Integer current, Integer size,String reagentConsumableName); + IPage getAllRM(IPage page, QueryWrapper qw); IPage getReagentConsumableInventoryRMVOList(IPage page,QueryWrapperqw); List getReagentConsumableInventoryFull(QueryWrapper qw); + + void referenceMaterialTablePDF(List voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception; + + //试剂/耗材扫描物品编码进行持久化 + void setCode(String id, String code); + + String buildCodeLabelContent(String code); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/ReferenceMaterialService.java b/src/main/java/digital/laboratory/platform/reagent/service/ReferenceMaterialService.java index 8edb605..c3c8a60 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/ReferenceMaterialService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/ReferenceMaterialService.java @@ -19,5 +19,5 @@ public interface ReferenceMaterialService extends IService { List getReferenceMaterialVOList(String batchDetailsId); - void standardSolutionCurveTablePDF(List voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception; + List getReferenceMaterialList(); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java index 5ccc15f..6f9c254 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java @@ -112,7 +112,14 @@ public class ApplicationForUseServiceImpl extends ServiceImpl reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -155,6 +162,7 @@ public class ApplicationForUseServiceImpl extends ServiceImpl applicationForUseDTOList, DLPUser dlpUser) { 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 7c3cf44..44648e8 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 @@ -17,6 +17,8 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java index 7bc8fc5..e54bad0 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java @@ -1,27 +1,40 @@ package digital.laboratory.platform.reagent.service.impl; +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.service.impl.ServiceImpl; +import com.deepoove.poi.XWPFTemplate; +import com.deepoove.poi.config.Configure; +import com.deepoove.poi.config.ConfigureBuilder; +import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; +import digital.laboratory.platform.common.feign.RemoteWord2PDFService; 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.CentralizedRequestDTO; -import digital.laboratory.platform.reagent.entity.CentralizedRequest; -import digital.laboratory.platform.reagent.entity.DetailsOfCentralized; +import digital.laboratory.platform.reagent.entity.*; import digital.laboratory.platform.reagent.mapper.CentralizedRequestMapper; -import digital.laboratory.platform.reagent.service.CentralizedRequestService; -import digital.laboratory.platform.reagent.service.DetailsOfCentralizedService; -import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; -import digital.laboratory.platform.reagent.vo.DetailsOfCentralizedVO; +import digital.laboratory.platform.reagent.service.*; +import digital.laboratory.platform.reagent.vo.*; +import feign.Response; +import org.apache.commons.io.output.ByteArrayOutputStream; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; /** @@ -40,6 +53,32 @@ public class CentralizedRequestServiceImpl extends ServiceImpl centralizedRequestDTOList, DLPUser dlpUser) { @@ -224,6 +263,171 @@ public class CentralizedRequestServiceImpl extends ServiceImpl getPurchaseRequestPrintList(String id, String type) { + ArrayList purchaseRequestPrintVOList = new ArrayList<>(); + + if(type.equals("集中采购申请")){ + + CentralizedRequestVO centralizedRequest = centralizedRequestService.getCentralizedRequestVO(id); + + List detailsOfCentralizedVOList = centralizedRequest.getDetailsOfCentralizedVOList(); + + + for (DetailsOfCentralizedVO detailsOfCentralized : detailsOfCentralizedVOList) { + + ReagentConsumables reagentConsumables = reagentConsumablesService.getById(detailsOfCentralized.getReagentConsumableId()); + + if (reagentConsumables.getCategory().equals("标准物质")){ + + PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO(); + purchaseRequestPrintVO.setApplicantName(centralizedRequest.getApplicantName()); + purchaseRequestPrintVO.setPurpose(detailsOfCentralized.getPurpose()); + purchaseRequestPrintVO.setQuantity(detailsOfCentralized.getQuantityPurchased()); + purchaseRequestPrintVO.setRemarks(detailsOfCentralized.getRemarks()); + purchaseRequestPrintVO.setReagentConsumableName(reagentConsumables.getReagentConsumableName()); + purchaseRequestPrintVO.setSpecificationAndModel(reagentConsumables.getSpecificationAndModel()); + purchaseRequestPrintVO.setUnitPrice(procurementContentService.getById(detailsOfCentralized.getProcurementContentId()).getUnitPrice()); + purchaseRequestPrintVO.setSubtotal(procurementContentService.getById(detailsOfCentralized.getProcurementContentId()).getSubtotal()); + purchaseRequestPrintVO.setSupplierName(supplierInformationService.getById(purchaseListDetailsService.getOne(Wrappers.query().eq("procurement_content_id", detailsOfCentralized.getProcurementContentId())).getSupplierId()).getSupplierName()); + purchaseRequestPrintVOList.add(purchaseRequestPrintVO);} + + + } + }else { + + DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(id); + + for (DecentralizeDetails decentralizeDetails : requestById.getDecentralizeDetailsVOList()) { + + if (decentralizeDetails.getCategory().equals("标准物质")){ + + PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO(); + + BeanUtils.copyProperties(decentralizeDetails, purchaseRequestPrintVO); + + purchaseRequestPrintVO.setPurpose(decentralizeDetails.getPurpose()); + purchaseRequestPrintVO.setApplicantName(requestById.getApplicantName()); + purchaseRequestPrintVO.setRemarks(decentralizeDetails.getRemarks()); + + purchaseRequestPrintVO.setSubtotal(purchaseRequestPrintVO.getUnitPrice() * purchaseRequestPrintVO.getQuantity()); + //查找出供应商名称 + purchaseRequestPrintVO.setSupplierName(supplierInformationService.getById(purchaseListDetailsService.getById(decentralizeDetails.getPurchaseListDetailsId()).getSupplierId()).getSupplierName()); + + purchaseRequestPrintVOList.add(purchaseRequestPrintVO);} + } + } + return purchaseRequestPrintVOList; + } + @Override + public void purchaseRequestTablePDF(List voList, String id, String type, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + System.out.println("purchaseRequestTablePDF................."); + + int x = 1; + + double total = 0; + + for (PurchaseRequestPrintVO purchaseRequestPrintVO : voList) { + purchaseRequestPrintVO.setI(x); + total = total + purchaseRequestPrintVO.getSubtotal(); + x++; + } + + String firstAuditName =null; + String secondAuditName = null; + String thirdAuditName = null; + String fourthAuditName = null; + String commitTime = null; + + //----------------------------- + // 生成 word 版本的 采购目录 + + if (type.equals("集中采购申请")){ + + CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(id); + PurchasingPlanVO byId = purchasingPlanService.getPurchasingPlanVO(centralizedRequestVO.getPurchasingPlanId()); + firstAuditName = centralizedRequestVO.getAuditorName(); + secondAuditName = byId.getCreateName(); + thirdAuditName = byId.getPrimaryAuditorName(); + fourthAuditName = byId.getApproverName(); + commitTime = LocalDateTimeUtil.format(centralizedRequestVO.getDateOfApplication(),"yyyy年MM月dd日"); + + } + else { + DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(id); + firstAuditName = requestById.getPrimaryAuditorName(); + secondAuditName = requestById.getSecondaryAuditorName(); + thirdAuditName = requestById.getThreeLevelAuditName(); + fourthAuditName = requestById.getApproverName(); + commitTime = LocalDateTimeUtil.format(requestById.getCommitTime(),"yyyy年MM月dd日"); + } + 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(); + + ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false); + builder.bind("voList", policy).build(); + + /** + * 循环表格 + */ + double finalTotal = total; + String finalFourthAuditName = fourthAuditName; + String finalSecondAuditName = secondAuditName; + String finalThirdAuditName = thirdAuditName; + String finalFirstAuditName = firstAuditName; + String finalCommitTime = commitTime; + XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render( + new HashMap() {{ + put("voList", voList); + put("id", id); + put("size", 1); + put("total", finalTotal); + put("finalFirstAuditName", finalFirstAuditName); + put("finalSecondAuditName", finalSecondAuditName); + put("finalThirdAuditName", finalThirdAuditName); + put("finalFourthAuditName", finalFourthAuditName); + put("commitTime", finalCommitTime); + }} + ); + 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" + "/" + "purchaseRequest" + "/" + id + "/" + applyFileName + ".pdf", isPDF); + isPDF.close(); + + + System.out.println(String.format("转换为 PDF 结束")); + + } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizeDetailsServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizeDetailsServiceImpl.java index ca04d03..406bfb1 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizeDetailsServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizeDetailsServiceImpl.java @@ -5,7 +5,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import digital.laboratory.platform.reagent.entity.DecentralizeDetails; import digital.laboratory.platform.reagent.mapper.DecentralizeDetailsMapper; import digital.laboratory.platform.reagent.service.DecentralizeDetailsService; -import digital.laboratory.platform.reagent.vo.DecentralizeDetailsVO; +import digital.laboratory.platform.reagent.service.DecentralizedRequestService; +import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -23,6 +24,9 @@ public class DecentralizeDetailsServiceImpl extends ServiceImpl getDecentralizeDetailsList(String decentralizedRequestId) { @@ -34,4 +38,14 @@ public class DecentralizeDetailsServiceImpl extends ServiceImpl decentralizeDetailsList = baseMapper.getDecentralizeDetailsList(id); + + DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(decentralizeDetailsList.get(0).getDecentralizedRequestId()); + + return requestById; + } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizedRequestServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizedRequestServiceImpl.java index 2e60cee..24df805 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizedRequestServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/DecentralizedRequestServiceImpl.java @@ -301,6 +301,9 @@ public class DecentralizedRequestServiceImpl extends ServiceImpl referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>(); - referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getNumber, reagentConsumablesSet.getReferenceMaterialNumber()); - - ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(referenceMaterialLambdaQueryWrapper); + ReferenceMaterial referenceMaterial = referenceMaterialService.getById(reagentConsumablesSet.getReferenceMaterialId()); outgoingContents.setReferenceMaterialId(referenceMaterial.getId()); @@ -118,10 +116,13 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImplquery() .eq("claim_code", claimCode)); + if (applicationForUse==null){ + + return null; + } + DeliveryRegistrationFormVO deliveryRegistrationFormVOById = baseMapper.getDeliveryRegistrationFormVOById(applicationForUse.getDeliveryRegistrationFormId()); LambdaQueryWrapper outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>(); diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/InstructionBookServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/InstructionBookServiceImpl.java index 837779a..a768c50 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/InstructionBookServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/InstructionBookServiceImpl.java @@ -36,9 +36,9 @@ public class InstructionBookServiceImpl extends ServiceImpl instructionBookLambdaQueryWrapper = new LambdaQueryWrapper<>(); - - instructionBookLambdaQueryWrapper.eq(InstructionBook::getReferenceMaterialTypeId,id); - - InstructionBook one = instructionBookService.getOne(instructionBookLambdaQueryWrapper); - - InstructionBookVO instructionBookVO = new InstructionBookVO(); - - - if (one!=null){ - - BeanUtils.copyProperties(one,instructionBookVO); - - } + InstructionBookVO instructionBookVO = baseMapper.getInstructionBookVO(id); ReagentConsumables byId = reagentConsumablesService.getById(id); - instructionBookVO.setReagentConsumables(byId); - return instructionBookVO; } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/PeriodVerificationImplementationServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/PeriodVerificationImplementationServiceImpl.java index 6da2b53..dcd91ce 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/PeriodVerificationImplementationServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/PeriodVerificationImplementationServiceImpl.java @@ -47,6 +47,7 @@ import java.util.HashMap; * @describe (标准物质期间核查实施情况及结果记录表) 服务实现类 */ @Service +@SuppressWarnings("all") public class PeriodVerificationImplementationServiceImpl extends ServiceImpl implements PeriodVerificationImplementationService { @Autowired private PeriodVerificationPlanService periodVerificationPlanService; @@ -136,8 +137,6 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId); List list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper); - return catalogueDetailsService.removeBatchByIds(list) && + if (list.size() > 0 & list != null) { + catalogueDetailsService.removeBatchByIds(list); + } + + return purchaseCatalogueService.removeById(purchaseCatalogueId); } @@ -178,7 +184,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl purchaseCatalogueDTOList, DLPUser dlpUser) { - if (purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId().equals("")) { + if (purchaseCatalogueDTOList.get(0).getPurchaseCatalogueId() == null) { PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.addCatalogue(dlpUser, purchaseCatalogueDTOList); @@ -258,13 +264,20 @@ public class PurchaseCatalogueServiceImpl extends ServiceImplquery() + .eq("reagent_consumable_name", catalogueDetails.getReagentConsumableName()) + .eq("cas_number", catalogueDetails.getCasNumber()) + .eq("specification_and_model", catalogueDetails.getSpecificationAndModel()) + .eq("standard_value_or_purity", catalogueDetails.getStandardValueOrPurity())); + if (one == null) { + ReagentConsumables reagentConsumables = reagentConsumablesService.addReagentConsumables(catalogueDetails); + } + } } - } } else { purchaseCatalogue.setStatus(-3); @@ -314,7 +327,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl catalogueDetailsList = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper); - if (list == null&list.size()==0) { + if (list == null & list.size() == 0) { throw new RuntimeException(String.format("未存在已发布的采购目录")); } @@ -322,10 +335,11 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl purchaseCatalogueDTOList) { int i = 1; - String message = null; + String message = ""; try { for (PurchaseCatalogueDTO purchaseCatalogueDTO : purchaseCatalogueDTOList) { @@ -345,7 +359,6 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl catalogueDetailsList = new ArrayList<>(); 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 6112ec8..f9155a6 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 @@ -1,26 +1,39 @@ package digital.laboratory.platform.reagent.service.impl; +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.Constants; import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.deepoove.poi.XWPFTemplate; +import com.deepoove.poi.config.Configure; +import com.deepoove.poi.config.ConfigureBuilder; +import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; +import digital.laboratory.platform.common.feign.RemoteWord2PDFService; +import digital.laboratory.platform.common.oss.service.OssFile; import digital.laboratory.platform.reagent.dto.PurchaseListDTO; import digital.laboratory.platform.reagent.entity.*; import digital.laboratory.platform.reagent.mapper.PurchaseListMapper; import digital.laboratory.platform.reagent.service.*; -import digital.laboratory.platform.reagent.vo.PurchaseListDetailsVO; -import digital.laboratory.platform.reagent.vo.PurchaseListPageVO; -import digital.laboratory.platform.reagent.vo.PurchaseListVO; +import digital.laboratory.platform.reagent.vo.*; +import feign.Response; +import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.ibatis.annotations.Param; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; import java.time.LocalDate; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; /** @@ -30,6 +43,7 @@ import java.util.List; * @describe (采购清单) 服务实现类 */ @Service +@SuppressWarnings("all") public class PurchaseListServiceImpl extends ServiceImpl implements PurchaseListService { @Autowired @@ -46,6 +60,9 @@ public class PurchaseListServiceImpl extends ServiceImpl supplierInformationLambdaQueryWrapper = new LambdaQueryWrapper<>(); - if (purchaseListDetailsVO.getSupplierId()!=null){ + if (purchaseListDetailsVO.getSupplierId() != null) { - supplierInformationLambdaQueryWrapper.eq(SupplierInformation::getId, purchaseListDetailsVO.getSupplierId()); + supplierInformationLambdaQueryWrapper.eq(SupplierInformation::getId, purchaseListDetailsVO.getSupplierId()); - SupplierInformation one = supplierInformationService.getOne(supplierInformationLambdaQueryWrapper); + SupplierInformation one = supplierInformationService.getOne(supplierInformationLambdaQueryWrapper); - purchaseListDetailsVO.setSupplierName(one.getSupplierName()); - }} + purchaseListDetailsVO.setSupplierName(one.getSupplierName()); + } + } purchaseListVO.setPurchaseListDetailsVOS(purchaseListDetailsVOList); @@ -87,7 +121,7 @@ public class PurchaseListServiceImpl extends ServiceImpl purchaseListDTOList){ + public void editById(List purchaseListDTOList) { for (PurchaseListDTO purchaseListDTO : purchaseListDTOList) { @@ -104,7 +138,24 @@ public class PurchaseListServiceImpl extends ServiceImplquery() + .eq("purchase_list_id", id)); + + PurchasingPlanVO purchasingPlanVO = purchasingPlanService.getPurchasingPlanVO(plan.getPurchasingPlanId()); + List centralizedRequestList = centralizedRequestService.list(Wrappers.query().eq("purchasing_plan_id", plan.getPurchasingPlanId())); + for (CentralizedRequest centralizedRequest : centralizedRequestList) { + centralizedRequest.setStatus(4); + centralizedRequestService.updateById(centralizedRequest); + } + } else { + DecentralizedRequest purchase_list_id = decentralizedRequestService.getOne(Wrappers.query() + .eq("purchase_list_id", id)); + purchase_list_id.setStatus(6); + decentralizedRequestService.updateById(purchase_list_id); + } purchaseList.setStatus(1); LambdaQueryWrapper purchaseListDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -128,6 +179,9 @@ public class PurchaseListServiceImpl extends ServiceImplquery() + .eq("reagent_consumable_id", byId.getReagentConsumableId())); + WarehousingContent warehousingContent = new WarehousingContent(); //完善入库内容信息 @@ -145,8 +199,13 @@ public class PurchaseListServiceImpl extends ServiceImpl catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getReagentConsumableId, warehousingContent.getReagentConsumableId()); 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 97ee0c4..3c9f534 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 @@ -116,6 +116,8 @@ public class PurchasingPlanServiceImpl extends ServiceImpl getReagentConsumableInventoryVOList(Page page, String name) { - - QueryWrapper reagentConsumableInventoryQueryWrapper = new QueryWrapper<>(); - - reagentConsumableInventoryQueryWrapper.eq("status", 1); - - if (StrUtil.isNotBlank(name)) { - - reagentConsumableInventoryQueryWrapper - .eq("category", "试剂").or() - .eq("category", "耗材") - .like("reagent_consumable_name", name); - } else { - - reagentConsumableInventoryQueryWrapper.eq("category", "试剂").or() - .eq("category", "耗材"); - } - - List list = reagentConsumableInventoryService.list(reagentConsumableInventoryQueryWrapper); - - ArrayList reagentConsumableInventoryVOS = new ArrayList<>(); - - for (ReagentConsumableInventory reagentConsumableInventory : list) { - - List batchDetailsVOList = batchDetailsService.getBatchDetailsList(reagentConsumableInventory.getReagentConsumableInventoryId()); - - ReagentConsumableInventoryVO reagentConsumableInventoryVO = new ReagentConsumableInventoryVO(); - - BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryVO); - //赋值试剂耗材批次明细 - reagentConsumableInventoryVO.setBatchDetailsVOS(batchDetailsVOList); - - reagentConsumableInventoryVOS.add(reagentConsumableInventoryVO); - } - if (reagentConsumableInventoryVOS != null) { - PageUtils pageUtils = new PageUtils(); - - Page pages = pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), reagentConsumableInventoryVOS); - - return pages; - } else return null; + @Autowired + private RemoteWord2PDFService remoteWord2PDFService; - } + @Autowired + private OssFile ossFile; - @Override//标准物质管理列表 + @Override//试剂耗材/标准物质标准物质管理列表 public IPage getReagentConsumableInventoryRMVOList(IPage page, QueryWrapper qw) { IPage reagentConsumableInventoryVOPage = baseMapper.getReagentConsumableInventoryVOPage(page, qw); @@ -149,16 +128,6 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl getAllList(Integer current, Integer size, QueryWrapper qw, Integer status) { @@ -209,7 +178,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl standardReserveSolutionLambdaQueryWrapper = new LambdaQueryWrapper<>(); - standardReserveSolutionLambdaQueryWrapper.eq(StandardReserveSolution::getSolutionNumbering, referenceMaterial.getNumber()); + standardReserveSolutionLambdaQueryWrapper.eq(StandardReserveSolution::getReferenceId, referenceMaterial.getId()); StandardReserveSolution one1 = standardReserveSolutionService.getOne(standardReserveSolutionLambdaQueryWrapper); @@ -242,54 +211,47 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl getAllRM(Integer current, Integer size, String reagentConsumableName) { - - List reagentConsumableInventoryFullVOList = new ArrayList<>(); + public IPage getAllRM(IPage page, QueryWrapper qw) { - List list = reagentConsumableInventoryService.list(Wrappers.query() - .eq("category", "试剂").or() - .eq("category", "耗材") - .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)); - //找出对应的仓库信息 - for (ReagentConsumableInventory reagentConsumableInventory : list) { + List list = reagentConsumableInventoryService.list(qw); - LambdaQueryWrapper batchDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); + List reagentConsumableInventoryFullVOS = new ArrayList<>(); - batchDetailsLambdaQueryWrapper - .eq(BatchDetails::getReagentConsumableInventoryId, reagentConsumableInventory.getReagentConsumableInventoryId()) - .eq(BatchDetails::getServiceStatus, 1); + for (ReagentConsumableInventory reagentConsumableInventory : list) { - List list1 = batchDetailsService.list(batchDetailsLambdaQueryWrapper); - //将不同批次的物品展示出来 - for (BatchDetails batchDetails : list1) { + List list1 = batchDetailsService.list(Wrappers.query() + .eq("reagent_consumable_inventory_id", reagentConsumableInventory.getReagentConsumableInventoryId()) + .eq("service_status", 1)); - ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO(); + //将不同批次的物品展示出来 + for (BatchDetails batchDetails : list1) { - BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryFullVO); + ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO(); - SupplierInformation byId = supplierInformationService.getById(batchDetails.getSupplierId()); + BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryFullVO); - reagentConsumableInventoryFullVO.setSupplierName(byId.getSupplierName()); + reagentConsumableInventoryFullVO.setSupplierName(supplierInformationService.getById(batchDetails.getSupplierId()).getSupplierName()); - reagentConsumableInventoryFullVO.setBatch(batchDetails.getBatch()); + reagentConsumableInventoryFullVO.setBatch(batchDetails.getBatch()); - reagentConsumableInventoryFullVO.setBatchDetailsId(batchDetails.getBatchDetailsId()); + reagentConsumableInventoryFullVO.setBatchDetailsId(batchDetails.getBatchDetailsId()); - reagentConsumableInventoryFullVO.setTotalQuantity(batchDetails.getQuantity()); + reagentConsumableInventoryFullVO.setTotalQuantity(batchDetails.getQuantity()); - reagentConsumableInventoryFullVOList.add(reagentConsumableInventoryFullVO); - } + reagentConsumableInventoryFullVOS.add(reagentConsumableInventoryFullVO); } - PageUtils pageUtils = new PageUtils(); + } + PageUtils pageUtils = new PageUtils(); - Page pages = pageUtils.getPages(current, size, reagentConsumableInventoryFullVOList); + Page pages = pageUtils.getPages((int) page.getCurrent(), (int) page.getSize(), reagentConsumableInventoryFullVOS); - return pages; - } + return pages; + + } @Override - public List getReagentConsumableInventoryFull(QueryWrapper qw){ + public List getReagentConsumableInventoryFull(QueryWrapper qw) { List list = reagentConsumableInventoryService.list(qw); // return list; @@ -326,4 +288,118 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + System.out.println("referenceMaterialTablePDF................."); + + int x = 1; + + for (ReferenceMaterialVO referenceMaterialVO : voList) { + + referenceMaterialVO.setI(x); + x++; + } + //----------------------------- + // 生成 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(); + + ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false); + builder.bind("voList", policy).build(); + + /** + * 循环表格 + */ + XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render( + new HashMap() {{ + put("voList", voList); + put("id", id); + put("size", 1); + }} + ); + 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" + "/" + "referenceMaterial" + "/" + id + "/" + applyFileName + ".pdf", isPDF); + isPDF.close(); + + + System.out.println(String.format("转换为 PDF 结束")); + + } + + //试剂/耗材扫描物品编码进行持久化 + @Override + public void setCode(String id, String code) { + + ReagentConsumables byId = reagentConsumablesService.getById(id); + + ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(Wrappers.query() + .eq("reagent_consumable_id", id)); + + if (byId != null & one != null) { + byId.setCode(code); + one.setCode(code); + + reagentConsumableInventoryService.updateById(one); + reagentConsumablesService.updateById(byId); + } + + } + + @Override +//标准物质条形码打印 + public String buildCodeLabelContent(String id) { + + ReferenceMaterial referenceMaterialServiceById = referenceMaterialService.getById(id); + + Map data = new HashMap<>(); + + referenceMaterialServiceById.setCode(LocalDateTimeUtil.format(LocalDateTime.now(),"yyyyMMddHHmmssSSS")); + + referenceMaterialService.updateById(referenceMaterialServiceById); + ReagentConsumables byId = reagentConsumablesService.getById(referenceMaterialServiceById.getReagentConsumableId()); + String reagentConsumableName = byId.getReagentConsumableName(); + ReferenceMaterialVO referenceMaterial = new ReferenceMaterialVO(); + BeanUtils.copyProperties(referenceMaterialServiceById,referenceMaterial); + referenceMaterial.setCodeName(reagentConsumableName+":"+referenceMaterialServiceById.getCode()); + data.put("referenceMaterial", referenceMaterial); + + String templateFileName = AppStartupRunner.getCfg( "labelTemplate_standardSubstance"); + + return remoteTemplate2htmlService.getHtml(templateFileName,data); + + } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/ReferenceMaterialServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/ReferenceMaterialServiceImpl.java index 3603777..b386e68 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/ReferenceMaterialServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/ReferenceMaterialServiceImpl.java @@ -1,12 +1,7 @@ package digital.laboratory.platform.reagent.service.impl; -import cn.hutool.core.io.IoUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.deepoove.poi.XWPFTemplate; -import com.deepoove.poi.config.Configure; -import com.deepoove.poi.config.ConfigureBuilder; -import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; import digital.laboratory.platform.common.feign.RemoteWord2PDFService; import digital.laboratory.platform.common.oss.service.OssFile; import digital.laboratory.platform.reagent.entity.ReagentConsumables; @@ -15,19 +10,11 @@ import digital.laboratory.platform.reagent.mapper.ReferenceMaterialMapper; import digital.laboratory.platform.reagent.service.ReagentConsumablesService; import digital.laboratory.platform.reagent.service.ReferenceMaterialService; import digital.laboratory.platform.reagent.vo.ReferenceMaterialVO; -import digital.laboratory.platform.reagent.vo.StandardSolutionCurveVO; -import feign.Response; -import org.apache.commons.io.output.ByteArrayOutputStream; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayInputStream; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; /** @@ -81,77 +68,13 @@ public class ReferenceMaterialServiceImpl extends ServiceImpl voList, String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { - System.out.println("standardSolutionCurveTablePDF................."); + public List getReferenceMaterialList(){ - Integer x = 1; - for (StandardSolutionCurveVO standardSolutionCurveVO : voList) { + List referenceMaterialVOList = baseMapper.getReferenceMaterialVOList(); - standardSolutionCurveVO.setSerialnNumber(x.toString()); - - x++; - } - - String applyFileName = "标准工作曲线溶液配制记录表-" + id; - //----------------------------- - // 生成 word 版本的 验收记录表 - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - ossFile.fileGet("template" + "/" + "标准工作曲线溶液配制记录表模板.docx", bos); - - byte[] templateArray = bos.toByteArray(); - - ByteArrayInputStream bis = new ByteArrayInputStream(templateArray); - - bos.close(); - - LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy(); - - ConfigureBuilder builder = Configure.builder().buildGramer("${", "}").useSpringEL(false); - - builder.bind("voList", policy).build(); - - /** - * 循环表格 - */ - XWPFTemplate template = XWPFTemplate.compile(bis, builder.build()).render( - new HashMap() {{ - put("voList",voList); - put("id",id); - put("size",1); + return referenceMaterialVOList; + }; - }} - ); - 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" + "/" + "standardSolutionCurve" + "/" + id + "/" + applyFileName + ".pdf", isPDF); - isPDF.close(); - - - System.out.println(String.format("转换为 PDF 结束")); - - } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/ReviewAndApproveServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/ReviewAndApproveServiceImpl.java index c05ebd3..f32bc5d 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/ReviewAndApproveServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/ReviewAndApproveServiceImpl.java @@ -505,7 +505,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl permissions = dlpUser.getPermissions(); ReviewAndApprove reviewAndApprove = new ReviewAndApprove(); - //分散采购申请待审核列表 + //分散采购申请已审核列表 List decentralizedRequestVOS = new ArrayList<>(); - //采购目录待审核列表 + //采购目录已审核列表 List purchaseCatalogueVOList = new ArrayList<>(); - //采购计划待审核列表 + //采购计划已审核列表 List purchasingPlanVOS = new ArrayList<>(); - //符合性检查待审核列表 + //符合性检查已审核列表 List complianceCheckVOS = new ArrayList<>(); - //指导书待审核列表 + //指导书已审核列表 List instructionBookVOS = new ArrayList<>(); - //期间核查待审核列表 + //期间核查已审核列表 List checkScheduleVOS = new ArrayList<>(); - //标准物质管理待审核列表 + //标准物质管理已审核列表 List standardMaterialApprovalFormVOS = new ArrayList<>(); - //验收记录待审核列表 + //验收记录已审核列表 List acceptanceRecordFormVOS = new ArrayList<>(); - //期间核查结果录入待审核列表 + //期间核查结果录入已审核列表 List periodVerificationImplementationVOS = new ArrayList<>(); - //供应商评价待审核列表 + //供应商评价已审核列表 List evaluationFormVOS = new ArrayList<>(); List centralizedRequestVOList = new ArrayList<>(); - + //集中采购申请已审核列表 if (permissions.contains("reagent_centralized_request_audit")){ LambdaQueryWrapper centralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -576,7 +576,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getStatus, 2).or().eq(DecentralizedRequest::getStatus, -2); @@ -596,7 +596,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getStatus, 3).or().eq(DecentralizedRequest::getStatus, -3); @@ -616,7 +616,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getStatus, 4).or().eq(DecentralizedRequest::getStatus, -4); @@ -635,7 +635,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl decentralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>(); decentralizedRequestLambdaQueryWrapper.eq(DecentralizedRequest::getStatus, 5).or().eq(DecentralizedRequest::getStatus, -5); @@ -654,7 +654,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl purchaseCatalogueLambdaQueryWrapper = new LambdaQueryWrapper<>(); purchaseCatalogueLambdaQueryWrapper.eq(PurchaseCatalogue::getStatus, 2).or().eq(PurchaseCatalogue::getStatus, -2); @@ -672,7 +672,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl purchaseCatalogueLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -693,7 +693,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl purchasingPlanLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -712,7 +712,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl purchasingPlanLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -732,7 +732,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl acceptanceRecordFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -753,7 +753,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl acceptanceRecordFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -774,7 +774,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl acceptanceRecordFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -794,7 +794,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl complianceCheckLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -814,7 +814,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl complianceCheckLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -833,7 +833,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl checkScheduleLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -852,7 +852,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl periodVerificationImplementationLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -872,7 +872,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl standardMaterialApprovalFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -892,7 +892,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl standardMaterialApprovalFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -911,7 +911,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl standardMaterialApprovalFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -930,7 +930,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl evaluationFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -949,7 +949,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl evaluationFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -968,7 +968,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl instructionBookLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -981,7 +981,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl implements StandardMaterialApplicationService { @@ -61,18 +65,21 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImplquery().eq("solution_numbering", referenceMaterial.getNumber())); + StandardReserveSolution solution_numbering = standardReserveSolutionService.getOne(Wrappers.query().eq("reference_id", referenceMaterial.getId())); solution_numbering.setStatus(-1); @@ -107,7 +117,9 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl0){ + byId2.setServiceStatus(1); + } batchDetailsService.updateById(byId2); reagentConsumableInventoryService.updateById(byId1); @@ -152,6 +164,12 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl standardReserveSolutionLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -173,7 +191,7 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl voList, String ids,HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + public void standardMaterialApplicationTablePDF(List voList, String ids, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { System.out.println("standardMaterialApplicationTablePDF................."); int x = 1; @@ -255,6 +273,12 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl solutionUseFormVOList = solutionUseFormService.getSolutionUseFormVOList(standardReserveSolutionVOById.getId()); - standardReserveSolutionVOById.setSolutionUseFormVOList(solutionUseFormVOList); + if (solutionUseFormVOList!=null){ + standardReserveSolutionVOById.setSolutionUseFormVOList(solutionUseFormVOList);} return standardReserveSolutionVOById; } @@ -144,10 +141,24 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl getStandardReserveSolutionVOList(IPage page, QueryWrapper qw) { IPage standardReserveSolutionVOPage = baseMapper.getStandardReserveSolutionVOPage(page, qw); + List records = standardReserveSolutionVOPage.getRecords(); + + for (StandardReserveSolutionVO record : records) { + + ReferenceMaterial byId = referenceMaterialService.getById(record.getReferenceId()); + + if (byId!=null) { + record.setLocation(byId.getLocation()); + record.setLatticeId(byId.getLatticeId()); + } + } + + return standardReserveSolutionVOPage; } @@ -159,6 +170,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -209,9 +223,9 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl getWarehousingBatchListVOList(String warehousingContentId) { - List warehousingBatchListVOList = baseMapper.getWarehousingBatchListVOList(warehousingContentId); + List warehousingBatchListVOList = baseMapper.getWarehousingBatchListVOList(warehousingContentId); + + ArrayList strings = new ArrayList<>(); + + for (WarehousingBatchListVO warehousingBatchListVO : warehousingBatchListVOList) { + + if (warehousingBatchListVO.getBatchId() != null) { + + List batch_details_id = referenceMaterialService.list(Wrappers.query().eq("batch_details_id", warehousingBatchListVO.getBatchId())); + + for (ReferenceMaterial referenceMaterial : batch_details_id) { + + strings.add(referenceMaterial.getId()); + } + } + warehousingBatchListVO.setIdList(strings); + + } + return warehousingBatchListVOList; } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingContentServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingContentServiceImpl.java index 61113b0..881637c 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingContentServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingContentServiceImpl.java @@ -43,6 +43,8 @@ public class WarehousingContentServiceImpl extends ServiceImpl warehousingRecordFormDTOList, DLPUser dlpUser) { for (WarehousingRecordFormDTO warehousingRecordFormDTO : warehousingRecordFormDTOList) { - if (warehousingRecordFormDTO.getLatticeId().isEmpty()&warehousingRecordFormDTO.getLocation().isEmpty()){ + if (warehousingRecordFormDTO.getLatticeId().isEmpty() & warehousingRecordFormDTO.getLocation().isEmpty() & + warehousingRecordFormDTO.getBoxId().isEmpty()) { throw new RuntimeException(String.format("请选择存放位置后再进行提交")); } @@ -146,6 +146,8 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl warehousingBatchListLambdaQueryWrapper = new LambdaQueryWrapper<>(); warehousingBatchListLambdaQueryWrapper.eq(WarehousingBatchList::getWarehousingContentId, warehousingBatchList.getWarehousingContentId()); @@ -165,37 +169,16 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl byId.getTotalQuantity()) { throw new RuntimeException(String.format("入库数量不能大于采购数量")); } - if (warehousingContentService.updateById(byId) & warehousingBatchListService.save(warehousingBatchList)) { - - flag = true; - } else { - flag = false; - } - //入库登记表更新 - StorageRegistrationForm storageRegistrationForm = new StorageRegistrationForm(); + warehousingContentService.updateById(byId); - storageRegistrationForm.setStorageRegistrationFormId(IdWorker.get32UUID().toUpperCase()); - storageRegistrationForm.setReagentConsumableId(byId.getReagentConsumableId()); - - storageRegistrationForm.setQuantity(warehousingBatchList.getQuantity()); - - storageRegistrationForm.setRemarks(warehousingRecordFormDTO.getRemark()); - - storageRegistrationFormService.save(storageRegistrationForm); - - LambdaQueryWrapper reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); - - reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, byId.getReagentConsumableId()); - - ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); + ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(Wrappers.query().eq("reagent_consumable_id", byId.getReagentConsumableId())); //录入仓库批次信息,若仓库不存在该物品,则新增该物品的库存信息 if (one == null) { @@ -214,6 +197,12 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl list = referenceMaterialService.list(Wrappers.query() .likeRight("number", prefix) @@ -297,6 +297,12 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableId, byId.getReagentConsumableId()); @@ -313,19 +319,23 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl batchDetailsList = batchDetailsService.list(Wrappers.query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId()) - .eq("supplier_id",byId.getSupplierId())); + .eq("supplier_id", byId.getSupplierId())); - if (batchDetailsList.size()==0){ + if (batchDetailsList.size() == 0) { batchDetails.setBatch(1); - }else { - batchDetails.setBatch(batchDetailsList.size()+1); + } else { + batchDetails.setBatch(batchDetailsList.size() + 1); } - if (one.getCategory().equals("试剂")|one.getCategory().equals("耗材")){ + if (one.getCategory().equals("试剂") | one.getCategory().equals("耗材")) { batchDetails.setLocation(warehousingRecordFormDTO.getLocation()); batchDetails.setLatticeId(warehousingRecordFormDTO.getLatticeId()); + batchDetails.setBoxId(warehousingRecordFormDTO.getBoxId()); + //更新格子信息(试剂耗材传入类ID) + remoteCabinetService.updateCabinet(latticeId, byId.getReagentConsumableId(), "1"); } one.setTotalQuantity(one.getTotalQuantity() + batchDetails.getQuantity()); @@ -343,15 +353,18 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl list = referenceMaterialService.list(Wrappers.query() .likeRight("number", prefix) @@ -380,7 +393,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl warehousingContentLambdaQueryWrapper = new LambdaQueryWrapper<>(); WarehousingContent byId = warehousingContentService.getById(warehousingRecordFormDTOList.get(0).getWarehousingContentId()); @@ -392,6 +407,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl list = warehousingContentService.list(warehousingContentLambdaQueryWrapper); WarehousingRecordForm warehousingRecordForm = warehousingRecordFormService.getById(warehousingRecordFormId); + + + //遍历采购内容,判断试剂耗材是否入库完毕 for (WarehousingContent warehousingContent : list) { @@ -427,19 +445,19 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl evaluationFormLambdaQueryWrapper = new LambdaQueryWrapper<>(); - evaluationFormLambdaQueryWrapper.eq(EvaluationForm::getSupplierInformationId,supplierInformation.getId()) - .orderByDesc(EvaluationForm::getCreateTime); + evaluationFormLambdaQueryWrapper.eq(EvaluationForm::getSupplierInformationId, supplierInformation.getId()) + .orderByDesc(EvaluationForm::getCreateTime); List list1 = evaluationFormService.list(evaluationFormLambdaQueryWrapper); - provideServicesOrSuppliesService.addById(list1.get(0).getId(),warehousingContent.getReagentConsumableId()); + provideServicesOrSuppliesService.addById(list1.get(0).getId(), warehousingContent.getReagentConsumableId()); } } @@ -460,7 +478,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl getWarehousingRecordFormVOPage(Page page, QueryWrapper qw) { - IPage warehousingRecordFormVOPage = baseMapper.getWarehousingRecordFormVOPage(page,qw); + IPage warehousingRecordFormVOPage = baseMapper.getWarehousingRecordFormVOPage(page, qw); List records = warehousingRecordFormVOPage.getRecords(); @@ -472,19 +490,19 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl getPurchaseRequestPrint(String id){ + public List getPurchaseRequestPrint(String id) { WarehousingRecordForm byId = warehousingRecordFormService.getById(id); @@ -494,7 +512,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImplquery().eq("purchase_list_id", purchaseListDetails1.getPurchaseListId())); - if (request!=null){ + if (request != null) { DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(request.getId()); @@ -514,7 +532,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImplquery().eq("purchase_list_id", purchaseListId)); - if (request!=null){ + if (request != null) { DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(request.getId()); @@ -524,16 +542,17 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl() {{ -// put("theSameBrandAndModel", acceptanceRecordFormVO.getTheSameBrandAndModel()); -// }} -// ); -// 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" + "/" + "acceptanceRecordForm" + "/" + id + "/" + applyFileName + ".pdf", isPDF); -// isPDF.close(); -// -// -// System.out.println(String.format("转换为 PDF 结束")); -// -// } } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVO.java index 856ff2f..acc685b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVO.java @@ -10,6 +10,7 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.time.LocalDateTime; import java.util.List; @@ -26,10 +27,11 @@ public class CentralizedRequestVO extends CentralizedRequest { private List detailsOfCentralizedVOList; @ApiModelProperty(value="申请人名称") - private String applicantName; + private String createName; private String auditorName; + private String type = "集中采购申请"; diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/PeriodVerificationImplementationVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/PeriodVerificationImplementationVO.java index ac355fc..ae58648 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/PeriodVerificationImplementationVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/PeriodVerificationImplementationVO.java @@ -14,6 +14,9 @@ public class PeriodVerificationImplementationVO extends PeriodVerificationImplem @ApiModelProperty(value = "标准物质名称") private String referenceMaterialName; + @ApiModelProperty(value = "类ID") + private String reagentConsumableId; + @ApiModelProperty(value = "技术负责人名称") private String technicalDirectorName; diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/PurchaseRequestPrintVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/PurchaseRequestPrintVO.java index 7d73ef2..e67cc3d 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/PurchaseRequestPrintVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/PurchaseRequestPrintVO.java @@ -36,4 +36,6 @@ public class PurchaseRequestPrintVO { @ApiModelProperty(value="(小计)") private Double subtotal; + private Integer i; + } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryFullVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryFullVO.java index 52fb5a5..4108d5e 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryFullVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/ReagentConsumableInventoryFullVO.java @@ -59,5 +59,8 @@ public class ReagentConsumableInventoryFullVO extends ReagentConsumableInventory @ApiModelProperty(value="(有效期限)") private Integer validityPeriod; + @ApiModelProperty(value="(打印序号)") + private Integer i; + } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/ReferenceMaterialVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/ReferenceMaterialVO.java index 560c57f..26201d3 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/ReferenceMaterialVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/ReferenceMaterialVO.java @@ -9,4 +9,16 @@ public class ReferenceMaterialVO extends ReferenceMaterial { @ApiModelProperty(value="标准物质名称") private String referenceMaterialName; + + + @ApiModelProperty(value="规格型号") + private String specificationAndModel; + + + @ApiModelProperty(value="纯度") + private String standardValueOrPurity; + + private Integer i ; + + private String codeName; } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/StandardMaterialApplicationVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/StandardMaterialApplicationVO.java index e002d9c..65abcb1 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/StandardMaterialApplicationVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/StandardMaterialApplicationVO.java @@ -39,4 +39,13 @@ public class StandardMaterialApplicationVO extends StandardMaterialApplication { */ @ApiModelProperty(value="(归还日期)") private String dateOfReturns; + + @ApiModelProperty(value="格子ID") + private String latticeId; + + @ApiModelProperty(value="位置信息") + private String location; + + @ApiModelProperty(value="柜子ID") + private String boxId; } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/StandardReserveSolutionVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/StandardReserveSolutionVO.java index e593a6b..4facd71 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/StandardReserveSolutionVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/StandardReserveSolutionVO.java @@ -14,4 +14,10 @@ public class StandardReserveSolutionVO extends StandardReserveSolution { private List solutionUseFormVOList; + private String location; + + @ApiModelProperty(value = "存储期限") + private Integer storageLife; + + private String latticeId; } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingBatchListVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingBatchListVO.java index 3968d89..b36a862 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingBatchListVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingBatchListVO.java @@ -5,10 +5,13 @@ import digital.laboratory.platform.reagent.entity.WarehousingBatchList; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; + @Data public class WarehousingBatchListVO extends WarehousingBatchList { @ApiModelProperty(value="入库人名称") private String depositorName; + private List idList; } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingContentVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingContentVO.java index 1eadfb4..870c37a 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingContentVO.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/WarehousingContentVO.java @@ -30,4 +30,13 @@ public class WarehousingContentVO extends WarehousingContent { @ApiModelProperty(value="(标准值/纯度)") private String standardValueOrPurity; + + @ApiModelProperty(value="单价") + private Double unitPrice; + + @ApiModelProperty(value="偏差/不确定度") + private String deviationOrUncertainty; + + + } diff --git a/src/main/resources/mapper/BatchDetailsMapper.xml b/src/main/resources/mapper/BatchDetailsMapper.xml index 801a5a7..a1f675d 100644 --- a/src/main/resources/mapper/BatchDetailsMapper.xml +++ b/src/main/resources/mapper/BatchDetailsMapper.xml @@ -28,6 +28,8 @@ + + diff --git a/src/main/resources/mapper/CatalogueDetailsMapper.xml b/src/main/resources/mapper/CatalogueDetailsMapper.xml index 41625b7..65675ce 100644 --- a/src/main/resources/mapper/CatalogueDetailsMapper.xml +++ b/src/main/resources/mapper/CatalogueDetailsMapper.xml @@ -24,6 +24,7 @@ + diff --git a/src/main/resources/mapper/CentralizedRequestMapper.xml b/src/main/resources/mapper/CentralizedRequestMapper.xml index 1757bed..fe82160 100644 --- a/src/main/resources/mapper/CentralizedRequestMapper.xml +++ b/src/main/resources/mapper/CentralizedRequestMapper.xml @@ -19,13 +19,14 @@ + - + @@ -35,7 +36,7 @@ (SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=cr.applicant_id - ) AS applicant_name, + ) AS create_name, (SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=cr.audit_id @@ -47,7 +48,7 @@ select cr.*, (select department from dlp_base.sys_user where user_id = cr.applicant_id) as department, - (select user.name from dlp_base.sys_user user where user.user_id=cr.applicant_id ) as applicant_name, + (select user.name from dlp_base.sys_user user where user.user_id=cr.applicant_id ) as create_name, (select user.name from dlp_base.sys_user user where user.user_id=cr.audit_id ) as auditor_name from centralized_request cr where cr.id =#{id} @@ -79,7 +80,7 @@ (SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=cr.applicant_id - ) AS applicant_name, + ) AS create_name, (SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=cr.audit_id diff --git a/src/main/resources/mapper/DecentralizeDetailsMapper.xml b/src/main/resources/mapper/DecentralizeDetailsMapper.xml index bc734b5..e73b3ac 100644 --- a/src/main/resources/mapper/DecentralizeDetailsMapper.xml +++ b/src/main/resources/mapper/DecentralizeDetailsMapper.xml @@ -27,5 +27,10 @@ + + diff --git a/src/main/resources/mapper/InstructionBookMapper.xml b/src/main/resources/mapper/InstructionBookMapper.xml index 49ce65f..0abdad1 100644 --- a/src/main/resources/mapper/InstructionBookMapper.xml +++ b/src/main/resources/mapper/InstructionBookMapper.xml @@ -22,7 +22,18 @@ - + + + + + diff --git a/src/main/resources/mapper/OutgoingContentsMapper.xml b/src/main/resources/mapper/OutgoingContentsMapper.xml index 8049677..259d83a 100644 --- a/src/main/resources/mapper/OutgoingContentsMapper.xml +++ b/src/main/resources/mapper/OutgoingContentsMapper.xml @@ -21,6 +21,9 @@ + + + diff --git a/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml b/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml index f197f6b..8228324 100644 --- a/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml +++ b/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml @@ -37,11 +37,13 @@ - + @@ -50,6 +52,10 @@ FROM dlp_base.sys_user user WHERE user.user_id=pvi.inspector_id ) as inspector_name , ( + SELECT rm.reagent_consumable_id + From reference_material rm + WHERE rm.id = pvi.reference_material_id ) as reagent_consumable_id, + ( SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=pvi.technical_director_id ) as technical_director_name @@ -57,24 +63,27 @@ - ${ew.customSqlSegment} - select pvi.*, - (select rc.reagent_consumable_name - from reagent_consumables rc - where rc.reagent_consumable_id = pvi.reference_material_id) as reference_material_name, (SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=pvi.inspector_id ) as inspector_name - , ( + , + ( + SELECT rm.reagent_consumable_id + From reference_material rm + WHERE rm.id = pvi.reference_material_id ) as reagent_consumable_id, ( SELECT user.name FROM dlp_base.sys_user user - WHERE user.user_id=pvi.technical_director_id ) as technical_director_name, - ( + WHERE user.user_id=pvi.technical_director_id ) as technical_director_name + , ( SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=pvi.create_by ) as create_name diff --git a/src/main/resources/mapper/ReagentConsumableInventoryMapper.xml b/src/main/resources/mapper/ReagentConsumableInventoryMapper.xml index c3f477a..c2732e1 100644 --- a/src/main/resources/mapper/ReagentConsumableInventoryMapper.xml +++ b/src/main/resources/mapper/ReagentConsumableInventoryMapper.xml @@ -4,42 +4,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/ReagentConsumablesMapper.xml b/src/main/resources/mapper/ReagentConsumablesMapper.xml index 324e5c7..aeebab4 100644 --- a/src/main/resources/mapper/ReagentConsumablesMapper.xml +++ b/src/main/resources/mapper/ReagentConsumablesMapper.xml @@ -27,6 +27,8 @@ + + diff --git a/src/main/resources/mapper/ReagentConsumablesSetMapper.xml b/src/main/resources/mapper/ReagentConsumablesSetMapper.xml index bd35b51..e0e1cfb 100644 --- a/src/main/resources/mapper/ReagentConsumablesSetMapper.xml +++ b/src/main/resources/mapper/ReagentConsumablesSetMapper.xml @@ -16,7 +16,7 @@ - + diff --git a/src/main/resources/mapper/ReferenceMaterialMapper.xml b/src/main/resources/mapper/ReferenceMaterialMapper.xml index e21f6ee..764b256 100644 --- a/src/main/resources/mapper/ReferenceMaterialMapper.xml +++ b/src/main/resources/mapper/ReferenceMaterialMapper.xml @@ -18,5 +18,30 @@ + + + + + + + + + + + + diff --git a/src/main/resources/mapper/WarehousingBatchListMapper.xml b/src/main/resources/mapper/WarehousingBatchListMapper.xml index 855a0e4..315a976 100644 --- a/src/main/resources/mapper/WarehousingBatchListMapper.xml +++ b/src/main/resources/mapper/WarehousingBatchListMapper.xml @@ -25,6 +25,7 @@ + diff --git a/src/main/resources/mapper/WarehousingContentMapper.xml b/src/main/resources/mapper/WarehousingContentMapper.xml index f265d2e..b605b3d 100644 --- a/src/main/resources/mapper/WarehousingContentMapper.xml +++ b/src/main/resources/mapper/WarehousingContentMapper.xml @@ -21,6 +21,8 @@ + +