|
|
@ -1902,112 +1902,123 @@ |
|
|
|
|
|
|
|
|
<!-- 新增IPQC主记录信息 --> |
|
|
<!-- 新增IPQC主记录信息 --> |
|
|
<insert id="saveIPQCRecord" parameterType="QcFAIRecordData"> |
|
|
<insert id="saveIPQCRecord" parameterType="QcFAIRecordData"> |
|
|
INSERT INTO qc_ipqc_record (inspection_no, site, bu_no, state, task_date, inspection_type_no, inspection_cycle, order_no, operation_desc, resource_id, part_no, roll_qty, sampling_qty, ssr_id, seq_no, batch_roll_no, special_requirements, work_center_no, roll_no, um_id, pass_qty) |
|
|
|
|
|
VALUES(#{inspectionNo}, #{site}, #{buNo}, #{state}, getDate(), #{inspectionTypeNo}, #{inspectionCycle,jdbcType=DECIMAL}, #{orderNo}, #{operationDesc}, #{resourceId}, #{partNo}, #{rollQty}, #{samplingQty,jdbcType=DECIMAL}, #{ssrId}, #{seqNo}, #{batchRollNo}, #{specialRequirements}, #{workCenterNo}, #{rollNo}, #{umId}, #{samplingQty}) |
|
|
|
|
|
|
|
|
INSERT INTO qc_ipqc_record (inspection_no, site, bu_no, state, task_date, inspection_type_no, inspection_cycle, order_no, operation_desc, resource_id, part_no, roll_qty, sampling_qty, ssr_id, seq_no, batch_roll_no, special_requirements, work_center_no, roll_no, um_id, pass_qty, create_by, important_flag) |
|
|
|
|
|
VALUES(#{inspectionNo}, #{site}, #{buNo}, #{state}, getDate(), #{inspectionTypeNo}, #{inspectionCycle,jdbcType=DECIMAL}, #{orderNo}, #{operationDesc}, #{resourceId}, #{partNo}, #{rollQty}, #{samplingQty,jdbcType=DECIMAL}, #{ssrId}, #{seqNo}, #{batchRollNo}, #{specialRequirements}, #{workCenterNo}, #{rollNo}, #{umId}, #{samplingQty}, #{createBy}, #{importantFlag}) |
|
|
</insert> |
|
|
</insert> |
|
|
|
|
|
|
|
|
<!-- 查询IPQC主记录信息 --> |
|
|
<!-- 查询IPQC主记录信息 --> |
|
|
<select id="qcIPQCInspectionSearch" parameterType="QcFAIRecordData" resultType="QcFAIRecordData"> |
|
|
<select id="qcIPQCInspectionSearch" parameterType="QcFAIRecordData" resultType="QcFAIRecordData"> |
|
|
SELECT |
|
|
SELECT |
|
|
inspection_no, |
|
|
|
|
|
site, |
|
|
|
|
|
bu_no, |
|
|
|
|
|
dbo.get_bu_desc(site, bu_no) as buDesc, |
|
|
|
|
|
state, |
|
|
|
|
|
inspection_result, |
|
|
|
|
|
task_date, |
|
|
|
|
|
inspection_type_no, |
|
|
|
|
|
inspection_cycle, |
|
|
|
|
|
order_no, |
|
|
|
|
|
operation_desc, |
|
|
|
|
|
resource_id, |
|
|
|
|
|
dbo.qc_get_resource_desc(site, resource_id, work_center_no) as resourceDesc, |
|
|
|
|
|
part_no, |
|
|
|
|
|
dbo.qc_get_part_desc(part_no) as part_desc, |
|
|
|
|
|
inspection_remark, |
|
|
|
|
|
roll_qty, |
|
|
|
|
|
sampling_qty, |
|
|
|
|
|
disposal_measures, |
|
|
|
|
|
disposal_remark, |
|
|
|
|
|
inspector_date, |
|
|
|
|
|
inspector_no, |
|
|
|
|
|
dbo.qc_get_inspector_name(site, inspector_no) as inspectorName, |
|
|
|
|
|
ssr_id, |
|
|
|
|
|
unqualified_qty, |
|
|
|
|
|
submit_flag, |
|
|
|
|
|
dbo.qc_get_spec(part_no) as spec, |
|
|
|
|
|
seq_no, |
|
|
|
|
|
batch_roll_no, |
|
|
|
|
|
special_requirements, |
|
|
|
|
|
work_center_no, |
|
|
|
|
|
roll_no, |
|
|
|
|
|
um_id, |
|
|
|
|
|
dbo.qc_get_um_name(site, um_id) as umName, |
|
|
|
|
|
action_date, |
|
|
|
|
|
action_by, |
|
|
|
|
|
isnull(dbo.joint_id(site, bu_no, inspection_no, 'coordination'), '') as operator, |
|
|
|
|
|
isnull(dbo.joint_name(site, bu_no, inspection_no, 'coordination'), '') as operatorName, |
|
|
|
|
|
isnull(dbo.joint_id(site, bu_no, inspection_no, 'supplier'), '') as responsiblePerson, |
|
|
|
|
|
pass_qty, |
|
|
|
|
|
not_pass_qty |
|
|
|
|
|
FROM qc_ipqc_record |
|
|
|
|
|
|
|
|
a.inspection_no, |
|
|
|
|
|
a.site, |
|
|
|
|
|
a.bu_no, |
|
|
|
|
|
dbo.get_bu_desc(a.site, a.bu_no) as buDesc, |
|
|
|
|
|
a.state, |
|
|
|
|
|
a.inspection_result, |
|
|
|
|
|
a.task_date, |
|
|
|
|
|
a.inspection_type_no, |
|
|
|
|
|
a.inspection_cycle, |
|
|
|
|
|
a.order_no, |
|
|
|
|
|
a.operation_desc, |
|
|
|
|
|
a.resource_id, |
|
|
|
|
|
dbo.qc_get_resource_desc(a.site, a.resource_id, a.work_center_no) as resourceDesc, |
|
|
|
|
|
a.part_no, |
|
|
|
|
|
dbo.qc_get_part_desc(a.part_no) as part_desc, |
|
|
|
|
|
a.inspection_remark, |
|
|
|
|
|
a.roll_qty, |
|
|
|
|
|
a.sampling_qty, |
|
|
|
|
|
a.disposal_measures, |
|
|
|
|
|
a.disposal_remark, |
|
|
|
|
|
a.inspector_date, |
|
|
|
|
|
a.inspector_no, |
|
|
|
|
|
dbo.qc_get_inspector_name(a.site, a.inspector_no) as inspectorName, |
|
|
|
|
|
a.ssr_id, |
|
|
|
|
|
a.unqualified_qty, |
|
|
|
|
|
a.submit_flag, |
|
|
|
|
|
dbo.qc_get_spec(a.part_no) as spec, |
|
|
|
|
|
a.seq_no, |
|
|
|
|
|
a.batch_roll_no, |
|
|
|
|
|
a.special_requirements, |
|
|
|
|
|
a.work_center_no, |
|
|
|
|
|
w.WorkCenterDesc, |
|
|
|
|
|
a.roll_no, |
|
|
|
|
|
a.um_id, |
|
|
|
|
|
dbo.qc_get_um_name(a.site, a.um_id) as umName, |
|
|
|
|
|
a.action_date, |
|
|
|
|
|
a.action_by, |
|
|
|
|
|
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, 'supplier'), '') as responsiblePerson, |
|
|
|
|
|
a.pass_qty, |
|
|
|
|
|
a.not_pass_qty, |
|
|
|
|
|
p.DefaultDepartmentID as departmentID, |
|
|
|
|
|
d.DepartmentName, |
|
|
|
|
|
a.create_by, |
|
|
|
|
|
a.important_flag |
|
|
|
|
|
FROM qc_ipqc_record as a |
|
|
|
|
|
left join WorkCenter as w on w.Site = a.Site AND w.WorkCenterNo = a.work_center_no |
|
|
|
|
|
left join part as p on a.site = p.site and a.part_no = p.partNo |
|
|
|
|
|
left join department as d on d.site = p.site and d.DepartmentID = p.DefaultDepartmentID |
|
|
<where> |
|
|
<where> |
|
|
site in (select site from eam_access_site where username = #{query.userName}) |
|
|
|
|
|
and (site + '-' + bu_no) in (select * from dbo.query_bu(#{query.userName})) |
|
|
|
|
|
|
|
|
a.site in (select site from eam_access_site where username = #{query.userName}) |
|
|
|
|
|
and (a.site + '-' + a.bu_no) in (select * from dbo.query_bu(#{query.userName})) |
|
|
<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 (a.site, a.bu_no) = #{query.buDesc} |
|
|
</if> |
|
|
</if> |
|
|
<if test = "query.inspectionNo != null and query.inspectionNo != ''"> |
|
|
<if test = "query.inspectionNo != null and query.inspectionNo != ''"> |
|
|
AND inspection_no LIKE #{query.inspectionNo} |
|
|
|
|
|
|
|
|
AND a.inspection_no LIKE #{query.inspectionNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test = "query.partNo != null and query.partNo != ''"> |
|
|
<if test = "query.partNo != null and query.partNo != ''"> |
|
|
AND part_no LIKE #{query.partNo} |
|
|
|
|
|
|
|
|
AND a.part_no LIKE #{query.partNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test = "query.partDesc != null and query.partDesc != ''"> |
|
|
<if test = "query.partDesc != null and query.partDesc != ''"> |
|
|
AND dbo.qc_get_part_desc(part_no) LIKE #{query.partDesc} |
|
|
|
|
|
|
|
|
AND dbo.qc_get_part_desc(a.part_no) LIKE #{query.partDesc} |
|
|
</if> |
|
|
</if> |
|
|
<if test = "query.states != null and query.states.size > 0"> |
|
|
<if test = "query.states != null and query.states.size > 0"> |
|
|
AND state in |
|
|
|
|
|
|
|
|
AND a.state in |
|
|
<foreach item="item" collection="query.states" open="(" separator="," close=")"> |
|
|
<foreach item="item" collection="query.states" open="(" separator="," close=")"> |
|
|
#{item} |
|
|
#{item} |
|
|
</foreach> |
|
|
</foreach> |
|
|
</if> |
|
|
</if> |
|
|
<if test = "query.inspectionTypeNo != null and query.inspectionTypeNo != ''"> |
|
|
<if test = "query.inspectionTypeNo != null and query.inspectionTypeNo != ''"> |
|
|
AND inspection_type_no = #{query.inspectionTypeNo} |
|
|
|
|
|
|
|
|
AND a.inspection_type_no = #{query.inspectionTypeNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test = "query.inspectionResult != null and query.inspectionResult != ''"> |
|
|
<if test = "query.inspectionResult != null and query.inspectionResult != ''"> |
|
|
AND inspection_result = #{query.inspectionResult} |
|
|
|
|
|
|
|
|
AND a.inspection_result = #{query.inspectionResult} |
|
|
</if> |
|
|
</if> |
|
|
<if test = "query.disposalMeasures != null and query.disposalMeasures != ''"> |
|
|
<if test = "query.disposalMeasures != null and query.disposalMeasures != ''"> |
|
|
AND disposal_measures = #{query.disposalMeasures} |
|
|
|
|
|
|
|
|
AND a.disposal_measures = #{query.disposalMeasures} |
|
|
</if> |
|
|
</if> |
|
|
<if test = "query.orderNo != null and query.orderNo != ''"> |
|
|
<if test = "query.orderNo != null and query.orderNo != ''"> |
|
|
AND order_no LIKE #{query.orderNo} |
|
|
|
|
|
|
|
|
AND a.order_no LIKE #{query.orderNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test = "query.seqNo != null and query.seqNo != ''"> |
|
|
<if test = "query.seqNo != null and query.seqNo != ''"> |
|
|
AND seq_no LIKE #{query.seqNo} |
|
|
|
|
|
|
|
|
AND a.seq_no LIKE #{query.seqNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test = "query.operationDesc != null and query.operationDesc != ''"> |
|
|
<if test = "query.operationDesc != null and query.operationDesc != ''"> |
|
|
AND operation_desc LIKE #{query.operationDesc} |
|
|
|
|
|
|
|
|
AND a.operation_desc LIKE #{query.operationDesc} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.startDate != null"> |
|
|
<if test="query.startDate != null"> |
|
|
AND inspector_date >= #{query.startDate} |
|
|
|
|
|
|
|
|
AND a.inspector_date >= #{query.startDate} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.endDate != null"> |
|
|
<if test="query.endDate != null"> |
|
|
AND #{query.endDate} >= inspector_date |
|
|
|
|
|
|
|
|
AND #{query.endDate} >= a.inspector_date |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test = "query.createBy != null and query.createBy != ''"> |
|
|
|
|
|
AND a.create_by LIKE #{query.createBy} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.startDate2 != null"> |
|
|
<if test="query.startDate2 != null"> |
|
|
AND task_date >= #{query.startDate2} |
|
|
|
|
|
|
|
|
AND a.task_date >= #{query.startDate2} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.endDate2 != null"> |
|
|
<if test="query.endDate2 != null"> |
|
|
AND #{query.endDate2} >= task_date |
|
|
|
|
|
|
|
|
AND #{query.endDate2} >= a.task_date |
|
|
</if> |
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
ORDER BY |
|
|
ORDER BY |
|
|
CASE WHEN state = '待检验' THEN 1 |
|
|
|
|
|
WHEN state = '待审核' THEN 2 |
|
|
|
|
|
WHEN state = '已完成' THEN 3 |
|
|
|
|
|
END, task_date desc |
|
|
|
|
|
|
|
|
CASE WHEN a.state = '待检验' THEN 1 |
|
|
|
|
|
WHEN a.state = '待审核' THEN 2 |
|
|
|
|
|
WHEN a.state = '已完成' THEN 3 |
|
|
|
|
|
END, a.task_date desc |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- IPQC明细记录查询 --> |
|
|
<!-- IPQC明细记录查询 --> |
|
|
@ -3342,33 +3353,53 @@ |
|
|
p.spec, |
|
|
p.spec, |
|
|
a.S_ResourceID as resourceId, |
|
|
a.S_ResourceID as resourceId, |
|
|
w.ResourceDesc as resourceDesc, |
|
|
w.ResourceDesc as resourceDesc, |
|
|
a.S_workCenterNo as workCenterNo |
|
|
|
|
|
|
|
|
a.S_workCenterNo as workCenterNo, |
|
|
|
|
|
w2.WorkCenterDesc, |
|
|
|
|
|
p.DefaultDepartmentID as departmentID, |
|
|
|
|
|
d.DepartmentName, |
|
|
|
|
|
a.ScheduledDate, |
|
|
|
|
|
a.OperatorName, |
|
|
|
|
|
isnull(a.roll_qty, 0) as rollQty |
|
|
FROM SOScheduledRouting AS a |
|
|
FROM SOScheduledRouting AS a |
|
|
inner join ShopOrder as t ON t.Site = a.Site AND t.OrderNo = a.SOOrderNo |
|
|
inner join ShopOrder as t ON t.Site = a.Site AND t.OrderNo = a.SOOrderNo |
|
|
inner join WorkCenterResource as w ON w.Site = a.Site AND w.WorkCenterNo = a.S_WorkCenterNo and w.ResourceID = a.S_ResourceID |
|
|
inner join WorkCenterResource as w ON w.Site = a.Site AND w.WorkCenterNo = a.S_WorkCenterNo and w.ResourceID = a.S_ResourceID |
|
|
left join part as p on a.site = p.site and a.partNo = p.partNo |
|
|
left join part as p on a.site = p.site and a.partNo = p.partNo |
|
|
|
|
|
left join department as d on d.site = p.site and d.DepartmentID = p.DefaultDepartmentID |
|
|
|
|
|
left join WorkCenter as w2 on w2.Site = a.Site AND w2.WorkCenterNo = a.S_WorkCenterNo |
|
|
WHERE |
|
|
WHERE |
|
|
a.site in (select site from eam_access_site where username = #{query.userName}) |
|
|
a.site in (select site from eam_access_site where username = #{query.userName}) |
|
|
<if test="query.status != null and query.status != ''"> |
|
|
|
|
|
AND t.status = #{query.status} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="(query.status == null or query.status == '') and (query.cancelFlag == null or query.cancelFlag == '')"> |
|
|
|
|
|
AND t.status <![CDATA[<>]]> '已取消' |
|
|
|
|
|
|
|
|
<if test="query.cancelFlag == null or query.cancelFlag == ''"> |
|
|
|
|
|
AND a.QtyRequired <![CDATA[>]]> isnull(a.roll_qty, 0) |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.orderNo != null and query.orderNo != ''"> |
|
|
<if test="query.orderNo != null and query.orderNo != ''"> |
|
|
AND a.SOOrderNo LIKE '%' + #{query.orderNo} + '%' |
|
|
|
|
|
|
|
|
AND a.SOOrderNo LIKE #{query.orderNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.seqNo != null and query.seqNo != ''"> |
|
|
<if test="query.seqNo != null and query.seqNo != ''"> |
|
|
AND a.BarcodeID LIKE '%' + #{query.seqNo} + '%' |
|
|
|
|
|
|
|
|
AND a.BarcodeID LIKE #{query.seqNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.partNo != null and query.partNo != ''"> |
|
|
<if test="query.partNo != null and query.partNo != ''"> |
|
|
AND a.partNo LIKE '%' + #{query.partNo} + '%' |
|
|
|
|
|
|
|
|
AND a.partNo LIKE #{query.partNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.partDesc != null and query.partDesc != ''"> |
|
|
<if test="query.partDesc != null and query.partDesc != ''"> |
|
|
AND (p.PartDescription + Isnull(p.Spec,'')) LIKE '%' + #{query.partDesc} + '%' |
|
|
|
|
|
|
|
|
AND (p.PartDescription + Isnull(p.Spec,'')) LIKE #{query.partDesc} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="query.departmentID != null and query.departmentID != ''"> |
|
|
|
|
|
AND p.DefaultDepartmentID LIKE #{query.departmentID} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="query.workCenterNo != null and query.workCenterNo != ''"> |
|
|
|
|
|
AND a.S_workCenterNo LIKE #{query.workCenterNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.operationDesc != null and query.operationDesc != ''"> |
|
|
<if test="query.operationDesc != null and query.operationDesc != ''"> |
|
|
AND a.operationDesc LIKE '%' + #{query.operationDesc} + '%' |
|
|
|
|
|
|
|
|
AND a.operationDesc LIKE #{query.operationDesc} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="query.operatorName != null and query.operatorName != ''"> |
|
|
|
|
|
AND a.OperatorName LIKE #{query.operatorName} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="query.startDate != null"> |
|
|
|
|
|
AND a.ScheduledDate >= #{query.startDate} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="query.endDate != null"> |
|
|
|
|
|
AND #{query.endDate} >= a.ScheduledDate |
|
|
</if> |
|
|
</if> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
@ -4341,6 +4372,13 @@ |
|
|
delete sys_oss |
|
|
delete sys_oss |
|
|
where order_ref1 = #{site} and order_ref2 = #{inspectionNo} and order_ref4 = #{buNo} |
|
|
where order_ref1 = #{site} and order_ref2 = #{inspectionNo} and order_ref4 = #{buNo} |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 修改IQC明细记录信息 --> |
|
|
|
|
|
<update id="updateSOScheduledRoutingRollQty"> |
|
|
|
|
|
UPDATE SOScheduledRouting |
|
|
|
|
|
SET roll_qty = isnull(roll_qty, 0) + #{rollQty} |
|
|
|
|
|
WHERE site = #{site} and BarcodeID = #{seqNo} |
|
|
|
|
|
</update> |
|
|
</mapper> |
|
|
</mapper> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|