|
@@ -1032,19 +1032,15 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
|
FlowResult flowResultParam = JSONObject.parseObject(sopSaveParam.getFormProperties(), FlowResult.class);
|
|
|
LinkedHashMap<String, FlowTaskResult> setupParamMap = flowResultParam.getSetupMap();
|
|
|
for (Map.Entry<String, FlowTaskResult> entry : setupParamMap.entrySet()) {
|
|
|
- if (entry.getValue().getSetup() != 0 && entry.getValue().getSetup() > 1) {//更新动态表单字段和处理时限
|
|
|
+ if (entry.getValue().getSetup() != 0) {//更新动态表单字段和处理时限
|
|
|
tbSopInfoService.saveDynamicSop(tfCustomFlow, tfCustomFlowEntity.getCode(), tfCustomFlowEntity.getFlowId(), entry.getValue());
|
|
|
}
|
|
|
}
|
|
|
FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
|
|
|
LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
|
|
|
for (Map.Entry<String, FlowTaskResult> entry : setupMap.entrySet()) {
|
|
|
- if (entry.getValue().getSetup().intValue() > 1) {
|
|
|
- if (Objects.nonNull(setupParamMap.get(entry.getKey()))) {
|
|
|
- setupMap.put(entry.getKey(), setupParamMap.get(entry.getKey()));
|
|
|
- } else {
|
|
|
- break;
|
|
|
- }
|
|
|
+ if (Objects.nonNull(setupParamMap.get(entry.getKey()))) {
|
|
|
+ setupMap.put(entry.getKey(), setupParamMap.get(entry.getKey()));
|
|
|
}
|
|
|
}
|
|
|
flowResult.setSetupMap(setupMap);
|
|
@@ -1107,7 +1103,9 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- Optional.ofNullable(processLimitedTime).orElseThrow(() -> ExceptionResultEnum.ERROR.exception(ProcessLimitedEnum.convertKeyToEnum(fieldId).getTitle() + "处理时限时间为空"));
|
|
|
+ if (!fieldId.contains(ProcessLimitedEnum.SERVICE_FINISH_PLAN_BEGIN_DATE.getKey())) {
|
|
|
+ Optional.ofNullable(processLimitedTime).orElseThrow(() -> ExceptionResultEnum.ERROR.exception(ProcessLimitedEnum.convertKeyToEnum(fieldId).getTitle() + "处理时限时间为空"));
|
|
|
+ }
|
|
|
return processLimitedTime;
|
|
|
}
|
|
|
|
|
@@ -1124,19 +1122,21 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
|
public void saveSopPlanDate(FlowTaskResult flowTaskResult, Long sopId, Long flowId, Long userId) {
|
|
|
Long serviceFinishPlanBeginDate = this.getProcessLimitedTime(flowTaskResult, ProcessLimitedEnum.SERVICE_FINISH_PLAN_BEGIN_DATE.getKey());
|
|
|
Long serviceFinishPlanEndDate = this.getProcessLimitedTime(flowTaskResult, ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey());
|
|
|
- serviceFinishPlanBeginDate = serviceFinishPlanBeginDate + 1000;
|
|
|
- TBSopPlanDateLog tbSopPlanDateLog = tbSopPlanDateLogService.getOne(new QueryWrapper<TBSopPlanDateLog>().lambda().eq(TBSopPlanDateLog::getFlowId, flowId).orderByDesc(TBSopPlanDateLog::getCreateTime).last(" limit 1 "));
|
|
|
- if (Objects.isNull(tbSopPlanDateLog)) {
|
|
|
- tbSopPlanDateLog = new TBSopPlanDateLog(sopId, flowId, serviceFinishPlanBeginDate, serviceFinishPlanEndDate, userId);
|
|
|
- tbSopPlanDateLogService.save(tbSopPlanDateLog);
|
|
|
- } else {
|
|
|
- TBSopPlanDateLog tbSopPlanDateLogNew = new TBSopPlanDateLog();
|
|
|
- BeanUtils.copyProperties(tbSopPlanDateLog, tbSopPlanDateLogNew);
|
|
|
- tbSopPlanDateLogNew.setBeginTime(serviceFinishPlanBeginDate);
|
|
|
- tbSopPlanDateLogNew.setEndTime(serviceFinishPlanEndDate);
|
|
|
- if (!tbSopPlanDateLogNew.equals(tbSopPlanDateLog)) {
|
|
|
- tbSopPlanDateLogNew.updateInfo(userId);
|
|
|
- tbSopPlanDateLogService.save(tbSopPlanDateLogNew);
|
|
|
+ if (Objects.nonNull(serviceFinishPlanBeginDate)) {
|
|
|
+ serviceFinishPlanBeginDate = serviceFinishPlanBeginDate + 1000;
|
|
|
+ TBSopPlanDateLog tbSopPlanDateLog = tbSopPlanDateLogService.getOne(new QueryWrapper<TBSopPlanDateLog>().lambda().eq(TBSopPlanDateLog::getFlowId, flowId).orderByDesc(TBSopPlanDateLog::getCreateTime).last(" limit 1 "));
|
|
|
+ if (Objects.isNull(tbSopPlanDateLog)) {
|
|
|
+ tbSopPlanDateLog = new TBSopPlanDateLog(sopId, flowId, serviceFinishPlanBeginDate, serviceFinishPlanEndDate, userId);
|
|
|
+ tbSopPlanDateLogService.save(tbSopPlanDateLog);
|
|
|
+ } else {
|
|
|
+ TBSopPlanDateLog tbSopPlanDateLogNew = new TBSopPlanDateLog();
|
|
|
+ BeanUtils.copyProperties(tbSopPlanDateLog, tbSopPlanDateLogNew);
|
|
|
+ tbSopPlanDateLogNew.setBeginTime(serviceFinishPlanBeginDate);
|
|
|
+ tbSopPlanDateLogNew.setEndTime(serviceFinishPlanEndDate);
|
|
|
+ if (!tbSopPlanDateLogNew.equals(tbSopPlanDateLog)) {
|
|
|
+ tbSopPlanDateLogNew.updateInfo(userId);
|
|
|
+ tbSopPlanDateLogService.save(tbSopPlanDateLogNew);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|