| | |
| | | private LocService locService; |
| | | @Autowired |
| | | private LocStsService locStsService; |
| | | @Autowired |
| | | private TaskLogService taskLogService; |
| | | @Autowired |
| | | private TaskDetlLogService taskDetlLogService; |
| | | @Autowired |
| | | private TaskDetlFieldLogService taskDetlFieldLogService; |
| | | |
| | | @Override |
| | | public String generateTaskNo(Long taskType) { |
| | |
| | | } |
| | | } |
| | | |
| | | //删除明细扩展 |
| | | boolean removeField = taskDetlFieldService.remove(new LambdaQueryWrapper<TaskDetlField>().eq(TaskDetlField::getDetlId, taskDetl.getId())); |
| | | if(!removeField){ |
| | | throw new CoolException("回滚扩展明细失败"); |
| | | List<TaskDetlField> detlFields = taskDetlFieldService.list(new LambdaQueryWrapper<TaskDetlField>().eq(TaskDetlField::getDetlId, taskDetl.getId())); |
| | | for (TaskDetlField detlField : detlFields) { |
| | | //明细扩展字段数据保存至历史档 |
| | | TaskDetlFieldLog taskDetlFieldLog = new TaskDetlFieldLog(); |
| | | taskDetlFieldLog.sync(detlField); |
| | | if (!taskDetlFieldLogService.save(taskDetlFieldLog)) { |
| | | throw new CoolException("明细扩展字段转历史档案失败"); |
| | | } |
| | | |
| | | //删除明细扩展 |
| | | boolean removeField = taskDetlFieldService.removeById(detlField.getId()); |
| | | if(!removeField){ |
| | | throw new CoolException("回滚扩展明细失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | //明细数据保存至历史档 |
| | | TaskDetlLog taskDetlLog = new TaskDetlLog(); |
| | | taskDetlLog.sync(taskDetl); |
| | | if (!taskDetlLogService.save(taskDetlLog)) { |
| | | throw new CoolException("明细数据转历史档案失败"); |
| | | } |
| | | |
| | | //删除明细 |
| | |
| | | } |
| | | } |
| | | |
| | | //数据保存至历史档 |
| | | TaskLog taskLog = new TaskLog(); |
| | | taskLog.sync(task); |
| | | if (!taskLogService.save(taskLog)) { |
| | | throw new CoolException("任务档案转历史档案失败"); |
| | | } |
| | | |
| | | //删除任务 |
| | | boolean removeTask = taskService.removeById(taskId); |
| | | if(!removeTask){ |