|
|
|
@ -16,10 +16,8 @@ import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.JsonUtilTool;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.MathOperation;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
@ -843,9 +841,6 @@ public class JxOqcReportFormService implements IJxOqcReportFormService {
|
|
|
|
|
if (null == oqcCheck) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
JxOqcCheckReportModel result = new JxOqcCheckReportModel();
|
|
|
|
|
BeanUtils.copyProperties(oqcCheck, result);
|
|
|
|
|
|
|
|
|
|
resultList.add(packResult4OqcCheckReport(oqcCheck, badnessTypeMap, badnessClassifyMap));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1028,38 +1023,40 @@ public class JxOqcReportFormService implements IJxOqcReportFormService {
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//编码规则
|
|
|
|
|
String[] serialNoArray = numberRuleModel.getNumberRule().split("}\\{");
|
|
|
|
|
//规则属性长度拼接
|
|
|
|
|
String[] ruleLengthSpiltArray = numberRuleModel.getRuleLengthSpilt().split(",");
|
|
|
|
|
String serialNoStr = "serialno";
|
|
|
|
|
int serialNoIndex = -1;
|
|
|
|
|
for (int index = 0; index < serialNoArray.length; index++) {
|
|
|
|
|
if(serialNoArray[index].contains(serialNoStr)) serialNoIndex = index;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ruleLengthTotal = 0;
|
|
|
|
|
if(serialNoIndex != -1){
|
|
|
|
|
for (int index = 0; index < serialNoIndex; index++) {
|
|
|
|
|
ruleLengthTotal += Integer.parseInt(ruleLengthSpiltArray[index]);
|
|
|
|
|
if (!StringUtils.isEmpty(numberRuleModel.getRuleLengthSpilt())) {
|
|
|
|
|
//编码规则
|
|
|
|
|
String[] serialNoArray = numberRuleModel.getNumberRule().split("}\\{");
|
|
|
|
|
//规则属性长度拼接
|
|
|
|
|
String[] ruleLengthSpiltArray = numberRuleModel.getRuleLengthSpilt().split(",");
|
|
|
|
|
String serialNoStr = "serialno";
|
|
|
|
|
int serialNoIndex = -1;
|
|
|
|
|
for (int index = 0; index < serialNoArray.length; index++) {
|
|
|
|
|
if(serialNoArray[index].contains(serialNoStr)) serialNoIndex = index;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int finalRuleLengthTotal = ruleLengthTotal;
|
|
|
|
|
int finalSerialNoIndex = serialNoIndex;
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(model.getBatchLimitStart()) && !StringUtils.isEmpty(model.getBatchLimitEnd())) {
|
|
|
|
|
oqcPackageDetailList = oqcPackageDetailList.stream().filter(oqcCheckPackageDetail ->
|
|
|
|
|
model.getBatchLimitStart() <= Integer.parseInt(oqcCheckPackageDetail.getSerialNumber().substring(finalRuleLengthTotal, finalRuleLengthTotal + Integer.parseInt(ruleLengthSpiltArray[finalSerialNoIndex]))) &&
|
|
|
|
|
model.getBatchLimitEnd() >= Integer.parseInt(oqcCheckPackageDetail.getSerialNumber().substring(finalRuleLengthTotal, finalRuleLengthTotal + Integer.parseInt(ruleLengthSpiltArray[finalSerialNoIndex])))
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
} else if(!StringUtils.isEmpty(model.getBatchLimitStart())){
|
|
|
|
|
oqcPackageDetailList = oqcPackageDetailList.stream().filter(oqcCheckPackageDetail ->
|
|
|
|
|
model.getBatchLimitStart() <= Integer.parseInt(oqcCheckPackageDetail.getSerialNumber().substring(finalRuleLengthTotal, finalRuleLengthTotal + Integer.parseInt(ruleLengthSpiltArray[finalSerialNoIndex])))
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
} else if(!StringUtils.isEmpty(model.getBatchLimitEnd())){
|
|
|
|
|
oqcPackageDetailList = oqcPackageDetailList.stream().filter(oqcCheckPackageDetail ->
|
|
|
|
|
model.getBatchLimitEnd() >= Integer.parseInt(oqcCheckPackageDetail.getSerialNumber().substring(finalRuleLengthTotal, finalRuleLengthTotal + Integer.parseInt(ruleLengthSpiltArray[finalSerialNoIndex])))
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
int ruleLengthTotal = 0;
|
|
|
|
|
if(serialNoIndex != -1){
|
|
|
|
|
for (int index = 0; index < serialNoIndex; index++) {
|
|
|
|
|
ruleLengthTotal += Integer.parseInt(ruleLengthSpiltArray[index]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int finalRuleLengthTotal = ruleLengthTotal;
|
|
|
|
|
int finalSerialNoIndex = serialNoIndex;
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(model.getBatchLimitStart()) && !StringUtils.isEmpty(model.getBatchLimitEnd())) {
|
|
|
|
|
oqcPackageDetailList = oqcPackageDetailList.stream().filter(oqcCheckPackageDetail ->
|
|
|
|
|
model.getBatchLimitStart() <= Integer.parseInt(oqcCheckPackageDetail.getSerialNumber().substring(finalRuleLengthTotal, finalRuleLengthTotal + Integer.parseInt(ruleLengthSpiltArray[finalSerialNoIndex]))) &&
|
|
|
|
|
model.getBatchLimitEnd() >= Integer.parseInt(oqcCheckPackageDetail.getSerialNumber().substring(finalRuleLengthTotal, finalRuleLengthTotal + Integer.parseInt(ruleLengthSpiltArray[finalSerialNoIndex])))
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
} else if(!StringUtils.isEmpty(model.getBatchLimitStart())){
|
|
|
|
|
oqcPackageDetailList = oqcPackageDetailList.stream().filter(oqcCheckPackageDetail ->
|
|
|
|
|
model.getBatchLimitStart() <= Integer.parseInt(oqcCheckPackageDetail.getSerialNumber().substring(finalRuleLengthTotal, finalRuleLengthTotal + Integer.parseInt(ruleLengthSpiltArray[finalSerialNoIndex])))
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
} else if(!StringUtils.isEmpty(model.getBatchLimitEnd())){
|
|
|
|
|
oqcPackageDetailList = oqcPackageDetailList.stream().filter(oqcCheckPackageDetail ->
|
|
|
|
|
model.getBatchLimitEnd() >= Integer.parseInt(oqcCheckPackageDetail.getSerialNumber().substring(finalRuleLengthTotal, finalRuleLengthTotal + Integer.parseInt(ruleLengthSpiltArray[finalSerialNoIndex])))
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(model.getSerialNumber())) {
|
|
|
|
|