| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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()); |