再次兼容一下赵玉松"不是同一批次的产品也可以有相同的批次号"的需求!!!

This commit is contained in:
liuchengqian 2022-03-18 14:25:07 +08:00
parent 72a1c46c21
commit f053a7011c

View File

@ -188,7 +188,7 @@ public class QcSourceServiceImpl implements QcSourceService {
continue; continue;
} }
String formatValue = getFormatValue(varietyNo, craftItemNo, qcItemNo, qcValue); String formatValue = getFormatValue(varietyNo, craftItemNo, qcItemNo, qcValue);
Map<String, Object> emptyRoom = findEmptyRoom(resultList, batchNo, qcItemNo); Map<String, Object> emptyRoom = findEmptyRoom(resultList, qcItemNo, batchNo, machineNo, materialNo, mouldNo, varietyNo, craftItemNo);
if (emptyRoom == null) { if (emptyRoom == null) {
Map<String, Object> newRoom = new HashMap<>(); Map<String, Object> newRoom = new HashMap<>();
newRoom.put(EXCEL_HEAD_STYLE_ONE_NO.get(0), batchNo); newRoom.put(EXCEL_HEAD_STYLE_ONE_NO.get(0), batchNo);
@ -242,12 +242,12 @@ public class QcSourceServiceImpl implements QcSourceService {
/** /**
* 尝试找到一个qcItemNo有空位置的Map * 尝试找到一个qcItemNo有空位置的Map
*/ */
private Map<String, Object> findEmptyRoom(List<Map<String, Object>> mapList, String batchNo, String qcItemNo) { private Map<String, Object> findEmptyRoom(List<Map<String, Object>> mapList, String qcItemNo, String batchNo, String machineNo, String materialNo, String mouldNo, String varietyNo, String craftItemNo) {
if (mapList == null || mapList.isEmpty() || TextUtils.isEmpty(batchNo) || TextUtils.isEmpty(qcItemNo)) { if (mapList == null || mapList.isEmpty() || TextUtils.isEmpty(qcItemNo)) {
return null; return null;
} }
for (Map<String, Object> room : mapList) { for (Map<String, Object> 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)) { if (!room.containsKey(qcItemNo)) {
return room; return room;
} }