瀏覽代碼

龙泉收据

wangli 4 年之前
父節點
當前提交
0271e31efa

+ 4 - 0
smart-city-platform/src/main/java/com/bz/smart_city/controller/pay/PayInvoiceController.java

@@ -66,6 +66,7 @@ public class PayInvoiceController {
             @ApiParam(value = "缴费批次号", required = true) @RequestParam(required = true) String payseriesno) {
 
         PrintInvoiceData printInvoiceData = null ;
+
         PrintInvoiceData type = payinvoiceService.getPayInvoiceType(payseriesno);
         if(type != null && type.getPayInvoiceType() == 0){  //默认
             if(type.getPrintType() != null && type.getPrintType() == 1){	//单纯充值
@@ -79,6 +80,9 @@ public class PayInvoiceController {
         }else if(type != null && type.getPayInvoiceType() == 2){  //盖州
             printInvoiceData = payinvoiceService.getPrintDataOfTransGaizhou(payseriesno);
 
+        }else if(type != null && type.getPayInvoiceType() == 3){  //突泉县龙泉水司
+            printInvoiceData = payinvoiceService.getPrintDataOfTransLongquan(payseriesno);
+
         }
         if(printInvoiceData != null){
             printInvoiceData.setPayInvoiceType(type.getPayInvoiceType());

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

@@ -58,5 +58,7 @@ public interface PayInvoiceMapper {
 
     PrintInvoiceData getPayInvoiceType(@Param("payseriesno")String payseriesno );
 
+    PrintInvoiceData getPayInvoiceReceivable(@Param("payseriesno")String payseriesno );
+
 
 }

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

@@ -20,7 +20,7 @@ import java.util.List;
 @ApiModel("打印信息")
 public class PrintInvoiceData {
 
-    @ApiModelProperty(value="收据模板类型:0:默认 1:开鲁 2:盖州")
+    @ApiModelProperty(value="收据模板类型:0:默认 1:开鲁 2:盖州 3:龙泉")
     private Integer payInvoiceType;
 
     @ApiModelProperty(value = "收据类型:1充值 2缴费")
@@ -95,10 +95,22 @@ public class PrintInvoiceData {
 
     @ApiModelProperty("一阶水价")
     private String totalPrice;
-    @ApiModelProperty("一阶水价")
+    @ApiModelProperty("所属小区")
     private String livingareaName;
 
     @ApiModelProperty("结算水量")
     private BigDecimal payamount;
 
+    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
+    @ApiModelProperty("审核时间")
+    private LocalDateTime approvetime;
+    @ApiModelProperty("审核日期")
+    private String approveDate;
+    @ApiModelProperty("基础水费")
+    private String receivablefee1;
+    @ApiModelProperty("排污费")
+    private String receivablefee4;
+    @ApiModelProperty("水资源费")
+    private String receivablefee3;
+
 }

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

@@ -282,6 +282,64 @@ public class PayInvoiceServiceImpl implements PayinvoiceService {
         return printInvoiceDataAccountBaseInfo;
     }
 
+    public PrintInvoiceData getPrintDataOfTransLongquan(String payseriesno){
+        //获取缴费信息
+        PrintInvoiceData printInvoiceData=payInvoiceMapper.countTransactiondetails(payseriesno);
+        PrintInvoiceData printDataLongquan;
+        if(printInvoiceData != null && printInvoiceData.getAccountId() != null){
+            //获取用户信息
+            printDataLongquan = payInvoiceMapper.getAccountInfoPrint(printInvoiceData.getAccountId());
+
+            //获取应收/水量信息
+            PrintInvoiceData payInvoiceReceivable = payInvoiceMapper.getPayInvoiceReceivable(payseriesno);
+            //拼装数据
+            DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            if(payInvoiceReceivable != null){
+                printDataLongquan.setLastreading(payInvoiceReceivable.getLastreading());
+                printDataLongquan.setReading(payInvoiceReceivable.getReading());
+                printDataLongquan.setPayamount(payInvoiceReceivable.getPayamount());
+                printDataLongquan.setPrice1(payInvoiceReceivable.getPrice1());
+                printDataLongquan.setReceivablefee1(payInvoiceReceivable.getReceivablefee1());
+                printDataLongquan.setPrice3(payInvoiceReceivable.getPrice3());
+                printDataLongquan.setReceivablefee3(payInvoiceReceivable.getReceivablefee3());
+                printDataLongquan.setPrice4(payInvoiceReceivable.getPrice4());
+                printDataLongquan.setReceivablefee4(payInvoiceReceivable.getReceivablefee4());
+                printDataLongquan.setReceivablefee(payInvoiceReceivable.getReceivablefee());
+                if(printInvoiceData.getApprovetime()!=null){
+                    printDataLongquan.setApproveDate(df.format(printInvoiceData.getApprovetime()));
+                }else{
+                    printDataLongquan.setApproveDate(df.format(LocalDateTime.now()));
+                }
+            }
+
+            printDataLongquan.setTransamount(printInvoiceData.getTransamount());
+            printDataLongquan.setLastRemaining(printInvoiceData.getLastRemaining());
+            printDataLongquan.setRemaining(printInvoiceData.getRemaining());
+            printDataLongquan.setCreateBy(printInvoiceData.getCreateBy());
+
+            if(printInvoiceData.getCreateDate()!=null){
+                printDataLongquan.setCreateDate(printInvoiceData.getCreateDate());
+                printDataLongquan.setPaydate(df.format(printInvoiceData.getCreateDate()));
+            }else{
+                printDataLongquan.setCreateDate(LocalDateTime.now());
+                printDataLongquan.setPaydate(df.format(LocalDateTime.now()));
+            }
+            if(payInvoiceReceivable != null && payInvoiceReceivable.getApprovetime() != null){
+                printDataLongquan.setApprovetime(payInvoiceReceivable.getApprovetime());
+                printDataLongquan.setApproveDate(df.format(payInvoiceReceivable.getApprovetime()));
+            }else{
+                printDataLongquan.setApprovetime(LocalDateTime.now());
+                printDataLongquan.setApproveDate(df.format(LocalDateTime.now()));
+            }
+        }else{
+            throw new ServiceException(ResultStatus.OPERATE_RECORD_NOT_EXIT);
+        }
+        printDataLongquan.setPrintType(1);
+        printDataLongquan.setPayseriesno(payseriesno);
+        printDataLongquan.setInvoiceNo(
+                DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS").format(LocalDateTime.now())+""+(int)(Math.random()*1000));
+        return printDataLongquan;
+    }
     /**
      * 打印收据——缴纳欠费(transtype == null || (transtype ==2 ||transtype ==4))
      * @param payseriesno

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

@@ -61,6 +61,8 @@ public interface PayinvoiceService {
     PrintInvoiceData getPrintDataOfTransKailu(String payseriesno);
 
     PrintInvoiceData getPrintDataOfTransGaizhou(String payseriesno);
+
+    PrintInvoiceData getPrintDataOfTransLongquan(String payseriesno);
     /**
      * 打印收据——缴纳欠费(transtype == null || (transtype ==2 ||transtype ==4))
      * @param payseriesno

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

@@ -255,8 +255,11 @@
             a.accountnumber,
             a.name as "accountname",
             a.address,
-            r.remaining
+            r.remaining,
+            p.`name`as "waterPropertyName"
         from pay_base_account a
+        left join pay_base_customerandmeterrela c on c.account_id = a.id
+        left join pay_base_waterproperty p on c.waterproperty_id =p.id
         left join pay_pay_rechargeaccount r on a.id=r.account_id
         where a.id=#{accountId}
     </select>
@@ -451,4 +454,27 @@
         left join sc_customer c on c.id =t.customer_id
 
     </select>
+
+    <select id="getPayInvoiceReceivable" resultType="com.bz.smart_city.dto.pay.payfee.PrintInvoiceData">
+        select
+            rec.account_id
+            ,sum(case when rec.feetype = 1 then rec.receivablefee else 0 end ) payamount
+            ,max(case when rec.feetype = 1 and rec.ladderlevel =1 then rec.waterbasicprice else 0 end ) price1
+            ,sum(case when rec.feetype = 1 then rec.receivablefee else 0 end ) receivablefee1
+            ,max(case when rec.feetype = 3 and rec.ladderlevel =1 then rec.waterbasicprice else 0 end ) price3
+            ,sum(case when rec.feetype = 3 then rec.receivablefee else 0 end ) receivablefee3
+            ,max(case when rec.feetype = 4 and rec.ladderlevel =1 then rec.waterbasicprice else 0 end ) price4
+            ,sum(case when rec.feetype = 4 then rec.receivablefee else 0 end ) receivablefee4
+            ,sum(rec.receivablefee ) receivablefee
+            ,max(amount.`year` *12 +amount.`month`)  maxPeriod
+            ,min(amount.`year` *12 +amount.`month`) minPeriod
+            ,max(amount.approvetime) approvetime
+            ,max(amount.reading) reading
+            ,min(amount.lastreading) lastreading
+        from
+         pay_pay_receivable rec
+        left join pay_amount_waterusedamount amount on amount.id=rec.usedamount_id
+        where rec.id in (select receivable_id from pay_pay_received where payseriesno = #{payseriesno})
+        group by rec.account_id
+    </select>
 </mapper>