退料接收时,检查结算表拿到待退料数量,防止多退
This commit is contained in:
parent
29523f27fd
commit
3aaa1188b0
|
|
@ -731,8 +731,6 @@
|
|||
bad.audit_num as auditNum,
|
||||
bad.status as status,
|
||||
IFNULL(sai.num, 0) as max_back_num,
|
||||
IFNULL(aa.back_num,0) as in_completed_back_num,
|
||||
IFNULL(bb.finished_back_num, 0) as finished_back_num,
|
||||
mt.manage_type as manageType,
|
||||
mtk.user_id,
|
||||
CONCAT('NSJJ',mt.`code`,mt.model_code) as `code`
|
||||
|
|
@ -745,26 +743,6 @@
|
|||
LEFT JOIN ma_type mt on mt.type_id=bad.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id=mt.parent_id
|
||||
LEFT JOIN ma_type_keeper mtk on mt.type_id=mtk.type_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
type_id as typeId,
|
||||
SUM(IFNULL(back_num,0)) as back_num
|
||||
FROM
|
||||
back_check_details
|
||||
WHERE
|
||||
parent_id=#{parentId} and is_finished is null
|
||||
GROUP BY type_id
|
||||
) aa on aa.typeId=bad.type_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
type_id as typeId,
|
||||
SUM(IFNULL(back_num,0)) as finished_back_num
|
||||
FROM
|
||||
back_check_details
|
||||
WHERE
|
||||
parent_id=#{parentId} and is_finished = 1
|
||||
GROUP BY type_id
|
||||
) bb on bb.typeId=bad.type_id
|
||||
WHERE
|
||||
bai.id=#{parentId}
|
||||
<if test="typeId != null and typeId != ''">
|
||||
|
|
|
|||
Loading…
Reference in New Issue