|
@@ -25,47 +25,47 @@ public class MuseumFlowController {
|
|
|
private MuseumFlowService museumFlowService;
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
- @Operation(summary = "新增标本")
|
|
|
+ @Operation(summary = "新增表单")
|
|
|
public Integer createMuseumFlow(MuseumFlowSaveVO saveVO) {
|
|
|
return museumFlowService.createMuseumFlow(saveVO);
|
|
|
}
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
- @Operation(summary = "更新标本")
|
|
|
+ @Operation(summary = "更新表单")
|
|
|
public CommonResult<Boolean> updateMuseumFlow(@RequestBody MuseumFlowSaveVO saveVO){
|
|
|
museumFlowService.updateMuseumFlow(saveVO);
|
|
|
return CommonResult.success(true);
|
|
|
}
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
- @Operation(summary = "删除标本")
|
|
|
+ @Operation(summary = "删除表单")
|
|
|
public CommonResult<Boolean> deleteMuseumFlow(@RequestParam("id") Integer id){
|
|
|
museumFlowService.deleteMuseumFlow(id);
|
|
|
return CommonResult.success(true);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get")
|
|
|
- @Operation(summary = "查找标本")
|
|
|
+ @Operation(summary = "查找表单")
|
|
|
public CommonResult<MuseumFlowRespVO> getMuseumFlow(@RequestParam("id") Integer id){
|
|
|
MuseumFlowDO result = museumFlowService.selectMuseumFlow(id);
|
|
|
MuseumFlowRespVO result1 = BeanUtils.toBean(result,MuseumFlowRespVO.class);
|
|
|
return CommonResult.success(result1);
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/1")
|
|
|
- @Operation(summary = "1")
|
|
|
+ @PostMapping("/Outbound")
|
|
|
+ @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 Save=result.getSave();
|
|
|
// 0现为已出库,1为未出库或已回库,2为审批中,3为审批通过
|
|
|
- if(condition == 0){
|
|
|
+ if(Save == 0){
|
|
|
return CommonResult.error(200,"样品不在库中");
|
|
|
}
|
|
|
- else if (condition == 2){
|
|
|
+ else if (Save == 2){
|
|
|
return CommonResult.error(200,"样品正在审批");
|
|
|
}
|
|
|
else {
|
|
@@ -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 Save = result.getSave();
|
|
|
+ // 0现为已出库,1为未出库或已回库,2为审批中,3为审批通过,4为审批驳回
|
|
|
+ if (Save == 4) {
|
|
|
+ return CommonResult.error(200, "样品审批已被驳回");
|
|
|
+ }
|
|
|
+ else if (Save == 3) {
|
|
|
+ return CommonResult.error(200, "样品已审批通过");
|
|
|
+ }
|
|
|
+ else if (Save == 1) {
|
|
|
+ return CommonResult.error(200, "样品并未申请出库");
|
|
|
+ }
|
|
|
+ else if (Save == 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 Save = result.getSave();
|
|
|
+ // 0现为已出库,1为未出库或已回库,2为审批中,3为审批通过,4为审批驳回
|
|
|
+ if (Save == 4) {
|
|
|
+ return CommonResult.error(200, "样品审批已被驳回");
|
|
|
+ }
|
|
|
+ else if (Save == 3) {
|
|
|
+ return CommonResult.error(200, "样品已审批通过");
|
|
|
+ }
|
|
|
+ else if (Save == 1) {
|
|
|
+ return CommonResult.error(200, "样品并未申请出库");
|
|
|
+ }
|
|
|
+ else if (Save == 2) {
|
|
|
+ museumFlowService.createMuseumFlow(saveVO);
|
|
|
+ museumFlowService.updateMuseumFlowState4(saveVO);
|
|
|
+ return CommonResult.success(true);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return CommonResult.error(200,"样品已审批通过并出库");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|