| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private LocItemWorkingService locItemWorkingService; |
| | | @Autowired |
| | | @Lazy |
| | | private WcsService wcsService; |
| | | @Autowired |
| | | private OutStockService outStockService; |
| | |
| | | @Autowired |
| | | private CheckOrderItemService checkOrderItemService; |
| | | @Autowired |
| | | @Lazy |
| | | private CheckOrderService checkOrderService; |
| | | @Autowired |
| | | private CheckDiffService checkDiffService; |
| | |
| | | @Autowired |
| | | private RemotesInfoProperties.RcsApi rcsApi; |
| | | @Autowired |
| | | @Lazy |
| | | private FlowStepInstanceService flowStepInstanceService; |
| | | @Autowired |
| | | private RemotesInfoProperties.WmsOpenApi wmsOpenApi; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Task taskToTop(Long id, Long loginUserId) throws Exception { |
| | | List<Integer> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id); |
| | | Task tasks = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getId, id).in(Task::getTaskStatus, longs)); |
| | | Task tasks = this.getOne(new LambdaQueryWrapper<Task>().eq(Task::getId, id).in(Task::getTaskStatus, longs)); |
| | | if (Objects.isNull(tasks)) { |
| | | throw new CoolException("任务已处执行状态不可一键置顶!!"); |
| | | } |
| | | //判断浅库位任务,修改任务优先级 |
| | | modiftyTaskSort(tasks, loginUserId); |
| | | |
| | | if (!taskService.updateById(tasks)) { |
| | | if (!this.updateById(tasks)) { |
| | | throw new CoolException("置顶失败!!"); |
| | | } |
| | | return null; |
| | |
| | | throw new CoolException("数据错误,库位不存在!!"); |
| | | } |
| | | if (loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) { |
| | | Task serviceOne = taskService.getOne(new LambdaQueryWrapper<Task>() |
| | | Task serviceOne = this.getOne(new LambdaQueryWrapper<Task>() |
| | | .eq(Task::getOrgLoc, loc.getCode()) |
| | | .or() |
| | | .eq(Task::getTargLoc, loc.getCode())); |
| | |
| | | locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId())); |
| | | |
| | | task.setTaskStatus(TaskStsType.UPDATED_IN.id).setUpdateTime(new Date()).setUpdateBy(loginUserId); |
| | | if (!taskService.updateById(task)) { |
| | | if (!this.updateById(task)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | |
| | |
| | | locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId())); |
| | | |
| | | task.setTaskStatus(TaskStsType.UPDATED_IN.id).setUpdateTime(new Date()).setUpdateBy(loginUserId); |
| | | if (!taskService.updateById(task)) { |
| | | if (!this.updateById(task)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | // 盘点再入库任务结束:将关联的盘点差异单置为已审核 |
| | |
| | | */ |
| | | @Override |
| | | public void markCheckDiffApprovedWhenCheckInDone(Task checkInTask) { |
| | | Task outTask = taskService.getOne(new LambdaQueryWrapper<Task>() |
| | | Task outTask = this.getOne(new LambdaQueryWrapper<Task>() |
| | | .eq(Task::getBarcode, checkInTask.getBarcode()) |
| | | .eq(Task::getTaskType, TaskType.TASK_TYPE_CHECK_OUT.type) |
| | | .last("limit 1")); |
| | |
| | | throw new CoolException("移库目标库位状态修改失败!!"); |
| | | } |
| | | |
| | | Task outTask = taskService.getById(task.getParentId()); |
| | | Task outTask = this.getById(task.getParentId()); |
| | | if (!Objects.isNull(outTask)) { |
| | | LocToTaskParams params = new LocToTaskParams(); |
| | | params.setOrgLoc(task.getOrgLoc()).setSiteNo(task.getOrgSite()); |
| | |
| | | return R.error("任务编码不能为空!!"); |
| | | } |
| | | List<Integer> integers = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id); |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>() |
| | | List<Task> tasks = this.list(new LambdaQueryWrapper<Task>() |
| | | .in(Task::getId, ids) |
| | | .in(Task::getTaskStatus, integers) |
| | | .orderByDesc(Task::getSort)); |
| | |
| | | } |
| | | } |
| | | |
| | | taskService.pubTaskToWcs(tasks); |
| | | this.pubTaskToWcs(tasks); |
| | | |
| | | return R.ok(); |
| | | } |
| | |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | |
| | | if (!taskService.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode()) |
| | | if (!this.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode()) |
| | | .set(Task::getTaskStatus, TaskStsType.WCS_EXECUTE_IN.id))) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | |
| | | if (!taskService.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode()) |
| | | if (!this.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode()) |
| | | .set(Task::getTaskStatus, TaskStsType.WCS_EXECUTE_OUT.id))) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |