|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.supervision.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import com.supervision.model.Process;
|
|
|
|
|
import com.supervision.model.TreatmentPlanRecord;
|
|
|
|
@ -11,6 +12,7 @@ import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
@ -59,15 +61,17 @@ public class TreatmentPlanServiceImpl implements TreatmentPlanService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean confirmTreatmentPlan(String processId) {
|
|
|
|
|
public boolean confirmTreatmentPlan(String processId, String status) {
|
|
|
|
|
|
|
|
|
|
Assert.isTrue(CollectionUtil.newArrayList("0","1","2").contains(status),"状态值有误");
|
|
|
|
|
|
|
|
|
|
Process process = processService.getById(processId);
|
|
|
|
|
Assert.notNull(process,"流程数据不存在");
|
|
|
|
|
Assert.notNull(process.getStatus(),"状态值有误");
|
|
|
|
|
|
|
|
|
|
if (process.getStatus().equals(2)){
|
|
|
|
|
if (Integer.valueOf(status).compareTo(process.getStatus()) <= 0){
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
process.setStatus(2);
|
|
|
|
|
process.setStatus(Integer.valueOf(status));
|
|
|
|
|
return processService.updateById(process);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|