|
|
|
@ -6,6 +6,7 @@ import cn.estsh.i3plus.ext.mes.apiservice.utils.BeanUtil;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.utils.MesException;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.model.MesLoadingListDetailModel;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.model.MesShippingOrderManagementDetailModel;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
@ -26,6 +27,7 @@ import cn.estsh.i3plus.pojo.mes.repository.MesProductRecordLogRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import com.google.common.base.Objects;
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import com.xxl.job.core.util.DateUtil;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.hibernate.SQLQuery;
|
|
|
|
|
import org.hibernate.query.internal.NativeQueryImpl;
|
|
|
|
@ -39,10 +41,7 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import javax.persistence.EntityManager;
|
|
|
|
|
import javax.persistence.Query;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
@ -545,7 +544,8 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
List<MesProductAccountResModel> partitionList = partition(mesProductAccountResModels, pager.getPageSize(), pager.getCurrentPage());
|
|
|
|
|
for (MesProductAccountResModel mesProductAccountResModel : partitionList) {
|
|
|
|
|
boolean isErrorCount = false;
|
|
|
|
|
int size = mesProductAccountResModel.getPartNo().split(",").length == 1 ? mesProductAccountResModel.getPartNo().split(";").length : 1;
|
|
|
|
|
int size = mesProductAccountResModel.getPartNo().split(",").length == 1 ? mesProductAccountResModel.getPartNo().split(";").length : mesProductAccountResModel.getPartNo().split(",").length;
|
|
|
|
|
|
|
|
|
|
int productCount = Integer.valueOf(mesProductAccountResModel.getProductCount());
|
|
|
|
|
int detailCount = Integer.valueOf(mesProductAccountResModel.getDetailCount());
|
|
|
|
|
if (detailCount * size > productCount) {
|
|
|
|
@ -564,12 +564,24 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
DdlPreparedPack.getOrderBy("createDatetime", CommonEnumUtil.ASC_OR_DESC.ASC.getValue(), packBean);
|
|
|
|
|
List<MesProductRecordLog> recordLogs = mesProductRecordLogRepository.findByHqlWhere(packBean);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
DdlPackBean packOffilinBean = DdlPackBean.getDdlPackBean("CK01");
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(mesProductAccountResModel.getEquipmentCode(), "equipmentCode", packOffilinBean);
|
|
|
|
|
|
|
|
|
|
Date yesterday = TimeTool.getDateBefore(DateUtil.parseDateTime(productAccountModel.getStartTime()), 1);
|
|
|
|
|
String yesterdayStr = DateUtil.formatDateTime(yesterday);
|
|
|
|
|
DdlPreparedPack.getStringSmallerNotEqualPack(productAccountModel.getStartTime(), "createDatetime", packOffilinBean);
|
|
|
|
|
DdlPreparedPack.getStringBiggerPack(yesterdayStr, "createDatetime", packOffilinBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(mesProductAccountResModel.getPartNo(), "partNo", packOffilinBean);
|
|
|
|
|
DdlPreparedPack.getStringLikerPack("客户端", "message", packOffilinBean);
|
|
|
|
|
|
|
|
|
|
DdlPreparedPack.getOrderBy("createDatetime", CommonEnumUtil.ASC_OR_DESC.ASC.getValue(), packOffilinBean);
|
|
|
|
|
List<MesProductRecordLog> offlineRecordLogs = mesProductRecordLogRepository.findByHqlWhere(packOffilinBean);
|
|
|
|
|
|
|
|
|
|
recordLogs.addAll(offlineRecordLogs);
|
|
|
|
|
recordLogs = recordLogs.stream().sorted(Comparator.comparing(MesProductRecordLog::getCreateDatetime)).collect(Collectors.toList());
|
|
|
|
|
if (mesProductAccountResModel.getEquipmentCode().contains("HT")) {
|
|
|
|
|
// 1 判断2个 shotcount之间有没有加工记录,如果没有,就需要看 设备是不是192,然后看是否是网络原因
|
|
|
|
|
|
|
|
|
|
String reason = handleHT(recordLogs);
|
|
|
|
|
mesProductAccountResModel.setErrorReason(reason);
|
|
|
|
|
} else if (equimentList.contains(mesProductAccountResModel.getEquipmentCode())) {
|
|
|
|
@ -590,16 +602,48 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
String startTime = "";
|
|
|
|
|
String endTime = "";
|
|
|
|
|
String reason = "";
|
|
|
|
|
String reasonOffline = "因其他原因:系统,网络,发版等,导致【%s】的完成信号丢失【%s】个;";
|
|
|
|
|
String offlineReason = "【%s】到【%s】,客户端下线,导致【%s】个完成信号丢失";
|
|
|
|
|
String reasonOffline = "因其他原因:系统,网络,发版等,导致【%s】的完成信号丢失;";
|
|
|
|
|
String reasonQuality = "【%s】设备信号质量为0,导致【%s】个完成信号丢失;";
|
|
|
|
|
String reasonBypass = "【%s】设备打BYPASS,导致【%s】个完成信号丢失;";
|
|
|
|
|
String reasonBypass = "【%s】的完成信号,设备打BYPASS,视为无效;";
|
|
|
|
|
// BYPASS 默认fasle
|
|
|
|
|
boolean bypassFlag = false;
|
|
|
|
|
|
|
|
|
|
boolean offlineFlag = false;
|
|
|
|
|
List<String> finishList = Stream.of("Product_finish","Part_Finish").collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
for (MesProductRecordLog recordLog : recordLogs) {
|
|
|
|
|
int errorCount = 0;
|
|
|
|
|
|
|
|
|
|
/*if (recordLog.getId() ==1834566428726444032l) {
|
|
|
|
|
int a = 1;
|
|
|
|
|
}*/
|
|
|
|
|
if (Objects.equal(recordLog.getType(), "monitor") && recordLog.getMessage().contains("客户端下线")) {
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
offlineFlag = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equal(recordLog.getType(), "monitor") && recordLog.getMessage().contains("客户端上线") ) {
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
offlineFlag = false;
|
|
|
|
|
if (errorCount > 0) {
|
|
|
|
|
reason += String.format(offlineReason, startTime, endTime, errorCount + "");
|
|
|
|
|
errorCount = 0;
|
|
|
|
|
}
|
|
|
|
|
//result = 0;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (offlineFlag &&finishList.contains(recordLog.getCategoryLevelTwo()) && Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
if (result > 0) {
|
|
|
|
|
//endTime = recordLog.getCreateDatetime();
|
|
|
|
|
errorCount ++;
|
|
|
|
|
reason += String.format(offlineReason, startTime, startTime, errorCount + "");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
errorCount ++;
|
|
|
|
|
result++;
|
|
|
|
|
continue ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Objects.equal(recordLog.getCategoryLevelTwo(), "BYPASS")) {
|
|
|
|
|
if (Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
if (StringUtils.isEmpty(startTime)) {
|
|
|
|
@ -628,19 +672,18 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
if (!finishList.contains(recordLog.getCategoryLevelTwo()) || !Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
result ++;
|
|
|
|
|
} else {
|
|
|
|
|
if (finishList.contains(recordLog.getCategoryLevelTwo()) && Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
if (StringUtils.isEmpty(startTime)) {
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
}
|
|
|
|
|
errorCount ++;
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
if (Objects.equal(recordLog.getQuality(), "192")) {
|
|
|
|
|
reason += String.format(reasonOffline,startTime, errorCount +"");
|
|
|
|
|
} else {
|
|
|
|
|
reason += String.format(reasonQuality,startTime, errorCount +"");
|
|
|
|
|
}
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (recordLog.getType().equals("record")) {
|
|
|
|
|
result --;
|
|
|
|
@ -659,12 +702,12 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
// 错误个数
|
|
|
|
|
// 异常原因
|
|
|
|
|
String reason = "";
|
|
|
|
|
String reasonOffline = "因其他原因:系统,网络,发版等,导致【%s】的完成信号丢失【%s】个;";
|
|
|
|
|
String reasonOffline = "因其他原因:系统,网络,发版等,导致【%s】的完成信号丢失;";
|
|
|
|
|
|
|
|
|
|
//String reasonOffline = "【%s】,客户端下线,导致【%s】个完成信号丢失";
|
|
|
|
|
String reasonQuality = "【%s】设备信号质量为0,导致【%s】个完成信号丢失;";
|
|
|
|
|
String reasonBypass = "【%s】设备打BYPASS,导致【%s】个完成信号丢失;";
|
|
|
|
|
String releaseBypass = "【%s】设备在MES没有发允许加工指令的情况下,给了【%s】个完成信号;";
|
|
|
|
|
String offlineReason = "【%s】到【%s】,客户端下线,导致【%s】个完成信号丢失;";
|
|
|
|
|
String reasonQuality = "【%s】设备信号质量为0,视为无效;";
|
|
|
|
|
String reasonBypass = "【%s】的完成信号,设备打BYPASS,视为无效;";
|
|
|
|
|
String releaseBypass = "【%s】的完成信号,未发送Release信号,视为无效;";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// BYPASS 默认fasle
|
|
|
|
@ -672,43 +715,96 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
// release 默认false
|
|
|
|
|
boolean releaseFlag = false;
|
|
|
|
|
|
|
|
|
|
// BYPASS 默认fasle
|
|
|
|
|
boolean offlineFlag = false;
|
|
|
|
|
//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 = "";
|
|
|
|
|
|
|
|
|
|
for (MesProductRecordLog recordLog : recordLogs) {
|
|
|
|
|
int errorCount = 0;
|
|
|
|
|
|
|
|
|
|
// BYPASS 逻辑开始
|
|
|
|
|
// 第一次遇到BYPASS = true, 取下开始时间,后面的加工记录一直增加errorCount 直到出现 BYPASS = FALSE,
|
|
|
|
|
if (Objects.equal(recordLog.getCategoryLevelTwo(), "BYPASS") && Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
if (recordLog.getId() ==1288411771211612170l) {
|
|
|
|
|
int a = 1;
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equal(recordLog.getType(), "monitor") && recordLog.getMessage().contains("客户端下线")) {
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
|
|
|
|
|
offlineFlag = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equal(recordLog.getType(), "monitor") && recordLog.getMessage().contains("客户端上线") ) {
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
bypassFlag = true;
|
|
|
|
|
offlineFlag = false;
|
|
|
|
|
if (result > 0) {
|
|
|
|
|
reason += String.format(offlineReason, startTime, endTime, 1 + "");
|
|
|
|
|
errorCount = 0;
|
|
|
|
|
}
|
|
|
|
|
//result = 0;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 如果是bypass 遇到的所有加工完成指令 都计数并且原因是bypass导致
|
|
|
|
|
if (bypassFlag && finishList.contains(recordLog.getCategoryLevelTwo()) && Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
if (!StringUtils.isEmpty(preReason)) {
|
|
|
|
|
reason += preReason;
|
|
|
|
|
}
|
|
|
|
|
preReason = String.format(reasonBypass,startTime, 1 +"");
|
|
|
|
|
//reason += String.format(reasonBypass,startTime, 1 +"");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (offlineFlag && finishList.contains(recordLog.getCategoryLevelTwo()) && Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
// 如果经过了1个finish,然后再经过客户端下线,再遇到finish则认为是客户端下线引起
|
|
|
|
|
if (result > 0) {
|
|
|
|
|
//endTime = recordLog.getCreateDatetime();
|
|
|
|
|
errorCount ++;
|
|
|
|
|
reason += String.format(offlineReason, startTime, startTime, errorCount + "");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
errorCount ++;
|
|
|
|
|
reason += String.format(reasonBypass,startTime, errorCount +"");
|
|
|
|
|
result++;
|
|
|
|
|
continue ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Objects.equal(recordLog.getCategoryLevelTwo(), "BYPASS") && Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
bypassFlag = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 遇到bypass = false 则重置错误次数
|
|
|
|
|
if (bypassFlag && Objects.equal(recordLog.getCategoryLevelTwo(), "BYPASS") && Objects.equal(recordLog.getEquipVariableValue(), "False")) {
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
errorCount = 0;
|
|
|
|
|
bypassFlag = false;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 如果没有发送release 就出现了加工完成信号,则记录错误原因,且预错误,遇到有加工记录则取消
|
|
|
|
|
/**
|
|
|
|
|
* 没有release有完成信号 需要预处理,先得出一个结论:如果没有发送release指令,导致信号丢失
|
|
|
|
|
* 后面如果没有加工记录,则预处理结果变成实际结果
|
|
|
|
|
* 后面有加工记录则预处理结果清空
|
|
|
|
|
*/
|
|
|
|
|
if (!releaseFlag) {
|
|
|
|
|
if (finishList.contains(recordLog.getCategoryLevelTwo()) && Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
if (!StringUtils.isEmpty(preReason)) {
|
|
|
|
|
reason += preReason;
|
|
|
|
|
}
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
errorCount ++;
|
|
|
|
|
reason += String.format(releaseBypass, startTime, errorCount + "");
|
|
|
|
|
preReason = String.format(releaseBypass, startTime, errorCount + "");
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// BYPASS 逻辑结束 result = 1 代表一个成功新型号,遇到一个加工记录就会-1 变成0
|
|
|
|
|
if (result == 0) {
|
|
|
|
|
// 没有加工完成指令,或者没有release指令,但是有加工记录,则也需要重置
|
|
|
|
|
if (recordLog.getType().equals("record")) {
|
|
|
|
|
releaseFlag = false;
|
|
|
|
|
bypassFlag = false;
|
|
|
|
|
preReason = "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Objects.equal(recordLog.getCategoryLevelTwo(), "Work_Allow") && Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
releaseFlag = true;
|
|
|
|
|
continue;
|
|
|
|
@ -717,28 +813,48 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
if (!finishList.contains(recordLog.getCategoryLevelTwo()) || !Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (!releaseFlag) {
|
|
|
|
|
reason += preReason;
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
preReason = String.format(releaseBypass, startTime, 1 + "");
|
|
|
|
|
result ++;
|
|
|
|
|
continue;
|
|
|
|
|
} if (!StringUtils.isEmpty(preReason)) {
|
|
|
|
|
reason += preReason;
|
|
|
|
|
}
|
|
|
|
|
result ++;
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
if (finishList.contains(recordLog.getCategoryLevelTwo()) && Objects.equal(recordLog.getEquipVariableValue(), "True")) {
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
|
|
|
|
|
errorCount ++;
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
if (Objects.equal(recordLog.getQuality(), "192")) {
|
|
|
|
|
reason += String.format(reasonOffline,startTime, errorCount +"");
|
|
|
|
|
// 上一个加工记录信号还没走完,这边又继续发一个加工记录,且没有release 两个都要判定问题
|
|
|
|
|
if (!releaseFlag) {
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
reason += String.format(releaseBypass, startTime, 1 + "");
|
|
|
|
|
} else {
|
|
|
|
|
reason += String.format(reasonQuality,startTime, errorCount +"");
|
|
|
|
|
if (Objects.equal(recordLog.getQuality(), "192")) {
|
|
|
|
|
reason += String.format(reasonOffline,startTime, 1 +"");
|
|
|
|
|
} else {
|
|
|
|
|
reason += String.format(reasonQuality,startTime, 1 +"");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (recordLog.getType().equals("record")) {
|
|
|
|
|
releaseFlag = false;
|
|
|
|
|
bypassFlag = false;
|
|
|
|
|
offlineFlag = false;
|
|
|
|
|
result --;
|
|
|
|
|
preReason = "";
|
|
|
|
|
startTime = "";
|
|
|
|
|
errorCount = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 如果走到最后,还有预编译的错误,则直接加上
|
|
|
|
|
if (!StringUtils.isEmpty(preReason)) {
|
|
|
|
|
reason += preReason;
|
|
|
|
|
}
|
|
|
|
|
return reason;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -747,11 +863,34 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
String startTime = "";
|
|
|
|
|
String endTime = "";
|
|
|
|
|
String reason = "";
|
|
|
|
|
String reasonOffline = "因其他原因:系统,网络,发版等,导致【%s】的完成信号丢失【%s】个;";
|
|
|
|
|
String reasonQuality = "【%s】设备信号质量为0,导致【%s】个完成信号丢失;";
|
|
|
|
|
String offlineReason = "【%s】到【%s】,客户端下线,导致【%s】个完成信号丢失";
|
|
|
|
|
String reasonOffline = "因其他原因:系统,网络,发版等,导致【%s】的完成信号丢失;";
|
|
|
|
|
String reasonQuality = "【%s】设备信号质量为0,导致完成信号丢失;";
|
|
|
|
|
boolean offlineFlag = false;
|
|
|
|
|
int errorCount = 0;
|
|
|
|
|
|
|
|
|
|
for (MesProductRecordLog recordLog : recordLogs) {
|
|
|
|
|
int errorCount = 0;
|
|
|
|
|
if (recordLog.getId() ==1284126441587343426l) {
|
|
|
|
|
int i = 1;
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equal(recordLog.getType(), "monitor") && recordLog.getMessage().contains("客户端下线")) {
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
offlineFlag = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equal(recordLog.getType(), "monitor") && recordLog.getMessage().contains("客户端上线") && offlineFlag) {
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
offlineFlag = false;
|
|
|
|
|
if (errorCount > 0) {
|
|
|
|
|
reason += String.format(offlineReason, startTime, endTime, errorCount + "");
|
|
|
|
|
errorCount = 0;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (offlineFlag && Objects.equal(recordLog.getCategoryLevelTwo(),"shot_counter") && recordLog.getEquipVariableValue().compareTo("0") > 0) {
|
|
|
|
|
errorCount ++;
|
|
|
|
|
continue ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (result == 0) {
|
|
|
|
|
if (!Objects.equal(recordLog.getCategoryLevelTwo(),"shot_counter") ) {
|
|
|
|
@ -764,12 +903,11 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
if (Objects.equal(recordLog.getCategoryLevelTwo(),"shot_counter") && recordLog.getEquipVariableValue().compareTo("0") > 0) {
|
|
|
|
|
startTime = recordLog.getCreateDatetime();
|
|
|
|
|
|
|
|
|
|
errorCount ++;
|
|
|
|
|
endTime = recordLog.getCreateDatetime();
|
|
|
|
|
if (Objects.equal(recordLog.getQuality(), "192")) {
|
|
|
|
|
reason += String.format(reasonOffline,startTime, errorCount +"");
|
|
|
|
|
reason += String.format(reasonOffline,startTime, 1 +"");
|
|
|
|
|
} else {
|
|
|
|
|
reason += String.format(reasonQuality,startTime, errorCount +"");
|
|
|
|
|
reason += String.format(reasonQuality,startTime, 1 +"");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (recordLog.getType().equals("record")) {
|
|
|
|
@ -777,6 +915,9 @@ public class MesProductionRecordServiceImpl extends BaseMesService<MesProduction
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (errorCount > 0 && offlineFlag) {
|
|
|
|
|
reason += String.format(offlineReason, startTime, "最后", errorCount + "");
|
|
|
|
|
}
|
|
|
|
|
return reason;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|