diff --git a/src/main/java/com/xkrs/service/impl/QcSourceServiceImpl.java b/src/main/java/com/xkrs/service/impl/QcSourceServiceImpl.java index 7e0cedb..e06710d 100644 --- a/src/main/java/com/xkrs/service/impl/QcSourceServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/QcSourceServiceImpl.java @@ -188,7 +188,7 @@ public class QcSourceServiceImpl implements QcSourceService { continue; } String formatValue = getFormatValue(varietyNo, craftItemNo, qcItemNo, qcValue); - Map emptyRoom = findEmptyRoom(resultList, batchNo, qcItemNo); + Map emptyRoom = findEmptyRoom(resultList, qcItemNo, batchNo, machineNo, materialNo, mouldNo, varietyNo, craftItemNo); if (emptyRoom == null) { Map newRoom = new HashMap<>(); newRoom.put(EXCEL_HEAD_STYLE_ONE_NO.get(0), batchNo); @@ -242,12 +242,12 @@ public class QcSourceServiceImpl implements QcSourceService { /** * 尝试找到一个qcItemNo有空位置的Map */ - private Map findEmptyRoom(List> mapList, String batchNo, String qcItemNo) { - if (mapList == null || mapList.isEmpty() || TextUtils.isEmpty(batchNo) || TextUtils.isEmpty(qcItemNo)) { + private Map findEmptyRoom(List> mapList, String qcItemNo, String batchNo, String machineNo, String materialNo, String mouldNo, String varietyNo, String craftItemNo) { + if (mapList == null || mapList.isEmpty() || TextUtils.isEmpty(qcItemNo)) { return null; } for (Map room : mapList) { - if (room.getOrDefault("batchNo", "").equals(batchNo)) { + if (room.getOrDefault("batchNo", "").equals(batchNo) && room.getOrDefault("machineNo", "").equals(machineNo) && room.getOrDefault("materialNo", "").equals(materialNo) && room.getOrDefault("mouldNo", "").equals(mouldNo) && room.getOrDefault("varietyNo", "").equals(varietyNo) && room.getOrDefault("craftItemNo", "").equals(craftItemNo)) { if (!room.containsKey(qcItemNo)) { return room; }