|
@@ -177,8 +177,17 @@ public class MesProductLeakagePointStatController extends BaseController {
|
|
|
List<Map<String, Object>> occurrences = new ArrayList<>();
|
|
List<Map<String, Object>> occurrences = new ArrayList<>();
|
|
|
Set<String> countedDefectOccurrences = new LinkedHashSet<>();
|
|
Set<String> countedDefectOccurrences = new LinkedHashSet<>();
|
|
|
Map<String, Set<String>> leakagePointsByProduct = buildLeakagePointsByProduct(hfRecords);
|
|
Map<String, Set<String>> leakagePointsByProduct = buildLeakagePointsByProduct(hfRecords);
|
|
|
|
|
+ // INSP030A/B 的生产记录是总结果的权威来源,优先于气密仪记录,避免重复计数。
|
|
|
|
|
+ List<MesProductRecord> productRecords = findProductRecords(startDate, endDate);
|
|
|
|
|
+ Set<String> productionRecordKeys = new LinkedHashSet<>();
|
|
|
|
|
+ for (MesProductRecord record : productRecords) {
|
|
|
|
|
+ if (matchesDataType(record.getOprno(), dataType)) {
|
|
|
|
|
+ productionRecordKeys.add(leakagePointKey(record.getSn(), record.getOprno()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
for (MesProductQm record : mesProductQmService.findList(query)) {
|
|
for (MesProductQm record : mesProductQmService.findList(query)) {
|
|
|
if (!matchesDataType(record.getOprno(), dataType)) continue;
|
|
if (!matchesDataType(record.getOprno(), dataType)) continue;
|
|
|
|
|
+ if (productionRecordKeys.contains(leakagePointKey(record.getComponentNum(), record.getOprno()))) continue;
|
|
|
if ("OK".equalsIgnoreCase(record.getTestResult())) qualified++;
|
|
if ("OK".equalsIgnoreCase(record.getTestResult())) qualified++;
|
|
|
else {
|
|
else {
|
|
|
Set<String> points = leakagePointsByProduct.get(leakagePointKey(record.getComponentNum(), record.getOprno()));
|
|
Set<String> points = leakagePointsByProduct.get(leakagePointKey(record.getComponentNum(), record.getOprno()));
|
|
@@ -192,7 +201,7 @@ public class MesProductLeakagePointStatController extends BaseController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- for (MesProductRecord record : findProductRecords(startDate, endDate)) {
|
|
|
|
|
|
|
+ for (MesProductRecord record : productRecords) {
|
|
|
if (!matchesDataType(record.getOprno(), dataType)) continue;
|
|
if (!matchesDataType(record.getOprno(), dataType)) continue;
|
|
|
if ("OK".equalsIgnoreCase(record.getContent())) qualified++;
|
|
if ("OK".equalsIgnoreCase(record.getContent())) qualified++;
|
|
|
else {
|
|
else {
|