|
|
@ -1803,7 +1803,7 @@ public class QcServiceImpl implements QcService { |
|
|
// 主记录信息赋值 |
|
|
// 主记录信息赋值 |
|
|
qcFAIRecordData.setState("待检验"); // 状态 |
|
|
qcFAIRecordData.setState("待检验"); // 状态 |
|
|
qcFAIRecordData.setInspectionTypeNo("101"); // 检验类型编码 |
|
|
qcFAIRecordData.setInspectionTypeNo("101"); // 检验类型编码 |
|
|
qcFAIRecordData.setCheckType("末件检"); |
|
|
|
|
|
|
|
|
qcFAIRecordData.setCheckType("首件检"); |
|
|
qcFAIRecordData.setOrderNo(recordData.getOrderNo()); // 工单号 |
|
|
qcFAIRecordData.setOrderNo(recordData.getOrderNo()); // 工单号 |
|
|
qcFAIRecordData.setOperationDesc(recordData.getOperationDesc()); // 工序 |
|
|
qcFAIRecordData.setOperationDesc(recordData.getOperationDesc()); // 工序 |
|
|
qcFAIRecordData.setResourceId(recordData.getResourceId()); // 机台号 |
|
|
qcFAIRecordData.setResourceId(recordData.getResourceId()); // 机台号 |
|
|
@ -1818,7 +1818,7 @@ public class QcServiceImpl implements QcService { |
|
|
String attributeType1 = "A"; |
|
|
String attributeType1 = "A"; |
|
|
// 获取该物料属性下维护的IPQC检验模板 |
|
|
// 获取该物料属性下维护的IPQC检验模板 |
|
|
List<QcFAIRecordData> partAttribute = qcMapper.selectPartAttributeByPartNo(partNo, attributeType1, qcFAIRecordData.getInspectionTypeNo()); |
|
|
List<QcFAIRecordData> partAttribute = qcMapper.selectPartAttributeByPartNo(partNo, attributeType1, qcFAIRecordData.getInspectionTypeNo()); |
|
|
if (partAttribute != null){ |
|
|
|
|
|
|
|
|
if (partAttribute != null && partAttribute.size() > 0){ |
|
|
qcFAIRecordData.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); |
|
|
qcFAIRecordData.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); |
|
|
|
|
|
|
|
|
// 获取抽样数量 |
|
|
// 获取抽样数量 |
|
|
@ -1880,58 +1880,56 @@ public class QcServiceImpl implements QcService { |
|
|
qcFAIRecordData.setInspectionCycle(null); |
|
|
qcFAIRecordData.setInspectionCycle(null); |
|
|
}else { |
|
|
}else { |
|
|
qcFAIRecordData.setInspectionCycle(familyAttribute.getInspectionCycle()); |
|
|
qcFAIRecordData.setInspectionCycle(familyAttribute.getInspectionCycle()); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 获取抽样数量 |
|
|
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
|
|
if (familyAttribute.getSamplingProgrammeNo() != null){ |
|
|
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(familyAttribute.getSamplingProgrammeNo()); |
|
|
|
|
|
} |
|
|
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
|
|
// 先根据抽样方案确定抽样数 |
|
|
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
|
|
if (programmeData.getSamplingLevelNo() == familyAttribute.getSamplingLevelNo() && (qcFAIRecordData.getRollQty().compareTo(programmeData.getMinQty()) == 1 || qcFAIRecordData.getRollQty().compareTo(programmeData.getMinQty()) == 0) && (qcFAIRecordData.getRollQty().compareTo(programmeData.getMaxQty()) == -1 || qcFAIRecordData.getRollQty().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
|
|
qcFAIRecordData.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
|
|
|
|
|
// 获取抽样数量 |
|
|
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
|
|
if (familyAttribute.getSamplingProgrammeNo() != null){ |
|
|
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(familyAttribute.getSamplingProgrammeNo()); |
|
|
|
|
|
} |
|
|
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
|
|
// 先根据抽样方案确定抽样数 |
|
|
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
|
|
if (programmeData.getSamplingLevelNo() == familyAttribute.getSamplingLevelNo() && (qcFAIRecordData.getRollQty().compareTo(programmeData.getMinQty()) == 1 || qcFAIRecordData.getRollQty().compareTo(programmeData.getMinQty()) == 0) && (qcFAIRecordData.getRollQty().compareTo(programmeData.getMaxQty()) == -1 || qcFAIRecordData.getRollQty().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
|
|
qcFAIRecordData.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 再根据默认抽样数来确定 |
|
|
|
|
|
if (qcFAIRecordData.getSamplingQty() == null){ |
|
|
|
|
|
qcFAIRecordData.setSamplingQty(familyAttribute.getDefaultSamplingQuantity()); |
|
|
|
|
|
} |
|
|
|
|
|
// 再根据默认抽样比例来确定 |
|
|
|
|
|
if (qcFAIRecordData.getSamplingQty() == null){ |
|
|
|
|
|
qcFAIRecordData.setSamplingQty(familyAttribute.getDefaultSamplingProportion().multiply(qcFAIRecordData.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
|
|
} |
|
|
|
|
|
// 获取根据该检验模板下维护的检验项目 |
|
|
|
|
|
QcTemplateData templateData = new QcTemplateData(); |
|
|
|
|
|
templateData.setTemplateId(familyAttribute.getTemplateId()); |
|
|
|
|
|
templateData.setItemType("D"); |
|
|
|
|
|
List<QcTemplateData> itemList = qcMapper.templateDetailsSearch(templateData); |
|
|
|
|
|
QcFAIRecordData faiRecordData = new QcFAIRecordData(); |
|
|
|
|
|
faiRecordData.setInspectionNo(qcFAIRecordData.getInspectionNo()); // 检验单号 |
|
|
|
|
|
faiRecordData.setOrderNo(qcFAIRecordData.getOrderNo()); // 工单号 |
|
|
|
|
|
faiRecordData.setTemplateId(familyAttribute.getTemplateId()); // 模板编码 |
|
|
|
|
|
faiRecordData.setSamplingLevelNo(familyAttribute.getSamplingLevelNo()); // 检验水平编码 |
|
|
|
|
|
faiRecordData.setSamplingLevelDesc(familyAttribute.getSamplingLevelDesc()); // 检验水平名称 |
|
|
|
|
|
faiRecordData.setSamplingProgrammeNo(familyAttribute.getSamplingProgrammeNo()); // 抽样方案编码 |
|
|
|
|
|
faiRecordData.setSamplingProgrammeDesc(familyAttribute.getSamplingProgrammeDesc()); // 抽样方案名称 |
|
|
|
|
|
faiRecordData.setAql(familyAttribute.getAql()); // aql |
|
|
|
|
|
faiRecordData.setAc(familyAttribute.getAc()); // ac |
|
|
|
|
|
faiRecordData.setRe(familyAttribute.getRe()); // re |
|
|
|
|
|
for (QcTemplateData itemData : itemList) { |
|
|
|
|
|
faiRecordData.setItemNo(itemData.getItemNo()); // 项目编码 |
|
|
|
|
|
faiRecordData.setItemDesc(itemData.getItemDesc()); // 项目名称 |
|
|
|
|
|
faiRecordData.setObjectId(itemData.getObjectID()); // 设备编码 |
|
|
|
|
|
faiRecordData.setObjectDesc(itemData.getObjectDesc()); // 设备名称 |
|
|
|
|
|
faiRecordData.setDefaultValue(itemData.getDefaultValue()); // 默认值 |
|
|
|
|
|
faiRecordData.setMinValue(itemData.getMinValue()); // 最小值 |
|
|
|
|
|
faiRecordData.setMaxValue(itemData.getMaxValue()); // 最大值 |
|
|
|
|
|
faiRecordData.setValueType(itemData.getValueType()); // 检测值类型 |
|
|
|
|
|
faiRecordData.setValueTypeDb(itemData.getValueTypeDb()); |
|
|
|
|
|
// 新增IPQC明细记录信息 |
|
|
|
|
|
qcMapper.saveIPQCDetailedRecord(faiRecordData); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// 再根据默认抽样数来确定 |
|
|
|
|
|
if (qcFAIRecordData.getSamplingQty() == null){ |
|
|
|
|
|
qcFAIRecordData.setSamplingQty(familyAttribute.getDefaultSamplingQuantity()); |
|
|
|
|
|
} |
|
|
|
|
|
// 再根据默认抽样比例来确定 |
|
|
|
|
|
if (qcFAIRecordData.getSamplingQty() == null){ |
|
|
|
|
|
qcFAIRecordData.setSamplingQty(familyAttribute.getDefaultSamplingProportion().multiply(qcFAIRecordData.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 获取根据该检验模板下维护的检验项目 |
|
|
|
|
|
QcTemplateData templateData = new QcTemplateData(); |
|
|
|
|
|
templateData.setTemplateId(familyAttribute.getTemplateId()); |
|
|
|
|
|
templateData.setItemType("D"); |
|
|
|
|
|
List<QcTemplateData> itemList = qcMapper.templateDetailsSearch(templateData); |
|
|
|
|
|
QcFAIRecordData faiRecordData = new QcFAIRecordData(); |
|
|
|
|
|
faiRecordData.setInspectionNo(qcFAIRecordData.getInspectionNo()); // 检验单号 |
|
|
|
|
|
faiRecordData.setOrderNo(qcFAIRecordData.getOrderNo()); // 工单号 |
|
|
|
|
|
faiRecordData.setTemplateId(familyAttribute.getTemplateId()); // 模板编码 |
|
|
|
|
|
faiRecordData.setSamplingLevelNo(familyAttribute.getSamplingLevelNo()); // 检验水平编码 |
|
|
|
|
|
faiRecordData.setSamplingLevelDesc(familyAttribute.getSamplingLevelDesc()); // 检验水平名称 |
|
|
|
|
|
faiRecordData.setSamplingProgrammeNo(familyAttribute.getSamplingProgrammeNo()); // 抽样方案编码 |
|
|
|
|
|
faiRecordData.setSamplingProgrammeDesc(familyAttribute.getSamplingProgrammeDesc()); // 抽样方案名称 |
|
|
|
|
|
faiRecordData.setAql(familyAttribute.getAql()); // aql |
|
|
|
|
|
faiRecordData.setAc(familyAttribute.getAc()); // ac |
|
|
|
|
|
faiRecordData.setRe(familyAttribute.getRe()); // re |
|
|
|
|
|
for (QcTemplateData itemData : itemList) { |
|
|
|
|
|
faiRecordData.setItemNo(itemData.getItemNo()); // 项目编码 |
|
|
|
|
|
faiRecordData.setItemDesc(itemData.getItemDesc()); // 项目名称 |
|
|
|
|
|
faiRecordData.setObjectId(itemData.getObjectID()); // 设备编码 |
|
|
|
|
|
faiRecordData.setObjectDesc(itemData.getObjectDesc()); // 设备名称 |
|
|
|
|
|
faiRecordData.setDefaultValue(itemData.getDefaultValue()); // 默认值 |
|
|
|
|
|
faiRecordData.setMinValue(itemData.getMinValue()); // 最小值 |
|
|
|
|
|
faiRecordData.setMaxValue(itemData.getMaxValue()); // 最大值 |
|
|
|
|
|
faiRecordData.setValueType(itemData.getValueType()); // 检测值类型 |
|
|
|
|
|
faiRecordData.setValueTypeDb(itemData.getValueTypeDb()); |
|
|
|
|
|
// 新增IPQC明细记录信息 |
|
|
|
|
|
qcMapper.saveIPQCDetailedRecord(faiRecordData); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// 新增IPQC主记录信息 |
|
|
// 新增IPQC主记录信息 |
|
|
|