Browse Source

Merge remote-tracking branch 'origin/master'

java8
yuejiayang 11 months ago
parent
commit
d4762df851
  1. 27
      src/main/java/com/xujie/sys/modules/pms/data/QcFAIRecordData.java
  2. 214
      src/main/java/com/xujie/sys/modules/pms/service/Impl/QcServiceImpl.java
  3. 33
      src/main/resources/mapper/pms/QcMapper.xml

27
src/main/java/com/xujie/sys/modules/pms/data/QcFAIRecordData.java

@ -255,6 +255,33 @@ public class QcFAIRecordData extends QueryPage {
private Date productionDate;
private Date expirationWarningDate;
private Date expirationDate;
private BigDecimal passQty;
private BigDecimal notPassQty;
private BigDecimal batchQualifiedQty;
public BigDecimal getPassQty() {
return passQty;
}
public void setPassQty(BigDecimal passQty) {
this.passQty = passQty;
}
public BigDecimal getNotPassQty() {
return notPassQty;
}
public void setNotPassQty(BigDecimal notPassQty) {
this.notPassQty = notPassQty;
}
public BigDecimal getBatchQualifiedQty() {
return batchQualifiedQty;
}
public void setBatchQualifiedQty(BigDecimal batchQualifiedQty) {
this.batchQualifiedQty = batchQualifiedQty;
}
public String getBatchNo() {
return batchNo;

214
src/main/java/com/xujie/sys/modules/pms/service/Impl/QcServiceImpl.java

@ -3711,217 +3711,6 @@ public class QcServiceImpl implements QcService {
@Override
@Transactional
public PageUtils qcIQCInspectionSearch(QcFAIRecordData data) {
// // 查询送检单里的全部数据
// List<QcFAIRecordData> basicData = qcMapper.selectIQCBasicData(data);
// // 新建对象存放主记录
// QcFAIRecordData qcFAIRecordData = new QcFAIRecordData();
// for (QcFAIRecordData recordData : basicData) {
// // 拿到供应商编码
// String supplierNo = "";
// if (StringUtils.isNotBlank(recordData.getSupplierNo())) {
// supplierNo = recordData.getSupplierNo();
// }
//// // 查询该记录是否已存在明细
//// List<QcFAIRecordData> detailData = qcMapper.checkIQCDetail(recordData);
//// if (detailData.size() > 0) {
//// continue;
//// }
// // 主记录信息赋值
// qcFAIRecordData.setSite(recordData.getSite());
// qcFAIRecordData.setBuNo(recordData.getBuNo());
// qcFAIRecordData.setInspectionNo(recordData.getInspectionNo()); // 检验单号
// qcFAIRecordData.setInspectionTypeNo("105"); // 检验类型编码
// qcFAIRecordData.setPartDesc(recordData.getPartDesc());
// qcFAIRecordData.setRollQty(recordData.getRollQty());
// // 明细记录信息赋值
// String partNo = recordData.getPartNo();
// String attributeType1 = "A";
// // 获取该物料属性下维护的IQC检验模板
// List<QcFAIRecordData> partAttribute = qcMapper.selectPartAttributeByPartNo(recordData.getSite(), recordData.getBuNo(), partNo, attributeType1, qcFAIRecordData.getInspectionTypeNo(), supplierNo);
// if (!partAttribute.isEmpty()) {
// // 检验周期
// if (partAttribute.get(0).getInspectionCycle() != null) {
// qcFAIRecordData.setInspectionCycle(partAttribute.get(0).getInspectionCycle());
// }
// // 获取抽样数量
// // 如果该检验模板有维护抽样方案
// 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();
// templateData.setSite(recordData.getSite());
// templateData.setBuNo(recordData.getBuNo());
// templateData.setTemplateId(partAttribute.get(0).getTemplateId());
// templateData.setItemType("D");
// List<QcTemplateData> itemList = qcMapper.templateDetailsSearch(templateData);
// QcFAIRecordData faiRecordData = new QcFAIRecordData();
// faiRecordData.setSite(recordData.getSite()); // 工厂
// faiRecordData.setBuNo(recordData.getBuNo()); // BU
// faiRecordData.setInspectionNo(qcFAIRecordData.getInspectionNo()); // 检验单号
// faiRecordData.setTemplateId(partAttribute.get(0).getTemplateId()); // 模板编码
// 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.setSamplingQty(null);
// faiRecordData.setSamplingLevelNo(itemData.getSamplingLevelNo()); // 检验水平编码
// faiRecordData.setSamplingLevelDesc(itemData.getSamplingLevelDesc()); // 检验水平名称
// faiRecordData.setSamplingProgrammeNo(itemData.getSamplingProgrammeNo()); // 抽样方案编码
// faiRecordData.setSamplingProgrammeDesc(itemData.getSamplingProgrammeDesc()); // 抽样方案名称
// 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());
// // 获取抽样数量
// // 如果该检验项目有维护抽样方案
// if (StringUtils.isNotBlank(itemData.getSamplingProgrammeNo())) {
// QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData();
// samplingInspectionProgrammeData.setSite(itemData.getSite());
// samplingInspectionProgrammeData.setBuNo(itemData.getBuNo());
// samplingInspectionProgrammeData.setSamplingProgrammeNo(itemData.getSamplingProgrammeNo());
// // 获取抽样方案维护的矩阵详情
// List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData);
// // 根据抽样方案确定抽样数
// for (QcSamplingInspectionProgrammeData programmeData : dataList) {
// if (programmeData.getSamplingLevelNo().equals(itemData.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)) {
// faiRecordData.setSamplingQty(programmeData.getSamplingQty());
// }
// }
// } else if (itemData.getItemSamplingQuantity() != null) {
// // 没有维护抽样方案再根据默认抽样数来确定
// faiRecordData.setSamplingQty(itemData.getItemSamplingQuantity());
// } else if (itemData.getDefaultSamplingProportion() != null) {
// // 也没有维护默认抽样数最后根据默认抽样比例来确定
// faiRecordData.setSamplingQty(itemData.getDefaultSamplingProportion().multiply(recordData.getRollCount()).divide(new BigDecimal(100), 3, BigDecimal.ROUND_HALF_UP));
// } else {
// // 最后则根据检验单抽样数量赋值
// faiRecordData.setSamplingQty(qcFAIRecordData.getSamplingQty()); // 抽样数量
// }
// // 新增IQC明细记录信息
// qcMapper.saveIQCDetailedRecord(faiRecordData);
// }
// } else {
// // 获取物料的类别编码
// String familyId = qcMapper.selectFamilyIdByPartNo(partNo,recordData.getSite());
// String attributeType2 = "B";
// // 获取该类别属性下维护的IQC检验模板
// List<QcFAIRecordData> familyAttribute = qcMapper.selectPartAttributeByPartNo(recordData.getSite(), recordData.getBuNo(), familyId, attributeType2, qcFAIRecordData.getInspectionTypeNo(), supplierNo);
// if (!familyAttribute.isEmpty()) {
// // 获取检验周期
// if (familyAttribute.get(0).getInspectionCycle() != null) {
// qcFAIRecordData.setInspectionCycle(familyAttribute.get(0).getInspectionCycle());
// }
// // 获取抽样数量
// // 如果该检验模板有维护抽样方案
// 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();
// templateData.setTemplateId(familyAttribute.get(0).getTemplateId());
// templateData.setItemType("D");
// templateData.setSite(recordData.getSite());
// templateData.setBuNo(recordData.getBuNo());
// List<QcTemplateData> itemList = qcMapper.templateDetailsSearch(templateData);
// QcFAIRecordData faiRecordData = new QcFAIRecordData();
// faiRecordData.setSite(recordData.getSite()); // 工厂
// faiRecordData.setBuNo(recordData.getBuNo()); // BU
// faiRecordData.setInspectionNo(qcFAIRecordData.getInspectionNo()); // 检验单号
// faiRecordData.setTemplateId(familyAttribute.get(0).getTemplateId()); // 模板编码
// faiRecordData.setAql(familyAttribute.get(0).getAql()); // aql
// faiRecordData.setAc(familyAttribute.get(0).getAc()); // ac
// faiRecordData.setRe(familyAttribute.get(0).getRe()); // re
// for (QcTemplateData itemData : itemList) {
// faiRecordData.setSamplingQty(null);
// faiRecordData.setSamplingLevelNo(itemData.getSamplingLevelNo()); // 检验水平编码
// faiRecordData.setSamplingLevelDesc(itemData.getSamplingLevelDesc()); // 检验水平名称
// faiRecordData.setSamplingProgrammeNo(itemData.getSamplingProgrammeNo()); // 抽样方案编码
// faiRecordData.setSamplingProgrammeDesc(itemData.getSamplingProgrammeDesc()); // 抽样方案名称
// 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());
// // 获取抽样数量
// // 如果该检验项目有维护抽样方案
// if (StringUtils.isNotBlank(itemData.getSamplingProgrammeNo())) {
// QcSamplingInspectionProgrammeData samplingInspectionProgrammeData = new QcSamplingInspectionProgrammeData();
// samplingInspectionProgrammeData.setSite(itemData.getSite());
// samplingInspectionProgrammeData.setBuNo(itemData.getBuNo());
// samplingInspectionProgrammeData.setSamplingProgrammeNo(itemData.getSamplingProgrammeNo());
// // 获取抽样方案维护的矩阵详情
// List<QcSamplingInspectionProgrammeData> dataList = qcMapper.searchSamplingProgrammeDetails(samplingInspectionProgrammeData);
// // 根据抽样方案确定抽样数
// for (QcSamplingInspectionProgrammeData programmeData : dataList) {
// if (programmeData.getSamplingLevelNo().equals(itemData.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)) {
// faiRecordData.setSamplingQty(programmeData.getSamplingQty());
// }
// }
// } else if (itemData.getItemSamplingQuantity() != null) {
// // 没有维护抽样方案再根据默认抽样数来确定
// faiRecordData.setSamplingQty(itemData.getItemSamplingQuantity());
// } else if (itemData.getDefaultSamplingProportion() != null) {
// // 也没有维护默认抽样数最后根据默认抽样比例来确定
// faiRecordData.setSamplingQty(itemData.getDefaultSamplingProportion().multiply(recordData.getRollCount()).divide(new BigDecimal(100), 3, BigDecimal.ROUND_HALF_UP));
// } else {
// // 最后则根据检验单抽样数量赋值
// faiRecordData.setSamplingQty(qcFAIRecordData.getSamplingQty()); // 抽样数量
// }
// // 新增IQC明细记录信息
// qcMapper.saveIQCDetailedRecord(faiRecordData);
// }
// }
// }
// // 更新IQC主记录信息
// qcMapper.updateIQCRecord(qcFAIRecordData);
// }
// 查询FAI主记录信息
IPage<QcFAIRecordData> resultList = this.qcMapper.qcIQCInspectionSearch(new Page<QcFAIRecordData>(data.getPage(), data.getLimit()), data);
return new PageUtils(resultList);
@ -4368,7 +4157,8 @@ public class QcServiceImpl implements QcService {
List<PoOrderData> poOrderData = qcMapper.queryDataFromViewPoOrder(recordData);
if (!poOrderData.isEmpty() && poOrderData.get(0) != null) {
// 修改order_qty为送检数量
poOrderData.get(0).setOrderQty(recordData.getRollQty().toString());
// orderQty取值改为批次合格数 -- 2025-02-10
poOrderData.get(0).setOrderQty(recordData.getBatchQualifiedQty().toString());
poOrderData.get(0).setInspectionNo(recordData.getInspectionNo());
poOrderData.get(0).setBatchNo(recordData.getBatchNo());
poOrderData.get(0).setProductionDate(recordData.getProductionDate());

33
src/main/resources/mapper/pms/QcMapper.xml

@ -1608,7 +1608,10 @@
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operator,
isnull(dbo.joint_name(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operatorName,
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePerson,
isnull(dbo.joint_name2(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName
isnull(dbo.joint_name2(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName,
a.pass_qty,
a.not_pass_qty,
a.batch_qualified_qty
FROM qc_fai_record as a
left join part as d on a.site = d.site and a.bu_no = d.sourceBu and a.part_no = d.part_no
left join sys_user as u on a.inspector_no = u.username
@ -1738,6 +1741,9 @@
sampling_qty = #{samplingQty,jdbcType=DECIMAL},
roll_qty = #{rollQty,jdbcType=DECIMAL},
unqualified_qty = #{unqualifiedQty,jdbcType=DECIMAL},
pass_qty = #{passQty,jdbcType=DECIMAL},
not_pass_qty = #{notPassQty,jdbcType=DECIMAL},
batch_qualified_qty = #{batchQualifiedQty,jdbcType=DECIMAL},
submit_date = getDate()
WHERE site = #{site} AND inspection_no = #{inspectionNo} and bu_no = #{buNo}
</update>
@ -1948,7 +1954,10 @@
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operator,
isnull(dbo.joint_name(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operatorName,
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePerson,
isnull(dbo.joint_name2(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName
isnull(dbo.joint_name2(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName,
a.pass_qty,
a.not_pass_qty,
a.batch_qualified_qty
FROM qc_ipqc_record as a
left join part as d on a.site = d.site and a.bu_no = d.sourceBu and a.part_no = d.part_no
left join sys_user as u on a.inspector_no = u.username
@ -2057,7 +2066,6 @@
LEFT JOIN qc_method_item as b on a.site = b.site and a.item_no = b.ItemNo and a.bu_no = b.bu_no
LEFT JOIN qc_method as c on b.site = c.site and b.method_no = c.method_no and b.bu_no = c.bu_no
WHERE a.inspection_no = #{inspectionNo} and a.site = #{site} and a.bu_no = #{buNo}
order by a.order_id
</select>
@ -2092,6 +2100,9 @@
sampling_qty = #{samplingQty,jdbcType=DECIMAL},
roll_qty = #{rollQty,jdbcType=DECIMAL},
unqualified_qty = #{unqualifiedQty,jdbcType=DECIMAL},
pass_qty = #{passQty,jdbcType=DECIMAL},
not_pass_qty = #{notPassQty,jdbcType=DECIMAL},
batch_qualified_qty = #{batchQualifiedQty,jdbcType=DECIMAL},
submit_date = getDate()
WHERE site = #{site} and inspection_no = #{inspectionNo} and bu_no = #{buNo}
</update>
@ -2330,7 +2341,10 @@
a.batch_no,
a.production_date,
a.expiration_warning_date,
a.expiration_date
a.expiration_date,
a.pass_qty,
a.not_pass_qty,
a.batch_qualified_qty
FROM qc_iqc_record as a
left join part as d on a.site = d.site and a.bu_no = d.sourceBu and a.part_no = d.part_no
left join view_Supplier as s on a.site = s.site and a.supplier_no = s.SupplierID
@ -2492,6 +2506,9 @@
roll_count = #{rollCount,jdbcType=DECIMAL},
sampling_qty = #{samplingQty,jdbcType=DECIMAL},
unqualified_qty = #{unqualifiedQty,jdbcType=DECIMAL},
pass_qty = #{passQty,jdbcType=DECIMAL},
not_pass_qty = #{notPassQty,jdbcType=DECIMAL},
batch_qualified_qty = #{batchQualifiedQty,jdbcType=DECIMAL},
submit_date = getDate()
WHERE site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo}
</update>
@ -2695,7 +2712,10 @@
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operator,
isnull(dbo.joint_name(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operatorName,
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePerson,
isnull(dbo.joint_name2(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName
isnull(dbo.joint_name2(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName,
a.pass_qty,
a.not_pass_qty,
a.batch_qualified_qty
FROM qc_fqc_record as a
left join part as d on a.site = d.site and a.bu_no = d.sourceBu and a.part_no = d.part_no
left join sys_user as u on a.inspector_no = u.username
@ -2847,6 +2867,9 @@
sampling_qty = #{samplingQty,jdbcType=DECIMAL},
roll_qty = #{rollQty,jdbcType=DECIMAL},
unqualified_qty = #{unqualifiedQty,jdbcType=DECIMAL},
pass_qty = #{passQty,jdbcType=DECIMAL},
not_pass_qty = #{notPassQty,jdbcType=DECIMAL},
batch_qualified_qty = #{batchQualifiedQty,jdbcType=DECIMAL},
submit_date = getDate()
WHERE site = #{site} and inspection_no = #{inspectionNo} and bu_no = #{buNo}
</update>

Loading…
Cancel
Save