|
@@ -53,14 +53,14 @@ public class MuseumFlowController {
|
|
|
}
|
|
|
|
|
|
@PostMapping("/1")
|
|
|
- @Operation(summary = "1")
|
|
|
+ @Operation(summary = "添加出库单")
|
|
|
public CommonResult<Boolean> createMuseumFlowState(@RequestBody MuseumFlowSaveVO saveVO){
|
|
|
String sample_id=saveVO.getNumber();
|
|
|
MuseumInfoDO result = museumFlowService.selectMuseumFlowSampleId(sample_id);
|
|
|
if(result == null){
|
|
|
return CommonResult.error(200,"样品不存在");
|
|
|
}
|
|
|
- int condition=result.getSave();
|
|
|
+ int condition=result.getState();
|
|
|
// 0现为已出库,1为未出库或已回库,2为审批中,3为审批通过
|
|
|
if(condition == 0){
|
|
|
return CommonResult.error(200,"样品不在库中");
|
|
@@ -81,7 +81,61 @@ public class MuseumFlowController {
|
|
|
return museumFlowService.selectPageS(pageVO);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/review")
|
|
|
+ @Operation(summary = "新增通过的审批单")
|
|
|
+ public CommonResult<Boolean> createMuseumAFlowReview(@RequestBody MuseumFlowSaveVO saveVO) {
|
|
|
+ String sample_id = saveVO.getNumber();
|
|
|
+ MuseumInfoDO result = museumFlowService.selectMuseumFlowSampleId(sample_id);
|
|
|
+ if (result == null) {
|
|
|
+ return CommonResult.error(200, "样品不存在");
|
|
|
+ }
|
|
|
+ int condition = result.getCondition();
|
|
|
+ // 0现为已出库,1为未出库或已回库,2为审批中,3为审批通过,4为审批驳回
|
|
|
+ if (condition == 4) {
|
|
|
+ return CommonResult.error(200, "样品审批已被驳回");
|
|
|
+ }
|
|
|
+ else if (condition == 3) {
|
|
|
+ return CommonResult.error(200, "样品已审批通过");
|
|
|
+ }
|
|
|
+ else if (condition == 1) {
|
|
|
+ return CommonResult.error(200, "样品并未申请出库");
|
|
|
+ }
|
|
|
+ else if (condition == 2) {
|
|
|
+ museumFlowService.createMuseumFlow(saveVO);
|
|
|
+ museumFlowService.updateMuseumFlowState3(saveVO);
|
|
|
+ return CommonResult.success(true);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return CommonResult.error(200,"样品已审批通过并出库");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
+ @PostMapping("/reject")
|
|
|
+ @Operation(summary = "新增拒绝的审批单")
|
|
|
+ public CommonResult<Boolean> createMuseumAFlowReject(@RequestBody MuseumFlowSaveVO saveVO) {
|
|
|
+ String sample_id = saveVO.getNumber();
|
|
|
+ MuseumInfoDO result = museumFlowService.selectMuseumFlowSampleId(sample_id);
|
|
|
+ if (result == null) {
|
|
|
+ return CommonResult.error(200, "样品不存在");
|
|
|
+ }
|
|
|
+ int condition = result.getCondition();
|
|
|
+ // 0现为已出库,1为未出库或已回库,2为审批中,3为审批通过,4为审批驳回
|
|
|
+ if (condition == 4) {
|
|
|
+ return CommonResult.error(200, "样品审批已被驳回");
|
|
|
+ }
|
|
|
+ else if (condition == 3) {
|
|
|
+ return CommonResult.error(200, "样品已审批通过");
|
|
|
+ }
|
|
|
+ else if (condition == 1) {
|
|
|
+ return CommonResult.error(200, "样品并未申请出库");
|
|
|
+ }
|
|
|
+ else if (condition == 2) {
|
|
|
+ museumFlowService.createMuseumFlow(saveVO);
|
|
|
+ museumFlowService.updateMuseumFlowState4(saveVO);
|
|
|
+ return CommonResult.success(true);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return CommonResult.error(200,"样品已审批通过并出库");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|