Browse Source

2025-11-03

oqc优化
master
fengyuan_yang 2 months ago
parent
commit
659623477d
  1. 6
      src/main/java/com/gaotao/modules/pms/data/QcFAIRecordData.java
  2. 83
      src/main/resources/mapper/pms/QcMapper.xml

6
src/main/java/com/gaotao/modules/pms/data/QcFAIRecordData.java

@ -175,9 +175,9 @@ public class QcFAIRecordData extends QueryPage {
// 特殊要求 // 特殊要求
private String specialRequirements; private String specialRequirements;
// 采购订单 // 采购订单
private String poOrderNo;
private String poOrderNo; // 关联单号
// 行号 // 行号
private String poItemNo;
private String poItemNo; // 关联单行号
// 子明细数据数量 // 子明细数据数量
private Integer subDetailRecordNum; private Integer subDetailRecordNum;
// 加工中心 // 加工中心
@ -288,4 +288,6 @@ public class QcFAIRecordData extends QueryPage {
private String receiptNo; private String receiptNo;
private String receiptItemNo; private String receiptItemNo;
private String documentNo; private String documentNo;
private String customerNo;
private String customerName;
} }

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

@ -2714,11 +2714,11 @@
qir.site, qir.site,
qir.bu_no, qir.bu_no,
qir.roll_count qir.roll_count
FROM qc_stock_record as qir
FROM qc_oqc_record as qir
LEFT JOIN part p ON qir.part_no = p.partNo and qir.site = p.site LEFT JOIN part p ON qir.part_no = p.partNo and qir.site = p.site
WHERE qir.site in (select site from AccessSite where userID = #{userName}) WHERE qir.site in (select site from AccessSite where userID = #{userName})
and qir.bu_no in (select bu_no from AccessBu where username = #{userName}) and qir.bu_no in (select bu_no from AccessBu where username = #{userName})
and qir.detail_flag = 'N' and qir.order_ref_type = '发货通知单'
and qir.detail_flag = 'N'
</select> </select>
<select id="selectFQASPartAttributeByPartNo" resultType="com.gaotao.modules.pms.data.QcFAIRecordData"> <select id="selectFQASPartAttributeByPartNo" resultType="com.gaotao.modules.pms.data.QcFAIRecordData">
@ -2749,7 +2749,7 @@
<!-- 新增OQC明细记录信息 --> <!-- 新增OQC明细记录信息 -->
<insert id="saveFQASDetailedRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> <insert id="saveFQASDetailedRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData">
INSERT INTO qc_stock_detailed_record
INSERT INTO qc_oqc_detailed_record
(inspection_no, template_id, sampling_level_no, sampling_level_desc, sampling_programme_no, sampling_programme_desc, AQL, AC, RE, (inspection_no, template_id, sampling_level_no, sampling_level_desc, sampling_programme_no, sampling_programme_desc, AQL, AC, RE,
item_no, item_desc, object_id, object_desc, default_value, min_value, max_value, value_type_db, value_type, site, sampling_qty, bu_no, serial_no) item_no, item_desc, object_id, object_desc, default_value, min_value, max_value, value_type_db, value_type, site, sampling_qty, bu_no, serial_no)
VALUES VALUES
@ -2759,7 +2759,7 @@
<!-- 修改OQC检验记录 --> <!-- 修改OQC检验记录 -->
<update id="updateFQASRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> <update id="updateFQASRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData">
UPDATE qc_stock_record
UPDATE qc_oqc_record
SET inspection_type_no = #{inspectionTypeNo}, SET inspection_type_no = #{inspectionTypeNo},
sampling_qty = #{samplingQty}, sampling_qty = #{samplingQty},
inspection_cycle = #{inspectionCycle}, inspection_cycle = #{inspectionCycle},
@ -2802,19 +2802,15 @@
isnull(dbo.joint_name(site, bu_no, inspection_no, 'responsible'), '') as responsiblePersonName, isnull(dbo.joint_name(site, bu_no, inspection_no, 'responsible'), '') as responsiblePersonName,
pass_qty, pass_qty,
not_pass_qty, not_pass_qty,
order_ref_type,
order_ref1,
order_ref2,
order_ref3,
order_ref4,
order_ref5,
order_ref6,
create_by
FROM qc_stock_record
create_by,
customer_no,
dbo.Get_CustomerDesc(site, customer_no) as customerName,
po_orderNo,
po_itemNo
FROM qc_oqc_record
<where> <where>
site in (select site from AccessSite where userID = #{query.userName}) site in (select site from AccessSite where userID = #{query.userName})
and bu_no in (select bu_no from AccessBu where username = #{query.userName}) and bu_no in (select bu_no from AccessBu where username = #{query.userName})
and order_ref_type = '发货通知单'
<if test="query.buDesc != null and query.buDesc != ''"> <if test="query.buDesc != null and query.buDesc != ''">
AND dbo.get_bu_desc ( site, bu_no ) = #{query.buDesc} AND dbo.get_bu_desc ( site, bu_no ) = #{query.buDesc}
</if> </if>
@ -2854,23 +2850,11 @@
<if test="query.endDate2 != null"> <if test="query.endDate2 != null">
AND #{query.endDate2} >= create_date AND #{query.endDate2} >= create_date
</if> </if>
<if test = "query.orderRef1 != null and query.orderRef1 != ''">
AND order_ref1 LIKE #{query.orderRef1}
</if>
<if test = "query.orderRef2 != null and query.orderRef2 != ''">
AND order_ref2 LIKE #{query.orderRef2}
</if>
<if test = "query.orderRef3 != null and query.orderRef3 != ''">
AND order_ref3 LIKE #{query.orderRef3}
<if test = "query.customerNo != null and query.customerNo != ''">
AND customer_no LIKE #{query.customerNo}
</if> </if>
<if test = "query.orderRef4 != null and query.orderRef4 != ''">
AND order_ref4 LIKE #{query.orderRef4}
</if>
<if test = "query.orderRef5 != null and query.orderRef5 != ''">
AND order_ref5 LIKE #{query.orderRef5}
</if>
<if test = "query.orderRef6 != null and query.orderRef6 != ''">
AND order_ref6 LIKE #{query.orderRef6}
<if test = "query.customerName != null and query.customerName != ''">
AND dbo.Get_CustomerDesc(site, customer_no) LIKE #{query.customerName}
</if> </if>
</where> </where>
ORDER BY ORDER BY
@ -2914,7 +2898,7 @@
c.method_name, c.method_name,
c.method_remark, c.method_remark,
a.sampling_qty a.sampling_qty
FROM qc_stock_detailed_record as a
FROM qc_oqc_detailed_record as a
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_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 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} WHERE a.inspection_no = #{inspectionNo} and a.site = #{site} and a.bu_no = #{buNo}
@ -2930,7 +2914,7 @@
sampling_location, sampling_location,
is_submit, is_submit,
sampling_location_b sampling_location_b
FROM qc_stock_sub_detail_record
FROM qc_oqc_sub_detail_record
WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo}
</select> </select>
@ -2945,7 +2929,7 @@
<!-- 修改FQAS主记录信息 --> <!-- 修改FQAS主记录信息 -->
<update id="updateFQASMasterRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> <update id="updateFQASMasterRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData">
UPDATE qc_stock_record
UPDATE qc_oqc_record
SET disposal_measures = #{disposalMeasures}, SET disposal_measures = #{disposalMeasures},
disposal_remark = #{disposalRemark}, disposal_remark = #{disposalRemark},
inspection_result = #{inspectionResult}, inspection_result = #{inspectionResult},
@ -2963,7 +2947,7 @@
<!-- 修改FQAS明细记录信息 --> <!-- 修改FQAS明细记录信息 -->
<update id="updateFQASDetailedRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> <update id="updateFQASDetailedRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData">
UPDATE qc_stock_detailed_record
UPDATE qc_oqc_detailed_record
SET item_result = #{itemResult}, SET item_result = #{itemResult},
unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL},
sampling_qty = #{samplingQty,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL},
@ -2978,21 +2962,18 @@
site, site,
bu_no, bu_no,
inspection_no, inspection_no,
order_ref1,
not_pass_qty, not_pass_qty,
roll_count, roll_count,
inspection_result, inspection_result,
disposal_measures, disposal_measures,
part_no,
order_ref_type,
order_ref2
FROM qc_stock_record
part_no
FROM qc_oqc_record
where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo}
</select> </select>
<!-- 修改FQAS主记录标识为已提交 --> <!-- 修改FQAS主记录标识为已提交 -->
<update id="updateFQASMasterSubmitFlag" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> <update id="updateFQASMasterSubmitFlag" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData">
UPDATE qc_stock_record
UPDATE qc_oqc_record
SET submit_flag = 'Y', SET submit_flag = 'Y',
state = '已完成' state = '已完成'
WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo}
@ -3000,14 +2981,14 @@
<!-- 修改FQAS明细记录标识为已提交 --> <!-- 修改FQAS明细记录标识为已提交 -->
<update id="updateFQASDetailSubmitFlag" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> <update id="updateFQASDetailSubmitFlag" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData">
UPDATE qc_stock_detailed_record
UPDATE qc_oqc_detailed_record
SET is_submit = 'Y' SET is_submit = 'Y'
WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo}
</update> </update>
<!-- 修改FQAS子明细记录标识为已提交 --> <!-- 修改FQAS子明细记录标识为已提交 -->
<update id="updateFQASSubDetailSubmitFlag" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> <update id="updateFQASSubDetailSubmitFlag" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData">
UPDATE qc_stock_sub_detail_record
UPDATE qc_oqc_sub_detail_record
SET is_submit = 'Y' SET is_submit = 'Y'
WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo}
</update> </update>
@ -3015,19 +2996,19 @@
<!-- 查询FQAS检验记录是否已提交 --> <!-- 查询FQAS检验记录是否已提交 -->
<select id="checkFQASIsSubmit" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData" resultType="com.gaotao.modules.pms.data.QcFAIRecordData"> <select id="checkFQASIsSubmit" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData" resultType="com.gaotao.modules.pms.data.QcFAIRecordData">
SELECT submit_flag SELECT submit_flag
FROM qc_stock_record
FROM qc_oqc_record
WHERE inspection_no = #{inspectionNo} and site = #{site} WHERE inspection_no = #{inspectionNo} and site = #{site}
</select> </select>
<!-- 删除FQAS子明细的老数据 --> <!-- 删除FQAS子明细的老数据 -->
<delete id="delFQASSubDetailedRecord" parameterType="com.gaotao.modules.pms.data.QcSubDetailInformationData"> <delete id="delFQASSubDetailedRecord" parameterType="com.gaotao.modules.pms.data.QcSubDetailInformationData">
DELETE FROM qc_stock_sub_detail_record
DELETE FROM qc_oqc_sub_detail_record
WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo}
</delete> </delete>
<!-- 新增FQAS子明细信息 --> <!-- 新增FQAS子明细信息 -->
<insert id="saveFQASSubDetailed"> <insert id="saveFQASSubDetailed">
INSERT INTO qc_stock_sub_detail_record
INSERT INTO qc_oqc_sub_detail_record
(inspection_no, item_no, sub_detail_value, sampling_location, site, sampling_location_b, bu_no) (inspection_no, item_no, sub_detail_value, sampling_location, site, sampling_location_b, bu_no)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
@ -3037,24 +3018,24 @@
<!-- 删除FQAS检验记录 --> <!-- 删除FQAS检验记录 -->
<delete id="deleteFQASRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> <delete id="deleteFQASRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData">
DELETE FROM qc_stock_record
DELETE FROM qc_oqc_record
WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo}
</delete> </delete>
<!-- 删除FQAS明细记录信息 --> <!-- 删除FQAS明细记录信息 -->
<delete id="deleteFQASDetailedRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> <delete id="deleteFQASDetailedRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData">
DELETE FROM qc_stock_detailed_record
DELETE FROM qc_oqc_detailed_record
WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo}
</delete> </delete>
<!-- 删除FQAS子明细记录信息 --> <!-- 删除FQAS子明细记录信息 -->
<delete id="deleteFQASSubDetailedRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> <delete id="deleteFQASSubDetailedRecord" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData">
DELETE FROM qc_stock_sub_detail_record
DELETE FROM qc_oqc_sub_detail_record
WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo} WHERE inspection_no = #{inspectionNo} and site = #{site} and bu_no = #{buNo}
</delete> </delete>
<update id="actionFQASInspection" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData"> <update id="actionFQASInspection" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData">
update qc_stock_record
update qc_oqc_record
set action_date = getDate(), set action_date = getDate(),
action_by = #{actionBy}, action_by = #{actionBy},
state = #{state} state = #{state}
@ -3067,7 +3048,7 @@
qc_iqc_record qc_iqc_record
</if> </if>
<if test = "inspectionTypeNo == '108'"> <if test = "inspectionTypeNo == '108'">
qc_stock_record
qc_oqc_record
</if> </if>
set sampling_qty = #{samplingQty,jdbcType=DECIMAL} set sampling_qty = #{samplingQty,jdbcType=DECIMAL}
where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo}
@ -3079,7 +3060,7 @@
qc_iqc_detailed_record qc_iqc_detailed_record
</if> </if>
<if test = "inspectionTypeNo == '108'"> <if test = "inspectionTypeNo == '108'">
qc_stock_detailed_record
qc_oqc_detailed_record
</if> </if>
set sampling_qty = #{samplingQty,jdbcType=DECIMAL} set sampling_qty = #{samplingQty,jdbcType=DECIMAL}
where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo} where site = #{site} and bu_no = #{buNo} and inspection_no = #{inspectionNo}

Loading…
Cancel
Save