|
|
|
@ -3616,6 +3616,7 @@ public class QcServiceImpl implements QcService { |
|
|
|
qcFAIRecordData.setInspectionTypeNo("105"); // 检验类型编码 |
|
|
|
qcFAIRecordData.setPartDesc(recordData.getPartDesc()); |
|
|
|
qcFAIRecordData.setRollQty(recordData.getRollQty()); |
|
|
|
qcFAIRecordData.setSamplingQty(recordData.getSamplingQty()); |
|
|
|
// 明细记录信息赋值 |
|
|
|
String partNo = recordData.getPartNo(); |
|
|
|
String attributeType1 = "A"; |
|
|
|
@ -3628,27 +3629,27 @@ public class QcServiceImpl implements QcService { |
|
|
|
} |
|
|
|
// 获取抽样数量 |
|
|
|
// 如果该检验模板有维护抽样方案 |
|
|
|
if (StringUtils.isNotBlank(partAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSite(partAttribute.get(0).getSite()); |
|
|
|
samplingInspectionProgrammeData.setBuNo(partAttribute.get(0).getBuNo()); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 根据抽样方案确定抽样数 |
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
if (programmeData.getSamplingLevelNo().equals(partAttribute.get(0).getSamplingLevelNo()) && (recordData.getRollCount().compareTo(programmeData.getMinQty()) > 0 || recordData.getRollCount().compareTo(programmeData.getMinQty()) == 0) && (recordData.getRollCount().compareTo(programmeData.getMaxQty()) < 0 || recordData.getRollCount().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
qcFAIRecordData.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (partAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
qcFAIRecordData.setSamplingQty(partAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
} else if (partAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
BigDecimal d = partAttribute.get(0).getDefaultSamplingProportion().multiply(recordData.getRollCount()).divide(new BigDecimal(100), 3, BigDecimal.ROUND_HALF_UP); |
|
|
|
qcFAIRecordData.setSamplingQty(d); |
|
|
|
} |
|
|
|
// if (StringUtils.isNotBlank(partAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
// QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
// samplingInspectionProgrammeData.setSite(partAttribute.get(0).getSite()); |
|
|
|
// samplingInspectionProgrammeData.setBuNo(partAttribute.get(0).getBuNo()); |
|
|
|
// samplingInspectionProgrammeData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// // 获取抽样方案维护的矩阵详情 |
|
|
|
// List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// // 根据抽样方案确定抽样数 |
|
|
|
// for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
// if (programmeData.getSamplingLevelNo().equals(partAttribute.get(0).getSamplingLevelNo()) && (recordData.getRollCount().compareTo(programmeData.getMinQty()) > 0 || recordData.getRollCount().compareTo(programmeData.getMinQty()) == 0) && (recordData.getRollCount().compareTo(programmeData.getMaxQty()) < 0 || recordData.getRollCount().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
// qcFAIRecordData.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } else if (partAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// // 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
// qcFAIRecordData.setSamplingQty(partAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
// } else if (partAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// // 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
// BigDecimal d = partAttribute.get(0).getDefaultSamplingProportion().multiply(recordData.getRollCount()).divide(new BigDecimal(100), 3, BigDecimal.ROUND_HALF_UP); |
|
|
|
// qcFAIRecordData.setSamplingQty(d); |
|
|
|
// } |
|
|
|
|
|
|
|
// 获取根据该检验模板下维护的检验项目 |
|
|
|
QcTemplateData templateData = new QcTemplateData(); |
|
|
|
@ -3721,26 +3722,26 @@ public class QcServiceImpl implements QcService { |
|
|
|
} |
|
|
|
// 获取抽样数量 |
|
|
|
// 如果该检验模板有维护抽样方案 |
|
|
|
if (StringUtils.isNotBlank(familyAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSite(familyAttribute.get(0).getSite()); |
|
|
|
samplingInspectionProgrammeData.setBuNo(familyAttribute.get(0).getBuNo()); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(familyAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 根据抽样方案确定抽样数 |
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
if (programmeData.getSamplingLevelNo().equals(familyAttribute.get(0).getSamplingLevelNo()) && (recordData.getRollCount().compareTo(programmeData.getMinQty()) > 0 || recordData.getRollCount().compareTo(programmeData.getMinQty()) == 0) && (recordData.getRollCount().compareTo(programmeData.getMaxQty()) < 0 || recordData.getRollCount().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
qcFAIRecordData.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (familyAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
qcFAIRecordData.setSamplingQty(familyAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
} else if (familyAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
qcFAIRecordData.setSamplingQty(familyAttribute.get(0).getDefaultSamplingProportion().multiply(qcFAIRecordData.getRollCount()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
// if (StringUtils.isNotBlank(familyAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
// QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
// samplingInspectionProgrammeData.setSite(familyAttribute.get(0).getSite()); |
|
|
|
// samplingInspectionProgrammeData.setBuNo(familyAttribute.get(0).getBuNo()); |
|
|
|
// samplingInspectionProgrammeData.setSamplingProgrammeNo(familyAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// // 获取抽样方案维护的矩阵详情 |
|
|
|
// List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// // 根据抽样方案确定抽样数 |
|
|
|
// for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
// if (programmeData.getSamplingLevelNo().equals(familyAttribute.get(0).getSamplingLevelNo()) && (recordData.getRollCount().compareTo(programmeData.getMinQty()) > 0 || recordData.getRollCount().compareTo(programmeData.getMinQty()) == 0) && (recordData.getRollCount().compareTo(programmeData.getMaxQty()) < 0 || recordData.getRollCount().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
// qcFAIRecordData.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } else if (familyAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// // 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
// qcFAIRecordData.setSamplingQty(familyAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
// } else if (familyAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// // 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
// qcFAIRecordData.setSamplingQty(familyAttribute.get(0).getDefaultSamplingProportion().multiply(qcFAIRecordData.getRollCount()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
// } |
|
|
|
|
|
|
|
// 获取根据该检验模板下维护的检验项目 |
|
|
|
QcTemplateData templateData = new QcTemplateData(); |
|
|
|
@ -4043,13 +4044,6 @@ public class QcServiceImpl implements QcService { |
|
|
|
System.out.println("字符串转换数值失败(receiptItemNo): " + inData.getReceiptItemNo()); |
|
|
|
} |
|
|
|
String inspectDate = sdf.format(inData.getInspectorDate()); |
|
|
|
// Date inspectDate; |
|
|
|
// try { |
|
|
|
// String format = sdf.format(inData.getInspectorDate()); |
|
|
|
// inspectDate = sdf.parse(format); // 检验日期 |
|
|
|
// } catch (ParseException e) { |
|
|
|
// throw new RuntimeException("检验日期处理失败:", e); |
|
|
|
// } |
|
|
|
Float arriveQty = inData.getRollCount().floatValue(); // 送检数量 |
|
|
|
Float qtyInspected = inData.getSamplingQty().floatValue(); // 检验数量/抽样数量 |
|
|
|
Float qtyApproved = inData.getPassQty() == null ? 0 : inData.getPassQty().floatValue();// 合格数量 |
|
|
|
|