wangli %!s(int64=4) %!d(string=hai) anos
pai
achega
4e5cb32794

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

@@ -63,16 +63,27 @@ public class PayInvoiceController {
     @GetMapping("/getPrintData")
     @ApiOperation("获取打印数据")
     public AjaxMessage< PrintInvoiceData> getPrintData(
-            @ApiParam(value = "缴费批次号", required = true) @RequestParam(required = true) String payseriesno,
-            @ApiParam(value = "交易类型,实收打印时为空", required = false) @RequestParam(required = false) Integer transType,
-            @ApiParam(value = "支付方式,查询返回信息的payway", required = true) @RequestParam(required = true) Integer payway ) {
-        if(transType !=null && transType==1 && payway == 4){	//单纯充值
-            return  new AjaxMessage<>(ResultStatus.OK,payinvoiceService.getPrintDataOfTrans(payseriesno));
+            @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){	//单纯充值
+                printInvoiceData = payinvoiceService.getPrintDataOfTrans(payseriesno);
 
+            }else{	//缴费
+                printInvoiceData = payinvoiceService.getPrintDataOfReceived(payseriesno);
+            }
+        }else if(type != null && type.getPayInvoiceType() == 1){  //开鲁
+            printInvoiceData = payinvoiceService.getPrintDataOfTransKailu(payseriesno);
+        }else if(type != null && type.getPayInvoiceType() == 2){  //盖州
+            printInvoiceData = payinvoiceService.getPrintDataOfTransGaizhou(payseriesno);
 
-        }else{	//缴费
-            return  new AjaxMessage<>(ResultStatus.OK,payinvoiceService.getPrintDataOfReceived(payseriesno));
         }
+        if(printInvoiceData != null){
+            printInvoiceData.setPayInvoiceType(type.getPayInvoiceType());
+        }
+        return  new AjaxMessage<>(ResultStatus.OK,printInvoiceData);
     }
 
     @GetMapping("/getPrintDataAgain")
@@ -81,23 +92,33 @@ public class PayInvoiceController {
             @ApiParam(value = "票据id", required = true) @RequestParam(required = true) BigInteger id
            ){
 
+        PrintInvoiceData printInvoiceData = null ;
         PayInvoiceDto payInvoiceDto = payinvoiceService.get(id);
-        String payseriesno = payinvoiceService.findPayseriesnoByPrint(id, 1);
-        if (StringUtils.isNotBlank(payseriesno)) {
-            PrintInvoiceData printInvoiceData= payinvoiceService.getPrintDataOfReceived(payseriesno);
-            printInvoiceData.setInvoiceNo(payInvoiceDto.getInvoiceno());
-            return new AjaxMessage<>(ResultStatus.OK,printInvoiceData);
 
-        } else {
+        String payseriesno = payinvoiceService.findPayseriesnoByPrint(id, 1);
+        if (StringUtils.isBlank(payseriesno)) {
             payseriesno = payinvoiceService.findPayseriesnoByPrint(id, 2);
-            if (StringUtils.isNotBlank(payseriesno)) {
-                PrintInvoiceData printInvoiceData= payinvoiceService.getPrintDataOfTrans(payseriesno);
-                printInvoiceData.setInvoiceNo(payInvoiceDto.getInvoiceno());
-                return new AjaxMessage<>(ResultStatus.OK,printInvoiceData);
-            } else {
-                return new AjaxMessage<>(ResultStatus.OPERATE_RECORD_NOT_EXIT);
+        }
+        PrintInvoiceData type = payinvoiceService.getPayInvoiceType(payseriesno);
+        if(type != null && type.getPayInvoiceType() == 0){  //默认
+            if(type.getPrintType() != null && type.getPrintType() == 1){	//单纯充值
+                printInvoiceData = payinvoiceService.getPrintDataOfTrans(payseriesno);
+
+            }else{	//缴费
+                printInvoiceData = payinvoiceService.getPrintDataOfReceived(payseriesno);
             }
+        }else if(type != null && type.getPayInvoiceType() == 1){  //开鲁
+            printInvoiceData = payinvoiceService.getPrintDataOfTransKailu(payseriesno);
+        }else if(type != null && type.getPayInvoiceType() == 2){  //盖州
+            printInvoiceData = payinvoiceService.getPrintDataOfTransGaizhou(payseriesno);
+
+        }
+
+        if(printInvoiceData != null){
+            printInvoiceData.setInvoiceNo(payInvoiceDto.getInvoiceno());
+            printInvoiceData.setPayInvoiceType(type.getPayInvoiceType());
         }
+        return  new AjaxMessage<>(ResultStatus.OK,printInvoiceData);
     }
 
     @PostMapping("/cancelPrintinfo")

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

@@ -27,12 +27,15 @@ public interface PayInvoiceMapper {
     List<PayTransactiondetails> findTransByPayseriesno(@Param("payseriesno") String payseriesno, @Param("siteId") Integer siteId, @Param("customerId") Integer customerId);
     List<PayPayReceived> findReceivedByPayseriesno(@Param("payseriesno") String payseriesno , @Param("siteId") Integer siteId, @Param("customerId") Integer customerId);
     void updatePrintInvoiceRecord(@Param("type") Integer type, @Param("payseriesno") String payseriesno, @Param("invoiceId") BigInteger invoiceId,@Param("siteId") Integer siteId, @Param("customerId") Integer customerId);
+
     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 getDateRangeInfoPrint(@Param("payseriesno")String payseriesno);
+
     PrintInvoiceData getAccountInfoPrint(@Param("accountId") BigInteger accountId);
     List<PrintReceivedInfo>  getPayfeeInfoPrint(@Param("minPeriod")Integer minPeriod,@Param("maxPeriod")Integer maxPeriod,@Param("accountId")BigInteger accountId);
     PrintInvoiceData getPayfeeRemainingPrint(@Param("accountId")BigInteger accountId,@Param("maxPeriod")Integer maxPeriod,@Param("payseriesno")String payseriesno);
@@ -40,6 +43,20 @@ public interface PayInvoiceMapper {
     String findPayseriesnoByPrint(@Param("id")BigInteger id, @Param("type")Integer type);
 
     void deleteTransPrint(@Param("id")BigInteger id);
+
     void deleteReceivedPrint(@Param("id")BigInteger id);
+
     void cancelPayInvoice(@Param("id")BigInteger id,@Param("canceltime")LocalDateTime canceltime,@Param("cancelperson")BigInteger cancelperson);
+
+    PrintInvoiceData countTransactiondetails( @Param("payseriesno")String payseriesno);
+
+    PrintInvoiceData getAmountPeriod(@Param("payseriesno")String payseriesno);
+
+    PrintInvoiceData getAmountInfoAndReceivablefee(@Param("accountId")BigInteger accountId ,@Param("maxPeriod")Integer maxPeriod, @Param("minPeriod")Integer minPeriod);
+
+    PrintInvoiceData getAccountBaseInfo(@Param("accountId")BigInteger accountId );
+
+    PrintInvoiceData getPayInvoiceType(@Param("payseriesno")String payseriesno );
+
+
 }

+ 3 - 1
smart-city-platform/src/main/java/com/bz/smart_city/dto/pay/PayInvoiceDto.java

@@ -25,7 +25,9 @@ public class PayInvoiceDto {
     private BigInteger id;
     @ApiModelProperty(value = "收据号码")
     private String invoiceno;
-    @ApiModelProperty(value = "客户编号")
+    @ApiModelProperty(value = "用户id")
+    private String accountId;
+    @ApiModelProperty(value = "客户名称")
     private String accountnumber;
     @ApiModelProperty(value = "客户名称")
     private String accountname;

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

@@ -20,6 +20,9 @@ import java.util.List;
 @ApiModel("打印信息")
 public class PrintInvoiceData {
 
+    @ApiModelProperty(value="收据模板类型:0:默认 1:开鲁 2:盖州")
+    private Integer payInvoiceType;
+
     @ApiModelProperty(value = "收据类型:1充值 2缴费")
     private Integer printType ;
     @ApiModelProperty(value = "客户名称(水司名称)")
@@ -66,11 +69,17 @@ public class PrintInvoiceData {
     @ApiModelProperty(value = "实收信息")
     private List<PrintReceivedInfo> printReceivedInfo;
 
+    @ApiModelProperty(value = "账期年" ,hidden = true)
+    private Integer year;
+    @ApiModelProperty(value = "账期月" ,hidden = true)
+    private Integer month;
+
     @ApiModelProperty(value = "最大账期(year*12+month)" ,hidden = true)
     private Integer maxPeriod;
     @ApiModelProperty(value = "最小账期(year*12+month)" ,hidden = true)
     private Integer minPeriod;
 
+
     @ApiModelProperty("水表表号")
     private String eleno;
     @ApiModelProperty("水表档案号")
@@ -84,4 +93,12 @@ public class PrintInvoiceData {
     @ApiModelProperty(value = "用水性质名称" )
     private String waterPropertyName;
 
+    @ApiModelProperty("一阶水价")
+    private String totalPrice;
+    @ApiModelProperty("一阶水价")
+    private String livingareaName;
+
+    @ApiModelProperty("结算水量")
+    private String payamount;
+
 }