|
|
@ -931,27 +931,27 @@ public class ProTaskDetailService implements IProTaskDetailService { |
|
|
|
taskDetail.setDelayTime(updateTaskInfo.getDelayTime()); |
|
|
|
} |
|
|
|
//时间
|
|
|
|
// if(ObjectUtil.isNotNull(updateTaskInfo.getBeginTime())
|
|
|
|
// && ObjectUtil.isNotNull(updateTaskInfo.getEndTime())
|
|
|
|
// && updateTaskInfo.getBeginTime() >= updateTaskInfo.getEndTime()){
|
|
|
|
// throw new BaseException(CodeEnum.TIME_ERROR_BEGIN);
|
|
|
|
// }
|
|
|
|
boolean isUpdateTime = false; |
|
|
|
if(ObjectUtil.isNotNull(updateTaskInfo.getBeginTime())){ |
|
|
|
taskDetail.setBeginTime(updateTaskInfo.getBeginTime()); |
|
|
|
isUpdateTime = true; |
|
|
|
} |
|
|
|
if(ObjectUtil.isNotNull(updateTaskInfo.getEndTime())){ |
|
|
|
taskDetail.setEndTime(updateTaskInfo.getEndTime()); |
|
|
|
isUpdateTime = true; |
|
|
|
} |
|
|
|
if(StrUtil.isNotEmpty(updateTaskInfo.getCycle())){ |
|
|
|
taskDetail.setCycle(updateTaskInfo.getCycle()); |
|
|
|
isUpdateTime = true; |
|
|
|
} |
|
|
|
//时间赋完值后,检查开始时间是否小于结束时间。(赋值前判断太麻烦)
|
|
|
|
|
|
|
|
//一级任务没有时间,不能修改
|
|
|
|
if(taskDetail.getLevel() != 1 && taskDetail.getLevel() != 0) { |
|
|
|
if (ObjectUtil.isNotNull(updateTaskInfo.getBeginTime())) { |
|
|
|
taskDetail.setBeginTime(updateTaskInfo.getBeginTime()); |
|
|
|
isUpdateTime = true; |
|
|
|
} |
|
|
|
if (ObjectUtil.isNotNull(updateTaskInfo.getEndTime())) { |
|
|
|
taskDetail.setEndTime(updateTaskInfo.getEndTime()); |
|
|
|
isUpdateTime = true; |
|
|
|
} |
|
|
|
if (StrUtil.isNotEmpty(updateTaskInfo.getCycle())) { |
|
|
|
taskDetail.setCycle(updateTaskInfo.getCycle()); |
|
|
|
isUpdateTime = true; |
|
|
|
} |
|
|
|
|
|
|
|
//时间赋完值后,检查开始时间是否小于结束时间。(赋值前判断太麻烦)
|
|
|
|
if (taskDetail.getBeginTime() >= taskDetail.getEndTime()){ |
|
|
|
throw new BaseException(CodeEnum.TIME_ERROR_BEGIN); |
|
|
|
} |
|
|
|
} |
|
|
|
//若时间相关被修改,删掉旧的subTime,根据新时间重新生成
|
|
|
|
if(isUpdateTime){ |
|
|
|
//删掉旧的subTime
|
|
|
@ -974,6 +974,28 @@ public class ProTaskDetailService implements IProTaskDetailService { |
|
|
|
} |
|
|
|
return normalTask; |
|
|
|
} |
|
|
|
// private void changeTime(ProTaskDetail taskDetail,Long beginTime,Long endTime,SysProject project){
|
|
|
|
// if(beginTime >= project.getBeginTime() || endTime <= project.getEndTime()){
|
|
|
|
// throw new BaseException(CodeEnum.TIME_ERROR_PROJECT);
|
|
|
|
// }
|
|
|
|
// if(taskDetail.getLevel() == 2){
|
|
|
|
// ProTaskDetailExample detailExample = new ProTaskDetailExample();
|
|
|
|
// detailExample.createCriteria().andParentIdEqualTo(taskDetail.getId());
|
|
|
|
// List<ProTaskDetail> detailList = taskDetailDao.selectByExample(detailExample);
|
|
|
|
// if(CollectionUtil.isNotEmpty(detailList)){
|
|
|
|
//
|
|
|
|
// }else {
|
|
|
|
// if (ObjectUtil.isNotNull(beginTime)) {
|
|
|
|
// taskDetail.setBeginTime(beginTime);
|
|
|
|
// }
|
|
|
|
// if (ObjectUtil.isNotNull(endTime)) {
|
|
|
|
// taskDetail.setEndTime(endTime);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }else if(taskDetail.getLevel() == 3){
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
private void partTaskSubTime(ProTaskDetail taskDetail){ |
|
|
|
//cycle为空或者组任务,只加一条数据
|
|
|
|
if (StrUtil.isEmpty(taskDetail.getCycle()) || taskDetail.getHasGroup() == 1) { |
|
|
|