| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean save(Integer wrkNo) { |
| | | List<TaskDetl> detls = taskDetlService.selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", wrkNo)); |
| | | if (Objects.isNull(detls) || detls.isEmpty()) { |
| | | throw new CoolException("数据错误:任务不存在!!"); |
| | | if (!detls.isEmpty()) { |
| | | detls.forEach(detl -> { |
| | | TaskDetlLog detlLog = new TaskDetlLog(); |
| | | BeanUtils.copyProperties(detl, detlLog); |
| | | detlLog.setId(null); |
| | | detlLog.setLogId(detl.getId()); |
| | | if (!this.insert(detlLog)) { |
| | | throw new CoolException("工作档明细历史保存失败!!"); |
| | | } |
| | | }); |
| | | } |
| | | detls.forEach(detl -> { |
| | | TaskDetlLog detlLog = new TaskDetlLog(); |
| | | BeanUtils.copyProperties(detl, detlLog); |
| | | detlLog.setId(null); |
| | | detlLog.setLogId(detl.getId()); |
| | | if (!this.insert(detlLog)) { |
| | | throw new CoolException("工作档明细历史保存失败!!"); |
| | | } |
| | | }); |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | } |