杨海航 2 years ago
parent de7c05aa06
commit 45feba34f2
  1. 58
      src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java
  2. 143
      src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java
  3. 2
      src/main/java/digital/laboratory/platform/reagent/dto/AuditAndApproveDto.java
  4. 6
      src/main/java/digital/laboratory/platform/reagent/entity/PurchaseCatalogue.java
  5. 6
      src/main/java/digital/laboratory/platform/reagent/mapper/CatalogueDetailsMapper.java
  6. 11
      src/main/java/digital/laboratory/platform/reagent/mapper/CentralizedRequestMapper.java
  7. 6
      src/main/java/digital/laboratory/platform/reagent/mapper/DetailsOfCentralizedMapper.java
  8. 13
      src/main/java/digital/laboratory/platform/reagent/mapper/PurchaseCatalogueMapper.java
  9. 7
      src/main/java/digital/laboratory/platform/reagent/service/CatalogueDetailsService.java
  10. 16
      src/main/java/digital/laboratory/platform/reagent/service/CentralizedRequestService.java
  11. 10
      src/main/java/digital/laboratory/platform/reagent/service/DetailsOfCentralizedService.java
  12. 22
      src/main/java/digital/laboratory/platform/reagent/service/PurchaseCatalogueService.java
  13. 15
      src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java
  14. 78
      src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java
  15. 11
      src/main/java/digital/laboratory/platform/reagent/service/impl/DetailsOfCentralizedServiceImpl.java
  16. 130
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseCatalogueServiceImpl.java
  17. 6
      src/main/java/digital/laboratory/platform/reagent/vo/CentralizedRequestVO.java
  18. 6
      src/main/java/digital/laboratory/platform/reagent/vo/PurchaseCatalogueVO.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<IPage<CentralizedRequest>> getCentralizedRequestPage(Page<CentralizedRequest> page, CentralizedRequest centralizedRequest, HttpServletRequest theHttpServletRequest) {
public R<IPage<CentralizedRequestVO>> getCentralizedRequestPage(Page<CentralizedRequest> page, CentralizedRequest centralizedRequest, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<CentralizedRequest> centralizedRequestSList = centralizedRequestService.page(page, Wrappers.<CentralizedRequest>query()
.eq("create_by", dlpUser.getId())
.orderByDesc("create_time")
);
IPage<CentralizedRequestVO> centralizedRequestVOPage = centralizedRequestService.getCentralizedRequestVOPage(page, Wrappers.<CentralizedRequest>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<DetailsOfCentralized> detailsOfCentralizedList= centralizedRequestService.saveRequest(centralizedRequest, centralizedRequestDtoList, dlpUser);
List<DetailsOfCentralized> 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<DetailsOfCentralized> list = centralizedRequestService.delRequest(centralizedRequestId);
List<DetailsOfCentralized> 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&centralizedRequestService.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<IPage<CentralizedRequest>> getAuditCentralizedRequestPage(Page<CentralizedRequest> page, CentralizedRequest centralizedRequest, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<CentralizedRequest> centralizedRequestSList = centralizedRequestService.page(page, Wrappers.<CentralizedRequest>query()
.eq("status", 1)
.orderByDesc("create_time")
);
return R.ok(centralizedRequestSList);
}
}

@ -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<IPage<PurchaseCatalogue>> getPurchaseCataloguePage(Page<PurchaseCatalogue> page, PurchaseCatalogue purchaseCatalogue, HttpServletRequest theHttpServletRequest) {
public R<IPage<PurchaseCatalogueVO>> getPurchaseCataloguePage(Page<PurchaseCatalogue> page, PurchaseCatalogue purchaseCatalogue, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<PurchaseCatalogue> purchaseCatalogueSList = purchaseCatalogueService.page(page, Wrappers.<PurchaseCatalogue>query()
.eq("create_by", dlpUser.getId())
.orderByDesc("create_time")
);
return R.ok(purchaseCatalogueSList);
IPage<PurchaseCatalogueVO> purchaseCatalogueVOPage = purchaseCatalogueService.getPurchaseCatalogueVOPage(page, Wrappers.<PurchaseCatalogue>query().eq("create_by", dlpUser.getId())
.orderByDesc("create_time"));
return R.ok(purchaseCatalogueVOPage);
}
@ -119,7 +121,6 @@ public class PurchaseCatalogueController {
List<CatalogueDetails> 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<CatalogueDetails> 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<CatalogueDetails> 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<PurchaseCatalogue> 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<PurchaseCatalogue> 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<PurchaseCatalogue> 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("发布失败");
}
}
}
}

@ -9,7 +9,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class AuditAndApproveDto {
private String auditId;
private String uuId;
private String auditResult;

@ -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

@ -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<CatalogueDetails> {
List<CatalogueDetailsVO>getCatalogueDetailsVOList(String purchaseCatalogueId);
}

@ -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<CentralizedRequest> {
IPage<CentralizedRequestVO> getCentralizedRequestVOPage(@Param("page") IPage<CentralizedRequest> page, @Param(Constants.WRAPPER) QueryWrapper<CentralizedRequest> qw);
List<CentralizedRequestVO> getCentralizedRequestVOList(@Param(Constants.WRAPPER) QueryWrapper<CentralizedRequest> qw);
CentralizedRequestVO getCentralizedRequestVO(String centralizedRequestId);
}

@ -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<DetailsOfCentralized> {
List<DetailsOfCentralizedVO> getDetailsOfCentralizedVOList(String centralizedRequestId);
}

@ -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<PurchaseCatalogue> {
IPage<PurchaseCatalogueVO> getPurchaseCatalogueVOPage(@Param("page") IPage<PurchaseCatalogue> page, @Param(Constants.WRAPPER) QueryWrapper<PurchaseCatalogue> qw);
List<PurchaseCatalogueVO> getPurchaseCatalogueVOList(@Param(Constants.WRAPPER) QueryWrapper<PurchaseCatalogue> qw);
PurchaseCatalogueVO getPurchaseCatalogueVO(String purchaseCatalogueId);
}

@ -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<CatalogueDetails> {
List<CatalogueDetailsVO>getCatalogueDetailsVOList(String purchaseCatalogueId);
}

@ -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<CentralizedRequest> {
List<DetailsOfCentralized> saveRequest(CentralizedRequest centralizedRequest, List<CentralizedRequestDto> centralizedRequestDtoList, DLPUser dlpUser);
CentralizedRequestVo getRequest(String centralizedRequestId);
List<DetailsOfCentralized> saveRequestById(CentralizedRequest centralizedRequest, List<CentralizedRequestDto> centralizedRequestDtoList, DLPUser dlpUser);
CentralizedRequest commit(String centralizedRequestId);
@ -27,7 +27,13 @@ public interface CentralizedRequestService extends IService<CentralizedRequest>
DetailsOfCentralized addDetails(CentralizedRequestDto centralizedRequestDto);
List<DetailsOfCentralized> delRequest(String centralizedRequestId);
List<DetailsOfCentralized> delRequestById(String centralizedRequestId);
CentralizedRequest checkRequest(AuditAndApproveDto auditAndApproveDto, DLPUser dlpUser);
IPage<CentralizedRequestVO> getCentralizedRequestVOPage(IPage<CentralizedRequest> page, QueryWrapper<CentralizedRequest> qw);
List<CentralizedRequestVO> getCentralizedRequestVOList(QueryWrapper<CentralizedRequest> qw);
CentralizedRequestVO getCentralizedRequestVO(String centralizedRequestId);
}

@ -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<DetailsOfCentralized> {
List<DetailsOfCentralizedVO> getDetailsOfCentralizedVOList(String centralizedRequestId);
}

@ -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<PurchaseCatalogue> {
List<CatalogueDetails> addCatalogue(DLPUser dlpUser, List<PurchaseCatalogueDto> purchaseCatalogueDtoList, PurchaseCatalogue purchaseCatalogue);
PurchaseCatalogueVo getCatalogue(String purchaseCatalogueId);
CatalogueDetails editCatalogue(PurchaseCatalogueDto purchaseCatalogueDto);
List<CatalogueDetails> delCatalogue(String purchaseCatalogueId);
IPage<PurchaseCatalogueVO> getPurchaseCatalogueVOPage(IPage<PurchaseCatalogue> page, QueryWrapper<PurchaseCatalogue> qw);
List<PurchaseCatalogueVO> getPurchaseCatalogueVOList(QueryWrapper<PurchaseCatalogue> qw);
PurchaseCatalogueVO getPurchaseCatalogueVO(String purchaseCatalogueId);
PurchaseCatalogue commitById(String purchaseCatalogueId);
PurchaseCatalogue checkCatalogue (AuditAndApproveDto auditAndApproveDto,DLPUser dlpUser);
PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId);
}

@ -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<CatalogueDetailsMapper, CatalogueDetails> implements CatalogueDetailsService {
@Autowired
private CatalogueDetailsService catalogueDetailsService;
@Override
public List<CatalogueDetailsVO> getCatalogueDetailsVOList(String purchaseCatalogueId) {
List<CatalogueDetailsVO> catalogueDetailsVOList = baseMapper.getCatalogueDetailsVOList(purchaseCatalogueId);
return catalogueDetailsVOList;
}
}

@ -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<CentralizedReques
@Autowired
private DetailsOfCentralizedService detailsOfCentralizedService;
@Override
public List<DetailsOfCentralized> saveRequest(CentralizedRequest centralizedRequest, List<CentralizedRequestDto> centralizedRequestDtoList, DLPUser dlpUser) {
public List<DetailsOfCentralized> saveRequestById(CentralizedRequest centralizedRequest, List<CentralizedRequestDto> centralizedRequestDtoList, DLPUser dlpUser) {
centralizedRequest.setApplicantId(dlpUser.getId());
@ -62,31 +66,6 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
return detailsOfCentralizedList;
}
@Override
public CentralizedRequestVo getRequest(String centralizedRequestId) {
CentralizedRequestVo centralizedRequestVo = new CentralizedRequestVo();
if (centralizedRequestService.getById(centralizedRequestId) != null) {
CentralizedRequest centralizedRequest = centralizedRequestService.getById(centralizedRequestId);
BeanUtils.copyProperties(centralizedRequest, centralizedRequestVo);
//查询集中采购明细
LambdaQueryWrapper<DetailsOfCentralized> detailsOfCentralizedLambdaQueryWrapper = new LambdaQueryWrapper<>();
detailsOfCentralizedLambdaQueryWrapper.eq(DetailsOfCentralized::getCentralizedRequestId, centralizedRequestId);
List<DetailsOfCentralized> 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<CentralizedReques
}
@Override
public List<DetailsOfCentralized> delRequest(String centralizedRequestId) {
public List<DetailsOfCentralized> delRequestById(String centralizedRequestId) {
LambdaQueryWrapper<DetailsOfCentralized> detailsOfCentralizedLambdaQueryWrapper = new LambdaQueryWrapper<>();
@ -153,19 +132,48 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
@Override
public CentralizedRequest checkRequest(AuditAndApproveDto auditAndApproveDto, DLPUser dlpUser) {
CentralizedRequest centralizedRequest = centralizedRequestService.getById(auditAndApproveDto.getAuditId());
CentralizedRequest centralizedRequest = centralizedRequestService.getById(auditAndApproveDto.getUuId());
centralizedRequest.setAuditResult(auditAndApproveDto.getAuditResult());
centralizedRequest.setAuditOpinion(auditAndApproveDto.getAuditOpinion());
if (centralizedRequest != null) {
centralizedRequest.setAuditResult(auditAndApproveDto.getAuditResult());
centralizedRequest.setHeadOfDepartmentId(dlpUser.getId());
centralizedRequest.setAuditOpinion(auditAndApproveDto.getAuditOpinion());
centralizedRequest.setAuditTime(LocalDateTime.now());
centralizedRequest.setHeadOfDepartmentId(dlpUser.getId());
centralizedRequest.setStatus(2);
centralizedRequest.setAuditTime(LocalDateTime.now());
return centralizedRequest;
centralizedRequest.setStatus(2);
return centralizedRequest;
} else {
return null;
}
}
@Override
public IPage<CentralizedRequestVO> getCentralizedRequestVOPage(IPage<CentralizedRequest> page, QueryWrapper<CentralizedRequest> qw) {
IPage<CentralizedRequestVO> r = baseMapper.getCentralizedRequestVOPage(page, qw);
return r;
}
@Override
public List<CentralizedRequestVO> getCentralizedRequestVOList(QueryWrapper<CentralizedRequest> qw) {
List<CentralizedRequestVO> list = baseMapper.getCentralizedRequestVOList(qw);
return list;
}
@Override
public CentralizedRequestVO getCentralizedRequestVO(String centralizedRequestId) {
CentralizedRequestVO centralizedRequestVO = baseMapper.getCentralizedRequestVO(centralizedRequestId);
List<DetailsOfCentralizedVO> detailsOfCentralizedVOList = detailsOfCentralizedService.getDetailsOfCentralizedVOList(centralizedRequestId);
centralizedRequestVO.setDetailsOfCentralizedVOList(detailsOfCentralizedVOList);
return centralizedRequestVO;
}
}

@ -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<DetailsOfCentralizedMapper, DetailsOfCentralized> implements DetailsOfCentralizedService {
@Override
public List<DetailsOfCentralizedVO> getDetailsOfCentralizedVOList(String centralizedRequestId) {
List<DetailsOfCentralizedVO> list= baseMapper.getDetailsOfCentralizedVOList(centralizedRequestId);
return list;
}
}

@ -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<PurchaseCatalogueM
purchaseCatalogue.setPurchaseCatalogueId(IdWorker.get32UUID().toUpperCase());
purchaseCatalogue.setStatus(0);
List<CatalogueDetails> catalogueDetailsList = new ArrayList<>();
for (PurchaseCatalogueDto purchaseCatalogueDto : purchaseCatalogueDtoList) {
@ -46,51 +53,136 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
catalogueDetails.setCatalogueDetailsId(IdWorker.get32UUID().toUpperCase());
catalogueDetails.setPurchaseCatalogueId(purchaseCatalogue.getPurchaseCatalogueId());
BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails);
catalogueDetails.setPurchaseCatalogueId(purchaseCatalogue.getPurchaseCatalogueId());
catalogueDetailsList.add(catalogueDetails);
}
return catalogueDetailsList;
}
@Override
public PurchaseCatalogueVo getCatalogue(String purchaseCatalogueId) {
public CatalogueDetails editCatalogue(PurchaseCatalogueDto purchaseCatalogueDto) {
if (purchaseCatalogueService.getById(purchaseCatalogueId) != null) {
CatalogueDetails catalogueDetails = catalogueDetailsService.getById(purchaseCatalogueDto.getCatalogueDetailsId());
PurchaseCatalogueVo purchaseCatalogueVo = new PurchaseCatalogueVo();
BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails);
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.getById(purchaseCatalogueId);
return catalogueDetails;
}
BeanUtils.copyProperties(purchaseCatalogue, purchaseCatalogueVo);
@Override
public List<CatalogueDetails> delCatalogue(String purchaseCatalogueId) {
return purchaseCatalogueVo;
} else {
return null;
}
LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId);
List<CatalogueDetails> list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper);
if (list!=null){
return list;
}else {
return null;}
}
@Override
public CatalogueDetails editCatalogue(PurchaseCatalogueDto purchaseCatalogueDto){
public IPage<PurchaseCatalogueVO> getPurchaseCatalogueVOPage(IPage<PurchaseCatalogue> page, QueryWrapper<PurchaseCatalogue> qw) {
CatalogueDetails catalogueDetails = catalogueDetailsService.getById(purchaseCatalogueDto.getCatalogueDetailsId());
IPage<PurchaseCatalogueVO> purchaseCatalogueVOPage = baseMapper.getPurchaseCatalogueVOPage(page, qw);
BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails);
return purchaseCatalogueVOPage;
}
return catalogueDetails;
@Override
public List<PurchaseCatalogueVO> getPurchaseCatalogueVOList(QueryWrapper<PurchaseCatalogue> qw) {
List<PurchaseCatalogueVO> purchaseCatalogueVOList = baseMapper.getPurchaseCatalogueVOList(qw);
return purchaseCatalogueVOList;
}
@Override
public PurchaseCatalogueVO getPurchaseCatalogueVO(String purchaseCatalogueId) {
PurchaseCatalogueVO purchaseCatalogueVO = baseMapper.getPurchaseCatalogueVO(purchaseCatalogueId);
List<CatalogueDetailsVO> catalogueDetailsVOList = catalogueDetailsService.getCatalogueDetailsVOList(purchaseCatalogueId);
purchaseCatalogueVO.setCatalogueDetailsVOListList(catalogueDetailsVOList);
return purchaseCatalogueVO;
}
@Override
public List<CatalogueDetails> delCatalogue(String purchaseCatalogueId){
public PurchaseCatalogue commitById(String purchaseCatalogueId) {
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.getById(purchaseCatalogueId);
LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId,purchaseCatalogueId);
catalogueDetailsLambdaQueryWrapper.eq(CatalogueDetails::getPurchaseCatalogueId, purchaseCatalogueId);
List<CatalogueDetails> 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;
}
}
}

@ -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<DetailsOfCentralized> detailsOfCentralizedList;
private List<DetailsOfCentralizedVO> detailsOfCentralizedVOList;
private String applicantName;

@ -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<CatalogueDetails> catalogueDetailsList;
private List<CatalogueDetailsVO> catalogueDetailsVOListList;
}
Loading…
Cancel
Save