diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java b/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java index 3e35165..543a0e2 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java @@ -1,8 +1,6 @@ package digital.laboratory.platform.reagent.controller; -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; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import digital.laboratory.platform.common.core.util.R; @@ -14,8 +12,7 @@ import digital.laboratory.platform.reagent.entity.CentralizedRequest; import digital.laboratory.platform.reagent.entity.DetailsOfCentralized; import digital.laboratory.platform.reagent.service.CentralizedRequestService; import digital.laboratory.platform.reagent.service.DetailsOfCentralizedService; -import digital.laboratory.platform.reagent.vo.CentralizedRequestVo; -import org.springframework.beans.BeanUtils; +import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; @@ -25,12 +22,7 @@ import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; import java.security.Principal; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.util.ArrayList; import java.util.List; /** @@ -73,7 +65,7 @@ public class CentralizedRequestController { DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - CentralizedRequestVo vo = centralizedRequestService.getRequest(centralizedRequestId); + CentralizedRequestVO vo = centralizedRequestService.getCentralizedRequestVO(centralizedRequestId); if (vo!=null){ return R.ok(vo); @@ -92,18 +84,18 @@ public class CentralizedRequestController { @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") @PreAuthorize("@pms.hasPermission('CentralizedPurchaseRequestList')") - public R> getCentralizedRequestPage(Page page, CentralizedRequest centralizedRequest, HttpServletRequest theHttpServletRequest) { + public R> getCentralizedRequestPage(Page page, CentralizedRequest centralizedRequest, HttpServletRequest theHttpServletRequest) { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - IPage centralizedRequestSList = centralizedRequestService.page(page, Wrappers.query() - .eq("create_by", dlpUser.getId()) - .orderByDesc("create_time") - ); + IPage centralizedRequestVOPage = centralizedRequestService.getCentralizedRequestVOPage(page, Wrappers.query() + .eq("create_by", dlpUser.getId()).orderByDesc("create_time")); - return R.ok(centralizedRequestSList); + + + return R.ok(centralizedRequestVOPage); } @@ -123,10 +115,10 @@ public class CentralizedRequestController { Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - //获取申请人id + CentralizedRequest centralizedRequest = new CentralizedRequest(); - List detailsOfCentralizedList= centralizedRequestService.saveRequest(centralizedRequest, centralizedRequestDtoList, dlpUser); + List detailsOfCentralizedList= centralizedRequestService.saveRequestById(centralizedRequest, centralizedRequestDtoList, dlpUser); if (centralizedRequestService.save(centralizedRequest) & detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) { return R.ok(centralizedRequest, "保存成功"); @@ -219,11 +211,13 @@ public class CentralizedRequestController { DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - List list = centralizedRequestService.delRequest(centralizedRequestId); + List list = centralizedRequestService.delRequestById(centralizedRequestId); CentralizedRequest oldcentralizedRequest = centralizedRequestService.getById(centralizedRequestId); - if (oldcentralizedRequest.getStatus()==0&detailsOfCentralizedService.removeBatchByIds(list) & centralizedRequestService.removeById(centralizedRequestId)) { + detailsOfCentralizedService.removeBatchByIds(list); + + if (oldcentralizedRequest.getStatus()==0 & centralizedRequestService.removeById(centralizedRequestId)) { return R.ok(oldcentralizedRequest, "删除成功"); } else { return R.failed(oldcentralizedRequest, "删除失败"); @@ -270,7 +264,7 @@ public class CentralizedRequestController { CentralizedRequest centralizedRequest = centralizedRequestService.checkRequest(auditAndApproveDto, dlpUser); - if (centralizedRequestService.updateById(centralizedRequest)) { + if (centralizedRequest!=null¢ralizedRequestService.updateById(centralizedRequest)) { return R.ok(centralizedRequest, "审核成功"); } else { return R.failed(centralizedRequest, "审核失败"); @@ -278,29 +272,9 @@ public class CentralizedRequestController { } - /** - * 审核申请分页查询 - * - * @param page 分页对象 - * @param centralizedRequest 集中采购申请 - * @return - */ - @ApiOperation(value = "分页查询", notes = "分页查询") - @GetMapping("audit/page") - @PreAuthorize("@pms.hasPermission('AuditCentralizedPurchaseRequestList')") - public R> getAuditCentralizedRequestPage(Page page, CentralizedRequest centralizedRequest, HttpServletRequest theHttpServletRequest) { - - Principal principal = theHttpServletRequest.getUserPrincipal(); - - DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - IPage centralizedRequestSList = centralizedRequestService.page(page, Wrappers.query() - .eq("status", 1) - .orderByDesc("create_time") - ); - return R.ok(centralizedRequestSList); } -} + diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java index da0f137..8f2dde8 100644 --- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java +++ b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java @@ -1,20 +1,19 @@ package digital.laboratory.platform.reagent.controller; +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; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ; 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.AuditAndApproveDto; import digital.laboratory.platform.reagent.dto.PurchaseCatalogueDto; import digital.laboratory.platform.reagent.entity.CatalogueDetails; import digital.laboratory.platform.reagent.entity.PurchaseCatalogue; import digital.laboratory.platform.reagent.service.CatalogueDetailsService; import digital.laboratory.platform.reagent.service.PurchaseCatalogueService; -import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVo; -import org.springframework.beans.BeanUtils; +import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.annotations.Api; @@ -24,10 +23,7 @@ import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; import java.security.Principal; -import java.util.ArrayList; import java.util.List; /** @@ -69,9 +65,14 @@ public class PurchaseCatalogueController { DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - PurchaseCatalogueVo catalogueVo = purchaseCatalogueService.getCatalogue(purchaseCatalogueId); + PurchaseCatalogueVO catalogueVo = purchaseCatalogueService.getPurchaseCatalogueVO(purchaseCatalogueId); + + if (catalogueVo != null) { + return R.ok(catalogueVo); + } else { + return R.failed("未查询到该信息"); + } - return R.ok(catalogueVo); } @@ -85,15 +86,16 @@ public class PurchaseCatalogueController { @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page") @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_get')") - public R> getPurchaseCataloguePage(Page page, PurchaseCatalogue purchaseCatalogue, HttpServletRequest theHttpServletRequest) { + public R> getPurchaseCataloguePage(Page page, PurchaseCatalogue purchaseCatalogue, HttpServletRequest theHttpServletRequest) { + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - IPage purchaseCatalogueSList = purchaseCatalogueService.page(page, Wrappers.query() - .eq("create_by", dlpUser.getId()) - .orderByDesc("create_time") - ); - return R.ok(purchaseCatalogueSList); + IPage purchaseCatalogueVOPage = purchaseCatalogueService.getPurchaseCatalogueVOPage(page, Wrappers.query().eq("create_by", dlpUser.getId()) + .orderByDesc("create_time")); + + return R.ok(purchaseCatalogueVOPage); } @@ -119,7 +121,6 @@ public class PurchaseCatalogueController { List catalogueDetailsList = purchaseCatalogueService.addCatalogue(dlpUser, purchaseCatalogueDtoList, purchaseCatalogue); if (purchaseCatalogueService.save(purchaseCatalogue) & catalogueDetailsService.saveBatch(catalogueDetailsList)) { - return R.ok(purchaseCatalogue, "保存成功"); } else { return R.failed(purchaseCatalogue, "保存失败"); @@ -167,22 +168,116 @@ public class PurchaseCatalogueController { DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - if (purchaseCatalogueService.getById(purchaseCatalogueId)!=null){ + PurchaseCatalogue oldPurchaseCatalogue = purchaseCatalogueService.getById(purchaseCatalogueId); - }else { + if (oldPurchaseCatalogue != null) { + } + else { return R.failed("未能查到当前id数据,请重新输入"); } - PurchaseCatalogue oldPurchaseCatalogue = purchaseCatalogueService.getById(purchaseCatalogueId); - List list = purchaseCatalogueService.delCatalogue(purchaseCatalogueId); - if (purchaseCatalogueService.removeById(purchaseCatalogueId)&catalogueDetailsService.removeBatchByIds(list)) { - + if (list!=null) { + catalogueDetailsService.removeBatchByIds(list); + purchaseCatalogueService.removeById(oldPurchaseCatalogue); return R.ok(oldPurchaseCatalogue, "目录删除成功"); } else { - return R.failed(oldPurchaseCatalogue, "目录删除失败"); + purchaseCatalogueService.removeById(oldPurchaseCatalogue); + return R.ok(oldPurchaseCatalogue, "目录删除成功"); + } + } + + /** + * 通过id删除采购目录明细 + * + * @param catalogueDetailsId + * @return R + */ + @ApiOperation(value = "通过id删除采购目录明细", notes = "通过id删除采购目录明细") + @SysLog("通过id删除采购目录") + @DeleteMapping("details/{catalogueDetailsId}") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_del')") + public R deleteDetailsById(@PathVariable String catalogueDetailsId, HttpServletRequest theHttpServletRequest) { + + Principal principal = theHttpServletRequest.getUserPrincipal(); + + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + CatalogueDetails byId = catalogueDetailsService.getById(catalogueDetailsId); + + if (catalogueDetailsService.removeById(byId)){ + return R.ok(byId,"删除明细成功"); + }else { + return R.failed("删除失败"); + } + } + + /** + * 提交采购目录 + * + * @param purchaseCatalogueId + * @return R + */ + @ApiOperation(value = "提交采购目录", notes = "提交采购目录") + @SysLog("提交采购目录") + @PutMapping("/commit/{purchaseCatalogueId}") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_edit')") + public R commitById(@PathVariable String purchaseCatalogueId, HttpServletRequest theHttpServletRequest) { + + PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.commitById(purchaseCatalogueId); + + if (purchaseCatalogue!=null&purchaseCatalogueService.updateById(purchaseCatalogue)){ + return R.ok(purchaseCatalogue,"提交成功"); + }else { + return R.failed("提交失败"); + } + } + + /** + * 审核采购目录 + * + * @param auditAndApproveDto + * @return R + */ + @ApiOperation(value = "审核采购目录", notes = "审核采购目录") + @SysLog("审核采购目录") + @PutMapping("/check") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_edit')") + public R checkCatalogue(@RequestBody AuditAndApproveDto auditAndApproveDto, HttpServletRequest theHttpServletRequest) { + + Principal principal = theHttpServletRequest.getUserPrincipal(); + + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.checkCatalogue(auditAndApproveDto,dlpUser); + + if (purchaseCatalogue!=null&purchaseCatalogueService.updateById(purchaseCatalogue)){ + return R.ok(purchaseCatalogue,"审核成功"); + }else { + return R.failed("审核失败"); } + } + /** + * 发布采购目录 + * + * @param purchaseCatalogueId + * @return R + */ + @ApiOperation(value = "发布采购目录", notes = "发布采购目录") + @SysLog("发布采购目录") + @PutMapping("/release/{purchaseCatalogueId}") + @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_edit')") + public R releaseById(@PathVariable String purchaseCatalogueId, HttpServletRequest theHttpServletRequest) { + + PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.releaseCatalogue(purchaseCatalogueId); + + if (purchaseCatalogue!=null&purchaseCatalogueService.updateById(purchaseCatalogue)){ + return R.ok(purchaseCatalogue,"发布成功"); + }else { + return R.failed("发布失败"); + } } + } + -} diff --git a/src/main/java/digital/laboratory/platform/reagent/dto/AuditAndApproveDto.java b/src/main/java/digital/laboratory/platform/reagent/dto/AuditAndApproveDto.java index 18a1181..594d0d2 100644 --- a/src/main/java/digital/laboratory/platform/reagent/dto/AuditAndApproveDto.java +++ b/src/main/java/digital/laboratory/platform/reagent/dto/AuditAndApproveDto.java @@ -9,7 +9,7 @@ import lombok.NoArgsConstructor; @NoArgsConstructor public class AuditAndApproveDto { - private String auditId; + private String uuId; private String auditResult; diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/PurchaseCatalogue.java b/src/main/java/digital/laboratory/platform/reagent/entity/PurchaseCatalogue.java index 73379da..0f78976 100644 --- a/src/main/java/digital/laboratory/platform/reagent/entity/PurchaseCatalogue.java +++ b/src/main/java/digital/laboratory/platform/reagent/entity/PurchaseCatalogue.java @@ -64,7 +64,7 @@ public class PurchaseCatalogue extends BaseEntity { * (质量负责人ID) */ @ApiModelProperty(value="(质量负责人ID)") - private String qualitySupervisorid; + private String qualitySupervisorId; /** * 发布日期 @@ -76,7 +76,7 @@ public class PurchaseCatalogue extends BaseEntity { * (状态) */ @ApiModelProperty(value="(状态)") - private String status; + private Integer status; @@ -86,7 +86,7 @@ public class PurchaseCatalogue extends BaseEntity { * (技术负责人ID) */ @ApiModelProperty(value="(技术负责人ID)") - private String technicalDirectorid; + private String technicalDirectorId; /** * purchaseCatalogueId diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/CatalogueDetailsMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/CatalogueDetailsMapper.java index 292ed0f..cc30ccd 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/CatalogueDetailsMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/CatalogueDetailsMapper.java @@ -1,10 +1,14 @@ package digital.laboratory.platform.reagent.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import digital.laboratory.platform.reagent.entity.CatalogueDetails; +import digital.laboratory.platform.reagent.vo.CatalogueDetailsVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * (采购目录明细) Mapper 接口 * @@ -14,4 +18,6 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface CatalogueDetailsMapper extends BaseMapper { + ListgetCatalogueDetailsVOList(String purchaseCatalogueId); + } diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/CentralizedRequestMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/CentralizedRequestMapper.java index be3f6e5..6d4ff7f 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/CentralizedRequestMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/CentralizedRequestMapper.java @@ -1,10 +1,16 @@ 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.CentralizedRequest; +import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * (集中采购申请) Mapper 接口 * @@ -14,4 +20,9 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface CentralizedRequestMapper extends BaseMapper { + IPage getCentralizedRequestVOPage(@Param("page") IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + List getCentralizedRequestVOList(@Param(Constants.WRAPPER) QueryWrapper qw); + + CentralizedRequestVO getCentralizedRequestVO(String centralizedRequestId); + } diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/DetailsOfCentralizedMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/DetailsOfCentralizedMapper.java index 9917181..c15706d 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/DetailsOfCentralizedMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/DetailsOfCentralizedMapper.java @@ -2,9 +2,13 @@ package digital.laboratory.platform.reagent.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import digital.laboratory.platform.reagent.entity.DetailsOfCentralized; +import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; +import digital.laboratory.platform.reagent.vo.DetailsOfCentralizedVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * (集中采购申请明细) Mapper 接口 * @@ -13,5 +17,5 @@ import org.apache.ibatis.annotations.Param; */ @Mapper public interface DetailsOfCentralizedMapper extends BaseMapper { - + List getDetailsOfCentralizedVOList(String centralizedRequestId); } diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/PurchaseCatalogueMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/PurchaseCatalogueMapper.java index 0aa1545..e75a703 100644 --- a/src/main/java/digital/laboratory/platform/reagent/mapper/PurchaseCatalogueMapper.java +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/PurchaseCatalogueMapper.java @@ -1,10 +1,18 @@ 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.CentralizedRequest; import digital.laboratory.platform.reagent.entity.PurchaseCatalogue; +import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; +import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * (采购目录) Mapper 接口 * @@ -14,4 +22,9 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface PurchaseCatalogueMapper extends BaseMapper { + IPage getPurchaseCatalogueVOPage(@Param("page") IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + List getPurchaseCatalogueVOList(@Param(Constants.WRAPPER) QueryWrapper qw); + + PurchaseCatalogueVO getPurchaseCatalogueVO(String purchaseCatalogueId); + } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/CatalogueDetailsService.java b/src/main/java/digital/laboratory/platform/reagent/service/CatalogueDetailsService.java index ae6d11e..0a2ebe9 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/CatalogueDetailsService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/CatalogueDetailsService.java @@ -2,6 +2,9 @@ package digital.laboratory.platform.reagent.service; import com.baomidou.mybatisplus.extension.service.IService; import digital.laboratory.platform.reagent.entity.CatalogueDetails; +import digital.laboratory.platform.reagent.vo.CatalogueDetailsVO; + +import java.util.List; /** * (采购目录明细)服务类 @@ -11,4 +14,8 @@ import digital.laboratory.platform.reagent.entity.CatalogueDetails; */ public interface CatalogueDetailsService extends IService { + ListgetCatalogueDetailsVOList(String purchaseCatalogueId); + + + } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java b/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java index ba3c3af..dbfc3cf 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java @@ -1,12 +1,14 @@ 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.service.IService; import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.reagent.dto.AuditAndApproveDto; import digital.laboratory.platform.reagent.dto.CentralizedRequestDto; import digital.laboratory.platform.reagent.entity.CentralizedRequest; import digital.laboratory.platform.reagent.entity.DetailsOfCentralized; -import digital.laboratory.platform.reagent.vo.CentralizedRequestVo; +import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; import java.util.List; @@ -17,9 +19,7 @@ import java.util.List; * @describe (集中采购申请) 服务类 */ public interface CentralizedRequestService extends IService { - List saveRequest(CentralizedRequest centralizedRequest, List centralizedRequestDtoList, DLPUser dlpUser); - - CentralizedRequestVo getRequest(String centralizedRequestId); + List saveRequestById(CentralizedRequest centralizedRequest, List centralizedRequestDtoList, DLPUser dlpUser); CentralizedRequest commit(String centralizedRequestId); @@ -27,7 +27,13 @@ public interface CentralizedRequestService extends IService DetailsOfCentralized addDetails(CentralizedRequestDto centralizedRequestDto); - List delRequest(String centralizedRequestId); + List delRequestById(String centralizedRequestId); CentralizedRequest checkRequest(AuditAndApproveDto auditAndApproveDto, DLPUser dlpUser); + + IPage getCentralizedRequestVOPage(IPage page, QueryWrapper qw); + + List getCentralizedRequestVOList(QueryWrapper qw); + + CentralizedRequestVO getCentralizedRequestVO(String centralizedRequestId); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/DetailsOfCentralizedService.java b/src/main/java/digital/laboratory/platform/reagent/service/DetailsOfCentralizedService.java index 7177771..6e99fb8 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/DetailsOfCentralizedService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/DetailsOfCentralizedService.java @@ -1,7 +1,15 @@ package digital.laboratory.platform.reagent.service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.service.IService; +import digital.laboratory.platform.reagent.entity.CentralizedRequest; import digital.laboratory.platform.reagent.entity.DetailsOfCentralized; +import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; +import digital.laboratory.platform.reagent.vo.DetailsOfCentralizedVO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * (集中采购申请明细)服务类 @@ -11,4 +19,6 @@ import digital.laboratory.platform.reagent.entity.DetailsOfCentralized; */ public interface DetailsOfCentralizedService extends IService { + List getDetailsOfCentralizedVOList(String centralizedRequestId); + } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/PurchaseCatalogueService.java b/src/main/java/digital/laboratory/platform/reagent/service/PurchaseCatalogueService.java index 3c4d454..0c10d29 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/PurchaseCatalogueService.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/PurchaseCatalogueService.java @@ -1,11 +1,16 @@ 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.service.IService; import digital.laboratory.platform.common.mybatis.security.service.DLPUser; +import digital.laboratory.platform.reagent.dto.AuditAndApproveDto; import digital.laboratory.platform.reagent.dto.PurchaseCatalogueDto; import digital.laboratory.platform.reagent.entity.CatalogueDetails; +import digital.laboratory.platform.reagent.entity.CentralizedRequest; import digital.laboratory.platform.reagent.entity.PurchaseCatalogue; -import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVo; +import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; +import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO; import java.util.List; @@ -19,8 +24,19 @@ public interface PurchaseCatalogueService extends IService { List addCatalogue(DLPUser dlpUser, List purchaseCatalogueDtoList, PurchaseCatalogue purchaseCatalogue); - PurchaseCatalogueVo getCatalogue(String purchaseCatalogueId); - CatalogueDetails editCatalogue(PurchaseCatalogueDto purchaseCatalogueDto); List delCatalogue(String purchaseCatalogueId); + + IPage getPurchaseCatalogueVOPage(IPage page, QueryWrapper qw); + + List getPurchaseCatalogueVOList(QueryWrapper qw); + + PurchaseCatalogueVO getPurchaseCatalogueVO(String purchaseCatalogueId); + + + PurchaseCatalogue commitById(String purchaseCatalogueId); + + PurchaseCatalogue checkCatalogue (AuditAndApproveDto auditAndApproveDto,DLPUser dlpUser); + + PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId); } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java index 67193ae..6cd5f71 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java @@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import digital.laboratory.platform.reagent.entity.CatalogueDetails; import digital.laboratory.platform.reagent.mapper.CatalogueDetailsMapper; import digital.laboratory.platform.reagent.service.CatalogueDetailsService; +import digital.laboratory.platform.reagent.vo.CatalogueDetailsVO; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * (采购目录明细)服务实现类 * @@ -15,4 +19,15 @@ import org.springframework.stereotype.Service; @Service public class CatalogueDetailsServiceImpl extends ServiceImpl implements CatalogueDetailsService { + @Autowired + private CatalogueDetailsService catalogueDetailsService; + + @Override + public List getCatalogueDetailsVOList(String purchaseCatalogueId) { + + List catalogueDetailsVOList = baseMapper.getCatalogueDetailsVOList(purchaseCatalogueId); + + return catalogueDetailsVOList; + + } } 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 bd48940..5efdcc8 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java @@ -1,6 +1,8 @@ package digital.laboratory.platform.reagent.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import digital.laboratory.platform.common.mybatis.security.service.DLPUser; @@ -11,7 +13,8 @@ import digital.laboratory.platform.reagent.entity.DetailsOfCentralized; import digital.laboratory.platform.reagent.mapper.CentralizedRequestMapper; import digital.laboratory.platform.reagent.service.CentralizedRequestService; import digital.laboratory.platform.reagent.service.DetailsOfCentralizedService; -import digital.laboratory.platform.reagent.vo.CentralizedRequestVo; +import digital.laboratory.platform.reagent.vo.CentralizedRequestVO; +import digital.laboratory.platform.reagent.vo.DetailsOfCentralizedVO; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -34,8 +37,9 @@ public class CentralizedRequestServiceImpl extends ServiceImpl saveRequest(CentralizedRequest centralizedRequest, List centralizedRequestDtoList, DLPUser dlpUser) { + public List saveRequestById(CentralizedRequest centralizedRequest, List centralizedRequestDtoList, DLPUser dlpUser) { centralizedRequest.setApplicantId(dlpUser.getId()); @@ -62,31 +66,6 @@ public class CentralizedRequestServiceImpl extends ServiceImpl detailsOfCentralizedLambdaQueryWrapper = new LambdaQueryWrapper<>(); - - detailsOfCentralizedLambdaQueryWrapper.eq(DetailsOfCentralized::getCentralizedRequestId, centralizedRequestId); - - List list = detailsOfCentralizedService.list(detailsOfCentralizedLambdaQueryWrapper); - - centralizedRequest.getHeadOfDepartmentId(); - - - centralizedRequestVo.setDetailsOfCentralizedList(list); - - return centralizedRequestVo; - } else return null; - } @Override public CentralizedRequest commit(String centralizedRequestId) { @@ -138,7 +117,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl delRequest(String centralizedRequestId) { + public List delRequestById(String centralizedRequestId) { LambdaQueryWrapper detailsOfCentralizedLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -153,19 +132,48 @@ public class CentralizedRequestServiceImpl extends ServiceImpl getCentralizedRequestVOPage(IPage page, QueryWrapper qw) { + IPage r = baseMapper.getCentralizedRequestVOPage(page, qw); + return r; + } + + @Override + public List getCentralizedRequestVOList(QueryWrapper qw) { + List list = baseMapper.getCentralizedRequestVOList(qw); + return list; + } + + @Override + public CentralizedRequestVO getCentralizedRequestVO(String centralizedRequestId) { + + CentralizedRequestVO centralizedRequestVO = baseMapper.getCentralizedRequestVO(centralizedRequestId); + + List detailsOfCentralizedVOList = detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestId); + + centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedVOList); + + return centralizedRequestVO; } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/DetailsOfCentralizedServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/DetailsOfCentralizedServiceImpl.java index df85efa..ae230f4 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/DetailsOfCentralizedServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/DetailsOfCentralizedServiceImpl.java @@ -1,11 +1,15 @@ package digital.laboratory.platform.reagent.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import digital.laboratory.platform.reagent.entity.DetailsOfCentralized; import digital.laboratory.platform.reagent.mapper.DetailsOfCentralizedMapper; import digital.laboratory.platform.reagent.service.DetailsOfCentralizedService; +import digital.laboratory.platform.reagent.vo.DetailsOfCentralizedVO; import org.springframework.stereotype.Service; +import java.util.List; + /** * (集中采购申请明细)服务实现类 * @@ -15,4 +19,11 @@ import org.springframework.stereotype.Service; @Service public class DetailsOfCentralizedServiceImpl extends ServiceImpl implements DetailsOfCentralizedService { + @Override + public List getDetailsOfCentralizedVOList(String centralizedRequestId) { + + List list= baseMapper.getDetailsOfCentralizedVOList(centralizedRequestId); + + return list; + } } diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java index 0eafdf4..392ae05 100644 --- a/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java @@ -1,20 +1,25 @@ package digital.laboratory.platform.reagent.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.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.PurchaseCatalogueDto; import digital.laboratory.platform.reagent.entity.CatalogueDetails; import digital.laboratory.platform.reagent.entity.PurchaseCatalogue; import digital.laboratory.platform.reagent.mapper.PurchaseCatalogueMapper; import digital.laboratory.platform.reagent.service.CatalogueDetailsService; import digital.laboratory.platform.reagent.service.PurchaseCatalogueService; -import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVo; +import digital.laboratory.platform.reagent.vo.CatalogueDetailsVO; +import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -38,6 +43,8 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl catalogueDetailsList = new ArrayList<>(); for (PurchaseCatalogueDto purchaseCatalogueDto : purchaseCatalogueDtoList) { @@ -46,51 +53,136 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl delCatalogue(String purchaseCatalogueId) { - return purchaseCatalogueVo; - } else { - return null; - } + LambdaQueryWrapper catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); + + catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId); + + List list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper); + + if (list!=null){ + + return list; + }else { + return null;} } @Override - public CatalogueDetails editCatalogue(PurchaseCatalogueDto purchaseCatalogueDto){ + public IPage getPurchaseCatalogueVOPage(IPage page, QueryWrapper qw) { - CatalogueDetails catalogueDetails = catalogueDetailsService.getById(purchaseCatalogueDto.getCatalogueDetailsId()); + IPage purchaseCatalogueVOPage = baseMapper.getPurchaseCatalogueVOPage(page, qw); - BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails); + return purchaseCatalogueVOPage; + } - return catalogueDetails; + @Override + public List getPurchaseCatalogueVOList(QueryWrapper qw) { + + List purchaseCatalogueVOList = baseMapper.getPurchaseCatalogueVOList(qw); + + return purchaseCatalogueVOList; + } + + @Override + public PurchaseCatalogueVO getPurchaseCatalogueVO(String purchaseCatalogueId) { + + PurchaseCatalogueVO purchaseCatalogueVO = baseMapper.getPurchaseCatalogueVO(purchaseCatalogueId); + + List catalogueDetailsVOList = catalogueDetailsService.getCatalogueDetailsVOList(purchaseCatalogueId); + + purchaseCatalogueVO.setCatalogueDetailsVOListList(catalogueDetailsVOList); + + return purchaseCatalogueVO; } @Override - public List delCatalogue(String purchaseCatalogueId){ + public PurchaseCatalogue commitById(String purchaseCatalogueId) { + + PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.getById(purchaseCatalogueId); LambdaQueryWrapper catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>(); - catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId,purchaseCatalogueId); + catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId); List list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper); + //非空校验 + for (CatalogueDetails catalogueDetails : list) { + + if (catalogueDetails.getPurchaseCatalogueNumber() != null & + catalogueDetails.getBrand() != null & + catalogueDetails.getCategory() != null & + catalogueDetails.getNumber() != null & + catalogueDetails.getPackagedCopies() != null & + catalogueDetails.getSpecies() != null & + catalogueDetails.getSpecificationAndModel() != null & + catalogueDetails.getUnitPrice() != null & + catalogueDetails.getStandardValueOrPurity() != null) { + } else { + return null; + } + } + purchaseCatalogue.setStatus(1); + + return purchaseCatalogue; + } + + @Override + public PurchaseCatalogue checkCatalogue(AuditAndApproveDto auditAndApproveDto,DLPUser dlpUser) { + + PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.getById(auditAndApproveDto.getUuId()); + + if (purchaseCatalogue != null) { + + purchaseCatalogue.setAuditOpinionOfQuality(auditAndApproveDto.getAuditOpinion()); + + purchaseCatalogue.setAuditResultOfQuality(auditAndApproveDto.getAuditResult()); + + purchaseCatalogue.setQualitySupervisorId(dlpUser.getId()); - return list; + purchaseCatalogue.setAuditTimeOfQuality(LocalDateTime.now()); + + purchaseCatalogue.setStatus(2); + + return purchaseCatalogue; + } else { + return null; + } + } + + @Override + public PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId) { + + PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.getById(purchaseCatalogueId); + + if (purchaseCatalogue != null) { + + purchaseCatalogue.setStatus(3); + + return purchaseCatalogue; + } else { + return null; + } } } diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVo.java b/src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVO.java similarity index 72% rename from src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVo.java rename to src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVO.java index ef5efe6..547c936 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVo.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVO.java @@ -12,11 +12,11 @@ import java.util.List; @Data @AllArgsConstructor @NoArgsConstructor -public class CentralizedRequestVo extends CentralizedRequest { +public class CentralizedRequestVO extends CentralizedRequest { - private String department; + private String orgName; - private List detailsOfCentralizedList; + private List detailsOfCentralizedVOList; private String applicantName; diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCatalogueVo.java b/src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCatalogueVO.java similarity index 72% rename from src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCatalogueVo.java rename to src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCatalogueVO.java index 92535be..ef1074e 100644 --- a/src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCatalogueVo.java +++ b/src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCatalogueVO.java @@ -11,10 +11,8 @@ import java.util.List; @Data @AllArgsConstructor @NoArgsConstructor -public class PurchaseCatalogueVo extends PurchaseCatalogue { - - private String reagentConsumableName; +public class PurchaseCatalogueVO extends PurchaseCatalogue { private String qualityName; private String technicalName; - private List catalogueDetailsList; + private List catalogueDetailsVOListList; }