| | |
| | | .setTargLoc(targetLoc) |
| | | .setBarcode(pakin.getBarcode()) |
| | | .setOrgSite(deviceSite.getSite()) |
| | | .setTargSite(deviceSite.getDeviceCode()) |
| | | .setTargSite(deviceSite.getDeviceSite()) |
| | | .setCreateBy(loginUserId) |
| | | .setUpdateBy(loginUserId); |
| | | |
| | | if (!Objects.isNull(waitPakin.getLocCode()) && StringUtils.isNotBlank(waitPakin.getLocCode())) { |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, waitPakin.getLocCode())); |
| | | // if (!locs.isEmpty()) { |
| | | // throw new CoolException("库位错误:相同库位应只一条") |
| | | // } |
| | | Loc loc = locs.stream().findFirst().get(); |
| | | task.setTargSite(loc.getCode()); |
| | | } else { |
| | | task.setTargSite(LocManageUtil.getTargetSite()); |
| | | } |
| | | // if (!Objects.isNull(waitPakin.getSiteId()) && waitPakin.getSiteId() > 0) { |
| | | // DeviceSite site = deviceSiteService.getById(waitPakin.getSiteId()); |
| | | // task.setTargSite(site.getSite() + ""); |
| | | // } else { |
| | | // task.setTargSite(LocManageUtil.getTargetSite()); |
| | | // } |
| | | // if (!Objects.isNull(waitPakin.getLocCode()) && StringUtils.isNotBlank(waitPakin.getLocCode())) { |
| | | // List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, waitPakin.getLocCode())); |
| | | //// if (!locs.isEmpty()) { |
| | | //// throw new CoolException("库位错误:相同库位应只一条") |
| | | //// } |
| | | // Loc loc = locs.stream().findFirst().get(); |
| | | // task.setTargSite(loc.getCode()); |
| | | // } else { |
| | | // task.setTargSite(LocManageUtil.getTargetSite()); |
| | | // } |
| | | |
| | | if (!this.save(task)) { |
| | | throw new CoolException("任务保存失败!!"); |
| | |
| | | * @time 2025/4/15 15:28 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | void saveLocItem(List<TaskItem> items, Long taskId) throws Exception { |
| | | public void saveLocItem(List<TaskItem> items, Long taskId) throws Exception { |
| | | Task task = this.getById(taskId); |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("任务不存在!!"); |
| | |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | void saveStockItems(List<TaskItem> items, WaitPakinItem order) throws Exception { |
| | | public void saveStockItems(List<TaskItem> items, WaitPakinItem order) throws Exception { |
| | | Stock stock = new Stock(); |
| | | // if (!Objects.isNull(order.getPoCode()) && StringUtils.isNotBlank(order.getPoCode())) { |
| | | // Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getCode, order.getPoCode())); |