wangli hace 4 años
padre
commit
b09daf66a4

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/dao/pay/PayInvoiceMapper.java

@@ -2,7 +2,6 @@ package com.bz.smart_city.dao.pay;
 
 import com.bz.smart_city.dto.pay.PayInvoiceDto;
 import com.bz.smart_city.dto.pay.PayTransactiondetails;
-import com.bz.smart_city.dto.pay.PayTransactiondetailsDto;
 import com.bz.smart_city.dto.pay.payfee.PrintInvoiceData;
 import com.bz.smart_city.dto.pay.payfee.PrintReceivedInfo;
 import com.bz.smart_city.entity.pay.PayInvoice;
@@ -31,6 +30,7 @@ public interface PayInvoiceMapper {
     PrintInvoiceData getPrintDataOfTran(@Param("payseriesno")String payseriesno,@Param("siteId")Integer siteId,@Param("customerId")Integer customerId);
     PrintInvoiceData getLastWaterUsedRecord(@Param("accountId")BigInteger accountId,@Param("date") LocalDateTime date, @Param("siteId")Integer siteId, @Param("customerId")Integer customerId);
 
+    PrintInvoiceData getPrintDataKailu(@Param("accountId")BigInteger accountId);
 
     PrintInvoiceData getDateRangeInfoPrint(@Param("payseriesno")String payseriesno,@Param("siteId")Integer siteId,@Param("customerId")Integer customerId);
     PrintInvoiceData getAccountInfoPrint(@Param("accountId") BigInteger accountId);

+ 14 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/payfee/PrintInvoiceData.java

@@ -70,4 +70,18 @@ public class PrintInvoiceData {
     private Integer maxPeriod;
     @ApiModelProperty(value = "最小账期(year*12+month)" ,hidden = true)
     private Integer minPeriod;
+
+    @ApiModelProperty("水表表号")
+    private String eleno;
+    @ApiModelProperty("水表档案号")
+    private String metercode;
+    @ApiModelProperty("基础水价")
+    private String price1;
+    @ApiModelProperty("排污费单价")
+    private String price4;
+    @ApiModelProperty("水资源费单价")
+    private String price3;
+    @ApiModelProperty(value = "用水性质名称" )
+    private String waterPropertyName;
+
 }

+ 30 - 3
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/PayInvoiceServiceImpl.java

@@ -7,9 +7,7 @@ import com.bz.smart_city.commom.util.UserUtil;
 import com.bz.smart_city.dao.pay.PayInvoiceMapper;
 import com.bz.smart_city.dto.LoginUser;
 import com.bz.smart_city.dto.pay.PayInvoiceDto;
-import com.bz.smart_city.dto.pay.PayMessagesendrecordDto;
 import com.bz.smart_city.dto.pay.PayTransactiondetails;
-import com.bz.smart_city.dto.pay.PayTransactiondetailsDto;
 import com.bz.smart_city.dto.pay.payfee.PrintInvoiceData;
 import com.bz.smart_city.dto.pay.payfee.PrintReceivedInfo;
 import com.bz.smart_city.entity.pay.PayInvoice;
@@ -169,7 +167,7 @@ public class PayInvoiceServiceImpl implements PayinvoiceService {
      * @param payseriesno
      * @return
      */
-    public PrintInvoiceData getPrintDataOfTrans(String payseriesno){
+    public PrintInvoiceData getPrintDataOfTrans2(String payseriesno){
         LoginUser loginUser=UserUtil.getCurrentUser();
         PrintInvoiceData printInvoiceData=payInvoiceMapper.getPrintDataOfTran(payseriesno,loginUser.getSiteId(),loginUser.getCustomerId());
         if(printInvoiceData!=null){
@@ -193,11 +191,40 @@ public class PayInvoiceServiceImpl implements PayinvoiceService {
                 DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS").format(LocalDateTime.now())+""+(int)(Math.random()*1000));
         return printInvoiceData;
     }
+
+    public PrintInvoiceData getPrintDataOfTrans(String payseriesno){
+        LoginUser loginUser=UserUtil.getCurrentUser();
+        PrintInvoiceData printInvoiceData=payInvoiceMapper.getPrintDataOfTran(payseriesno,loginUser.getSiteId(),loginUser.getCustomerId());
+        if(printInvoiceData!=null){
+            PrintInvoiceData printDataKailu = payInvoiceMapper.getPrintDataKailu(printInvoiceData.getAccountId());
+
+            printInvoiceData.setWaterPropertyName(printDataKailu.getWaterPropertyName());
+            printInvoiceData.setMetercode(printDataKailu.getMetercode());
+            printInvoiceData.setEleno(printDataKailu.getEleno());
+            printInvoiceData.setPrice1(printDataKailu.getPrice1());
+            printInvoiceData.setPrice4(printDataKailu.getPrice4());
+
+            DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            if(printInvoiceData.getCreateDate()!=null){
+                printInvoiceData.setPaydate(df.format(printInvoiceData.getCreateDate()));
+            }else{
+                printInvoiceData.setPaydate(df.format(LocalDateTime.now()));
+            }
+        }else{
+            throw new ServiceException(ResultStatus.OPERATE_RECORD_NOT_EXIT);
+        }
+        printInvoiceData.setPrintType(1);
+        printInvoiceData.setPayseriesno(payseriesno);
+        printInvoiceData.setInvoiceNo(
+                DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS").format(LocalDateTime.now())+""+(int)(Math.random()*1000));
+        return printInvoiceData;
+    }
     /**
      * 打印收据——缴纳欠费(transtype == null || (transtype ==2 ||transtype ==4))
      * @param payseriesno
      * @return
      */
+
     public PrintInvoiceData getPrintDataOfReceived(String payseriesno){
         LoginUser loginUser=UserUtil.getCurrentUser();
         //收费区间信息和抄表信息

+ 1 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/pay/PayinvoiceService.java

@@ -56,6 +56,7 @@ public interface PayinvoiceService {
      * @param payseriesno
      * @return
      */
+    PrintInvoiceData getPrintDataOfTrans2(String payseriesno);
     PrintInvoiceData getPrintDataOfTrans(String payseriesno);
 
     /**

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

@@ -186,6 +186,30 @@
             and a.canceledrecord_id is null and a.iscanceled=0
     </select>
 
+    <select id="getPrintDataKailu" resultType="com.bz.smart_city.dto.pay.payfee.PrintInvoiceData">
+     select
+            d.water_meter_no as eleno
+            ,c.metercode
+            ,p.name as waterPropertyName
+            ,p.price1 as price1
+            ,p.price4 as price4
+        from pay_base_customerandmeterrela c
+        left join sc_device d on c.watermeter_id=d.id
+        left join (
+                select
+                pro.id as waterproperty_id
+								,pro.name
+                ,ifnull(max(price1.price),0) as price1
+                ,ifnull(max(price4.price),0) as price4
+                from pay_base_waterproperty pro
+								left join pay_base_priceofwaterproperty pp on pro.id=pp.waterproperty_id
+                left join pay_base_waterprice price1 on price1.id=pp.waterprice_id and price1.feetype=1 and price1.ladderlevel =1
+                left join pay_base_waterprice price4 on price4.id=pp.waterprice_id and price4.feetype=4 and price4.ladderlevel =1
+                group by pro.id,pro.name
+            ) p on c.waterproperty_id =p.waterproperty_id
+        where c.account_id=#{accountId}
+  </select>
+
     <select id="getLastWaterUsedRecord"  resultType="com.bz.smart_city.dto.pay.payfee.PrintInvoiceData">
 		select  reading ,recorddate
 	 from pay_amount_waterusedamount
@@ -198,8 +222,8 @@
     <select id="getDateRangeInfoPrint" resultType="com.bz.smart_city.dto.pay.payfee.PrintInvoiceData">
         select
             amount.account_id as "accountId",
-            max(amount.year*12+amount.`month`) as  "maxPeriod",
-            min(amount.year*12+amount.`month`) as  "minPeriod",
+            ifnull(max(amount.year*12+amount.`month`),0) as  "maxPeriod",
+            ifnull(min(amount.year*12+amount.`month`),0) as  "minPeriod",
             max(amount.recorddate) as "recorddate",
             min(amount.lastrecorddate) as "lastrecorddate",
             max(amount.reading) as "reading",