| | |
| | | listMap.keySet().forEach(key -> { |
| | | Task task = new Task(); |
| | | Loc loc = locService.getById(key); |
| | | logger.info("库位:>{}<UNK>", loc.getCode()); |
| | | |
| | | logger.info("库位:>{}", loc.getCode()); |
| | | if (Objects.isNull(loc)) { |
| | | throw new CoolException("数据错误:所选库存信息不存在!!"); |
| | | } |
| | | if (!loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) { |
| | | throw new CoolException("库位:" + loc.getCode() + ",不处于F.在库状态,不可执行R.出库预约操作!!"); |
| | | throw new CoolException("库位:" + loc.getCode() + ",不处于F.在库状态,不可执行R.出库预约操作!!"); |
| | | } |
| | | |
| | | loc.setUseStatus(LocStsType.LOC_STS_TYPE_R.type); |
| | |
| | | .setUpdateTime(new Date()) |
| | | .setOrderType(OrderType.ORDER_OUT.type) |
| | | .setWkType(Short.parseShort(OrderWorkType.ORDER_WORK_TYPE_STOCK_OUT.type)); |
| | | if (map.getType().equals(Constants.TASK_TYPE_ORDER_OUT_STOCK)) { |
| | | if (map.getType().equals(Constants.TASK_TYPE_ORDER_OUT_STOCK)) { |
| | | taskItem.setWkType(Short.parseShort(order.getWkType())) |
| | | .setSourceCode(order.getCode()) |
| | | .setSourceId(order.getId()); |
| | | } else if (map.getType().equals(Constants.TASK_TYPE_OUT_CHECK) || map.getType().equals(Constants.TASK_TYPE_OUT_STOCK)) { |
| | | taskItem.setSource(item.getId()) |
| | | .setSourceId(item.getLocId()) |
| | | .setSourceCode(item.getLocCode()); |
| | | } |
| | | } else if (map.getType().equals(Constants.TASK_TYPE_OUT_CHECK) || map.getType().equals(Constants.TASK_TYPE_OUT_STOCK)) { |
| | | taskItem.setSource(item.getId()) |
| | | .setSourceId(item.getLocId()) |
| | | .setSourceCode(item.getLocCode()); |
| | | } |
| | | taskItems.add(taskItem); |
| | | |
| | | Double qty = Math.round((item.getWorkQty() + item.getOutQty()) * 10000) / 10000.0; |
| | |
| | | if (Objects.isNull(map.getTarLoc()) || StringUtils.isBlank(map.getTarLoc())) { |
| | | //目标库位为空,自动获取新库位 |
| | | DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | .eq(DeviceSite::getType, TaskType.TASK_TYPE_LOC_MOVE.type) |
| | | .eq(DeviceSite::getType, TaskType.TASK_TYPE_LOC_MOVE.type) |
| | | .eq(DeviceSite::getChannel, orgLoc.getChannel()), false); |
| | | if (Objects.isNull(deviceSite)) { |
| | | throw new CoolException("站点信息不存在!!"); |