| | |
| | | throw new CoolException("库位类型不存在");
|
| | | }
|
| | | LocType locType = locTypeService.getById(locTypeBind.getTypeId());
|
| | |
|
| | | if(locType == null){
|
| | | throw new CoolException("库位类型不存在");
|
| | | }
|
| | | LocTypeHeightType locTypeHeightType = LocTypeHeightType.get(locType.getFlag());
|
| | |
|
| | | if(locTypeHeightType == null){
|
| | | throw new CoolException("高低库位类型不存在");
|
| | | }
|
| | |
| | | throw new CoolException("任务明细不存在");
|
| | | }
|
| | | TaskDetl taskDetl = taskDetls.get(0);
|
| | |
|
| | | //生成新的库位 !important
|
| | | Loc loc = this.generateLoc(taskType, taskDetl.getMatId(), taskDetl.getBatch(), taskDetl.getUniqueField(), locTypeHeightType.id);
|
| | |
|
| | | // Loc loc = this.generateLoc(taskType, taskDetl.getMatId(), taskDetl.getBatch(), taskDetl.getUniqueField(), locTypeHeightType.id);
|
| | | // if(loc == null) {
|
| | | // throw new CoolException("没有空库位");
|
| | | // }
|
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, task.getOriginLoc()));
|
| | | if(loc == null) {
|
| | | throw new CoolException("没有空库位");
|
| | | }
|
| | | //102拣料此处需修改为WCS_CONTAINER_RECEIVE,定时任务查询后,自动下发入库任务至ESS
|
| | | task.setTaskSts(TaskStsType.WCS_CONTAINER_RECEIVE.id);//1.生成入库任务
|
| | | task.setTaskType(taskType);
|
| | | task.setTargetLoc(loc.getLocNo());
|
| | | //原库位变目标库位, 原站点变目标站点
|
| | | //todo 需确认原站点为空,该怎么处理
|
| | | task.setTargetLoc(task.getOriginLoc());
|
| | | task.setUpdateTime(new Date());
|
| | | if (!taskService.updateById(task)) {
|
| | | throw new CoolException("拣料失败");
|
| | | }
|
| | |
|
| | | //库位O => S
|
| | | //库位状态改为预约入库 R => S
|
| | | loc.setLocStsId(LocStsType.S.val());
|
| | | loc.setUpdateTime(new Date());
|
| | | boolean locUpdate = locService.updateById(loc);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public boolean locAdjust(LocAdjustParam param) {
|
| | | if (param == null) {
|
| | | throw new CoolException("参数不能为空");
|