|
|
@ -263,7 +263,14 @@ public class TaskSubTimeService implements ITaskSubTimeService { |
|
|
|
} |
|
|
|
taskSubTime.setComplatedStatus(1); |
|
|
|
taskSubTimeDao.updateByPrimaryKeySelective(taskSubTime); |
|
|
|
|
|
|
|
if (1 == startTaskDto.getIsUpdateTime()){ |
|
|
|
ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskSubTime.getTaskDetailId()); |
|
|
|
if (ObjectUtil.isNotNull(taskDetail)){ |
|
|
|
Long timeDifference = taskSubTime.getBeginTime()-now; |
|
|
|
//寻找下到工序并修改时间
|
|
|
|
updateTimeDifference(timeDifference,taskDetail.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//查找任务的负责人名
|
|
|
|
String player = null; |
|
|
@ -336,6 +343,30 @@ public class TaskSubTimeService implements ITaskSubTimeService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改分解任务预计时间 |
|
|
|
* @param timeDifference 时间差 |
|
|
|
* @param taskDetailId 任务详情id |
|
|
|
*/ |
|
|
|
public void updateTimeDifference(Long timeDifference,Long taskDetailId){ |
|
|
|
Long currentTime = System.currentTimeMillis(); |
|
|
|
ProTaskDetailExample taskDetailExample = new ProTaskDetailExample(); |
|
|
|
taskDetailExample.createCriteria().andLastTaskDetailIdEqualTo(taskDetailId); |
|
|
|
List<ProTaskDetail> proTaskDetails = taskDetailDao.selectByExample(taskDetailExample); |
|
|
|
if (CollectionUtil.isNotEmpty(proTaskDetails)){ |
|
|
|
for (ProTaskDetail proTaskDetail : proTaskDetails) { |
|
|
|
ProTaskSubTimeExample subTimeExample = new ProTaskSubTimeExample(); |
|
|
|
subTimeExample.createCriteria().andBeginTimeGreaterThan(currentTime).andTaskDetailIdEqualTo(proTaskDetail.getId()); |
|
|
|
List<ProTaskSubTime> taskSubTimes = taskSubTimeDao.selectByExample(subTimeExample); |
|
|
|
if (CollectionUtil.isNotEmpty(taskSubTimes)){ |
|
|
|
taskSubTimes.get(0).setBeginTime(taskSubTimes.get(0).getBeginTime()+timeDifference); |
|
|
|
taskSubTimeDao.updateByPrimaryKeySelective(taskSubTimes.get(0)); |
|
|
|
} |
|
|
|
updateTimeDifference(timeDifference,proTaskDetail.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 结束其他进行中的任务 |
|
|
|
* |
|
|
|