| | |
| | | } |
| | | |
| | | @Override |
| | | public Task selectByUuid(String uuid) { |
| | | return this.getOne(new LambdaQueryWrapper<Task>().eq(Task::getUuid, uuid)); |
| | | public Task selectBySeqNum(Long busId, String seqNum) { |
| | | if (Cools.isEmpty(seqNum)) { |
| | | return null; |
| | | } |
| | | LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<>(); |
| | | if (null != busId) { |
| | | wrapper.eq(Task::getBusId, busId); |
| | | } |
| | | wrapper.eq(Task::getSeqNum, seqNum); |
| | | return this.getOne(wrapper.last(Constants.LIMIT_ONE)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Boolean complete(Long taskId, Long userId) { |
| | | public Boolean complete(Long taskId, Long userId, String from) { |
| | | Task task = this.getById(taskId); |
| | | if (null == task) { |
| | | return Boolean.FALSE; |
| | |
| | | task.setTaskSts(TaskStsType.COMPLETE.val()); |
| | | task.setUpdateTime(now); |
| | | task.setUpdateBy(userId); |
| | | task.setMemo(Constants.HANDLE + " " + TaskStsType.COMPLETE); |
| | | task.setMemo(from + " " + TaskStsType.COMPLETE); |
| | | if (!this.updateById(task)) { |
| | | throw new CoolException(BaseRes.ERROR); |
| | | } |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Boolean cancel(Long taskId, Long userId) { |
| | | public Boolean cancel(Long taskId, Long userId, String from) { |
| | | Task task = this.getById(taskId); |
| | | if (null == task) { |
| | | return Boolean.FALSE; |
| | |
| | | task.setTaskSts(TaskStsType.CANCEL.val()); |
| | | task.setUpdateTime(now); |
| | | task.setUpdateBy(userId); |
| | | task.setMemo(Constants.HANDLE + " " + TaskStsType.CANCEL); |
| | | task.setMemo(from + " " + TaskStsType.CANCEL); |
| | | if (!this.updateById(task)) { |
| | | throw new CoolException(BaseRes.ERROR); |
| | | } |