| | |
| | | if (barcodeToUse == null && !existTasks.isEmpty()) { |
| | | barcodeToUse = existTasks.get(0).getBarcode(); |
| | | if (StringUtils.isNotBlank(barcodeToUse)) { |
| | | locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getId, loc.getId()) |
| | | .set(Loc::getBarcode, barcodeToUse).set(Loc::getUpdateBy, loginUserId).set(Loc::getUpdateTime, new Date())); |
| | | Task refTask = existTasks.get(0); |
| | | LambdaUpdateWrapper<Loc> locUw = new LambdaUpdateWrapper<Loc>().eq(Loc::getId, loc.getId()) |
| | | .set(Loc::getBarcode, barcodeToUse) |
| | | .set(Loc::getUpdateBy, loginUserId) |
| | | .set(Loc::getUpdateTime, new Date()); |
| | | if (refTask.getWeight() != null) { |
| | | locUw.set(Loc::getWeight, refTask.getWeight()); |
| | | } |
| | | locService.update(locUw); |
| | | } |
| | | } |
| | | if (barcodeToUse == null) { |
| | |
| | | throw new CoolException("目标库位不存在!!"); |
| | | } |
| | | |
| | | targetLoc.setUseStatus(LocStsType.LOC_STS_TYPE_S.type); |
| | | targetLoc.setUseStatus(LocStsType.LOC_STS_TYPE_S.type) |
| | | .setWeight(orgLoc.getWeight()); |
| | | |
| | | if (!locService.updateById(targetLoc)) { |
| | | throw new CoolException("目标库位预约失败!!"); |