机具费用推送修改

This commit is contained in:
hongchao 2025-10-20 15:29:51 +08:00
parent 0864b70fb1
commit 3eefc8bbc5
3 changed files with 62 additions and 26 deletions

View File

@ -727,7 +727,7 @@ public class IwsCostPushServiceImpl implements IwsCostPushService {
List<IwsCostPushBean> list = getMonthCosts(proIdsBean); List<IwsCostPushBean> list = getMonthCosts(proIdsBean);
if(CollectionUtils.isNotEmpty(list)){ if(CollectionUtils.isNotEmpty(list)){
//分段推送 //分段推送
forHttpYouer(list,proIdsBean); // forHttpYouer(list,proIdsBean);
} }
} }
} }

View File

@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
slt_agreement_details sad slt_agreement_details sad
left join slt_agreement_apply saa on sad.apply_id = saa.id left join slt_agreement_apply saa on sad.apply_id = saa.id
LEFT JOIN bm_agreement_info bma ON bma.agreement_id = saa.agreement_id LEFT JOIN bm_agreement_info bma ON bma.agreement_id = saa.agreement_id
WHERE LEFT(saa.create_time,7) = #{month} AND sad.slt_type = 2 WHERE LEFT(saa.audit_time,7) = #{month} AND sad.slt_type = 2
GROUP BY bma.agreement_id GROUP BY bma.agreement_id
UNION UNION
@ -88,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
slt_agreement_details sad slt_agreement_details sad
left join slt_agreement_apply saa on sad.apply_id = saa.id left join slt_agreement_apply saa on sad.apply_id = saa.id
LEFT JOIN bm_agreement_info bma ON bma.agreement_id = saa.agreement_id LEFT JOIN bm_agreement_info bma ON bma.agreement_id = saa.agreement_id
WHERE LEFT(saa.create_time,7) = #{month} AND sad.slt_type = 3 and sad.is_charge = 1 WHERE LEFT(saa.audit_time,7) = #{month} AND sad.slt_type = 3 and sad.is_charge = 1
GROUP BY bma.agreement_id GROUP BY bma.agreement_id
UNION UNION
@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
slt_agreement_details sad slt_agreement_details sad
left join slt_agreement_apply saa on sad.apply_id = saa.id left join slt_agreement_apply saa on sad.apply_id = saa.id
LEFT JOIN bm_agreement_info bma ON bma.agreement_id = saa.agreement_id LEFT JOIN bm_agreement_info bma ON bma.agreement_id = saa.agreement_id
WHERE LEFT(saa.create_time,7) = #{month} AND sad.slt_type = 4 and sad.is_charge = 1 WHERE LEFT(saa.audit_time,7) = #{month} AND sad.slt_type = 4 and sad.is_charge = 1
GROUP BY bma.agreement_id GROUP BY bma.agreement_id
) a ON ) a ON
pmc.AGREEMENT_ID = a.agreementId pmc.AGREEMENT_ID = a.agreementId
@ -558,7 +558,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sad.num as num, sad.num as num,
sad.price as leasePrice, sad.price as leasePrice,
sad.money as money, sad.money as money,
#{type} as type, case when sad.slt_type = 1 then 1
when sad.slt_type = 2 then 2
when sad.slt_type = 3 then 4
when sad.slt_type = 4 then 5
else null
end as type,
1 as category, 1 as category,
#{submitUser} as submitUser, #{submitUser} as submitUser,
#{month} as month #{month} as month
@ -582,6 +587,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type != null and (type == 1 or type ==2)"> <if test="type != null and (type == 1 or type ==2)">
and sad.slt_type = #{type} and sad.slt_type = #{type}
</if> </if>
<if test="month != null and month != ''">
and LEFT(saa.audit_time,7) = #{month}
</if>
<if test="settlementType != null"> <if test="settlementType != null">
and saa.settlement_type = #{settlementType} and saa.settlement_type = #{settlementType}
</if> </if>
@ -681,7 +689,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sad.num as num, sad.num as num,
sad.price as leasePrice, sad.price as leasePrice,
sad.money as money, sad.money as money,
#{type} as type, case when sad.slt_type = 1 then 1
when sad.slt_type = 2 then 2
when sad.slt_type = 3 then 4
when sad.slt_type = 4 then 5
else null
end as type,
2 as category, 2 as category,
#{submitUser} as submitUser, #{submitUser} as submitUser,
#{month} as month #{month} as month
@ -699,9 +712,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<foreach collection="agreementIds" item="item" open="(" close=")" separator=","> <foreach collection="agreementIds" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
<if test="type != null"> <if test="type != null and type !=4">
and sad.slt_type = #{type} and sad.slt_type = #{type}
</if> </if>
<if test="type != null and type ==4">
and sad.slt_type = #{type} and saa.is_charge = 1
</if>
<if test="month != null and month != ''">
and LEFT(saa.audit_time,7) = #{month}
</if>
<if test="settlementType != null"> <if test="settlementType != null">
and saa.settlement_type = #{settlementType} and saa.settlement_type = #{settlementType}
</if> </if>

View File

@ -20,8 +20,8 @@
pmc.LOST_MONEY as lostMoney, pmc.LOST_MONEY as lostMoney,
pmc.SCRAP_MONEY as scrapMoney, pmc.SCRAP_MONEY as scrapMoney,
pmc.REPAIR_MONEY as repairMoney, pmc.REPAIR_MONEY as repairMoney,
pmia.push_status as pushStatus, a.pushStatus as pushStatus,
pmia.push_remark as pushRemark, a.pushRemark as pushRemark,
ROUND(ifnull(pmc.LEASE_MONEY,0)+ifnull(pmc.LOST_MONEY,0)+ifnull(pmc.SCRAP_MONEY,0),2) as money, ROUND(ifnull(pmc.LEASE_MONEY,0)+ifnull(pmc.LOST_MONEY,0)+ifnull(pmc.SCRAP_MONEY,0),2) as money,
pmc.CHECK_STATUS as checkStatus pmc.CHECK_STATUS as checkStatus
from from
@ -32,28 +32,45 @@
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
pmi.agreementId, pmi.agreementId,pmi.id,pmi.push_status as pushStatus,
pmi.taskId, pmi.push_remark as pushRemark
pmi.push_status, FROM calc_project_month cpm
pmi.push_remark, LEFT JOIN project_month_info pmi ON pmi.taskId = cpm.id
bai.unit_id, WHERE cpm.`MONTH` = #{month} and pmi.jiju_type = 2 GROUP BY pmi.agreementId
bai.project_id
UNION
SELECT
bma.agreement_id AS agreementId,
sad.id,sad.push_status as pushStatus,
sad.push_remark as pushRemark
FROM FROM
project_month_info pmi slt_agreement_details sad
LEFT JOIN bm_agreement_info bai ON pmi.agreementId = bai.agreement_id left join slt_agreement_apply saa on sad.apply_id = saa.id
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id LEFT JOIN bm_agreement_info bma ON bma.agreement_id = saa.agreement_id
LEFT JOIN calc_project_month cpm ON pmi.taskId = cpm.ID WHERE LEFT(saa.audit_time,7) = #{month} AND sad.slt_type = 2
where pmi.jiju_type = 2 GROUP BY bma.agreement_id
GROUP BY
pmi.agreementId UNION
) pmia on bai.project_id = pmia.project_id and pmc.task_id=pmia.taskId and pmia.agreementId=pmc.AGREEMENT_ID SELECT
bma.agreement_id AS agreementId,
sad.id,sad.push_status as pushStatus,
sad.push_remark as pushRemark
FROM
slt_agreement_details sad
left join slt_agreement_apply saa on sad.apply_id = saa.id
LEFT JOIN bm_agreement_info bma ON bma.agreement_id = saa.agreement_id
WHERE LEFT(saa.audit_time,7) = #{month} AND sad.slt_type = 4 and sad.is_charge = 1
GROUP BY bma.agreement_id
) a ON
pmc.AGREEMENT_ID = a.agreementId
where where
bp.pro_id is not null and pmc.type = 2 bp.pro_id is not null and pmc.type = 2
and and
(pmc.LEASE_MONEY > 0 or pmc.LOST_MONEY > 0 or pmc.REPAIR_MONEY > 0 or pmc.SCRAP_MONEY > 0) (pmc.LEASE_MONEY > 0 or pmc.LOST_MONEY > 0 or pmc.REPAIR_MONEY > 0 or pmc.SCRAP_MONEY > 0)
and (pmc.CONSUME_MONEY = 0 or pmc.CONSUME_MONEY is null) and (pmc.CONSUME_MONEY = 0 or pmc.CONSUME_MONEY is null)
<if test="status != null"> <if test="status != null">
AND pmia.push_status = #{status} AND a.pushStatus = #{status}
</if> </if>
<if test="month != null"> <if test="month != null">
AND cpm.month = #{month} AND cpm.month = #{month}
@ -64,8 +81,8 @@
<if test="unitId != null and unitId != ''"> <if test="unitId != null and unitId != ''">
AND bai.unit_id = #{unitId} AND bai.unit_id = #{unitId}
</if> </if>
GROUP BY bai.project_id,bai.unit_id GROUP BY bai.agreement_id
order by pmia.push_status order by a.pushStatus
</select> </select>
<!-- 获取消耗费用推送审核数据 --> <!-- 获取消耗费用推送审核数据 -->