From 45cf686a025f3eccaa5406c1f7ee0321813633d1 Mon Sep 17 00:00:00 2001 From: yanghaihang <1344638791@qq.com> Date: Thu, 27 Apr 2023 17:55:47 +0800 Subject: [PATCH] 4.27 --- pom.xml | 10 +- .../AcceptanceRecordFormController.java | 2 +- .../controller/CheckScheduleController.java | 6 +- .../FixedValueReportController.java | 163 +++++++-------- .../controller/InstructionBookController.java | 187 +++++++++--------- ...dVerificationImplementationController.java | 36 +--- ...tandardMaterialApprovalFormController.java | 59 +----- .../StandardReserveSolutionController.java | 107 +++++----- .../SupplierInformationController.java | 154 ++++++++++++--- .../WarehousingRecordFormController.java | 42 +++- .../PeriodVerificationImplementationDTO.java | 24 +-- .../dto/PeriodVerificationPlanDTO.java | 4 +- .../reagent/dto/ReagentConsumablesSetDTO.java | 6 - .../dto/StandardMaterialApplicationDTO.java | 10 +- .../dto/StandardMaterialApprovalFormDTO.java | 37 +++- .../reagent/dto/WarehousingRecordFormDTO.java | 2 - .../platform/reagent/entity/BatchDetails.java | 2 +- .../reagent/entity/InstructionBook.java | 4 +- .../PeriodVerificationImplementation.java | 23 ++- .../entity/PeriodVerificationPlan.java | 2 +- .../entity/ReagentConsumableInventory.java | 2 +- .../entity/StandardMaterialApplication.java | 2 + .../entity/StandardMaterialApprovalForm.java | 8 +- .../entity/StandardReserveSolution.java | 9 +- .../reagent/entity/SupplierInformation.java | 12 ++ .../reagent/entity/WarehousingBatchList.java | 6 + .../reagent/entity/WarehousingContent.java | 5 + .../mapper/PeriodVerificationPlanMapper.java | 4 + .../mapper/StandardReserveSolutionMapper.java | 4 +- .../mapper/WarehousingContentMapper.java | 7 + ...riodVerificationImplementationService.java | 5 +- .../PeriodVerificationPlanService.java | 4 + .../StandardMaterialApprovalFormService.java | 7 +- .../StandardReserveSolutionService.java | 8 +- .../service/WarehousingContentService.java | 4 + .../service/WarehousingRecordFormService.java | 4 +- .../impl/CentralizedRequestServiceImpl.java | 1 - .../impl/CheckScheduleServiceImpl.java | 48 +++-- .../DeliveryRegistrationFormServiceImpl.java | 77 +++++--- .../impl/DetailsOfCentralizedServiceImpl.java | 1 - ...VerificationImplementationServiceImpl.java | 90 +++++---- .../PeriodVerificationPlanServiceImpl.java | 29 +++ .../service/impl/PurchaseListServiceImpl.java | 7 + ...ReagentConsumableInventoryServiceImpl.java | 41 +++- .../impl/RequisitionRecordServiceImpl.java | 1 + ...tandardMaterialApplicationServiceImpl.java | 23 +-- ...andardMaterialApprovalFormServiceImpl.java | 67 ++++--- .../StandardReserveSolutionServiceImpl.java | 76 +++++-- .../impl/WarehousingContentServiceImpl.java | 29 +++ .../WarehousingRecordFormServiceImpl.java | 15 +- .../vo/StandardMaterialApplicationVO.java | 10 + .../reagent/vo/WarehousingContentVO.java | 3 - src/main/resources/bootstrap.yml | 20 +- .../mapper/InstructionBookMapper.xml | 2 +- ...PeriodVerificationImplementationMapper.xml | 12 +- .../mapper/PeriodVerificationPlanMapper.xml | 14 +- .../StandardMaterialApplicationMapper.xml | 11 +- .../StandardMaterialApprovalFormMapper.xml | 3 +- .../mapper/StandardReserveSolutionMapper.xml | 3 +- .../mapper/SupplierInformationMapper.xml | 2 + .../mapper/WarehousingContentMapper.xml | 13 +- 61 files changed, 955 insertions(+), 614 deletions(-) delete mode 100644 src/main/java/digital/laboratory/platform/reagent/dto/ReagentConsumablesSetDTO.java diff --git a/pom.xml b/pom.xml index 2600182..3c0626d 100644 --- a/pom.xml +++ b/pom.xml @@ -66,11 +66,11 @@ 2022.10.11-snapshots - - - - - + + digital.laboratory.platform + dlp-common-oss + 2022.10.11-snapshots + 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 667e337..e6b76d6 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/AcceptanceRecordFormController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/AcceptanceRecordFormController.java @@ -94,7 +94,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, AcceptanceRecordForm acceptanceRecordForm, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); 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 eaf394b..334fac8 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java @@ -13,6 +13,7 @@ import digital.laboratory.platform.reagent.dto.PeriodVerificationPlanDTO; import digital.laboratory.platform.reagent.entity.CheckSchedule; import digital.laboratory.platform.reagent.entity.PeriodVerificationPlan; import digital.laboratory.platform.reagent.service.CheckScheduleService; +import digital.laboratory.platform.reagent.service.InstructionBookService; import digital.laboratory.platform.reagent.vo.CheckScheduleVO; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; @@ -46,6 +47,8 @@ public class CheckScheduleController { private final CheckScheduleService checkScheduleService; + + /** * 通过id查询 * @@ -87,7 +90,7 @@ public class CheckScheduleController { checkScheduleQueryWrapper.eq("number",number); } IPage checkScheduleVOPage = checkScheduleService.getCheckScheduleVOPage(page, checkScheduleQueryWrapper - .orderByAsc("create_time")); + .orderByDesc("create_time")); return R.ok(checkScheduleVOPage); } @@ -179,4 +182,5 @@ public class CheckScheduleController { } + } diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/FixedValueReportController.java b/src/main/java/digital/laboratory/platform/reagent/controller/FixedValueReportController.java index 1220d97..359b0b4 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/FixedValueReportController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/FixedValueReportController.java @@ -1,5 +1,7 @@ package digital.laboratory.platform.reagent.controller; +import cn.hutool.core.io.file.FileNameUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -7,19 +9,28 @@ 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.common.oss.service.OssFile; import digital.laboratory.platform.reagent.entity.FixedValueReport; +import digital.laboratory.platform.reagent.entity.InstructionBook; +import digital.laboratory.platform.reagent.entity.ReagentConsumables; +import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.service.FixedValueReportService; +import digital.laboratory.platform.reagent.service.ReferenceMaterialService; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.security.Principal; +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; /** * (定值报告) @@ -42,110 +53,86 @@ public class FixedValueReportController { private final FixedValueReportService fixedValueReportService; + private final ReferenceMaterialService referenceMaterialService; + + private final OssFile ossFile; + /** - * 通过id查询(定值报告) - * @param fixedValueReportId id + * 新增定值报告 + * + * @param id 定值报告 * @return R */ - @ApiOperation(value = "通过id查询", notes = "通过id查询") - @GetMapping("/{fixedValueReportId}" ) - @PreAuthorize("@pms.hasPermission('reagent_fixed_value_report_get')" ) - public R getById(@PathVariable("fixedValueReportId" ) String fixedValueReportId, HttpServletRequest theHttpServletRequest) { + @ApiOperation(value = "上传定值报告", notes = "上传定值报告") + @SysLog("上传定值报告") + @PostMapping +// @PreAuthorize("@pms.hasPermission('fixed_value_report_add')" ) + public R upload(String id, String fixedResult,@RequestPart(value = "file", required = false) MultipartFile file, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - FixedValueReport fixedValueReport = fixedValueReportService.getById(fixedValueReportId); - return R.ok(fixedValueReport); - //return R.ok(fixedValueReportService.getById(fixedValueReportId)); + ReferenceMaterial byId = referenceMaterialService.getById(id); + + String path = "reagen_managment" + "/" + "fixedValueReport" + "/" + byId.getReagentConsumableId(); + String fileName = FileNameUtil.getName(file.getOriginalFilename()); + boolean b = ossFile.fileUpload(file, path); + Map ResultData = new HashMap<>(); + ResultData.put("fileName", fileName); + ResultData.put("path", path); + FixedValueReport fixedValueReport = new FixedValueReport(); + + if (b) { + fixedValueReport.setFixedValueReportId(IdWorker.get32UUID().toUpperCase()); + fixedValueReport.setFixedValueReport(fileName); + fixedValueReport.setFixedResult(fixedResult); + fixedValueReport.setReferenceSubstanceId(byId.getId()); + + String fileNames = path + "/" + fileName; + + ossFile.fileGet(fileNames, httpServletResponse.getOutputStream()); + + fixedValueReportService.save(fixedValueReport); + + return R.ok(fixedValueReport, "上传成功"); + } else return R.failed("上传失败"); } /** - * 分页查询 - * @param page 分页对象 - * @param fixedValueReport (定值报告) - * @return - */ - @ApiOperation(value = "分页查询", notes = "分页查询") - @GetMapping("/page" ) - @PreAuthorize("@pms.hasPermission('reagent_fixed_value_report_get')" ) - public R> getFixedValueReportPage(Page page, FixedValueReport fixedValueReport, HttpServletRequest theHttpServletRequest) { + * 新增定值报告 + * + * @param id 定值报告 + * @return R + */ + @ApiOperation(value = "预览定值报告", notes = "预览定值报告") + @SysLog("预览定值报告") + @GetMapping("/download") +// @PreAuthorize("@pms.hasPermission('reagent_instruction_book_add')" ) + public R download(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - IPage fixedValueReportSList = fixedValueReportService.page(page, Wrappers.query() - .eq("create_by", dlpUser.getId()) - .orderByDesc("create_time") - ); - return R.ok(fixedValueReportSList); -// return R.ok(fixedValueReportService.page(page, Wrappers.query(fixedValueReport))); - } - - - /** - * 新增(定值报告) - * @param fixedValueReport (定值报告) - * @return R - */ - @ApiOperation(value = "新增(定值报告)", notes = "新增(定值报告)") - @SysLog("新增(定值报告)" ) - @PostMapping - @PreAuthorize("@pms.hasPermission('reagent_fixed_value_report_add')" ) - public R postAddObject(@RequestBody FixedValueReport fixedValueReport, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + ReferenceMaterial byId = referenceMaterialService.getById(id); - fixedValueReport.setFixedValueReportId(IdWorker.get32UUID().toUpperCase()); - if (fixedValueReportService.save(fixedValueReport)) { - return R.ok(fixedValueReport, "对象创建成功"); - } - else { - return R.failed(fixedValueReport, "对象创建失败"); - } - } - - /** - * 修改(定值报告) - * @param fixedValueReport (定值报告) - * @return R - */ - @ApiOperation(value = "修改(定值报告)", notes = "修改(定值报告)") - @SysLog("修改(定值报告)" ) - @PutMapping - @PreAuthorize("@pms.hasPermission('reagent_fixed_value_report_edit')" ) - public R putUpdateById(@RequestBody FixedValueReport fixedValueReport, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + LambdaQueryWrapper fixedValueReportLambdaQueryWrapper = new LambdaQueryWrapper<>(); - if (fixedValueReportService.updateById(fixedValueReport)) { - return R.ok(fixedValueReport, "保存对象成功"); - } - else { - return R.failed(fixedValueReport, "保存对象失败"); - } - } - - /** - * 通过id删除(定值报告) - * @param fixedValueReportId id - * @return R - */ - @ApiOperation(value = "通过id删除(定值报告)", notes = "通过id删除(定值报告)") - @SysLog("通过id删除(定值报告)" ) - @DeleteMapping("/{fixedValueReportId}" ) - @PreAuthorize("@pms.hasPermission('reagent_fixed_value_report_del')" ) - public R deleteById(@PathVariable String fixedValueReportId, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + fixedValueReportLambdaQueryWrapper.eq(FixedValueReport::getReferenceSubstanceId,byId.getId()); + + FixedValueReport one = fixedValueReportService.getOne(fixedValueReportLambdaQueryWrapper); + + if (one != null) { - FixedValueReport oldFixedValueReport = fixedValueReportService.getById(fixedValueReportId); + String fileName = one.getFixedValueReport(); - if (fixedValueReportService.removeById(fixedValueReportId)) { - return R.ok(oldFixedValueReport, "对象删除成功"); - } - else { - return R.failed(oldFixedValueReport, "对象删除失败"); - } + String path = "reagen_managment" + "/" + "instructionBook" + "/" + byId.getReagentConsumableId(); - } + String fileNames = path + "/" + fileName; + ossFile.fileGet(fileNames, httpServletResponse.getOutputStream()); + + return R.ok(one); + } else + return R.ok(null); + } } 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 dcb0c3e..42a4ec1 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java @@ -1,5 +1,7 @@ package digital.laboratory.platform.reagent.controller; +import cn.hutool.core.io.file.FileNameUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -7,145 +9,134 @@ 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.common.oss.service.OssFile; 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 org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.security.Principal; +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; + /** * (标准物质期间核查指导书) * * @author Zhang Xiaolong created at 2023-03-10 * @describe (标准物质期间核查指导书) 前端控制器 - * + *

* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中 * 这里写什么: - * 为前端提供数据, 接受前端的数据 - * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理 - * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的 + * 为前端提供数据, 接受前端的数据 + * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理 + * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的 * 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换 */ @RestController @RequiredArgsConstructor -@RequestMapping("/instruction_book" ) +@RequestMapping("/instruction_book") @Api(value = "instruction_book", tags = "(标准物质期间核查指导书)管理") public class InstructionBookController { - private final InstructionBookService instructionBookService; - - /** - * 通过id查询(标准物质期间核查指导书) - * @param instructionBookId id - * @return R - */ - @ApiOperation(value = "通过id查询", notes = "通过id查询") - @GetMapping("/{instructionBookId}" ) - @PreAuthorize("@pms.hasPermission('reagent_instruction_book_get')" ) - public R getById(@PathVariable("instructionBookId" ) String instructionBookId, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - InstructionBook instructionBook = instructionBookService.getById(instructionBookId); - return R.ok(instructionBook); - //return R.ok(instructionBookService.getById(instructionBookId)); - } - - /** - * 分页查询 - * @param page 分页对象 - * @param instructionBook (标准物质期间核查指导书) - * @return - */ - @ApiOperation(value = "分页查询", notes = "分页查询") - @GetMapping("/page" ) - @PreAuthorize("@pms.hasPermission('reagent_instruction_book_get')" ) - public R> getInstructionBookPage(Page page, InstructionBook instructionBook, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - IPage instructionBookSList = instructionBookService.page(page, Wrappers.query() - .eq("create_by", dlpUser.getId()) - .orderByDesc("create_time") - ); - return R.ok(instructionBookSList); -// return R.ok(instructionBookService.page(page, Wrappers.query(instructionBook))); - } + private final ReagentConsumablesService reagentConsumablesService; + private final InstructionBookService instructionBookService; + private final OssFile ossFile; /** * 新增(标准物质期间核查指导书) - * @param instructionBook (标准物质期间核查指导书) + * + * @param id (标准物质期间核查指导书) * @return R */ - @ApiOperation(value = "新增(标准物质期间核查指导书)", notes = "新增(标准物质期间核查指导书)") - @SysLog("新增(标准物质期间核查指导书)" ) + @ApiOperation(value = "上传(标准物质期间核查指导书)", notes = "上传(标准物质期间核查指导书)") + @SysLog("上传(标准物质期间核查指导书)") @PostMapping - @PreAuthorize("@pms.hasPermission('reagent_instruction_book_add')" ) - public R postAddObject(@RequestBody InstructionBook instructionBook, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - instructionBook.setId(IdWorker.get32UUID().toUpperCase()); - if (instructionBookService.save(instructionBook)) { - return R.ok(instructionBook, "对象创建成功"); - } - else { - return R.failed(instructionBook, "对象创建失败"); - } - } +// @PreAuthorize("@pms.hasPermission('reagent_instruction_book_add')" ) + 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(); + + ReagentConsumables byId = reagentConsumablesService.getById(id); + + String path = "reagen_managment" + "/" + "instructionBook" + "/" + byId.getReagentConsumableId(); + String fileName = FileNameUtil.getName(file.getOriginalFilename()); + boolean b = ossFile.fileUpload(file, path); + Map ResultData = new HashMap<>(); + ResultData.put("fileName", fileName); + ResultData.put("path", path); + InstructionBook instructionBook = new InstructionBook(); + + if (b) { + instructionBook.setId(IdWorker.get32UUID().toUpperCase()); + instructionBook.setSetTime(LocalDateTime.now()); + instructionBook.setMakerId(dlpUser.getId()); + instructionBook.setReferenceMaterialTypeId(byId.getReagentConsumableId()); + instructionBook.setInstructionBook(fileName); + + String fileNames = path + "/" + fileName; + + ossFile.fileGet(fileNames, httpServletResponse.getOutputStream()); + + instructionBookService.save(instructionBook); + + return R.ok(instructionBook, "上传成功"); + } else return R.failed("上传失败"); + - /** - * 修改(标准物质期间核查指导书) - * @param instructionBook (标准物质期间核查指导书) - * @return R - */ - @ApiOperation(value = "修改(标准物质期间核查指导书)", notes = "修改(标准物质期间核查指导书)") - @SysLog("修改(标准物质期间核查指导书)" ) - @PutMapping - @PreAuthorize("@pms.hasPermission('reagent_instruction_book_edit')" ) - public R putUpdateById(@RequestBody InstructionBook instructionBook, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - if (instructionBookService.updateById(instructionBook)) { - return R.ok(instructionBook, "保存对象成功"); - } - else { - return R.failed(instructionBook, "保存对象失败"); - } } /** - * 通过id删除(标准物质期间核查指导书) - * @param instructionBookId id + * 新增(标准物质期间核查指导书) + * + * @param id (标准物质期间核查指导书) * @return R */ - @ApiOperation(value = "通过id删除(标准物质期间核查指导书)", notes = "通过id删除(标准物质期间核查指导书)") - @SysLog("通过id删除(标准物质期间核查指导书)" ) - @DeleteMapping("/{instructionBookId}" ) - @PreAuthorize("@pms.hasPermission('reagent_instruction_book_del')" ) - public R deleteById(@PathVariable String instructionBookId, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - InstructionBook oldInstructionBook = instructionBookService.getById(instructionBookId); - - if (instructionBookService.removeById(instructionBookId)) { - return R.ok(oldInstructionBook, "对象删除成功"); - } - else { - return R.failed(oldInstructionBook, "对象删除失败"); - } + @ApiOperation(value = "预览(标准物质期间核查指导书)", notes = "预览(标准物质期间核查指导书)(标准物质期间核查指导书)") + @SysLog("预览(标准物质期间核查指导书)(标准物质期间核查指导书)") + @GetMapping("/download") +// @PreAuthorize("@pms.hasPermission('reagent_instruction_book_add')" ) + public R download(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - } + ReagentConsumables byId = reagentConsumablesService.getById(id); + + LambdaQueryWrapper instructionBookLambdaQueryWrapper = new LambdaQueryWrapper<>(); + + instructionBookLambdaQueryWrapper.eq(InstructionBook::getReferenceMaterialTypeId, byId.getReagentConsumableId()); + + InstructionBook one = instructionBookService.getOne(instructionBookLambdaQueryWrapper); + + if (one != null) { + + String fileName = one.getInstructionBook(); + + String path = "reagen_managment" + "/" + "instructionBook" + "/" + byId.getReagentConsumableId(); + String fileNames = path + "/" + fileName; + + ossFile.fileGet(fileNames, httpServletResponse.getOutputStream()); + + return R.ok(one); + } else + return R.ok(null); + } } + + + + + 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 a254888..56f232c 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java @@ -52,9 +52,9 @@ public class PeriodVerificationImplementationController { * @return R */ @ApiOperation(value = "通过id查询", notes = "通过id查询") - @GetMapping("/{periodVerificationImplementationId}" ) + @GetMapping( ) // @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_get')" ) - public R getById(@PathVariable("periodVerificationImplementationId" ) String periodVerificationImplementationId, HttpServletRequest theHttpServletRequest) { + public R getById( String periodVerificationImplementationId, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -85,7 +85,6 @@ public class PeriodVerificationImplementationController { } IPage periodVerificationImplementationSList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.query() - .eq("create_by", dlpUser.getId()) .orderByDesc("create_time") ); return R.ok(periodVerificationImplementationSList); @@ -93,43 +92,20 @@ public class PeriodVerificationImplementationController { } - /** - * 新增(标准物质期间核查实施情况及结果记录表) - * @param periodVerificationImplementationDTOS (标准物质期间核查实施情况及结果记录表) - * @return R - */ - @ApiOperation(value = "新增(标准物质期间核查实施情况及结果记录表)", notes = "新增(标准物质期间核查实施情况及结果记录表)") - @SysLog("新增(标准物质期间核查实施情况及结果记录表)" ) - @PostMapping -// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_add')" ) - public R postAddObject(@RequestBody PeriodVerificationImplementationDTO periodVerificationImplementationDTOS, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - PeriodVerificationImplementation periodVerificationImplementation = periodVerificationImplementationService.addById(periodVerificationImplementationDTOS, dlpUser); - - if (periodVerificationImplementation!=null) { - return R.ok(periodVerificationImplementation, "保存成功"); - } - else { - return R.failed(periodVerificationImplementation, "对象创建失败"); - } - } - /** * 修改(标准物质期间核查实施情况及结果记录表) * @param periodVerificationImplementationDTO (标准物质期间核查实施情况及结果记录表) * @return R */ - @ApiOperation(value = "修改(标准物质期间核查实施情况及结果记录表)", notes = "修改(标准物质期间核查实施情况及结果记录表)") - @SysLog("修改(标准物质期间核查实施情况及结果记录表)" ) - @PutMapping + @ApiOperation(value = "录入(标准物质期间核查实施情况及结果记录表)", notes = "录入((标准物质期间核查实施情况及结果记录表)") + @SysLog("录入((标准物质期间核查实施情况及结果记录表)" ) + @PostMapping // @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(); - PeriodVerificationImplementation periodVerificationImplementation = periodVerificationImplementationService.editById(periodVerificationImplementationDTO); + PeriodVerificationImplementation periodVerificationImplementation = periodVerificationImplementationService.editById(periodVerificationImplementationDTO,dlpUser); if (periodVerificationImplementation!=null) { return R.ok(periodVerificationImplementation, "保存成功"); 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 e7382d6..3f26fbf 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/StandardMaterialApprovalFormController.java @@ -47,17 +47,17 @@ public class StandardMaterialApprovalFormController { /** * 通过id查询(标准物质停用/报废销毁/恢复/降级使用审批表) - * @param standardMaterialApprovalFormId id + * @param id * @return R */ @ApiOperation(value = "通过id查询", notes = "通过id查询") @GetMapping( ) // @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" ) - public R getById(String standardMaterialApprovalFormId, HttpServletRequest theHttpServletRequest) { + public R getById(String id, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - StandardMaterialApprovalFormVO standardMaterialApprovalForm = standardMaterialApprovalFormService.getVO(standardMaterialApprovalFormId); + StandardMaterialApprovalFormVO standardMaterialApprovalForm = standardMaterialApprovalFormService.getVO(id); return R.ok(standardMaterialApprovalForm); //return R.ok(standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId)); } @@ -96,7 +96,7 @@ public class StandardMaterialApprovalFormController { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.addById(standardMaterialApprovalFormDTO, dlpUser); + StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.commitById(standardMaterialApprovalFormDTO, dlpUser); if (standardMaterialApprovalForm!=null) { return R.ok(standardMaterialApprovalForm, "保存成功"); @@ -106,51 +106,6 @@ public class StandardMaterialApprovalFormController { } } - /** - * 修改(标准物质停用/报废销毁/恢复/降级使用审批表) - * @param standardMaterialApprovalFormDTO (标准物质停用/报废销毁/恢复/降级使用审批表) - * @return R - */ - @ApiOperation(value = "修改(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "修改(标准物质停用/报废销毁/恢复/降级使用审批表)") - @SysLog("修改(标准物质停用/报废销毁/恢复/降级使用审批表)" ) - @PutMapping -// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_edit')" ) - public R putUpdateById(@RequestBody StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.editById(standardMaterialApprovalFormDTO); - - if (standardMaterialApprovalForm!=null) { - return R.ok(standardMaterialApprovalForm, "修改成功"); - } - else { - return R.failed(standardMaterialApprovalForm, "修改失败"); - } - } - - /** - * 修改(标准物质停用/报废销毁/恢复/降级使用审批表) - * @param standardMaterialApprovalFormDTO (标准物质停用/报废销毁/恢复/降级使用审批表) - * @return R - */ - @ApiOperation(value = "修改(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "修改(标准物质停用/报废销毁/恢复/降级使用审批表)") - @SysLog("修改(标准物质停用/报废销毁/恢复/降级使用审批表)" ) - @PostMapping("/commit") -// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_edit')" ) - public R commitById(@RequestBody StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, HttpServletRequest theHttpServletRequest) { - Principal principal = theHttpServletRequest.getUserPrincipal(); - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - - StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.commitById(standardMaterialApprovalFormDTO, dlpUser); - - if (standardMaterialApprovalForm!=null) { - return R.ok(standardMaterialApprovalForm, "提交成功"); - } - else { - return R.failed(standardMaterialApprovalForm, "提交失败"); - } - } /** * 一级审核(标准物质停用/报废销毁/恢复/降级使用审批表) * @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表) @@ -159,7 +114,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_edit')" ) public R auditPrimary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -182,7 +137,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_edit')" ) public R auditSecondary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); @@ -205,7 +160,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_edit')" ) public R approveById(@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/StandardReserveSolutionController.java b/src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java index 4456bef..5f35ea3 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/StandardReserveSolutionController.java @@ -7,8 +7,12 @@ 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.dto.StandardReserveSolutionDTO; +import digital.laboratory.platform.reagent.dto.StandardReserveSolutionFullDTO; import digital.laboratory.platform.reagent.entity.StandardReserveSolution; import digital.laboratory.platform.reagent.service.StandardReserveSolutionService; +import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO; +import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -44,18 +48,18 @@ public class StandardReserveSolutionController { /** * 通过id查询(标准储备溶液配制及使用记录表) - * @param standardReserveSolutionId id + * @param id id * @return R */ @ApiOperation(value = "通过id查询", notes = "通过id查询") - @GetMapping("/{standardReserveSolutionId}" ) - @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_get')" ) - public R getById(@PathVariable("standardReserveSolutionId" ) String standardReserveSolutionId, HttpServletRequest theHttpServletRequest) { + @GetMapping( ) +// @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(); - StandardReserveSolution standardReserveSolution = standardReserveSolutionService.getById(standardReserveSolutionId); - return R.ok(standardReserveSolution); + StandardReserveSolutionVO standardReserveSolutionVOById = standardReserveSolutionService.getStandardReserveSolutionVOById(id); + return R.ok(standardReserveSolutionVOById); //return R.ok(standardReserveSolutionService.getById(standardReserveSolutionId)); } @@ -67,13 +71,12 @@ public class StandardReserveSolutionController { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page" ) - @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_get')" ) - public R> getStandardReserveSolutionPage(Page page, StandardReserveSolution standardReserveSolution, HttpServletRequest theHttpServletRequest) { +// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_get')" ) + public R> getStandardReserveSolutionPage(Page page, StandardReserveSolution standardReserveSolution, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - IPage standardReserveSolutionSList = standardReserveSolutionService.page(page, Wrappers.query() - .eq("create_by", dlpUser.getId()) + IPage standardReserveSolutionSList = standardReserveSolutionService.getStandardReserveSolutionVOList(page, Wrappers.query() .orderByDesc("create_time") ); return R.ok(standardReserveSolutionSList); @@ -83,69 +86,59 @@ public class StandardReserveSolutionController { /** * 新增(标准储备溶液配制及使用记录表) - * @param standardReserveSolution (标准储备溶液配制及使用记录表) + * @param standardReserveSolutionDTO (标准储备溶液配制及使用记录表) * @return R */ @ApiOperation(value = "新增(标准储备溶液配制及使用记录表)", notes = "新增(标准储备溶液配制及使用记录表)") @SysLog("新增(标准储备溶液配制及使用记录表)" ) @PostMapping - @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_add')" ) - public R postAddObject(@RequestBody StandardReserveSolution standardReserveSolution, HttpServletRequest theHttpServletRequest) { +// @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(); - standardReserveSolution.setId(IdWorker.get32UUID().toUpperCase()); - if (standardReserveSolutionService.save(standardReserveSolution)) { - return R.ok(standardReserveSolution, "对象创建成功"); - } - else { - return R.failed(standardReserveSolution, "对象创建失败"); - } - } + StandardReserveSolutionVO standardReserveSolutionVO = standardReserveSolutionService.addById(standardReserveSolutionDTO, dlpUser); - /** - * 修改(标准储备溶液配制及使用记录表) - * @param standardReserveSolution (标准储备溶液配制及使用记录表) - * @return R - */ - @ApiOperation(value = "修改(标准储备溶液配制及使用记录表)", notes = "修改(标准储备溶液配制及使用记录表)") - @SysLog("修改(标准储备溶液配制及使用记录表)" ) - @PutMapping - @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_edit')" ) - public R putUpdateById(@RequestBody StandardReserveSolution standardReserveSolution, HttpServletRequest theHttpServletRequest) { + if (standardReserveSolutionVO!=null){ + return R.ok(standardReserveSolutionVO,"配置成功"); + }else return R.failed("配置失败"); + } + + /** + * 新增(标准储备溶液配制及使用记录表) + * @return R + */ + @ApiOperation(value = "入库(标准储备溶液配制及使用记录表)", notes = "入库(标准储备溶液配制及使用记录表)") + @SysLog("入库(标准储备溶液配制及使用记录表)" ) + @PostMapping("warehousing") +// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_add')" ) + public R warehousingById(@RequestBody StandardReserveSolutionFullDTO standardReserveSolutionFullDTO, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - if (standardReserveSolutionService.updateById(standardReserveSolution)) { - return R.ok(standardReserveSolution, "保存对象成功"); - } - else { - return R.failed(standardReserveSolution, "保存对象失败"); - } - } + StandardReserveSolutionFullVO standardReserveSolutionFullVO = standardReserveSolutionService.warehousingById(standardReserveSolutionFullDTO); - /** - * 通过id删除(标准储备溶液配制及使用记录表) - * @param standardReserveSolutionId id - * @return R - */ - @ApiOperation(value = "通过id删除(标准储备溶液配制及使用记录表)", notes = "通过id删除(标准储备溶液配制及使用记录表)") - @SysLog("通过id删除(标准储备溶液配制及使用记录表)" ) - @DeleteMapping("/{standardReserveSolutionId}" ) - @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_del')" ) - public R deleteById(@PathVariable String standardReserveSolutionId, HttpServletRequest theHttpServletRequest) { + if (standardReserveSolutionFullVO!=null){ + return R.ok(standardReserveSolutionFullVO,"入库成功"); + }else return R.failed("入库失败"); + } + + /** + * 通过id查询(标准储备溶液配制及使用记录表) + * @param id id + * @return R + */ + @ApiOperation(value = "通过id查询标准储备溶液入库记录", notes = "通过id查询标准储备溶液入库记录") + @GetMapping( "/full") +// @PreAuthorize("@pms.hasPermission('reagent_standard_reserve_solution_get')" ) + public R getFullVOById(String id, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - StandardReserveSolution oldStandardReserveSolution = standardReserveSolutionService.getById(standardReserveSolutionId); - - if (standardReserveSolutionService.removeById(standardReserveSolutionId)) { - return R.ok(oldStandardReserveSolution, "对象删除成功"); - } - else { - return R.failed(oldStandardReserveSolution, "对象删除失败"); - } + StandardReserveSolutionFullVO byFullVOId = standardReserveSolutionService.getByFullVOId(id); - } + return R.ok(byFullVOId); + //return R.ok(standardReserveSolutionService.getById(standardReserveSolutionId)); + } } 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 fba7fef..e91fad3 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/SupplierInformationController.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import digital.laboratory.platform.common.core.util.R; -//import digital.laboratory.platform.common.oss.service.OssFile; +import digital.laboratory.platform.common.oss.service.OssFile; import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.reagent.dto.SupplierInformationDTO; @@ -22,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.activation.MimetypesFileTypeMap; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @@ -50,7 +51,7 @@ public class SupplierInformationController { private final SupplierInformationService supplierInformationService; -// private final OssFile ossFile; + private final OssFile ossFile; /** * 通过id查询(服务商/供应商信息) @@ -70,7 +71,6 @@ public class SupplierInformationController { SupplierInformationVO voById = supplierInformationService.getVOById(supplierInformationId); return R.ok(voById); - } /** @@ -148,37 +148,127 @@ public class SupplierInformationController { } /** - * 修改(服务商/供应商信息) + * 上传供应人照片 * - * @param id (服务商/供应商信息) + * @param id 上传供应人照片 * @return R */ -// @ApiOperation(value = "上传供应人照片", notes = "上传供应人照片/供应商信息") -// @SysLog("修改服务商/供应商信息") -// @PostMapping("/upload") -//// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_edit')" ) -// public R putUpdateById(String id, @RequestPart("file") MultipartFile file, HttpServletRequest theHttpServletRequest) { -// -// Principal principal = theHttpServletRequest.getUserPrincipal(); -// -// DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); -// -// SupplierInformation supplierInformation = supplierInformationService.getById(id); -// -// String path = "reagent_managment" + " /" + "supplierInformation" + "/" + "picture_"+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); -// supplierInformationService.updateById(supplierInformation); -// return R.ok(supplierInformation, "上传成功"); -// } else return R.failed("上传失败"); -// -// } + @ApiOperation(value = "上传供应人照片", notes = "上传供应人照片/供应商信息") + @SysLog("修改服务商/供应商信息") + @PostMapping("/upload") +// @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 { + + Principal principal = theHttpServletRequest.getUserPrincipal(); + + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + 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("上传失败"); + + } + + @ApiOperation(value = "上传资质文件", notes = "上传资质文件") + @SysLog("上传资质文件") + @PostMapping("/uploadQd") +// @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(); + + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + 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.setQualificationDocument(path); + supplierInformation.setQualificationDocumentName(fileName); + supplierInformationService.updateById(supplierInformation); + String fileNames = path + "/" + fileName; + ossFile.fileGet(fileNames, httpServletResponse.getOutputStream()); + return R.ok(supplierInformation, "上传成功"); + } else return R.failed("上传失败"); + } + + @ApiOperation(value = "预览资质文件", notes = "预览资质文件") + @SysLog("预览资质文件") + @GetMapping("/downloadQd") +// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" ) + public R downloadById(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + + Principal principal = theHttpServletRequest.getUserPrincipal(); + + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + SupplierInformation supplierInformation = supplierInformationService.getById(id); + + String qualificationDocumentName = supplierInformation.getQualificationDocumentName(); + + if (qualificationDocumentName != null) { + + String path = "reagen_managment" + "/" + "supplierInformation/" + supplierInformation.getId(); + + String fileName = path + "/" + qualificationDocumentName; + + ossFile.fileGet(fileName, httpServletResponse.getOutputStream()); + return R.ok(supplierInformation); + + } else return R.failed(); + + + } + + @ApiOperation(value = "预览供应人照片", notes = "预览供应人照片") + @SysLog("预览供应人照片") + @GetMapping("/download") +// @PreAuthorize("@pms.hasPermission('reagent_supplier_information_get')" ) + public R download(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + + Principal principal = theHttpServletRequest.getUserPrincipal(); + + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + SupplierInformation supplierInformation = supplierInformationService.getById(id); + + String photograph = supplierInformation.getPhotograph(); + + if (photograph != null) { + + String path = "reagen_managment" + "/" + "supplierInformation/" + supplierInformation.getId(); + + String fileName = path + "/" + photograph; + + ossFile.fileGet(fileName, httpServletResponse.getOutputStream()); + + return R.ok(supplierInformation); + + } else return R.failed(); + + + } } 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 35994e1..ee5b59d 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/WarehousingRecordFormController.java @@ -1,5 +1,7 @@ package digital.laboratory.platform.reagent.controller; +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.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -7,9 +9,14 @@ 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.dto.WarehousingRecordFormDTO; +import digital.laboratory.platform.reagent.entity.ReagentConsumables; import digital.laboratory.platform.reagent.entity.WarehousingBatchList; +import digital.laboratory.platform.reagent.entity.WarehousingContent; import digital.laboratory.platform.reagent.entity.WarehousingRecordForm; +import digital.laboratory.platform.reagent.service.ReagentConsumablesService; +import digital.laboratory.platform.reagent.service.WarehousingContentService; import digital.laboratory.platform.reagent.service.WarehousingRecordFormService; +import digital.laboratory.platform.reagent.vo.WarehousingContentVO; import digital.laboratory.platform.reagent.vo.WarehousingRecordFormVO; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; @@ -43,6 +50,10 @@ public class WarehousingRecordFormController { private final WarehousingRecordFormService warehousingRecordFormService; + private final WarehousingContentService warehousingContentService; + + private final ReagentConsumablesService reagentConsumablesService; + /** * 通过id查询签收记录表 * @@ -70,19 +81,44 @@ public class WarehousingRecordFormController { @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") // @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')") - public R> getWarehousingRecordFormVOPage( HttpServletRequest theHttpServletRequest) { + public R> getWarehousingRecordFormVOPage( Page page,HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - List warehousingRecordFormVOList = warehousingRecordFormService.getWarehousingRecordFormVOList(); + Page warehousingRecordFormVOList = warehousingRecordFormService.getWarehousingRecordFormVOList(page); return R.ok(warehousingRecordFormVOList); } + /** + * 分页查询 + * @return + */ + @ApiOperation(value = "分页查询", notes = "分页查询") + @GetMapping("/pageWC") +// @PreAuthorize("@pms.hasPermission('reagent_warehousing_record_form_page')") + public R> getWarehousingContentVOPage( Page page,String name,HttpServletRequest theHttpServletRequest) { + + Principal principal = theHttpServletRequest.getUserPrincipal(); + + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + QueryWrapper warehousingContentQueryWrapper = new QueryWrapper<>(); + + if (!name.equals("")){ + + warehousingContentQueryWrapper.eq("reagentConsumableName",name); + + } + IPage warehousingContentVOPage = warehousingContentService.getWarehousingContentVOPage(page, warehousingContentQueryWrapper); + + return R.ok(warehousingContentVOPage); + + } /** * 新增签收记录表 * @@ -107,4 +143,6 @@ public class WarehousingRecordFormController { return R.failed("入库失败"); } } + + } diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationImplementationDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationImplementationDTO.java index 32e981f..2bd5640 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationImplementationDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationImplementationDTO.java @@ -14,30 +14,12 @@ public class PeriodVerificationImplementationDTO { @ApiModelProperty(value="(核查时间)") private LocalDate checkingTime; - @ApiModelProperty(value="(偏差/不确定度)") - private String deviationAndUncertainty; - @ApiModelProperty(value="(核查实施情况及结果)") private String implementationAndResults; - @ApiModelProperty(value="(标准物质编号)") - private String referenceMaterialNumber; - - @ApiModelProperty(value="(标准物质ID)") - private String referenceMaterialId; - - @ApiModelProperty(value="(标准物质名称)") - private String referenceMaterialName; - @ApiModelProperty(value="(备注)") private String remarks; - @ApiModelProperty(value="(标准值/纯度)") - private String standardValueAndPurity; - - @ApiModelProperty(value="(核查方法)") - private String verificationMethod; - @ApiModelProperty(value="(期间核查计划明细ID)") private String periodVerificationPlanId; @@ -49,4 +31,10 @@ public class PeriodVerificationImplementationDTO { @ApiModelProperty(value="(核查结果:PDF)") private String result; + + @ApiModelProperty(value="(核查方法)") + private String verificationMethod; + + @ApiModelProperty(value="(偏差/不确定度)") + private String deviationAndUncertainty; } diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationPlanDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationPlanDTO.java index b14b106..f9bf256 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationPlanDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/PeriodVerificationPlanDTO.java @@ -16,7 +16,7 @@ import java.time.LocalDateTime; public class PeriodVerificationPlanDTO { @ApiModelProperty(value="(偏差/不确定度)") - private String deviationAndUncertainty; + private String deviationOrUncertainty; @ApiModelProperty(value="(核查人ID)") private String inspectorId; @@ -36,7 +36,7 @@ public class PeriodVerificationPlanDTO { private LocalDate scheduledVerificationDate; @ApiModelProperty(value="(标准值/纯度)") - private String standardValueAndPurity; + private String standardValueOrPurity; @ApiModelProperty(value="(核查依据)") private String verificationBasis; diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/ReagentConsumablesSetDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/ReagentConsumablesSetDTO.java deleted file mode 100644 index 3175e58..0000000 --- a/src/main/java/digital/laboratory/platform/reagent/dto/ReagentConsumablesSetDTO.java +++ /dev/null @@ -1,6 +0,0 @@ -package digital.laboratory.platform.reagent.dto; - -public class ReagentConsumablesSetDTO { - - -} 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 d439a83..54eca0e 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApplicationDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApplicationDTO.java @@ -1,13 +1,19 @@ package digital.laboratory.platform.reagent.dto; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data public class StandardMaterialApplicationDTO { - +@ApiModelProperty(value = "标准物质领用归还登记表Id") private String standardMaterialApplicationId; - private String userId; + + @ApiModelProperty(value = "归还数量") private String useQuantity; + + @ApiModelProperty(value = "格子id") private String latticeId; + + @ApiModelProperty(value = "是否需要归还") private Boolean outOfUse; } diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApprovalFormDTO.java b/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApprovalFormDTO.java index cd682c6..cd0702d 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApprovalFormDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/StandardMaterialApprovalFormDTO.java @@ -1,29 +1,60 @@ package digital.laboratory.platform.reagent.dto; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.models.auth.In; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.time.LocalDate; import java.time.LocalDateTime; @Data @NoArgsConstructor @AllArgsConstructor public class StandardMaterialApprovalFormDTO { - + @ApiModelProperty(value="(经办人)") private String agentName; - private String applicantId; - private String applicantName; + + @ApiModelProperty(value="(批号)") private String batchNumber; + + @ApiModelProperty(value="(定值结果)") private String fixedResult; + + @ApiModelProperty(value="(制造商)") private String manufacturerId; + + @ApiModelProperty(value="(标准物质编号)") private String referenceMaterialNumber; + + @ApiModelProperty(value="(标准物质名称)") private String referenceMaterialName; + + @ApiModelProperty(value="(购置时间)") private LocalDateTime purchaseTime; + + @ApiModelProperty(value="(处理时间)") + private LocalDate processingTime; + + @ApiModelProperty(value="(数量)") private Integer quantity; + + @ApiModelProperty(value="(申请原因)") private String reasonForApplication; + + @ApiModelProperty(value="(标准物质id)") private String referenceMaterialId; + + @ApiModelProperty(value="(备注)") private String remarks; + + @ApiModelProperty(value="(规格)") private String specification; + + @ApiModelProperty(value="(申请内容)") + private Integer applicationContent; + + @ApiModelProperty(value="ID") private String standardMaterialApprovalFormId; 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 b22a1d1..195a6fc 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/WarehousingRecordFormDTO.java @@ -51,7 +51,5 @@ public class WarehousingRecordFormDTO { @ApiModelProperty(value="(备注)") private String remark; - @ApiModelProperty(value="(存储期限)") - private String limitDate; } 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 ed54528..79014fb 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java @@ -64,7 +64,7 @@ public class BatchDetails extends BaseEntity { * (有效日期) */ @ApiModelProperty(value="(有效日期)") - private LocalDateTime expirationDate; + private Integer expirationDate; /** * (定值结果) 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 d8cfd1a..8f99b80 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/InstructionBook.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/InstructionBook.java @@ -65,8 +65,8 @@ public class InstructionBook extends BaseEntity { /** * (标准物质id) */ - @ApiModelProperty(value="(标准物质id)") - private String referenceMaterialId; + @ApiModelProperty(value="(标准物质类id)") + private String referenceMaterialTypeId; /** * (制定时间) diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationImplementation.java b/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationImplementation.java index 3baabfc..a3682eb 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationImplementation.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationImplementation.java @@ -58,7 +58,7 @@ public class PeriodVerificationImplementation extends BaseEntity { /** * (提交状态) */ - @ApiModelProperty(value="(提交状态)") + @ApiModelProperty(value="(提交状态(0:未提交,1:已提交,2:审核通过,-1:审核未通过))") private Integer commitStatus; /** @@ -79,6 +79,9 @@ public class PeriodVerificationImplementation extends BaseEntity { @ApiModelProperty(value="(核查人员ID)") private String inspectorId; + @ApiModelProperty(value="(核查结果:PDF)") + private String result; + /** * (编号) */ @@ -101,12 +104,18 @@ public class PeriodVerificationImplementation extends BaseEntity { /** * (标准物质ID) */ + @ApiModelProperty(value="(标准物质ID)") private String referenceMaterialId; + @ApiModelProperty(value="(标准物质名称)") private String referenceMaterialName; - + /** + * (核查依据) + */ + @ApiModelProperty(value="(核查依据)") + private String verificationBasis; /** * (备注) */ @@ -117,7 +126,7 @@ public class PeriodVerificationImplementation extends BaseEntity { * (标准值/纯度) */ @ApiModelProperty(value="(标准值/纯度)") - private String standardValueAndPurity; + private String standardValueOrPurity; /** * (技术负责人ID) @@ -131,13 +140,12 @@ public class PeriodVerificationImplementation extends BaseEntity { @ApiModelProperty(value="(核查方法)") private String verificationMethod; - /** * periodVerificationImplementationId */ - @TableId(value = "period_verification_implementation_id", type = IdType.ASSIGN_UUID) - @ApiModelProperty(value="periodVerificationImplementationId") - private String periodVerificationImplementationId; + @TableId(value = "id", type = IdType.ASSIGN_UUID) + @ApiModelProperty(value="id") + private String id; /** * periodVerificationPlanId @@ -145,5 +153,4 @@ public class PeriodVerificationImplementation extends BaseEntity { @ApiModelProperty(value="periodVerificationPlanId") private String periodVerificationPlanId; - } diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationPlan.java b/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationPlan.java index fe8b2fb..470aca5 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationPlan.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/PeriodVerificationPlan.java @@ -83,7 +83,7 @@ public class PeriodVerificationPlan extends BaseEntity { * (标准值/纯度) */ @ApiModelProperty(value="(标准值/纯度)") - private String standardValueAndPurity; + private String standardValueOrPurity; /** * (核查依据) 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 1c8eafa..645038f 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/ReagentConsumableInventory.java @@ -153,7 +153,7 @@ public class ReagentConsumableInventory extends BaseEntity { * 存储期限 */ @ApiModelProperty(value = "存储期限") - private LocalDateTime storageLife; + private Integer storageLife; /** * 状态 */ diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApplication.java b/src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApplication.java index 6244764..d14fab2 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApplication.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApplication.java @@ -93,6 +93,8 @@ public class StandardMaterialApplication extends BaseEntity { @ApiModelProperty(value="(领用数量)") private Integer requisitionedQuantity; + @ApiModelProperty(value="(是否归还)") + private Integer isReturn; /** * (序号) */ diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApprovalForm.java b/src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApprovalForm.java index cd1d0a4..13edd3a 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApprovalForm.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/StandardMaterialApprovalForm.java @@ -7,6 +7,7 @@ import digital.laboratory.platform.common.mybatis.base.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; +import java.time.LocalDate; import java.time.LocalDateTime; import lombok.Data; import lombok.EqualsAndHashCode; @@ -129,7 +130,7 @@ public class StandardMaterialApprovalForm extends BaseEntity { /** * (提交状态) */ - @ApiModelProperty(value="(提交状态)") + @ApiModelProperty(value="(提交状态(0:未提交,1:已提交,2:一级审核通过,3:二级审核通过,4:审批通过,-1:审核/审批不通过,-2:审批不通过))") private Integer commitStatus; @@ -165,7 +166,7 @@ public class StandardMaterialApprovalForm extends BaseEntity { * (处理时间) */ @ApiModelProperty(value="(处理时间)") - private LocalDateTime processingTime; + private LocalDate processingTime; /** * (购置时间) @@ -197,6 +198,9 @@ public class StandardMaterialApprovalForm extends BaseEntity { @ApiModelProperty(value="(备注)") private String remarks; + @ApiModelProperty(value="(申请内容)") + private Integer applicationContent; + /** * (规格) */ diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/StandardReserveSolution.java b/src/main/java/digital/laboratory/platform/reagent/entity/StandardReserveSolution.java index b39a3c8..37933b4 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/StandardReserveSolution.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/StandardReserveSolution.java @@ -7,6 +7,7 @@ import digital.laboratory.platform.common.mybatis.base.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; +import java.time.LocalDate; import java.time.LocalDateTime; import io.swagger.models.auth.In; @@ -43,17 +44,11 @@ public class StandardReserveSolution extends BaseEntity { */ @ApiModelProperty(value="(定容体积(mL))") private String constantVolume; - - /** * (配制人ID) */ @ApiModelProperty(value="(配制人ID)") private String dispenserId; - - - private String quantityUsed; - /** * (标准物质ID) */ @@ -105,7 +100,7 @@ public class StandardReserveSolution extends BaseEntity { * (有效期限) */ @ApiModelProperty(value="(有效期限)") - private LocalDateTime validityPeriod; + private Integer validityPeriod; /** * (有效期限) */ diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/SupplierInformation.java b/src/main/java/digital/laboratory/platform/reagent/entity/SupplierInformation.java index 6e36823..f23e488 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/SupplierInformation.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/SupplierInformation.java @@ -54,12 +54,24 @@ public class SupplierInformation extends BaseEntity { @ApiModelProperty(value="(供应人照片)路径") private String photographOfSupplier; + /** + * (供应人照片)名称 + */ + @ApiModelProperty(value="(供应人照片)名称") + private String photograph; + /** * (资质文件)路径 */ @ApiModelProperty(value="(资质文件)路径") private String qualificationDocument; + /** + * (资质文件)路径 + */ + @ApiModelProperty(value="(资质文件)名称") + private String qualificationDocumentName; + /** * (供应范围) */ 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 5be1458..e07f4f7 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingBatchList.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingBatchList.java @@ -1,8 +1,10 @@ package digital.laboratory.platform.reagent.entity; +import com.alibaba.fastjson.annotation.JSONField; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import digital.laboratory.platform.common.mybatis.base.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -46,6 +48,8 @@ public class WarehousingBatchList extends BaseEntity { /** * (生产日期) */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JSONField(format = "yyyy-MM-dd") @ApiModelProperty(value="(生产日期)") private LocalDate dateOfProduction; @@ -59,6 +63,8 @@ public class WarehousingBatchList extends BaseEntity { /** * (有效日期) */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JSONField(format = "yyyy-MM-dd") @ApiModelProperty(value="(有效日期)") private LocalDate expirationDate; /** 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 13dfb33..e07de96 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java @@ -20,6 +20,11 @@ public class WarehousingContent extends BaseEntity { */ @ApiModelProperty(value = "(试剂耗材ID)") private String reagentConsumableId; + /** + * (试剂耗材ID) + */ + @ApiModelProperty(value = "(试剂耗材名称)") + private String reagentConsumableName; /** * (总数量) diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/PeriodVerificationPlanMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/PeriodVerificationPlanMapper.java index 06ec377..5b9c5c2 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/PeriodVerificationPlanMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/PeriodVerificationPlanMapper.java @@ -3,10 +3,13 @@ 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 com.baomidou.mybatisplus.extension.plugins.pagination.Page; import digital.laboratory.platform.reagent.entity.PeriodVerificationPlan; import digital.laboratory.platform.reagent.vo.PeriodVerificationPlanVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.springframework.security.core.parameters.P; import java.util.List; @@ -20,5 +23,6 @@ import java.util.List; public interface PeriodVerificationPlanMapper extends BaseMapper { List getPeriodVerificationPlanVOList (String checkScheduleId); + IPage getPeriodVerificationPlanVOPage (Page page, @Param(Constants.WRAPPER) QueryWrapperqw); } diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/StandardReserveSolutionMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/StandardReserveSolutionMapper.java index a88323f..c0fe643 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/StandardReserveSolutionMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/StandardReserveSolutionMapper.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.StandardReserveSolution; import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO; import org.apache.ibatis.annotations.Mapper; @@ -19,6 +20,7 @@ public interface StandardReserveSolutionMapper extends BaseMapper getStandardReserveSolutionVOPage (IPage page , QueryWrapper qw); + IPage getStandardReserveSolutionVOPage (IPage page , @Param(Constants.WRAPPER) QueryWrapper qw); + IPage getVOPage (); } diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingContentMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingContentMapper.java index a32a614..18c8675 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingContentMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/WarehousingContentMapper.java @@ -1,9 +1,15 @@ 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 com.baomidou.mybatisplus.extension.plugins.pagination.Page; import digital.laboratory.platform.reagent.entity.WarehousingContent; import digital.laboratory.platform.reagent.vo.WarehousingContentVO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.yaml.snakeyaml.scanner.Constant; import java.util.List; @@ -11,4 +17,5 @@ import java.util.List; public interface WarehousingContentMapper extends BaseMapper { List getWarehousingContentVOList(String signingRecordFormId); + IPage getWarehousingContentVOPage(Page page, @Param(Constants.WRAPPER)QueryWrapper qw); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/PeriodVerificationImplementationService.java b/src/main/java/digital/laboratory/platform/reagent/service/PeriodVerificationImplementationService.java index 043f61f..61ed0a5 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/PeriodVerificationImplementationService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/PeriodVerificationImplementationService.java @@ -7,6 +7,7 @@ import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; import digital.laboratory.platform.reagent.dto.PeriodVerificationImplementationDTO; import digital.laboratory.platform.reagent.entity.PeriodVerificationImplementation; +import digital.laboratory.platform.reagent.entity.PeriodVerificationPlan; import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO; /** @@ -21,9 +22,9 @@ public interface PeriodVerificationImplementationService extends IService { List getPeriodVerificationPlanVOList ( String checkScheduleId); + + + IPage getPeriodVerificationPlanVOPage (Page page, QueryWrapper qw); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/StandardMaterialApprovalFormService.java b/src/main/java/digital/laboratory/platform/reagent/service/StandardMaterialApprovalFormService.java index 4bb6bbb..a32c47a 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/StandardMaterialApprovalFormService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/StandardMaterialApprovalFormService.java @@ -17,12 +17,7 @@ import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO; */ public interface StandardMaterialApprovalFormService extends IService { - StandardMaterialApprovalForm addById (StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, DLPUser dlpUser); - - StandardMaterialApprovalForm editById (StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO); - - StandardMaterialApprovalForm commitById(StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, DLPUser dlpUser); - + StandardMaterialApprovalForm commitById (StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, DLPUser dlpUser); IPage getVOPage(IPage page, QueryWrapper qw); StandardMaterialApprovalFormVO getVO(String standardMaterialApprovalFormId); diff --git a/src/main/java/digital/laboratory/platform/reagent/service/StandardReserveSolutionService.java b/src/main/java/digital/laboratory/platform/reagent/service/StandardReserveSolutionService.java index 47460d0..37864a4 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/StandardReserveSolutionService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/StandardReserveSolutionService.java @@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.reagent.dto.StandardReserveSolutionDTO; +import digital.laboratory.platform.reagent.dto.StandardReserveSolutionFullDTO; import digital.laboratory.platform.reagent.entity.StandardReserveSolution; import digital.laboratory.platform.reagent.vo.StandardReserveSolutionFullVO; import digital.laboratory.platform.reagent.vo.StandardReserveSolutionVO; +import java.util.List; + /** * (标准储备溶液配制及使用记录表)服务类 * @@ -19,11 +22,12 @@ public interface StandardReserveSolutionService extends IService getStandardReserveSolutionVOList(IPage page, QueryWrapper qw); - StandardReserveSolution warehousingById(String solutionId, String latticeId); + StandardReserveSolutionFullVO warehousingById(StandardReserveSolutionFullDTO standardReserveSolutionFullDTO); StandardReserveSolutionFullVO getByFullVOId(String id); + } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/WarehousingContentService.java b/src/main/java/digital/laboratory/platform/reagent/service/WarehousingContentService.java index 98f01c0..4bc6319 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/WarehousingContentService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/WarehousingContentService.java @@ -1,5 +1,8 @@ package digital.laboratory.platform.reagent.service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import digital.laboratory.platform.reagent.entity.ReagentConsumables; import digital.laboratory.platform.reagent.entity.WarehousingContent; @@ -11,4 +14,5 @@ public interface WarehousingContentService extends IService List getWarehousingContentVOList(String warehousingRecordFormId); + IPage getWarehousingContentVOPage(Page page, QueryWrapper qw); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/WarehousingRecordFormService.java b/src/main/java/digital/laboratory/platform/reagent/service/WarehousingRecordFormService.java index a09b081..c8d4173 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/WarehousingRecordFormService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/WarehousingRecordFormService.java @@ -1,5 +1,6 @@ package digital.laboratory.platform.reagent.service; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.reagent.dto.WarehousingRecordFormDTO; @@ -24,6 +25,5 @@ public interface WarehousingRecordFormService extends IService warehousingRecordFormDTOList, DLPUser dlpUser); - - List getWarehousingRecordFormVOList(); + Page getWarehousingRecordFormVOList(Page page); } 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 ceb5205..81d5744 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 @@ -199,7 +199,6 @@ public class CentralizedRequestServiceImpl extends ServiceImpl implements CheckScheduleService { + @Autowired + private PeriodVerificationImplementationService periodVerificationImplementationService; + @Autowired private CheckScheduleService checkScheduleService; @Autowired @@ -58,6 +63,8 @@ public class CheckScheduleServiceImpl extends ServiceImpl periodVerificationPlanLambdaQueryWrapper = new LambdaQueryWrapper<>(); + + periodVerificationPlanLambdaQueryWrapper.eq(PeriodVerificationPlan::getCheckScheduleId,byId.getId()); + + List list = periodVerificationPlanService.list(periodVerificationPlanLambdaQueryWrapper); + + for (PeriodVerificationPlan periodVerificationPlan : list) { + + periodVerificationImplementationService.addById(periodVerificationPlan); + + } + byId.setStatus(2); + } else { byId.setStatus(-1); } - if (checkScheduleService.updateById(byId)){ + if (checkScheduleService.updateById(byId)) { return byId; - }else throw new RuntimeException(String.format("审核失败")); + } else throw new RuntimeException(String.format("审核失败")); } @Override @@ -167,4 +192,5 @@ public class CheckScheduleServiceImpl extends ServiceImpl referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>(); - referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getNumber,reagentConsumablesSet.getReferenceMaterialNumber()); + referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getNumber, reagentConsumablesSet.getReferenceMaterialNumber()); ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(referenceMaterialLambdaQueryWrapper); @@ -166,7 +166,9 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl getDeliveryRegistrationFormVOPage(Page page, QueryWrapper qw){ + public Page getDeliveryRegistrationFormVOPage(Page page, QueryWrapper qw) { Page deliveryRegistrationFormVOPage = baseMapper.getDeliveryRegistrationFormVOPage(page, qw); @@ -268,46 +286,47 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>(); - outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId,deliveryRegistrationFormVOById.getId()); + outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId, deliveryRegistrationFormVOById.getId()); List list = outgoingContentsService.list(outgoingContentsLambdaQueryWrapper); List outgoingContentsVOS = new ArrayList<>(); - if (list.size()!=0){ + if (list.size() != 0) { - for (OutgoingContents outgoingContents : list) { + for (OutgoingContents outgoingContents : list) { - OutgoingContentsVO outgoingContentsVO = new OutgoingContentsVO(); + OutgoingContentsVO outgoingContentsVO = new OutgoingContentsVO(); - BeanUtils.copyProperties(outgoingContents,outgoingContentsVO); + BeanUtils.copyProperties(outgoingContents, outgoingContentsVO); - LambdaQueryWrapper reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); + LambdaQueryWrapper reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); - reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId,outgoingContents.getReagentConsumableId()); + reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, outgoingContents.getReagentConsumableId()); - ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); + ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); - outgoingContentsVO.setReagentConsumableInventory(one); + outgoingContentsVO.setReagentConsumableInventory(one); - outgoingContentsVOS.add(outgoingContentsVO); - } + outgoingContentsVOS.add(outgoingContentsVO); + } - deliveryRegistrationFormVOById.setOutgoingContentsList(outgoingContentsVOS);} + deliveryRegistrationFormVOById.setOutgoingContentsList(outgoingContentsVOS); + } return deliveryRegistrationFormVOById; } @Override - public ReagentConsumablesVO scanById(String reagentConsumableId, String referenceMaterialId){ + public ReagentConsumablesVO scanById(String reagentConsumableId, String referenceMaterialId) { - if (!(referenceMaterialId.equals("0"))){ + if (!(referenceMaterialId.equals("0"))) { ReagentConsumables byId = reagentConsumablesService.getById(reagentConsumableId); @@ -315,20 +334,20 @@ public class DeliveryRegistrationFormServiceImpl extends ServiceImpl referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>(); + referenceMaterialLambdaQueryWrapper.eq(ReferenceMaterial::getId, periodVerificationPlan.getReferenceMaterialId()); + ReferenceMaterial referenceMaterial = referenceMaterialService.getOne(referenceMaterialLambdaQueryWrapper); + + ReagentConsumables reagentConsumables = reagentConsumablesService.getById(referenceMaterial.getReagentConsumableId()); + //赋值信息 + periodVerificationImplementation.setReferenceMaterialName(reagentConsumables.getReagentConsumableName()); + periodVerificationImplementation.setStandardValueOrPurity(reagentConsumables.getStandardValueOrPurity()); + periodVerificationImplementation.setVerificationBasis(periodVerificationPlan.getVerificationBasis()); + periodVerificationImplementation.setCommitStatus(0); + + if (periodVerificationImplementationService.save(periodVerificationImplementation)) { + return periodVerificationImplementation; + } else throw new RuntimeException(String.format("保存失败")); - periodVerificationImplementation.setPeriodVerificationImplementationId(IdWorker.get32UUID().toUpperCase()); + } - String result = periodVerificationImplementationDTO.getResult(); + @Override//录入期间核查结果记录表 + public PeriodVerificationImplementation editById(PeriodVerificationImplementationDTO periodVerificationImplementationDTO, DLPUser dlpUser) { - PeriodVerificationPlan byId = periodVerificationPlanService.getById(periodVerificationImplementationDTO.getPeriodVerificationPlanId()); + PeriodVerificationImplementation byId = periodVerificationImplementationService.getById(periodVerificationImplementationDTO.getPeriodVerificationImplementationId()); - byId.setVerificationResult(result); + BeanUtils.copyProperties(periodVerificationImplementationDTO, byId); - byId.setImplementationDate(periodVerificationImplementation.getCheckingTime()); + byId.setInspectorId(dlpUser.getId()); - byId.setDateOfNextCheck(byId.getImplementationDate().minusMonths(byId.getPlannedVerificationCycle())); + if (periodVerificationImplementationDTO.getCauseOfDissatisfaction() != null) { - if (periodVerificationImplementationService.save(periodVerificationImplementation) && periodVerificationPlanService - .updateById(byId)) { + byId.setOpinionOfInspector(false); - return periodVerificationImplementation; - } else throw new RuntimeException(String.format("保存失败")); + } else byId.setOpinionOfInspector(true); - } + ReferenceMaterial byId1 = referenceMaterialService.getById(byId.getReferenceMaterialId()); - @Override//修改期间核查结果记录表 - public PeriodVerificationImplementation editById(PeriodVerificationImplementationDTO periodVerificationImplementationDTO) { + ReagentConsumables byId2 = reagentConsumablesService.getById(byId1.getReagentConsumableId()); - PeriodVerificationImplementation byId = periodVerificationImplementationService.getById(periodVerificationImplementationDTO.getPeriodVerificationImplementationId()); + byId2.setDeviationOrUncertainty(periodVerificationImplementationDTO.getDeviationAndUncertainty()); - BeanUtils.copyProperties(periodVerificationImplementationDTO, byId); + reagentConsumablesService.updateById(byId2); String result = periodVerificationImplementationDTO.getResult(); @@ -108,33 +129,23 @@ public class PeriodVerificationImplementationServiceImpl extends ServiceImpl implements PeriodVerificationPlanService { + @Autowired + private ReagentConsumablesService reagentConsumablesService; + + @Autowired + private ReferenceMaterialService referenceMaterialService; @Override public List getPeriodVerificationPlanVOList(String checkScheduleId){ List periodVerificationPlanVOPage = baseMapper.getPeriodVerificationPlanVOList(checkScheduleId); + for (PeriodVerificationPlanVO periodVerificationPlanVO : periodVerificationPlanVOPage) { + + ReferenceMaterial byId = referenceMaterialService.getById(periodVerificationPlanVO.getReferenceMaterialId()); + + ReagentConsumables byId1 = reagentConsumablesService.getById(byId.getReagentConsumableId()); + + periodVerificationPlanVO.setReferenceMaterialName(byId1.getReagentConsumableName()); + + } + + return periodVerificationPlanVOPage; + } + + @Override + public IPage getPeriodVerificationPlanVOPage(Page page, QueryWrapper qw){ + + IPage periodVerificationPlanVOPage = baseMapper.getPeriodVerificationPlanVOPage(page, qw); + return periodVerificationPlanVOPage; } 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 8016f7e..a23ebf8 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 @@ -50,6 +50,9 @@ public class PurchaseListServiceImpl extends ServiceImpl getReagentConsumableInventoryVOList(Page page, String name) { QueryWrapper reagentConsumableInventoryQueryWrapper = new QueryWrapper<>(); + reagentConsumableInventoryQueryWrapper.eq("status",1); + if (name != null) { reagentConsumableInventoryQueryWrapper.eq("category", "试剂").or() @@ -143,6 +149,11 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl fixedValueReportLambdaQueryWrapper = new LambdaQueryWrapper<>(); + + fixedValueReportLambdaQueryWrapper.eq(FixedValueReport::getReferenceSubstanceId,referenceMaterial.getId()); + + FixedValueReport one = fixedValueReportService.getOne(fixedValueReportLambdaQueryWrapper); + ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO(); BeanUtils.copyProperties(reagentConsumableInventory, reagentConsumableInventoryFullVO); @@ -213,8 +231,17 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl standardMaterialApplicationVOList = baseMapper.getStandardMaterialApplicationVOList(page, qw); - return standardMaterialApplicationVOList; + List records = standardMaterialApplicationVOList.getRecords(); - } + for (StandardMaterialApplicationVO record : records) { + ReagentConsumables byId = reagentConsumablesService.getById(record.getReferenceSubstanceId()); + record.setCategory(byId.getCategory()); + } + return standardMaterialApplicationVOList; + } } 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 c417dbb..4eea825 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 @@ -7,9 +7,11 @@ 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.dto.StandardMaterialApprovalFormDTO; +import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm; import digital.laboratory.platform.reagent.entity.SupplierInformation; import digital.laboratory.platform.reagent.mapper.StandardMaterialApprovalFormMapper; +import digital.laboratory.platform.reagent.service.ReferenceMaterialService; import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService; import digital.laboratory.platform.reagent.service.SupplierInformationService; import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO; @@ -33,52 +35,49 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl getVOPage(IPage page, QueryWrapper qw){ @@ -112,6 +111,12 @@ public class StandardMaterialApprovalFormServiceImpl extends ServiceImpl reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); - reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName,standardReserveSolution.getSolutionName()); - reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration,standardReserveSolution.getConfigurationConcentration()); + reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName, standardReserveSolution.getSolutionName()); + reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration, standardReserveSolution.getConfigurationConcentration()); ReagentConsumables one = reagentConsumablesService.getOne(reagentConsumablesLambdaQueryWrapper); //判断是否存在过该标准储备溶液,若未存在,则将其存入试剂耗材类 - if (one==null){ + if (one == null) { ReagentConsumables reagentConsumables = new ReagentConsumables(); @@ -103,21 +105,25 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl getStandardReserveSolutionVOList(IPage page, QueryWrapper qw) { IPage standardReserveSolutionVOPage = baseMapper.getStandardReserveSolutionVOPage(page, qw); @@ -126,15 +132,26 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>(); - reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName,byId.getSolutionName()); + reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableName, byId.getSolutionName()); - reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration,byId.getConfigurationConcentration()); + reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getConfigurationConcentration, byId.getConfigurationConcentration()); //查询出该标准储备溶液的对象 ReagentConsumables reagentConsumables = reagentConsumablesService.getOne(reagentConsumablesLambdaQueryWrapper); @@ -150,11 +167,17 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>(); - //更新库存信息 - reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, standardReserveSolutionVOById.getReferenceMaterialId()); + + ReferenceMaterial byId = referenceMaterialService.getById(standardReserveSolutionVOById.getReferenceMaterialId()); + + reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableName, standardReserveSolutionVOById.getSolutionName()); reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getConfigurationConcentration, standardReserveSolutionVOById.getConfigurationConcentration()); ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper); @@ -232,6 +266,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl getWarehousingContentVOPage(Page page, QueryWrapper qw) { + + IPage warehousingContentVOPage = baseMapper.getWarehousingContentVOPage(page, qw); + + List records = warehousingContentVOPage.getRecords(); + + for (WarehousingContentVO warehousingContentVO : records) { + + List warehousingBatchListVOList = warehousingBatchListService.getWarehousingBatchListVOList(warehousingContentVO.getId()); + + warehousingContentVO.setWarehousingBatchListVOList(warehousingBatchListVOList); + + ReagentConsumables byId = reagentConsumablesService.getById(warehousingContentVO.getReagentConsumableId()); + + warehousingContentVO.setCategory(byId.getCategory()); + warehousingContentVO.setBrand(byId.getBrand()); + warehousingContentVO.setSpecificationAndModel(byId.getSpecificationAndModel()); + warehousingContentVO.setReagentConsumables(byId); + + } + return warehousingContentVOPage; + } + + } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java index 2ad27b4..a466ca9 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java @@ -1,11 +1,14 @@ package digital.laboratory.platform.reagent.service.impl; +import cn.hutool.core.util.PageUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import digital.laboratory.platform.common.mybatis.security.service.DLPUser; +import digital.laboratory.platform.reagent.config.PageUtils; import digital.laboratory.platform.reagent.dto.WarehousingRecordFormDTO; import digital.laboratory.platform.reagent.entity.*; import digital.laboratory.platform.reagent.mapper.WarehousingRecordFormMapper; @@ -157,6 +160,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl getWarehousingRecordFormVOList() { + public Page getWarehousingRecordFormVOList(Page page) { List warehousingRecordFormVOList = baseMapper.getWarehousingRecordFormVOList(); @@ -403,7 +407,14 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl warehousingBatchListVOList; diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml index 9d929dc..4b8b1c9 100644 --- a/src/main/resources/bootstrap.yml +++ b/src/main/resources/bootstrap.yml @@ -49,17 +49,17 @@ spring: # minio 文件存储配置信息 # 文件上传相关 支持阿里云、华为云、腾讯、minio -# oss: -# endpoint: http://127.0.0.1:9000 -# accessKey: dlp-yhh -# secretKey: 87990016 -# bucket-name: bucket1 +#oss: +# endpoint: http://127.0.0.1:9000 +# accessKey: dlp-yhh +# secretKey: 87990016 +# bucket-name: bucket1 # 文件上传相关 支持阿里云、华为云、腾讯、minio -# oss: -# endpoint: http://192.168.9.73:9000 -# accessKey: dlp -# secretKey: 87990016 -# bucket-name: dlpfiles +oss: + endpoint: http://192.168.9.73:9000 + accessKey: dlp + secretKey: 87990016 + bucket-name: dlpfiles diff --git a/src/main/resources/mapper/InstructionBookMapper.xml b/src/main/resources/mapper/InstructionBookMapper.xml index 096a220..8e1d224 100644 --- a/src/main/resources/mapper/InstructionBookMapper.xml +++ b/src/main/resources/mapper/InstructionBookMapper.xml @@ -12,7 +12,7 @@ - + diff --git a/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml b/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml index 039e8ad..6c0c2c3 100644 --- a/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml +++ b/src/main/resources/mapper/PeriodVerificationImplementationMapper.xml @@ -6,7 +6,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -30,6 +30,8 @@ + + diff --git a/src/main/resources/mapper/PeriodVerificationPlanMapper.xml b/src/main/resources/mapper/PeriodVerificationPlanMapper.xml index 9bf9e80..60d9a3c 100644 --- a/src/main/resources/mapper/PeriodVerificationPlanMapper.xml +++ b/src/main/resources/mapper/PeriodVerificationPlanMapper.xml @@ -13,7 +13,6 @@ - @@ -22,6 +21,7 @@ + select pvp.*, - (select rc.reagent_consumable_name - from reagent_consumables rc - where rc.reagent_consumable_id = pvp.reference_material_id) as reference_material_name, (SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=pvp.inspector_id ) as inspector_name @@ -45,4 +42,13 @@ + + diff --git a/src/main/resources/mapper/StandardMaterialApplicationMapper.xml b/src/main/resources/mapper/StandardMaterialApplicationMapper.xml index 3fbe474..798b4c2 100644 --- a/src/main/resources/mapper/StandardMaterialApplicationMapper.xml +++ b/src/main/resources/mapper/StandardMaterialApplicationMapper.xml @@ -30,6 +30,7 @@ + + + @@ -44,10 +47,16 @@ (select rc.reagent_consumable_name from reagent_consumables rc where rc.reagent_consumable_id = sma.reference_substance_id) as reference_substance_name, + + (SELECT user.name FROM dlp_base.sys_user user WHERE user.user_id=sma.recipient_id - ) AS recipient_name + ) AS recipient_name, + (SELECT user.name + FROM dlp_base.sys_user user + WHERE user.user_id=sma.administrator_id + ) AS administrator_name from standard_material_application sma diff --git a/src/main/resources/mapper/StandardMaterialApprovalFormMapper.xml b/src/main/resources/mapper/StandardMaterialApprovalFormMapper.xml index fde0e5d..b38d28f 100644 --- a/src/main/resources/mapper/StandardMaterialApprovalFormMapper.xml +++ b/src/main/resources/mapper/StandardMaterialApprovalFormMapper.xml @@ -37,6 +37,7 @@ + @@ -50,7 +51,7 @@ + diff --git a/src/main/resources/mapper/SupplierInformationMapper.xml b/src/main/resources/mapper/SupplierInformationMapper.xml index 215b70e..bb0c554 100644 --- a/src/main/resources/mapper/SupplierInformationMapper.xml +++ b/src/main/resources/mapper/SupplierInformationMapper.xml @@ -22,5 +22,7 @@ + + diff --git a/src/main/resources/mapper/WarehousingContentMapper.xml b/src/main/resources/mapper/WarehousingContentMapper.xml index 3fefd1b..9119c7f 100644 --- a/src/main/resources/mapper/WarehousingContentMapper.xml +++ b/src/main/resources/mapper/WarehousingContentMapper.xml @@ -17,11 +17,11 @@ + - @@ -29,10 +29,17 @@ + + \ No newline at end of file