| | |
| | | import com.vincent.rsf.server.api.utils.LocUtils; |
| | | import com.vincent.rsf.server.api.utils.SlaveProperties; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.mapper.LocItemMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.manager.service.impl.LocServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | |
| | | @Autowired |
| | | private LocServiceImpl locService; |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | private LocItemMapper locItemMapper; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | |
| | | * 更新库位状态 |
| | | */ |
| | | private void updateLocStatus(String locCode, String barcode) { |
| | | boolean updated = locService.update(new LambdaUpdateWrapper<Loc>() |
| | | .eq(Loc::getCode, locCode) |
| | | .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_S.type) |
| | | .set(Loc::getBarcode, barcode)); |
| | | Loc current = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, locCode)); |
| | | if (Objects.isNull(current)) { |
| | | throw new CoolException("库位预约失败!!"); |
| | | } |
| | | Loc update = new Loc(); |
| | | update.setId(current.getId()); |
| | | update.setVersion(current.getVersion()); |
| | | update.setUseStatus(LocStsType.LOC_STS_TYPE_S.type); |
| | | update.setBarcode(barcode); |
| | | boolean updated = locService.update(update, new LambdaUpdateWrapper<Loc>() |
| | | .eq(Loc::getId, current.getId())); |
| | | if (!updated) { |
| | | throw new CoolException("库位预约失败!!"); |
| | | } |
| | |
| | | * 更新组托状态 |
| | | */ |
| | | private void updateWaitPakinStatus(String barcode, Long loginUserId) { |
| | | boolean updated = waitPakinService.update(new LambdaUpdateWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, barcode) |
| | | .set(WaitPakin::getUpdateBy, loginUserId) |
| | | .set(WaitPakin::getCreateBy, loginUserId) |
| | | .set(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_TASK_EXCE.val)); |
| | | WaitPakin current = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, barcode)); |
| | | if (Objects.isNull(current)) { |
| | | throw new CoolException("组托状态修改失败!!"); |
| | | } |
| | | WaitPakin update = new WaitPakin(); |
| | | update.setId(current.getId()); |
| | | update.setVersion(current.getVersion()); |
| | | update.setUpdateBy(loginUserId); |
| | | update.setCreateBy(loginUserId); |
| | | update.setIoStatus(PakinIOStatus.PAKIN_IO_STATUS_TASK_EXCE.val); |
| | | boolean updated = waitPakinService.update(update, new LambdaUpdateWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getId, current.getId())); |
| | | |
| | | if (!updated) { |
| | | throw new CoolException("组托状态修改失败!!"); |
| | |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_IN.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) { |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type)) { |
| | | /**修改出库站点状态*/ |
| | | BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getStationName, task.getOrgSite())); |
| | |
| | | // throw new CoolException("站点状态修改失败!!"); |
| | | // } |
| | | // } |
| | | } else if (task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)){ |
| | | //查询步骤 清楚源库位或者中间站点数据 |
| | | //待修改 先默认清除源库位 |
| | | |
| | | } |
| | | /**取箱完成, 修改任务状态*/ |
| | | } else if (params.getEventType().equals(CallBackEvent.CALL_BACK_EVENT_END.event)) { |
| | |
| | | //入库靠近摆放 |
| | | if (ioType == 1 && deviceBind.getBeSimilar().equals("1") && !Cools.isEmpty(matnr) && Cools.isEmpty(orgLoc)) { |
| | | if (nearRow != curRow) { |
| | | List<LocItem> locItems = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getMatnrCode, matnr)); |
| | | List<LocItem> locItems = locItemMapper.selectList(new LambdaQueryWrapper<LocItem>().eq(LocItem::getMatnrCode, matnr)); |
| | | for (LocItem locItem : locItems) { |
| | | Loc loc1 = locService.getById(locItem.getLocId()); |
| | | if (LocUtils.isShallowLoc(loc1.getCode())) { |
| | |
| | | } |
| | | String shallowLocNo = LocUtils.getShallowLoc(loc1.getCode()); |
| | | // 检测目标库位是否为空库位 |
| | | Loc shallowLoc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, shallowLocNo)); |
| | | Loc shallowLoc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, shallowLocNo).last("limit 1")); |
| | | if (shallowLoc != null && shallowLoc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | if (LocUtils.locMoveCheckLocTypeComplete(shallowLoc, locTypeDto)) { |
| | | loc = shallowLoc; |
| | |
| | | DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | .eq(DeviceSite::getType, ioType) |
| | | .eq(DeviceSite::getSite, sourceStaNo) |
| | | .eq(DeviceSite::getChannel, channel) |
| | | .eq(DeviceSite::getChannel, channel).last("limit 1") |
| | | ); |
| | | if (Cools.isEmpty(deviceSite)) { |
| | | channel = 0; |
| | |
| | | |
| | | flowStepInstanceService.updateById(flowStepInstance); |
| | | taskService.updateById(task); |
| | | // 盘点再入库任务经 WCS 上报变为 100(库存更新完成)时,同步将盘点差异单置为已审核 |
| | | if (TaskType.TASK_TYPE_CHECK_IN.type.equals(task.getTaskType()) |
| | | && flowStepInstance.getWmsNextTaskStatus() != null |
| | | && flowStepInstance.getWmsNextTaskStatus().equals(TaskStsType.UPDATED_IN.id)) { |
| | | taskService.markCheckDiffApprovedWhenCheckInDone(task); |
| | | } |
| | | if (flowStepInstance.getWmsNextTaskStatus() != 9999) { |
| | | FlowStepInstance nextFlowStepInstance = flowStepInstanceService.getOne(new LambdaQueryWrapper<FlowStepInstance>() |
| | | .eq(FlowStepInstance::getStatus, (short)0) |
| | |
| | | // return R.ok(JSONObject.toJSONString(params)); |
| | | } |
| | | } |
| | | |