wangli 4 years ago
parent
commit
f23cd5f519

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

@@ -22,6 +22,8 @@ public class PrintInvoiceData {
 
     @ApiModelProperty(value = "收据类型:1充值 2缴费")
     private Integer printType ;
+    @ApiModelProperty(value = "交易流水号")
+    private String payseriesno ;
     @ApiModelProperty(value = "票据号码")
     private String invoiceNo ;
     @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")

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

@@ -188,6 +188,7 @@ public class PayInvoiceServiceImpl implements PayinvoiceService {
             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;
@@ -221,7 +222,7 @@ public class PayInvoiceServiceImpl implements PayinvoiceService {
 
         //余额信息(/*--交易前后余额(先按批次号查询,没有再查询交易后第一条记录,还有没有就取预存账户余额)*/)
         PrintInvoiceData payfeeRemainingPrint= payInvoiceMapper.getPayfeeRemainingPrint(printInvoiceData.getAccountId(),null,payseriesno);
-        if(payfeeRemainingPrint !=null || payfeeRemainingPrint.getRemaining() != null){
+        if(payfeeRemainingPrint !=null && payfeeRemainingPrint.getRemaining() != null){
             printInvoiceData.setRemaining(payfeeRemainingPrint.getRemaining());
             printInvoiceData.setLastRemaining(payfeeRemainingPrint.getLastRemaining());
         }else{
@@ -252,6 +253,7 @@ public class PayInvoiceServiceImpl implements PayinvoiceService {
         printInvoiceData.setInvoiceNo(
             DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS").format(LocalDateTime.now())+""+(int)(Math.random()*1000));
         printInvoiceData.setPrintType(2);
+        printInvoiceData.setPayseriesno(payseriesno);
         return printInvoiceData;
     }