| | |
| | | .setBarcode(pakin.getBarcode()) |
| | | .setTargSite(deviceSite.getDeviceCode()) |
| | | .setCreateBy(loginUserId) |
| | | .setUpdateBy(loginUserId) |
| | | .setTargSite(LocManageUtil.getTargetSite()); |
| | | .setUpdateBy(loginUserId); |
| | | |
| | | 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("任务保存失败!!"); |
| | | } |
| | |
| | | BeanUtils.copyProperties(item, taskItem); |
| | | AsnOrder order = asnOrderService.getOne(new LambdaQueryWrapper<AsnOrder>().eq(AsnOrder::getId, item.getAsnId())); |
| | | if (Objects.isNull(order)) { |
| | | throw new CoolException("单据不存在!!"); |
| | | throw new CoolException("数据错误: 单据不存在!!"); |
| | | } |
| | | taskItem.setTaskId(task.getId()) |
| | | .setOrderType(OrderType.ORDER_RECEIPT.type) |