| | |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.framework.common.SnowflakeIdWorker; |
| | | import com.zy.acs.framework.exception.CoolException; |
| | | import com.zy.acs.manager.common.domain.BaseParam; |
| | | import com.zy.acs.manager.common.domain.PageParam; |
| | | import com.zy.acs.manager.common.domain.PageResult; |
| | | import com.zy.acs.manager.common.exception.BusinessException; |
| | | import com.zy.acs.manager.core.domain.Lane; |
| | | import com.zy.acs.manager.core.service.LaneService; |
| | |
| | | private LaneService laneService; |
| | | |
| | | @Override |
| | | public PageResult<Task> pageRel(PageParam<Task, BaseParam> pageParam) { |
| | | return new PageResult<>(this.baseMapper.selectPageRel(pageParam, pageParam.checkoutMap()), pageParam.getTotal()); |
| | | } |
| | | |
| | | @Override |
| | | public synchronized String generateSeqNum() { |
| | | return String.valueOf(snowflakeIdWorker.nextId()).substring(13, 19); |
| | | } |
| | |
| | | public Task selectByUuid(String uuid) { |
| | | return this.getOne(new LambdaQueryWrapper<Task>().eq(Task::getUuid, uuid)); |
| | | } |
| | | |
| | | @Override |
| | | public Task selectBySeqNum(String seqNum) { |
| | | return this.list(new LambdaQueryWrapper<Task>().eq(Task::getSeqNum, seqNum)).get(0); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Task> selectBySts(TaskStsType taskStsType) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Boolean cancelCheckTaskSts(Long taskId, Long userId) { |
| | | Task task = this.getById(taskId); |
| | | if (null == task) { |
| | | return Boolean.FALSE; |
| | | } |
| | | if ( task.getTaskSts() >= TaskStsType.ASSIGN.val()){ |
| | | throw new BusinessException("任务已分配或执行,不能取消"); |
| | | } |
| | | |
| | | this.maintainLocSts(task, Boolean.FALSE); |
| | | |
| | | task.setTaskSts(TaskStsType.CANCEL.val()); |
| | | task.setUpdateTime(new Date()); |
| | | task.setUpdateBy(userId); |
| | | if (!this.updateById(task)) { |
| | | throw new CoolException(BaseRes.ERROR); |
| | | } |
| | | busService.checkoutComplete(task.getBusId()); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | @Override |
| | | public Lane checkoutOriginLane(Task task) { |
| | | Long codeId = null; |
| | | TaskTypeType typeType = TaskTypeType.get(task.getTaskTypeEl()); |