3.20
This commit is contained in:
+2025
-961
File diff suppressed because it is too large
Load Diff
+29045
-18349
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1115,3 +1115,60 @@ Caused by: java.net.ConnectException: Connection refused: no further information
|
||||
2023-03-14 14:05:57,183 [main] ERROR [com.alibaba.nacos.common.remote.client] LoggerUtils.java:99 - Send request fail, request=ConfigQueryRequest{headers={charset=UTF-8, Client-AppName=unknown, Client-RequestToken=db0a8686b1ce784131b9084bd2aa94f7, Client-RequestTS=1678773956957, exConfigInfo=true, notify=false, Timestamp=1678773956957}, requestId='null'}, retryTimes=1,errorMessage=Client not connected,current status:STARTING
|
||||
2023-03-14 14:05:57,290 [main] ERROR [com.alibaba.nacos.common.remote.client] LoggerUtils.java:99 - Send request fail, request=ConfigQueryRequest{headers={charset=UTF-8, Client-AppName=unknown, Client-RequestToken=db0a8686b1ce784131b9084bd2aa94f7, Client-RequestTS=1678773956957, exConfigInfo=true, notify=false, Timestamp=1678773956957}, requestId='null'}, retryTimes=2,errorMessage=Client not connected,current status:STARTING
|
||||
2023-03-14 14:05:57,402 [main] ERROR [com.alibaba.nacos.common.remote.client] LoggerUtils.java:99 - Send request fail, request=ConfigQueryRequest{headers={charset=UTF-8, Client-AppName=unknown, Client-RequestToken=28e72b15d8acbc6d69515eeb59eb6338, Client-RequestTS=1678773957291, exConfigInfo=true, notify=false, Timestamp=1678773957291}, requestId='null'}, retryTimes=0,errorMessage=Client not connected,current status:STARTING
|
||||
2023-03-15 11:47:31,308 [main] ERROR [o.s.b.diagnostics.LoggingFailureAnalysisReporter] LoggingFailureAnalysisReporter.java:40 -
|
||||
|
||||
***************************
|
||||
APPLICATION FAILED TO START
|
||||
***************************
|
||||
|
||||
Description:
|
||||
|
||||
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
|
||||
|
||||
Reason: Failed to determine a suitable driver class
|
||||
|
||||
|
||||
Action:
|
||||
|
||||
Consider the following:
|
||||
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
|
||||
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
|
||||
|
||||
2023-03-15 11:47:51,925 [main] ERROR [o.s.b.diagnostics.LoggingFailureAnalysisReporter] LoggingFailureAnalysisReporter.java:40 -
|
||||
|
||||
***************************
|
||||
APPLICATION FAILED TO START
|
||||
***************************
|
||||
|
||||
Description:
|
||||
|
||||
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
|
||||
|
||||
Reason: Failed to determine a suitable driver class
|
||||
|
||||
|
||||
Action:
|
||||
|
||||
Consider the following:
|
||||
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
|
||||
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
|
||||
|
||||
2023-03-15 11:49:41,517 [main] ERROR [o.s.b.diagnostics.LoggingFailureAnalysisReporter] LoggingFailureAnalysisReporter.java:40 -
|
||||
|
||||
***************************
|
||||
APPLICATION FAILED TO START
|
||||
***************************
|
||||
|
||||
Description:
|
||||
|
||||
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
|
||||
|
||||
Reason: Failed to determine a suitable driver class
|
||||
|
||||
|
||||
Action:
|
||||
|
||||
Consider the following:
|
||||
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
|
||||
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<version>2022.10.11-snapshots</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>dlp-utilities</artifactId>
|
||||
<artifactId>dlp-reagent-managment</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<description>DLP 的试剂耗材管理</description>
|
||||
<properties>
|
||||
@@ -117,6 +117,8 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -184,4 +186,5 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
||||
|
||||
+19
-13
@@ -6,8 +6,8 @@ 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.AuditAndApproveDto;
|
||||
import digital.laboratory.platform.reagent.dto.CentralizedRequestDto;
|
||||
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.service.CentralizedRequestService;
|
||||
@@ -103,14 +103,14 @@ public class CentralizedRequestController {
|
||||
/**
|
||||
* 新增(集中采购申请)
|
||||
*
|
||||
* @param centralizedRequestDtoList 集中采购申请
|
||||
* @param centralizedRequestDTOList 集中采购申请
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增集中采购申请", notes = "新增集中采购申请")
|
||||
@SysLog("新增集中采购申请")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('reagent_centralized_request_add')")
|
||||
public R<CentralizedRequest> postAddObject(@RequestBody List<CentralizedRequestDto> centralizedRequestDtoList, HttpServletRequest theHttpServletRequest) {
|
||||
public R<CentralizedRequest> postAddObject(@RequestBody List<CentralizedRequestDTO> centralizedRequestDTOList, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
@@ -118,7 +118,7 @@ public class CentralizedRequestController {
|
||||
|
||||
CentralizedRequest centralizedRequest = new CentralizedRequest();
|
||||
|
||||
List<DetailsOfCentralized> detailsOfCentralizedList= centralizedRequestService.saveRequestById(centralizedRequest, centralizedRequestDtoList, dlpUser);
|
||||
List<DetailsOfCentralized> detailsOfCentralizedList= centralizedRequestService.saveRequestById(centralizedRequest, centralizedRequestDTOList, dlpUser);
|
||||
|
||||
if (centralizedRequestService.save(centralizedRequest) & detailsOfCentralizedService.saveBatch(detailsOfCentralizedList)) {
|
||||
return R.ok(centralizedRequest, "保存成功");
|
||||
@@ -137,7 +137,7 @@ public class CentralizedRequestController {
|
||||
@SysLog("新增集中采购申请明细")
|
||||
@PostMapping("/details")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_details_of_centralized_add')")
|
||||
public R<DetailsOfCentralized> postAddDetails(@RequestBody CentralizedRequestDto centralizedRequestDto, HttpServletRequest theHttpServletRequest) {
|
||||
public R<DetailsOfCentralized> postAddDetails(@RequestBody CentralizedRequestDTO centralizedRequestDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
DetailsOfCentralized detailsOfCentralized = centralizedRequestService.addDetails(centralizedRequestDto);
|
||||
|
||||
@@ -180,7 +180,7 @@ public class CentralizedRequestController {
|
||||
@SysLog("修改(集中采购申请)")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('reagent_centralized_request_edit')")
|
||||
public R<DetailsOfCentralized> putUpdateById(@RequestBody CentralizedRequestDto centralizedRequestDto, HttpServletRequest theHttpServletRequest) {
|
||||
public R<DetailsOfCentralized> putUpdateById(@RequestBody CentralizedRequestDTO centralizedRequestDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
@@ -215,14 +215,20 @@ public class CentralizedRequestController {
|
||||
|
||||
CentralizedRequest oldcentralizedRequest = centralizedRequestService.getById(centralizedRequestId);
|
||||
|
||||
detailsOfCentralizedService.removeBatchByIds(list);
|
||||
if (oldcentralizedRequest==null){
|
||||
|
||||
if (oldcentralizedRequest.getStatus()==0 & centralizedRequestService.removeById(centralizedRequestId)) {
|
||||
return R.ok(oldcentralizedRequest, "删除成功");
|
||||
} else {
|
||||
return R.failed(oldcentralizedRequest, "删除失败");
|
||||
return R.failed("未能查询到对应信息");
|
||||
}
|
||||
|
||||
if (list!=null){
|
||||
if (oldcentralizedRequest.getStatus()==0&detailsOfCentralizedService.removeBatchByIds(list)¢ralizedRequestService.removeById(oldcentralizedRequest)){
|
||||
return R.ok(oldcentralizedRequest, "删除成功");
|
||||
}else return R.failed("删除失败");
|
||||
}else {
|
||||
if (oldcentralizedRequest.getStatus()==0¢ralizedRequestService.removeById(oldcentralizedRequest)){
|
||||
return R.ok(oldcentralizedRequest, "删除成功");
|
||||
}else return R.failed("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,7 +262,7 @@ public class CentralizedRequestController {
|
||||
@SysLog("审核集中采购申请明细")
|
||||
@PutMapping("/check")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_centralized_request_check')")
|
||||
public R<CentralizedRequest> checkRequest(@RequestBody AuditAndApproveDto auditAndApproveDto, HttpServletRequest theHttpServletRequest) {
|
||||
public R<CentralizedRequest> checkRequest(@RequestBody AuditAndApproveDTO auditAndApproveDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
|
||||
+246
-74
@@ -1,15 +1,19 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
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;
|
||||
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.DecentralizedRequestDTO;
|
||||
import digital.laboratory.platform.reagent.entity.DecentralizeDetails;
|
||||
import digital.laboratory.platform.reagent.entity.DecentralizedRequest;
|
||||
import digital.laboratory.platform.reagent.service.DecentralizeDetailsService;
|
||||
import digital.laboratory.platform.reagent.service.DecentralizedRequestService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -17,135 +21,303 @@ 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.List;
|
||||
|
||||
/**
|
||||
* (分散采购申请)
|
||||
*
|
||||
* @author Zhang Xiaolong created at 2023-03-10
|
||||
* @describe (分散采购申请) 前端控制器
|
||||
*
|
||||
* <p>
|
||||
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
|
||||
* 这里写什么:
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/decentralized_request" )
|
||||
@RequestMapping("/decentralized_request")
|
||||
@Api(value = "decentralized_request", tags = "(分散采购申请)管理")
|
||||
public class DecentralizedRequestController {
|
||||
|
||||
private final DecentralizedRequestService decentralizedRequestService;
|
||||
@Autowired
|
||||
private final DecentralizedRequestService decentralizedRequestService;
|
||||
@Autowired
|
||||
private final DecentralizeDetailsService decentralizeDetailsService;
|
||||
|
||||
/**
|
||||
* 通过id查询(分散采购申请)
|
||||
* @param decentralizedRequestId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{decentralizedRequestId}" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')" )
|
||||
public R<DecentralizedRequest> getById(@PathVariable("decentralizedRequestId" ) String decentralizedRequestId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
/**
|
||||
* 通过id查询(分散采购申请)
|
||||
*
|
||||
* @param decentralizedRequestId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{decentralizedRequestId}")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')")
|
||||
public R<DecentralizedRequest> getById(@PathVariable("decentralizedRequestId") String decentralizedRequestId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
DecentralizedRequest decentralizedRequest = decentralizedRequestService.getById(decentralizedRequestId);
|
||||
return R.ok(decentralizedRequest);
|
||||
//return R.ok(decentralizedRequestService.getById(decentralizedRequestId));
|
||||
}
|
||||
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(decentralizedRequestId);
|
||||
return R.ok(requestById);
|
||||
//return R.ok(decentralizedRequestService.getById(decentralizedRequestId));
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param decentralizedRequest (分散采购申请)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')" )
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')")
|
||||
public R<IPage<DecentralizedRequest>> getDecentralizedRequestPage(Page<DecentralizedRequest> page, DecentralizedRequest decentralizedRequest, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<DecentralizedRequest> decentralizedRequestSList = decentralizedRequestService.page(page, Wrappers.<DecentralizedRequest>query()
|
||||
.eq("create_by", dlpUser.getId())
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(decentralizedRequestSList);
|
||||
IPage<DecentralizedRequest> decentralizedRequestSList = decentralizedRequestService.page(page, Wrappers.<DecentralizedRequest>query()
|
||||
.eq("create_by", dlpUser.getId())
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(decentralizedRequestSList);
|
||||
// return R.ok(decentralizedRequestService.page(page, Wrappers.query(decentralizedRequest)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增(分散采购申请)
|
||||
* @param decentralizedRequest (分散采购申请)
|
||||
*
|
||||
* @param decentralizedRequestDTOList (分散采购申请)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增(分散采购申请)", notes = "新增(分散采购申请)")
|
||||
@SysLog("新增(分散采购申请)" )
|
||||
@ApiOperation(value = "新增分散采购申请", notes = "新增分散采购申请")
|
||||
@SysLog("新增分散采购申请")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('reagent_decentralized_request_add')" )
|
||||
public R<DecentralizedRequest> postAddObject(@RequestBody DecentralizedRequest decentralizedRequest, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_add')")
|
||||
public R<DecentralizedRequest> postAddObject(@RequestBody List<DecentralizedRequestDTO> decentralizedRequestDTOList, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
DecentralizedRequest decentralizedRequest = new DecentralizedRequest();
|
||||
|
||||
List<DecentralizeDetails> list = decentralizedRequestService.addRequest(decentralizedRequestDTOList, dlpUser, decentralizedRequest);
|
||||
|
||||
if (decentralizedRequestService.save(decentralizedRequest) & decentralizeDetailsService.saveBatch(list)) {
|
||||
|
||||
return R.ok(decentralizedRequest, "保存成功");
|
||||
} else {
|
||||
return R.failed("保存失败");
|
||||
}
|
||||
|
||||
|
||||
decentralizedRequest.setDecentralizedRequestId(IdWorker.get32UUID().toUpperCase());
|
||||
if (decentralizedRequestService.save(decentralizedRequest)) {
|
||||
return R.ok(decentralizedRequest, "对象创建成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(decentralizedRequest, "对象创建失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改(分散采购申请)
|
||||
* @param decentralizedRequest (分散采购申请)
|
||||
*
|
||||
* @param decentralizedRequestDTO (分散采购申请)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改(分散采购申请)", notes = "修改(分散采购申请)")
|
||||
@SysLog("修改(分散采购申请)" )
|
||||
@SysLog("修改(分散采购申请)")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('reagent_decentralized_request_edit')" )
|
||||
public R<DecentralizedRequest> putUpdateById(@RequestBody DecentralizedRequest decentralizedRequest, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_edit')")
|
||||
public R<DecentralizeDetails> putUpdateById(@RequestBody DecentralizedRequestDTO decentralizedRequestDTO, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
if (decentralizedRequestService.updateById(decentralizedRequest)) {
|
||||
return R.ok(decentralizedRequest, "保存对象成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(decentralizedRequest, "保存对象失败");
|
||||
}
|
||||
DecentralizeDetails decentralizeDetails = decentralizedRequestService.editRequest(decentralizedRequestDTO);
|
||||
|
||||
if (decentralizeDetailsService.updateById(decentralizeDetails)) {
|
||||
return R.ok(decentralizeDetails, "修改成功");
|
||||
} else {
|
||||
return R.failed(decentralizeDetails, "修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除(分散采购申请)
|
||||
*
|
||||
* @param decentralizedRequestId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除(分散采购申请)", notes = "通过id删除(分散采购申请)")
|
||||
@SysLog("通过id删除(分散采购申请)" )
|
||||
@DeleteMapping("/{decentralizedRequestId}" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_decentralized_request_del')" )
|
||||
@ApiOperation(value = "通过id删除分散采购申请", notes = "通过id删除分散采购申请")
|
||||
@SysLog("通过id删除(分散采购申请)")
|
||||
@DeleteMapping("/{decentralizedRequestId}")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_del')")
|
||||
public R<DecentralizedRequest> deleteById(@PathVariable String decentralizedRequestId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
DecentralizedRequest oldDecentralizedRequest = decentralizedRequestService.getById(decentralizedRequestId);
|
||||
|
||||
if (decentralizedRequestService.removeById(decentralizedRequestId)) {
|
||||
return R.ok(oldDecentralizedRequest, "对象删除成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(oldDecentralizedRequest, "对象删除失败");
|
||||
}
|
||||
List<DecentralizeDetails> list = decentralizedRequestService.delRequestById(decentralizedRequestId);
|
||||
|
||||
if (oldDecentralizedRequest == null) {
|
||||
|
||||
return R.failed("未能查询到当前信息");
|
||||
}
|
||||
|
||||
if (list != null) {
|
||||
if (decentralizeDetailsService.removeBatchByIds(list) &
|
||||
decentralizedRequestService.removeById(oldDecentralizedRequest)) {
|
||||
return R.ok(oldDecentralizedRequest, "删除成功");
|
||||
} else {
|
||||
return R.failed("删除失败");
|
||||
}
|
||||
} else {
|
||||
if (decentralizedRequestService.removeById(oldDecentralizedRequest)) {
|
||||
return R.ok(oldDecentralizedRequest, "删除成功");
|
||||
} else {
|
||||
return R.failed("删除失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除分散采购申请明细
|
||||
*
|
||||
* @param decentralizeDetailsId
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除分散采购申请明细", notes = "通过id删除分散采购申请明细")
|
||||
@SysLog("通过id删除分散采购申请明细")
|
||||
@DeleteMapping("details/{decentralizeDetailsId}")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_del')")
|
||||
public R<DecentralizeDetails> deleteDetailsById(@PathVariable String decentralizeDetailsId, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
DecentralizeDetails decentralizeDetails = decentralizeDetailsService.getById(decentralizeDetailsId);
|
||||
|
||||
if (decentralizeDetailsService.removeById(decentralizeDetails)) {
|
||||
return R.ok(decentralizeDetails, "移除成功");
|
||||
} else return R.failed("移除失败");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交分散采购申请明细
|
||||
*
|
||||
* @param decentralizedRequestId
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "提交分散采购申请明细", notes = "提交分散采购申请明细")
|
||||
@SysLog("提交分散采购申请明细")
|
||||
@PutMapping("commit/{decentralizedRequestId}")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_edit')")
|
||||
public R<DecentralizedRequest> commitById(@PathVariable String decentralizedRequestId, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
DecentralizedRequest decentralizedRequest = decentralizedRequestService.commitRequest(decentralizedRequestId);
|
||||
|
||||
if (decentralizedRequestService.updateById(decentralizedRequest)) {
|
||||
return R.ok(decentralizedRequest, "提交成功");
|
||||
} else return R.failed("提交失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 一级审核分散采购申请
|
||||
*
|
||||
* @param auditAndApproveDto
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审核分散采购申请", notes = "审核分散采购申请")
|
||||
@SysLog("审核分散采购申请明细")
|
||||
@PutMapping("/primary/audit")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_edit')")
|
||||
public R<DecentralizedRequest> primaryAuditRequest(@RequestBody AuditAndApproveDTO auditAndApproveDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
DecentralizedRequest decentralizedRequest = decentralizedRequestService.primaryAuditRequest(dlpUser, auditAndApproveDto);
|
||||
|
||||
if (decentralizedRequestService.updateById(decentralizedRequest)) {
|
||||
return R.ok(decentralizedRequest, "审核成功");
|
||||
} else return R.failed("审核失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 二级审核分散采购申请
|
||||
*
|
||||
* @param auditAndApproveDto
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审核分散采购申请", notes = "审核分散采购申请")
|
||||
@SysLog("审核分散采购申请明细")
|
||||
@PutMapping("/secondary/audit")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_edit')")
|
||||
public R<DecentralizedRequest> secondaryAuditRequest(@RequestBody AuditAndApproveDTO auditAndApproveDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
DecentralizedRequest decentralizedRequest = decentralizedRequestService.secondaryAuditRequest(dlpUser, auditAndApproveDto);
|
||||
|
||||
if (decentralizedRequestService.updateById(decentralizedRequest)) {
|
||||
return R.ok(decentralizedRequest, "审核成功");
|
||||
} else return R.failed("审核失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 三级审核分散采购申请
|
||||
*
|
||||
* @param auditAndApproveDto
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审核分散采购申请", notes = "审核分散采购申请")
|
||||
@SysLog("审核分散采购申请明细")
|
||||
@PutMapping("/threeLevel/audit")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_edit')")
|
||||
public R<DecentralizedRequest> threeLevelAuditRequest(@RequestBody AuditAndApproveDTO auditAndApproveDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
DecentralizedRequest decentralizedRequest = decentralizedRequestService.threeLevelAuditRequest(dlpUser, auditAndApproveDto);
|
||||
|
||||
if (decentralizedRequestService.updateById(decentralizedRequest)) {
|
||||
return R.ok(decentralizedRequest, "审核成功");
|
||||
} else return R.failed("审核失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批分散采购申请
|
||||
*
|
||||
* @param auditAndApproveDto
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审批分散采购申请", notes = "审批分散采购申请")
|
||||
@SysLog("审批分散采购申请明细")
|
||||
@PutMapping("/approve")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_edit')")
|
||||
public R<DecentralizedRequest> approveRequest(@RequestBody AuditAndApproveDTO auditAndApproveDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
DecentralizedRequest decentralizedRequest = decentralizedRequestService.approveRequest(dlpUser, auditAndApproveDto);
|
||||
|
||||
if (decentralizedRequestService.updateById(decentralizedRequest)) {
|
||||
return R.ok(decentralizedRequest, "审批成功");
|
||||
} else return R.failed("审批失败");
|
||||
}
|
||||
}
|
||||
|
||||
+43
-20
@@ -1,14 +1,13 @@
|
||||
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.Wrappers;
|
||||
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.AuditAndApproveDto;
|
||||
import digital.laboratory.platform.reagent.dto.PurchaseCatalogueDto;
|
||||
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;
|
||||
@@ -103,14 +102,14 @@ public class PurchaseCatalogueController {
|
||||
/**
|
||||
* 新增(采购目录)
|
||||
*
|
||||
* @param purchaseCatalogueDtoList (采购目录)
|
||||
* @param purchaseCatalogueDTOList (采购目录)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增(采购目录)", notes = "新增(采购目录)")
|
||||
@SysLog("新增(采购目录)")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_add')")
|
||||
public R<PurchaseCatalogue> postAddObject(@RequestBody List<PurchaseCatalogueDto> purchaseCatalogueDtoList, HttpServletRequest theHttpServletRequest) {
|
||||
public R<PurchaseCatalogue> postAddObject(@RequestBody List<PurchaseCatalogueDTO> purchaseCatalogueDTOList, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
@@ -118,7 +117,7 @@ public class PurchaseCatalogueController {
|
||||
|
||||
PurchaseCatalogue purchaseCatalogue = new PurchaseCatalogue();
|
||||
|
||||
List<CatalogueDetails> catalogueDetailsList = purchaseCatalogueService.addCatalogue(dlpUser, purchaseCatalogueDtoList, purchaseCatalogue);
|
||||
List<CatalogueDetails> catalogueDetailsList = purchaseCatalogueService.addCatalogue(dlpUser, purchaseCatalogueDTOList, purchaseCatalogue);
|
||||
|
||||
if (purchaseCatalogueService.save(purchaseCatalogue) & catalogueDetailsService.saveBatch(catalogueDetailsList)) {
|
||||
return R.ok(purchaseCatalogue, "保存成功");
|
||||
@@ -137,7 +136,7 @@ public class PurchaseCatalogueController {
|
||||
@SysLog("修改明细采购目录明细")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_edit')")
|
||||
public R<CatalogueDetails> putUpdateById(@RequestBody PurchaseCatalogueDto purchaseCatalogueDto, HttpServletRequest theHttpServletRequest) {
|
||||
public R<CatalogueDetails> putUpdateById(@RequestBody PurchaseCatalogueDTO purchaseCatalogueDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
@@ -170,20 +169,19 @@ public class PurchaseCatalogueController {
|
||||
|
||||
PurchaseCatalogue oldPurchaseCatalogue = purchaseCatalogueService.getById(purchaseCatalogueId);
|
||||
|
||||
if (oldPurchaseCatalogue != null) {
|
||||
}
|
||||
else {
|
||||
return R.failed("未能查到当前id数据,请重新输入");
|
||||
if (oldPurchaseCatalogue == null) {
|
||||
return R.failed("未能查到当前信息");
|
||||
}
|
||||
List<CatalogueDetails> list = purchaseCatalogueService.delCatalogue(purchaseCatalogueId);
|
||||
|
||||
if (list!=null) {
|
||||
catalogueDetailsService.removeBatchByIds(list);
|
||||
purchaseCatalogueService.removeById(oldPurchaseCatalogue);
|
||||
return R.ok(oldPurchaseCatalogue, "目录删除成功");
|
||||
if (oldPurchaseCatalogue.getStatus()==0&catalogueDetailsService.removeBatchByIds(list)&purchaseCatalogueService.removeById(oldPurchaseCatalogue)){
|
||||
return R.ok(oldPurchaseCatalogue, "目录删除成功");
|
||||
}else return R.failed("目录删除失败");
|
||||
} else {
|
||||
purchaseCatalogueService.removeById(oldPurchaseCatalogue);
|
||||
return R.ok(oldPurchaseCatalogue, "目录删除成功");
|
||||
if (oldPurchaseCatalogue.getStatus()==0&purchaseCatalogueService.removeById(oldPurchaseCatalogue)){
|
||||
return R.ok(oldPurchaseCatalogue, "目录删除成功");
|
||||
}else return R.failed("目录删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,16 +238,41 @@ public class PurchaseCatalogueController {
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审核采购目录", notes = "审核采购目录")
|
||||
@SysLog("审核采购目录")
|
||||
@PutMapping("/check")
|
||||
@SysLog("一级审核采购目录")
|
||||
@PutMapping("/primary/audit")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_edit')")
|
||||
public R<PurchaseCatalogue> checkCatalogue(@RequestBody AuditAndApproveDto auditAndApproveDto, HttpServletRequest theHttpServletRequest) {
|
||||
public R<PurchaseCatalogue> primaryAuditCatalogue(@RequestBody AuditAndApproveDTO auditAndApproveDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.checkCatalogue(auditAndApproveDto,dlpUser);
|
||||
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.primaryAuditCatalogue(auditAndApproveDto,dlpUser);
|
||||
|
||||
if (purchaseCatalogue!=null&purchaseCatalogueService.updateById(purchaseCatalogue)){
|
||||
return R.ok(purchaseCatalogue,"审核成功");
|
||||
}else {
|
||||
return R.failed("审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核采购目录
|
||||
*
|
||||
* @param auditAndApproveDto
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审核采购目录", notes = "审核采购目录")
|
||||
@SysLog("二级审核采购目录")
|
||||
@PutMapping("/secondary/audit")
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_edit')")
|
||||
public R<PurchaseCatalogue> secondaryAuditCatalogue(@RequestBody AuditAndApproveDTO auditAndApproveDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.secondaryAuditCatalogue(auditAndApproveDto,dlpUser);
|
||||
|
||||
if (purchaseCatalogue!=null&purchaseCatalogueService.updateById(purchaseCatalogue)){
|
||||
return R.ok(purchaseCatalogue,"审核成功");
|
||||
|
||||
+19
-10
@@ -7,8 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.reagent.dto.PurchaseListDTO;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaseList;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaseListDetails;
|
||||
import digital.laboratory.platform.reagent.service.PurchaseListService;
|
||||
import digital.laboratory.platform.reagent.vo.PurchaseListVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -20,6 +23,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.Principal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购清单)
|
||||
@@ -49,14 +53,16 @@ public class PurchaseListController {
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{purchaseListId}" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchase_list_get')" )
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_get')" )
|
||||
public R<PurchaseList> getById(@PathVariable("purchaseListId" ) String purchaseListId, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchaseList purchaseList = purchaseListService.getById(purchaseListId);
|
||||
PurchaseListVO purchaseList = purchaseListService.getPurchaseList(purchaseListId);
|
||||
|
||||
return R.ok(purchaseList);
|
||||
//return R.ok(purchaseListService.getById(purchaseListId));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,23 +89,26 @@ public class PurchaseListController {
|
||||
|
||||
/**
|
||||
* 新增(采购清单)
|
||||
* @param purchaseList (采购清单)
|
||||
* @param purchaseListDTOList (采购清单)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增(采购清单)", notes = "新增(采购清单)")
|
||||
@SysLog("新增(采购清单)" )
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchase_list_add')" )
|
||||
public R<PurchaseList> postAddObject(@RequestBody PurchaseList purchaseList, HttpServletRequest theHttpServletRequest) {
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_add')" )
|
||||
public R<PurchaseList> postAddObject(@RequestBody List<PurchaseListDTO> purchaseListDTOList, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
purchaseList.setPurchaseListId(IdWorker.get32UUID().toUpperCase());
|
||||
if (purchaseListService.save(purchaseList)) {
|
||||
return R.ok(purchaseList, "对象创建成功");
|
||||
PurchaseList purchaseList = new PurchaseList();
|
||||
|
||||
if (purchaseListService.addListById(purchaseListDTOList, purchaseList)!=null) {
|
||||
return R.ok(purchaseList, "创建成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(purchaseList, "对象创建失败");
|
||||
return R.failed(purchaseList, "创建失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+14
-16
@@ -7,8 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import digital.laboratory.platform.common.core.util.R;
|
||||
import digital.laboratory.platform.common.log.annotation.SysLog;
|
||||
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaselistDetails;
|
||||
import digital.laboratory.platform.reagent.service.PurchaselistDetailsService;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaseListDetails;
|
||||
import digital.laboratory.platform.reagent.service.PurchaseListDetailsService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -17,8 +17,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -38,9 +36,9 @@ import java.security.Principal;
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/purchaselist_details" )
|
||||
@Api(value = "purchaselist_details", tags = "(采购清单明细)管理")
|
||||
public class PurchaselistDetailsController {
|
||||
public class PurchaseListDetailsController {
|
||||
|
||||
private final PurchaselistDetailsService purchaselistDetailsService;
|
||||
private final PurchaseListDetailsService purchaselistDetailsService;
|
||||
|
||||
/**
|
||||
* 通过id查询(采购清单明细)
|
||||
@@ -50,11 +48,11 @@ public class PurchaselistDetailsController {
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{purchaselistDetailsId}" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchaselist_details_get')" )
|
||||
public R<PurchaselistDetails> getById(@PathVariable("purchaselistDetailsId" ) String purchaselistDetailsId, HttpServletRequest theHttpServletRequest) {
|
||||
public R<PurchaseListDetails> getById(@PathVariable("purchaselistDetailsId" ) String purchaselistDetailsId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchaselistDetails purchaselistDetails = purchaselistDetailsService.getById(purchaselistDetailsId);
|
||||
PurchaseListDetails purchaselistDetails = purchaselistDetailsService.getById(purchaselistDetailsId);
|
||||
return R.ok(purchaselistDetails);
|
||||
//return R.ok(purchaselistDetailsService.getById(purchaselistDetailsId));
|
||||
}
|
||||
@@ -68,11 +66,11 @@ public class PurchaselistDetailsController {
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchaselist_details_get')" )
|
||||
public R<IPage<PurchaselistDetails>> getPurchaselistDetailsPage(Page<PurchaselistDetails> page, PurchaselistDetails purchaselistDetails, HttpServletRequest theHttpServletRequest) {
|
||||
public R<IPage<PurchaseListDetails>> getPurchaselistDetailsPage(Page<PurchaseListDetails> page, PurchaseListDetails purchaselistDetails, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<PurchaselistDetails> purchaselistDetailsSList = purchaselistDetailsService.page(page, Wrappers.<PurchaselistDetails>query()
|
||||
IPage<PurchaseListDetails> purchaselistDetailsSList = purchaselistDetailsService.page(page, Wrappers.<PurchaseListDetails>query()
|
||||
.eq("create_by", dlpUser.getId())
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
@@ -90,7 +88,7 @@ public class PurchaselistDetailsController {
|
||||
@SysLog("新增(采购清单明细)" )
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchaselist_details_add')" )
|
||||
public R<PurchaselistDetails> postAddObject(@RequestBody PurchaselistDetails purchaselistDetails, HttpServletRequest theHttpServletRequest) {
|
||||
public R<PurchaseListDetails> postAddObject(@RequestBody PurchaseListDetails purchaselistDetails, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
@@ -112,7 +110,7 @@ public class PurchaselistDetailsController {
|
||||
@SysLog("修改(采购清单明细)" )
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchaselist_details_edit')" )
|
||||
public R<PurchaselistDetails> putUpdateById(@RequestBody PurchaselistDetails purchaselistDetails, HttpServletRequest theHttpServletRequest) {
|
||||
public R<PurchaseListDetails> putUpdateById(@RequestBody PurchaseListDetails purchaselistDetails, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
@@ -133,17 +131,17 @@ public class PurchaselistDetailsController {
|
||||
@SysLog("通过id删除(采购清单明细)" )
|
||||
@DeleteMapping("/{purchaselistDetailsId}" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchaselist_details_del')" )
|
||||
public R<PurchaselistDetails> deleteById(@PathVariable String purchaselistDetailsId, HttpServletRequest theHttpServletRequest) {
|
||||
public R<PurchaseListDetails> deleteById(@PathVariable String purchaselistDetailsId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchaselistDetails oldPurchaselistDetails = purchaselistDetailsService.getById(purchaselistDetailsId);
|
||||
PurchaseListDetails oldPurchaseListDetails = purchaselistDetailsService.getById(purchaselistDetailsId);
|
||||
|
||||
if (purchaselistDetailsService.removeById(purchaselistDetailsId)) {
|
||||
return R.ok(oldPurchaselistDetails, "对象删除成功");
|
||||
return R.ok(oldPurchaseListDetails, "对象删除成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(oldPurchaselistDetails, "对象删除失败");
|
||||
return R.failed(oldPurchaseListDetails, "对象删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
+216
-79
@@ -1,15 +1,18 @@
|
||||
package digital.laboratory.platform.reagent.controller;
|
||||
|
||||
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;
|
||||
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.PurchasingPlanDTO;
|
||||
import digital.laboratory.platform.reagent.entity.ProcurementContent;
|
||||
import digital.laboratory.platform.reagent.entity.PurchasingPlan;
|
||||
import digital.laboratory.platform.reagent.service.PurchasingPlanService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -17,135 +20,269 @@ 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.List;
|
||||
|
||||
/**
|
||||
* (采购计划)
|
||||
*
|
||||
* @author Zhang Xiaolong created at 2023-03-10
|
||||
* @describe (采购计划) 前端控制器
|
||||
*
|
||||
* <p>
|
||||
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
|
||||
* 这里写什么:
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 为前端提供数据, 接受前端的数据
|
||||
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
|
||||
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
|
||||
* 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/purchasing_plan" )
|
||||
@Api(value = "purchasing_plan", tags = "(采购计划)管理")
|
||||
@RequestMapping("/purchasing_plan")
|
||||
@Api(value = "purchasing_plan", tags = "采购计划管理")
|
||||
public class PurchasingPlanController {
|
||||
|
||||
private final PurchasingPlanService purchasingPlanService;
|
||||
@Autowired
|
||||
private final PurchasingPlanService purchasingPlanService;
|
||||
|
||||
/**
|
||||
* 通过id查询(采购计划)
|
||||
* @param purchasingPlanId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{purchasingPlanId}" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')" )
|
||||
public R<PurchasingPlan> getById(@PathVariable("purchasingPlanId" ) String purchasingPlanId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
/**
|
||||
* 通过id查询(采购计划)
|
||||
*
|
||||
* @param purchasingPlanId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{purchasingPlanId}")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')")
|
||||
public R<PurchasingPlan> getById(@PathVariable("purchasingPlanId") String purchasingPlanId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchasingPlan purchasingPlan = purchasingPlanService.getById(purchasingPlanId);
|
||||
return R.ok(purchasingPlan);
|
||||
//return R.ok(purchasingPlanService.getById(purchasingPlanId));
|
||||
}
|
||||
PurchasingPlanVO purchasingPlanVO = purchasingPlanService.getPurchasingPlanVO(purchasingPlanId);
|
||||
return R.ok(purchasingPlanVO);
|
||||
//return R.ok(purchasingPlanService.getById(purchasingPlanId));
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param purchasingPlan (采购计划)
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')" )
|
||||
public R<IPage<PurchasingPlan>> getPurchasingPlanPage(Page<PurchasingPlan> page, PurchasingPlan purchasingPlan, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_get')")
|
||||
public R<IPage<PurchasingPlanVO>> getPurchasingPlanPage(Page<PurchasingPlan> page, PurchasingPlan purchasingPlan, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
IPage<PurchasingPlan> purchasingPlanSList = purchasingPlanService.page(page, Wrappers.<PurchasingPlan>query()
|
||||
.eq("create_by", dlpUser.getId())
|
||||
.orderByDesc("create_time")
|
||||
);
|
||||
return R.ok(purchasingPlanSList);
|
||||
// return R.ok(purchasingPlanService.page(page, Wrappers.query(purchasingPlan)));
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
IPage<PurchasingPlanVO> purchasingPlanVOPage = purchasingPlanService.getPurchasingPlanVOPage(page, Wrappers.<PurchasingPlan>query()
|
||||
.eq("create_by", dlpUser.getId())
|
||||
.orderByDesc("create_time"));
|
||||
|
||||
return R.ok(purchasingPlanVOPage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增(采购计划)
|
||||
* @param purchasingPlan (采购计划)
|
||||
*
|
||||
* @param purchasingPlanDTOList (采购计划)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增(采购计划)", notes = "新增(采购计划)")
|
||||
@SysLog("新增(采购计划)" )
|
||||
@SysLog("新增(采购计划)")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_add')" )
|
||||
public R<PurchasingPlan> postAddObject(@RequestBody PurchasingPlan purchasingPlan, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_add')" )
|
||||
public R<PurchasingPlan> postAddObject(@RequestBody List<PurchasingPlanDTO> purchasingPlanDTOList, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
PurchasingPlan purchasingPlan = new PurchasingPlan();
|
||||
|
||||
purchasingPlan.setPurchasingPlanId(IdWorker.get32UUID().toUpperCase());
|
||||
if (purchasingPlanService.save(purchasingPlan)) {
|
||||
return R.ok(purchasingPlan, "对象创建成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(purchasingPlan, "对象创建失败");
|
||||
}
|
||||
if (purchasingPlanService.addById(purchasingPlanDTOList, dlpUser, purchasingPlan)) {
|
||||
return R.ok(purchasingPlan, "保存成功");
|
||||
} else {
|
||||
return R.failed("保存失败");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改(采购计划)
|
||||
* @param purchasingPlan (采购计划)
|
||||
* 修改采购计划明细
|
||||
*
|
||||
* @param purchasingPlanDTO (采购计划)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改(采购计划)", notes = "修改(采购计划)")
|
||||
@SysLog("修改(采购计划)" )
|
||||
@ApiOperation(value = "修改采购计划明细", notes = "修改采购计划明细")
|
||||
@SysLog("修改(采购计划)")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_edit')" )
|
||||
public R<PurchasingPlan> putUpdateById(@RequestBody PurchasingPlan purchasingPlan, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_edit')")
|
||||
public R<ProcurementContent> putUpdateById(@RequestBody PurchasingPlanDTO purchasingPlanDTO, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
if (purchasingPlanService.updateById(purchasingPlan)) {
|
||||
return R.ok(purchasingPlan, "保存对象成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(purchasingPlan, "保存对象失败");
|
||||
}
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
ProcurementContent procurementContent = purchasingPlanService.editById(purchasingPlanDTO);
|
||||
|
||||
if (procurementContent != null) {
|
||||
return R.ok(procurementContent,"修改成功");
|
||||
} else {
|
||||
return R.failed("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除(采购计划)
|
||||
*
|
||||
* @param purchasingPlanId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除(采购计划)", notes = "通过id删除(采购计划)")
|
||||
@SysLog("通过id删除(采购计划)" )
|
||||
@DeleteMapping("/{purchasingPlanId}" )
|
||||
@PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_del')" )
|
||||
public R<PurchasingPlan> deleteById(@PathVariable String purchasingPlanId, HttpServletRequest theHttpServletRequest) {
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
@SysLog("通过id删除(采购计划)")
|
||||
@DeleteMapping("/{purchasingPlanId}")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_del')")
|
||||
public R<String> deleteById(@PathVariable String purchasingPlanId, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
PurchasingPlan oldPurchasingPlan = purchasingPlanService.getById(purchasingPlanId);
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
if (purchasingPlanService.removeById(purchasingPlanId)) {
|
||||
return R.ok(oldPurchasingPlan, "对象删除成功");
|
||||
}
|
||||
else {
|
||||
return R.failed(oldPurchasingPlan, "对象删除失败");
|
||||
}
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
if (purchasingPlanService.delById(purchasingPlanId)) {
|
||||
return R.ok("删除成功");
|
||||
} else {
|
||||
return R.failed("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除采购计划明细
|
||||
*
|
||||
* @param procurementContentId id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除采购计划明细", notes = "通过id删除采购计划明细")
|
||||
@SysLog("通过id删除采购计划明细")
|
||||
@DeleteMapping("content/{procurementContentId}")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_del')")
|
||||
public R<String> deleteContentById(@PathVariable String procurementContentId, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
if (purchasingPlanService.delContentById(procurementContentId)) {
|
||||
return R.ok("移除成功");
|
||||
} else {
|
||||
return R.failed("移除失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交采购计划
|
||||
*
|
||||
* @param purchasingPlanId (采购计划)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "提交采购计划", notes = "提交采购计划")
|
||||
@SysLog("修改(采购计划)")
|
||||
@PutMapping("/commit/{purchasingPlanId}")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_edit')")
|
||||
public R<PurchasingPlan> commitById(@PathVariable String purchasingPlanId, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchasingPlan purchasingPlan = purchasingPlanService.commitById(purchasingPlanId);
|
||||
|
||||
if (purchasingPlan != null) {
|
||||
return R.ok(purchasingPlan,"提交成功");
|
||||
} else {
|
||||
return R.failed("提交失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核采购计划
|
||||
*
|
||||
* @param auditAndApproveDto (采购计划)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审核采购计划", notes = "审核采购计划")
|
||||
@SysLog("修改(采购计划)")
|
||||
@PutMapping("/audit")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_edit')")
|
||||
public R<PurchasingPlan> auditById(@RequestBody AuditAndApproveDTO auditAndApproveDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchasingPlan purchasingPlan = purchasingPlanService.auditById(auditAndApproveDto,dlpUser);
|
||||
|
||||
if (purchasingPlan != null) {
|
||||
return R.ok(purchasingPlan,"审核成功");
|
||||
} else {
|
||||
return R.failed("审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批采购计划
|
||||
*
|
||||
* @param auditAndApproveDto (采购计划)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "审批采购计划", notes = "审批采购计划")
|
||||
@SysLog("修改(采购计划)")
|
||||
@PutMapping("/approve")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_edit')")
|
||||
public R<PurchasingPlan> approveById(@RequestBody AuditAndApproveDTO auditAndApproveDto, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchasingPlan purchasingPlan = purchasingPlanService.approveById(auditAndApproveDto,dlpUser);
|
||||
|
||||
if (purchasingPlan != null) {
|
||||
return R.ok(purchasingPlan,"审批成功");
|
||||
} else {
|
||||
return R.failed("审批失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布采购计划
|
||||
*
|
||||
* @param purchasingPlanId (采购计划)
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "发布采购计划", notes = "发布采购计划")
|
||||
@SysLog("修改(采购计划)")
|
||||
@PutMapping("/release")
|
||||
// @PreAuthorize("@pms.hasPermission('reagent_purchasing_plan_edit')")
|
||||
public R<PurchasingPlan> releaseById(@PathVariable String purchasingPlanId, HttpServletRequest theHttpServletRequest) {
|
||||
|
||||
Principal principal = theHttpServletRequest.getUserPrincipal();
|
||||
|
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
|
||||
|
||||
PurchasingPlan purchasingPlan = purchasingPlanService.releaseById(purchasingPlanId);
|
||||
|
||||
if (purchasingPlan != null) {
|
||||
return R.ok(purchasingPlan,"发布成功");
|
||||
} else {
|
||||
return R.failed("发布失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AuditAndApproveDto {
|
||||
public class AuditAndApproveDTO {
|
||||
|
||||
private String uuId;
|
||||
|
||||
+1
-4
@@ -1,8 +1,5 @@
|
||||
package digital.laboratory.platform.reagent.dto;
|
||||
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
||||
import digital.laboratory.platform.reagent.entity.CentralizedRequest;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -11,7 +8,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CentralizedRequestDto {
|
||||
public class CentralizedRequestDTO {
|
||||
|
||||
private String centralizedRequestId;
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PurchaseCatalogueDto {
|
||||
public class PurchaseCatalogueDTO {
|
||||
|
||||
private String brand;
|
||||
|
||||
@@ -57,8 +57,8 @@ public class CentralizedRequest extends BaseEntity {
|
||||
/**
|
||||
* (部门负责人ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(部门负责人ID)")
|
||||
private String headOfDepartmentId;
|
||||
@ApiModelProperty(value="(审核人ID)")
|
||||
private String auditorId;
|
||||
|
||||
/**
|
||||
* 采购计划ID
|
||||
|
||||
@@ -65,7 +65,7 @@ public class DecentralizeDetails extends BaseEntity {
|
||||
* (数量)
|
||||
*/
|
||||
@ApiModelProperty(value="(数量)")
|
||||
private String quantity;
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* (试剂耗材ID)
|
||||
@@ -103,15 +103,11 @@ public class DecentralizeDetails extends BaseEntity {
|
||||
@ApiModelProperty(value="单价")
|
||||
private Double unitPrice;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* (用途)
|
||||
*/
|
||||
@ApiModelProperty(value="(用途)")
|
||||
private String use;
|
||||
private String purpose;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+46
-46
@@ -33,74 +33,74 @@ public class DecentralizedRequest extends BaseEntity {
|
||||
/**
|
||||
* (主任审批意见)
|
||||
*/
|
||||
@ApiModelProperty(value="(主任审批意见)")
|
||||
@ApiModelProperty(value="(审批意见)")
|
||||
private String opinionOfApproval;
|
||||
|
||||
/**
|
||||
* (主任审批结果)
|
||||
* (审批结果)
|
||||
*/
|
||||
@ApiModelProperty(value="(主任审批结果)")
|
||||
@ApiModelProperty(value="(审批结果)")
|
||||
private String resultOfApproval;
|
||||
|
||||
/**
|
||||
* (主任审批时间)
|
||||
* (审批时间)
|
||||
*/
|
||||
@ApiModelProperty(value="(主任审批时间)")
|
||||
@ApiModelProperty(value="(审批时间)")
|
||||
private LocalDateTime approvalOfTime;
|
||||
|
||||
/**
|
||||
* (部门负责人审核意见)
|
||||
* (一级审核意见)
|
||||
*/
|
||||
@ApiModelProperty(value="(部门负责人审核意见)")
|
||||
private String auditOpinionOfDepartment;
|
||||
@ApiModelProperty(value="(一级审核意见)")
|
||||
private String auditOpinionOfPrimary;
|
||||
|
||||
/**
|
||||
* (质量负责人审核意见)
|
||||
* (二级审核意见)
|
||||
*/
|
||||
@ApiModelProperty(value="(质量负责人审核意见)")
|
||||
private String auditOpinionOfQuality;
|
||||
@ApiModelProperty(value="(二级审核意见)")
|
||||
private String auditOpinionOfSecondary;
|
||||
|
||||
/**
|
||||
* (技术负责人审核意见)
|
||||
* (三级审核意见)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人审核意见)")
|
||||
private String auditOpinionOfTechnical;
|
||||
@ApiModelProperty(value="(三级审核意见)")
|
||||
private String auditOpinionOfThreeLevel;
|
||||
|
||||
/**
|
||||
* (部门负责人审核结果)
|
||||
* (一级审核结果)
|
||||
*/
|
||||
@ApiModelProperty(value="(部门负责人审核结果)")
|
||||
private String auditResultOfDepartment;
|
||||
@ApiModelProperty(value="(一级审核结果)")
|
||||
private String auditResultOfPrimary;
|
||||
|
||||
/**
|
||||
* (质量负责人审核结果)
|
||||
* (二级审核结果)
|
||||
*/
|
||||
@ApiModelProperty(value="(质量负责人审核结果)")
|
||||
private String auditResultOfQuality;
|
||||
@ApiModelProperty(value="(二级审核结果)")
|
||||
private String auditResultOfSecondary;
|
||||
|
||||
/**
|
||||
* (技术负责人审核结果)
|
||||
* (三级审核结果)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人审核结果)")
|
||||
private String auditResultOfTechnical;
|
||||
@ApiModelProperty(value="(三级审核结果)")
|
||||
private String auditResultOfThreeLevel;
|
||||
|
||||
/**
|
||||
* (部门负责人审核时间)
|
||||
* (一级审核时间)
|
||||
*/
|
||||
@ApiModelProperty(value="(部门负责人审核时间)")
|
||||
private LocalDateTime auditTimeOfDepartment;
|
||||
@ApiModelProperty(value="(一级审核时间)")
|
||||
private LocalDateTime auditTimeOfPrimary;
|
||||
|
||||
/**
|
||||
* (质量负责人审核时间)
|
||||
* (二级审核时间)
|
||||
*/
|
||||
@ApiModelProperty(value="(质量负责人审核时间)")
|
||||
private LocalDateTime auditTimeOfQuality;
|
||||
@ApiModelProperty(value="(二级审核时间)")
|
||||
private LocalDateTime auditTimeOfSecondary;
|
||||
|
||||
/**
|
||||
* (技术负责人审核时间)
|
||||
* (三级审核时间)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人审核时间)")
|
||||
private LocalDateTime auditTimeOfTechnical;
|
||||
@ApiModelProperty(value="(三级审核时间)")
|
||||
private LocalDateTime auditTimeOfThreeLevel;
|
||||
|
||||
/**
|
||||
* (需要符合性检验)
|
||||
@@ -112,19 +112,19 @@ public class DecentralizedRequest extends BaseEntity {
|
||||
* (申请日期)
|
||||
*/
|
||||
@ApiModelProperty(value="(申请日期)")
|
||||
private String dateOfApplication;
|
||||
private LocalDateTime dateOfApplication;
|
||||
|
||||
/**
|
||||
* (主任ID)
|
||||
* (审批人ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(主任ID)")
|
||||
private String directorId;
|
||||
@ApiModelProperty(value="(审批人ID)")
|
||||
private String approverId;
|
||||
|
||||
/**
|
||||
* (部门负责人ID)
|
||||
* (一级审核人ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(部门负责人ID)")
|
||||
private String headOfDepartmentId;
|
||||
@ApiModelProperty(value="(一级审核人ID)")
|
||||
private String primaryAuditorId;
|
||||
|
||||
/**
|
||||
* decentralizedRequestId
|
||||
@@ -140,26 +140,26 @@ public class DecentralizedRequest extends BaseEntity {
|
||||
private String purchaseListId;
|
||||
|
||||
/**
|
||||
* (质量负责人ID)
|
||||
* (二级审核人ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(质量负责人ID)")
|
||||
private String qualitySupervisorId;
|
||||
@ApiModelProperty(value="(二级审核人ID)")
|
||||
private String secondaryAuditorId;
|
||||
|
||||
/**
|
||||
* (提交状态)
|
||||
*/
|
||||
@ApiModelProperty(value="(提交状态)")
|
||||
private String status;
|
||||
private Integer status;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* (技术负责人ID)
|
||||
* (三级审核人ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人ID)")
|
||||
private String technicalDirectorId;
|
||||
@ApiModelProperty(value="(三级审核人ID)")
|
||||
private String threeLevelAuditId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -34,7 +36,7 @@ public class ProcurementContent extends BaseEntity {
|
||||
* (数量)
|
||||
*/
|
||||
@ApiModelProperty(value="(数量)")
|
||||
private String quantity;
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* (试剂耗材ID)
|
||||
@@ -46,7 +48,7 @@ public class ProcurementContent extends BaseEntity {
|
||||
* (小计)
|
||||
*/
|
||||
@ApiModelProperty(value="(小计)")
|
||||
private String subtotal;
|
||||
private Double subtotal;
|
||||
|
||||
/**
|
||||
* (单价)
|
||||
|
||||
@@ -27,44 +27,44 @@ public class PurchaseCatalogue extends BaseEntity {
|
||||
/**
|
||||
* (质量负责人审核意见)
|
||||
*/
|
||||
@ApiModelProperty(value="(质量负责人审核意见)")
|
||||
private String auditOpinionOfQuality;
|
||||
@ApiModelProperty(value="(一级审核意见)")
|
||||
private String auditOpinionOfPrimary;
|
||||
|
||||
/**
|
||||
* (技术负责人审核意见)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人审核意见)")
|
||||
private String auditOpinionOfTechnical;
|
||||
@ApiModelProperty(value="(二级审核意见)")
|
||||
private String auditOpinionOfSecondary;
|
||||
|
||||
/**
|
||||
* (质量负责人审核结果)
|
||||
*/
|
||||
@ApiModelProperty(value="(质量负责人审核结果)")
|
||||
private String auditResultOfQuality;
|
||||
@ApiModelProperty(value="(一级审核结果)")
|
||||
private String auditResultOfPrimary;
|
||||
|
||||
/**
|
||||
* (技术负责人审核结果)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人审核结果)")
|
||||
private String auditResultOfTechnical;
|
||||
@ApiModelProperty(value="(二级审核结果)")
|
||||
private String auditResultOfSecondary;
|
||||
|
||||
/**
|
||||
* (质量负责人审核时间)
|
||||
*/
|
||||
@ApiModelProperty(value="(质量负责人审核时间)")
|
||||
private LocalDateTime auditTimeOfQuality;
|
||||
@ApiModelProperty(value="(一级审核时间)")
|
||||
private LocalDateTime auditTimeOfPrimary;
|
||||
|
||||
/**
|
||||
* (技术负责人审核时间)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人审核时间)")
|
||||
private LocalDateTime auditTimeOfTechnical;
|
||||
@ApiModelProperty(value="(二级审核时间)")
|
||||
private LocalDateTime auditTimeOfSecondary;
|
||||
|
||||
/**
|
||||
* (质量负责人ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(质量负责人ID)")
|
||||
private String qualitySupervisorId;
|
||||
@ApiModelProperty(value="(一级审核人ID)")
|
||||
private String primaryAuditorId;
|
||||
|
||||
/**
|
||||
* 发布日期
|
||||
@@ -79,14 +79,11 @@ public class PurchaseCatalogue extends BaseEntity {
|
||||
private Integer status;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* (技术负责人ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人ID)")
|
||||
private String technicalDirectorId;
|
||||
@ApiModelProperty(value="(二级审核人ID)")
|
||||
private String secondaryAuditorId;
|
||||
|
||||
/**
|
||||
* purchaseCatalogueId
|
||||
|
||||
+3
-11
@@ -6,8 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
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.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -22,13 +20,7 @@ import lombok.EqualsAndHashCode;
|
||||
@TableName(value = "purchaselist_details", autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "(采购清单明细)")
|
||||
public class PurchaselistDetails extends BaseEntity {
|
||||
|
||||
/**
|
||||
* (采购目录编号)
|
||||
*/
|
||||
@ApiModelProperty(value="(采购目录编号)")
|
||||
private String purchaseCatalogueNumber;
|
||||
public class PurchaseListDetails extends BaseEntity {
|
||||
|
||||
/**
|
||||
* (采购清单ID)·
|
||||
@@ -46,13 +38,13 @@ public class PurchaselistDetails extends BaseEntity {
|
||||
* (试剂耗材ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(试剂耗材ID)")
|
||||
private String peagentConsumableId;
|
||||
private String reagentConsumableId;
|
||||
|
||||
/**
|
||||
* (备注)
|
||||
*/
|
||||
@ApiModelProperty(value="(备注)")
|
||||
private String pemarks;
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* (供应商ID)
|
||||
@@ -31,66 +31,54 @@ public class PurchasingPlan extends BaseEntity {
|
||||
private String appropriationBudget;
|
||||
|
||||
/**
|
||||
* (主任审批意见)
|
||||
* (制定人)
|
||||
*/
|
||||
@ApiModelProperty(value="(主任审批意见)")
|
||||
@ApiModelProperty(value="(制定人)")
|
||||
private String CreateId;
|
||||
|
||||
|
||||
/**
|
||||
* (审批意见)
|
||||
*/
|
||||
@ApiModelProperty(value="(审批意见)")
|
||||
private String approvalOpinion;
|
||||
|
||||
/**
|
||||
* (主任审批结果)
|
||||
* (审批结果)
|
||||
*/
|
||||
@ApiModelProperty(value="(主任审批结果)")
|
||||
@ApiModelProperty(value="(审批结果)")
|
||||
private String approvalResult;
|
||||
|
||||
/**
|
||||
* (主任审批时间)
|
||||
* (审批时间)
|
||||
*/
|
||||
@ApiModelProperty(value="(主任审批时间)")
|
||||
private String approvalTime;
|
||||
@ApiModelProperty(value="(审批时间)")
|
||||
private LocalDateTime approvalTime;
|
||||
|
||||
/**
|
||||
* (试剂耗材管理员审核意见)
|
||||
* (一级审核意见)
|
||||
*/
|
||||
@ApiModelProperty(value="(试剂耗材管理员审核意见)")
|
||||
private String auditOpinionOfManager;
|
||||
@ApiModelProperty(value="(一级审核意见)")
|
||||
private String auditOpinionOfPrimary;
|
||||
|
||||
/**
|
||||
* (技术负责人审核意见)
|
||||
* (一级审核结果)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人审核意见)")
|
||||
private String auditOpinionOfTechnical;
|
||||
@ApiModelProperty(value="(一级审核结果)")
|
||||
private String auditResultOfPrimary;
|
||||
|
||||
/**
|
||||
* (试剂耗材管理员审核结果)
|
||||
* (一级审核时间)
|
||||
*/
|
||||
@ApiModelProperty(value="(试剂耗材管理员审核结果)")
|
||||
private String auditResultOfManager;
|
||||
@ApiModelProperty(value="(一级审核时间)")
|
||||
private LocalDateTime auditTimeOfPrimary;
|
||||
|
||||
|
||||
/**
|
||||
* (技术负责人审核结果)
|
||||
* (审批人ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人审核结果)")
|
||||
private String auditResultOfTechnical;
|
||||
|
||||
/**
|
||||
* (试剂耗材管理员审核时间)
|
||||
*/
|
||||
@ApiModelProperty(value="(试剂耗材管理员审核时间)")
|
||||
private LocalDateTime auditTimeOfManager;
|
||||
|
||||
/**
|
||||
* (技术负责人审核时间)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人审核时间)")
|
||||
private LocalDateTime auditTimeOfTechnical;
|
||||
|
||||
/**
|
||||
* (主任ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(主任ID)")
|
||||
private String airectorId;
|
||||
|
||||
|
||||
@ApiModelProperty(value="(审批人ID)")
|
||||
private String approverId;
|
||||
|
||||
|
||||
|
||||
@@ -101,10 +89,10 @@ public class PurchasingPlan extends BaseEntity {
|
||||
private String purchaseListId;
|
||||
|
||||
/**
|
||||
* (试剂耗材管理员ID)
|
||||
* (一级审核人ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(试剂耗材管理员ID)")
|
||||
private String reagentSuppliesManagerId;
|
||||
@ApiModelProperty(value="(一级审核人ID)")
|
||||
private String primaryAuditorId;
|
||||
|
||||
/**
|
||||
* 发布日期
|
||||
@@ -118,12 +106,6 @@ public class PurchasingPlan extends BaseEntity {
|
||||
@ApiModelProperty(value="(状态)")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* (技术负责人ID)
|
||||
*/
|
||||
@ApiModelProperty(value="(技术负责人ID)")
|
||||
private String technicalDirectorId;
|
||||
|
||||
/**
|
||||
* purchasingPlanId
|
||||
*/
|
||||
|
||||
+5
@@ -2,9 +2,12 @@ package digital.laboratory.platform.reagent.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import digital.laboratory.platform.reagent.entity.DecentralizeDetails;
|
||||
import digital.laboratory.platform.reagent.vo.DecentralizeDetailsVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分散采购申请明细 Mapper 接口
|
||||
*
|
||||
@@ -14,4 +17,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface DecentralizeDetailsMapper extends BaseMapper<DecentralizeDetails> {
|
||||
|
||||
List<DecentralizeDetailsVO> getDecentralizeDetailsVOList (String decentralizedRequestId);
|
||||
|
||||
}
|
||||
|
||||
+16
@@ -1,10 +1,18 @@
|
||||
package digital.laboratory.platform.reagent.mapper;
|
||||
|
||||
import cn.hutool.db.Page;
|
||||
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.DecentralizedRequest;
|
||||
import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (分散采购申请) Mapper 接口
|
||||
*
|
||||
@@ -14,4 +22,12 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface DecentralizedRequestMapper extends BaseMapper<DecentralizedRequest> {
|
||||
|
||||
IPage<DecentralizedRequestVO> getDecentralizedRequestVOPage
|
||||
(@Param("page")IPage<DecentralizedRequest>page, @Param(Constants.WRAPPER) QueryWrapper<DecentralizedRequest> qw);
|
||||
|
||||
List<DecentralizedRequestVO> getDecentralizedRequestVOList(@Param(Constants.WRAPPER) QueryWrapper<DecentralizedRequest> qw);
|
||||
|
||||
DecentralizedRequestVO getDecentralizedRequest (String decentralizedRequestId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,9 +2,12 @@ package digital.laboratory.platform.reagent.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import digital.laboratory.platform.reagent.entity.ProcurementContent;
|
||||
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购内容) Mapper 接口
|
||||
*
|
||||
@@ -14,4 +17,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface ProcurementContentMapper extends BaseMapper<ProcurementContent> {
|
||||
|
||||
List<ProcurementContentVO> getProcurementContentVOList(String purchasingPlanId);
|
||||
|
||||
}
|
||||
|
||||
+6
-3
@@ -1,9 +1,10 @@
|
||||
package digital.laboratory.platform.reagent.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaselistDetails;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaseListDetails;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购清单明细) Mapper 接口
|
||||
@@ -12,6 +13,8 @@ import org.apache.ibatis.annotations.Param;
|
||||
* @describe (采购清单明细) Mapper 类
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurchaselistDetailsMapper extends BaseMapper<PurchaselistDetails> {
|
||||
public interface PurchaseListDetailsMapper extends BaseMapper<PurchaseListDetails> {
|
||||
|
||||
List<PurchaseListDetails> getPurchaseListDetailsVOList(String purchaseListId);
|
||||
|
||||
}
|
||||
@@ -1,9 +1,19 @@
|
||||
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.DecentralizedRequest;
|
||||
import digital.laboratory.platform.reagent.entity.PurchasingPlan;
|
||||
import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO;
|
||||
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购计划) Mapper 接口
|
||||
@@ -13,5 +23,10 @@ import org.apache.ibatis.annotations.Param;
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurchasingPlanMapper extends BaseMapper<PurchasingPlan> {
|
||||
IPage<PurchasingPlanVO> getPurchasingPlanVOPage(@Param("page") IPage<PurchasingPlan> page, @Param(Constants.WRAPPER) QueryWrapper<PurchasingPlan> qw);
|
||||
|
||||
List<PurchasingPlanVO> getPurchasingPlanVOList(@Param(Constants.WRAPPER) QueryWrapper<PurchasingPlan> qw);
|
||||
|
||||
PurchasingPlanVO getPurchasingPlanVO (String purchasingPlanId);
|
||||
|
||||
}
|
||||
|
||||
+6
-6
@@ -4,8 +4,8 @@ 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.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;
|
||||
@@ -19,17 +19,17 @@ import java.util.List;
|
||||
* @describe (集中采购申请) 服务类
|
||||
*/
|
||||
public interface CentralizedRequestService extends IService<CentralizedRequest> {
|
||||
List<DetailsOfCentralized> saveRequestById(CentralizedRequest centralizedRequest, List<CentralizedRequestDto> centralizedRequestDtoList, DLPUser dlpUser);
|
||||
List<DetailsOfCentralized> saveRequestById(CentralizedRequest centralizedRequest, List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser);
|
||||
|
||||
CentralizedRequest commit(String centralizedRequestId);
|
||||
|
||||
DetailsOfCentralized editDetails(CentralizedRequestDto centralizedRequestDto);
|
||||
DetailsOfCentralized editDetails(CentralizedRequestDTO centralizedRequestDto);
|
||||
|
||||
DetailsOfCentralized addDetails(CentralizedRequestDto centralizedRequestDto);
|
||||
DetailsOfCentralized addDetails(CentralizedRequestDTO centralizedRequestDto);
|
||||
|
||||
List<DetailsOfCentralized> delRequestById(String centralizedRequestId);
|
||||
|
||||
CentralizedRequest checkRequest(AuditAndApproveDto auditAndApproveDto, DLPUser dlpUser);
|
||||
CentralizedRequest checkRequest(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser);
|
||||
|
||||
IPage<CentralizedRequestVO> getCentralizedRequestVOPage(IPage<CentralizedRequest> page, QueryWrapper<CentralizedRequest> qw);
|
||||
|
||||
|
||||
+5
@@ -2,6 +2,9 @@ package digital.laboratory.platform.reagent.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import digital.laboratory.platform.reagent.entity.DecentralizeDetails;
|
||||
import digital.laboratory.platform.reagent.vo.DecentralizeDetailsVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分散采购申请明细服务类
|
||||
@@ -11,4 +14,6 @@ import digital.laboratory.platform.reagent.entity.DecentralizeDetails;
|
||||
*/
|
||||
public interface DecentralizeDetailsService extends IService<DecentralizeDetails> {
|
||||
|
||||
List<DecentralizeDetailsVO> getDecentralizeDetailsVOList (String decentralizedRequestId);
|
||||
|
||||
}
|
||||
|
||||
+33
@@ -1,7 +1,18 @@
|
||||
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.core.toolkit.Constants;
|
||||
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.DecentralizedRequestDTO;
|
||||
import digital.laboratory.platform.reagent.entity.DecentralizeDetails;
|
||||
import digital.laboratory.platform.reagent.entity.DecentralizedRequest;
|
||||
import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (分散采购申请)服务类
|
||||
@@ -11,4 +22,26 @@ import digital.laboratory.platform.reagent.entity.DecentralizedRequest;
|
||||
*/
|
||||
public interface DecentralizedRequestService extends IService<DecentralizedRequest> {
|
||||
|
||||
IPage<DecentralizedRequestVO> getDecentralizedRequestVOPage
|
||||
(@Param("page") IPage<DecentralizedRequest> page, @Param(Constants.WRAPPER) QueryWrapper<DecentralizedRequest> qw);
|
||||
|
||||
List<DecentralizedRequestVO> getDecentralizedRequestVOList(@Param(Constants.WRAPPER) QueryWrapper<DecentralizedRequest> qw);
|
||||
|
||||
DecentralizedRequestVO getRequestById(String decentralizedRequestId);
|
||||
|
||||
List<DecentralizeDetails> addRequest(List<DecentralizedRequestDTO> decentralizedRequestDTOList, DLPUser dlpUser, DecentralizedRequest decentralizedRequest);
|
||||
|
||||
//修改分散采购申请明细
|
||||
DecentralizeDetails editRequest(DecentralizedRequestDTO decentralizedRequestDTO);
|
||||
|
||||
List<DecentralizeDetails> delRequestById(String decentralizedRequestId);
|
||||
|
||||
//提交分散采购申请
|
||||
DecentralizedRequest commitRequest(String decentralizedRequestId);
|
||||
|
||||
DecentralizedRequest primaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto);
|
||||
DecentralizedRequest secondaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto);
|
||||
DecentralizedRequest threeLevelAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto);
|
||||
|
||||
DecentralizedRequest approveRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto);
|
||||
}
|
||||
|
||||
+5
@@ -2,6 +2,9 @@ package digital.laboratory.platform.reagent.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import digital.laboratory.platform.reagent.entity.ProcurementContent;
|
||||
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购内容)服务类
|
||||
@@ -11,4 +14,6 @@ import digital.laboratory.platform.reagent.entity.ProcurementContent;
|
||||
*/
|
||||
public interface ProcurementContentService extends IService<ProcurementContent> {
|
||||
|
||||
List<ProcurementContentVO> getProcurementContentVOList(String purchasingPlanId);
|
||||
|
||||
}
|
||||
|
||||
+7
-7
@@ -4,12 +4,10 @@ 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.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.CentralizedRequestVO;
|
||||
import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -22,9 +20,9 @@ import java.util.List;
|
||||
*/
|
||||
public interface PurchaseCatalogueService extends IService<PurchaseCatalogue> {
|
||||
|
||||
List<CatalogueDetails> addCatalogue(DLPUser dlpUser, List<PurchaseCatalogueDto> purchaseCatalogueDtoList, PurchaseCatalogue purchaseCatalogue);
|
||||
List<CatalogueDetails> addCatalogue(DLPUser dlpUser, List<PurchaseCatalogueDTO> purchaseCatalogueDTOList, PurchaseCatalogue purchaseCatalogue);
|
||||
|
||||
CatalogueDetails editCatalogue(PurchaseCatalogueDto purchaseCatalogueDto);
|
||||
CatalogueDetails editCatalogue(PurchaseCatalogueDTO purchaseCatalogueDto);
|
||||
List<CatalogueDetails> delCatalogue(String purchaseCatalogueId);
|
||||
|
||||
IPage<PurchaseCatalogueVO> getPurchaseCatalogueVOPage(IPage<PurchaseCatalogue> page, QueryWrapper<PurchaseCatalogue> qw);
|
||||
@@ -36,7 +34,9 @@ public interface PurchaseCatalogueService extends IService<PurchaseCatalogue> {
|
||||
|
||||
PurchaseCatalogue commitById(String purchaseCatalogueId);
|
||||
|
||||
PurchaseCatalogue checkCatalogue (AuditAndApproveDto auditAndApproveDto,DLPUser dlpUser);
|
||||
PurchaseCatalogue primaryAuditCatalogue (AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser);
|
||||
|
||||
PurchaseCatalogue secondaryAuditCatalogue(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser);
|
||||
|
||||
PurchaseCatalogue releaseCatalogue(String purchaseCatalogueId);
|
||||
}
|
||||
|
||||
+6
-2
@@ -1,7 +1,9 @@
|
||||
package digital.laboratory.platform.reagent.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaselistDetails;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaseListDetails;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购清单明细)服务类
|
||||
@@ -9,6 +11,8 @@ import digital.laboratory.platform.reagent.entity.PurchaselistDetails;
|
||||
* @author Zhang Xiaolong created at 2023-03-10
|
||||
* @describe (采购清单明细) 服务类
|
||||
*/
|
||||
public interface PurchaselistDetailsService extends IService<PurchaselistDetails> {
|
||||
public interface PurchaseListDetailsService extends IService<PurchaseListDetails> {
|
||||
|
||||
List<PurchaseListDetails> getPurchaseListDetailsVOList(String purchaseListId);
|
||||
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
package digital.laboratory.platform.reagent.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import digital.laboratory.platform.reagent.dto.PurchaseListDTO;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaseList;
|
||||
import digital.laboratory.platform.reagent.vo.PurchaseListVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购清单)服务类
|
||||
@@ -11,4 +15,9 @@ import digital.laboratory.platform.reagent.entity.PurchaseList;
|
||||
*/
|
||||
public interface PurchaseListService extends IService<PurchaseList> {
|
||||
|
||||
//
|
||||
PurchaseListVO getPurchaseList(String purchaseListId);
|
||||
|
||||
//
|
||||
PurchaseList addListById(List<PurchaseListDTO> purchaseListDTOList, PurchaseList purchaseList);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
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.core.toolkit.Constants;
|
||||
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.PurchasingPlanDTO;
|
||||
import digital.laboratory.platform.reagent.entity.ProcurementContent;
|
||||
import digital.laboratory.platform.reagent.entity.PurchasingPlan;
|
||||
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购计划)服务类
|
||||
@@ -11,4 +23,29 @@ import digital.laboratory.platform.reagent.entity.PurchasingPlan;
|
||||
*/
|
||||
public interface PurchasingPlanService extends IService<PurchasingPlan> {
|
||||
|
||||
IPage<PurchasingPlanVO> getPurchasingPlanVOPage(@Param("page") IPage<PurchasingPlan> page, @Param(Constants.WRAPPER) QueryWrapper<PurchasingPlan> qw);
|
||||
|
||||
List<PurchasingPlanVO> getPurchasingPlanVOList(@Param(Constants.WRAPPER) QueryWrapper<PurchasingPlan> qw);
|
||||
|
||||
PurchasingPlanVO getPurchasingPlanVO (String purchasingPlanId);
|
||||
|
||||
@Transactional
|
||||
Boolean addById(List<PurchasingPlanDTO> purchasingPlanDTOList, DLPUser user, PurchasingPlan purchasingPlan);
|
||||
|
||||
ProcurementContent addContent(PurchasingPlanDTO purchasingPlanDTO);
|
||||
|
||||
ProcurementContent editById(PurchasingPlanDTO purchasingPlanDTO);
|
||||
|
||||
@Transactional
|
||||
Boolean delById(String purchasingPlanId);
|
||||
|
||||
Boolean delContentById(String procurementContentId);
|
||||
|
||||
PurchasingPlan commitById(String purchasingPlanId);
|
||||
|
||||
PurchasingPlan auditById(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser);
|
||||
|
||||
PurchasingPlan approveById(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser);
|
||||
|
||||
PurchasingPlan releaseById(String purchasingPlanId);
|
||||
}
|
||||
|
||||
+10
-10
@@ -6,8 +6,8 @@ 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.CentralizedRequestDto;
|
||||
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.mapper.CentralizedRequestMapper;
|
||||
@@ -39,7 +39,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
|
||||
private DetailsOfCentralizedService detailsOfCentralizedService;
|
||||
|
||||
@Override
|
||||
public List<DetailsOfCentralized> saveRequestById(CentralizedRequest centralizedRequest, List<CentralizedRequestDto> centralizedRequestDtoList, DLPUser dlpUser) {
|
||||
public List<DetailsOfCentralized> saveRequestById(CentralizedRequest centralizedRequest, List<CentralizedRequestDTO> centralizedRequestDTOList, DLPUser dlpUser) {
|
||||
|
||||
centralizedRequest.setApplicantId(dlpUser.getId());
|
||||
|
||||
@@ -51,14 +51,14 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
|
||||
|
||||
List<DetailsOfCentralized> detailsOfCentralizedList = new ArrayList<>();
|
||||
//将DTO赋值给明细表
|
||||
for (CentralizedRequestDto centralizedRequestDto : centralizedRequestDtoList) {
|
||||
for (CentralizedRequestDTO centralizedRequestDto : centralizedRequestDTOList) {
|
||||
|
||||
DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized();
|
||||
|
||||
detailsOfCentralized.setDetailsOfCentralizedId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
BeanUtils.copyProperties(centralizedRequestDto, detailsOfCentralized);
|
||||
|
||||
detailsOfCentralized.setDetailsOfCentralizedId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
detailsOfCentralized.setCentralizedRequestId(centralizedRequest.getCentralizedRequestId());
|
||||
|
||||
detailsOfCentralizedList.add(detailsOfCentralized);
|
||||
@@ -94,7 +94,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
|
||||
}
|
||||
|
||||
@Override
|
||||
public DetailsOfCentralized editDetails(CentralizedRequestDto centralizedRequestDto) {
|
||||
public DetailsOfCentralized editDetails(CentralizedRequestDTO centralizedRequestDto) {
|
||||
|
||||
DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(centralizedRequestDto.getDetailsOfCentralizedId());
|
||||
|
||||
@@ -105,7 +105,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
|
||||
}
|
||||
|
||||
@Override
|
||||
public DetailsOfCentralized addDetails(CentralizedRequestDto centralizedRequestDto) {
|
||||
public DetailsOfCentralized addDetails(CentralizedRequestDTO centralizedRequestDto) {
|
||||
|
||||
DetailsOfCentralized detailsOfCentralized = new DetailsOfCentralized();
|
||||
|
||||
@@ -130,7 +130,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
|
||||
}
|
||||
|
||||
@Override
|
||||
public CentralizedRequest checkRequest(AuditAndApproveDto auditAndApproveDto, DLPUser dlpUser) {
|
||||
public CentralizedRequest checkRequest(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) {
|
||||
|
||||
CentralizedRequest centralizedRequest = centralizedRequestService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
@@ -140,7 +140,7 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
|
||||
|
||||
centralizedRequest.setAuditOpinion(auditAndApproveDto.getAuditOpinion());
|
||||
|
||||
centralizedRequest.setHeadOfDepartmentId(dlpUser.getId());
|
||||
centralizedRequest.setAuditorId(dlpUser.getId());
|
||||
|
||||
centralizedRequest.setAuditTime(LocalDateTime.now());
|
||||
|
||||
|
||||
+10
@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import digital.laboratory.platform.reagent.entity.DecentralizeDetails;
|
||||
import digital.laboratory.platform.reagent.mapper.DecentralizeDetailsMapper;
|
||||
import digital.laboratory.platform.reagent.service.DecentralizeDetailsService;
|
||||
import digital.laboratory.platform.reagent.vo.DecentralizeDetailsVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分散采购申请明细服务实现类
|
||||
*
|
||||
@@ -15,4 +18,11 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class DecentralizeDetailsServiceImpl extends ServiceImpl<DecentralizeDetailsMapper, DecentralizeDetails> implements DecentralizeDetailsService {
|
||||
|
||||
@Override
|
||||
public List<DecentralizeDetailsVO> getDecentralizeDetailsVOList(String decentralizedRequestId) {
|
||||
|
||||
List<DecentralizeDetailsVO> decentralizeDetailsVOList = baseMapper.getDecentralizeDetailsVOList(decentralizedRequestId);
|
||||
|
||||
return decentralizeDetailsVOList;
|
||||
}
|
||||
}
|
||||
|
||||
+185
@@ -1,11 +1,30 @@
|
||||
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.Constants;
|
||||
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.DecentralizedRequestDTO;
|
||||
import digital.laboratory.platform.reagent.entity.DecentralizeDetails;
|
||||
import digital.laboratory.platform.reagent.entity.DecentralizedRequest;
|
||||
import digital.laboratory.platform.reagent.mapper.DecentralizedRequestMapper;
|
||||
import digital.laboratory.platform.reagent.service.DecentralizeDetailsService;
|
||||
import digital.laboratory.platform.reagent.service.DecentralizedRequestService;
|
||||
import digital.laboratory.platform.reagent.vo.DecentralizeDetailsVO;
|
||||
import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
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;
|
||||
|
||||
/**
|
||||
* (分散采购申请)服务实现类
|
||||
*
|
||||
@@ -15,4 +34,170 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class DecentralizedRequestServiceImpl extends ServiceImpl<DecentralizedRequestMapper, DecentralizedRequest> implements DecentralizedRequestService {
|
||||
|
||||
@Autowired
|
||||
private DecentralizedRequestService decentralizedRequestService;
|
||||
@Autowired
|
||||
private DecentralizeDetailsService decentralizeDetailsService;
|
||||
|
||||
@Override//分散采购申请分页
|
||||
public IPage<DecentralizedRequestVO> getDecentralizedRequestVOPage
|
||||
(@Param("page") IPage<DecentralizedRequest> page, @Param(Constants.WRAPPER) QueryWrapper<DecentralizedRequest> qw) {
|
||||
|
||||
IPage<DecentralizedRequestVO> decentralizedRequestVOPage = baseMapper.getDecentralizedRequestVOPage(page, qw);
|
||||
|
||||
return decentralizedRequestVOPage;
|
||||
}
|
||||
|
||||
|
||||
@Override//分散采购申请列表
|
||||
public List<DecentralizedRequestVO> getDecentralizedRequestVOList(@Param(Constants.WRAPPER) QueryWrapper<DecentralizedRequest> qw) {
|
||||
|
||||
List<DecentralizedRequestVO> decentralizedRequestVOList = baseMapper.getDecentralizedRequestVOList(qw);
|
||||
|
||||
return decentralizedRequestVOList;
|
||||
}
|
||||
|
||||
@Override//通过ID查询分散采购申请
|
||||
public DecentralizedRequestVO getRequestById(String decentralizedRequestId) {
|
||||
|
||||
DecentralizedRequestVO decentralizedRequestVO = baseMapper.getDecentralizedRequest(decentralizedRequestId);
|
||||
|
||||
List<DecentralizeDetailsVO> decentralizeDetailsVOList = decentralizeDetailsService.getDecentralizeDetailsVOList(decentralizedRequestId);
|
||||
|
||||
decentralizedRequestVO.setDecentralizeDetailsVOList(decentralizeDetailsVOList);
|
||||
|
||||
return decentralizedRequestVO;
|
||||
}
|
||||
|
||||
@Override//创建分散采购申请
|
||||
public List<DecentralizeDetails> addRequest(List<DecentralizedRequestDTO> decentralizedRequestDTOList, DLPUser dlpUser, DecentralizedRequest decentralizedRequest) {
|
||||
|
||||
decentralizedRequest.setDecentralizedRequestId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
decentralizedRequest.setApplicantId(dlpUser.getId());
|
||||
|
||||
decentralizedRequest.setDateOfApplication(LocalDateTime.now());
|
||||
|
||||
decentralizedRequest.setStatus(0);
|
||||
|
||||
List<DecentralizeDetails> list = new ArrayList<>();
|
||||
//接受分散采购DTO,将其赋值给分散采购明细
|
||||
for (DecentralizedRequestDTO decentralizedRequestDTO : decentralizedRequestDTOList) {
|
||||
|
||||
DecentralizeDetails decentralizedDetails = new DecentralizeDetails();
|
||||
|
||||
BeanUtils.copyProperties(decentralizedRequestDTO, decentralizedDetails);
|
||||
|
||||
decentralizedDetails.setDecentralizeDetailsId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
decentralizedDetails.setDecentralizedRequestId(decentralizedRequest.getDecentralizedRequestId());
|
||||
|
||||
list.add(decentralizedDetails);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override//修改分散采购申请明细
|
||||
public DecentralizeDetails editRequest(DecentralizedRequestDTO decentralizedRequestDTO) {
|
||||
|
||||
DecentralizeDetails decentralizeDetails = decentralizeDetailsService.getById(decentralizedRequestDTO.getDecentralizeDetailsId());
|
||||
|
||||
BeanUtils.copyProperties(decentralizedRequestDTO, decentralizeDetails);
|
||||
|
||||
return decentralizeDetails;
|
||||
|
||||
}
|
||||
|
||||
@Override//删除分散采购申请
|
||||
public List<DecentralizeDetails> delRequestById(String decentralizedRequestId) {
|
||||
|
||||
LambdaQueryWrapper<DecentralizeDetails> decentralizeDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
decentralizeDetailsLambdaQueryWrapper.eq(DecentralizeDetails::getDecentralizedRequestId, decentralizedRequestId);
|
||||
|
||||
List<DecentralizeDetails> list = decentralizeDetailsService.list(decentralizeDetailsLambdaQueryWrapper);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override//提交分散采购申请
|
||||
public DecentralizedRequest commitRequest(String decentralizedRequestId) {
|
||||
|
||||
DecentralizedRequest decentralizedRequest = decentralizedRequestService.getById(decentralizedRequestId);
|
||||
|
||||
decentralizedRequest.setStatus(1);
|
||||
|
||||
return decentralizedRequest;
|
||||
}
|
||||
|
||||
@Override//一级审核
|
||||
public DecentralizedRequest primaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) {
|
||||
|
||||
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
byId.setPrimaryAuditorId(dlpUser.getId());
|
||||
|
||||
byId.setAuditResultOfPrimary(auditAndApproveDto.getAuditResult());
|
||||
|
||||
byId.setAuditOpinionOfPrimary(auditAndApproveDto.getAuditOpinion());
|
||||
|
||||
byId.setAuditTimeOfPrimary(LocalDateTime.now());
|
||||
|
||||
return byId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override//二级审核
|
||||
public DecentralizedRequest secondaryAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) {
|
||||
|
||||
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
byId.setSecondaryAuditorId(dlpUser.getId());
|
||||
|
||||
byId.setAuditResultOfSecondary(auditAndApproveDto.getAuditResult());
|
||||
|
||||
byId.setAuditOpinionOfSecondary(auditAndApproveDto.getAuditOpinion());
|
||||
|
||||
byId.setAuditTimeOfSecondary(LocalDateTime.now());
|
||||
|
||||
return byId;
|
||||
}
|
||||
|
||||
@Override//三级审核
|
||||
public DecentralizedRequest threeLevelAuditRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) {
|
||||
|
||||
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
byId.setThreeLevelAuditId(dlpUser.getId());
|
||||
|
||||
byId.setAuditResultOfThreeLevel(auditAndApproveDto.getAuditResult());
|
||||
|
||||
byId.setAuditOpinionOfThreeLevel(auditAndApproveDto.getAuditOpinion());
|
||||
|
||||
byId.setAuditTimeOfThreeLevel(LocalDateTime.now());
|
||||
|
||||
return byId;
|
||||
}
|
||||
|
||||
@Override//审批
|
||||
public DecentralizedRequest approveRequest(DLPUser dlpUser, AuditAndApproveDTO auditAndApproveDto) {
|
||||
|
||||
DecentralizedRequest byId = decentralizedRequestService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
byId.setApproverId(dlpUser.getId());
|
||||
|
||||
byId.setResultOfApproval(auditAndApproveDto.getApproveResult());
|
||||
|
||||
byId.setOpinionOfApproval(auditAndApproveDto.getApproveOpinion());
|
||||
|
||||
byId.setApprovalOfTime(LocalDateTime.now());
|
||||
|
||||
return byId;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+16
@@ -1,11 +1,17 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import digital.laboratory.platform.reagent.entity.ProcurementContent;
|
||||
import digital.laboratory.platform.reagent.mapper.ProcurementContentMapper;
|
||||
import digital.laboratory.platform.reagent.service.ProcurementContentService;
|
||||
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购内容)服务实现类
|
||||
*
|
||||
@@ -15,4 +21,14 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class ProcurementContentServiceImpl extends ServiceImpl<ProcurementContentMapper, ProcurementContent> implements ProcurementContentService {
|
||||
|
||||
@Autowired
|
||||
private ProcurementContentService procurementContentService;
|
||||
|
||||
@Override
|
||||
public List<ProcurementContentVO> getProcurementContentVOList(String purchasingPlanId) {
|
||||
|
||||
List<ProcurementContentVO> procurementContentVOList = baseMapper.getProcurementContentVOList(purchasingPlanId);
|
||||
|
||||
return procurementContentVOList;
|
||||
}
|
||||
}
|
||||
|
||||
+37
-15
@@ -6,8 +6,8 @@ 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.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;
|
||||
@@ -39,7 +39,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
|
||||
private CatalogueDetailsService catalogueDetailsService;
|
||||
|
||||
@Override
|
||||
public List<CatalogueDetails> addCatalogue(DLPUser dlpUser, List<PurchaseCatalogueDto> purchaseCatalogueDtoList, PurchaseCatalogue purchaseCatalogue) {
|
||||
public List<CatalogueDetails> addCatalogue(DLPUser dlpUser, List<PurchaseCatalogueDTO> purchaseCatalogueDTOList, PurchaseCatalogue purchaseCatalogue) {
|
||||
|
||||
purchaseCatalogue.setPurchaseCatalogueId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
@@ -47,14 +47,14 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
|
||||
|
||||
List<CatalogueDetails> catalogueDetailsList = new ArrayList<>();
|
||||
|
||||
for (PurchaseCatalogueDto purchaseCatalogueDto : purchaseCatalogueDtoList) {
|
||||
for (PurchaseCatalogueDTO purchaseCatalogueDto : purchaseCatalogueDTOList) {
|
||||
|
||||
CatalogueDetails catalogueDetails = new CatalogueDetails();
|
||||
|
||||
catalogueDetails.setCatalogueDetailsId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
BeanUtils.copyProperties(purchaseCatalogueDto, catalogueDetails);
|
||||
|
||||
catalogueDetails.setCatalogueDetailsId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
catalogueDetails.setPurchaseCatalogueId(purchaseCatalogue.getPurchaseCatalogueId());
|
||||
|
||||
catalogueDetailsList.add(catalogueDetails);
|
||||
@@ -64,7 +64,7 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
|
||||
|
||||
|
||||
@Override
|
||||
public CatalogueDetails editCatalogue(PurchaseCatalogueDto purchaseCatalogueDto) {
|
||||
public CatalogueDetails editCatalogue(PurchaseCatalogueDTO purchaseCatalogueDto) {
|
||||
|
||||
CatalogueDetails catalogueDetails = catalogueDetailsService.getById(purchaseCatalogueDto.getCatalogueDetailsId());
|
||||
|
||||
@@ -82,11 +82,12 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
|
||||
|
||||
List<CatalogueDetails> list = catalogueDetailsService.list(catalogueDetailsLambdaQueryWrapper);
|
||||
|
||||
if (list!=null){
|
||||
if (list != null) {
|
||||
|
||||
return list;
|
||||
}else {
|
||||
return null;}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,19 +150,40 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurchaseCatalogue checkCatalogue(AuditAndApproveDto auditAndApproveDto,DLPUser dlpUser) {
|
||||
public PurchaseCatalogue primaryAuditCatalogue(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) {
|
||||
|
||||
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
if (purchaseCatalogue != null) {
|
||||
|
||||
purchaseCatalogue.setAuditOpinionOfQuality(auditAndApproveDto.getAuditOpinion());
|
||||
purchaseCatalogue.setAuditOpinionOfPrimary(auditAndApproveDto.getAuditOpinion());
|
||||
|
||||
purchaseCatalogue.setAuditResultOfQuality(auditAndApproveDto.getAuditResult());
|
||||
purchaseCatalogue.setAuditResultOfPrimary(auditAndApproveDto.getAuditResult());
|
||||
|
||||
purchaseCatalogue.setQualitySupervisorId(dlpUser.getId());
|
||||
purchaseCatalogue.setPrimaryAuditorId(dlpUser.getId());
|
||||
|
||||
purchaseCatalogue.setAuditTimeOfQuality(LocalDateTime.now());
|
||||
purchaseCatalogue.setAuditTimeOfPrimary(LocalDateTime.now());
|
||||
|
||||
return purchaseCatalogue;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurchaseCatalogue secondaryAuditCatalogue(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) {
|
||||
|
||||
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
if (purchaseCatalogue != null) {
|
||||
|
||||
purchaseCatalogue.setAuditOpinionOfSecondary(auditAndApproveDto.getAuditOpinion());
|
||||
|
||||
purchaseCatalogue.setAuditResultOfSecondary(auditAndApproveDto.getAuditResult());
|
||||
|
||||
purchaseCatalogue.setSecondaryAuditorId(dlpUser.getId());
|
||||
|
||||
purchaseCatalogue.setAuditTimeOfSecondary(LocalDateTime.now());
|
||||
|
||||
purchaseCatalogue.setStatus(2);
|
||||
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaseListDetails;
|
||||
import digital.laboratory.platform.reagent.mapper.PurchaseListDetailsMapper;
|
||||
import digital.laboratory.platform.reagent.service.PurchaseListDetailsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购清单明细)服务实现类
|
||||
*
|
||||
* @author Zhang Xiaolong created at 2023-03-10
|
||||
* @describe (采购清单明细) 服务实现类
|
||||
*/
|
||||
@Service
|
||||
public class PurchaseListDetailsServiceImpl extends ServiceImpl<PurchaseListDetailsMapper, PurchaseListDetails> implements PurchaseListDetailsService {
|
||||
@Autowired
|
||||
private PurchaseListDetailsService purchaseListDetailsService;
|
||||
|
||||
@Override
|
||||
public List<PurchaseListDetails> getPurchaseListDetailsVOList(String purchaseListId) {
|
||||
|
||||
LambdaQueryWrapper<PurchaseListDetails> purchaseListDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
purchaseListDetailsLambdaQueryWrapper.eq(PurchaseListDetails::getPurchaseListId, purchaseListId);
|
||||
|
||||
List<PurchaseListDetails> list = purchaseListDetailsService.list(purchaseListDetailsLambdaQueryWrapper);
|
||||
|
||||
return list;
|
||||
|
||||
}
|
||||
}
|
||||
+60
@@ -1,10 +1,21 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import digital.laboratory.platform.reagent.dto.PurchaseListDTO;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaseList;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaseListDetails;
|
||||
import digital.laboratory.platform.reagent.mapper.PurchaseListMapper;
|
||||
import digital.laboratory.platform.reagent.service.PurchaseListDetailsService;
|
||||
import digital.laboratory.platform.reagent.service.PurchaseListService;
|
||||
import digital.laboratory.platform.reagent.vo.PurchaseListVO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购清单)服务实现类
|
||||
@@ -15,4 +26,53 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, PurchaseList> implements PurchaseListService {
|
||||
|
||||
@Autowired
|
||||
private PurchaseListService purchaseListService;
|
||||
@Autowired
|
||||
private PurchaseListDetailsService purchaseListDetailsService;
|
||||
|
||||
@Override//通过ID查找清单
|
||||
public PurchaseListVO getPurchaseList(String purchaseListId) {
|
||||
|
||||
PurchaseList byId = purchaseListService.getById(purchaseListId);
|
||||
|
||||
List<PurchaseListDetails> list = purchaseListDetailsService.getPurchaseListDetailsVOList(purchaseListId);
|
||||
|
||||
PurchaseListVO purchaseListVO = new PurchaseListVO();
|
||||
|
||||
BeanUtils.copyProperties(byId, purchaseListVO);
|
||||
|
||||
purchaseListVO.setPurchaseListDetailsList(list);
|
||||
|
||||
return purchaseListVO;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override//新增采购清单
|
||||
public PurchaseList addListById(List<PurchaseListDTO> purchaseListDTOList, PurchaseList purchaseList){
|
||||
|
||||
purchaseList.setPurchaseListId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
List<PurchaseListDetails> purchaseListDetailsList= new ArrayList<>();
|
||||
|
||||
for (PurchaseListDTO purchaseListDTO : purchaseListDTOList) {
|
||||
|
||||
PurchaseListDetails purchaseListDetails = new PurchaseListDetails();
|
||||
|
||||
BeanUtils.copyProperties(purchaseListDTO,purchaseListDetails);
|
||||
|
||||
purchaseListDetails.setPurchaseListId(purchaseList.getPurchaseListId());
|
||||
|
||||
purchaseListDetails.setPurchaselistDetailsId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
purchaseListDetailsList.add(purchaseListDetails);
|
||||
}
|
||||
if (purchaseListService.save(purchaseList)&purchaseListDetailsService.saveBatch(purchaseListDetailsList)){
|
||||
return purchaseList;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package digital.laboratory.platform.reagent.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import digital.laboratory.platform.reagent.entity.PurchaselistDetails;
|
||||
import digital.laboratory.platform.reagent.mapper.PurchaselistDetailsMapper;
|
||||
import digital.laboratory.platform.reagent.service.PurchaselistDetailsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* (采购清单明细)服务实现类
|
||||
*
|
||||
* @author Zhang Xiaolong created at 2023-03-10
|
||||
* @describe (采购清单明细) 服务实现类
|
||||
*/
|
||||
@Service
|
||||
public class PurchaselistDetailsServiceImpl extends ServiceImpl<PurchaselistDetailsMapper, PurchaselistDetails> implements PurchaselistDetailsService {
|
||||
|
||||
}
|
||||
+235
@@ -1,10 +1,28 @@
|
||||
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.PurchasingPlanDTO;
|
||||
import digital.laboratory.platform.reagent.entity.ProcurementContent;
|
||||
import digital.laboratory.platform.reagent.entity.PurchasingPlan;
|
||||
import digital.laboratory.platform.reagent.mapper.PurchasingPlanMapper;
|
||||
import digital.laboratory.platform.reagent.service.ProcurementContentService;
|
||||
import digital.laboratory.platform.reagent.service.PurchasingPlanService;
|
||||
import digital.laboratory.platform.reagent.vo.ProcurementContentVO;
|
||||
import digital.laboratory.platform.reagent.vo.PurchasingPlanVO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (采购计划)服务实现类
|
||||
@@ -15,4 +33,221 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class PurchasingPlanServiceImpl extends ServiceImpl<PurchasingPlanMapper, PurchasingPlan> implements PurchasingPlanService {
|
||||
|
||||
@Autowired
|
||||
private PurchasingPlanService purchasingPlanService;
|
||||
@Autowired
|
||||
private ProcurementContentService procurementContentService;
|
||||
|
||||
@Override//分页
|
||||
public IPage<PurchasingPlanVO> getPurchasingPlanVOPage(IPage<PurchasingPlan> page, QueryWrapper<PurchasingPlan> qw) {
|
||||
IPage<PurchasingPlanVO> purchasingPlanVOPage = baseMapper.getPurchasingPlanVOPage(page, qw);
|
||||
return purchasingPlanVOPage;
|
||||
}
|
||||
|
||||
@Override//列表
|
||||
public List<PurchasingPlanVO> getPurchasingPlanVOList(QueryWrapper<PurchasingPlan> qw) {
|
||||
return baseMapper.getPurchasingPlanVOList(qw);
|
||||
}
|
||||
|
||||
@Override//通过ID查询
|
||||
public PurchasingPlanVO getPurchasingPlanVO(String purchasingPlanId) {
|
||||
|
||||
PurchasingPlanVO purchasingPlanVO = baseMapper.getPurchasingPlanVO(purchasingPlanId);
|
||||
|
||||
if (purchasingPlanVO == null) {
|
||||
|
||||
throw new RuntimeException(String.format("信息不存在"));
|
||||
}
|
||||
|
||||
List<ProcurementContentVO> procurementContentVOList = procurementContentService.getProcurementContentVOList(purchasingPlanId);
|
||||
|
||||
purchasingPlanVO.setProcurementContentVOList(procurementContentVOList);
|
||||
|
||||
return purchasingPlanVO;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override//创建计划
|
||||
public Boolean addById(List<PurchasingPlanDTO> purchasingPlanDTOList, DLPUser user, PurchasingPlan purchasingPlan) {
|
||||
|
||||
purchasingPlan.setPurchasingPlanId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
purchasingPlan.setCreateId(user.getId());
|
||||
|
||||
purchasingPlan.setStatus(0);
|
||||
|
||||
List<ProcurementContent> list = new ArrayList<>();
|
||||
|
||||
for (PurchasingPlanDTO purchasingPlanDTO : purchasingPlanDTOList) {
|
||||
|
||||
ProcurementContent procurementContent = new ProcurementContent();
|
||||
|
||||
BeanUtils.copyProperties(purchasingPlanDTO, procurementContent);
|
||||
|
||||
procurementContent.setPurchasingPlanId(purchasingPlan.getPurchasingPlanId());
|
||||
|
||||
procurementContent.setProcurementContentId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
list.add(procurementContent);
|
||||
}
|
||||
|
||||
return purchasingPlanService.save(purchasingPlan) & procurementContentService.saveBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcurementContent addContent(PurchasingPlanDTO purchasingPlanDTO) {
|
||||
|
||||
ProcurementContent procurementContent = new ProcurementContent();
|
||||
|
||||
BeanUtils.copyProperties(purchasingPlanDTO, procurementContent);
|
||||
|
||||
if (procurementContentService.save(procurementContent)) {
|
||||
return procurementContent;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcurementContent editById(PurchasingPlanDTO purchasingPlanDTO) {
|
||||
|
||||
ProcurementContent byId = procurementContentService.getById(purchasingPlanDTO.getProcurementContentId());
|
||||
|
||||
BeanUtils.copyProperties(purchasingPlanDTO, byId);
|
||||
|
||||
if (purchasingPlanService.getById(byId.getPurchasingPlanId()).getStatus() == 0 & procurementContentService.updateById(byId)) {
|
||||
return byId;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean delById(String purchasingPlanId) {
|
||||
|
||||
PurchasingPlan purchasingPlan = purchasingPlanService.getById(purchasingPlanId);
|
||||
|
||||
LambdaQueryWrapper<ProcurementContent> procurementContentLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
procurementContentLambdaQueryWrapper.eq(ProcurementContent::getPurchasingPlanId, purchasingPlan.getPurchasingPlanId());
|
||||
|
||||
List<ProcurementContent> list = procurementContentService.list(procurementContentLambdaQueryWrapper);
|
||||
|
||||
if (purchasingPlan.getStatus() == 0) {
|
||||
return procurementContentService.removeBatchByIds(list) & purchasingPlanService.removeById(purchasingPlanId);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean delContentById(String procurementContentId) {
|
||||
|
||||
ProcurementContent byId = procurementContentService.getById(procurementContentId);
|
||||
|
||||
if (purchasingPlanService.getById(byId.getPurchasingPlanId()).getStatus() == 0) {
|
||||
return procurementContentService.removeById(procurementContentId);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurchasingPlan commitById(String purchasingPlanId) {
|
||||
|
||||
PurchasingPlan byId = purchasingPlanService.getById(purchasingPlanId);
|
||||
|
||||
LambdaQueryWrapper<ProcurementContent> procurementContentLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
procurementContentLambdaQueryWrapper.eq(ProcurementContent::getPurchasingPlanId, byId.getPurchasingPlanId());
|
||||
|
||||
List<ProcurementContent> list = procurementContentService.list(procurementContentLambdaQueryWrapper);
|
||||
|
||||
for (ProcurementContent procurementContent : list) {
|
||||
|
||||
if (!(procurementContent.getUnitPrice() > 0 &
|
||||
procurementContent.getUnitPrice() < 1000000 &
|
||||
procurementContent.getQuantity() > 0 &
|
||||
procurementContent.getQuantity() < 1000 &
|
||||
procurementContent.getReagentConsumableId() != null)) {
|
||||
throw new RuntimeException(String.format("您输入的值有误,请重新输入"));
|
||||
}
|
||||
}
|
||||
byId.setStatus(1);
|
||||
if (purchasingPlanService.updateById(byId)) {
|
||||
return byId;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurchasingPlan auditById(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) {
|
||||
|
||||
PurchasingPlan purchasingPlan = purchasingPlanService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
if (purchasingPlan.getStatus() != 1) {
|
||||
throw new RuntimeException(String.format("当前状态不可审核"));
|
||||
}
|
||||
purchasingPlan.setAuditResultOfPrimary(auditAndApproveDto.getAuditResult());
|
||||
|
||||
purchasingPlan.setAuditOpinionOfPrimary(auditAndApproveDto.getAuditOpinion());
|
||||
|
||||
purchasingPlan.setAuditTimeOfPrimary(LocalDateTime.now());
|
||||
|
||||
purchasingPlan.setPrimaryAuditorId(dlpUser.getId());
|
||||
|
||||
purchasingPlan.setStatus(2);
|
||||
|
||||
if (purchasingPlanService.updateById(purchasingPlan)) {
|
||||
return purchasingPlan;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurchasingPlan approveById(AuditAndApproveDTO auditAndApproveDto, DLPUser dlpUser) {
|
||||
|
||||
PurchasingPlan purchasingPlan = purchasingPlanService.getById(auditAndApproveDto.getUuId());
|
||||
|
||||
if (purchasingPlan.getStatus() != 2) {
|
||||
throw new RuntimeException(String.format("当前状态不可审批"));
|
||||
}
|
||||
purchasingPlan.setApprovalResult(auditAndApproveDto.getApproveResult());
|
||||
|
||||
purchasingPlan.setApprovalOpinion(auditAndApproveDto.getApproveOpinion());
|
||||
|
||||
purchasingPlan.setApprovalTime(LocalDateTime.now());
|
||||
|
||||
purchasingPlan.setStatus(3);
|
||||
|
||||
purchasingPlan.setApproverId(dlpUser.getId());
|
||||
|
||||
if (purchasingPlanService.updateById(purchasingPlan)) {
|
||||
return purchasingPlan;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurchasingPlan releaseById(String purchasingPlanId) {
|
||||
|
||||
PurchasingPlan byId = purchasingPlanService.getById(purchasingPlanId);
|
||||
|
||||
if (byId.getStatus() != 3) {
|
||||
throw new RuntimeException(String.format("当前状态无法提交"));
|
||||
}
|
||||
byId.setStatus(4);
|
||||
|
||||
if (purchasingPlanService.updateById(byId)) {
|
||||
return byId;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PurchaseCatalogueVO extends PurchaseCatalogue {
|
||||
private String qualityName;
|
||||
private String technicalName;
|
||||
private String primaryAuditorName;
|
||||
private String secondaryAuditorName;
|
||||
private List<CatalogueDetailsVO> catalogueDetailsVOListList;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,6 @@ spring:
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
username: dlp
|
||||
username: root
|
||||
password: 7990016
|
||||
url: jdbc:mysql://dlp-mysql:3306/dlp_reagent_managment?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://dlp-mysql:3306/reagent_managment?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user