소스 검색

水表信息当前读数查询调整

oppadmin 4 년 전
부모
커밋
a467d58b76

+ 2 - 2
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/AmountSynByDayServiceImpl.java

@@ -276,6 +276,7 @@ public class AmountSynByDayServiceImpl implements AmountSynByDayService, Initial
 
     //未开户用户抄表数据
     public void noOpenUpdateByDay(Integer siteId, Integer customerId){
+        log.info(String.format("未开户用户数据同步开始:siteId=%s,customerId=%s"));
         //产生未开户的day基础计划
         Integer totalNum = amountWaterUsedAmountMapper.getNoOpenAmountCountByDay(siteId, customerId);
 
@@ -316,9 +317,8 @@ public class AmountSynByDayServiceImpl implements AmountSynByDayService, Initial
                     amountWaterUsedAmountMapper.updateByDate(amountWaterUsedAmountDto);
                 }
             }
-
         }
-
+        log.info(String.format("未开户用户数据同步结束:siteId=%s,customerId=%s"));
     }
 
 

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

@@ -444,7 +444,7 @@
 		now(),
 		'每天抄表计划',
 		0,
-		c.site_id,
+		NULL,
 		c.customer_id,
 		DATE_FORMAT( DATE_SUB( now(), INTERVAL 1 DAY ), '%Y%m%d' ),
 		NULL
@@ -570,7 +570,7 @@
 		left join pay_amount_waterusedamount_day amount on amount.watermeter_id = scd.id
 		and amount.read_date =DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 day) ,'%Y%m%d')
 		left join pay_base_customerandmeterrela pba on pba.watermeter_id = scd.id
-		where scd.status =1 and amount.reading is null and pba.id  is null
+		where scd.status =1 and amount.reading is null and (pba.id  is null or pba.businessstate=2)
 		<if test="customerId!= null" >and scd.customer_id = #{customerId} </if>
 		<if test="siteId!= null" > and scd.site_id = #{siteId} </if>
 	</select>

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

@@ -566,7 +566,7 @@
         left join
         (SELECT a.watermeter_id,a.reading FROM pay_amount_waterusedamount_day AS a,
         (SELECT b.watermeter_id, MAX(b.read_date) AS read_date FROM pay_amount_waterusedamount_day AS b
-        where b.reading is not null and b.customer_id=#{customerId} and b.site_id=#{siteId}
+        where b.reading is not null and b.customer_id=#{customerId}
         GROUP BY b.watermeter_id)
         AS c WHERE a.watermeter_id=c.watermeter_id AND a.read_date = c.read_date)  rd on rd.watermeter_id = scd.id
         where  scd.customer_id = #{customerId} and scd.account_id is not null