退料接收bug修改

This commit is contained in:
bonus 2025-07-22 16:09:58 +08:00
parent 44ad0681c3
commit 8a49ecee7c
2 changed files with 40 additions and 43 deletions

View File

@ -118,16 +118,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.type_name AS materialName,
mt2.type_name AS materialType
FROM
lease_out_details lod
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
slt_agreement_info sai
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN slt_agreement_info sai on lod.type_id = sai.type_id
and sai.ma_id = lod.ma_id
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
WHERE
mm.ma_status = '2'
@ -330,22 +328,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ba.project_id AS proId,
bp.pro_name AS proName,
ba.agreement_id AS agreementId
FROM lease_out_details lod
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
FROM slt_agreement_info sai
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN slt_agreement_info sai on lod.type_id = sai.type_id
and sai.ma_id = lod.ma_id
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
AND bu.del_flag = '0'
WHERE mm.ma_status = '2'
WHERE sai.`status`=0 and mm.ma_status = '2'
and mm.ma_code = #{maCode}
AND ba.unit_id = #{unitId}
AND ba.project_id = #{proId}
@ -409,36 +406,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getMachineByQrCode" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
SELECT
mm.ma_id AS maId,
mm.ma_code AS maCode,
mm.ma_status AS maStatus,
mt1.type_name AS typeName,
mm.type_id AS typeId,
mt.type_name AS typeModelName,
mt2.type_name AS materialType,
ba.unit_id AS unitId,
bu.unit_name AS unitName,
ba.project_id AS proId,
bp.pro_name AS proName,
ba.agreement_id AS agreementId
mm.ma_id AS maId,
mm.ma_code AS maCode,
mm.ma_status AS maStatus,
mt1.type_name AS typeName,
mm.type_id AS typeId,
mt.type_name AS typeModelName,
mt2.type_name AS materialType,
ba.unit_id AS unitId,
bu.unit_name AS unitName,
ba.project_id AS proId,
bp.pro_name AS proName,
ba.agreement_id AS agreementId
FROM
lease_out_details lod
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN lease_apply_info lai ON lod.parent_id = lai.id
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info ba ON tta.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
AND bu.del_flag = '0'
slt_agreement_info sai
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
AND bu.del_flag = '0'
WHERE
mm.ma_status = '2' and mm.qr_code = #{qrCode}
sai.`status`=0 and mm.qr_code = #{qrCode}
<if test="agreementId != null">
AND ba.unit_id = #{unitId}
</if>

View File

@ -383,6 +383,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.type_name as typeName,
mt.parent_id as parentId,
mt.unit_name as unitName,
mt.unit_value as unitValue,
mt.manage_type as manageType,
SUM( CASE WHEN sai.agreement_id = #{agreementId} AND sai.STATUS = '0' THEN sai.num ELSE 0 END ) AS num,
mt.LEVEL as level