web: 添加确认处置计划功能

dev_2.0.0
xueqingkun 1 year ago
parent 858d128f8c
commit 56417e2fbf

@ -29,6 +29,14 @@ public class TreatmentPlanController {
return treatmentPlanService.saveTreatmentPlanRecord(treatmentPlanRecord);
}
@ApiOperation("确认处置计划")
@PostMapping("/confirm")
public boolean confirmTreatmentPlan(String processId) {
return treatmentPlanService.confirmTreatmentPlan(processId);
}
@ApiOperation("修改处置计划记录")
@PutMapping("/record/update")
public boolean updateTreatmentPlanRecord(@RequestBody TreatmentPlanRecord treatmentPlanRecord) {

@ -12,4 +12,6 @@ public interface TreatmentPlanService {
boolean updateTreatmentPlanRecord(TreatmentPlanRecord treatmentPlanRecord);
boolean deleteTreatmentPlanRecord(String id);
boolean confirmTreatmentPlan(String processId);
}

@ -2,7 +2,9 @@ package com.supervision.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import com.supervision.model.Process;
import com.supervision.model.TreatmentPlanRecord;
import com.supervision.service.ProcessService;
import com.supervision.service.TreatmentPlanRecordService;
import com.supervision.service.TreatmentPlanService;
import lombok.RequiredArgsConstructor;
@ -18,6 +20,8 @@ public class TreatmentPlanServiceImpl implements TreatmentPlanService {
private final TreatmentPlanRecordService treatmentPlanRecordService;
private final ProcessService processService;
@Override
public boolean saveTreatmentPlanRecord(TreatmentPlanRecord treatmentPlanRecord) {
@ -54,6 +58,19 @@ public class TreatmentPlanServiceImpl implements TreatmentPlanService {
return treatmentPlanRecordService.removeById(id);
}
@Override
public boolean confirmTreatmentPlan(String processId) {
Process process = processService.getById(processId);
Assert.notNull(process,"流程数据不存在");
Assert.notNull(process.getStatus(),"状态值有误");
if (process.getStatus().equals(2)){
return true;
}
process.setStatus(2);
return processService.updateById(process);
}
private void assertSaveTreatmentPlanRecord(TreatmentPlanRecord treatmentPlanRecord){
Assert.notEmpty(treatmentPlanRecord.getProcessId(),"流程id不能为空");
Assert.notNull(treatmentPlanRecord.getDisposalMethod(),"处置方式不能为为空");

Loading…
Cancel
Save