|
|
@@ -287,6 +287,10 @@ public class SafetyCheckRegisterSericeImpl extends ServiceImpl<CoreSafetyTaskMap
|
|
|
*/
|
|
|
@Override
|
|
|
public Boolean webSubmit(TaskRegisterVo<TaskRegisterAreaVo> data) {
|
|
|
+ return webSubmit(data, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ private Boolean webSubmit(TaskRegisterVo<TaskRegisterAreaVo> data, Boolean isNewTask) {
|
|
|
TaskRegisterVo<AppTaskRegisterPointVo> appdata = new TaskRegisterVo<AppTaskRegisterPointVo>();
|
|
|
BeanUtils.copyProperties(data, appdata);
|
|
|
appdata.setCheckList(new ArrayList<>());
|
|
|
@@ -308,7 +312,7 @@ public class SafetyCheckRegisterSericeImpl extends ServiceImpl<CoreSafetyTaskMap
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return submit(appdata, false);
|
|
|
+ return submit(appdata, isNewTask);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -322,32 +326,9 @@ public class SafetyCheckRegisterSericeImpl extends ServiceImpl<CoreSafetyTaskMap
|
|
|
if (ObjectUtil.isNull(data.getId())) {
|
|
|
data.setId(IDHelper.id());
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-// TaskRegisterVo<AppTaskRegisterPointVo> appdata = new TaskRegisterVo<AppTaskRegisterPointVo>();
|
|
|
-// BeanUtils.copyProperties(data, appdata);
|
|
|
-// appdata.setCheckList(new ArrayList<>());
|
|
|
-// for (TaskRegisterAreaVo areaVo : data.getCheckList()) {
|
|
|
-// boolean firstPoint = true;
|
|
|
-//
|
|
|
-// for (TaskRegisterItemVo itemVo : areaVo.getItemList()) {
|
|
|
-//
|
|
|
-// for (TaskRegisterPointVo pointVo : itemVo.getPointList()) {
|
|
|
-//
|
|
|
-// AppTaskRegisterPointVo appPointVo = new AppTaskRegisterPointVo();
|
|
|
-// BeanUtils.copyProperties(pointVo, appPointVo);
|
|
|
-// BeanUtils.copyProperties(itemVo, appPointVo);
|
|
|
-// BeanUtils.copyProperties(areaVo, appPointVo);
|
|
|
-// appPointVo.setNfcList(new ArrayList<>());
|
|
|
-// if (firstPoint) {
|
|
|
-// appPointVo.setNfcList(areaVo.getNfcList());
|
|
|
-// firstPoint = false;
|
|
|
-// }
|
|
|
-// appdata.getCheckList().add(appPointVo);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
- return webSubmit(data);
|
|
|
+ data.setPlanStartTime(DateUtil.beginOfDay(data.getPlanStartTime()));
|
|
|
+ data.setPlanEndTime(DateUtil.endOfDay(data.getPlanStartTime()));
|
|
|
+ return webSubmit(data, true);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -412,7 +393,11 @@ public class SafetyCheckRegisterSericeImpl extends ServiceImpl<CoreSafetyTaskMap
|
|
|
questionService.insertQuestion(question);
|
|
|
}
|
|
|
}
|
|
|
- updateTask(data, questions.size(), data.getIsSubmit());
|
|
|
+ if (isNewTask) {
|
|
|
+ addTask(data, questions.size(), data.getIsSubmit());
|
|
|
+ } else {
|
|
|
+ updateTask(data, questions.size(), data.getIsSubmit());
|
|
|
+ }
|
|
|
|
|
|
return true;
|
|
|
}
|