质量待检任务

This commit is contained in:
yinjinlu-pc\尹金路
2023-10-18 22:02:01 +08:00
parent 835f09a735
commit 01fd608843
16 changed files with 887 additions and 9 deletions

View File

@@ -10,6 +10,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="ipqcName" column="ipqc_name" />
<result property="ipqcType" column="ipqc_type" />
<result property="templateId" column="template_id" />
<result property="sourceDocId" column="source_doc_id" ></result>
<result property="sourceDocType" column="source_doc_type"></result>
<result property="sourceDocCode" column="source_doc_code"></result>
<result property="sourceLineId" column="source_line_id"></result>
<result property="workorderId" column="workorder_id" />
<result property="workorderCode" column="workorder_code" />
<result property="workorderName" column="workorder_name" />
@@ -52,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectQcIpqcVo">
select ipqc_id, ipqc_code, ipqc_name, ipqc_type, template_id, workorder_id, workorder_code, workorder_name, task_id, task_code, task_name, workstation_id, workstation_code, workstation_name, process_id, process_code, process_name, item_id, item_code, item_name, specification, unit_of_measure, quantity_check, quantity_unqualified, quantity_qualified, cr_rate, maj_rate, min_rate, cr_quantity, maj_quantity, min_quantity, check_result, inspect_date, inspector, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from qc_ipqc
select ipqc_id, ipqc_code, ipqc_name, ipqc_type, template_id, source_doc_id,source_doc_type, source_doc_code, source_line_id, workorder_id, workorder_code, workorder_name, task_id, task_code, task_name, workstation_id, workstation_code, workstation_name, process_id, process_code, process_name, item_id, item_code, item_name, specification, unit_of_measure, quantity_check, quantity_unqualified, quantity_qualified, cr_rate, maj_rate, min_rate, cr_quantity, maj_quantity, min_quantity, check_result, inspect_date, inspector, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from qc_ipqc
</sql>
<select id="selectQcIpqcList" parameterType="QcIpqc" resultMap="QcIpqcResult">
@@ -62,6 +66,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="ipqcName != null and ipqcName != ''"> and ipqc_name like concat('%', #{ipqcName}, '%')</if>
<if test="ipqcType != null and ipqcType != ''"> and ipqc_type = #{ipqcType}</if>
<if test="templateId != null "> and template_id = #{templateId}</if>
<if test="sourceDocId != null"> and source_doc_id = #{sourceDocId}</if>
<if test="sourceDocType !=null and sourceDocType !=''"> and source_doc_type = #{sourceDocType}</if>
<if test="sourceDocCode !=null and sourceDocCode !=''"> and source_doc_code = #{sourceDocCode}</if>
<if test="sourceLineId !=null"> and source_line_id = #{sourceLineId}</if>
<if test="workorderId != null "> and workorder_id = #{workorderId}</if>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
<if test="workorderName != null and workorderName != ''"> and workorder_name like concat('%', #{workorderName}, '%')</if>
@@ -130,6 +138,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="ipqcName != null">ipqc_name,</if>
<if test="ipqcType != null and ipqcType != ''">ipqc_type,</if>
<if test="templateId != null">template_id,</if>
<if test="sourceDocId != null">source_doc_id,</if>
<if test="sourceDocType !=null and sourceDocType !=''">source_doc_type,</if>
<if test="sourceDocCode !=null and sourceDocCode !=''">source_doc_code,</if>
<if test="sourceLineId !=null">source_line_id,</if>
<if test="workorderId != null">workorder_id,</if>
<if test="workorderCode != null and workorderCode != ''">workorder_code,</if>
<if test="workorderName != null and workorderName != ''">workorder_name,</if>
@@ -175,6 +187,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="ipqcName != null">#{ipqcName},</if>
<if test="ipqcType != null and ipqcType != ''">#{ipqcType},</if>
<if test="templateId != null">#{templateId},</if>
<if test="sourceDocId != null">#{sourceDocId},</if>
<if test="sourceDocType !=null and sourceDocType !=''">#{sourceDocType},</if>
<if test="sourceDocCode !=null and sourceDocCode !=''">#{sourceDocCode},</if>
<if test="sourceLineId !=null">#{sourceLineId},</if>
<if test="workorderId != null">#{workorderId},</if>
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
<if test="workorderName != null and workorderName != ''">#{workorderName},</if>
@@ -224,6 +240,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="ipqcName != null">ipqc_name = #{ipqcName},</if>
<if test="ipqcType != null and ipqcType != ''">ipqc_type = #{ipqcType},</if>
<if test="templateId != null">template_id = #{templateId},</if>
<if test="sourceDocId !=null">source_doc_id = #{sourceDocId},</if>
<if test="sourceDocType !=null and sourceDocType !=''">source_doc_type = #{sourceDocType},</if>
<if test="sourceDocCode !=null and sourceDocCode !=''">source_doc_code = #{sourceDocCode},</if>
<if test="sourceLineId !=null">source_line_id = #{sourceLineId},</if>
<if test="workorderId != null">workorder_id = #{workorderId},</if>
<if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>
<if test="workorderName != null and workorderName != ''">workorder_name = #{workorderName},</if>

View File

@@ -10,6 +10,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="iqcName" column="iqc_name" />
<result property="templateId" column="template_id" />
<result property="vendorId" column="vendor_id" />
<result property="sourceDocId" column="source_doc_id" ></result>
<result property="sourceDocType" column="source_doc_type"></result>
<result property="sourceDocCode" column="source_doc_code"></result>
<result property="sourceLineId" column="source_line_id"></result>
<result property="vendorCode" column="vendor_code" />
<result property="vendorName" column="vendor_name" />
<result property="vendorNick" column="vendor_nick" />
@@ -48,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectQcIqcVo">
select iqc_id, iqc_code, iqc_name, template_id, vendor_id, vendor_code, vendor_name, vendor_nick, vendor_batch, item_id, item_code, item_name, specification, unit_of_measure, quantity_min_check, quantity_max_unqualified, quantity_recived, quantity_check, quantity_unqualified, cr_rate, maj_rate, min_rate, cr_quantity, maj_quantity, min_quantity, check_result, recive_date, inspect_date, inspector,u.nick_name as inspector_name, q.status, q.remark, attr1, attr2, attr3, attr4, q.create_by, q.create_time, q.update_by, q.update_time from qc_iqc q left join sys_user u on u.user_name = q.inspector
select iqc_id, iqc_code, iqc_name, template_id, source_doc_id,source_doc_type, source_doc_code, source_line_id, vendor_id, vendor_code, vendor_name, vendor_nick, vendor_batch, item_id, item_code, item_name, specification, unit_of_measure, quantity_min_check, quantity_max_unqualified, quantity_recived, quantity_check, quantity_unqualified, cr_rate, maj_rate, min_rate, cr_quantity, maj_quantity, min_quantity, check_result, recive_date, inspect_date, inspector,u.nick_name as inspector_name, q.status, q.remark, attr1, attr2, attr3, attr4, q.create_by, q.create_time, q.update_by, q.update_time from qc_iqc q left join sys_user u on u.user_name = q.inspector
</sql>
<select id="selectQcIqcList" parameterType="QcIqc" resultMap="QcIqcResult">
@@ -57,6 +61,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="iqcCode != null and iqcCode != ''"> and iqc_code = #{iqcCode}</if>
<if test="iqcName != null and iqcName != ''"> and iqc_name like concat('%', #{iqcName}, '%')</if>
<if test="templateId != null "> and template_id = #{templateId}</if>
<if test="sourceDocId != null"> and source_doc_id = #{sourceDocId}</if>
<if test="sourceDocType !=null and sourceDocType !=''"> and source_doc_type = #{sourceDocType}</if>
<if test="sourceDocCode !=null and sourceDocCode !=''"> and source_doc_code = #{sourceDocCode}</if>
<if test="sourceLineId !=null"> and source_line_id = #{sourceLineId}</if>
<if test="vendorId != null "> and vendor_id = #{vendorId}</if>
<if test="vendorCode != null and vendorCode != ''"> and vendor_code = #{vendorCode}</if>
<if test="vendorName != null and vendorName != ''"> and vendor_name like concat('%', #{vendorName}, '%')</if>
@@ -103,6 +111,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="iqcCode != null and iqcCode != ''">iqc_code,</if>
<if test="iqcName != null and iqcName != ''">iqc_name,</if>
<if test="templateId != null">template_id,</if>
<if test="sourceDocId != null">source_doc_id,</if>
<if test="sourceDocType !=null and sourceDocType !=''">source_doc_type,</if>
<if test="sourceDocCode !=null and sourceDocCode !=''">source_doc_code,</if>
<if test="sourceLineId !=null">source_line_id,</if>
<if test="vendorId != null">vendor_id,</if>
<if test="vendorCode != null and vendorCode != ''">vendor_code,</if>
<if test="vendorName != null and vendorName != ''">vendor_name,</if>
@@ -143,6 +155,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="iqcCode != null and iqcCode != ''">#{iqcCode},</if>
<if test="iqcName != null and iqcName != ''">#{iqcName},</if>
<if test="templateId != null">#{templateId},</if>
<if test="sourceDocId != null">#{sourceDocId},</if>
<if test="sourceDocType !=null and sourceDocType !=''">#{sourceDocType},</if>
<if test="sourceDocCode !=null and sourceDocCode !=''">#{sourceDocCode},</if>
<if test="sourceLineId !=null">#{sourceLineId},</if>
<if test="vendorId != null">#{vendorId},</if>
<if test="vendorCode != null and vendorCode != ''">#{vendorCode},</if>
<if test="vendorName != null and vendorName != ''">#{vendorName},</if>
@@ -208,6 +224,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="iqcCode != null and iqcCode != ''">iqc_code = #{iqcCode},</if>
<if test="iqcName != null and iqcName != ''">iqc_name = #{iqcName},</if>
<if test="templateId != null">template_id = #{templateId},</if>
<if test="sourceDocId !=null">source_doc_id = #{sourceDocId},</if>
<if test="sourceDocType !=null and sourceDocType !=''">source_doc_type = #{sourceDocType},</if>
<if test="sourceDocCode !=null and sourceDocCode !=''">source_doc_code = #{sourceDocCode},</if>
<if test="sourceLineId !=null">source_line_id = #{sourceLineId},</if>
<if test="vendorId != null">vendor_id = #{vendorId},</if>
<if test="vendorCode != null and vendorCode != ''">vendor_code = #{vendorCode},</if>
<if test="vendorName != null and vendorName != ''">vendor_name = #{vendorName},</if>

View File

@@ -9,6 +9,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="oqcCode" column="oqc_code" />
<result property="oqcName" column="oqc_name" />
<result property="templateId" column="template_id" />
<result property="sourceDocId" column="source_doc_id" ></result>
<result property="sourceDocType" column="source_doc_type"></result>
<result property="sourceDocCode" column="source_doc_code"></result>
<result property="sourceLineId" column="source_line_id"></result>
<result property="clientId" column="client_id" />
<result property="clientCode" column="client_code" />
<result property="clientName" column="client_name" />
@@ -47,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectQcOqcVo">
select oqc_id, oqc_code, oqc_name, template_id, client_id, client_code, client_name, batch_code, item_id, item_code, item_name, specification, unit_of_measure, quantity_min_check, quantity_max_unqualified, quantity_out, quantity_check, quantity_unqualified, quantity_quanlified, cr_rate, maj_rate, min_rate, cr_quantity, maj_quantity, min_quantity, check_result, out_date, inspect_date, inspector, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from qc_oqc
select oqc_id, oqc_code, oqc_name, template_id, source_doc_id,source_doc_type, source_doc_code, source_line_id, client_id, client_code, client_name, batch_code, item_id, item_code, item_name, specification, unit_of_measure, quantity_min_check, quantity_max_unqualified, quantity_out, quantity_check, quantity_unqualified, quantity_quanlified, cr_rate, maj_rate, min_rate, cr_quantity, maj_quantity, min_quantity, check_result, out_date, inspect_date, inspector, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from qc_oqc
</sql>
<select id="selectQcOqcList" parameterType="QcOqc" resultMap="QcOqcResult">
@@ -56,6 +60,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="oqcCode != null and oqcCode != ''"> and oqc_code = #{oqcCode}</if>
<if test="oqcName != null and oqcName != ''"> and oqc_name like concat('%', #{oqcName}, '%')</if>
<if test="templateId != null "> and template_id = #{templateId}</if>
<if test="sourceDocId != null"> and source_doc_id = #{sourceDocId}</if>
<if test="sourceDocType !=null and sourceDocType !=''"> and source_doc_type = #{sourceDocType}</if>
<if test="sourceDocCode !=null and sourceDocCode !=''"> and source_doc_code = #{sourceDocCode}</if>
<if test="sourceLineId !=null"> and source_line_id = #{sourceLineId}</if>
<if test="clientId != null "> and client_id = #{clientId}</if>
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode}</if>
<if test="clientName != null and clientName != ''"> and client_name like concat('%', #{clientName}, '%')</if>
@@ -102,6 +110,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="oqcCode != null and oqcCode != ''">oqc_code,</if>
<if test="oqcName != null">oqc_name,</if>
<if test="templateId != null">template_id,</if>
<if test="sourceDocId != null">source_doc_id,</if>
<if test="sourceDocType !=null and sourceDocType !=''">source_doc_type,</if>
<if test="sourceDocCode !=null and sourceDocCode !=''">source_doc_code,</if>
<if test="sourceLineId !=null">source_line_id,</if>
<if test="clientId != null">client_id,</if>
<if test="clientCode != null and clientCode != ''">client_code,</if>
<if test="clientName != null and clientName != ''">client_name,</if>
@@ -142,6 +154,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="oqcCode != null and oqcCode != ''">#{oqcCode},</if>
<if test="oqcName != null">#{oqcName},</if>
<if test="templateId != null">#{templateId},</if>
<if test="sourceDocId != null">#{sourceDocId},</if>
<if test="sourceDocType !=null and sourceDocType !=''">#{sourceDocType},</if>
<if test="sourceDocCode !=null and sourceDocCode !=''">#{sourceDocCode},</if>
<if test="sourceLineId !=null">#{sourceLineId},</if>
<if test="clientId != null">#{clientId},</if>
<if test="clientCode != null and clientCode != ''">#{clientCode},</if>
<if test="clientName != null and clientName != ''">#{clientName},</if>
@@ -186,6 +202,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="oqcCode != null and oqcCode != ''">oqc_code = #{oqcCode},</if>
<if test="oqcName != null">oqc_name = #{oqcName},</if>
<if test="templateId != null">template_id = #{templateId},</if>
<if test="sourceDocId !=null">source_doc_id = #{sourceDocId},</if>
<if test="sourceDocType !=null and sourceDocType !=''">source_doc_type = #{sourceDocType},</if>
<if test="sourceDocCode !=null and sourceDocCode !=''">source_doc_code = #{sourceDocCode},</if>
<if test="sourceLineId !=null">source_line_id = #{sourceLineId},</if>
<if test="clientId != null">client_id = #{clientId},</if>
<if test="clientCode != null and clientCode != ''">client_code = #{clientCode},</if>
<if test="clientName != null and clientName != ''">client_name = #{clientName},</if>

View File

@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.qc.mapper.QcPendingInspectMapper">
<resultMap id="QcPendingInspectResult" type="QcPendingInspect">
<result property="sourceDocId" column="source_doc_id" />
<result property="sourceDocCode" column="source_doc_code" />
<result property="sourceLineId" column="source_line_id"></result>
<result property="recordTime" column="record_time" />
<result property="qcType" column="qc_type" />
<result property="itemId" column="item_id" />
<result property="itemCode" column="item_code" />
<result property="itemName" column="item_name" />
<result property="specification" column="specification"></result>
<result property="unitOfMeasure" column="unit_of_measure"></result>
<result property="quantityUncheck" column="quantity_uncheck" />
<result property="workOrderId" column="workorder_id" />
<result property="workOrderCode" column="workorder_code" />
<result property="workOrderName" column="workorder_name" />
<result property="workstationId" column="workstation_id" />
<result property="workstationCode" column="workstation_code" />
<result property="workstationName" column="workstation_name" />
<result property="vendorClientId" column="vendor_client_id"></result>
<result property="vendorClientCode" column="vendor_client_code"></result>
<result property="vendorClientName" column="vendor_client_name"></result>
<result property="vendorClientNick" column="vendor_client_nick"></result>
<result property="batchCode" column="batch_code"></result>
<result property="taskId" column="task_id" />
<result property="taskCode" column="task_code" />
<result property="taskName" column="task_name" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseCode" column="warehouse_code" />
<result property="warehouseName" column="warehouse_name" />
<result property="locationId" column="location_id" />
<result property="locationCode" column="location_code" />
<result property="locationName" column="location_name" />
<result property="areaId" column="area_id" />
<result property="areaCode" column="area_code" />
<result property="areaName" column="area_name" />
<result property="address" column="address" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<select id="selectQcPendingList" parameterType="QcPendingInspect" resultMap="QcPendingInspectResult">
SELECT *
FROM
(
SELECT
wi.recpt_id as source_doc_id,
wi.recpt_code AS source_doc_code,
wil.line_id AS source_line_id,
wi.create_time AS record_time,
'IQC' AS qc_type,
wil.item_id,
wil.item_code,
wil.item_name,
wil.specification,
wil.unit_of_measure,
wil.quantity_recived AS quantity_uncheck,
NULL AS workorder_id,
NULL AS workorder_code,
NULL AS workorder_name,
NULL AS task_id,
NULL AS task_code,
NULL AS task_name,
NULL AS workstation_id,
NULL AS workstation_code,
NULL AS workstation_name,
wi.vendor_id as vendor_client_id,
wi.vendor_code as vendor_client_code,
wi.vendor_name as vendor_client_name,
wi.vendor_nick as vendor_client_nick,
wil.batch_code,
wil.warehouse_id,
wil.warehouse_code,
wil.warehouse_name,
wil.location_id,
wil.location_code,
wil.location_name,
wil.area_id,
wil.area_code,
wil.area_name,
concat( wil.warehouse_name, wil.location_name, wil.area_name ) AS address
FROM
wm_item_recpt wi
LEFT JOIN wm_item_recpt_line wil ON wi.recpt_id = wil.recpt_id
WHERE
wil.iqc_check = 'Y'
AND wil.iqc_id IS NULL UNION ALL
SELECT
pf.record_id as source_doc_id,
pf.feedback_code AS source_doc_code,
pf.record_id as source_line_id,
pf.feedback_time AS record_time,
'PQC' AS qc_type,
pf.item_id,
pf.item_code,
pf.item_name,
pf.specification,
pf.unit_of_measure,
pf.quantity_uncheck,
pf.workorder_id,
pf.workorder_code,
pf.workorder_name,
pf.task_id,
pf.task_code,
NULL AS task_name,
pf.workstation_id,
pf.workstation_code,
pf.workstation_name,
NULL as vendor_client_id,
NULL as vendor_client_code,
NULL as vendor_client_name,
NULL as vendor_client_nick,
NULL AS batch_code,
NULL AS warehouse_id,
NULL AS warehouse_code,
NULL AS warehouse_name,
NULL AS location_id,
NULL AS location_code,
NULL AS location_name,
NULL AS area_id,
NULL AS area_code,
NULL AS area_name,
pf.workstation_name AS address
FROM
pro_feedback pf
WHERE
pf.quantity_uncheck > 0 UNION ALL
SELECT
ps.salse_id AS source_doc_id,
ps.salse_code AS source_doc_code,
psl.line_id AS source_line_id,
ps.create_time AS record_time,
'OQC' AS qc_type,
psl.item_id,
psl.item_code,
psl.item_name,
psl.specification,
psl.unit_of_measure,
psl.quantity_salse AS quantity_uncheck,
NULL AS workorder_id,
NULL AS workorder_code,
NULL AS workorder_name,
NULL AS task_id,
NULL AS task_code,
NULL AS task_name,
NULL AS workstation_id,
NULL AS workstation_code,
NULL AS workstation_name,
ps.client_id as vendor_client_id,
ps.client_code as vendor_client_code,
ps.client_name as vendor_client_name,
ps.client_nick as vendor_client_nick,
psl.batch_code,
psl.warehouse_id,
psl.warehouse_code,
psl.warehouse_name,
psl.location_id,
psl.location_code,
psl.location_name,
psl.area_id,
psl.area_code,
psl.area_name,
concat( psl.warehouse_name, psl.location_name, psl.area_name ) AS address
FROM
wm_product_salse ps
LEFT JOIN wm_product_salse_line psl ON ps.salse_id = psl.salse_id
WHERE
psl.oqc_check = 'Y'
AND psl.oqc_id IS NULL
) t
ORDER BY record_time DESC
</select>
</mapper>