Prechádzať zdrojové kódy

水量同步定时任务修改

wangli 4 rokov pred
rodič
commit
4d04d1812e

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/quartz/service/impl/AmountSynDayServiceImpl.java

@@ -120,7 +120,7 @@ public class AmountSynDayServiceImpl implements AmountSynByDayService, Initializ
         Integer year=baseClosingAccountInfoDto.getYear();
         Integer month=baseClosingAccountInfoDto.getMonth();
         //插入水量基础信息(同步计划)
-        Integer amountNumber = amountWaterUsedAmountMapper.getAllAmountCountByDay(siteId,customerId);
+        Integer amountNumber = amountWaterUsedAmountMapper.createdAmountByDay(siteId,customerId);
         if(amountNumber == 0){
             log.info("每天同步水量失败:生成同步计划失败");
             return;

+ 4 - 1
smart-city-platform/src/main/resources/mapper/pay/AmountWaterUsedAmountMapper.xml

@@ -590,6 +590,9 @@
 		,#{customerId}
 		from pay_base_customerandmeterrela c
 		left join pay_base_waterproperty p on c.waterproperty_id=p.id
+		LEFT JOIN pay_amount_waterusedamount amount ON amount.watermeter_id = c.watermeter_id
+		AND amount.YEAR = #{year}
+		AND amount.MONTH = #{month}
 		left join sc_device d on c.watermeter_id=d.id
 		left join (
 			select
@@ -606,7 +609,7 @@
 			)	aLast
 			left join pay_amount_waterusedamount a on a.ele_no=aLast.ele_no and a.create_date=aLast.create_date
 		) amount on amount.watermeter_id=c.watermeter_id
-		where c.businessstate= 1 and c.site_id=#{siteId} and c.customer_id=#{customerId}
+		where c.businessstate= 1 and amount.id is null and c.site_id=#{siteId} and c.customer_id=#{customerId}
 	</insert>
 
 	<select id="getSynAmountMetercode" resultType="java.lang.String">