|
|
|
@ -1478,150 +1478,6 @@ public class QcServiceImpl implements QcService { |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public PageUtils qcFAIInspectionSearch(QcFAIRecordData data) { |
|
|
|
// // 查询FAI基础数据 |
|
|
|
// List<QcFAIRecordData> basicData = qcMapper.selectFAIBasicData(); |
|
|
|
// QcFAIRecordData qcFAIRecordData = new QcFAIRecordData(); |
|
|
|
// qcFAIRecordData.setSite(data.getSite()); |
|
|
|
// for (QcFAIRecordData recordData : basicData) { |
|
|
|
// // 查询最大编码,自增后赋值 |
|
|
|
// String s = qcMapper.queryLastFAIInspectionNo(qcFAIRecordData); |
|
|
|
// if (s == null){ |
|
|
|
// qcFAIRecordData.setInspectionNo("10001"); |
|
|
|
// }else { |
|
|
|
// int no = Integer.parseInt(qcMapper.queryLastFAIInspectionNo(qcFAIRecordData)); |
|
|
|
// qcFAIRecordData.setInspectionNo(String.valueOf(++no)); |
|
|
|
// } |
|
|
|
// // 主记录信息赋值 |
|
|
|
// qcFAIRecordData.setState("待检验"); // 状态 |
|
|
|
// qcFAIRecordData.setInspectionTypeNo("102"); // 检验类型编码 |
|
|
|
// qcFAIRecordData.setOrderNo(recordData.getOrderNo()); // 工单号 |
|
|
|
// qcFAIRecordData.setOperationDesc(recordData.getOperationDesc()); // 工序 |
|
|
|
// qcFAIRecordData.setResourceId(recordData.getResourceId()); // 机台号 |
|
|
|
// qcFAIRecordData.setResourceDesc(recordData.getResourceDesc()); // 机台名 |
|
|
|
// qcFAIRecordData.setPartNo(recordData.getPartNo()); // 物料编码 |
|
|
|
// qcFAIRecordData.setPartDesc(recordData.getPartDesc()); // 物料名称 |
|
|
|
// qcFAIRecordData.setRollQty(recordData.getRollQty()); // 送检数量 |
|
|
|
// qcFAIRecordData.setSsrId(recordData.getSsrId()); // ssr的主键ID |
|
|
|
// |
|
|
|
// // 明细记录信息赋值 |
|
|
|
// String partNo = recordData.getPartNo(); |
|
|
|
// String attributeType1 = "A"; |
|
|
|
// // 获取该物料属性下维护的FAI检验模板 |
|
|
|
// String specialField = ""; |
|
|
|
// List<QcFAIRecordData> partAttribute = qcMapper.selectPartAttributeByPartNo(partNo, attributeType1, qcFAIRecordData.getInspectionTypeNo(), specialField); |
|
|
|
// if (partAttribute != null){ |
|
|
|
// qcFAIRecordData.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); // 检验周期 |
|
|
|
// |
|
|
|
// // 获取抽样数量 |
|
|
|
// QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
// samplingInspectionProgrammeData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// // 获取抽样方案维护的矩阵详情 |
|
|
|
// List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// // 先根据抽样方案确定抽样数 |
|
|
|
// for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
// if (programmeData.getSamplingLevelNo() == partAttribute.get(0).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(partAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
// } |
|
|
|
// // 再根据默认抽样比例来确定 |
|
|
|
// if (qcFAIRecordData.getSamplingQty() == null){ |
|
|
|
// qcFAIRecordData.setSamplingQty(partAttribute.get(0).getDefaultSamplingProportion().multiply(qcFAIRecordData.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
// } |
|
|
|
// |
|
|
|
// // 获取根据该检验模板下维护的检验项目 |
|
|
|
// QcTemplateData templateData = new QcTemplateData(); |
|
|
|
// templateData.setTemplateId(partAttribute.get(0).getTemplateId()); |
|
|
|
// templateData.setItemType("D"); |
|
|
|
// List<QcTemplateData> itemList = qcMapper.templateDetailsSearch(templateData); |
|
|
|
// QcFAIRecordData faiRecordData = new QcFAIRecordData(); |
|
|
|
// faiRecordData.setInspectionNo(qcFAIRecordData.getInspectionNo()); // 检验单号 |
|
|
|
// faiRecordData.setOrderNo(qcFAIRecordData.getOrderNo()); // 工单号 |
|
|
|
// faiRecordData.setTemplateId(partAttribute.get(0).getTemplateId()); // 模板编码 |
|
|
|
// faiRecordData.setSamplingLevelNo(partAttribute.get(0).getSamplingLevelNo()); // 检验水平编码 |
|
|
|
// faiRecordData.setSamplingLevelDesc(partAttribute.get(0).getSamplingLevelDesc()); // 检验水平名称 |
|
|
|
// faiRecordData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); // 抽样方案编码 |
|
|
|
// faiRecordData.setSamplingProgrammeDesc(partAttribute.get(0).getSamplingProgrammeDesc()); // 抽样方案名称 |
|
|
|
// faiRecordData.setAql(partAttribute.get(0).getAql()); // aql |
|
|
|
// faiRecordData.setAc(partAttribute.get(0).getAc()); // ac |
|
|
|
// faiRecordData.setRe(partAttribute.get(0).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()); |
|
|
|
// // 新增FAI明细记录信息 |
|
|
|
// qcMapper.saveFAIDetailedRecord(faiRecordData); |
|
|
|
// } |
|
|
|
// }else { |
|
|
|
// // 获取物料的类别编码 |
|
|
|
// String familyId = qcMapper.selectFamilyIdByPartNo(partNo,data.getSite()); |
|
|
|
// String attributeType2 = "B"; |
|
|
|
// // 获取该类别属性下维护的FAI检验模板 |
|
|
|
// QcFAIRecordData familyAttribute = qcMapper.selectFamilyAttributeByFamilyId(familyId, attributeType2, qcFAIRecordData.getInspectionTypeNo()); |
|
|
|
// qcFAIRecordData.setInspectionCycle(familyAttribute.getInspectionCycle()); |
|
|
|
// |
|
|
|
// // 获取抽样数量 |
|
|
|
// QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
// 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()); |
|
|
|
// // 新增FAI明细记录信息 |
|
|
|
// qcMapper.saveFAIDetailedRecord(faiRecordData); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// // 新增FAI主记录信息 |
|
|
|
// qcMapper.saveFAIRecord(qcFAIRecordData); |
|
|
|
// } |
|
|
|
// 查询FAI主记录信息 |
|
|
|
IPage<QcFAIRecordData> resultList = this.qcMapper.qcFAIInspectionSearch(new Page<QcFAIRecordData>(data.getPage(), data.getLimit()), data); |
|
|
|
return new PageUtils(resultList); |
|
|
|
@ -1652,25 +1508,29 @@ public class QcServiceImpl implements QcService { |
|
|
|
resourceId = data.getResourceId(); |
|
|
|
} |
|
|
|
List<QcFAIRecordData> partAttribute = qcMapper.selectPartAttributeByOperationAndResource(data.getSite(), partNo, attributeType1, data.getInspectionTypeNo(),operationDesc, resourceId); |
|
|
|
if (partAttribute != null && partAttribute.size() > 0) { |
|
|
|
data.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); |
|
|
|
if (partAttribute.size() > 0) { |
|
|
|
// 获取检验周期 |
|
|
|
if (partAttribute.get(0).getInspectionCycle() != null) { |
|
|
|
data.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); |
|
|
|
} |
|
|
|
// 获取抽样数量 |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 先根据抽样方案确定抽样数 |
|
|
|
for (int a = 0; a < dataList.size(); a++) { |
|
|
|
if (dataList.get(a).getSamplingLevelNo().equals(partAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 1 || data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 0) && (data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == -1 || data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(dataList.get(a).getSamplingQty()); |
|
|
|
// 如果该检验模板有维护抽样方案 |
|
|
|
if (StringUtils.isNotBlank(partAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 根据抽样方案确定抽样数 |
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
if (programmeData.getSamplingLevelNo().equals(partAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(programmeData.getMinQty()) == 1 || data.getRollQty().compareTo(programmeData.getMinQty()) == 0) && (data.getRollQty().compareTo(programmeData.getMaxQty()) == -1 || data.getRollQty().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 再根据默认抽样数来确定 |
|
|
|
if (data.getSamplingQty() == null && partAttribute.get(0).getDefaultSamplingQuantity() != null){ |
|
|
|
} else if (partAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
data.setSamplingQty(partAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
} |
|
|
|
// 再根据默认抽样比例来确定 |
|
|
|
if (data.getSamplingQty() == null && partAttribute.get(0).getDefaultSamplingProportion() != null){ |
|
|
|
} else if (partAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
data.setSamplingQty(partAttribute.get(0).getDefaultSamplingProportion().multiply(data.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1711,25 +1571,29 @@ public class QcServiceImpl implements QcService { |
|
|
|
String attributeType2 = "B"; |
|
|
|
// 获取该类别属性下维护的FAI检验模板 |
|
|
|
List<QcFAIRecordData> familyAttribute = qcMapper.selectPartAttributeByOperationAndResource(data.getSite(), familyId, attributeType2, data.getInspectionTypeNo(),operationDesc, resourceId); |
|
|
|
if (familyAttribute != null && familyAttribute.size() > 0) { |
|
|
|
data.setInspectionCycle(familyAttribute.get(0).getInspectionCycle()); |
|
|
|
if (familyAttribute.size() > 0) { |
|
|
|
// 获取检验周期 |
|
|
|
if (familyAttribute.get(0).getInspectionCycle() != null) { |
|
|
|
data.setInspectionCycle(familyAttribute.get(0).getInspectionCycle()); |
|
|
|
} |
|
|
|
// 获取抽样数量 |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(familyAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 先根据抽样方案确定抽样数 |
|
|
|
for (int a = 0; a < dataList.size(); a++) { |
|
|
|
if (dataList.get(a).getSamplingLevelNo().equals(familyAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 1 || data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 0) && (data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == -1 || data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(dataList.get(a).getSamplingQty()); |
|
|
|
// 如果该检验模板有维护抽样方案 |
|
|
|
if (StringUtils.isNotBlank(familyAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(familyAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 根据抽样方案确定抽样数 |
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
if (programmeData.getSamplingLevelNo().equals(familyAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(programmeData.getMinQty()) == 1 || data.getRollQty().compareTo(programmeData.getMinQty()) == 0) && (data.getRollQty().compareTo(programmeData.getMaxQty()) == -1 || data.getRollQty().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 再根据默认抽样数来确定 |
|
|
|
if (data.getSamplingQty() == null && familyAttribute.get(0).getDefaultSamplingQuantity() != null){ |
|
|
|
} else if (familyAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
data.setSamplingQty(familyAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
} |
|
|
|
// 再根据默认抽样比例来确定 |
|
|
|
if (data.getSamplingQty() == null && familyAttribute.get(0).getDefaultSamplingProportion() != null){ |
|
|
|
} else if (familyAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
data.setSamplingQty(familyAttribute.get(0).getDefaultSamplingProportion().multiply(data.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1962,25 +1826,29 @@ public class QcServiceImpl implements QcService { |
|
|
|
resourceId = data.getResourceId(); |
|
|
|
} |
|
|
|
List<QcFAIRecordData> partAttribute = qcMapper.selectPartAttributeByOperationAndResource(data.getSite(), partNo, attributeType1, data.getInspectionTypeNo(),operationDesc, resourceId); |
|
|
|
if (partAttribute != null && partAttribute.size() > 0) { |
|
|
|
data.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); |
|
|
|
if (partAttribute.size() > 0) { |
|
|
|
// 获取抽样数量 |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 先根据抽样方案确定抽样数 |
|
|
|
for (int a = 0; a < dataList.size(); a++) { |
|
|
|
if (dataList.get(a).getSamplingLevelNo().equals(partAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 1 || data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 0) && (data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == -1 || data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(dataList.get(a).getSamplingQty()); |
|
|
|
} |
|
|
|
if (partAttribute.get(0).getInspectionCycle() != null) { |
|
|
|
data.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); |
|
|
|
} |
|
|
|
// 再根据默认抽样数来确定 |
|
|
|
if (data.getSamplingQty() == null && partAttribute.get(0).getDefaultSamplingQuantity() != null){ |
|
|
|
// 获取抽样数量 |
|
|
|
// 如果该检验模板有维护抽样方案 |
|
|
|
if (StringUtils.isNotBlank(partAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 根据抽样方案确定抽样数 |
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
if (programmeData.getSamplingLevelNo().equals(partAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(programmeData.getMinQty()) == 1 || data.getRollQty().compareTo(programmeData.getMinQty()) == 0) && (data.getRollQty().compareTo(programmeData.getMaxQty()) == -1 || data.getRollQty().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (partAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
data.setSamplingQty(partAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
} |
|
|
|
// 再根据默认抽样比例来确定 |
|
|
|
if (data.getSamplingQty() == null && partAttribute.get(0).getDefaultSamplingProportion() != null){ |
|
|
|
} else if (partAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
data.setSamplingQty(partAttribute.get(0).getDefaultSamplingProportion().multiply(data.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2021,25 +1889,29 @@ public class QcServiceImpl implements QcService { |
|
|
|
String attributeType2 = "B"; |
|
|
|
// 获取该类别属性下维护的FQC检验模板 |
|
|
|
List<QcFAIRecordData> familyAttribute = qcMapper.selectPartAttributeByOperationAndResource(data.getSite(), familyId, attributeType2, data.getInspectionTypeNo(),operationDesc, resourceId); |
|
|
|
if (familyAttribute != null && familyAttribute.size() > 0) { |
|
|
|
data.setInspectionCycle(familyAttribute.get(0).getInspectionCycle()); |
|
|
|
if (familyAttribute.size() > 0) { |
|
|
|
// 获取检验周期 |
|
|
|
if (familyAttribute.get(0).getInspectionCycle() != null) { |
|
|
|
data.setInspectionCycle(familyAttribute.get(0).getInspectionCycle()); |
|
|
|
} |
|
|
|
// 获取抽样数量 |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(familyAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 先根据抽样方案确定抽样数 |
|
|
|
for (int a = 0; a < dataList.size(); a++) { |
|
|
|
if (dataList.get(a).getSamplingLevelNo().equals(familyAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 1 || data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 0) && (data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == -1 || data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(dataList.get(a).getSamplingQty()); |
|
|
|
// 如果该检验模板有维护抽样方案 |
|
|
|
if (StringUtils.isNotBlank(familyAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(familyAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 根据抽样方案确定抽样数 |
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
if (programmeData.getSamplingLevelNo().equals(familyAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(programmeData.getMinQty()) == 1 || data.getRollQty().compareTo(programmeData.getMinQty()) == 0) && (data.getRollQty().compareTo(programmeData.getMaxQty()) == -1 || data.getRollQty().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 再根据默认抽样数来确定 |
|
|
|
if (data.getSamplingQty() == null && familyAttribute.get(0).getDefaultSamplingQuantity() != null){ |
|
|
|
} else if (familyAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
data.setSamplingQty(familyAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
} |
|
|
|
// 再根据默认抽样比例来确定 |
|
|
|
if (data.getSamplingQty() == null && familyAttribute.get(0).getDefaultSamplingProportion() != null){ |
|
|
|
} else if (familyAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
data.setSamplingQty(familyAttribute.get(0).getDefaultSamplingProportion().multiply(data.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2236,156 +2108,6 @@ public class QcServiceImpl implements QcService { |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public PageUtils qcIPQCInspectionSearch(QcFAIRecordData data) { |
|
|
|
// 查询IPQC基础数据 |
|
|
|
//List<QcFAIRecordData> basicData = qcMapper.selectIPQCBasicData(); |
|
|
|
// List<QcFAIRecordData> basicData = qcMapper.qcExec(data.getSite()); |
|
|
|
// QcFAIRecordData qcFAIRecordData = new QcFAIRecordData(); |
|
|
|
// qcFAIRecordData.setSite(data.getSite()); |
|
|
|
// for (QcFAIRecordData recordData : basicData) { |
|
|
|
// // 查询最大编码,自增后赋值 |
|
|
|
// String s = qcMapper.queryLastIPQCInspectionNo(qcFAIRecordData); |
|
|
|
// if (s == null){ |
|
|
|
// qcFAIRecordData.setInspectionNo("10001"); |
|
|
|
// }else { |
|
|
|
// int no = Integer.parseInt(qcMapper.queryLastIPQCInspectionNo(qcFAIRecordData)); |
|
|
|
// qcFAIRecordData.setInspectionNo(String.valueOf(++no)); |
|
|
|
// } |
|
|
|
// // 主记录信息赋值 |
|
|
|
// qcFAIRecordData.setState("待检验"); // 状态 |
|
|
|
// qcFAIRecordData.setInspectionTypeNo("101"); // 检验类型编码 |
|
|
|
// qcFAIRecordData.setCheckType("首件检"); |
|
|
|
// qcFAIRecordData.setOrderNo(recordData.getOrderNo()); // 工单号 |
|
|
|
// qcFAIRecordData.setOperationDesc(recordData.getOperationDesc()); // 工序 |
|
|
|
// qcFAIRecordData.setResourceId(recordData.getResourceId()); // 机台号 |
|
|
|
// qcFAIRecordData.setResourceDesc(recordData.getResourceDesc()); // 机台名 |
|
|
|
// qcFAIRecordData.setPartNo(recordData.getPartNo()); // 物料编码 |
|
|
|
// qcFAIRecordData.setPartDesc(recordData.getPartDesc()); // 物料名称 |
|
|
|
// qcFAIRecordData.setRollQty(recordData.getRollQty()); // 送检数量 |
|
|
|
// qcFAIRecordData.setSsrId(recordData.getSsrId()); // ssr的主键ID |
|
|
|
// |
|
|
|
// // 明细记录信息赋值 |
|
|
|
// String partNo = recordData.getPartNo(); |
|
|
|
// String attributeType1 = "A"; |
|
|
|
// // 获取该物料属性下维护的IPQC检验模板 |
|
|
|
// String specialField = ""; |
|
|
|
// List<QcFAIRecordData> partAttribute = qcMapper.selectPartAttributeByPartNo(partNo, attributeType1, qcFAIRecordData.getInspectionTypeNo(),specialField); |
|
|
|
// if (partAttribute != null && partAttribute.size() > 0){ |
|
|
|
// qcFAIRecordData.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); |
|
|
|
// |
|
|
|
// // 获取抽样数量 |
|
|
|
// QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
// samplingInspectionProgrammeData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// // 获取抽样方案维护的矩阵详情 |
|
|
|
// List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// // 先根据抽样方案确定抽样数 |
|
|
|
// for (QcSamplingInspectionProgrammeData ProgrammeData : dataList) { |
|
|
|
// if (ProgrammeData.getSamplingLevelNo() == partAttribute.get(0).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(partAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
// } |
|
|
|
// // 再根据默认抽样比例来确定 |
|
|
|
// if (qcFAIRecordData.getSamplingQty() == null){ |
|
|
|
// qcFAIRecordData.setSamplingQty(partAttribute.get(0).getDefaultSamplingProportion().multiply(qcFAIRecordData.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
// } |
|
|
|
// |
|
|
|
// // 获取根据该检验模板下维护的检验项目 |
|
|
|
// QcTemplateData templateData = new QcTemplateData(); |
|
|
|
// templateData.setTemplateId(partAttribute.get(0).getTemplateId()); |
|
|
|
// templateData.setItemType("D"); |
|
|
|
// List<QcTemplateData> itemList = qcMapper.templateDetailsSearch(templateData); |
|
|
|
// QcFAIRecordData faiRecordData = new QcFAIRecordData(); |
|
|
|
// faiRecordData.setInspectionNo(qcFAIRecordData.getInspectionNo()); // 检验单号 |
|
|
|
// faiRecordData.setOrderNo(qcFAIRecordData.getOrderNo()); // 工单号 |
|
|
|
// faiRecordData.setTemplateId(partAttribute.get(0).getTemplateId()); // 模板编码 |
|
|
|
// faiRecordData.setSamplingLevelNo(partAttribute.get(0).getSamplingLevelNo()); // 检验水平编码 |
|
|
|
// faiRecordData.setSamplingLevelDesc(partAttribute.get(0).getSamplingLevelDesc()); // 检验水平名称 |
|
|
|
// faiRecordData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); // 抽样方案编码 |
|
|
|
// faiRecordData.setSamplingProgrammeDesc(partAttribute.get(0).getSamplingProgrammeDesc()); // 抽样方案名称 |
|
|
|
// faiRecordData.setAql(partAttribute.get(0).getAql()); // aql |
|
|
|
// faiRecordData.setAc(partAttribute.get(0).getAc()); // ac |
|
|
|
// faiRecordData.setRe(partAttribute.get(0).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); |
|
|
|
// } |
|
|
|
// }else { |
|
|
|
// // 获取物料的类别编码 |
|
|
|
// String familyId = qcMapper.selectFamilyIdByPartNo(partNo,data.getSite()); |
|
|
|
// String attributeType2 = "B"; |
|
|
|
// // 获取该类别属性下维护的IPQC检验模板 |
|
|
|
// QcFAIRecordData familyAttribute = qcMapper.selectFamilyAttributeByFamilyId(familyId, attributeType2, qcFAIRecordData.getInspectionTypeNo()); |
|
|
|
// if (familyAttribute == null || familyAttribute.getInspectionCycle() == null){ |
|
|
|
// qcFAIRecordData.setInspectionCycle(null); |
|
|
|
// }else { |
|
|
|
// 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()); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// // 再根据默认抽样数来确定 |
|
|
|
// 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主记录信息 |
|
|
|
// qcMapper.saveIPQCRecord(qcFAIRecordData); |
|
|
|
// } |
|
|
|
// 查询FAI主记录信息 |
|
|
|
IPage<QcFAIRecordData> resultList = this.qcMapper.qcIPQCInspectionSearch(new Page<QcFAIRecordData>(data.getPage(), data.getLimit()), data); |
|
|
|
return new PageUtils(resultList); |
|
|
|
@ -2416,25 +2138,29 @@ public class QcServiceImpl implements QcService { |
|
|
|
resourceId = data.getResourceId(); |
|
|
|
} |
|
|
|
List<QcFAIRecordData> partAttribute = qcMapper.selectPartAttributeByOperationAndResource(data.getSite(), partNo, attributeType1, data.getInspectionTypeNo(),operationDesc, resourceId); |
|
|
|
if (partAttribute != null && partAttribute.size() > 0) { |
|
|
|
data.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); |
|
|
|
if (partAttribute.size() > 0) { |
|
|
|
// 获取检验周期 |
|
|
|
if (partAttribute.get(0).getInspectionCycle() != null) { |
|
|
|
data.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); |
|
|
|
} |
|
|
|
// 获取抽样数量 |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 先根据抽样方案确定抽样数 |
|
|
|
for (int a = 0; a < dataList.size(); a++) { |
|
|
|
if (dataList.get(a).getSamplingLevelNo().equals(partAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 1 || data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 0) && (data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == -1 || data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(dataList.get(a).getSamplingQty()); |
|
|
|
// 如果该检验模板有维护抽样方案 |
|
|
|
if (StringUtils.isNotBlank(partAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 根据抽样方案确定抽样数 |
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
if (programmeData.getSamplingLevelNo().equals(partAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(programmeData.getMinQty()) == 1 || data.getRollQty().compareTo(programmeData.getMinQty()) == 0) && (data.getRollQty().compareTo(programmeData.getMaxQty()) == -1 || data.getRollQty().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 再根据默认抽样数来确定 |
|
|
|
if (data.getSamplingQty() == null && partAttribute.get(0).getDefaultSamplingQuantity() != null){ |
|
|
|
} else if (partAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
data.setSamplingQty(partAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
} |
|
|
|
// 再根据默认抽样比例来确定 |
|
|
|
if (data.getSamplingQty() == null && partAttribute.get(0).getDefaultSamplingProportion() != null){ |
|
|
|
} else if (partAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
data.setSamplingQty(partAttribute.get(0).getDefaultSamplingProportion().multiply(data.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2475,25 +2201,29 @@ public class QcServiceImpl implements QcService { |
|
|
|
String attributeType2 = "B"; |
|
|
|
// 获取该类别属性下维护的IPQC检验模板 |
|
|
|
List<QcFAIRecordData> familyAttribute = qcMapper.selectPartAttributeByOperationAndResource(data.getSite(), familyId, attributeType2, data.getInspectionTypeNo(),operationDesc, resourceId); |
|
|
|
if (familyAttribute != null && familyAttribute.size() > 0) { |
|
|
|
data.setInspectionCycle(familyAttribute.get(0).getInspectionCycle()); |
|
|
|
if (familyAttribute.size() > 0) { |
|
|
|
// 获取检验周期 |
|
|
|
if (familyAttribute.get(0).getInspectionCycle() != null) { |
|
|
|
data.setInspectionCycle(familyAttribute.get(0).getInspectionCycle()); |
|
|
|
} |
|
|
|
// 获取抽样数量 |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(familyAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 先根据抽样方案确定抽样数 |
|
|
|
for (int a = 0; a < dataList.size(); a++) { |
|
|
|
if (dataList.get(a).getSamplingLevelNo().equals(familyAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 1 || data.getRollQty().compareTo(dataList.get(a).getMinQty()) == 0) && (data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == -1 || data.getRollQty().compareTo(dataList.get(a).getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(dataList.get(a).getSamplingQty()); |
|
|
|
// 如果该检验模板有维护抽样方案 |
|
|
|
if (StringUtils.isNotBlank(familyAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(familyAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 根据抽样方案确定抽样数 |
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
if (programmeData.getSamplingLevelNo().equals(familyAttribute.get(0).getSamplingLevelNo()) && (data.getRollQty().compareTo(programmeData.getMinQty()) == 1 || data.getRollQty().compareTo(programmeData.getMinQty()) == 0) && (data.getRollQty().compareTo(programmeData.getMaxQty()) == -1 || data.getRollQty().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
data.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 再根据默认抽样数来确定 |
|
|
|
if (data.getSamplingQty() == null && familyAttribute.get(0).getDefaultSamplingQuantity() != null){ |
|
|
|
} else if (familyAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
data.setSamplingQty(familyAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
} |
|
|
|
// 再根据默认抽样比例来确定 |
|
|
|
if (data.getSamplingQty() == null && familyAttribute.get(0).getDefaultSamplingProportion() != null){ |
|
|
|
} else if (familyAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
data.setSamplingQty(familyAttribute.get(0).getDefaultSamplingProportion().multiply(data.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2750,7 +2480,7 @@ public class QcServiceImpl implements QcService { |
|
|
|
@Transactional |
|
|
|
public PageUtils qcIQCInspectionSearch(QcFAIRecordData data) { |
|
|
|
// 查询送检单里的全部数据 |
|
|
|
List<QcFAIRecordData> basicData = qcMapper.selectIQCBasicData(); |
|
|
|
List<QcFAIRecordData> basicData = qcMapper.selectIQCBasicData(data); |
|
|
|
// 新建对象存放主记录 |
|
|
|
QcFAIRecordData qcFAIRecordData = new QcFAIRecordData(); |
|
|
|
qcFAIRecordData.setSite(data.getSite()); |
|
|
|
@ -2760,11 +2490,11 @@ public class QcServiceImpl implements QcService { |
|
|
|
if (StringUtils.isNotBlank(recordData.getSupplierNo())) { |
|
|
|
supplierNo = recordData.getSupplierNo(); |
|
|
|
} |
|
|
|
// 查询该记录是否已存在明细 |
|
|
|
List<QcFAIRecordData> detailData = qcMapper.checkIQCDetail(recordData); |
|
|
|
if (detailData.size() > 0) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
// // 查询该记录是否已存在明细 |
|
|
|
// List<QcFAIRecordData> detailData = qcMapper.checkIQCDetail(recordData); |
|
|
|
// if (detailData.size() > 0) { |
|
|
|
// continue; |
|
|
|
// } |
|
|
|
// 主记录信息赋值 |
|
|
|
qcFAIRecordData.setInspectionNo(recordData.getInspectionNo()); // 检验单号 |
|
|
|
qcFAIRecordData.setInspectionTypeNo("105"); // 检验类型编码 |
|
|
|
@ -2774,25 +2504,29 @@ public class QcServiceImpl implements QcService { |
|
|
|
String attributeType1 = "A"; |
|
|
|
// 获取该物料属性下维护的IQC检验模板 |
|
|
|
List<QcFAIRecordData> partAttribute = qcMapper.selectPartAttributeByPartNo(data.getSite(), partNo, attributeType1, qcFAIRecordData.getInspectionTypeNo(), supplierNo); |
|
|
|
if (partAttribute != null && partAttribute.size() > 0){ |
|
|
|
qcFAIRecordData.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); // 检验周期 |
|
|
|
if (partAttribute.size() > 0){ |
|
|
|
// 检验周期 |
|
|
|
if (partAttribute.get(0).getInspectionCycle() != null) { |
|
|
|
qcFAIRecordData.setInspectionCycle(partAttribute.get(0).getInspectionCycle()); |
|
|
|
} |
|
|
|
// 获取抽样数量 |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(partAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 先根据抽样方案确定抽样数 |
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
if (programmeData.getSamplingLevelNo().equals(partAttribute.get(0).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 (StringUtils.isNotBlank(partAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
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.getRollQty().compareTo(programmeData.getMinQty()) == 1 || recordData.getRollQty().compareTo(programmeData.getMinQty()) == 0) && (recordData.getRollQty().compareTo(programmeData.getMaxQty()) == -1 || recordData.getRollQty().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
qcFAIRecordData.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 再根据默认抽样数来确定 |
|
|
|
if (qcFAIRecordData.getSamplingQty() == null && partAttribute.get(0).getDefaultSamplingQuantity() != null){ |
|
|
|
} else if (partAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
qcFAIRecordData.setSamplingQty(partAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
} |
|
|
|
// 再根据默认抽样比例来确定 |
|
|
|
if (qcFAIRecordData.getSamplingQty() == null && partAttribute.get(0).getDefaultSamplingProportion() != null){ |
|
|
|
} else if (partAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
qcFAIRecordData.setSamplingQty(partAttribute.get(0).getDefaultSamplingProportion().multiply(qcFAIRecordData.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2832,26 +2566,29 @@ public class QcServiceImpl implements QcService { |
|
|
|
String attributeType2 = "B"; |
|
|
|
// 获取该类别属性下维护的IQC检验模板 |
|
|
|
List<QcFAIRecordData> familyAttribute = qcMapper.selectPartAttributeByPartNo(data.getSite(), familyId, attributeType2, qcFAIRecordData.getInspectionTypeNo(), supplierNo); |
|
|
|
if (familyAttribute != null && partAttribute.size() > 0) { |
|
|
|
if (familyAttribute.size() > 0) { |
|
|
|
// 获取检验周期 |
|
|
|
qcFAIRecordData.setInspectionCycle(familyAttribute.get(0).getInspectionCycle()); |
|
|
|
if (familyAttribute.get(0).getInspectionCycle() != null) { |
|
|
|
qcFAIRecordData.setInspectionCycle(familyAttribute.get(0).getInspectionCycle()); |
|
|
|
} |
|
|
|
// 获取抽样数量 |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
samplingInspectionProgrammeData.setSamplingProgrammeNo(familyAttribute.get(0).getSamplingProgrammeNo()); |
|
|
|
// 获取抽样方案维护的矩阵详情 |
|
|
|
List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData); |
|
|
|
// 先根据抽样方案确定抽样数 |
|
|
|
for (QcSamplingInspectionProgrammeData programmeData : dataList) { |
|
|
|
if (programmeData.getSamplingLevelNo().equals(familyAttribute.get(0).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 (StringUtils.isNotBlank(familyAttribute.get(0).getSamplingProgrammeNo())) { |
|
|
|
QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData(); |
|
|
|
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.getRollQty().compareTo(programmeData.getMinQty()) == 1 || recordData.getRollQty().compareTo(programmeData.getMinQty()) == 0) && (recordData.getRollQty().compareTo(programmeData.getMaxQty()) == -1 || recordData.getRollQty().compareTo(programmeData.getMaxQty()) == 0) ){ |
|
|
|
qcFAIRecordData.setSamplingQty(programmeData.getSamplingQty()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 再根据默认抽样数来确定 |
|
|
|
if (qcFAIRecordData.getSamplingQty() == null && familyAttribute.get(0).getDefaultSamplingQuantity() != null){ |
|
|
|
} else if (familyAttribute.get(0).getDefaultSamplingQuantity() != null) { |
|
|
|
// 没有维护抽样方案,再根据默认抽样数来确定 |
|
|
|
qcFAIRecordData.setSamplingQty(familyAttribute.get(0).getDefaultSamplingQuantity()); |
|
|
|
} |
|
|
|
// 再根据默认抽样比例来确定 |
|
|
|
if (qcFAIRecordData.getSamplingQty() == null && familyAttribute.get(0).getDefaultSamplingProportion() != null){ |
|
|
|
} else if (familyAttribute.get(0).getDefaultSamplingProportion() != null) { |
|
|
|
// 也没有维护默认抽样数,最后根据默认抽样比例来确定 |
|
|
|
qcFAIRecordData.setSamplingQty(familyAttribute.get(0).getDefaultSamplingProportion().multiply(qcFAIRecordData.getRollQty()).divide(new BigDecimal(100),3,BigDecimal.ROUND_HALF_UP)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2886,7 +2623,7 @@ public class QcServiceImpl implements QcService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 跟新IQC主记录信息 |
|
|
|
// 更新IQC主记录信息 |
|
|
|
qcMapper.updateIQCRecord(qcFAIRecordData); |
|
|
|
} |
|
|
|
// 查询FAI主记录信息 |
|
|
|
@ -3008,13 +2745,23 @@ public class QcServiceImpl implements QcService { |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void saveIQCSubmitResult(QcFAIRecordData data) { |
|
|
|
for (QcFAIRecordData qcData : data.getSubmitList()){ |
|
|
|
for (QcFAIRecordData qcData : data.getSubmitList()) { |
|
|
|
// 修改主记录标识为已提交 |
|
|
|
qcMapper.updateIQCMasterSubmitFlag(qcData); |
|
|
|
// 修改明细记录标识为已提交 |
|
|
|
qcMapper.updateIQCDetailSubmitFlag(qcData); |
|
|
|
// 修改子明细记录标识为已提交 |
|
|
|
qcMapper.updateIQCSubDetailSubmitFlag(qcData); |
|
|
|
// 根据 site、po_orderNo、po_itemNo 从 view_po_order 中查出数据 |
|
|
|
List<PoOrderData> poOrderData = qcMapper.queryDataFromViewPoOrder(qcData); |
|
|
|
if (poOrderData.size() > 0 && poOrderData.get(0) != null) { |
|
|
|
// 修改order_qty为送检数量 |
|
|
|
poOrderData.get(0).setOrderQty(qcData.getRollQty().toString()); |
|
|
|
// 向收货任务表里添加数据 |
|
|
|
qcMapper.saveReceivingTask(poOrderData.get(0)); |
|
|
|
} else { |
|
|
|
throw new RuntimeException("未在po_order中查出数据!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|