| | |
| | | private TaskItemService taskItemService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private CusBarcodeSyncMatnrService cusBarcodeSyncMatnrService; |
| | | |
| | | /** |
| | | * 云仓改单/取消前:任务明细已关联该单据且主任务未逻辑删除则不允许 |
| | |
| | | return; |
| | | } |
| | | assertWkOrderExceStatusUnexecuted(order, "取消"); |
| | | } |
| | | |
| | | private void syncMatnrFromCusItemSyncViewByConfig(List<SyncOrdersItem> orderItems, Long loginUserId) { |
| | | cusBarcodeSyncMatnrService.syncFromOrderItems(orderItems, loginUserId); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R syncLocsDetl(PageParam<Loc, BaseParam> pageParam, QueryWrapper<Loc> wrapper) { |
| | | Page<Object> page = new Page<>(); |
| | | page.setCurrent(pageParam.getCurrent()).setSize(pageParam.getSize()); |
| | | IPage<LocStockDto> locStocks = locService.getLocDetls(page); |
| | | BaseParam bp = pageParam.getWhere(); |
| | | Map<String, Object> conds = bp != null && bp.getMap() != null ? bp.getMap() : Collections.emptyMap(); |
| | | IPage<LocStockDto> locStocks = locService.getLocDetls(page, conds); |
| | | return R.ok().add(locStocks); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | // 按配置同步物料主数据(none 时不影响通知档写入主流程) |
| | | syncMatnrFromCusItemSyncViewByConfig(syncOrder.getOrderItems(), loginUserId); |
| | | WkOrder wkOrder = new WkOrder(); |
| | | String wkTypeInput = syncOrder.getWkType(); |
| | | String typeCode = StringUtils.isBlank(wkTypeInput) ? null : orderWorkTypeService.getTypeByLabel(wkTypeInput); |
| | |
| | | if (!Cools.isEmpty(param.getPlanNo())) { |
| | | wrapper.eq(LocItem::getPlatWorkCode, param.getPlanNo()); |
| | | } |
| | | // 仓库、料箱码按库位 id 交集过滤 |
| | | List<Long> allowedLocIds = null; |
| | | if (!Cools.isEmpty(param.getWareHouseId())) { |
| | | Warehouse wh = warehouseService.getOne(new LambdaQueryWrapper<Warehouse>().eq(Warehouse::getCode, param.getWareHouseId())); |
| | | if (wh != null) { |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getWarehouseId, wh.getId())); |
| | | if (!locs.isEmpty()) { |
| | | wrapper.in(LocItem::getLocId, locs.stream().map(Loc::getId).collect(Collectors.toList())); |
| | | } else { |
| | | return R.ok().add(Collections.emptyList()); |
| | | } |
| | | } else { |
| | | if (wh == null) { |
| | | return R.ok().add(Collections.emptyList()); |
| | | } |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getWarehouseId, wh.getId())); |
| | | if (locs.isEmpty()) { |
| | | return R.ok().add(Collections.emptyList()); |
| | | } |
| | | allowedLocIds = locs.stream().map(Loc::getId).collect(Collectors.toList()); |
| | | } |
| | | if (!Cools.isEmpty(param.getBarcode())) { |
| | | LambdaQueryWrapper<Loc> lw = new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, param.getBarcode()); |
| | | if (allowedLocIds != null) { |
| | | lw.in(Loc::getId, allowedLocIds); |
| | | } |
| | | List<Loc> locs = locService.list(lw); |
| | | if (locs.isEmpty()) { |
| | | return R.ok().add(Collections.emptyList()); |
| | | } |
| | | allowedLocIds = locs.stream().map(Loc::getId).collect(Collectors.toList()); |
| | | } |
| | | if (allowedLocIds != null) { |
| | | wrapper.in(LocItem::getLocId, allowedLocIds); |
| | | } |
| | | List<LocItem> list = locItemService.list(wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | |
| | | row.put("wareHouseId", null); |
| | | row.put("wareHouseName", null); |
| | | } |
| | | row.put("barcode", loc != null ? loc.getBarcode() : null); |
| | | row.put("palletId", item.getTrackCode()); |
| | | row.put("matNr", item.getMatnrCode()); |
| | | row.put("makTx", item.getMaktx()); |