| | |
| | | .last("limit 1"); |
| | | Task task = taskService.getOne(lambdaQueryWrapper); |
| | | if (null == task) { |
| | | throw new CoolException("未找到容器号对应任务"); |
| | | throw new CoolException("未找到料箱码对应任务"); |
| | | } |
| | | // 允许 199(WAVE_SEED 播种中/待确认)或 196(AWAIT 等待确认),与盘点 PDA 逻辑一致 |
| | | if (!task.getTaskStatus().equals(TaskStsType.WAVE_SEED.id) |
| | |
| | | .orderByDesc(Task::getId) |
| | | .last("limit 1")); |
| | | if (null == task) { |
| | | throw new CoolException("未找到容器号对应任务"); |
| | | throw new CoolException("未找到料箱码对应任务"); |
| | | } |
| | | if (!task.getTaskStatus().equals(TaskStsType.WAVE_SEED.id)) { |
| | | return R.error("任务状态不是揀料狀態"); |
| | |
| | | // containerWaveDto.setTaskItem(taskItem); |
| | | // Wave wave = waveService.getById(taskItem.getSourceId()); |
| | | // if (null == wave) { |
| | | // throw new CoolException("未找到容器号对应波次"); |
| | | // throw new CoolException("未找到料箱码对应波次"); |
| | | // } |
| | | // List<WaveOrderRela> waveOrderRelas = waveOrderRelaService.list(new LambdaQueryWrapper<WaveOrderRela>() |
| | | // .eq(WaveOrderRela::getWaveId, wave.getId())); |
| | |
| | | if (Objects.isNull(param)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(param.get("fieldsIndex"))) { |
| | | return R.error("票号不能为空!!"); |
| | | } |
| | | // 票号暂不使用,注释校验 |
| | | // if (Objects.isNull(param.get("fieldsIndex"))) { |
| | | // return R.error("票号不能为空!!"); |
| | | // } |
| | | if (Objects.isNull(param.get("barcode"))) { |
| | | return R.error("容器号不能为空!!"); |
| | | return R.error("料箱码不能为空!!"); |
| | | } |
| | | if (Objects.isNull(param.get("orderId"))) { |
| | | return R.error("订单ID不能为空!!"); |
| | |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("数据错误,任务档已不存在!!"); |
| | | } |
| | | FieldsItem fieldsItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>() |
| | | .eq(FieldsItem::getValue, param.get("fieldsIndex").toString()) |
| | | .last("limit 1")); |
| | | if (Objects.isNull(fieldsItem)) { |
| | | return R.error("数据错误,票号不存在!!"); |
| | | } |
| | | TaskItem taskItem = taskItemService.getOne(new LambdaQueryWrapper<TaskItem>() |
| | | // 票号暂不使用,按任务取第一条明细 |
| | | // FieldsItem fieldsItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>() |
| | | // .eq(FieldsItem::getValue, param.get("fieldsIndex").toString()) |
| | | // .last("limit 1")); |
| | | // if (Objects.isNull(fieldsItem)) { |
| | | // return R.error("数据错误,票号不存在!!"); |
| | | // } |
| | | TaskItem taskItem = null; |
| | | FieldsItem fieldsItem = null; |
| | | if (param.get("fieldsIndex") != null && StringUtils.isNotBlank(param.get("fieldsIndex").toString())) { |
| | | fieldsItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>() |
| | | .eq(FieldsItem::getValue, param.get("fieldsIndex").toString()) |
| | | .last("limit 1")); |
| | | if (fieldsItem != null) { |
| | | taskItem = taskItemService.getOne(new LambdaQueryWrapper<TaskItem>() |
| | | .eq(TaskItem::getFieldsIndex, fieldsItem.getUuid()) |
| | | .eq(TaskItem::getTaskId, task.getId())); |
| | | .eq(TaskItem::getTaskId, task.getId())); |
| | | } |
| | | } |
| | | if (taskItem == null) { |
| | | taskItem = taskItemService.getOne(new LambdaQueryWrapper<TaskItem>() |
| | | .eq(TaskItem::getTaskId, task.getId()) |
| | | .last("limit 1")); |
| | | } |
| | | if (Objects.isNull(taskItem)) { |
| | | return R.error("数据错误,任务档明细不存在!!"); |
| | | } |
| | | // Long orderId = Long.valueOf(param.get("orderId").toString()); |
| | | // List<WkOrderItem> orderItems = asnOrderItemService.list(new LambdaQueryWrapper<WkOrderItem>().eq(WkOrderItem::getOrderId, orderId)); |
| | | // if (orderItems.isEmpty()) { |
| | | // return R.error("数据错误,订单数据不存在!!"); |
| | | // } |
| | | //根据索引获取动态字段Value值 |
| | | Map<String, String> fields = new HashMap<>(); |
| | | Fields fields1 = fieldsService.getById(fieldsItem.getFieldsId()); |
| | | fields.put(fields1.getFields(), fieldsItem.getValue()); |
| | | taskItem.setExtendFields(fields); |
| | | // 票号暂不使用:仅当有 fieldsItem 时设置 extendFields |
| | | if (fieldsItem != null) { |
| | | Fields fields1 = fieldsService.getById(fieldsItem.getFieldsId()); |
| | | if (fields1 != null) { |
| | | Map<String, String> fields = new HashMap<>(); |
| | | fields.put(fields1.getFields(), fieldsItem.getValue()); |
| | | taskItem.setExtendFields(fields); |
| | | } |
| | | } |
| | | |
| | | return R.ok().add(taskItem); |
| | | } |
| | |
| | | throw new CoolException("缓存数据丢失!!"); |
| | | } |
| | | Double v1 = Math.round((workItem.getAnfme() - serviceOne.getQty()) * 1000000) / 1000000.0; |
| | | //不管是否允许超收,都需判断是否超出库存范围 |
| | | if (taskItem.getAnfme().compareTo(v1) > 0) { |
| | | throw new CoolException("拣货数量超出当前票号库存数量!!"); |
| | | } |
| | | //不管是否允许超收,都需判断是否超出库存范围(票号暂不使用,该判断注释) |
| | | // if (taskItem.getAnfme().compareTo(v1) > 0) { |
| | | // throw new CoolException("拣货数量超出当前票号库存数量!!"); |
| | | // } |
| | | if (!Boolean.parseBoolean(config.getVal())) { |
| | | Double v = Math.round((item.getQty() + taskItem.getAnfme()) * 1000000) / 1000000.0; |
| | | if (item.getAnfme().compareTo(v) < 0.0) { |
| | |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | for (TaskItem item : items) { |
| | | // 票号暂不使用,跳过修改出库任务档明细票号逻辑 |
| | | continue; |
| | | /* |
| | | if (Objects.isNull(item.getCrushNo())) { |
| | | continue; |
| | | } |
| | |
| | | Map<String, String> fields = FieldsUtils.getFields(byId.getFieldsIndex()); |
| | | byId.setExtendFields(fields); |
| | | } |
| | | if (byId.getExtendFields().get("crushNo").equals(item.getCrushNo())) { |
| | | if (byId.getExtendFields() != null && byId.getExtendFields().get("crushNo") != null && byId.getExtendFields().get("crushNo").equals(item.getCrushNo())) { |
| | | continue; |
| | | } |
| | | FieldsItem fieldsItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>() |
| | |
| | | //更新库位信息 |
| | | locItemWorkingService.updateById(oldOne); |
| | | locItemWorkingService.updateById(one); |
| | | |
| | | */ |
| | | } |
| | | return R.ok(); |
| | | } |