获取物料出库批次差异null修改

This commit is contained in:
yf001217 2026-03-20 10:58:17 +08:00
parent a55d503c83
commit 5a47d42c33
2 changed files with 26 additions and 8 deletions

View File

@ -136,11 +136,13 @@ public class LocationTransferController extends BaseController {
.collect(Collectors.toList()).size();
VUtil.trueThrowBusinessError(count2 > 0).throwMessage("存在不同仓库的二维码");
boolean hasDuplicates1 = allQcMasters.stream()
.map(WmsQrCodeMaster::getBarcodeCode)
.collect(Collectors.toSet())
.size() != request.getItems().size();
VUtil.trueThrowBusinessError(!hasDuplicates1).throwMessage("存在同时扫箱码和箱中物料码的情况");
// boolean hasDuplicates1 = allQcMasters.stream()
// .map(WmsQrCodeMaster::getBarcodeCode)
// .collect(Collectors.toSet())
// .size() != request.getItems().size();
// VUtil.trueThrowBusinessError(!hasDuplicates1).throwMessage("存在同时扫箱码和箱中物料码的情况");
List<WmsTransferOrders> transferOrders = new ArrayList<>();
List<InventoryOutDTO> outBoundInventory = new ArrayList<>();

View File

@ -138,14 +138,30 @@ public class ScanRecordController extends BaseController {
v.stream()
.collect(Collectors.groupingBy(OutMaterialScanRecord::getKey9))
.forEach((key, vv) -> {
List<String> keyParts = StrUtil.split(key, "|");
String scanBatchNo = "";
if (keyParts.size() > 1) {
scanBatchNo = "null".equals(keyParts.get(1)) ? "" : keyParts.get(1);
}
String scanSerialNo = "";
if (keyParts.size() > 2) {
scanSerialNo = "null".equals(keyParts.get(2)) ? "" : keyParts.get(2);
}
String scanBinNo = "";
if (keyParts.size() > 3) {
scanBinNo = keyParts.get(3);
}
vo.getItems().add(new OutDifferenceItemVO()
.setRecommendbatchNo("")
.setRecommendSerialNo("")
.setRecommendBinNo("")
// .setRecommendNum(BigDecimal.ZERO)
.setScanBatchNo(StrUtil.split(key, "|").get(1))
.setScanSerialNo(StrUtil.split(key, "|").get(2))
.setScanBinNo(StrUtil.split(key, "|").get(3))
// .setScanBatchNo(StrUtil.split(key, "|").get(1))
// .setScanSerialNo(StrUtil.split(key, "|").get(2))
// .setScanBinNo(StrUtil.split(key, "|").get(3))
.setScanBatchNo(scanBatchNo)
.setScanSerialNo(scanSerialNo)
.setScanBinNo(scanBinNo)
.setScanNum(vv.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add)));
});
});