| | |
| | | @Override |
| | | public R operateToStock(OpStockParams params) { |
| | | if (org.apache.commons.lang3.StringUtils.isBlank(params.getBarcode())) { |
| | | throw new CoolException("托盘码不能为空!!"); |
| | | throw new CoolException("料箱码不能为空!!"); |
| | | } |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, params.getBarcode()) |
| | |
| | | .eq(WaitPakin::getFlagDefect, flagDefect) |
| | | .in(WaitPakin::getIoStatus, asList)); |
| | | // if (!Cools.isEmpty(waitPakin)) { |
| | | // throw new CoolException("托盘不可用,在组托中已存在"); |
| | | // throw new CoolException("料箱不可用,在组托中已存在"); |
| | | // } |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, params.get("barcode").toString())); |
| | | if (!tasks.isEmpty()) { |
| | | throw new CoolException("托盘码已在任务档执行!!"); |
| | | 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("托盘不可用,在库位中已存在"); |
| | | throw new CoolException("料箱不可用,在库位中已存在"); |
| | | } |
| | | // List<WaitPakinItem> items = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, waitPakin.getId())); |
| | | // items.forEach(item -> { |
| | |
| | | */ |
| | | @Override |
| | | public R getDeviceSites() { |
| | | List<DeviceSite> sites = deviceSiteMapper.selectList(new LambdaQueryWrapper<DeviceSite>() |
| | | // 先查全部再按 site 去重,避免 GROUP BY 与 only_full_group_by 冲突 |
| | | List<DeviceSite> all = deviceSiteMapper.selectList(new LambdaQueryWrapper<DeviceSite>() |
| | | .select(DeviceSite::getId, DeviceSite::getSite, DeviceSite::getName) |
| | | .eq(DeviceSite::getStatus, 1) |
| | | .groupBy(DeviceSite::getSite, DeviceSite::getId, DeviceSite::getName)); |
| | | .eq(DeviceSite::getStatus, 1)); |
| | | List<DeviceSite> sites = all.stream() |
| | | .collect(Collectors.toMap(DeviceSite::getSite, d -> d, (a, b) -> a)) |
| | | .values().stream() |
| | | .collect(Collectors.toList()); |
| | | return R.ok(sites); |
| | | } |
| | | |