|
|
|
@ -736,10 +736,10 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
//List<String> finishList = Stream.of("Product_finish","PART_OK","Part_Finish","Product_OK").collect(Collectors.toList());
|
|
|
|
|
List<String> finishList = Stream.of("Product_finish","Part_Finish").collect(Collectors.toList());
|
|
|
|
|
String preReason = "";
|
|
|
|
|
int errorCount = 0;
|
|
|
|
|
|
|
|
|
|
for (MesProductRecordLog recordLog : recordLogs) {
|
|
|
|
|
int errorCount = 0;
|
|
|
|
|
if (recordLog.getId() ==1838536264741601280l) {
|
|
|
|
|
if (recordLog.getId() ==1846373460483817472l) {
|
|
|
|
|
int a = 1;
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equal(recordLog.getType(), "monitor") && recordLog.getMessage().contains("客户端下线")) {
|
|
|
|
@ -748,13 +748,24 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equal(recordLog.getType(), "monitor") && recordLog.getMessage().contains("客户端上线") ) {
|
|
|
|
|
if (!offlineFlag) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
offlineFlag = false;
|
|
|
|
|
if (result > 0) {
|
|
|
|
|
reason += String.format(offlineReason, startTime, endTime, 1 + "");
|
|
|
|
|
|
|
|
|
|
if (errorCount > 0) {
|
|
|
|
|
reason += String.format(offlineReason, startTime, endTime, errorCount + "");
|
|
|
|
|
preReason = "";
|
|
|
|
|
result = 0;
|
|
|
|
|
errorCount = 0;
|
|
|
|
|
} else {
|
|
|
|
|
if (result > 0) {
|
|
|
|
|
reason += String.format(offlineReason, startTime, endTime, 1 + "");
|
|
|
|
|
preReason = "";
|
|
|
|
|
result = 0;
|
|
|
|
|
errorCount = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//result = 0;
|
|
|
|
|
continue;
|
|
|
|
@ -772,14 +783,15 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
// 如果经过了1个finish,然后再经过客户端下线,再遇到finish则认为是客户端下线引起,如果没有需要预处理一个下线的原因
|
|
|
|
|
errorCount ++;
|
|
|
|
|
if (result > 0) {
|
|
|
|
|
reason += preReason;
|
|
|
|
|
//reason += preReason;
|
|
|
|
|
preReason = String.format(offlineReason, endTime, recordLog.getCreateDatetime(), errorCount + "");
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
continue;
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
/*else {
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
preReason = String.format(offlineReason, startTime,endTime, errorCount + "");
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
result++;
|
|
|
|
|
continue ;
|
|
|
|
|
}
|
|
|
|
@ -887,10 +899,10 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
//List<String> finishList = Stream.of("Product_finish","PART_OK","Part_Finish","Product_OK").collect(Collectors.toList());
|
|
|
|
|
List<String> finishList = Stream.of("Product_finish","Part_Finish").collect(Collectors.toList());
|
|
|
|
|
String preReason = "";
|
|
|
|
|
int errorCount = 0;
|
|
|
|
|
|
|
|
|
|
for (MesProductRecordLog recordLog : recordLogs) {
|
|
|
|
|
int errorCount = 0;
|
|
|
|
|
if (recordLog.getId() ==1838551951325315072l) {
|
|
|
|
|
if (recordLog.getId() ==1296257140498948096l) {
|
|
|
|
|
int a = 1;
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equal(recordLog.getType(), "monitor") && recordLog.getMessage().contains("客户端下线")) {
|
|
|
|
@ -928,18 +940,28 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
if (offlineFlag && finishList.contains(recordLog.getCategoryLevelTwo()) && Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
// 如果经过了1个finish,然后再经过客户端下线,再遇到finish则认为是客户端下线引起,如果没有需要预处理一个下线的原因
|
|
|
|
|
errorCount ++;
|
|
|
|
|
|
|
|
|
|
if (result > 0) {
|
|
|
|
|
//reason += preReason;
|
|
|
|
|
preReason = String.format(offlineReason, endTime, recordLog.getCreateDatetime(), errorCount + "");
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
/*if (result > 0) {
|
|
|
|
|
reason += String.format(offlineReason, startTime, startTime, errorCount + "");
|
|
|
|
|
continue;
|
|
|
|
|
} else {
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
preReason = String.format(offlineReason, startTime,endTime, errorCount + "");
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
result++;
|
|
|
|
|
continue ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Objects.equal(recordLog.getCategoryLevelTwo(), "BYPASS") && Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
if (offlineFlag) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 如果有finish然后遇到bypass 需要预处理
|
|
|
|
|
if (result > 0) {
|
|
|
|
|
reason += String.format(reasonBypass,startTime, 1 +"");
|
|
|
|
@ -953,6 +975,9 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
|
|
|
|
|
// 遇到bypass = false 则重置错误次数
|
|
|
|
|
if (bypassFlag && Objects.equal(recordLog.getCategoryLevelTwo(), "BYPASS") && Objects.equal(recordLog.getEquipVariableValue(), "False")) {
|
|
|
|
|
if (offlineFlag) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
errorCount = 0;
|
|
|
|
|
bypassFlag = false;
|
|
|
|
|