| | |
| | | .or().eq(!Cools.isEmpty(matnrCode), WarehouseAreasItem::getMatnrCode, matnrCode) |
| | | .or().eq(!Cools.isEmpty(asnCode), WarehouseAreasItem::getAsnCode, asnCode); |
| | | List<WarehouseAreasItem> list = warehouseAreasItemService.list(queryWrapper); |
| | | list.removeIf(e -> e.getAnfme() <= e.getWorkQty()); |
| | | if (!list.isEmpty()) { |
| | | list.removeIf(e -> e.getAnfme() <= e.getWorkQty()); |
| | | } |
| | | list.forEach(item -> { |
| | | Map<String, String> fields = FieldsUtils.getFields(item.getFieldsIndex()); |
| | | item.setExtendFields(fields); |
| | |
| | | */ |
| | | @Override |
| | | public R getItemByContainer(Map<String, Object> params) { |
| | | // if (Objects.isNull(params.get("code"))) { |
| | | // throw new CoolException("参数不能为空!!"); |
| | | // } |
| | | //获取组拖未生成任务的组拖档 |
| | | List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | Short flagDefect = 0; |
| | | if (!Objects.isNull(params.get("type")) && params.get("type").equals("defective")) { |
| | | flagDefect = 1; |
| | | } |
| | | List<WaitPakin> waitPakin = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>() |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, params.get("barcode").toString()) |
| | | // .eq(WaitPakin::getFlagDefect, flagDefect) |
| | | .eq(WaitPakin::getFlagDefect, flagDefect) |
| | | .in(WaitPakin::getIoStatus, asList)); |
| | | if (!Cools.isEmpty(waitPakin)) { |
| | | throw new CoolException("托盘不可用,在组托中已存在"); |
| | | // if (!Cools.isEmpty(waitPakin)) { |
| | | // throw new CoolException("托盘不可用,在组托中已存在"); |
| | | // } |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, params.get("barcode").toString())); |
| | | if (!tasks.isEmpty()) { |
| | | throw new CoolException("托盘码已在任务档执行!!"); |
| | | } |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, params.get("barcode").toString())); |
| | | if (!Cools.isEmpty(locs)) { |
| | | throw new CoolException("托盘不可用,在库位中已存在"); |
| | | } |
| | | return R.ok("托盘可用"); |
| | | // List<WaitPakinItem> items = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, waitPakin.getId())); |
| | | // items.forEach(item -> { |
| | | // FieldsItem fieldsItem = fieldsItemService.getOne(new LambdaQueryWrapper<FieldsItem>().eq(FieldsItem::getUuid, item.getFieldsIndex()).last("limit 1")); |
| | | // if (!Objects.isNull(fieldsItem) && !Objects.isNull(item.getFieldsIndex())) { |
| | | // Map<String, String> fields = FieldsUtils.getFields(item.getFieldsIndex()); |
| | | // item.setExtendFields(fields); |
| | | // } |
| | | // }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (Cools.isEmpty(params.get("barcode")) && Cools.isEmpty(params.get("code"))) { |
| | | throw new CoolException("容器号与组托档编码不能全为空"); |
| | | } |
| | | //获取组拖未生成任务的组拖档 |
| | | // List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(!Cools.isEmpty(params.get("barcode")), WaitPakin::getBarcode, params.get("barcode")) |
| | | .eq(!Cools.isEmpty(params.get("code")), WaitPakin::getCode, params.get("code")) |