From 149e66c5b8e617e1e62e6c2d2b1e69114cf0dd87 Mon Sep 17 00:00:00 2001 From: yanghaihang <1344638791@qq.com> Date: Fri, 28 Apr 2023 17:47:01 +0800 Subject: [PATCH] 4.28 --- .../controller/CheckScheduleController.java | 6 +- .../controller/ComplianceCheckController.java | 2 +- .../DecentralizedRequestController.java | 3 +- .../controller/InstructionBookController.java | 50 +++++++- ...dVerificationImplementationController.java | 8 +- .../ProvideServicesOrSuppliesController.java | 23 ++++ .../PurchaseCatalogueController.java | 3 +- ...tandardMaterialApprovalFormController.java | 32 +++++- .../SupplierInformationController.java | 108 +++++++++++++++--- .../reagent/dto/EvaluationFormDTO.java | 22 ++-- .../reagent/entity/DetailsOfCentralized.java | 3 +- .../reagent/entity/InstructionBook.java | 2 +- .../reagent/mapper/ComplianceCheckMapper.java | 3 +- .../reagent/service/BlacklistService.java | 5 + .../service/InstructionBookService.java | 6 + .../impl/AcceptanceRecordFormServiceImpl.java | 9 +- .../service/impl/BlacklistServiceImpl.java | 50 +++++++- .../impl/InstructionBookServiceImpl.java | 57 +++++++++ ...andardMaterialApprovalFormServiceImpl.java | 66 ++++++----- .../impl/SupplierInformationServiceImpl.java | 5 +- .../vo/ProvideServicesOrSuppliesVO.java | 8 +- .../reagent/vo/PurchaseCatalogueVO.java | 10 +- .../mapper/ComplianceCheckMapper.xml | 1 + 23 files changed, 384 insertions(+), 98 deletions(-) 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 334fac8..456b287 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java @@ -76,7 +76,7 @@ public class CheckScheduleController { */ @ApiOperation(value = "分页查询新增标准物质期间核查计划和确认表", notes = "分页查询新增标准物质期间核查计划和确认表") @GetMapping("/page") -// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_get')" ) +// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_page)" ) public R> getCheckSchedulePage(Page page, CheckSchedule checkSchedule,String status, String number,HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -148,7 +148,7 @@ public class CheckScheduleController { @ApiOperation(value = "提交计划标准物质期间核查计划和确认表", notes = "提交计划标准物质期间核查计划和确认表") @SysLog("提交计划") @PostMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_edit')" ) +// @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(); @@ -169,7 +169,7 @@ public class CheckScheduleController { @ApiOperation(value = "审核标准物质期间核查计划和确认表", notes = "审核标准物质期间核查计划和确认表") @SysLog("修改") @PutMapping("/audit") -// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_edit')" ) +// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_audit')" ) public R auditPlan(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); 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 9274e80..e4fa2ba 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java @@ -80,7 +80,7 @@ public class ComplianceCheckController { DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); IPage complianceCheckSList = complianceCheckService.getComplianceCheckVOPage(page, Wrappers.query() - .orderByAsc("create_time") + .orderByDesc("create_time") ); return R.ok(complianceCheckSList); // return R.ok(complianceCheckService.page(page, Wrappers.query(complianceCheck))); 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 9e204a3..280d672 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizedRequestController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizedRequestController.java @@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.web.bind.annotation.*; @@ -278,7 +279,7 @@ public class DecentralizedRequestController { @ApiOperation(value = "二级审核分散采购申请", notes = "二级审核分散采购申请") @SysLog("审核分散采购申请明细") @PutMapping("/secondary/audit") -// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_secondary')") + @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_secondary')") public R secondaryAuditRequest(@RequestBody AuditAndApproveDTO auditAndApproveDto, 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 42a4ec1..74a1065 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java @@ -10,10 +10,12 @@ 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.entity.InstructionBook; import digital.laboratory.platform.reagent.entity.ReagentConsumables; import digital.laboratory.platform.reagent.service.InstructionBookService; import digital.laboratory.platform.reagent.service.ReagentConsumablesService; +import digital.laboratory.platform.reagent.vo.InstructionBookVO; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -64,7 +66,7 @@ public class InstructionBookController { @ApiOperation(value = "上传(标准物质期间核查指导书)", notes = "上传(标准物质期间核查指导书)") @SysLog("上传(标准物质期间核查指导书)") @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_instruction_book_add')" ) +// @PreAuthorize("@pms.hasPermission('reagent_instruction_book_upload')" ) public R upload(String id, @RequestPart(value = "file", required = false) MultipartFile file, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -85,6 +87,7 @@ public class InstructionBookController { instructionBook.setMakerId(dlpUser.getId()); instructionBook.setReferenceMaterialTypeId(byId.getReagentConsumableId()); instructionBook.setInstructionBook(fileName); + instructionBook.setCommitStatus(1); String fileNames = path + "/" + fileName; @@ -107,7 +110,7 @@ public class InstructionBookController { @ApiOperation(value = "预览(标准物质期间核查指导书)", notes = "预览(标准物质期间核查指导书)(标准物质期间核查指导书)") @SysLog("预览(标准物质期间核查指导书)(标准物质期间核查指导书)") @GetMapping("/download") -// @PreAuthorize("@pms.hasPermission('reagent_instruction_book_add')" ) +// @PreAuthorize("@pms.hasPermission('reagent_instruction_book_download')" ) public R download(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -134,6 +137,49 @@ public class InstructionBookController { } else return R.ok(null); } + + /** + * 新增(标准物质期间核查指导书) + * + * @param id (标准物质期间核查指导书) + * @return R + */ + @ApiOperation(value = "查看(标准物质期间核查指导书)", notes = "查看(标准物质期间核查指导书)(标准物质期间核查指导书)") + @SysLog("查看(标准物质期间核查指导书)(标准物质期间核查指导书)") + @GetMapping() +// @PreAuthorize("@pms.hasPermission('reagent_instruction_book_get')" ) + public R getVOById(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + InstructionBookVO vo = instructionBookService.getVO(id); + + return R.ok(vo); + + } + + /** + * 新增(标准物质期间核查指导书) + * + * @param auditAndApproveDTO (标准物质期间核查指导书) + * @return R + */ + @ApiOperation(value = "审核(标准物质期间核查指导书)", notes = "审核(标准物质期间核查指导书)(标准物质期间核查指导书)") + @SysLog("审核(标准物质期间核查指导书)(标准物质期间核查指导书)") + @PostMapping("/audit") +// @PreAuthorize("@pms.hasPermission('reagent_instruction_book_audit')" ) + public R auditById(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 vo = instructionBookService.getVO(instructionBook.getReferenceMaterialTypeId()); + + return R.ok(vo); + + } + } 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 56f232c..e146182 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java @@ -71,7 +71,7 @@ public class PeriodVerificationImplementationController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page" ) -// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_get')" ) +// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_page')" ) public R> getPeriodVerificationImplementationPage(Page page, String name,PeriodVerificationImplementation periodVerificationImplementation, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -147,7 +147,7 @@ public class PeriodVerificationImplementationController { @ApiOperation(value = "提交(标准物质期间核查实施情况及结果记录表)", notes = "提交(标准物质期间核查实施情况及结果记录表)") @SysLog("提交(标准物质期间核查实施情况及结果记录表)" ) @PostMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_edit')" ) +// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_commit')" ) public R commitById(@RequestBody PeriodVerificationImplementationDTO periodVerificationImplementationDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -170,9 +170,9 @@ public class PeriodVerificationImplementationController { * @return R */ @ApiOperation(value = "审核(标准物质期间核查实施情况及结果记录表)", notes = "审核(标准物质期间核查实施情况及结果记录表)") - @SysLog("修改(标准物质期间核查实施情况及结果记录表)" ) + @SysLog("审核(标准物质期间核查实施情况及结果记录表)" ) @PutMapping("/audit") -// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_edit')" ) +// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_audit')" ) public R auditById(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ProvideServicesOrSuppliesController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ProvideServicesOrSuppliesController.java index 724f5b4..4ad3168 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/ProvideServicesOrSuppliesController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/ProvideServicesOrSuppliesController.java @@ -7,8 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.reagent.entity.Blacklist; import digital.laboratory.platform.reagent.entity.ProvideServicesOrSupplies; +import digital.laboratory.platform.reagent.service.BlacklistService; import digital.laboratory.platform.reagent.service.ProvideServicesOrSuppliesService; +import digital.laboratory.platform.reagent.vo.BlackListVO; import digital.laboratory.platform.reagent.vo.ProvideServicesOrSuppliesVO; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; @@ -44,6 +47,8 @@ public class ProvideServicesOrSuppliesController { private final ProvideServicesOrSuppliesService provideServicesOrSuppliesService; + private final BlacklistService blacklistService; + /** * 通过id查询提供服务或供应品 * @param supplierInformationId id @@ -61,6 +66,24 @@ public class ProvideServicesOrSuppliesController { //return R.ok(provideServicesOrSuppliesService.getById(provideServicesOrSuppliesid)); } + /** + * 通过id查询提供服务或供应品 + * @param supplierInformationId id + * @return R + */ + @ApiOperation(value = "通过供应商id不符合内容", notes = "通过供应商id不符合内容") + @GetMapping("/blackList") +// @PreAuthorize("@pms.hasPermission('reagent_provide_services_or_supplies_get')" ) + public R> getBlackList(String supplierInformationId, HttpServletRequest theHttpServletRequest) { + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + List blacklist = blacklistService.getBlacklist(supplierInformationId); + + return R.ok(blacklist); + //return R.ok(provideServicesOrSuppliesService.getById(provideServicesOrSuppliesid)); + } + } 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 b49dca1..73a5f23 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java @@ -16,6 +16,7 @@ import digital.laboratory.platform.reagent.entity.CatalogueDetails; import digital.laboratory.platform.reagent.entity.PurchaseCatalogue; import digital.laboratory.platform.reagent.service.CatalogueDetailsService; import digital.laboratory.platform.reagent.service.PurchaseCatalogueService; +import digital.laboratory.platform.reagent.vo.CatalogueDetailsVO; import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.format.annotation.DateTimeFormat; @@ -67,7 +68,7 @@ public class PurchaseCatalogueController { @ApiOperation(value = "分页查询已发布的采购目录明细", notes = "分页查询已发布的采购目录明细") @GetMapping("/page") // @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_getPage')") - public R getPurchaseCataloguePage(HttpServletRequest theHttpServletRequest) { + public R> getPurchaseCataloguePage(HttpServletRequest theHttpServletRequest) { 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 3f26fbf..56b6990 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java @@ -9,7 +9,9 @@ import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO; +import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm; +import digital.laboratory.platform.reagent.service.ReferenceMaterialService; import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService; import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO; import org.springframework.security.access.prepost.PreAuthorize; @@ -45,6 +47,8 @@ public class StandardMaterialApprovalFormController { private final StandardMaterialApprovalFormService standardMaterialApprovalFormService; + private final ReferenceMaterialService referenceMaterialService; + /** * 通过id查询(标准物质停用/报废销毁/恢复/降级使用审批表) * @param id @@ -70,7 +74,7 @@ public class StandardMaterialApprovalFormController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page" ) -// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" ) +// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_page)" ) public R> getStandardMaterialApprovalFormPage(Page page, StandardMaterialApprovalForm standardMaterialApprovalForm, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -114,7 +118,7 @@ public class StandardMaterialApprovalFormController { @ApiOperation(value = "一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)") @SysLog("一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)" ) @PutMapping("/auditPrimary") -// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_edit')" ) +// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_auditPrimary')" ) public R auditPrimary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -137,7 +141,7 @@ public class StandardMaterialApprovalFormController { @ApiOperation(value = "二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)") @SysLog("一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)" ) @PutMapping("/auditSecondary") -// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_edit')" ) +// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_auditSecondary')" ) public R auditSecondary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -160,7 +164,7 @@ public class StandardMaterialApprovalFormController { @ApiOperation(value = "审批(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "审批(标准物质停用/报废销毁/恢复/降级使用审批表)") @SysLog("审批(标准物质停用/报废销毁/恢复/降级使用审批表)" ) @PutMapping("/approve") -// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_edit')" ) +// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_approve')" ) public R approveById(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -174,4 +178,24 @@ public class StandardMaterialApprovalFormController { return R.failed(standardMaterialApprovalForm, "审批失败"); } } + + @ApiOperation(value = "标准物质停用", notes = "标准物质停用") + @SysLog("标准物质停用" ) + @PostMapping("/deactivate") +// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_add')" ) + 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("停用成功"); + } + else { + return R.failed( "停用失败"); + } + } } 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 e91fad3..795302b 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java @@ -1,8 +1,11 @@ package digital.laboratory.platform.reagent.controller; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.file.FileNameUtil; +import cn.hutool.json.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import digital.laboratory.platform.common.core.util.R; @@ -25,8 +28,11 @@ import org.springframework.web.multipart.MultipartFile; import javax.activation.MimetypesFileTypeMap; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; import java.io.IOException; +import java.io.InputStream; import java.security.Principal; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -147,6 +153,7 @@ public class SupplierInformationController { } } + /** * 上传供应人照片 * @@ -155,9 +162,9 @@ public class SupplierInformationController { */ @ApiOperation(value = "上传供应人照片", notes = "上传供应人照片/供应商信息") @SysLog("修改服务商/供应商信息") - @PostMapping("/upload") + @PostMapping("/upload/{id}") // @PreAuthorize("@pms.hasPermission('reagent_supplier_information_add')" ) - public R putUpdateById(String id, @RequestPart(value = "file", required = false) MultipartFile file, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + public R putUpdateById(@PathVariable("id") String id, @RequestPart(value = "file") MultipartFile file, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { Principal principal = theHttpServletRequest.getUserPrincipal(); @@ -165,25 +172,29 @@ public class SupplierInformationController { SupplierInformation supplierInformation = supplierInformationService.getById(id); - 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("上传失败"); + 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") @@ -268,7 +279,66 @@ public class SupplierInformationController { return R.ok(supplierInformation); } else return R.failed(); + } - + /** + * 录入样品时上传图片,使用fastjson 解析json 对象 + * + * @param id + * @param jsonParam + * @return + * @throws Exception + */ + @ApiOperation(value = "上传供应商图片,使用fastjson 解析json 对象", + notes = "上传供应商图片,使用fastjson 解析json 对象") + @SysLog("上传供应商图片,使用fastjson 解析json 对象") + @PostMapping(value = "/picture_base64/{id}") +// @PreAuthorize("@pms.hasAnyPermission('HairJobSampleCreate')") + 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); + if (byId != null) { + String image = jsonParam.getStr("image"); + //System.out.println(String.format("image=%s", image)); + + if (StringUtils.isNotEmpty(image)) { + try { + String suffix = image.substring(11, image.indexOf(";")); + String fileName = DateUtil.format(new Date(), "yyyyMMddHHmmss") + "." + suffix; + System.out.println(String.format("fileName=[%s]", fileName)); + + //去掉头信息 + String imgBase64 = image.substring(image.indexOf(",") + 1); + byte[] decoded = org.apache.commons.codec.binary.Base64.decodeBase64(imgBase64); + InputStream is = new ByteArrayInputStream(decoded); + + // 生成存储路径 + String path = "reagen_managment" + "/" + "supplierInformation" + "/" + byId.getId(); + + + Map ResultData = new HashMap<>(); + ResultData.put("fileName", fileName); + ResultData.put("path", path); + + boolean r = ossFile.fileSave(path + "/" + fileName, is); + if (r) { + + byId.setPhotograph(fileName); + byId.setPhotographOfSupplier(path); + supplierInformationService.updateById(byId); + return R.ok(ResultData, "上传成功"); + + } + return R.failed("上传失败"); + + } catch (Exception e) { + e.printStackTrace(); + return R.failed("上传失败"); + } + } else { + return R.failed("上传的数据中没有图像"); + } + } + return R.failed("不存在这个供应商"); } } diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/EvaluationFormDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/EvaluationFormDTO.java index c0bcd82..59fd1c4 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/EvaluationFormDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/EvaluationFormDTO.java @@ -23,41 +23,39 @@ EvaluationFormDTO { private String contactPerson; @ApiModelProperty(value="供应商信息评价表id") - private String evaluationFormId; - @ApiModelProperty(value = "(供应商营业执照)") + @ApiModelProperty(value = "(供应商营业执照)") private String supplierBusinessLicense; - @ApiModelProperty(value = "(供应商通过质量保证体系)") + @ApiModelProperty(value = "(供应商通过质量保证体系)") private String supplierPassesQualityAssuranceSystem; - @ApiModelProperty(value = "(供应商产品认证)") + @ApiModelProperty(value = "(供应商产品认证)") private String supplierProductCertification; - @ApiModelProperty(value = "(对供应品检验校准效率)") + @ApiModelProperty(value = "(对供应品检验校准效率)") private String checkAndCalibrateEfficiencyOfSupplies; - @ApiModelProperty(value = "(对供应商总体服务是否满意)") + @ApiModelProperty(value = "(对供应商总体服务是否满意)") private String overallSupplierServiceSatisfaction; - @ApiModelProperty(value = "(供应商态度)") + @ApiModelProperty(value = "(供应商态度)") private String supplierAttitude; - @ApiModelProperty(value = "(供应商设备与设施)") + @ApiModelProperty(value = "(供应商设备与设施)") private String supplierEquipmentAndFacilities; - @ApiModelProperty(value = "(供应商技术与管理能力)") + @ApiModelProperty(value = "(供应商技术与管理能力)") private String supplierTechnologyAndManagementCapability; - @ApiModelProperty(value = "(供应商交货是否及时)") + @ApiModelProperty(value = "(供应商交货是否及时)") private String whetherTheSupplierDeliversOnTime; - @ApiModelProperty(value = "(供应商ID") + @ApiModelProperty(value = "(供应商ID") private String supplierInformationId; @ApiModelProperty(value = "(一级评价意见//该意见为当前登录用户的评价意见,不同于审核)") - private String commentsFromPrimary; diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/DetailsOfCentralized.java b/src/main/java/digital/laboratory/platform/reagent/entity/DetailsOfCentralized.java index 95fe6bc..1f4b15c 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/DetailsOfCentralized.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/DetailsOfCentralized.java @@ -84,10 +84,11 @@ public class DetailsOfCentralized extends BaseEntity { @TableId(value = "id", type = IdType.ASSIGN_UUID) @ApiModelProperty(value="集中采购明细ID") private String id; - /** * (备注) */ @ApiModelProperty(value="采购计划修改备注") private String detailsRemark; + + } diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/InstructionBook.java b/src/main/java/digital/laboratory/platform/reagent/entity/InstructionBook.java index 8f99b80..6f77426 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/InstructionBook.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/InstructionBook.java @@ -36,7 +36,7 @@ public class InstructionBook extends BaseEntity { * 技术负责人审核结果 */ @ApiModelProperty(value="技术负责人审核结果") - private String auditResultOfTechnical; + private boolean auditResultOfTechnical; /** * 技术负责人审核时间 diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/ComplianceCheckMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/ComplianceCheckMapper.java index 8427b50..052870c 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/ComplianceCheckMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/ComplianceCheckMapper.java @@ -3,6 +3,7 @@ package digital.laboratory.platform.reagent.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.ComplianceCheck; import digital.laboratory.platform.reagent.vo.ComplianceCheckVO; import org.apache.ibatis.annotations.Mapper; @@ -19,7 +20,7 @@ import java.util.List; @Mapper public interface ComplianceCheckMapper extends BaseMapper { - IPage getComplianceCheckVOPage (IPage page, QueryWrapper qw); + IPage getComplianceCheckVOPage (IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); List getComplianceCheckVOList (QueryWrapper qw) ; ComplianceCheckVO getComplianceCheckVO(String complianceCheckId); diff --git a/src/main/java/digital/laboratory/platform/reagent/service/BlacklistService.java b/src/main/java/digital/laboratory/platform/reagent/service/BlacklistService.java index b456ec8..008b117 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/BlacklistService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/BlacklistService.java @@ -2,6 +2,9 @@ package digital.laboratory.platform.reagent.service; import com.baomidou.mybatisplus.extension.service.IService; import digital.laboratory.platform.reagent.entity.Blacklist; +import digital.laboratory.platform.reagent.vo.BlackListVO; + +import java.util.List; /** * (试剂耗材黑名单)服务类 @@ -14,4 +17,6 @@ public interface BlacklistService extends IService { Blacklist addListById(String reagentConsumableId, String supplierId); Blacklist addListById2(String reagentConsumableId, String supplierId); + + List getBlacklist(String supplierInformationId); } 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 d39b851..b3e6884 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/InstructionBookService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/InstructionBookService.java @@ -1,7 +1,10 @@ package digital.laboratory.platform.reagent.service; import com.baomidou.mybatisplus.extension.service.IService; +import digital.laboratory.platform.common.mybatis.security.service.DLPUser; +import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.entity.InstructionBook; +import digital.laboratory.platform.reagent.vo.InstructionBookVO; /** * (标准物质期间核查指导书)服务类 @@ -11,4 +14,7 @@ import digital.laboratory.platform.reagent.entity.InstructionBook; */ public interface InstructionBookService extends IService { + InstructionBook auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser); + + InstructionBookVO getVO(String id); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/AcceptanceRecordFormServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/AcceptanceRecordFormServiceImpl.java index d75b728..0169deb 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/AcceptanceRecordFormServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/AcceptanceRecordFormServiceImpl.java @@ -52,10 +52,6 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl getBlacklist(String supplierInformationId) { + + LambdaQueryWrapper blacklistLambdaQueryWrapper = new LambdaQueryWrapper<>(); + + blacklistLambdaQueryWrapper.eq(Blacklist::getSupplierId, supplierInformationId); + + List list = blacklistService.list(blacklistLambdaQueryWrapper); + + List blackListVOS = new ArrayList<>(); + + for (Blacklist blacklist : list) { + + BlackListVO blackListVO = new BlackListVO(); + + ReagentConsumables byId = reagentConsumablesService.getById(blacklist.getReagentConsumableId()); + + blackListVO.setReagentConsumableName(byId.getReagentConsumableName()); + blackListVO.setCategory(byId.getCategory()); + blackListVO.setBrand(byId.getBrand()); + blackListVO.setSpecificationAndModel(byId.getSpecificationAndModel()); + + blackListVOS.add(blackListVO); + } + + return blackListVOS; } } 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 76763e4..b29325d 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 @@ -1,11 +1,21 @@ package digital.laboratory.platform.reagent.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import digital.laboratory.platform.common.mybatis.security.service.DLPUser; +import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.entity.InstructionBook; +import digital.laboratory.platform.reagent.entity.ReagentConsumables; import digital.laboratory.platform.reagent.mapper.InstructionBookMapper; import digital.laboratory.platform.reagent.service.InstructionBookService; +import digital.laboratory.platform.reagent.service.ReagentConsumablesService; +import digital.laboratory.platform.reagent.vo.InstructionBookVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.time.LocalDateTime; + /** * (标准物质期间核查指导书)服务实现类 * @@ -15,4 +25,51 @@ import org.springframework.stereotype.Service; @Service public class InstructionBookServiceImpl extends ServiceImpl implements InstructionBookService { + @Autowired + private InstructionBookService instructionBookService; + + @Autowired + private ReagentConsumablesService reagentConsumablesService; + @Override + public InstructionBook auditById(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser){ + + InstructionBook byId = instructionBookService.getById(auditAndApproveDTO.getUuId()); + + byId.setAuditOpinionOfTechnical(auditAndApproveDTO.getAuditOpinion()); + byId.setAuditResultOfTechnical(auditAndApproveDTO.getAuditResult()); + byId.setAuditTimeOfTechnical(LocalDateTime.now()); + byId.setTechnicalDirectorId(dlpUser.getId()); + + if (auditAndApproveDTO.getAuditResult()==true){ + + byId.setCommitStatus(2); + } + else byId.setCommitStatus(-1); + + if (instructionBookService.updateById(byId)){ + + return byId; + }else return null; + } + + @Override + public InstructionBookVO getVO(String id){ + + LambdaQueryWrapper instructionBookLambdaQueryWrapper = new LambdaQueryWrapper<>(); + + instructionBookLambdaQueryWrapper.eq(InstructionBook::getReferenceMaterialTypeId,id); + + InstructionBook one = instructionBookService.getOne(instructionBookLambdaQueryWrapper); + + InstructionBookVO instructionBookVO = new InstructionBookVO(); + + BeanUtils.copyProperties(one,instructionBookVO); + + ReagentConsumables byId = reagentConsumablesService.getById(instructionBookVO.getReferenceMaterialTypeId()); + + instructionBookVO.setReagentConsumables(byId); + + return instructionBookVO; + } + } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/StandardMaterialApprovalFormServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/StandardMaterialApprovalFormServiceImpl.java index 4eea825..4cc4465 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/StandardMaterialApprovalFormServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/StandardMaterialApprovalFormServiceImpl.java @@ -25,7 +25,7 @@ import java.time.LocalDateTime; * (标准物质停用/报废销毁/恢复/降级使用审批表)服务实现类 * * @author Zhang Xiaolong created at 2023-03-10 - * @describe (标准物质停用/报废销毁/恢复/降级使用审批表) 服务实现类 + * @describe (标准物质停用 / 报废销毁 / 恢复 / 降级使用审批表) 服务实现类 */ @Service public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl implements StandardMaterialApprovalFormService { @@ -38,61 +38,71 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl getVOPage(IPage page, QueryWrapper qw){ + public IPage getVOPage(IPage page, QueryWrapper qw) { IPage voPage = baseMapper.getVOPage(page, qw); return voPage; } + @Override - public StandardMaterialApprovalFormVO getVO(String standardMaterialApprovalFormId){ + public StandardMaterialApprovalFormVO getVO(String standardMaterialApprovalFormId) { StandardMaterialApprovalForm byId = standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId); StandardMaterialApprovalFormVO standardMaterialApprovalFormVO = new StandardMaterialApprovalFormVO(); - BeanUtils.copyProperties(byId,standardMaterialApprovalFormVO); + BeanUtils.copyProperties(byId, standardMaterialApprovalFormVO); SupplierInformation byId1 = supplierInformationService.getById(standardMaterialApprovalFormVO.getManufacturerId()); @@ -102,7 +112,7 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl list = supplierInformationService.list(supplierInformationQueryWrapper); + if (list.size()!=0){ + for (SupplierInformation information : list) { if (information.getSupplierName().equals(supplierInformationDTO.getSupplierName())) { throw new RuntimeException(String.format("该供应商信息已存在")); } - } + }} BeanUtils.copyProperties(supplierInformationDTO, supplierInformation); @@ -96,4 +98,5 @@ public class SupplierInformationServiceImpl extends ServiceImpl catalogueDetailsListList; - @ApiModelProperty(value="部门名称") + @ApiModelProperty(value="部门名称") private String orgName; - @ApiModelProperty(value="创建人名称") + @ApiModelProperty(value="创建人名称") private String createName; - @ApiModelProperty(value="总数量") + @ApiModelProperty(value="总数量") private Integer quantity; } diff --git a/src/main/resources/mapper/ComplianceCheckMapper.xml b/src/main/resources/mapper/ComplianceCheckMapper.xml index ae97187..2f710c2 100644 --- a/src/main/resources/mapper/ComplianceCheckMapper.xml +++ b/src/main/resources/mapper/ComplianceCheckMapper.xml @@ -62,6 +62,7 @@