|
@@ -56,6 +56,7 @@ import java.time.LocalDate;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Collection;
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
import java.util.Comparator;
|
|
import java.util.Comparator;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
@@ -105,7 +106,7 @@ public class SysImplementPlanManager {
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public Boolean createPlan(SysImplementPlanDTO.OnCreate resource, HnqzUser operator) {
|
|
public Boolean createPlan(SysImplementPlanDTO.OnCreate resource, HnqzUser operator) {
|
|
|
|
|
|
- boolean dupName = implementPlanService.dupName(resource.getPlanName(), operator.getDeptId());
|
|
|
|
|
|
+ boolean dupName = implementPlanService.dupName(resource.getPlanName(), operator.getDeptId(), Collections.emptyList());
|
|
|
|
|
|
if (dupName) {
|
|
if (dupName) {
|
|
throw new BizException(String.format("计划名称【%s】已存在,请更正", resource.getPlanName()));
|
|
throw new BizException(String.format("计划名称【%s】已存在,请更正", resource.getPlanName()));
|
|
@@ -117,13 +118,13 @@ public class SysImplementPlanManager {
|
|
UpmsType.ImplementPlanType planType = resource.getPlanType();
|
|
UpmsType.ImplementPlanType planType = resource.getPlanType();
|
|
|
|
|
|
UpmsState.ImplementPlanState state;
|
|
UpmsState.ImplementPlanState state;
|
|
- if (UpmsType.ImplementPlanType.QRT.equals(planType) && (resource.getParentId() == 0)){
|
|
|
|
|
|
+ if (UpmsType.ImplementPlanType.QRT.equals(planType) && (resource.getParentId() == 0)) {
|
|
state = UpmsState.ImplementPlanState.PASSED;
|
|
state = UpmsState.ImplementPlanState.PASSED;
|
|
plan.setCheckResult(true);
|
|
plan.setCheckResult(true);
|
|
plan.setCheckMessage("通过(审批流程,季度计划自动通过,不需要上级审批)");
|
|
plan.setCheckMessage("通过(审批流程,季度计划自动通过,不需要上级审批)");
|
|
plan.setCheckTime(now);
|
|
plan.setCheckTime(now);
|
|
plan.setChecker(username);
|
|
plan.setChecker(username);
|
|
- } else{
|
|
|
|
|
|
+ } else {
|
|
state = UpmsState.ImplementPlanState.INIT;
|
|
state = UpmsState.ImplementPlanState.INIT;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -975,7 +976,7 @@ public class SysImplementPlanManager {
|
|
if (CollUtil.isNotEmpty(onBatchCreates) && onBatchCreates.size() > 1) {
|
|
if (CollUtil.isNotEmpty(onBatchCreates) && onBatchCreates.size() > 1) {
|
|
errorMsg.append("表单内存在重名服务计划名称;");
|
|
errorMsg.append("表单内存在重名服务计划名称;");
|
|
} else {
|
|
} else {
|
|
- boolean dupName = implementPlanService.dupName(planName, deptId);
|
|
|
|
|
|
+ boolean dupName = implementPlanService.dupName(planName, deptId, Collections.emptyList());
|
|
if (dupName) {
|
|
if (dupName) {
|
|
errorMsg.append("服务计划名称已存在;");
|
|
errorMsg.append("服务计划名称已存在;");
|
|
}
|
|
}
|
|
@@ -1359,4 +1360,25 @@ public class SysImplementPlanManager {
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public Boolean updatePlan(SysImplementPlanDTO.OnUpdate resource, HnqzUser user) {
|
|
|
|
+
|
|
|
|
+ SysImplementPlan plan = implementPlanService.getById(resource.getPlanId());
|
|
|
|
+
|
|
|
|
+ if (UpmsState.ImplementPlanState.PASSED.equals(plan.getPlanState())) {
|
|
|
|
+ throw new BizException("当前执行计划已经审核通过了,不能修改");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ boolean dump = implementPlanService.dupName(resource.getPlanName(), user.getDeptId(), Collections.singletonList(resource.getPlanId()));
|
|
|
|
+
|
|
|
|
+ if (dump) {
|
|
|
|
+ throw new BizException(String.format("计划名称【%s】已存在,请更正", resource.getPlanName()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ SysImplementPlan updated = BeanUtil.copyProperties(resource, SysImplementPlan.class);
|
|
|
|
+ updated.setUpdateBy(user.getUsername());
|
|
|
|
+ updated.setUpdateTime(LocalDateTime.now());
|
|
|
|
+ return implementPlanService.updatePlan(updated);
|
|
|
|
+ }
|
|
}
|
|
}
|