shiyunlong há 1 ano atrás
pai
commit
91353ae322
99 ficheiros alterados com 4249 adições e 410 exclusões
  1. BIN
      .DS_Store
  2. 2 2
      .idea/mybatisx/templates.xml
  3. 6 0
      .idea/vcs.xml
  4. 2 0
      admin/src/main/resources/application.yml
  5. BIN
      admin/target/aska-admin.jar
  6. BIN
      admin/target/aska-admin.jar.original
  7. 2 0
      admin/target/classes/application.yml
  8. 220 0
      dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaChannelcouponnos.java
  9. 180 26
      dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaChannels.java
  10. 190 36
      dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaRetails.java
  11. 572 0
      dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaSplitrecord.java
  12. 311 63
      dao/src/main/java/com/mofangchuxing/aska/dao/domain/PayRequest.java
  13. 23 12
      dao/src/main/java/com/mofangchuxing/aska/dao/domain/RefundOrder.java
  14. 27 0
      dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaChannelcouponnosMapper.java
  15. 1 1
      dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaChannelsMapper.java
  16. 5 3
      dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaRetailsMapper.java
  17. 27 0
      dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaSplitrecordMapper.java
  18. 4 3
      dao/src/main/java/com/mofangchuxing/aska/dao/mapper/PayRequestMapper.java
  19. 1 1
      dao/src/main/java/com/mofangchuxing/aska/dao/mapper/RefundOrderMapper.java
  20. 112 0
      dao/src/main/resources/mapper/AskaChannelcouponnosMapper.xml
  21. 94 36
      dao/src/main/resources/mapper/AskaChannelsMapper.xml
  22. 107 36
      dao/src/main/resources/mapper/AskaRetailsMapper.xml
  23. 241 0
      dao/src/main/resources/mapper/AskaSplitrecordMapper.xml
  24. 108 18
      dao/src/main/resources/mapper/PayRequestMapper.xml
  25. 15 9
      dao/src/main/resources/mapper/RefundOrderMapper.xml
  26. BIN
      dao/target/aska-dao-1.0.jar
  27. BIN
      dao/target/classes/com/mofangchuxing/aska/dao/domain/AskaChannelcouponnos.class
  28. BIN
      dao/target/classes/com/mofangchuxing/aska/dao/domain/AskaChannels.class
  29. BIN
      dao/target/classes/com/mofangchuxing/aska/dao/domain/AskaRetails.class
  30. BIN
      dao/target/classes/com/mofangchuxing/aska/dao/domain/AskaSplitrecord.class
  31. BIN
      dao/target/classes/com/mofangchuxing/aska/dao/domain/PayRequest.class
  32. BIN
      dao/target/classes/com/mofangchuxing/aska/dao/domain/RefundOrder.class
  33. BIN
      dao/target/classes/com/mofangchuxing/aska/dao/mapper/AskaChannelcouponnosMapper.class
  34. BIN
      dao/target/classes/com/mofangchuxing/aska/dao/mapper/AskaRetailsMapper.class
  35. BIN
      dao/target/classes/com/mofangchuxing/aska/dao/mapper/AskaSplitrecordMapper.class
  36. 112 0
      dao/target/classes/mapper/AskaChannelcouponnosMapper.xml
  37. 94 36
      dao/target/classes/mapper/AskaChannelsMapper.xml
  38. 107 36
      dao/target/classes/mapper/AskaRetailsMapper.xml
  39. 241 0
      dao/target/classes/mapper/AskaSplitrecordMapper.xml
  40. 108 18
      dao/target/classes/mapper/PayRequestMapper.xml
  41. 15 9
      dao/target/classes/mapper/RefundOrderMapper.xml
  42. 10 6
      dao/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  43. 4 0
      dao/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  44. 3 0
      domain/src/main/java/com/mofangchuxing/aska/domain/DelayObjectWrapper.java
  45. 2 0
      domain/src/main/java/com/mofangchuxing/aska/domain/PayRequestDto.java
  46. 35 0
      domain/src/main/java/com/mofangchuxing/aska/domain/dto/WeiXinPayScoreServiceResourceDTO.java
  47. 15 0
      domain/src/main/java/com/mofangchuxing/aska/domain/entity/PlainCertificateItem.java
  48. 28 0
      domain/src/main/java/com/mofangchuxing/aska/domain/enums/DelayTypeEnum.java
  49. 135 0
      domain/src/main/java/com/mofangchuxing/aska/domain/vo/AskaRetailsVo.java
  50. 35 0
      domain/src/main/java/com/mofangchuxing/aska/domain/vo/WeiXinPayScoreServiceResourceDTO.java
  51. 47 0
      domain/src/main/java/com/mofangchuxing/aska/domain/vo/WeiXinPlatformCredentialVO.java
  52. BIN
      domain/target/aska-domain-1.0.jar
  53. BIN
      domain/target/classes/com/mofangchuxing/aska/domain/DelayObjectWrapper.class
  54. BIN
      domain/target/classes/com/mofangchuxing/aska/domain/PayRequestDto.class
  55. BIN
      domain/target/classes/com/mofangchuxing/aska/domain/dto/WeiXinPayScoreServiceResourceDTO.class
  56. BIN
      domain/target/classes/com/mofangchuxing/aska/domain/entity/PlainCertificateItem.class
  57. BIN
      domain/target/classes/com/mofangchuxing/aska/domain/enums/DelayTypeEnum.class
  58. BIN
      domain/target/classes/com/mofangchuxing/aska/domain/vo/AskaRetailsVo.class
  59. BIN
      domain/target/classes/com/mofangchuxing/aska/domain/vo/WeiXinPayScoreServiceResourceDTO.class
  60. BIN
      domain/target/classes/com/mofangchuxing/aska/domain/vo/WeiXinPlatformCredentialVO.class
  61. 6 0
      domain/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  62. 6 0
      domain/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  63. 45 0
      main/src/main/java/com/mofangchuxing/aska/controller/AskaController.java
  64. 3 0
      main/src/main/java/com/mofangchuxing/aska/handler/GlobalExceptionHandler.java
  65. 4 0
      main/src/main/resources/application.yml
  66. 24 0
      main/src/main/resources/wechatpay.pem
  67. BIN
      main/target/aska.jar
  68. BIN
      main/target/aska.jar.original
  69. 4 0
      main/target/classes/application.yml
  70. BIN
      main/target/classes/com/mofangchuxing/aska/controller/AskaController.class
  71. BIN
      main/target/classes/com/mofangchuxing/aska/handler/GlobalExceptionHandler.class
  72. 24 0
      main/target/classes/wechatpay.pem
  73. 15 0
      service/pom.xml
  74. 12 0
      service/src/main/java/com/mofangchuxing/aska/service/CouponService.java
  75. 2 0
      service/src/main/java/com/mofangchuxing/aska/service/PayService.java
  76. 23 0
      service/src/main/java/com/mofangchuxing/aska/service/ProfitSharingService.java
  77. 5 0
      service/src/main/java/com/mofangchuxing/aska/service/RetailService.java
  78. 60 27
      service/src/main/java/com/mofangchuxing/aska/service/common/DelayNotifyComponent.java
  79. 70 0
      service/src/main/java/com/mofangchuxing/aska/service/config/WxPayV3Config.java
  80. 28 0
      service/src/main/java/com/mofangchuxing/aska/service/impl/CouponServiceImpl.java
  81. 61 21
      service/src/main/java/com/mofangchuxing/aska/service/impl/PayServiceImpl.java
  82. 312 0
      service/src/main/java/com/mofangchuxing/aska/service/impl/ProfitSharingServiceImpl.java
  83. 10 3
      service/src/main/java/com/mofangchuxing/aska/service/impl/RetailServiceImpl.java
  84. 273 0
      service/src/main/java/com/mofangchuxing/aska/service/utils/WxPayV3Utils.java
  85. BIN
      service/target/aska-service-1.0.jar
  86. BIN
      service/target/classes/com/mofangchuxing/aska/service/CouponService.class
  87. BIN
      service/target/classes/com/mofangchuxing/aska/service/PayService.class
  88. BIN
      service/target/classes/com/mofangchuxing/aska/service/ProfitSharingService.class
  89. BIN
      service/target/classes/com/mofangchuxing/aska/service/RetailService.class
  90. BIN
      service/target/classes/com/mofangchuxing/aska/service/common/DelayNotifyComponent$1.class
  91. BIN
      service/target/classes/com/mofangchuxing/aska/service/common/DelayNotifyComponent.class
  92. BIN
      service/target/classes/com/mofangchuxing/aska/service/config/WxPayV3Config.class
  93. BIN
      service/target/classes/com/mofangchuxing/aska/service/impl/CouponServiceImpl.class
  94. BIN
      service/target/classes/com/mofangchuxing/aska/service/impl/PayServiceImpl.class
  95. BIN
      service/target/classes/com/mofangchuxing/aska/service/impl/ProfitSharingServiceImpl.class
  96. BIN
      service/target/classes/com/mofangchuxing/aska/service/impl/RetailServiceImpl.class
  97. BIN
      service/target/classes/com/mofangchuxing/aska/service/utils/WxPayV3Utils.class
  98. 15 8
      service/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  99. 6 0
      service/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

BIN
.DS_Store


+ 2 - 2
.idea/mybatisx/templates.xml

@@ -49,8 +49,8 @@
             <option name="tableUIInfoList">
               <list>
                 <TableUIInfo>
-                  <option name="className" value="AskaChannels" />
-                  <option name="tableName" value="aska_channels" />
+                  <option name="className" value="RefundOrder" />
+                  <option name="tableName" value="refund_order" />
                 </TableUIInfo>
               </list>
             </option>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 2 - 0
admin/src/main/resources/application.yml

@@ -40,6 +40,8 @@ spring:
 #微信支付配置
 wx:
   app-id: wxc6eeeba72fd3ed01
+  #app端的appId
+  app-appid: wxe5251793c19a48d5
   mch-id: 1641830577
   api-key: a8babfa0d75ac878dd76dc905bf677e2
   unified-order-url: https://api.mch.weixin.qq.com/pay/unifiedorder

BIN
admin/target/aska-admin.jar


BIN
admin/target/aska-admin.jar.original


+ 2 - 0
admin/target/classes/application.yml

@@ -40,6 +40,8 @@ spring:
 #微信支付配置
 wx:
   app-id: wxc6eeeba72fd3ed01
+  #app端的appId
+  app-appid: wxe5251793c19a48d5
   mch-id: 1641830577
   api-key: a8babfa0d75ac878dd76dc905bf677e2
   unified-order-url: https://api.mch.weixin.qq.com/pay/unifiedorder

+ 220 - 0
dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaChannelcouponnos.java

@@ -0,0 +1,220 @@
+package com.mofangchuxing.aska.dao.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 抵扣券
+ * @TableName aska_channelCouponNos
+ */
+public class AskaChannelcouponnos implements Serializable {
+    /**
+     * 
+     */
+    private Integer id;
+
+    /**
+     * 
+     */
+    private Integer channelId;
+
+    /**
+     * 
+     */
+    private String channelNo;
+
+    /**
+     * 
+     */
+    private String couponNo;
+
+    /**
+     * {有效,作废,已用}
+     */
+    private String status;
+
+    /**
+     * 
+     */
+    private Date outDate;
+
+    /**
+     * 面值(分),在使用抵扣券时,订单可以减免的额度。 话说,传进来的交易金额应该已经减过抵扣券面值了。
+     */
+    private Integer value;
+
+    /**
+     * 售价(分)
+     */
+    private Integer price;
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * 
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 
+     */
+    public Integer getChannelId() {
+        return channelId;
+    }
+
+    /**
+     * 
+     */
+    public void setChannelId(Integer channelId) {
+        this.channelId = channelId;
+    }
+
+    /**
+     * 
+     */
+    public String getChannelNo() {
+        return channelNo;
+    }
+
+    /**
+     * 
+     */
+    public void setChannelNo(String channelNo) {
+        this.channelNo = channelNo;
+    }
+
+    /**
+     * 
+     */
+    public String getCouponNo() {
+        return couponNo;
+    }
+
+    /**
+     * 
+     */
+    public void setCouponNo(String couponNo) {
+        this.couponNo = couponNo;
+    }
+
+    /**
+     * {有效,作废,已用}
+     */
+    public String getStatus() {
+        return status;
+    }
+
+    /**
+     * {有效,作废,已用}
+     */
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    /**
+     * 
+     */
+    public Date getOutDate() {
+        return outDate;
+    }
+
+    /**
+     * 
+     */
+    public void setOutDate(Date outDate) {
+        this.outDate = outDate;
+    }
+
+    /**
+     * 面值(分),在使用抵扣券时,订单可以减免的额度。 话说,传进来的交易金额应该已经减过抵扣券面值了。
+     */
+    public Integer getValue() {
+        return value;
+    }
+
+    /**
+     * 面值(分),在使用抵扣券时,订单可以减免的额度。 话说,传进来的交易金额应该已经减过抵扣券面值了。
+     */
+    public void setValue(Integer value) {
+        this.value = value;
+    }
+
+    /**
+     * 售价(分)
+     */
+    public Integer getPrice() {
+        return price;
+    }
+
+    /**
+     * 售价(分)
+     */
+    public void setPrice(Integer price) {
+        this.price = price;
+    }
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        AskaChannelcouponnos other = (AskaChannelcouponnos) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getChannelId() == null ? other.getChannelId() == null : this.getChannelId().equals(other.getChannelId()))
+            && (this.getChannelNo() == null ? other.getChannelNo() == null : this.getChannelNo().equals(other.getChannelNo()))
+            && (this.getCouponNo() == null ? other.getCouponNo() == null : this.getCouponNo().equals(other.getCouponNo()))
+            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
+            && (this.getOutDate() == null ? other.getOutDate() == null : this.getOutDate().equals(other.getOutDate()))
+            && (this.getValue() == null ? other.getValue() == null : this.getValue().equals(other.getValue()))
+            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getChannelId() == null) ? 0 : getChannelId().hashCode());
+        result = prime * result + ((getChannelNo() == null) ? 0 : getChannelNo().hashCode());
+        result = prime * result + ((getCouponNo() == null) ? 0 : getCouponNo().hashCode());
+        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
+        result = prime * result + ((getOutDate() == null) ? 0 : getOutDate().hashCode());
+        result = prime * result + ((getValue() == null) ? 0 : getValue().hashCode());
+        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", channelId=").append(channelId);
+        sb.append(", channelNo=").append(channelNo);
+        sb.append(", couponNo=").append(couponNo);
+        sb.append(", status=").append(status);
+        sb.append(", outDate=").append(outDate);
+        sb.append(", value=").append(value);
+        sb.append(", price=").append(price);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 180 - 26
dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaChannels.java

@@ -45,7 +45,17 @@ public class AskaChannels implements Serializable {
     /**
      * 
      */
-    private String accountname;
+    private String accountName;
+
+    /**
+     * {personal,merchant}
+     */
+    private String accountType;
+
+    /**
+     * {store,store_owner,staff,partner}
+     */
+    private String relation;
 
     /**
      * 
@@ -55,7 +65,7 @@ public class AskaChannels implements Serializable {
     /**
      * 
      */
-    private String certpath;
+    private String certPath;
 
     /**
      * 分账方式{定额,定比}
@@ -70,13 +80,38 @@ public class AskaChannels implements Serializable {
     /**
      * 是否实时分账
      */
-    private Integer realtimesplit;
+    private Integer realtimeSplit;
 
     /**
      * 渠道可用状态
      */
     private String status;
 
+    /**
+     * 收入总额
+     */
+    private Integer totalIncome;
+
+    /**
+     * 实时分账总额
+     */
+    private Integer totalSplit;
+
+    /**
+     * 提现总额
+     */
+    private Integer totalCashOut;
+
+    /**
+     * 退款总额
+     */
+    private Integer totalRefund;
+
+    /**
+     * 余额
+     */
+    private Integer balance;
+
     private static final long serialVersionUID = 1L;
 
     /**
@@ -180,15 +215,43 @@ public class AskaChannels implements Serializable {
     /**
      * 
      */
-    public String getAccountname() {
-        return accountname;
+    public String getAccountName() {
+        return accountName;
     }
 
     /**
      * 
      */
-    public void setAccountname(String accountname) {
-        this.accountname = accountname;
+    public void setAccountName(String accountName) {
+        this.accountName = accountName;
+    }
+
+    /**
+     * {personal,merchant}
+     */
+    public String getAccountType() {
+        return accountType;
+    }
+
+    /**
+     * {personal,merchant}
+     */
+    public void setAccountType(String accountType) {
+        this.accountType = accountType;
+    }
+
+    /**
+     * {store,store_owner,staff,partner}
+     */
+    public String getRelation() {
+        return relation;
+    }
+
+    /**
+     * {store,store_owner,staff,partner}
+     */
+    public void setRelation(String relation) {
+        this.relation = relation;
     }
 
     /**
@@ -208,15 +271,15 @@ public class AskaChannels implements Serializable {
     /**
      * 
      */
-    public String getCertpath() {
-        return certpath;
+    public String getCertPath() {
+        return certPath;
     }
 
     /**
      * 
      */
-    public void setCertpath(String certpath) {
-        this.certpath = certpath;
+    public void setCertPath(String certPath) {
+        this.certPath = certPath;
     }
 
     /**
@@ -250,15 +313,15 @@ public class AskaChannels implements Serializable {
     /**
      * 是否实时分账
      */
-    public Integer getRealtimesplit() {
-        return realtimesplit;
+    public Integer getRealtimeSplit() {
+        return realtimeSplit;
     }
 
     /**
      * 是否实时分账
      */
-    public void setRealtimesplit(Integer realtimesplit) {
-        this.realtimesplit = realtimesplit;
+    public void setRealtimeSplit(Integer realtimeSplit) {
+        this.realtimeSplit = realtimeSplit;
     }
 
     /**
@@ -275,6 +338,76 @@ public class AskaChannels implements Serializable {
         this.status = status;
     }
 
+    /**
+     * 收入总额
+     */
+    public Integer getTotalIncome() {
+        return totalIncome;
+    }
+
+    /**
+     * 收入总额
+     */
+    public void setTotalIncome(Integer totalIncome) {
+        this.totalIncome = totalIncome;
+    }
+
+    /**
+     * 实时分账总额
+     */
+    public Integer getTotalSplit() {
+        return totalSplit;
+    }
+
+    /**
+     * 实时分账总额
+     */
+    public void setTotalSplit(Integer totalSplit) {
+        this.totalSplit = totalSplit;
+    }
+
+    /**
+     * 提现总额
+     */
+    public Integer getTotalCashOut() {
+        return totalCashOut;
+    }
+
+    /**
+     * 提现总额
+     */
+    public void setTotalCashOut(Integer totalCashOut) {
+        this.totalCashOut = totalCashOut;
+    }
+
+    /**
+     * 退款总额
+     */
+    public Integer getTotalRefund() {
+        return totalRefund;
+    }
+
+    /**
+     * 退款总额
+     */
+    public void setTotalRefund(Integer totalRefund) {
+        this.totalRefund = totalRefund;
+    }
+
+    /**
+     * 余额
+     */
+    public Integer getBalance() {
+        return balance;
+    }
+
+    /**
+     * 余额
+     */
+    public void setBalance(Integer balance) {
+        this.balance = balance;
+    }
+
     @Override
     public boolean equals(Object that) {
         if (this == that) {
@@ -294,13 +427,20 @@ public class AskaChannels implements Serializable {
             && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
             && (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()))
             && (this.getAccount() == null ? other.getAccount() == null : this.getAccount().equals(other.getAccount()))
-            && (this.getAccountname() == null ? other.getAccountname() == null : this.getAccountname().equals(other.getAccountname()))
+            && (this.getAccountName() == null ? other.getAccountName() == null : this.getAccountName().equals(other.getAccountName()))
+            && (this.getAccountType() == null ? other.getAccountType() == null : this.getAccountType().equals(other.getAccountType()))
+            && (this.getRelation() == null ? other.getRelation() == null : this.getRelation().equals(other.getRelation()))
             && (this.getApiv3() == null ? other.getApiv3() == null : this.getApiv3().equals(other.getApiv3()))
-            && (this.getCertpath() == null ? other.getCertpath() == null : this.getCertpath().equals(other.getCertpath()))
+            && (this.getCertPath() == null ? other.getCertPath() == null : this.getCertPath().equals(other.getCertPath()))
             && (this.getTripartite() == null ? other.getTripartite() == null : this.getTripartite().equals(other.getTripartite()))
             && (this.getTripvalue() == null ? other.getTripvalue() == null : this.getTripvalue().equals(other.getTripvalue()))
-            && (this.getRealtimesplit() == null ? other.getRealtimesplit() == null : this.getRealtimesplit().equals(other.getRealtimesplit()))
-            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
+            && (this.getRealtimeSplit() == null ? other.getRealtimeSplit() == null : this.getRealtimeSplit().equals(other.getRealtimeSplit()))
+            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
+            && (this.getTotalIncome() == null ? other.getTotalIncome() == null : this.getTotalIncome().equals(other.getTotalIncome()))
+            && (this.getTotalSplit() == null ? other.getTotalSplit() == null : this.getTotalSplit().equals(other.getTotalSplit()))
+            && (this.getTotalCashOut() == null ? other.getTotalCashOut() == null : this.getTotalCashOut().equals(other.getTotalCashOut()))
+            && (this.getTotalRefund() == null ? other.getTotalRefund() == null : this.getTotalRefund().equals(other.getTotalRefund()))
+            && (this.getBalance() == null ? other.getBalance() == null : this.getBalance().equals(other.getBalance()));
     }
 
     @Override
@@ -314,13 +454,20 @@ public class AskaChannels implements Serializable {
         result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
         result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode());
         result = prime * result + ((getAccount() == null) ? 0 : getAccount().hashCode());
-        result = prime * result + ((getAccountname() == null) ? 0 : getAccountname().hashCode());
+        result = prime * result + ((getAccountName() == null) ? 0 : getAccountName().hashCode());
+        result = prime * result + ((getAccountType() == null) ? 0 : getAccountType().hashCode());
+        result = prime * result + ((getRelation() == null) ? 0 : getRelation().hashCode());
         result = prime * result + ((getApiv3() == null) ? 0 : getApiv3().hashCode());
-        result = prime * result + ((getCertpath() == null) ? 0 : getCertpath().hashCode());
+        result = prime * result + ((getCertPath() == null) ? 0 : getCertPath().hashCode());
         result = prime * result + ((getTripartite() == null) ? 0 : getTripartite().hashCode());
         result = prime * result + ((getTripvalue() == null) ? 0 : getTripvalue().hashCode());
-        result = prime * result + ((getRealtimesplit() == null) ? 0 : getRealtimesplit().hashCode());
+        result = prime * result + ((getRealtimeSplit() == null) ? 0 : getRealtimeSplit().hashCode());
         result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
+        result = prime * result + ((getTotalIncome() == null) ? 0 : getTotalIncome().hashCode());
+        result = prime * result + ((getTotalSplit() == null) ? 0 : getTotalSplit().hashCode());
+        result = prime * result + ((getTotalCashOut() == null) ? 0 : getTotalCashOut().hashCode());
+        result = prime * result + ((getTotalRefund() == null) ? 0 : getTotalRefund().hashCode());
+        result = prime * result + ((getBalance() == null) ? 0 : getBalance().hashCode());
         return result;
     }
 
@@ -333,17 +480,24 @@ public class AskaChannels implements Serializable {
         sb.append(", id=").append(id);
         sb.append(", name=").append(name);
         sb.append(", prefix=").append(prefix);
-        sb.append(", ownerid=").append(ownerId);
+        sb.append(", ownerId=").append(ownerId);
         sb.append(", phone=").append(phone);
         sb.append(", note=").append(note);
         sb.append(", account=").append(account);
-        sb.append(", accountname=").append(accountname);
+        sb.append(", accountName=").append(accountName);
+        sb.append(", accountType=").append(accountType);
+        sb.append(", relation=").append(relation);
         sb.append(", apiv3=").append(apiv3);
-        sb.append(", certpath=").append(certpath);
+        sb.append(", certPath=").append(certPath);
         sb.append(", tripartite=").append(tripartite);
         sb.append(", tripvalue=").append(tripvalue);
-        sb.append(", realtimesplit=").append(realtimesplit);
+        sb.append(", realtimeSplit=").append(realtimeSplit);
         sb.append(", status=").append(status);
+        sb.append(", totalIncome=").append(totalIncome);
+        sb.append(", totalSplit=").append(totalSplit);
+        sb.append(", totalCashOut=").append(totalCashOut);
+        sb.append(", totalRefund=").append(totalRefund);
+        sb.append(", balance=").append(balance);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 190 - 36
dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaRetails.java

@@ -40,7 +40,7 @@ public class AskaRetails implements Serializable {
     /**
      * 渠道负责人id
      */
-    private Integer ownerid;
+    private Integer ownerId;
 
     /**
      * 
@@ -53,14 +53,24 @@ public class AskaRetails implements Serializable {
     private String note;
 
     /**
-     * 收款账号
+     * 收款账号mchid或openid
      */
     private String account;
 
     /**
      * 
      */
-    private String accountname;
+    private String accountName;
+
+    /**
+     * {personal,merchant}
+     */
+    private String accountType;
+
+    /**
+     * {store,store_owner,staff,partner}
+     */
+    private String relation;
 
     /**
      * 
@@ -70,7 +80,7 @@ public class AskaRetails implements Serializable {
     /**
      * 
      */
-    private String certpath;
+    private String certPath;
 
     /**
      * 分账方式{定额,定比}
@@ -85,13 +95,38 @@ public class AskaRetails implements Serializable {
     /**
      * 是否实时分账
      */
-    private Integer realtimesplit;
+    private Integer realtimeSplit;
 
     /**
      * 渠道可用状态{运营,暂停}
      */
     private String status;
 
+    /**
+     * 收入总额
+     */
+    private Integer totalIncome;
+
+    /**
+     * 实时分账总 额
+     */
+    private Integer totalSplit;
+
+    /**
+     * 提现总额
+     */
+    private Integer totalCashOut;
+
+    /**
+     * 退款总额
+     */
+    private Integer totalRefund;
+
+    /**
+     * 余额
+     */
+    private Integer balance;
+
     private static final long serialVersionUID = 1L;
 
     /**
@@ -181,15 +216,15 @@ public class AskaRetails implements Serializable {
     /**
      * 渠道负责人id
      */
-    public Integer getOwnerid() {
-        return ownerid;
+    public Integer getOwnerId() {
+        return ownerId;
     }
 
     /**
      * 渠道负责人id
      */
-    public void setOwnerid(Integer ownerid) {
-        this.ownerid = ownerid;
+    public void setOwnerId(Integer ownerId) {
+        this.ownerId = ownerId;
     }
 
     /**
@@ -221,14 +256,14 @@ public class AskaRetails implements Serializable {
     }
 
     /**
-     * 收款账号
+     * 收款账号mchid或openid
      */
     public String getAccount() {
         return account;
     }
 
     /**
-     * 收款账号
+     * 收款账号mchid或openid
      */
     public void setAccount(String account) {
         this.account = account;
@@ -237,15 +272,43 @@ public class AskaRetails implements Serializable {
     /**
      * 
      */
-    public String getAccountname() {
-        return accountname;
+    public String getAccountName() {
+        return accountName;
     }
 
     /**
      * 
      */
-    public void setAccountname(String accountname) {
-        this.accountname = accountname;
+    public void setAccountName(String accountName) {
+        this.accountName = accountName;
+    }
+
+    /**
+     * {personal,merchant}
+     */
+    public String getAccountType() {
+        return accountType;
+    }
+
+    /**
+     * {personal,merchant}
+     */
+    public void setAccountType(String accountType) {
+        this.accountType = accountType;
+    }
+
+    /**
+     * {store,store_owner,staff,partner}
+     */
+    public String getRelation() {
+        return relation;
+    }
+
+    /**
+     * {store,store_owner,staff,partner}
+     */
+    public void setRelation(String relation) {
+        this.relation = relation;
     }
 
     /**
@@ -265,15 +328,15 @@ public class AskaRetails implements Serializable {
     /**
      * 
      */
-    public String getCertpath() {
-        return certpath;
+    public String getCertPath() {
+        return certPath;
     }
 
     /**
      * 
      */
-    public void setCertpath(String certpath) {
-        this.certpath = certpath;
+    public void setCertPath(String certPath) {
+        this.certPath = certPath;
     }
 
     /**
@@ -307,15 +370,15 @@ public class AskaRetails implements Serializable {
     /**
      * 是否实时分账
      */
-    public Integer getRealtimesplit() {
-        return realtimesplit;
+    public Integer getRealtimeSplit() {
+        return realtimeSplit;
     }
 
     /**
      * 是否实时分账
      */
-    public void setRealtimesplit(Integer realtimesplit) {
-        this.realtimesplit = realtimesplit;
+    public void setRealtimeSplit(Integer realtimeSplit) {
+        this.realtimeSplit = realtimeSplit;
     }
 
     /**
@@ -332,6 +395,76 @@ public class AskaRetails implements Serializable {
         this.status = status;
     }
 
+    /**
+     * 收入总额
+     */
+    public Integer getTotalIncome() {
+        return totalIncome;
+    }
+
+    /**
+     * 收入总额
+     */
+    public void setTotalIncome(Integer totalIncome) {
+        this.totalIncome = totalIncome;
+    }
+
+    /**
+     * 实时分账总 额
+     */
+    public Integer getTotalSplit() {
+        return totalSplit;
+    }
+
+    /**
+     * 实时分账总 额
+     */
+    public void setTotalSplit(Integer totalSplit) {
+        this.totalSplit = totalSplit;
+    }
+
+    /**
+     * 提现总额
+     */
+    public Integer getTotalCashOut() {
+        return totalCashOut;
+    }
+
+    /**
+     * 提现总额
+     */
+    public void setTotalCashOut(Integer totalCashOut) {
+        this.totalCashOut = totalCashOut;
+    }
+
+    /**
+     * 退款总额
+     */
+    public Integer getTotalRefund() {
+        return totalRefund;
+    }
+
+    /**
+     * 退款总额
+     */
+    public void setTotalRefund(Integer totalRefund) {
+        this.totalRefund = totalRefund;
+    }
+
+    /**
+     * 余额
+     */
+    public Integer getBalance() {
+        return balance;
+    }
+
+    /**
+     * 余额
+     */
+    public void setBalance(Integer balance) {
+        this.balance = balance;
+    }
+
     @Override
     public boolean equals(Object that) {
         if (this == that) {
@@ -350,17 +483,24 @@ public class AskaRetails implements Serializable {
             && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
             && (this.getLat() == null ? other.getLat() == null : this.getLat().equals(other.getLat()))
             && (this.getLng() == null ? other.getLng() == null : this.getLng().equals(other.getLng()))
-            && (this.getOwnerid() == null ? other.getOwnerid() == null : this.getOwnerid().equals(other.getOwnerid()))
+            && (this.getOwnerId() == null ? other.getOwnerId() == null : this.getOwnerId().equals(other.getOwnerId()))
             && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
             && (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()))
             && (this.getAccount() == null ? other.getAccount() == null : this.getAccount().equals(other.getAccount()))
-            && (this.getAccountname() == null ? other.getAccountname() == null : this.getAccountname().equals(other.getAccountname()))
+            && (this.getAccountName() == null ? other.getAccountName() == null : this.getAccountName().equals(other.getAccountName()))
+            && (this.getAccountType() == null ? other.getAccountType() == null : this.getAccountType().equals(other.getAccountType()))
+            && (this.getRelation() == null ? other.getRelation() == null : this.getRelation().equals(other.getRelation()))
             && (this.getApiv3() == null ? other.getApiv3() == null : this.getApiv3().equals(other.getApiv3()))
-            && (this.getCertpath() == null ? other.getCertpath() == null : this.getCertpath().equals(other.getCertpath()))
+            && (this.getCertPath() == null ? other.getCertPath() == null : this.getCertPath().equals(other.getCertPath()))
             && (this.getTripartite() == null ? other.getTripartite() == null : this.getTripartite().equals(other.getTripartite()))
             && (this.getTripvalue() == null ? other.getTripvalue() == null : this.getTripvalue().equals(other.getTripvalue()))
-            && (this.getRealtimesplit() == null ? other.getRealtimesplit() == null : this.getRealtimesplit().equals(other.getRealtimesplit()))
-            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
+            && (this.getRealtimeSplit() == null ? other.getRealtimeSplit() == null : this.getRealtimeSplit().equals(other.getRealtimeSplit()))
+            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
+            && (this.getTotalIncome() == null ? other.getTotalIncome() == null : this.getTotalIncome().equals(other.getTotalIncome()))
+            && (this.getTotalSplit() == null ? other.getTotalSplit() == null : this.getTotalSplit().equals(other.getTotalSplit()))
+            && (this.getTotalCashOut() == null ? other.getTotalCashOut() == null : this.getTotalCashOut().equals(other.getTotalCashOut()))
+            && (this.getTotalRefund() == null ? other.getTotalRefund() == null : this.getTotalRefund().equals(other.getTotalRefund()))
+            && (this.getBalance() == null ? other.getBalance() == null : this.getBalance().equals(other.getBalance()));
     }
 
     @Override
@@ -373,17 +513,24 @@ public class AskaRetails implements Serializable {
         result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
         result = prime * result + ((getLat() == null) ? 0 : getLat().hashCode());
         result = prime * result + ((getLng() == null) ? 0 : getLng().hashCode());
-        result = prime * result + ((getOwnerid() == null) ? 0 : getOwnerid().hashCode());
+        result = prime * result + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode());
         result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
         result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode());
         result = prime * result + ((getAccount() == null) ? 0 : getAccount().hashCode());
-        result = prime * result + ((getAccountname() == null) ? 0 : getAccountname().hashCode());
+        result = prime * result + ((getAccountName() == null) ? 0 : getAccountName().hashCode());
+        result = prime * result + ((getAccountType() == null) ? 0 : getAccountType().hashCode());
+        result = prime * result + ((getRelation() == null) ? 0 : getRelation().hashCode());
         result = prime * result + ((getApiv3() == null) ? 0 : getApiv3().hashCode());
-        result = prime * result + ((getCertpath() == null) ? 0 : getCertpath().hashCode());
+        result = prime * result + ((getCertPath() == null) ? 0 : getCertPath().hashCode());
         result = prime * result + ((getTripartite() == null) ? 0 : getTripartite().hashCode());
         result = prime * result + ((getTripvalue() == null) ? 0 : getTripvalue().hashCode());
-        result = prime * result + ((getRealtimesplit() == null) ? 0 : getRealtimesplit().hashCode());
+        result = prime * result + ((getRealtimeSplit() == null) ? 0 : getRealtimeSplit().hashCode());
         result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
+        result = prime * result + ((getTotalIncome() == null) ? 0 : getTotalIncome().hashCode());
+        result = prime * result + ((getTotalSplit() == null) ? 0 : getTotalSplit().hashCode());
+        result = prime * result + ((getTotalCashOut() == null) ? 0 : getTotalCashOut().hashCode());
+        result = prime * result + ((getTotalRefund() == null) ? 0 : getTotalRefund().hashCode());
+        result = prime * result + ((getBalance() == null) ? 0 : getBalance().hashCode());
         return result;
     }
 
@@ -399,17 +546,24 @@ public class AskaRetails implements Serializable {
         sb.append(", type=").append(type);
         sb.append(", lat=").append(lat);
         sb.append(", lng=").append(lng);
-        sb.append(", ownerid=").append(ownerid);
+        sb.append(", ownerId=").append(ownerId);
         sb.append(", phone=").append(phone);
         sb.append(", note=").append(note);
         sb.append(", account=").append(account);
-        sb.append(", accountname=").append(accountname);
+        sb.append(", accountName=").append(accountName);
+        sb.append(", accountType=").append(accountType);
+        sb.append(", relation=").append(relation);
         sb.append(", apiv3=").append(apiv3);
-        sb.append(", certpath=").append(certpath);
+        sb.append(", certPath=").append(certPath);
         sb.append(", tripartite=").append(tripartite);
         sb.append(", tripvalue=").append(tripvalue);
-        sb.append(", realtimesplit=").append(realtimesplit);
+        sb.append(", realtimeSplit=").append(realtimeSplit);
         sb.append(", status=").append(status);
+        sb.append(", totalIncome=").append(totalIncome);
+        sb.append(", totalSplit=").append(totalSplit);
+        sb.append(", totalCashOut=").append(totalCashOut);
+        sb.append(", totalRefund=").append(totalRefund);
+        sb.append(", balance=").append(balance);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 572 - 0
dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaSplitrecord.java

@@ -0,0 +1,572 @@
+package com.mofangchuxing.aska.dao.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 分账记录
+ * @TableName aska_splitRecord
+ */
+public class AskaSplitrecord implements Serializable {
+    /**
+     * 
+     */
+    private Integer id;
+
+    /**
+     * 订单Id
+     */
+    private Integer payId;
+
+    /**
+     * 分账订单号
+     */
+    private String spiltOrderId;
+
+    /**
+     * 订单金额
+     */
+    private Integer payAmount;
+
+    /**
+     * 门店id
+     */
+    private Integer retailId;
+
+    /**
+     * 门店名
+     */
+    private String retailName;
+
+    /**
+     * 门店收款账号
+     */
+    private String retailAccount;
+
+    /**
+     * 门店本单分账总额
+     */
+    private String retailAmount;
+
+    /**
+     * 实时分账金额
+     */
+    private Integer retailRealtimeAmount;
+
+    /**
+     * 记账金额
+     */
+    private Integer retailAccountAmount;
+
+    /**
+     * 门店分账规则,文本,用于调试
+     */
+    private String retailSplitrule;
+
+    /**
+     * 渠道id
+     */
+    private Integer channelId;
+
+    /**
+     * 渠道名
+     */
+    private String channelName;
+
+    /**
+     * 渠道收款账号
+     */
+    private String channelAccount;
+
+    /**
+     * 渠道本单分账总额
+     */
+    private String channelAmount;
+
+    /**
+     * 渠道实时分账金额
+     */
+    private Integer channelRealtimeAmount;
+
+    /**
+     * 渠道记账金额
+     */
+    private Integer channelAccountAmount;
+
+    /**
+     * 门店分账规则,文本,用于调试
+     */
+    private String channelSplitRule;
+
+    /**
+     * 分账状态 0-未分 1-已分
+     */
+    private Integer status;
+
+    /**
+     * 
+     */
+    private Date createTime;
+
+    /**
+     * 
+     */
+    private Integer hasRefund;
+
+    /**
+     * 
+     */
+    private Integer refundTotal;
+
+    /**
+     * 
+     */
+    private Integer refundRetail;
+
+    /**
+     * 
+     */
+    private Integer refundChannel;
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * 
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 订单Id
+     */
+    public Integer getPayId() {
+        return payId;
+    }
+
+    /**
+     * 订单Id
+     */
+    public void setPayId(Integer payId) {
+        this.payId = payId;
+    }
+
+    /**
+     * 分账订单号
+     */
+    public String getSpiltOrderId() {
+        return spiltOrderId;
+    }
+
+    /**
+     * 分账订单号
+     */
+    public void setSpiltOrderId(String spiltOrderId) {
+        this.spiltOrderId = spiltOrderId;
+    }
+
+    /**
+     * 订单金额
+     */
+    public Integer getPayAmount() {
+        return payAmount;
+    }
+
+    /**
+     * 订单金额
+     */
+    public void setPayAmount(Integer payAmount) {
+        this.payAmount = payAmount;
+    }
+
+    /**
+     * 门店id
+     */
+    public Integer getRetailId() {
+        return retailId;
+    }
+
+    /**
+     * 门店id
+     */
+    public void setRetailId(Integer retailId) {
+        this.retailId = retailId;
+    }
+
+    /**
+     * 门店名
+     */
+    public String getRetailName() {
+        return retailName;
+    }
+
+    /**
+     * 门店名
+     */
+    public void setRetailName(String retailName) {
+        this.retailName = retailName;
+    }
+
+    /**
+     * 门店收款账号
+     */
+    public String getRetailAccount() {
+        return retailAccount;
+    }
+
+    /**
+     * 门店收款账号
+     */
+    public void setRetailAccount(String retailAccount) {
+        this.retailAccount = retailAccount;
+    }
+
+    /**
+     * 门店本单分账总额
+     */
+    public String getRetailAmount() {
+        return retailAmount;
+    }
+
+    /**
+     * 门店本单分账总额
+     */
+    public void setRetailAmount(String retailAmount) {
+        this.retailAmount = retailAmount;
+    }
+
+    /**
+     * 实时分账金额
+     */
+    public Integer getRetailRealtimeAmount() {
+        return retailRealtimeAmount;
+    }
+
+    /**
+     * 实时分账金额
+     */
+    public void setRetailRealtimeAmount(Integer retailRealtimeAmount) {
+        this.retailRealtimeAmount = retailRealtimeAmount;
+    }
+
+    /**
+     * 记账金额
+     */
+    public Integer getRetailAccountAmount() {
+        return retailAccountAmount;
+    }
+
+    /**
+     * 记账金额
+     */
+    public void setRetailAccountAmount(Integer retailAccountAmount) {
+        this.retailAccountAmount = retailAccountAmount;
+    }
+
+    /**
+     * 门店分账规则,文本,用于调试
+     */
+    public String getRetailSplitrule() {
+        return retailSplitrule;
+    }
+
+    /**
+     * 门店分账规则,文本,用于调试
+     */
+    public void setRetailSplitrule(String retailSplitrule) {
+        this.retailSplitrule = retailSplitrule;
+    }
+
+    /**
+     * 渠道id
+     */
+    public Integer getChannelId() {
+        return channelId;
+    }
+
+    /**
+     * 渠道id
+     */
+    public void setChannelId(Integer channelId) {
+        this.channelId = channelId;
+    }
+
+    /**
+     * 渠道名
+     */
+    public String getChannelName() {
+        return channelName;
+    }
+
+    /**
+     * 渠道名
+     */
+    public void setChannelName(String channelName) {
+        this.channelName = channelName;
+    }
+
+    /**
+     * 渠道收款账号
+     */
+    public String getChannelAccount() {
+        return channelAccount;
+    }
+
+    /**
+     * 渠道收款账号
+     */
+    public void setChannelAccount(String channelAccount) {
+        this.channelAccount = channelAccount;
+    }
+
+    /**
+     * 渠道本单分账总额
+     */
+    public String getChannelAmount() {
+        return channelAmount;
+    }
+
+    /**
+     * 渠道本单分账总额
+     */
+    public void setChannelAmount(String channelAmount) {
+        this.channelAmount = channelAmount;
+    }
+
+    /**
+     * 渠道实时分账金额
+     */
+    public Integer getChannelRealtimeAmount() {
+        return channelRealtimeAmount;
+    }
+
+    /**
+     * 渠道实时分账金额
+     */
+    public void setChannelRealtimeAmount(Integer channelRealtimeAmount) {
+        this.channelRealtimeAmount = channelRealtimeAmount;
+    }
+
+    /**
+     * 渠道记账金额
+     */
+    public Integer getChannelAccountAmount() {
+        return channelAccountAmount;
+    }
+
+    /**
+     * 渠道记账金额
+     */
+    public void setChannelAccountAmount(Integer channelAccountAmount) {
+        this.channelAccountAmount = channelAccountAmount;
+    }
+
+    /**
+     * 门店分账规则,文本,用于调试
+     */
+    public String getChannelSplitRule() {
+        return channelSplitRule;
+    }
+
+    /**
+     * 门店分账规则,文本,用于调试
+     */
+    public void setChannelSplitRule(String channelSplitRule) {
+        this.channelSplitRule = channelSplitRule;
+    }
+
+    /**
+     * 分账状态 0-未分 1-已分
+     */
+    public Integer getStatus() {
+        return status;
+    }
+
+    /**
+     * 分账状态 0-未分 1-已分
+     */
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    /**
+     * 
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * 
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 
+     */
+    public Integer getHasRefund() {
+        return hasRefund;
+    }
+
+    /**
+     * 
+     */
+    public void setHasRefund(Integer hasRefund) {
+        this.hasRefund = hasRefund;
+    }
+
+    /**
+     * 
+     */
+    public Integer getRefundTotal() {
+        return refundTotal;
+    }
+
+    /**
+     * 
+     */
+    public void setRefundTotal(Integer refundTotal) {
+        this.refundTotal = refundTotal;
+    }
+
+    /**
+     * 
+     */
+    public Integer getRefundRetail() {
+        return refundRetail;
+    }
+
+    /**
+     * 
+     */
+    public void setRefundRetail(Integer refundRetail) {
+        this.refundRetail = refundRetail;
+    }
+
+    /**
+     * 
+     */
+    public Integer getRefundChannel() {
+        return refundChannel;
+    }
+
+    /**
+     * 
+     */
+    public void setRefundChannel(Integer refundChannel) {
+        this.refundChannel = refundChannel;
+    }
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        AskaSplitrecord other = (AskaSplitrecord) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getPayId() == null ? other.getPayId() == null : this.getPayId().equals(other.getPayId()))
+            && (this.getSpiltOrderId() == null ? other.getSpiltOrderId() == null : this.getSpiltOrderId().equals(other.getSpiltOrderId()))
+            && (this.getPayAmount() == null ? other.getPayAmount() == null : this.getPayAmount().equals(other.getPayAmount()))
+            && (this.getRetailId() == null ? other.getRetailId() == null : this.getRetailId().equals(other.getRetailId()))
+            && (this.getRetailName() == null ? other.getRetailName() == null : this.getRetailName().equals(other.getRetailName()))
+            && (this.getRetailAccount() == null ? other.getRetailAccount() == null : this.getRetailAccount().equals(other.getRetailAccount()))
+            && (this.getRetailAmount() == null ? other.getRetailAmount() == null : this.getRetailAmount().equals(other.getRetailAmount()))
+            && (this.getRetailRealtimeAmount() == null ? other.getRetailRealtimeAmount() == null : this.getRetailRealtimeAmount().equals(other.getRetailRealtimeAmount()))
+            && (this.getRetailAccountAmount() == null ? other.getRetailAccountAmount() == null : this.getRetailAccountAmount().equals(other.getRetailAccountAmount()))
+            && (this.getRetailSplitrule() == null ? other.getRetailSplitrule() == null : this.getRetailSplitrule().equals(other.getRetailSplitrule()))
+            && (this.getChannelId() == null ? other.getChannelId() == null : this.getChannelId().equals(other.getChannelId()))
+            && (this.getChannelName() == null ? other.getChannelName() == null : this.getChannelName().equals(other.getChannelName()))
+            && (this.getChannelAccount() == null ? other.getChannelAccount() == null : this.getChannelAccount().equals(other.getChannelAccount()))
+            && (this.getChannelAmount() == null ? other.getChannelAmount() == null : this.getChannelAmount().equals(other.getChannelAmount()))
+            && (this.getChannelRealtimeAmount() == null ? other.getChannelRealtimeAmount() == null : this.getChannelRealtimeAmount().equals(other.getChannelRealtimeAmount()))
+            && (this.getChannelAccountAmount() == null ? other.getChannelAccountAmount() == null : this.getChannelAccountAmount().equals(other.getChannelAccountAmount()))
+            && (this.getChannelSplitRule() == null ? other.getChannelSplitRule() == null : this.getChannelSplitRule().equals(other.getChannelSplitRule()))
+            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
+            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
+            && (this.getHasRefund() == null ? other.getHasRefund() == null : this.getHasRefund().equals(other.getHasRefund()))
+            && (this.getRefundTotal() == null ? other.getRefundTotal() == null : this.getRefundTotal().equals(other.getRefundTotal()))
+            && (this.getRefundRetail() == null ? other.getRefundRetail() == null : this.getRefundRetail().equals(other.getRefundRetail()))
+            && (this.getRefundChannel() == null ? other.getRefundChannel() == null : this.getRefundChannel().equals(other.getRefundChannel()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getPayId() == null) ? 0 : getPayId().hashCode());
+        result = prime * result + ((getSpiltOrderId() == null) ? 0 : getSpiltOrderId().hashCode());
+        result = prime * result + ((getPayAmount() == null) ? 0 : getPayAmount().hashCode());
+        result = prime * result + ((getRetailId() == null) ? 0 : getRetailId().hashCode());
+        result = prime * result + ((getRetailName() == null) ? 0 : getRetailName().hashCode());
+        result = prime * result + ((getRetailAccount() == null) ? 0 : getRetailAccount().hashCode());
+        result = prime * result + ((getRetailAmount() == null) ? 0 : getRetailAmount().hashCode());
+        result = prime * result + ((getRetailRealtimeAmount() == null) ? 0 : getRetailRealtimeAmount().hashCode());
+        result = prime * result + ((getRetailAccountAmount() == null) ? 0 : getRetailAccountAmount().hashCode());
+        result = prime * result + ((getRetailSplitrule() == null) ? 0 : getRetailSplitrule().hashCode());
+        result = prime * result + ((getChannelId() == null) ? 0 : getChannelId().hashCode());
+        result = prime * result + ((getChannelName() == null) ? 0 : getChannelName().hashCode());
+        result = prime * result + ((getChannelAccount() == null) ? 0 : getChannelAccount().hashCode());
+        result = prime * result + ((getChannelAmount() == null) ? 0 : getChannelAmount().hashCode());
+        result = prime * result + ((getChannelRealtimeAmount() == null) ? 0 : getChannelRealtimeAmount().hashCode());
+        result = prime * result + ((getChannelAccountAmount() == null) ? 0 : getChannelAccountAmount().hashCode());
+        result = prime * result + ((getChannelSplitRule() == null) ? 0 : getChannelSplitRule().hashCode());
+        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
+        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+        result = prime * result + ((getHasRefund() == null) ? 0 : getHasRefund().hashCode());
+        result = prime * result + ((getRefundTotal() == null) ? 0 : getRefundTotal().hashCode());
+        result = prime * result + ((getRefundRetail() == null) ? 0 : getRefundRetail().hashCode());
+        result = prime * result + ((getRefundChannel() == null) ? 0 : getRefundChannel().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", payId=").append(payId);
+        sb.append(", spiltOrderId=").append(spiltOrderId);
+        sb.append(", payAmount=").append(payAmount);
+        sb.append(", retailId=").append(retailId);
+        sb.append(", retailName=").append(retailName);
+        sb.append(", retailAccount=").append(retailAccount);
+        sb.append(", retailAmount=").append(retailAmount);
+        sb.append(", retailRealtimeAmount=").append(retailRealtimeAmount);
+        sb.append(", retailAccountAmount=").append(retailAccountAmount);
+        sb.append(", retailSplitrule=").append(retailSplitrule);
+        sb.append(", channelId=").append(channelId);
+        sb.append(", channelName=").append(channelName);
+        sb.append(", channelAccount=").append(channelAccount);
+        sb.append(", channelAmount=").append(channelAmount);
+        sb.append(", channelRealtimeAmount=").append(channelRealtimeAmount);
+        sb.append(", channelAccountAmount=").append(channelAccountAmount);
+        sb.append(", channelSplitRule=").append(channelSplitRule);
+        sb.append(", status=").append(status);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", hasRefund=").append(hasRefund);
+        sb.append(", refundTotal=").append(refundTotal);
+        sb.append(", refundRetail=").append(refundRetail);
+        sb.append(", refundChannel=").append(refundChannel);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 311 - 63
dao/src/main/java/com/mofangchuxing/aska/dao/domain/PayRequest.java

@@ -42,7 +42,7 @@ public class PayRequest implements Serializable {
     /**
      * 
      */
-    private BigDecimal amount;
+    private Integer amount;
 
     /**
      * 商品id
@@ -54,6 +54,9 @@ public class PayRequest implements Serializable {
      */
     private Integer itemType;
 
+    /**
+     * 
+     */
     private String itemName;
 
     /**
@@ -61,82 +64,89 @@ public class PayRequest implements Serializable {
      */
     private String itemChannel;
 
+    private Integer channelId;
+
     /**
-     * 支付渠道 1-微信 2-支付宝
+     * 
      */
-    private Integer payChannel;
-
-    private Integer payStatus;
+    private String retailId;
 
-    private String responseBody;
+    /**
+     * 
+     */
+    private String retailName;
 
+    /**
+     * 
+     */
     private String useCouponId;
 
-    private BigDecimal payAmount;
-
-    private Date payTime;
-
-    private String callbackUrl;
-
     /**
-     * 
+     * 支付渠道 1-微信 2-支付宝
      */
-    private Date createTime;
+    private Integer payChannel;
 
     /**
      * 
      */
-    private Date modifiedTime;
-
-    private static final long serialVersionUID = 1L;
+    private String responseBody;
 
-    public Integer getPayStatus() {
-        return payStatus;
-    }
+    /**
+     * 0-未支付 1-已支付
+     */
+    private Integer payStatus;
 
-    public void setPayStatus(Integer payStatus) {
-        this.payStatus = payStatus;
-    }
+    /**
+     * 支付时间
+     */
+    private Date payTime;
 
-    public String getResponseBody() {
-        return responseBody;
-    }
+    /**
+     * 
+     */
+    private String transactionId;
 
-    public void setResponseBody(String responseBody) {
-        this.responseBody = responseBody;
-    }
+    /**
+     * 支付金额
+     */
+    private Integer payAmount;
 
-    public String getUseCouponId() {
-        return useCouponId;
-    }
+    /**
+     * 是否有退款
+     */
+    private Integer hasRefund;
 
-    public void setUseCouponId(String useCouponId) {
-        this.useCouponId = useCouponId;
-    }
+    /**
+     * 如果有退款,则退款总额
+     */
+    private Integer refundTotal;
 
-    public BigDecimal getPayAmount() {
-        return payAmount;
-    }
+    /**
+     * 
+     */
+    private String clientType;
 
-    public void setPayAmount(BigDecimal payAmount) {
-        this.payAmount = payAmount;
-    }
+    /**
+     * 
+     */
+    private Integer cansplit;
 
-    public Date getPayTime() {
-        return payTime;
-    }
+    /**
+     * 
+     */
+    private String callbackUrl;
 
-    public void setPayTime(Date payTime) {
-        this.payTime = payTime;
-    }
+    /**
+     * 
+     */
+    private Date createTime;
 
-    public String getCallbackUrl() {
-        return callbackUrl;
-    }
+    /**
+     * 
+     */
+    private Date modifiedTime;
 
-    public void setCallbackUrl(String callbackUrl) {
-        this.callbackUrl = callbackUrl;
-    }
+    private static final long serialVersionUID = 1L;
 
     /**
      * 
@@ -225,14 +235,14 @@ public class PayRequest implements Serializable {
     /**
      * 
      */
-    public BigDecimal getAmount() {
+    public Integer getAmount() {
         return amount;
     }
 
     /**
      * 
      */
-    public void setAmount(BigDecimal amount) {
+    public void setAmount(Integer amount) {
         this.amount = amount;
     }
 
@@ -264,6 +274,20 @@ public class PayRequest implements Serializable {
         this.itemType = itemType;
     }
 
+    /**
+     * 
+     */
+    public String getItemName() {
+        return itemName;
+    }
+
+    /**
+     * 
+     */
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
     /**
      * 
      */
@@ -278,6 +302,56 @@ public class PayRequest implements Serializable {
         this.itemChannel = itemChannel;
     }
 
+    public Integer getChannelId() {
+        return channelId;
+    }
+
+    public void setChannelId(Integer channelId) {
+        this.channelId = channelId;
+    }
+
+    /**
+     * 
+     */
+    public String getRetailId() {
+        return retailId;
+    }
+
+    /**
+     * 
+     */
+    public void setRetailId(String retailId) {
+        this.retailId = retailId;
+    }
+
+    /**
+     * 
+     */
+    public String getRetailName() {
+        return retailName;
+    }
+
+    /**
+     * 
+     */
+    public void setRetailName(String retailName) {
+        this.retailName = retailName;
+    }
+
+    /**
+     * 
+     */
+    public String getUseCouponId() {
+        return useCouponId;
+    }
+
+    /**
+     * 
+     */
+    public void setUseCouponId(String useCouponId) {
+        this.useCouponId = useCouponId;
+    }
+
     /**
      * 支付渠道 1-微信 2-支付宝
      */
@@ -292,6 +366,146 @@ public class PayRequest implements Serializable {
         this.payChannel = payChannel;
     }
 
+    /**
+     * 
+     */
+    public String getResponseBody() {
+        return responseBody;
+    }
+
+    /**
+     * 
+     */
+    public void setResponseBody(String responseBody) {
+        this.responseBody = responseBody;
+    }
+
+    /**
+     * 0-未支付 1-已支付
+     */
+    public Integer getPayStatus() {
+        return payStatus;
+    }
+
+    /**
+     * 0-未支付 1-已支付
+     */
+    public void setPayStatus(Integer payStatus) {
+        this.payStatus = payStatus;
+    }
+
+    /**
+     * 支付时间
+     */
+    public Date getPayTime() {
+        return payTime;
+    }
+
+    /**
+     * 支付时间
+     */
+    public void setPayTime(Date payTime) {
+        this.payTime = payTime;
+    }
+
+    /**
+     * 
+     */
+    public String getTransactionId() {
+        return transactionId;
+    }
+
+    /**
+     * 
+     */
+    public void setTransactionId(String transactionId) {
+        this.transactionId = transactionId;
+    }
+
+    /**
+     * 支付金额
+     */
+    public Integer getPayAmount() {
+        return payAmount;
+    }
+
+    /**
+     * 支付金额
+     */
+    public void setPayAmount(Integer payAmount) {
+        this.payAmount = payAmount;
+    }
+
+    /**
+     * 是否有退款
+     */
+    public Integer getHasRefund() {
+        return hasRefund;
+    }
+
+    /**
+     * 是否有退款
+     */
+    public void setHasRefund(Integer hasRefund) {
+        this.hasRefund = hasRefund;
+    }
+
+    /**
+     * 如果有退款,则退款总额
+     */
+    public Integer getRefundTotal() {
+        return refundTotal;
+    }
+
+    /**
+     * 如果有退款,则退款总额
+     */
+    public void setRefundTotal(Integer refundTotal) {
+        this.refundTotal = refundTotal;
+    }
+
+    /**
+     * 
+     */
+    public String getClientType() {
+        return clientType;
+    }
+
+    /**
+     * 
+     */
+    public void setClientType(String clientType) {
+        this.clientType = clientType;
+    }
+
+    /**
+     * 
+     */
+    public Integer getCansplit() {
+        return cansplit;
+    }
+
+    /**
+     * 
+     */
+    public void setCansplit(Integer cansplit) {
+        this.cansplit = cansplit;
+    }
+
+    /**
+     * 
+     */
+    public String getCallbackUrl() {
+        return callbackUrl;
+    }
+
+    /**
+     * 
+     */
+    public void setCallbackUrl(String callbackUrl) {
+        this.callbackUrl = callbackUrl;
+    }
+
     /**
      * 
      */
@@ -341,20 +555,26 @@ public class PayRequest implements Serializable {
             && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
             && (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
             && (this.getItemType() == null ? other.getItemType() == null : this.getItemType().equals(other.getItemType()))
+            && (this.getItemName() == null ? other.getItemName() == null : this.getItemName().equals(other.getItemName()))
             && (this.getItemChannel() == null ? other.getItemChannel() == null : this.getItemChannel().equals(other.getItemChannel()))
+            && (this.getRetailId() == null ? other.getRetailId() == null : this.getRetailId().equals(other.getRetailId()))
+            && (this.getRetailName() == null ? other.getRetailName() == null : this.getRetailName().equals(other.getRetailName()))
+            && (this.getUseCouponId() == null ? other.getUseCouponId() == null : this.getUseCouponId().equals(other.getUseCouponId()))
             && (this.getPayChannel() == null ? other.getPayChannel() == null : this.getPayChannel().equals(other.getPayChannel()))
+            && (this.getResponseBody() == null ? other.getResponseBody() == null : this.getResponseBody().equals(other.getResponseBody()))
+            && (this.getPayStatus() == null ? other.getPayStatus() == null : this.getPayStatus().equals(other.getPayStatus()))
+            && (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime()))
+            && (this.getTransactionId() == null ? other.getTransactionId() == null : this.getTransactionId().equals(other.getTransactionId()))
+            && (this.getPayAmount() == null ? other.getPayAmount() == null : this.getPayAmount().equals(other.getPayAmount()))
+            && (this.getHasRefund() == null ? other.getHasRefund() == null : this.getHasRefund().equals(other.getHasRefund()))
+            && (this.getRefundTotal() == null ? other.getRefundTotal() == null : this.getRefundTotal().equals(other.getRefundTotal()))
+            && (this.getClientType() == null ? other.getClientType() == null : this.getClientType().equals(other.getClientType()))
+            && (this.getCansplit() == null ? other.getCansplit() == null : this.getCansplit().equals(other.getCansplit()))
+            && (this.getCallbackUrl() == null ? other.getCallbackUrl() == null : this.getCallbackUrl().equals(other.getCallbackUrl()))
             && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
             && (this.getModifiedTime() == null ? other.getModifiedTime() == null : this.getModifiedTime().equals(other.getModifiedTime()));
     }
 
-    public String getItemName() {
-        return itemName;
-    }
-
-    public void setItemName(String itemName) {
-        this.itemName = itemName;
-    }
-
     @Override
     public int hashCode() {
         final int prime = 31;
@@ -368,8 +588,22 @@ public class PayRequest implements Serializable {
         result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
         result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
         result = prime * result + ((getItemType() == null) ? 0 : getItemType().hashCode());
+        result = prime * result + ((getItemName() == null) ? 0 : getItemName().hashCode());
         result = prime * result + ((getItemChannel() == null) ? 0 : getItemChannel().hashCode());
+        result = prime * result + ((getRetailId() == null) ? 0 : getRetailId().hashCode());
+        result = prime * result + ((getRetailName() == null) ? 0 : getRetailName().hashCode());
+        result = prime * result + ((getUseCouponId() == null) ? 0 : getUseCouponId().hashCode());
         result = prime * result + ((getPayChannel() == null) ? 0 : getPayChannel().hashCode());
+        result = prime * result + ((getResponseBody() == null) ? 0 : getResponseBody().hashCode());
+        result = prime * result + ((getPayStatus() == null) ? 0 : getPayStatus().hashCode());
+        result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode());
+        result = prime * result + ((getTransactionId() == null) ? 0 : getTransactionId().hashCode());
+        result = prime * result + ((getPayAmount() == null) ? 0 : getPayAmount().hashCode());
+        result = prime * result + ((getHasRefund() == null) ? 0 : getHasRefund().hashCode());
+        result = prime * result + ((getRefundTotal() == null) ? 0 : getRefundTotal().hashCode());
+        result = prime * result + ((getClientType() == null) ? 0 : getClientType().hashCode());
+        result = prime * result + ((getCansplit() == null) ? 0 : getCansplit().hashCode());
+        result = prime * result + ((getCallbackUrl() == null) ? 0 : getCallbackUrl().hashCode());
         result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
         result = prime * result + ((getModifiedTime() == null) ? 0 : getModifiedTime().hashCode());
         return result;
@@ -390,8 +624,22 @@ public class PayRequest implements Serializable {
         sb.append(", amount=").append(amount);
         sb.append(", itemId=").append(itemId);
         sb.append(", itemType=").append(itemType);
+        sb.append(", itemName=").append(itemName);
         sb.append(", itemChannel=").append(itemChannel);
+        sb.append(", retailId=").append(retailId);
+        sb.append(", retailName=").append(retailName);
+        sb.append(", useCouponId=").append(useCouponId);
         sb.append(", payChannel=").append(payChannel);
+        sb.append(", responseBody=").append(responseBody);
+        sb.append(", payStatus=").append(payStatus);
+        sb.append(", payTime=").append(payTime);
+        sb.append(", transactionId=").append(transactionId);
+        sb.append(", payAmount=").append(payAmount);
+        sb.append(", hasRefund=").append(hasRefund);
+        sb.append(", refundTotal=").append(refundTotal);
+        sb.append(", clientType=").append(clientType);
+        sb.append(", cansplit=").append(cansplit);
+        sb.append(", callbackUrl=").append(callbackUrl);
         sb.append(", createTime=").append(createTime);
         sb.append(", modifiedTime=").append(modifiedTime);
         sb.append(", serialVersionUID=").append(serialVersionUID);

+ 23 - 12
dao/src/main/java/com/mofangchuxing/aska/dao/domain/RefundOrder.java

@@ -1,7 +1,6 @@
 package com.mofangchuxing.aska.dao.domain;
 
 import java.io.Serializable;
-import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -27,8 +26,11 @@ public class RefundOrder implements Serializable {
     /**
      * 
      */
-    private BigDecimal refundAmount;
+    private Integer refundAmount;
 
+    /**
+     * 退款原因
+     */
     private String message;
 
     /**
@@ -43,14 +45,6 @@ public class RefundOrder implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
     /**
      * 
      */
@@ -96,17 +90,31 @@ public class RefundOrder implements Serializable {
     /**
      * 
      */
-    public BigDecimal getRefundAmount() {
+    public Integer getRefundAmount() {
         return refundAmount;
     }
 
     /**
      * 
      */
-    public void setRefundAmount(BigDecimal refundAmount) {
+    public void setRefundAmount(Integer refundAmount) {
         this.refundAmount = refundAmount;
     }
 
+    /**
+     * 退款原因
+     */
+    public String getMessage() {
+        return message;
+    }
+
+    /**
+     * 退款原因
+     */
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
     /**
      * 
      */
@@ -151,6 +159,7 @@ public class RefundOrder implements Serializable {
             && (this.getOrderSn() == null ? other.getOrderSn() == null : this.getOrderSn().equals(other.getOrderSn()))
             && (this.getRefundOrderSn() == null ? other.getRefundOrderSn() == null : this.getRefundOrderSn().equals(other.getRefundOrderSn()))
             && (this.getRefundAmount() == null ? other.getRefundAmount() == null : this.getRefundAmount().equals(other.getRefundAmount()))
+            && (this.getMessage() == null ? other.getMessage() == null : this.getMessage().equals(other.getMessage()))
             && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
             && (this.getModifiedTime() == null ? other.getModifiedTime() == null : this.getModifiedTime().equals(other.getModifiedTime()));
     }
@@ -163,6 +172,7 @@ public class RefundOrder implements Serializable {
         result = prime * result + ((getOrderSn() == null) ? 0 : getOrderSn().hashCode());
         result = prime * result + ((getRefundOrderSn() == null) ? 0 : getRefundOrderSn().hashCode());
         result = prime * result + ((getRefundAmount() == null) ? 0 : getRefundAmount().hashCode());
+        result = prime * result + ((getMessage() == null) ? 0 : getMessage().hashCode());
         result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
         result = prime * result + ((getModifiedTime() == null) ? 0 : getModifiedTime().hashCode());
         return result;
@@ -178,6 +188,7 @@ public class RefundOrder implements Serializable {
         sb.append(", orderSn=").append(orderSn);
         sb.append(", refundOrderSn=").append(refundOrderSn);
         sb.append(", refundAmount=").append(refundAmount);
+        sb.append(", message=").append(message);
         sb.append(", createTime=").append(createTime);
         sb.append(", modifiedTime=").append(modifiedTime);
         sb.append(", serialVersionUID=").append(serialVersionUID);

+ 27 - 0
dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaChannelcouponnosMapper.java

@@ -0,0 +1,27 @@
+package com.mofangchuxing.aska.dao.mapper;
+
+import com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos;
+import org.apache.ibatis.annotations.Param;
+
+/**
+* @author syl
+* @description 针对表【aska_channelCouponNos(抵扣券)】的数据库操作Mapper
+* @createDate 2023-08-09 14:02:53
+* @Entity com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos
+*/
+public interface AskaChannelcouponnosMapper {
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(AskaChannelcouponnos record);
+
+    int insertSelective(AskaChannelcouponnos record);
+
+    AskaChannelcouponnos selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(AskaChannelcouponnos record);
+
+    int updateByPrimaryKey(AskaChannelcouponnos record);
+
+    AskaChannelcouponnos searchAllByCouponNo(@Param("couponNo") String couponNo);
+}

+ 1 - 1
dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaChannelsMapper.java

@@ -2,6 +2,7 @@ package com.mofangchuxing.aska.dao.mapper;
 
 import com.mofangchuxing.aska.dao.domain.AskaChannels;
 import com.mofangchuxing.aska.domain.dto.ChannelDto;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -26,5 +27,4 @@ public interface AskaChannelsMapper {
     int updateByPrimaryKey(AskaChannels record);
 
     List<AskaChannels> getAllChannels(ChannelDto channelDto);
-
 }

+ 5 - 3
dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaRetailsMapper.java

@@ -2,14 +2,14 @@ package com.mofangchuxing.aska.dao.mapper;
 
 import com.mofangchuxing.aska.dao.domain.AskaRetails;
 import com.mofangchuxing.aska.domain.dto.RetailDto;
-import com.mofangchuxing.aska.domain.utils.PageUtils;
+import com.mofangchuxing.aska.domain.vo.AskaRetailsVo;
 
 import java.util.List;
 
 /**
 * @author syl
 * @description 针对表【aska_retails】的数据库操作Mapper
-* @createDate 2023-08-01 14:45:09
+* @createDate 2023-08-09 16:19:01
 * @Entity com.mofangchuxing.aska.dao.domain.AskaRetails
 */
 public interface AskaRetailsMapper {
@@ -26,5 +26,7 @@ public interface AskaRetailsMapper {
 
     int updateByPrimaryKey(AskaRetails record);
 
-    List<AskaRetails> listAllRetails(RetailDto retailDto);
+    List<AskaRetailsVo> listAllRetails(RetailDto retailDto);
+
+    List<AskaRetailsVo> listAllRetailsNoLimit();
 }

+ 27 - 0
dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaSplitrecordMapper.java

@@ -0,0 +1,27 @@
+package com.mofangchuxing.aska.dao.mapper;
+
+import com.mofangchuxing.aska.dao.domain.AskaSplitrecord;
+import org.apache.ibatis.annotations.Param;
+
+/**
+* @author syl
+* @description 针对表【aska_splitRecord(分账记录)】的数据库操作Mapper
+* @createDate 2023-08-09 14:30:54
+* @Entity com.mofangchuxing.aska.dao.domain.AskaSplitrecord
+*/
+public interface AskaSplitrecordMapper {
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(AskaSplitrecord record);
+
+    int insertSelective(AskaSplitrecord record);
+
+    AskaSplitrecord selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(AskaSplitrecord record);
+
+    int updateByPrimaryKey(AskaSplitrecord record);
+
+    AskaSplitrecord selectAllByPayId(@Param("payId") Integer payId);
+}

+ 4 - 3
dao/src/main/java/com/mofangchuxing/aska/dao/mapper/PayRequestMapper.java

@@ -8,8 +8,8 @@ import java.util.List;
 /**
 * @author syl
 * @description 针对表【pay_request】的数据库操作Mapper
-* @createDate 2023-03-20 15:28:56
-* @Entity generator.domain.PayRequest
+* @createDate 2023-08-08 16:59:59
+* @Entity com.mofangchuxing.aska.dao.domain.PayRequest
 */
 public interface PayRequestMapper {
 
@@ -29,7 +29,8 @@ public interface PayRequestMapper {
 
     PayRequest selectPaySuccessByOrderId(String orderId);
 
-    List<PayRequest> selectByUser(@Param("phoneNo")String mobile, @Param("payStatus") Integer payStatus, @Param("itemType")Integer itemType);
+    List<PayRequest> selectByUser(@Param("phoneNo") String mobile, @Param("payStatus") Integer payStatus, @Param("itemType")Integer itemType);
 
     List<PayRequest> selectByOrderId(@Param("phoneNo")String mobile, @Param("orderId") String orderId);
+
 }

+ 1 - 1
dao/src/main/java/com/mofangchuxing/aska/dao/mapper/RefundOrderMapper.java

@@ -5,7 +5,7 @@ import com.mofangchuxing.aska.dao.domain.RefundOrder;
 /**
 * @author syl
 * @description 针对表【refund_order(退款订单)】的数据库操作Mapper
-* @createDate 2023-03-23 17:36:40
+* @createDate 2023-08-11 15:53:57
 * @Entity com.mofangchuxing.aska.dao.domain.RefundOrder
 */
 public interface RefundOrderMapper {

+ 112 - 0
dao/src/main/resources/mapper/AskaChannelcouponnosMapper.xml

@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.mofangchuxing.aska.dao.mapper.AskaChannelcouponnosMapper">
+
+    <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="channelId" column="channelId" jdbcType="INTEGER"/>
+            <result property="channelNo" column="channelNo" jdbcType="CHAR"/>
+            <result property="couponNo" column="couponNo" jdbcType="CHAR"/>
+            <result property="status" column="status" jdbcType="CHAR"/>
+            <result property="outDate" column="outDate" jdbcType="DATE"/>
+            <result property="value" column="value" jdbcType="INTEGER"/>
+            <result property="price" column="price" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,channelId,channelNo,
+        couponNo,status,outDate,
+        value,price
+    </sql>
+
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from aska_channelCouponNos
+        where  id = #{id,jdbcType=INTEGER} 
+    </select>
+    <select id="searchAllByCouponNo" resultType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
+        select
+        <include refid="Base_Column_List" />
+        from aska_channelCouponNos
+        where couponNo = #{couponNo} limit 1
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        delete from aska_channelCouponNos
+        where  id = #{id,jdbcType=INTEGER} 
+    </delete>
+    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos" useGeneratedKeys="true">
+        insert into aska_channelCouponNos
+        ( id,channelId,channelNo
+        ,couponNo,status,outDate
+        ,value,price)
+        values (#{id,jdbcType=INTEGER},#{channelId,jdbcType=INTEGER},#{channelNo,jdbcType=CHAR}
+        ,#{couponNo,jdbcType=CHAR},#{status,jdbcType=CHAR},#{outDate,jdbcType=DATE}
+        ,#{value,jdbcType=INTEGER},#{price,jdbcType=INTEGER})
+    </insert>
+    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos" useGeneratedKeys="true">
+        insert into aska_channelCouponNos
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                <if test="id != null">id,</if>
+                <if test="channelId != null">channelId,</if>
+                <if test="channelNo != null">channelNo,</if>
+                <if test="couponNo != null">couponNo,</if>
+                <if test="status != null">status,</if>
+                <if test="outDate != null">outDate,</if>
+                <if test="value != null">value,</if>
+                <if test="price != null">price,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                <if test="id != null">#{id,jdbcType=INTEGER},</if>
+                <if test="channelId != null">#{channelId,jdbcType=INTEGER},</if>
+                <if test="channelNo != null">#{channelNo,jdbcType=CHAR},</if>
+                <if test="couponNo != null">#{couponNo,jdbcType=CHAR},</if>
+                <if test="status != null">#{status,jdbcType=CHAR},</if>
+                <if test="outDate != null">#{outDate,jdbcType=DATE},</if>
+                <if test="value != null">#{value,jdbcType=INTEGER},</if>
+                <if test="price != null">#{price,jdbcType=INTEGER},</if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
+        update aska_channelCouponNos
+        <set>
+                <if test="channelId != null">
+                    channelId = #{channelId,jdbcType=INTEGER},
+                </if>
+                <if test="channelNo != null">
+                    channelNo = #{channelNo,jdbcType=CHAR},
+                </if>
+                <if test="couponNo != null">
+                    couponNo = #{couponNo,jdbcType=CHAR},
+                </if>
+                <if test="status != null">
+                    status = #{status,jdbcType=CHAR},
+                </if>
+                <if test="outDate != null">
+                    outDate = #{outDate,jdbcType=DATE},
+                </if>
+                <if test="value != null">
+                    value = #{value,jdbcType=INTEGER},
+                </if>
+                <if test="price != null">
+                    price = #{price,jdbcType=INTEGER},
+                </if>
+        </set>
+        where   id = #{id,jdbcType=INTEGER} 
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
+        update aska_channelCouponNos
+        set 
+            channelId =  #{channelId,jdbcType=INTEGER},
+            channelNo =  #{channelNo,jdbcType=CHAR},
+            couponNo =  #{couponNo,jdbcType=CHAR},
+            status =  #{status,jdbcType=CHAR},
+            outDate =  #{outDate,jdbcType=DATE},
+            value =  #{value,jdbcType=INTEGER},
+            price =  #{price,jdbcType=INTEGER}
+        where   id = #{id,jdbcType=INTEGER} 
+    </update>
+</mapper>

+ 94 - 36
dao/src/main/resources/mapper/AskaChannelsMapper.xml

@@ -12,21 +12,30 @@
             <result property="phone" column="phone" jdbcType="CHAR"/>
             <result property="note" column="note" jdbcType="VARCHAR"/>
             <result property="account" column="account" jdbcType="VARCHAR"/>
-            <result property="accountname" column="accountName" jdbcType="VARCHAR"/>
+            <result property="accountName" column="accountName" jdbcType="VARCHAR"/>
+            <result property="accountType" column="accountType" jdbcType="CHAR"/>
+            <result property="relation" column="relation" jdbcType="CHAR"/>
             <result property="apiv3" column="apiv3" jdbcType="VARCHAR"/>
-            <result property="certpath" column="certPath" jdbcType="VARCHAR"/>
+            <result property="certPath" column="certPath" jdbcType="VARCHAR"/>
             <result property="tripartite" column="tripartite" jdbcType="CHAR"/>
             <result property="tripvalue" column="tripvalue" jdbcType="INTEGER"/>
-            <result property="realtimesplit" column="realtimeSplit" jdbcType="INTEGER"/>
+            <result property="realtimeSplit" column="realtimeSplit" jdbcType="INTEGER"/>
             <result property="status" column="status" jdbcType="CHAR"/>
+            <result property="totalIncome" column="totalIncome" jdbcType="INTEGER"/>
+            <result property="totalSplit" column="totalSplit" jdbcType="INTEGER"/>
+            <result property="totalCashOut" column="totalCashOut" jdbcType="INTEGER"/>
+            <result property="totalRefund" column="totalRefund" jdbcType="INTEGER"/>
+            <result property="balance" column="balance" jdbcType="INTEGER"/>
     </resultMap>
 
     <sql id="Base_Column_List">
         id,name,prefix,
         ownerId,phone,note,
-        account,accountName,apiv3,
-        certPath,tripartite,tripvalue,
-        realtimeSplit,status
+        account,accountName,accountType,
+        relation,apiv3,certPath,
+        tripartite,tripvalue,realtimeSplit,
+        status,totalIncome,totalSplit,
+        totalCashOut,totalRefund,balance
     </sql>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -35,13 +44,14 @@
         from aska_channels
         where  id = #{id,jdbcType=INTEGER} 
     </select>
+
     <select id="getAllChannels" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List" />
         from aska_channels
         where 1=1 <if test="channelName != null">
-            and name = #{channelName,jdbcType=CHAR},
-        </if>
+        and name = #{channelName,jdbcType=CHAR},
+    </if>
     </select>
 
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
@@ -52,14 +62,20 @@
         insert into aska_channels
         ( id,name,prefix
         ,ownerId,phone,note
-        ,account,accountName,apiv3
-        ,certPath,tripartite,tripvalue
-        ,realtimeSplit,status)
+        ,account,accountName,accountType
+        ,relation,apiv3,certPath
+        ,tripartite,tripvalue,realtimeSplit
+        ,status,totalIncome,totalSplit
+        ,totalCashOut,totalRefund,balance
+        )
         values (#{id,jdbcType=INTEGER},#{name,jdbcType=CHAR},#{prefix,jdbcType=CHAR}
-        ,#{ownerid,jdbcType=INTEGER},#{phone,jdbcType=CHAR},#{note,jdbcType=VARCHAR}
-        ,#{account,jdbcType=VARCHAR},#{accountname,jdbcType=VARCHAR},#{apiv3,jdbcType=VARCHAR}
-        ,#{certpath,jdbcType=VARCHAR},#{tripartite,jdbcType=CHAR},#{tripvalue,jdbcType=INTEGER}
-        ,#{realtimesplit,jdbcType=INTEGER},#{status,jdbcType=CHAR})
+        ,#{ownerId,jdbcType=INTEGER},#{phone,jdbcType=CHAR},#{note,jdbcType=VARCHAR}
+        ,#{account,jdbcType=VARCHAR},#{accountName,jdbcType=VARCHAR},#{accountType,jdbcType=CHAR}
+        ,#{relation,jdbcType=CHAR},#{apiv3,jdbcType=VARCHAR},#{certPath,jdbcType=VARCHAR}
+        ,#{tripartite,jdbcType=CHAR},#{tripvalue,jdbcType=INTEGER},#{realtimeSplit,jdbcType=INTEGER}
+        ,#{status,jdbcType=CHAR},#{totalIncome,jdbcType=INTEGER},#{totalSplit,jdbcType=INTEGER}
+        ,#{totalCashOut,jdbcType=INTEGER},#{totalRefund,jdbcType=INTEGER},#{balance,jdbcType=INTEGER}
+        )
     </insert>
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannels" useGeneratedKeys="true">
         insert into aska_channels
@@ -67,33 +83,47 @@
                 <if test="id != null">id,</if>
                 <if test="name != null">name,</if>
                 <if test="prefix != null">prefix,</if>
-                <if test="ownerid != null">ownerId,</if>
+                <if test="ownerId != null">ownerId,</if>
                 <if test="phone != null">phone,</if>
                 <if test="note != null">note,</if>
                 <if test="account != null">account,</if>
-                <if test="accountname != null">accountName,</if>
+                <if test="accountName != null">accountName,</if>
+                <if test="accountType != null">accountType,</if>
+                <if test="relation != null">relation,</if>
                 <if test="apiv3 != null">apiv3,</if>
-                <if test="certpath != null">certPath,</if>
+                <if test="certPath != null">certPath,</if>
                 <if test="tripartite != null">tripartite,</if>
                 <if test="tripvalue != null">tripvalue,</if>
-                <if test="realtimesplit != null">realtimeSplit,</if>
+                <if test="realtimeSplit != null">realtimeSplit,</if>
                 <if test="status != null">status,</if>
+                <if test="totalIncome != null">totalIncome,</if>
+                <if test="totalSplit != null">totalSplit,</if>
+                <if test="totalCashOut != null">totalCashOut,</if>
+                <if test="totalRefund != null">totalRefund,</if>
+                <if test="balance != null">balance,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
                 <if test="id != null">#{id,jdbcType=INTEGER},</if>
                 <if test="name != null">#{name,jdbcType=CHAR},</if>
                 <if test="prefix != null">#{prefix,jdbcType=CHAR},</if>
-                <if test="ownerid != null">#{ownerid,jdbcType=INTEGER},</if>
+                <if test="ownerId != null">#{ownerId,jdbcType=INTEGER},</if>
                 <if test="phone != null">#{phone,jdbcType=CHAR},</if>
                 <if test="note != null">#{note,jdbcType=VARCHAR},</if>
                 <if test="account != null">#{account,jdbcType=VARCHAR},</if>
-                <if test="accountname != null">#{accountname,jdbcType=VARCHAR},</if>
+                <if test="accountName != null">#{accountName,jdbcType=VARCHAR},</if>
+                <if test="accountType != null">#{accountType,jdbcType=CHAR},</if>
+                <if test="relation != null">#{relation,jdbcType=CHAR},</if>
                 <if test="apiv3 != null">#{apiv3,jdbcType=VARCHAR},</if>
-                <if test="certpath != null">#{certpath,jdbcType=VARCHAR},</if>
+                <if test="certPath != null">#{certPath,jdbcType=VARCHAR},</if>
                 <if test="tripartite != null">#{tripartite,jdbcType=CHAR},</if>
                 <if test="tripvalue != null">#{tripvalue,jdbcType=INTEGER},</if>
-                <if test="realtimesplit != null">#{realtimesplit,jdbcType=INTEGER},</if>
+                <if test="realtimeSplit != null">#{realtimeSplit,jdbcType=INTEGER},</if>
                 <if test="status != null">#{status,jdbcType=CHAR},</if>
+                <if test="totalIncome != null">#{totalIncome,jdbcType=INTEGER},</if>
+                <if test="totalSplit != null">#{totalSplit,jdbcType=INTEGER},</if>
+                <if test="totalCashOut != null">#{totalCashOut,jdbcType=INTEGER},</if>
+                <if test="totalRefund != null">#{totalRefund,jdbcType=INTEGER},</if>
+                <if test="balance != null">#{balance,jdbcType=INTEGER},</if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannels">
@@ -105,8 +135,8 @@
                 <if test="prefix != null">
                     prefix = #{prefix,jdbcType=CHAR},
                 </if>
-                <if test="ownerid != null">
-                    ownerId = #{ownerid,jdbcType=INTEGER},
+                <if test="ownerId != null">
+                    ownerId = #{ownerId,jdbcType=INTEGER},
                 </if>
                 <if test="phone != null">
                     phone = #{phone,jdbcType=CHAR},
@@ -117,14 +147,20 @@
                 <if test="account != null">
                     account = #{account,jdbcType=VARCHAR},
                 </if>
-                <if test="accountname != null">
-                    accountName = #{accountname,jdbcType=VARCHAR},
+                <if test="accountName != null">
+                    accountName = #{accountName,jdbcType=VARCHAR},
+                </if>
+                <if test="accountType != null">
+                    accountType = #{accountType,jdbcType=CHAR},
+                </if>
+                <if test="relation != null">
+                    relation = #{relation,jdbcType=CHAR},
                 </if>
                 <if test="apiv3 != null">
                     apiv3 = #{apiv3,jdbcType=VARCHAR},
                 </if>
-                <if test="certpath != null">
-                    certPath = #{certpath,jdbcType=VARCHAR},
+                <if test="certPath != null">
+                    certPath = #{certPath,jdbcType=VARCHAR},
                 </if>
                 <if test="tripartite != null">
                     tripartite = #{tripartite,jdbcType=CHAR},
@@ -132,12 +168,27 @@
                 <if test="tripvalue != null">
                     tripvalue = #{tripvalue,jdbcType=INTEGER},
                 </if>
-                <if test="realtimesplit != null">
-                    realtimeSplit = #{realtimesplit,jdbcType=INTEGER},
+                <if test="realtimeSplit != null">
+                    realtimeSplit = #{realtimeSplit,jdbcType=INTEGER},
                 </if>
                 <if test="status != null">
                     status = #{status,jdbcType=CHAR},
                 </if>
+                <if test="totalIncome != null">
+                    totalIncome = #{totalIncome,jdbcType=INTEGER},
+                </if>
+                <if test="totalSplit != null">
+                    totalSplit = #{totalSplit,jdbcType=INTEGER},
+                </if>
+                <if test="totalCashOut != null">
+                    totalCashOut = #{totalCashOut,jdbcType=INTEGER},
+                </if>
+                <if test="totalRefund != null">
+                    totalRefund = #{totalRefund,jdbcType=INTEGER},
+                </if>
+                <if test="balance != null">
+                    balance = #{balance,jdbcType=INTEGER},
+                </if>
         </set>
         where   id = #{id,jdbcType=INTEGER} 
     </update>
@@ -146,17 +197,24 @@
         set 
             name =  #{name,jdbcType=CHAR},
             prefix =  #{prefix,jdbcType=CHAR},
-            ownerId =  #{ownerid,jdbcType=INTEGER},
+            ownerId =  #{ownerId,jdbcType=INTEGER},
             phone =  #{phone,jdbcType=CHAR},
             note =  #{note,jdbcType=VARCHAR},
             account =  #{account,jdbcType=VARCHAR},
-            accountName =  #{accountname,jdbcType=VARCHAR},
+            accountName =  #{accountName,jdbcType=VARCHAR},
+            accountType =  #{accountType,jdbcType=CHAR},
+            relation =  #{relation,jdbcType=CHAR},
             apiv3 =  #{apiv3,jdbcType=VARCHAR},
-            certPath =  #{certpath,jdbcType=VARCHAR},
+            certPath =  #{certPath,jdbcType=VARCHAR},
             tripartite =  #{tripartite,jdbcType=CHAR},
             tripvalue =  #{tripvalue,jdbcType=INTEGER},
-            realtimeSplit =  #{realtimesplit,jdbcType=INTEGER},
-            status =  #{status,jdbcType=CHAR}
+            realtimeSplit =  #{realtimeSplit,jdbcType=INTEGER},
+            status =  #{status,jdbcType=CHAR},
+            totalIncome =  #{totalIncome,jdbcType=INTEGER},
+            totalSplit =  #{totalSplit,jdbcType=INTEGER},
+            totalCashOut =  #{totalCashOut,jdbcType=INTEGER},
+            totalRefund =  #{totalRefund,jdbcType=INTEGER},
+            balance =  #{balance,jdbcType=INTEGER}
         where   id = #{id,jdbcType=INTEGER} 
     </update>
 </mapper>

+ 107 - 36
dao/src/main/resources/mapper/AskaRetailsMapper.xml

@@ -11,26 +11,35 @@
             <result property="type" column="type" jdbcType="CHAR"/>
             <result property="lat" column="lat" jdbcType="DOUBLE"/>
             <result property="lng" column="lng" jdbcType="DOUBLE"/>
-            <result property="ownerid" column="ownerId" jdbcType="INTEGER"/>
+            <result property="ownerId" column="ownerId" jdbcType="INTEGER"/>
             <result property="phone" column="phone" jdbcType="CHAR"/>
             <result property="note" column="note" jdbcType="VARCHAR"/>
             <result property="account" column="account" jdbcType="VARCHAR"/>
-            <result property="accountname" column="accountName" jdbcType="VARCHAR"/>
+            <result property="accountName" column="accountName" jdbcType="VARCHAR"/>
+            <result property="accountType" column="accountType" jdbcType="CHAR"/>
+            <result property="relation" column="relation" jdbcType="CHAR"/>
             <result property="apiv3" column="apiv3" jdbcType="VARCHAR"/>
-            <result property="certpath" column="certPath" jdbcType="VARCHAR"/>
+            <result property="certPath" column="certPath" jdbcType="VARCHAR"/>
             <result property="tripartite" column="tripartite" jdbcType="CHAR"/>
             <result property="tripvalue" column="tripvalue" jdbcType="INTEGER"/>
-            <result property="realtimesplit" column="realtimeSplit" jdbcType="INTEGER"/>
+            <result property="realtimeSplit" column="realtimeSplit" jdbcType="INTEGER"/>
             <result property="status" column="status" jdbcType="CHAR"/>
+            <result property="totalIncome" column="totalIncome" jdbcType="INTEGER"/>
+            <result property="totalSplit" column="totalSplit" jdbcType="INTEGER"/>
+            <result property="totalCashOut" column="totalCashOut" jdbcType="INTEGER"/>
+            <result property="totalRefund" column="totalRefund" jdbcType="INTEGER"/>
+            <result property="balance" column="balance" jdbcType="INTEGER"/>
     </resultMap>
 
     <sql id="Base_Column_List">
         id,name,address,
         type,lat,lng,
         ownerId,phone,note,
-        account,accountName,apiv3,
-        certPath,tripartite,tripvalue,
-        realtimeSplit,status
+        account,accountName,accountType,
+        relation,apiv3,certPath,
+        tripartite,tripvalue,realtimeSplit,
+        status,totalIncome,totalSplit,
+        totalCashOut,totalRefund,balance
     </sql>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -39,10 +48,24 @@
         from aska_retails
         where  id = #{id,jdbcType=INTEGER} 
     </select>
-    <select id="listAllRetails" resultType="com.mofangchuxing.aska.dao.domain.AskaRetails">
+
+    <select id="listAllRetails" resultType="com.mofangchuxing.aska.domain.vo.AskaRetailsVo">
         select
         <include refid="Base_Column_List" />
         from aska_retails
+        where 1=1
+        <if test="name != null">
+            and name = #{name}
+        </if>
+        <if test="status != null">
+            and status = #{status}
+        </if>
+    </select>
+    <select id="listAllRetailsNoLimit" resultType="com.mofangchuxing.aska.domain.vo.AskaRetailsVo">
+        select id as retailId,
+               name as retailName,
+               lat,lng,address,status
+        from aska_retails
     </select>
 
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
@@ -54,15 +77,21 @@
         ( id,name,address
         ,type,lat,lng
         ,ownerId,phone,note
-        ,account,accountName,apiv3
-        ,certPath,tripartite,tripvalue
-        ,realtimeSplit,status)
+        ,account,accountName,accountType
+        ,relation,apiv3,certPath
+        ,tripartite,tripvalue,realtimeSplit
+        ,status,totalIncome,totalSplit
+        ,totalCashOut,totalRefund,balance
+        )
         values (#{id,jdbcType=INTEGER},#{name,jdbcType=CHAR},#{address,jdbcType=VARCHAR}
         ,#{type,jdbcType=CHAR},#{lat,jdbcType=DOUBLE},#{lng,jdbcType=DOUBLE}
-        ,#{ownerid,jdbcType=INTEGER},#{phone,jdbcType=CHAR},#{note,jdbcType=VARCHAR}
-        ,#{account,jdbcType=VARCHAR},#{accountname,jdbcType=VARCHAR},#{apiv3,jdbcType=VARCHAR}
-        ,#{certpath,jdbcType=VARCHAR},#{tripartite,jdbcType=CHAR},#{tripvalue,jdbcType=INTEGER}
-        ,#{realtimesplit,jdbcType=INTEGER},#{status,jdbcType=CHAR})
+        ,#{ownerId,jdbcType=INTEGER},#{phone,jdbcType=CHAR},#{note,jdbcType=VARCHAR}
+        ,#{account,jdbcType=VARCHAR},#{accountName,jdbcType=VARCHAR},#{accountType,jdbcType=CHAR}
+        ,#{relation,jdbcType=CHAR},#{apiv3,jdbcType=VARCHAR},#{certPath,jdbcType=VARCHAR}
+        ,#{tripartite,jdbcType=CHAR},#{tripvalue,jdbcType=INTEGER},#{realtimeSplit,jdbcType=INTEGER}
+        ,#{status,jdbcType=CHAR},#{totalIncome,jdbcType=INTEGER},#{totalSplit,jdbcType=INTEGER}
+        ,#{totalCashOut,jdbcType=INTEGER},#{totalRefund,jdbcType=INTEGER},#{balance,jdbcType=INTEGER}
+        )
     </insert>
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaRetails" useGeneratedKeys="true">
         insert into aska_retails
@@ -73,17 +102,24 @@
                 <if test="type != null">type,</if>
                 <if test="lat != null">lat,</if>
                 <if test="lng != null">lng,</if>
-                <if test="ownerid != null">ownerId,</if>
+                <if test="ownerId != null">ownerId,</if>
                 <if test="phone != null">phone,</if>
                 <if test="note != null">note,</if>
                 <if test="account != null">account,</if>
-                <if test="accountname != null">accountName,</if>
+                <if test="accountName != null">accountName,</if>
+                <if test="accountType != null">accountType,</if>
+                <if test="relation != null">relation,</if>
                 <if test="apiv3 != null">apiv3,</if>
-                <if test="certpath != null">certPath,</if>
+                <if test="certPath != null">certPath,</if>
                 <if test="tripartite != null">tripartite,</if>
                 <if test="tripvalue != null">tripvalue,</if>
-                <if test="realtimesplit != null">realtimeSplit,</if>
+                <if test="realtimeSplit != null">realtimeSplit,</if>
                 <if test="status != null">status,</if>
+                <if test="totalIncome != null">totalIncome,</if>
+                <if test="totalSplit != null">totalSplit,</if>
+                <if test="totalCashOut != null">totalCashOut,</if>
+                <if test="totalRefund != null">totalRefund,</if>
+                <if test="balance != null">balance,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
                 <if test="id != null">#{id,jdbcType=INTEGER},</if>
@@ -92,17 +128,24 @@
                 <if test="type != null">#{type,jdbcType=CHAR},</if>
                 <if test="lat != null">#{lat,jdbcType=DOUBLE},</if>
                 <if test="lng != null">#{lng,jdbcType=DOUBLE},</if>
-                <if test="ownerid != null">#{ownerid,jdbcType=INTEGER},</if>
+                <if test="ownerId != null">#{ownerId,jdbcType=INTEGER},</if>
                 <if test="phone != null">#{phone,jdbcType=CHAR},</if>
                 <if test="note != null">#{note,jdbcType=VARCHAR},</if>
                 <if test="account != null">#{account,jdbcType=VARCHAR},</if>
-                <if test="accountname != null">#{accountname,jdbcType=VARCHAR},</if>
+                <if test="accountName != null">#{accountName,jdbcType=VARCHAR},</if>
+                <if test="accountType != null">#{accountType,jdbcType=CHAR},</if>
+                <if test="relation != null">#{relation,jdbcType=CHAR},</if>
                 <if test="apiv3 != null">#{apiv3,jdbcType=VARCHAR},</if>
-                <if test="certpath != null">#{certpath,jdbcType=VARCHAR},</if>
+                <if test="certPath != null">#{certPath,jdbcType=VARCHAR},</if>
                 <if test="tripartite != null">#{tripartite,jdbcType=CHAR},</if>
                 <if test="tripvalue != null">#{tripvalue,jdbcType=INTEGER},</if>
-                <if test="realtimesplit != null">#{realtimesplit,jdbcType=INTEGER},</if>
+                <if test="realtimeSplit != null">#{realtimeSplit,jdbcType=INTEGER},</if>
                 <if test="status != null">#{status,jdbcType=CHAR},</if>
+                <if test="totalIncome != null">#{totalIncome,jdbcType=INTEGER},</if>
+                <if test="totalSplit != null">#{totalSplit,jdbcType=INTEGER},</if>
+                <if test="totalCashOut != null">#{totalCashOut,jdbcType=INTEGER},</if>
+                <if test="totalRefund != null">#{totalRefund,jdbcType=INTEGER},</if>
+                <if test="balance != null">#{balance,jdbcType=INTEGER},</if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaRetails">
@@ -123,8 +166,8 @@
                 <if test="lng != null">
                     lng = #{lng,jdbcType=DOUBLE},
                 </if>
-                <if test="ownerid != null">
-                    ownerId = #{ownerid,jdbcType=INTEGER},
+                <if test="ownerId != null">
+                    ownerId = #{ownerId,jdbcType=INTEGER},
                 </if>
                 <if test="phone != null">
                     phone = #{phone,jdbcType=CHAR},
@@ -135,14 +178,20 @@
                 <if test="account != null">
                     account = #{account,jdbcType=VARCHAR},
                 </if>
-                <if test="accountname != null">
-                    accountName = #{accountname,jdbcType=VARCHAR},
+                <if test="accountName != null">
+                    accountName = #{accountName,jdbcType=VARCHAR},
+                </if>
+                <if test="accountType != null">
+                    accountType = #{accountType,jdbcType=CHAR},
+                </if>
+                <if test="relation != null">
+                    relation = #{relation,jdbcType=CHAR},
                 </if>
                 <if test="apiv3 != null">
                     apiv3 = #{apiv3,jdbcType=VARCHAR},
                 </if>
-                <if test="certpath != null">
-                    certPath = #{certpath,jdbcType=VARCHAR},
+                <if test="certPath != null">
+                    certPath = #{certPath,jdbcType=VARCHAR},
                 </if>
                 <if test="tripartite != null">
                     tripartite = #{tripartite,jdbcType=CHAR},
@@ -150,12 +199,27 @@
                 <if test="tripvalue != null">
                     tripvalue = #{tripvalue,jdbcType=INTEGER},
                 </if>
-                <if test="realtimesplit != null">
-                    realtimeSplit = #{realtimesplit,jdbcType=INTEGER},
+                <if test="realtimeSplit != null">
+                    realtimeSplit = #{realtimeSplit,jdbcType=INTEGER},
                 </if>
                 <if test="status != null">
                     status = #{status,jdbcType=CHAR},
                 </if>
+                <if test="totalIncome != null">
+                    totalIncome = #{totalIncome,jdbcType=INTEGER},
+                </if>
+                <if test="totalSplit != null">
+                    totalSplit = #{totalSplit,jdbcType=INTEGER},
+                </if>
+                <if test="totalCashOut != null">
+                    totalCashOut = #{totalCashOut,jdbcType=INTEGER},
+                </if>
+                <if test="totalRefund != null">
+                    totalRefund = #{totalRefund,jdbcType=INTEGER},
+                </if>
+                <if test="balance != null">
+                    balance = #{balance,jdbcType=INTEGER},
+                </if>
         </set>
         where   id = #{id,jdbcType=INTEGER} 
     </update>
@@ -167,17 +231,24 @@
             type =  #{type,jdbcType=CHAR},
             lat =  #{lat,jdbcType=DOUBLE},
             lng =  #{lng,jdbcType=DOUBLE},
-            ownerId =  #{ownerid,jdbcType=INTEGER},
+            ownerId =  #{ownerId,jdbcType=INTEGER},
             phone =  #{phone,jdbcType=CHAR},
             note =  #{note,jdbcType=VARCHAR},
             account =  #{account,jdbcType=VARCHAR},
-            accountName =  #{accountname,jdbcType=VARCHAR},
+            accountName =  #{accountName,jdbcType=VARCHAR},
+            accountType =  #{accountType,jdbcType=CHAR},
+            relation =  #{relation,jdbcType=CHAR},
             apiv3 =  #{apiv3,jdbcType=VARCHAR},
-            certPath =  #{certpath,jdbcType=VARCHAR},
+            certPath =  #{certPath,jdbcType=VARCHAR},
             tripartite =  #{tripartite,jdbcType=CHAR},
             tripvalue =  #{tripvalue,jdbcType=INTEGER},
-            realtimeSplit =  #{realtimesplit,jdbcType=INTEGER},
-            status =  #{status,jdbcType=CHAR}
+            realtimeSplit =  #{realtimeSplit,jdbcType=INTEGER},
+            status =  #{status,jdbcType=CHAR},
+            totalIncome =  #{totalIncome,jdbcType=INTEGER},
+            totalSplit =  #{totalSplit,jdbcType=INTEGER},
+            totalCashOut =  #{totalCashOut,jdbcType=INTEGER},
+            totalRefund =  #{totalRefund,jdbcType=INTEGER},
+            balance =  #{balance,jdbcType=INTEGER}
         where   id = #{id,jdbcType=INTEGER} 
     </update>
 </mapper>

+ 241 - 0
dao/src/main/resources/mapper/AskaSplitrecordMapper.xml

@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.mofangchuxing.aska.dao.mapper.AskaSplitrecordMapper">
+
+    <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.AskaSplitrecord">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="payId" column="payId" jdbcType="INTEGER"/>
+            <result property="spiltOrderId" column="spiltOrderId" jdbcType="VARCHAR"/>
+            <result property="payAmount" column="payAmount" jdbcType="INTEGER"/>
+            <result property="retailId" column="retailId" jdbcType="INTEGER"/>
+            <result property="retailName" column="retailName" jdbcType="VARCHAR"/>
+            <result property="retailAccount" column="retailAccount" jdbcType="VARCHAR"/>
+            <result property="retailAmount" column="retailAmount" jdbcType="VARCHAR"/>
+            <result property="retailRealtimeAmount" column="retailRealtimeAmount" jdbcType="INTEGER"/>
+            <result property="retailAccountAmount" column="retailAccountAmount" jdbcType="INTEGER"/>
+            <result property="retailSplitrule" column="retailSplitrule" jdbcType="VARCHAR"/>
+            <result property="channelId" column="channelId" jdbcType="INTEGER"/>
+            <result property="channelName" column="channelName" jdbcType="VARCHAR"/>
+            <result property="channelAccount" column="channelAccount" jdbcType="VARCHAR"/>
+            <result property="channelAmount" column="channelAmount" jdbcType="VARCHAR"/>
+            <result property="channelRealtimeAmount" column="channelRealtimeAmount" jdbcType="INTEGER"/>
+            <result property="channelAccountAmount" column="channelAccountAmount" jdbcType="INTEGER"/>
+            <result property="channelSplitRule" column="channelSplitRule" jdbcType="VARCHAR"/>
+            <result property="status" column="status" jdbcType="INTEGER"/>
+            <result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
+            <result property="hasRefund" column="hasRefund" jdbcType="INTEGER"/>
+            <result property="refundTotal" column="refundTotal" jdbcType="INTEGER"/>
+            <result property="refundRetail" column="refundRetail" jdbcType="INTEGER"/>
+            <result property="refundChannel" column="refundChannel" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,payId,spiltOrderId,
+        payAmount,retailId,retailName,
+        retailAccount,retailAmount,retailRealtimeAmount,
+        retailAccountAmount,retailSplitrule,channelId,
+        channelName,channelAccount,channelAmount,
+        channelRealtimeAmount,channelAccountAmount,channelSplitRule,
+        status,createTime,hasRefund,
+        refundTotal,refundRetail,refundChannel
+    </sql>
+
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from aska_splitRecord
+        where  id = #{id,jdbcType=INTEGER} 
+    </select>
+    <select id="selectAllByPayId" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from aska_splitRecord
+        where payId = #{payId} limit 1
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        delete from aska_splitRecord
+        where  id = #{id,jdbcType=INTEGER} 
+    </delete>
+    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaSplitrecord" useGeneratedKeys="true">
+        insert into aska_splitRecord
+        ( id,payId,spiltOrderId
+        ,payAmount,retailId,retailName
+        ,retailAccount,retailAmount,retailRealtimeAmount
+        ,retailAccountAmount,retailSplitrule,channelId
+        ,channelName,channelAccount,channelAmount
+        ,channelRealtimeAmount,channelAccountAmount,channelSplitRule
+        ,status,createTime,hasRefund
+        ,refundTotal,refundRetail,refundChannel
+        )
+        values (#{id,jdbcType=INTEGER},#{payId,jdbcType=INTEGER},#{spiltOrderId,jdbcType=VARCHAR}
+        ,#{payAmount,jdbcType=INTEGER},#{retailId,jdbcType=INTEGER},#{retailName,jdbcType=VARCHAR}
+        ,#{retailAccount,jdbcType=VARCHAR},#{retailAmount,jdbcType=VARCHAR},#{retailRealtimeAmount,jdbcType=INTEGER}
+        ,#{retailAccountAmount,jdbcType=INTEGER},#{retailSplitrule,jdbcType=VARCHAR},#{channelId,jdbcType=INTEGER}
+        ,#{channelName,jdbcType=VARCHAR},#{channelAccount,jdbcType=VARCHAR},#{channelAmount,jdbcType=VARCHAR}
+        ,#{channelRealtimeAmount,jdbcType=INTEGER},#{channelAccountAmount,jdbcType=INTEGER},#{channelSplitRule,jdbcType=VARCHAR}
+        ,#{status,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{hasRefund,jdbcType=INTEGER}
+        ,#{refundTotal,jdbcType=INTEGER},#{refundRetail,jdbcType=INTEGER},#{refundChannel,jdbcType=INTEGER}
+        )
+    </insert>
+    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaSplitrecord" useGeneratedKeys="true">
+        insert into aska_splitRecord
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                <if test="id != null">id,</if>
+                <if test="payId != null">payId,</if>
+                <if test="spiltOrderId != null">spiltOrderId,</if>
+                <if test="payAmount != null">payAmount,</if>
+                <if test="retailId != null">retailId,</if>
+                <if test="retailName != null">retailName,</if>
+                <if test="retailAccount != null">retailAccount,</if>
+                <if test="retailAmount != null">retailAmount,</if>
+                <if test="retailRealtimeAmount != null">retailRealtimeAmount,</if>
+                <if test="retailAccountAmount != null">retailAccountAmount,</if>
+                <if test="retailSplitrule != null">retailSplitrule,</if>
+                <if test="channelId != null">channelId,</if>
+                <if test="channelName != null">channelName,</if>
+                <if test="channelAccount != null">channelAccount,</if>
+                <if test="channelAmount != null">channelAmount,</if>
+                <if test="channelRealtimeAmount != null">channelRealtimeAmount,</if>
+                <if test="channelAccountAmount != null">channelAccountAmount,</if>
+                <if test="channelSplitRule != null">channelSplitRule,</if>
+                <if test="status != null">status,</if>
+                <if test="createTime != null">createTime,</if>
+                <if test="hasRefund != null">hasRefund,</if>
+                <if test="refundTotal != null">refundTotal,</if>
+                <if test="refundRetail != null">refundRetail,</if>
+                <if test="refundChannel != null">refundChannel,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                <if test="id != null">#{id,jdbcType=INTEGER},</if>
+                <if test="payId != null">#{payId,jdbcType=INTEGER},</if>
+                <if test="spiltOrderId != null">#{spiltOrderId,jdbcType=VARCHAR},</if>
+                <if test="payAmount != null">#{payAmount,jdbcType=INTEGER},</if>
+                <if test="retailId != null">#{retailId,jdbcType=INTEGER},</if>
+                <if test="retailName != null">#{retailName,jdbcType=VARCHAR},</if>
+                <if test="retailAccount != null">#{retailAccount,jdbcType=VARCHAR},</if>
+                <if test="retailAmount != null">#{retailAmount,jdbcType=VARCHAR},</if>
+                <if test="retailRealtimeAmount != null">#{retailRealtimeAmount,jdbcType=INTEGER},</if>
+                <if test="retailAccountAmount != null">#{retailAccountAmount,jdbcType=INTEGER},</if>
+                <if test="retailSplitrule != null">#{retailSplitrule,jdbcType=VARCHAR},</if>
+                <if test="channelId != null">#{channelId,jdbcType=INTEGER},</if>
+                <if test="channelName != null">#{channelName,jdbcType=VARCHAR},</if>
+                <if test="channelAccount != null">#{channelAccount,jdbcType=VARCHAR},</if>
+                <if test="channelAmount != null">#{channelAmount,jdbcType=VARCHAR},</if>
+                <if test="channelRealtimeAmount != null">#{channelRealtimeAmount,jdbcType=INTEGER},</if>
+                <if test="channelAccountAmount != null">#{channelAccountAmount,jdbcType=INTEGER},</if>
+                <if test="channelSplitRule != null">#{channelSplitRule,jdbcType=VARCHAR},</if>
+                <if test="status != null">#{status,jdbcType=INTEGER},</if>
+                <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
+                <if test="hasRefund != null">#{hasRefund,jdbcType=INTEGER},</if>
+                <if test="refundTotal != null">#{refundTotal,jdbcType=INTEGER},</if>
+                <if test="refundRetail != null">#{refundRetail,jdbcType=INTEGER},</if>
+                <if test="refundChannel != null">#{refundChannel,jdbcType=INTEGER},</if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaSplitrecord">
+        update aska_splitRecord
+        <set>
+                <if test="payId != null">
+                    payId = #{payId,jdbcType=INTEGER},
+                </if>
+                <if test="spiltOrderId != null">
+                    spiltOrderId = #{spiltOrderId,jdbcType=VARCHAR},
+                </if>
+                <if test="payAmount != null">
+                    payAmount = #{payAmount,jdbcType=INTEGER},
+                </if>
+                <if test="retailId != null">
+                    retailId = #{retailId,jdbcType=INTEGER},
+                </if>
+                <if test="retailName != null">
+                    retailName = #{retailName,jdbcType=VARCHAR},
+                </if>
+                <if test="retailAccount != null">
+                    retailAccount = #{retailAccount,jdbcType=VARCHAR},
+                </if>
+                <if test="retailAmount != null">
+                    retailAmount = #{retailAmount,jdbcType=VARCHAR},
+                </if>
+                <if test="retailRealtimeAmount != null">
+                    retailRealtimeAmount = #{retailRealtimeAmount,jdbcType=INTEGER},
+                </if>
+                <if test="retailAccountAmount != null">
+                    retailAccountAmount = #{retailAccountAmount,jdbcType=INTEGER},
+                </if>
+                <if test="retailSplitrule != null">
+                    retailSplitrule = #{retailSplitrule,jdbcType=VARCHAR},
+                </if>
+                <if test="channelId != null">
+                    channelId = #{channelId,jdbcType=INTEGER},
+                </if>
+                <if test="channelName != null">
+                    channelName = #{channelName,jdbcType=VARCHAR},
+                </if>
+                <if test="channelAccount != null">
+                    channelAccount = #{channelAccount,jdbcType=VARCHAR},
+                </if>
+                <if test="channelAmount != null">
+                    channelAmount = #{channelAmount,jdbcType=VARCHAR},
+                </if>
+                <if test="channelRealtimeAmount != null">
+                    channelRealtimeAmount = #{channelRealtimeAmount,jdbcType=INTEGER},
+                </if>
+                <if test="channelAccountAmount != null">
+                    channelAccountAmount = #{channelAccountAmount,jdbcType=INTEGER},
+                </if>
+                <if test="channelSplitRule != null">
+                    channelSplitRule = #{channelSplitRule,jdbcType=VARCHAR},
+                </if>
+                <if test="status != null">
+                    status = #{status,jdbcType=INTEGER},
+                </if>
+                <if test="createTime != null">
+                    createTime = #{createTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="hasRefund != null">
+                    hasRefund = #{hasRefund,jdbcType=INTEGER},
+                </if>
+                <if test="refundTotal != null">
+                    refundTotal = #{refundTotal,jdbcType=INTEGER},
+                </if>
+                <if test="refundRetail != null">
+                    refundRetail = #{refundRetail,jdbcType=INTEGER},
+                </if>
+                <if test="refundChannel != null">
+                    refundChannel = #{refundChannel,jdbcType=INTEGER},
+                </if>
+        </set>
+        where   id = #{id,jdbcType=INTEGER} 
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.AskaSplitrecord">
+        update aska_splitRecord
+        set 
+            payId =  #{payId,jdbcType=INTEGER},
+            spiltOrderId =  #{spiltOrderId,jdbcType=VARCHAR},
+            payAmount =  #{payAmount,jdbcType=INTEGER},
+            retailId =  #{retailId,jdbcType=INTEGER},
+            retailName =  #{retailName,jdbcType=VARCHAR},
+            retailAccount =  #{retailAccount,jdbcType=VARCHAR},
+            retailAmount =  #{retailAmount,jdbcType=VARCHAR},
+            retailRealtimeAmount =  #{retailRealtimeAmount,jdbcType=INTEGER},
+            retailAccountAmount =  #{retailAccountAmount,jdbcType=INTEGER},
+            retailSplitrule =  #{retailSplitrule,jdbcType=VARCHAR},
+            channelId =  #{channelId,jdbcType=INTEGER},
+            channelName =  #{channelName,jdbcType=VARCHAR},
+            channelAccount =  #{channelAccount,jdbcType=VARCHAR},
+            channelAmount =  #{channelAmount,jdbcType=VARCHAR},
+            channelRealtimeAmount =  #{channelRealtimeAmount,jdbcType=INTEGER},
+            channelAccountAmount =  #{channelAccountAmount,jdbcType=INTEGER},
+            channelSplitRule =  #{channelSplitRule,jdbcType=VARCHAR},
+            status =  #{status,jdbcType=INTEGER},
+            createTime =  #{createTime,jdbcType=TIMESTAMP},
+            hasRefund =  #{hasRefund,jdbcType=INTEGER},
+            refundTotal =  #{refundTotal,jdbcType=INTEGER},
+            refundRetail =  #{refundRetail,jdbcType=INTEGER},
+            refundChannel =  #{refundChannel,jdbcType=INTEGER}
+        where   id = #{id,jdbcType=INTEGER} 
+    </update>
+</mapper>

+ 108 - 18
dao/src/main/resources/mapper/PayRequestMapper.xml

@@ -11,15 +11,24 @@
             <result property="openId" column="open_id" jdbcType="VARCHAR"/>
             <result property="mobile" column="mobile" jdbcType="VARCHAR"/>
             <result property="orderId" column="order_id" jdbcType="VARCHAR"/>
-            <result property="amount" column="amount" jdbcType="DECIMAL"/>
+            <result property="amount" column="amount" jdbcType="INTEGER"/>
             <result property="itemId" column="item_id" jdbcType="VARCHAR"/>
-            <result property="itemName" column="item_name" jdbcType="VARCHAR"/>
             <result property="itemType" column="item_type" jdbcType="INTEGER"/>
+            <result property="itemName" column="item_name" jdbcType="VARCHAR"/>
             <result property="itemChannel" column="item_channel" jdbcType="VARCHAR"/>
+            <result property="retailId" column="retail_id" jdbcType="VARCHAR"/>
+            <result property="retailName" column="retail_name" jdbcType="VARCHAR"/>
+            <result property="useCouponId" column="use_coupon_id" jdbcType="VARCHAR"/>
             <result property="payChannel" column="pay_channel" jdbcType="INTEGER"/>
-            <result property="payStatus" column="pay_status" jdbcType="BIGINT"/>
-            <result property="payAmount" column="pay_amount" jdbcType="DECIMAL"/>
+            <result property="responseBody" column="response_body" jdbcType="VARCHAR"/>
+            <result property="payStatus" column="pay_status" jdbcType="INTEGER"/>
             <result property="payTime" column="pay_time" jdbcType="TIMESTAMP"/>
+            <result property="transactionId" column="transaction_id" jdbcType="VARCHAR"/>
+            <result property="payAmount" column="pay_amount" jdbcType="DECIMAL"/>
+            <result property="hasRefund" column="has_refund" jdbcType="INTEGER"/>
+            <result property="refundTotal" column="refund_total" jdbcType="DECIMAL"/>
+            <result property="clientType" column="client_type" jdbcType="VARCHAR"/>
+            <result property="cansplit" column="canSplit" jdbcType="INTEGER"/>
             <result property="callbackUrl" column="callback_url" jdbcType="VARCHAR"/>
             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
             <result property="modifiedTime" column="modified_time" jdbcType="TIMESTAMP"/>
@@ -28,9 +37,13 @@
     <sql id="Base_Column_List">
         id,request_body,order_sn,
         open_id,mobile,order_id,
-        amount,item_id,item_name,item_type,
-        item_channel,pay_channel,pay_status,pay_amount,pay_time,callback_url,create_time,
-        modified_time
+        amount,item_id,item_type,
+        item_name,item_channel,retail_id,
+        retail_name,use_coupon_id,pay_channel,
+        response_body,pay_status,pay_time,
+        transaction_id,pay_amount,has_refund,
+        refund_total,client_type,canSplit,
+        callback_url,create_time,modified_time
     </sql>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -39,6 +52,7 @@
         from pay_request
         where  id = #{id,jdbcType=INTEGER} 
     </select>
+
     <select id="selectByOrderSn" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List" />
@@ -66,6 +80,7 @@
         where mobile = #{phoneNo} and order_id = #{orderId}
     </select>
 
+
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
         delete from pay_request
         where  id = #{id,jdbcType=INTEGER} 
@@ -75,13 +90,23 @@
         ( id,request_body,order_sn
         ,open_id,mobile,order_id
         ,amount,item_id,item_type
-        ,item_channel,pay_channel,create_time
-        ,modified_time)
+        ,item_name,item_channel,retail_id
+        ,retail_name,use_coupon_id,pay_channel
+        ,response_body,pay_status,pay_time
+        ,transaction_id,pay_amount,has_refund
+        ,refund_total,client_type,canSplit
+        ,callback_url,create_time,modified_time
+        )
         values (#{id,jdbcType=INTEGER},#{requestBody,jdbcType=VARCHAR},#{orderSn,jdbcType=VARCHAR}
         ,#{openId,jdbcType=VARCHAR},#{mobile,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR}
         ,#{amount,jdbcType=DECIMAL},#{itemId,jdbcType=VARCHAR},#{itemType,jdbcType=INTEGER}
-        ,#{itemChannel,jdbcType=VARCHAR},#{payChannel,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP}
-        ,#{modifiedTime,jdbcType=TIMESTAMP})
+        ,#{itemName,jdbcType=VARCHAR},#{itemChannel,jdbcType=VARCHAR},#{retailId,jdbcType=VARCHAR}
+        ,#{retailName,jdbcType=VARCHAR},#{useCouponId,jdbcType=VARCHAR},#{payChannel,jdbcType=INTEGER}
+        ,#{responseBody,jdbcType=VARCHAR},#{payStatus,jdbcType=INTEGER},#{payTime,jdbcType=TIMESTAMP}
+        ,#{transactionId,jdbcType=VARCHAR},#{payAmount,jdbcType=DECIMAL},#{hasRefund,jdbcType=INTEGER}
+        ,#{refundTotal,jdbcType=DECIMAL},#{clientType,jdbcType=VARCHAR},#{cansplit,jdbcType=INTEGER}
+        ,#{callbackUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{modifiedTime,jdbcType=TIMESTAMP}
+        )
     </insert>
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest" useGeneratedKeys="true">
         insert into pay_request
@@ -95,11 +120,22 @@
                 <if test="amount != null">amount,</if>
                 <if test="itemId != null">item_id,</if>
                 <if test="itemType != null">item_type,</if>
+                <if test="itemName != null">item_name,</if>
                 <if test="itemChannel != null">item_channel,</if>
+                <if test="channelId != null">channel_id,</if>
+                <if test="retailId != null">retail_id,</if>
+                <if test="retailName != null">retail_name,</if>
+                <if test="useCouponId != null">use_coupon_id,</if>
                 <if test="payChannel != null">pay_channel,</if>
-                <if test="itemName != null">item_name,</if>
                 <if test="responseBody != null">response_body,</if>
                 <if test="payStatus != null">pay_status,</if>
+                <if test="payTime != null">pay_time,</if>
+                <if test="transactionId != null">transaction_id,</if>
+                <if test="payAmount != null">pay_amount,</if>
+                <if test="hasRefund != null">has_refund,</if>
+                <if test="refundTotal != null">refund_total,</if>
+                <if test="clientType != null">client_type,</if>
+                <if test="cansplit != null">canSplit,</if>
                 <if test="callbackUrl != null">callback_url,</if>
                 <if test="createTime != null">create_time,</if>
                 <if test="modifiedTime != null">modified_time,</if>
@@ -114,11 +150,22 @@
                 <if test="amount != null">#{amount,jdbcType=DECIMAL},</if>
                 <if test="itemId != null">#{itemId,jdbcType=VARCHAR},</if>
                 <if test="itemType != null">#{itemType,jdbcType=INTEGER},</if>
+                <if test="itemName != null">#{itemName,jdbcType=VARCHAR},</if>
                 <if test="itemChannel != null">#{itemChannel,jdbcType=VARCHAR},</if>
+                <if test="channelId != null">#{channelId,jdbcType=INTEGER},</if>
+                <if test="retailId != null">#{retailId,jdbcType=VARCHAR},</if>
+                <if test="retailName != null">#{retailName,jdbcType=VARCHAR},</if>
+                <if test="useCouponId != null">#{useCouponId,jdbcType=VARCHAR},</if>
                 <if test="payChannel != null">#{payChannel,jdbcType=INTEGER},</if>
-                <if test="itemName != null">#{itemName,jdbcType=VARCHAR},</if>
                 <if test="responseBody != null">#{responseBody,jdbcType=VARCHAR},</if>
-                <if test="payStatus != null">#{payStatus,jdbcType=BIGINT},</if>
+                <if test="payStatus != null">#{payStatus,jdbcType=INTEGER},</if>
+                <if test="payTime != null">#{payTime,jdbcType=TIMESTAMP},</if>
+                <if test="transactionId != null">#{transactionId,jdbcType=VARCHAR},</if>
+                <if test="payAmount != null">#{payAmount,jdbcType=DECIMAL},</if>
+                <if test="hasRefund != null">#{hasRefund,jdbcType=INTEGER},</if>
+                <if test="refundTotal != null">#{refundTotal,jdbcType=DECIMAL},</if>
+                <if test="clientType != null">#{clientType,jdbcType=VARCHAR},</if>
+                <if test="cansplit != null">#{cansplit,jdbcType=INTEGER},</if>
                 <if test="callbackUrl != null">#{callbackUrl,jdbcType=VARCHAR},</if>
                 <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
                 <if test="modifiedTime != null">#{modifiedTime,jdbcType=TIMESTAMP},</if>
@@ -151,9 +198,21 @@
                 <if test="itemType != null">
                     item_type = #{itemType,jdbcType=INTEGER},
                 </if>
+                <if test="itemName != null">
+                    item_name = #{itemName,jdbcType=VARCHAR},
+                </if>
                 <if test="itemChannel != null">
                     item_channel = #{itemChannel,jdbcType=VARCHAR},
                 </if>
+                <if test="retailId != null">
+                    retail_id = #{retailId,jdbcType=VARCHAR},
+                </if>
+                <if test="retailName != null">
+                    retail_name = #{retailName,jdbcType=VARCHAR},
+                </if>
+                <if test="useCouponId != null">
+                    use_coupon_id = #{useCouponId,jdbcType=VARCHAR},
+                </if>
                 <if test="payChannel != null">
                     pay_channel = #{payChannel,jdbcType=INTEGER},
                 </if>
@@ -161,13 +220,31 @@
                     response_body = #{responseBody,jdbcType=VARCHAR},
                 </if>
                 <if test="payStatus != null">
-                    pay_status = #{payStatus,jdbcType=BIGINT},
+                    pay_status = #{payStatus,jdbcType=INTEGER},
+                </if>
+                <if test="payTime != null">
+                    pay_time = #{payTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="transactionId != null">
+                    transaction_id = #{transactionId,jdbcType=VARCHAR},
                 </if>
                 <if test="payAmount != null">
                     pay_amount = #{payAmount,jdbcType=DECIMAL},
                 </if>
-                <if test="payTime != null">
-                    pay_time = #{payTime,jdbcType=TIMESTAMP},
+                <if test="hasRefund != null">
+                    has_refund = #{hasRefund,jdbcType=INTEGER},
+                </if>
+                <if test="refundTotal != null">
+                    refund_total = #{refundTotal,jdbcType=DECIMAL},
+                </if>
+                <if test="clientType != null">
+                    client_type = #{clientType,jdbcType=VARCHAR},
+                </if>
+                <if test="cansplit != null">
+                    canSplit = #{cansplit,jdbcType=INTEGER},
+                </if>
+                <if test="callbackUrl != null">
+                    callback_url = #{callbackUrl,jdbcType=VARCHAR},
                 </if>
                 <if test="createTime != null">
                     create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -189,9 +266,22 @@
             amount =  #{amount,jdbcType=DECIMAL},
             item_id =  #{itemId,jdbcType=VARCHAR},
             item_type =  #{itemType,jdbcType=INTEGER},
+            item_name =  #{itemName,jdbcType=VARCHAR},
             item_channel =  #{itemChannel,jdbcType=VARCHAR},
+            retail_id =  #{retailId,jdbcType=VARCHAR},
+            retail_name =  #{retailName,jdbcType=VARCHAR},
+            use_coupon_id =  #{useCouponId,jdbcType=VARCHAR},
             pay_channel =  #{payChannel,jdbcType=INTEGER},
-            response_body = #{responseBody,jdbcType=VARCHAR},
+            response_body =  #{responseBody,jdbcType=VARCHAR},
+            pay_status =  #{payStatus,jdbcType=INTEGER},
+            pay_time =  #{payTime,jdbcType=TIMESTAMP},
+            transaction_id =  #{transactionId,jdbcType=VARCHAR},
+            pay_amount =  #{payAmount,jdbcType=DECIMAL},
+            has_refund =  #{hasRefund,jdbcType=INTEGER},
+            refund_total =  #{refundTotal,jdbcType=DECIMAL},
+            client_type =  #{clientType,jdbcType=VARCHAR},
+            canSplit =  #{cansplit,jdbcType=INTEGER},
+            callback_url =  #{callbackUrl,jdbcType=VARCHAR},
             create_time =  #{createTime,jdbcType=TIMESTAMP},
             modified_time =  #{modifiedTime,jdbcType=TIMESTAMP}
         where   id = #{id,jdbcType=INTEGER} 

+ 15 - 9
dao/src/main/resources/mapper/RefundOrderMapper.xml

@@ -8,14 +8,16 @@
             <id property="id" column="id" jdbcType="INTEGER"/>
             <result property="orderSn" column="order_sn" jdbcType="VARCHAR"/>
             <result property="refundOrderSn" column="refund_order_sn" jdbcType="VARCHAR"/>
-            <result property="refundAmount" column="refund_amount" jdbcType="DECIMAL"/>
+            <result property="refundAmount" column="refund_amount" jdbcType="INTEGER"/>
+            <result property="message" column="message" jdbcType="VARCHAR"/>
             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
             <result property="modifiedTime" column="modified_time" jdbcType="TIMESTAMP"/>
     </resultMap>
 
     <sql id="Base_Column_List">
         id,order_sn,refund_order_sn,
-        refund_amount,create_time,modified_time
+        refund_amount,message,create_time,
+        modified_time
     </sql>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -32,11 +34,11 @@
     <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.RefundOrder" useGeneratedKeys="true">
         insert into refund_order
         ( id,order_sn,refund_order_sn
-        ,refund_amount,create_time,modified_time
-        )
+        ,refund_amount,message,create_time
+        ,modified_time)
         values (#{id,jdbcType=INTEGER},#{orderSn,jdbcType=VARCHAR},#{refundOrderSn,jdbcType=VARCHAR}
-        ,#{refundAmount,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{modifiedTime,jdbcType=TIMESTAMP}
-        )
+        ,#{refundAmount,jdbcType=INTEGER},#{message,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP}
+        ,#{modifiedTime,jdbcType=TIMESTAMP})
     </insert>
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.RefundOrder" useGeneratedKeys="true">
         insert into refund_order
@@ -53,7 +55,7 @@
                 <if test="id != null">#{id,jdbcType=INTEGER},</if>
                 <if test="orderSn != null">#{orderSn,jdbcType=VARCHAR},</if>
                 <if test="refundOrderSn != null">#{refundOrderSn,jdbcType=VARCHAR},</if>
-                <if test="refundAmount != null">#{refundAmount,jdbcType=DECIMAL},</if>
+                <if test="refundAmount != null">#{refundAmount,jdbcType=INTEGER},</if>
                 <if test="message != null">#{message,jdbcType=VARCHAR},</if>
                 <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
                 <if test="modifiedTime != null">#{modifiedTime,jdbcType=TIMESTAMP},</if>
@@ -69,7 +71,10 @@
                     refund_order_sn = #{refundOrderSn,jdbcType=VARCHAR},
                 </if>
                 <if test="refundAmount != null">
-                    refund_amount = #{refundAmount,jdbcType=DECIMAL},
+                    refund_amount = #{refundAmount,jdbcType=INTEGER},
+                </if>
+                <if test="message != null">
+                    message = #{message,jdbcType=VARCHAR},
                 </if>
                 <if test="createTime != null">
                     create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -85,7 +90,8 @@
         set 
             order_sn =  #{orderSn,jdbcType=VARCHAR},
             refund_order_sn =  #{refundOrderSn,jdbcType=VARCHAR},
-            refund_amount =  #{refundAmount,jdbcType=DECIMAL},
+            refund_amount =  #{refundAmount,jdbcType=INTEGER},
+            message =  #{message,jdbcType=VARCHAR},
             create_time =  #{createTime,jdbcType=TIMESTAMP},
             modified_time =  #{modifiedTime,jdbcType=TIMESTAMP}
         where   id = #{id,jdbcType=INTEGER} 

BIN
dao/target/aska-dao-1.0.jar


BIN
dao/target/classes/com/mofangchuxing/aska/dao/domain/AskaChannelcouponnos.class


BIN
dao/target/classes/com/mofangchuxing/aska/dao/domain/AskaChannels.class


BIN
dao/target/classes/com/mofangchuxing/aska/dao/domain/AskaRetails.class


BIN
dao/target/classes/com/mofangchuxing/aska/dao/domain/AskaSplitrecord.class


BIN
dao/target/classes/com/mofangchuxing/aska/dao/domain/PayRequest.class


BIN
dao/target/classes/com/mofangchuxing/aska/dao/domain/RefundOrder.class


BIN
dao/target/classes/com/mofangchuxing/aska/dao/mapper/AskaChannelcouponnosMapper.class


BIN
dao/target/classes/com/mofangchuxing/aska/dao/mapper/AskaRetailsMapper.class


BIN
dao/target/classes/com/mofangchuxing/aska/dao/mapper/AskaSplitrecordMapper.class


+ 112 - 0
dao/target/classes/mapper/AskaChannelcouponnosMapper.xml

@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.mofangchuxing.aska.dao.mapper.AskaChannelcouponnosMapper">
+
+    <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="channelId" column="channelId" jdbcType="INTEGER"/>
+            <result property="channelNo" column="channelNo" jdbcType="CHAR"/>
+            <result property="couponNo" column="couponNo" jdbcType="CHAR"/>
+            <result property="status" column="status" jdbcType="CHAR"/>
+            <result property="outDate" column="outDate" jdbcType="DATE"/>
+            <result property="value" column="value" jdbcType="INTEGER"/>
+            <result property="price" column="price" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,channelId,channelNo,
+        couponNo,status,outDate,
+        value,price
+    </sql>
+
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from aska_channelCouponNos
+        where  id = #{id,jdbcType=INTEGER} 
+    </select>
+    <select id="searchAllByCouponNo" resultType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
+        select
+        <include refid="Base_Column_List" />
+        from aska_channelCouponNos
+        where couponNo = #{couponNo} limit 1
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        delete from aska_channelCouponNos
+        where  id = #{id,jdbcType=INTEGER} 
+    </delete>
+    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos" useGeneratedKeys="true">
+        insert into aska_channelCouponNos
+        ( id,channelId,channelNo
+        ,couponNo,status,outDate
+        ,value,price)
+        values (#{id,jdbcType=INTEGER},#{channelId,jdbcType=INTEGER},#{channelNo,jdbcType=CHAR}
+        ,#{couponNo,jdbcType=CHAR},#{status,jdbcType=CHAR},#{outDate,jdbcType=DATE}
+        ,#{value,jdbcType=INTEGER},#{price,jdbcType=INTEGER})
+    </insert>
+    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos" useGeneratedKeys="true">
+        insert into aska_channelCouponNos
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                <if test="id != null">id,</if>
+                <if test="channelId != null">channelId,</if>
+                <if test="channelNo != null">channelNo,</if>
+                <if test="couponNo != null">couponNo,</if>
+                <if test="status != null">status,</if>
+                <if test="outDate != null">outDate,</if>
+                <if test="value != null">value,</if>
+                <if test="price != null">price,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                <if test="id != null">#{id,jdbcType=INTEGER},</if>
+                <if test="channelId != null">#{channelId,jdbcType=INTEGER},</if>
+                <if test="channelNo != null">#{channelNo,jdbcType=CHAR},</if>
+                <if test="couponNo != null">#{couponNo,jdbcType=CHAR},</if>
+                <if test="status != null">#{status,jdbcType=CHAR},</if>
+                <if test="outDate != null">#{outDate,jdbcType=DATE},</if>
+                <if test="value != null">#{value,jdbcType=INTEGER},</if>
+                <if test="price != null">#{price,jdbcType=INTEGER},</if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
+        update aska_channelCouponNos
+        <set>
+                <if test="channelId != null">
+                    channelId = #{channelId,jdbcType=INTEGER},
+                </if>
+                <if test="channelNo != null">
+                    channelNo = #{channelNo,jdbcType=CHAR},
+                </if>
+                <if test="couponNo != null">
+                    couponNo = #{couponNo,jdbcType=CHAR},
+                </if>
+                <if test="status != null">
+                    status = #{status,jdbcType=CHAR},
+                </if>
+                <if test="outDate != null">
+                    outDate = #{outDate,jdbcType=DATE},
+                </if>
+                <if test="value != null">
+                    value = #{value,jdbcType=INTEGER},
+                </if>
+                <if test="price != null">
+                    price = #{price,jdbcType=INTEGER},
+                </if>
+        </set>
+        where   id = #{id,jdbcType=INTEGER} 
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos">
+        update aska_channelCouponNos
+        set 
+            channelId =  #{channelId,jdbcType=INTEGER},
+            channelNo =  #{channelNo,jdbcType=CHAR},
+            couponNo =  #{couponNo,jdbcType=CHAR},
+            status =  #{status,jdbcType=CHAR},
+            outDate =  #{outDate,jdbcType=DATE},
+            value =  #{value,jdbcType=INTEGER},
+            price =  #{price,jdbcType=INTEGER}
+        where   id = #{id,jdbcType=INTEGER} 
+    </update>
+</mapper>

+ 94 - 36
dao/target/classes/mapper/AskaChannelsMapper.xml

@@ -12,21 +12,30 @@
             <result property="phone" column="phone" jdbcType="CHAR"/>
             <result property="note" column="note" jdbcType="VARCHAR"/>
             <result property="account" column="account" jdbcType="VARCHAR"/>
-            <result property="accountname" column="accountName" jdbcType="VARCHAR"/>
+            <result property="accountName" column="accountName" jdbcType="VARCHAR"/>
+            <result property="accountType" column="accountType" jdbcType="CHAR"/>
+            <result property="relation" column="relation" jdbcType="CHAR"/>
             <result property="apiv3" column="apiv3" jdbcType="VARCHAR"/>
-            <result property="certpath" column="certPath" jdbcType="VARCHAR"/>
+            <result property="certPath" column="certPath" jdbcType="VARCHAR"/>
             <result property="tripartite" column="tripartite" jdbcType="CHAR"/>
             <result property="tripvalue" column="tripvalue" jdbcType="INTEGER"/>
-            <result property="realtimesplit" column="realtimeSplit" jdbcType="INTEGER"/>
+            <result property="realtimeSplit" column="realtimeSplit" jdbcType="INTEGER"/>
             <result property="status" column="status" jdbcType="CHAR"/>
+            <result property="totalIncome" column="totalIncome" jdbcType="INTEGER"/>
+            <result property="totalSplit" column="totalSplit" jdbcType="INTEGER"/>
+            <result property="totalCashOut" column="totalCashOut" jdbcType="INTEGER"/>
+            <result property="totalRefund" column="totalRefund" jdbcType="INTEGER"/>
+            <result property="balance" column="balance" jdbcType="INTEGER"/>
     </resultMap>
 
     <sql id="Base_Column_List">
         id,name,prefix,
         ownerId,phone,note,
-        account,accountName,apiv3,
-        certPath,tripartite,tripvalue,
-        realtimeSplit,status
+        account,accountName,accountType,
+        relation,apiv3,certPath,
+        tripartite,tripvalue,realtimeSplit,
+        status,totalIncome,totalSplit,
+        totalCashOut,totalRefund,balance
     </sql>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -35,13 +44,14 @@
         from aska_channels
         where  id = #{id,jdbcType=INTEGER} 
     </select>
+
     <select id="getAllChannels" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List" />
         from aska_channels
         where 1=1 <if test="channelName != null">
-            and name = #{channelName,jdbcType=CHAR},
-        </if>
+        and name = #{channelName,jdbcType=CHAR},
+    </if>
     </select>
 
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
@@ -52,14 +62,20 @@
         insert into aska_channels
         ( id,name,prefix
         ,ownerId,phone,note
-        ,account,accountName,apiv3
-        ,certPath,tripartite,tripvalue
-        ,realtimeSplit,status)
+        ,account,accountName,accountType
+        ,relation,apiv3,certPath
+        ,tripartite,tripvalue,realtimeSplit
+        ,status,totalIncome,totalSplit
+        ,totalCashOut,totalRefund,balance
+        )
         values (#{id,jdbcType=INTEGER},#{name,jdbcType=CHAR},#{prefix,jdbcType=CHAR}
-        ,#{ownerid,jdbcType=INTEGER},#{phone,jdbcType=CHAR},#{note,jdbcType=VARCHAR}
-        ,#{account,jdbcType=VARCHAR},#{accountname,jdbcType=VARCHAR},#{apiv3,jdbcType=VARCHAR}
-        ,#{certpath,jdbcType=VARCHAR},#{tripartite,jdbcType=CHAR},#{tripvalue,jdbcType=INTEGER}
-        ,#{realtimesplit,jdbcType=INTEGER},#{status,jdbcType=CHAR})
+        ,#{ownerId,jdbcType=INTEGER},#{phone,jdbcType=CHAR},#{note,jdbcType=VARCHAR}
+        ,#{account,jdbcType=VARCHAR},#{accountName,jdbcType=VARCHAR},#{accountType,jdbcType=CHAR}
+        ,#{relation,jdbcType=CHAR},#{apiv3,jdbcType=VARCHAR},#{certPath,jdbcType=VARCHAR}
+        ,#{tripartite,jdbcType=CHAR},#{tripvalue,jdbcType=INTEGER},#{realtimeSplit,jdbcType=INTEGER}
+        ,#{status,jdbcType=CHAR},#{totalIncome,jdbcType=INTEGER},#{totalSplit,jdbcType=INTEGER}
+        ,#{totalCashOut,jdbcType=INTEGER},#{totalRefund,jdbcType=INTEGER},#{balance,jdbcType=INTEGER}
+        )
     </insert>
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannels" useGeneratedKeys="true">
         insert into aska_channels
@@ -67,33 +83,47 @@
                 <if test="id != null">id,</if>
                 <if test="name != null">name,</if>
                 <if test="prefix != null">prefix,</if>
-                <if test="ownerid != null">ownerId,</if>
+                <if test="ownerId != null">ownerId,</if>
                 <if test="phone != null">phone,</if>
                 <if test="note != null">note,</if>
                 <if test="account != null">account,</if>
-                <if test="accountname != null">accountName,</if>
+                <if test="accountName != null">accountName,</if>
+                <if test="accountType != null">accountType,</if>
+                <if test="relation != null">relation,</if>
                 <if test="apiv3 != null">apiv3,</if>
-                <if test="certpath != null">certPath,</if>
+                <if test="certPath != null">certPath,</if>
                 <if test="tripartite != null">tripartite,</if>
                 <if test="tripvalue != null">tripvalue,</if>
-                <if test="realtimesplit != null">realtimeSplit,</if>
+                <if test="realtimeSplit != null">realtimeSplit,</if>
                 <if test="status != null">status,</if>
+                <if test="totalIncome != null">totalIncome,</if>
+                <if test="totalSplit != null">totalSplit,</if>
+                <if test="totalCashOut != null">totalCashOut,</if>
+                <if test="totalRefund != null">totalRefund,</if>
+                <if test="balance != null">balance,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
                 <if test="id != null">#{id,jdbcType=INTEGER},</if>
                 <if test="name != null">#{name,jdbcType=CHAR},</if>
                 <if test="prefix != null">#{prefix,jdbcType=CHAR},</if>
-                <if test="ownerid != null">#{ownerid,jdbcType=INTEGER},</if>
+                <if test="ownerId != null">#{ownerId,jdbcType=INTEGER},</if>
                 <if test="phone != null">#{phone,jdbcType=CHAR},</if>
                 <if test="note != null">#{note,jdbcType=VARCHAR},</if>
                 <if test="account != null">#{account,jdbcType=VARCHAR},</if>
-                <if test="accountname != null">#{accountname,jdbcType=VARCHAR},</if>
+                <if test="accountName != null">#{accountName,jdbcType=VARCHAR},</if>
+                <if test="accountType != null">#{accountType,jdbcType=CHAR},</if>
+                <if test="relation != null">#{relation,jdbcType=CHAR},</if>
                 <if test="apiv3 != null">#{apiv3,jdbcType=VARCHAR},</if>
-                <if test="certpath != null">#{certpath,jdbcType=VARCHAR},</if>
+                <if test="certPath != null">#{certPath,jdbcType=VARCHAR},</if>
                 <if test="tripartite != null">#{tripartite,jdbcType=CHAR},</if>
                 <if test="tripvalue != null">#{tripvalue,jdbcType=INTEGER},</if>
-                <if test="realtimesplit != null">#{realtimesplit,jdbcType=INTEGER},</if>
+                <if test="realtimeSplit != null">#{realtimeSplit,jdbcType=INTEGER},</if>
                 <if test="status != null">#{status,jdbcType=CHAR},</if>
+                <if test="totalIncome != null">#{totalIncome,jdbcType=INTEGER},</if>
+                <if test="totalSplit != null">#{totalSplit,jdbcType=INTEGER},</if>
+                <if test="totalCashOut != null">#{totalCashOut,jdbcType=INTEGER},</if>
+                <if test="totalRefund != null">#{totalRefund,jdbcType=INTEGER},</if>
+                <if test="balance != null">#{balance,jdbcType=INTEGER},</if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannels">
@@ -105,8 +135,8 @@
                 <if test="prefix != null">
                     prefix = #{prefix,jdbcType=CHAR},
                 </if>
-                <if test="ownerid != null">
-                    ownerId = #{ownerid,jdbcType=INTEGER},
+                <if test="ownerId != null">
+                    ownerId = #{ownerId,jdbcType=INTEGER},
                 </if>
                 <if test="phone != null">
                     phone = #{phone,jdbcType=CHAR},
@@ -117,14 +147,20 @@
                 <if test="account != null">
                     account = #{account,jdbcType=VARCHAR},
                 </if>
-                <if test="accountname != null">
-                    accountName = #{accountname,jdbcType=VARCHAR},
+                <if test="accountName != null">
+                    accountName = #{accountName,jdbcType=VARCHAR},
+                </if>
+                <if test="accountType != null">
+                    accountType = #{accountType,jdbcType=CHAR},
+                </if>
+                <if test="relation != null">
+                    relation = #{relation,jdbcType=CHAR},
                 </if>
                 <if test="apiv3 != null">
                     apiv3 = #{apiv3,jdbcType=VARCHAR},
                 </if>
-                <if test="certpath != null">
-                    certPath = #{certpath,jdbcType=VARCHAR},
+                <if test="certPath != null">
+                    certPath = #{certPath,jdbcType=VARCHAR},
                 </if>
                 <if test="tripartite != null">
                     tripartite = #{tripartite,jdbcType=CHAR},
@@ -132,12 +168,27 @@
                 <if test="tripvalue != null">
                     tripvalue = #{tripvalue,jdbcType=INTEGER},
                 </if>
-                <if test="realtimesplit != null">
-                    realtimeSplit = #{realtimesplit,jdbcType=INTEGER},
+                <if test="realtimeSplit != null">
+                    realtimeSplit = #{realtimeSplit,jdbcType=INTEGER},
                 </if>
                 <if test="status != null">
                     status = #{status,jdbcType=CHAR},
                 </if>
+                <if test="totalIncome != null">
+                    totalIncome = #{totalIncome,jdbcType=INTEGER},
+                </if>
+                <if test="totalSplit != null">
+                    totalSplit = #{totalSplit,jdbcType=INTEGER},
+                </if>
+                <if test="totalCashOut != null">
+                    totalCashOut = #{totalCashOut,jdbcType=INTEGER},
+                </if>
+                <if test="totalRefund != null">
+                    totalRefund = #{totalRefund,jdbcType=INTEGER},
+                </if>
+                <if test="balance != null">
+                    balance = #{balance,jdbcType=INTEGER},
+                </if>
         </set>
         where   id = #{id,jdbcType=INTEGER} 
     </update>
@@ -146,17 +197,24 @@
         set 
             name =  #{name,jdbcType=CHAR},
             prefix =  #{prefix,jdbcType=CHAR},
-            ownerId =  #{ownerid,jdbcType=INTEGER},
+            ownerId =  #{ownerId,jdbcType=INTEGER},
             phone =  #{phone,jdbcType=CHAR},
             note =  #{note,jdbcType=VARCHAR},
             account =  #{account,jdbcType=VARCHAR},
-            accountName =  #{accountname,jdbcType=VARCHAR},
+            accountName =  #{accountName,jdbcType=VARCHAR},
+            accountType =  #{accountType,jdbcType=CHAR},
+            relation =  #{relation,jdbcType=CHAR},
             apiv3 =  #{apiv3,jdbcType=VARCHAR},
-            certPath =  #{certpath,jdbcType=VARCHAR},
+            certPath =  #{certPath,jdbcType=VARCHAR},
             tripartite =  #{tripartite,jdbcType=CHAR},
             tripvalue =  #{tripvalue,jdbcType=INTEGER},
-            realtimeSplit =  #{realtimesplit,jdbcType=INTEGER},
-            status =  #{status,jdbcType=CHAR}
+            realtimeSplit =  #{realtimeSplit,jdbcType=INTEGER},
+            status =  #{status,jdbcType=CHAR},
+            totalIncome =  #{totalIncome,jdbcType=INTEGER},
+            totalSplit =  #{totalSplit,jdbcType=INTEGER},
+            totalCashOut =  #{totalCashOut,jdbcType=INTEGER},
+            totalRefund =  #{totalRefund,jdbcType=INTEGER},
+            balance =  #{balance,jdbcType=INTEGER}
         where   id = #{id,jdbcType=INTEGER} 
     </update>
 </mapper>

+ 107 - 36
dao/target/classes/mapper/AskaRetailsMapper.xml

@@ -11,26 +11,35 @@
             <result property="type" column="type" jdbcType="CHAR"/>
             <result property="lat" column="lat" jdbcType="DOUBLE"/>
             <result property="lng" column="lng" jdbcType="DOUBLE"/>
-            <result property="ownerid" column="ownerId" jdbcType="INTEGER"/>
+            <result property="ownerId" column="ownerId" jdbcType="INTEGER"/>
             <result property="phone" column="phone" jdbcType="CHAR"/>
             <result property="note" column="note" jdbcType="VARCHAR"/>
             <result property="account" column="account" jdbcType="VARCHAR"/>
-            <result property="accountname" column="accountName" jdbcType="VARCHAR"/>
+            <result property="accountName" column="accountName" jdbcType="VARCHAR"/>
+            <result property="accountType" column="accountType" jdbcType="CHAR"/>
+            <result property="relation" column="relation" jdbcType="CHAR"/>
             <result property="apiv3" column="apiv3" jdbcType="VARCHAR"/>
-            <result property="certpath" column="certPath" jdbcType="VARCHAR"/>
+            <result property="certPath" column="certPath" jdbcType="VARCHAR"/>
             <result property="tripartite" column="tripartite" jdbcType="CHAR"/>
             <result property="tripvalue" column="tripvalue" jdbcType="INTEGER"/>
-            <result property="realtimesplit" column="realtimeSplit" jdbcType="INTEGER"/>
+            <result property="realtimeSplit" column="realtimeSplit" jdbcType="INTEGER"/>
             <result property="status" column="status" jdbcType="CHAR"/>
+            <result property="totalIncome" column="totalIncome" jdbcType="INTEGER"/>
+            <result property="totalSplit" column="totalSplit" jdbcType="INTEGER"/>
+            <result property="totalCashOut" column="totalCashOut" jdbcType="INTEGER"/>
+            <result property="totalRefund" column="totalRefund" jdbcType="INTEGER"/>
+            <result property="balance" column="balance" jdbcType="INTEGER"/>
     </resultMap>
 
     <sql id="Base_Column_List">
         id,name,address,
         type,lat,lng,
         ownerId,phone,note,
-        account,accountName,apiv3,
-        certPath,tripartite,tripvalue,
-        realtimeSplit,status
+        account,accountName,accountType,
+        relation,apiv3,certPath,
+        tripartite,tripvalue,realtimeSplit,
+        status,totalIncome,totalSplit,
+        totalCashOut,totalRefund,balance
     </sql>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -39,10 +48,24 @@
         from aska_retails
         where  id = #{id,jdbcType=INTEGER} 
     </select>
-    <select id="listAllRetails" resultType="com.mofangchuxing.aska.dao.domain.AskaRetails">
+
+    <select id="listAllRetails" resultType="com.mofangchuxing.aska.domain.vo.AskaRetailsVo">
         select
         <include refid="Base_Column_List" />
         from aska_retails
+        where 1=1
+        <if test="name != null">
+            and name = #{name}
+        </if>
+        <if test="status != null">
+            and status = #{status}
+        </if>
+    </select>
+    <select id="listAllRetailsNoLimit" resultType="com.mofangchuxing.aska.domain.vo.AskaRetailsVo">
+        select id as retailId,
+               name as retailName,
+               lat,lng,address,status
+        from aska_retails
     </select>
 
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
@@ -54,15 +77,21 @@
         ( id,name,address
         ,type,lat,lng
         ,ownerId,phone,note
-        ,account,accountName,apiv3
-        ,certPath,tripartite,tripvalue
-        ,realtimeSplit,status)
+        ,account,accountName,accountType
+        ,relation,apiv3,certPath
+        ,tripartite,tripvalue,realtimeSplit
+        ,status,totalIncome,totalSplit
+        ,totalCashOut,totalRefund,balance
+        )
         values (#{id,jdbcType=INTEGER},#{name,jdbcType=CHAR},#{address,jdbcType=VARCHAR}
         ,#{type,jdbcType=CHAR},#{lat,jdbcType=DOUBLE},#{lng,jdbcType=DOUBLE}
-        ,#{ownerid,jdbcType=INTEGER},#{phone,jdbcType=CHAR},#{note,jdbcType=VARCHAR}
-        ,#{account,jdbcType=VARCHAR},#{accountname,jdbcType=VARCHAR},#{apiv3,jdbcType=VARCHAR}
-        ,#{certpath,jdbcType=VARCHAR},#{tripartite,jdbcType=CHAR},#{tripvalue,jdbcType=INTEGER}
-        ,#{realtimesplit,jdbcType=INTEGER},#{status,jdbcType=CHAR})
+        ,#{ownerId,jdbcType=INTEGER},#{phone,jdbcType=CHAR},#{note,jdbcType=VARCHAR}
+        ,#{account,jdbcType=VARCHAR},#{accountName,jdbcType=VARCHAR},#{accountType,jdbcType=CHAR}
+        ,#{relation,jdbcType=CHAR},#{apiv3,jdbcType=VARCHAR},#{certPath,jdbcType=VARCHAR}
+        ,#{tripartite,jdbcType=CHAR},#{tripvalue,jdbcType=INTEGER},#{realtimeSplit,jdbcType=INTEGER}
+        ,#{status,jdbcType=CHAR},#{totalIncome,jdbcType=INTEGER},#{totalSplit,jdbcType=INTEGER}
+        ,#{totalCashOut,jdbcType=INTEGER},#{totalRefund,jdbcType=INTEGER},#{balance,jdbcType=INTEGER}
+        )
     </insert>
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaRetails" useGeneratedKeys="true">
         insert into aska_retails
@@ -73,17 +102,24 @@
                 <if test="type != null">type,</if>
                 <if test="lat != null">lat,</if>
                 <if test="lng != null">lng,</if>
-                <if test="ownerid != null">ownerId,</if>
+                <if test="ownerId != null">ownerId,</if>
                 <if test="phone != null">phone,</if>
                 <if test="note != null">note,</if>
                 <if test="account != null">account,</if>
-                <if test="accountname != null">accountName,</if>
+                <if test="accountName != null">accountName,</if>
+                <if test="accountType != null">accountType,</if>
+                <if test="relation != null">relation,</if>
                 <if test="apiv3 != null">apiv3,</if>
-                <if test="certpath != null">certPath,</if>
+                <if test="certPath != null">certPath,</if>
                 <if test="tripartite != null">tripartite,</if>
                 <if test="tripvalue != null">tripvalue,</if>
-                <if test="realtimesplit != null">realtimeSplit,</if>
+                <if test="realtimeSplit != null">realtimeSplit,</if>
                 <if test="status != null">status,</if>
+                <if test="totalIncome != null">totalIncome,</if>
+                <if test="totalSplit != null">totalSplit,</if>
+                <if test="totalCashOut != null">totalCashOut,</if>
+                <if test="totalRefund != null">totalRefund,</if>
+                <if test="balance != null">balance,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
                 <if test="id != null">#{id,jdbcType=INTEGER},</if>
@@ -92,17 +128,24 @@
                 <if test="type != null">#{type,jdbcType=CHAR},</if>
                 <if test="lat != null">#{lat,jdbcType=DOUBLE},</if>
                 <if test="lng != null">#{lng,jdbcType=DOUBLE},</if>
-                <if test="ownerid != null">#{ownerid,jdbcType=INTEGER},</if>
+                <if test="ownerId != null">#{ownerId,jdbcType=INTEGER},</if>
                 <if test="phone != null">#{phone,jdbcType=CHAR},</if>
                 <if test="note != null">#{note,jdbcType=VARCHAR},</if>
                 <if test="account != null">#{account,jdbcType=VARCHAR},</if>
-                <if test="accountname != null">#{accountname,jdbcType=VARCHAR},</if>
+                <if test="accountName != null">#{accountName,jdbcType=VARCHAR},</if>
+                <if test="accountType != null">#{accountType,jdbcType=CHAR},</if>
+                <if test="relation != null">#{relation,jdbcType=CHAR},</if>
                 <if test="apiv3 != null">#{apiv3,jdbcType=VARCHAR},</if>
-                <if test="certpath != null">#{certpath,jdbcType=VARCHAR},</if>
+                <if test="certPath != null">#{certPath,jdbcType=VARCHAR},</if>
                 <if test="tripartite != null">#{tripartite,jdbcType=CHAR},</if>
                 <if test="tripvalue != null">#{tripvalue,jdbcType=INTEGER},</if>
-                <if test="realtimesplit != null">#{realtimesplit,jdbcType=INTEGER},</if>
+                <if test="realtimeSplit != null">#{realtimeSplit,jdbcType=INTEGER},</if>
                 <if test="status != null">#{status,jdbcType=CHAR},</if>
+                <if test="totalIncome != null">#{totalIncome,jdbcType=INTEGER},</if>
+                <if test="totalSplit != null">#{totalSplit,jdbcType=INTEGER},</if>
+                <if test="totalCashOut != null">#{totalCashOut,jdbcType=INTEGER},</if>
+                <if test="totalRefund != null">#{totalRefund,jdbcType=INTEGER},</if>
+                <if test="balance != null">#{balance,jdbcType=INTEGER},</if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaRetails">
@@ -123,8 +166,8 @@
                 <if test="lng != null">
                     lng = #{lng,jdbcType=DOUBLE},
                 </if>
-                <if test="ownerid != null">
-                    ownerId = #{ownerid,jdbcType=INTEGER},
+                <if test="ownerId != null">
+                    ownerId = #{ownerId,jdbcType=INTEGER},
                 </if>
                 <if test="phone != null">
                     phone = #{phone,jdbcType=CHAR},
@@ -135,14 +178,20 @@
                 <if test="account != null">
                     account = #{account,jdbcType=VARCHAR},
                 </if>
-                <if test="accountname != null">
-                    accountName = #{accountname,jdbcType=VARCHAR},
+                <if test="accountName != null">
+                    accountName = #{accountName,jdbcType=VARCHAR},
+                </if>
+                <if test="accountType != null">
+                    accountType = #{accountType,jdbcType=CHAR},
+                </if>
+                <if test="relation != null">
+                    relation = #{relation,jdbcType=CHAR},
                 </if>
                 <if test="apiv3 != null">
                     apiv3 = #{apiv3,jdbcType=VARCHAR},
                 </if>
-                <if test="certpath != null">
-                    certPath = #{certpath,jdbcType=VARCHAR},
+                <if test="certPath != null">
+                    certPath = #{certPath,jdbcType=VARCHAR},
                 </if>
                 <if test="tripartite != null">
                     tripartite = #{tripartite,jdbcType=CHAR},
@@ -150,12 +199,27 @@
                 <if test="tripvalue != null">
                     tripvalue = #{tripvalue,jdbcType=INTEGER},
                 </if>
-                <if test="realtimesplit != null">
-                    realtimeSplit = #{realtimesplit,jdbcType=INTEGER},
+                <if test="realtimeSplit != null">
+                    realtimeSplit = #{realtimeSplit,jdbcType=INTEGER},
                 </if>
                 <if test="status != null">
                     status = #{status,jdbcType=CHAR},
                 </if>
+                <if test="totalIncome != null">
+                    totalIncome = #{totalIncome,jdbcType=INTEGER},
+                </if>
+                <if test="totalSplit != null">
+                    totalSplit = #{totalSplit,jdbcType=INTEGER},
+                </if>
+                <if test="totalCashOut != null">
+                    totalCashOut = #{totalCashOut,jdbcType=INTEGER},
+                </if>
+                <if test="totalRefund != null">
+                    totalRefund = #{totalRefund,jdbcType=INTEGER},
+                </if>
+                <if test="balance != null">
+                    balance = #{balance,jdbcType=INTEGER},
+                </if>
         </set>
         where   id = #{id,jdbcType=INTEGER} 
     </update>
@@ -167,17 +231,24 @@
             type =  #{type,jdbcType=CHAR},
             lat =  #{lat,jdbcType=DOUBLE},
             lng =  #{lng,jdbcType=DOUBLE},
-            ownerId =  #{ownerid,jdbcType=INTEGER},
+            ownerId =  #{ownerId,jdbcType=INTEGER},
             phone =  #{phone,jdbcType=CHAR},
             note =  #{note,jdbcType=VARCHAR},
             account =  #{account,jdbcType=VARCHAR},
-            accountName =  #{accountname,jdbcType=VARCHAR},
+            accountName =  #{accountName,jdbcType=VARCHAR},
+            accountType =  #{accountType,jdbcType=CHAR},
+            relation =  #{relation,jdbcType=CHAR},
             apiv3 =  #{apiv3,jdbcType=VARCHAR},
-            certPath =  #{certpath,jdbcType=VARCHAR},
+            certPath =  #{certPath,jdbcType=VARCHAR},
             tripartite =  #{tripartite,jdbcType=CHAR},
             tripvalue =  #{tripvalue,jdbcType=INTEGER},
-            realtimeSplit =  #{realtimesplit,jdbcType=INTEGER},
-            status =  #{status,jdbcType=CHAR}
+            realtimeSplit =  #{realtimeSplit,jdbcType=INTEGER},
+            status =  #{status,jdbcType=CHAR},
+            totalIncome =  #{totalIncome,jdbcType=INTEGER},
+            totalSplit =  #{totalSplit,jdbcType=INTEGER},
+            totalCashOut =  #{totalCashOut,jdbcType=INTEGER},
+            totalRefund =  #{totalRefund,jdbcType=INTEGER},
+            balance =  #{balance,jdbcType=INTEGER}
         where   id = #{id,jdbcType=INTEGER} 
     </update>
 </mapper>

+ 241 - 0
dao/target/classes/mapper/AskaSplitrecordMapper.xml

@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.mofangchuxing.aska.dao.mapper.AskaSplitrecordMapper">
+
+    <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.AskaSplitrecord">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="payId" column="payId" jdbcType="INTEGER"/>
+            <result property="spiltOrderId" column="spiltOrderId" jdbcType="VARCHAR"/>
+            <result property="payAmount" column="payAmount" jdbcType="INTEGER"/>
+            <result property="retailId" column="retailId" jdbcType="INTEGER"/>
+            <result property="retailName" column="retailName" jdbcType="VARCHAR"/>
+            <result property="retailAccount" column="retailAccount" jdbcType="VARCHAR"/>
+            <result property="retailAmount" column="retailAmount" jdbcType="VARCHAR"/>
+            <result property="retailRealtimeAmount" column="retailRealtimeAmount" jdbcType="INTEGER"/>
+            <result property="retailAccountAmount" column="retailAccountAmount" jdbcType="INTEGER"/>
+            <result property="retailSplitrule" column="retailSplitrule" jdbcType="VARCHAR"/>
+            <result property="channelId" column="channelId" jdbcType="INTEGER"/>
+            <result property="channelName" column="channelName" jdbcType="VARCHAR"/>
+            <result property="channelAccount" column="channelAccount" jdbcType="VARCHAR"/>
+            <result property="channelAmount" column="channelAmount" jdbcType="VARCHAR"/>
+            <result property="channelRealtimeAmount" column="channelRealtimeAmount" jdbcType="INTEGER"/>
+            <result property="channelAccountAmount" column="channelAccountAmount" jdbcType="INTEGER"/>
+            <result property="channelSplitRule" column="channelSplitRule" jdbcType="VARCHAR"/>
+            <result property="status" column="status" jdbcType="INTEGER"/>
+            <result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
+            <result property="hasRefund" column="hasRefund" jdbcType="INTEGER"/>
+            <result property="refundTotal" column="refundTotal" jdbcType="INTEGER"/>
+            <result property="refundRetail" column="refundRetail" jdbcType="INTEGER"/>
+            <result property="refundChannel" column="refundChannel" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,payId,spiltOrderId,
+        payAmount,retailId,retailName,
+        retailAccount,retailAmount,retailRealtimeAmount,
+        retailAccountAmount,retailSplitrule,channelId,
+        channelName,channelAccount,channelAmount,
+        channelRealtimeAmount,channelAccountAmount,channelSplitRule,
+        status,createTime,hasRefund,
+        refundTotal,refundRetail,refundChannel
+    </sql>
+
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from aska_splitRecord
+        where  id = #{id,jdbcType=INTEGER} 
+    </select>
+    <select id="selectAllByPayId" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from aska_splitRecord
+        where payId = #{payId} limit 1
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        delete from aska_splitRecord
+        where  id = #{id,jdbcType=INTEGER} 
+    </delete>
+    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaSplitrecord" useGeneratedKeys="true">
+        insert into aska_splitRecord
+        ( id,payId,spiltOrderId
+        ,payAmount,retailId,retailName
+        ,retailAccount,retailAmount,retailRealtimeAmount
+        ,retailAccountAmount,retailSplitrule,channelId
+        ,channelName,channelAccount,channelAmount
+        ,channelRealtimeAmount,channelAccountAmount,channelSplitRule
+        ,status,createTime,hasRefund
+        ,refundTotal,refundRetail,refundChannel
+        )
+        values (#{id,jdbcType=INTEGER},#{payId,jdbcType=INTEGER},#{spiltOrderId,jdbcType=VARCHAR}
+        ,#{payAmount,jdbcType=INTEGER},#{retailId,jdbcType=INTEGER},#{retailName,jdbcType=VARCHAR}
+        ,#{retailAccount,jdbcType=VARCHAR},#{retailAmount,jdbcType=VARCHAR},#{retailRealtimeAmount,jdbcType=INTEGER}
+        ,#{retailAccountAmount,jdbcType=INTEGER},#{retailSplitrule,jdbcType=VARCHAR},#{channelId,jdbcType=INTEGER}
+        ,#{channelName,jdbcType=VARCHAR},#{channelAccount,jdbcType=VARCHAR},#{channelAmount,jdbcType=VARCHAR}
+        ,#{channelRealtimeAmount,jdbcType=INTEGER},#{channelAccountAmount,jdbcType=INTEGER},#{channelSplitRule,jdbcType=VARCHAR}
+        ,#{status,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{hasRefund,jdbcType=INTEGER}
+        ,#{refundTotal,jdbcType=INTEGER},#{refundRetail,jdbcType=INTEGER},#{refundChannel,jdbcType=INTEGER}
+        )
+    </insert>
+    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaSplitrecord" useGeneratedKeys="true">
+        insert into aska_splitRecord
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                <if test="id != null">id,</if>
+                <if test="payId != null">payId,</if>
+                <if test="spiltOrderId != null">spiltOrderId,</if>
+                <if test="payAmount != null">payAmount,</if>
+                <if test="retailId != null">retailId,</if>
+                <if test="retailName != null">retailName,</if>
+                <if test="retailAccount != null">retailAccount,</if>
+                <if test="retailAmount != null">retailAmount,</if>
+                <if test="retailRealtimeAmount != null">retailRealtimeAmount,</if>
+                <if test="retailAccountAmount != null">retailAccountAmount,</if>
+                <if test="retailSplitrule != null">retailSplitrule,</if>
+                <if test="channelId != null">channelId,</if>
+                <if test="channelName != null">channelName,</if>
+                <if test="channelAccount != null">channelAccount,</if>
+                <if test="channelAmount != null">channelAmount,</if>
+                <if test="channelRealtimeAmount != null">channelRealtimeAmount,</if>
+                <if test="channelAccountAmount != null">channelAccountAmount,</if>
+                <if test="channelSplitRule != null">channelSplitRule,</if>
+                <if test="status != null">status,</if>
+                <if test="createTime != null">createTime,</if>
+                <if test="hasRefund != null">hasRefund,</if>
+                <if test="refundTotal != null">refundTotal,</if>
+                <if test="refundRetail != null">refundRetail,</if>
+                <if test="refundChannel != null">refundChannel,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                <if test="id != null">#{id,jdbcType=INTEGER},</if>
+                <if test="payId != null">#{payId,jdbcType=INTEGER},</if>
+                <if test="spiltOrderId != null">#{spiltOrderId,jdbcType=VARCHAR},</if>
+                <if test="payAmount != null">#{payAmount,jdbcType=INTEGER},</if>
+                <if test="retailId != null">#{retailId,jdbcType=INTEGER},</if>
+                <if test="retailName != null">#{retailName,jdbcType=VARCHAR},</if>
+                <if test="retailAccount != null">#{retailAccount,jdbcType=VARCHAR},</if>
+                <if test="retailAmount != null">#{retailAmount,jdbcType=VARCHAR},</if>
+                <if test="retailRealtimeAmount != null">#{retailRealtimeAmount,jdbcType=INTEGER},</if>
+                <if test="retailAccountAmount != null">#{retailAccountAmount,jdbcType=INTEGER},</if>
+                <if test="retailSplitrule != null">#{retailSplitrule,jdbcType=VARCHAR},</if>
+                <if test="channelId != null">#{channelId,jdbcType=INTEGER},</if>
+                <if test="channelName != null">#{channelName,jdbcType=VARCHAR},</if>
+                <if test="channelAccount != null">#{channelAccount,jdbcType=VARCHAR},</if>
+                <if test="channelAmount != null">#{channelAmount,jdbcType=VARCHAR},</if>
+                <if test="channelRealtimeAmount != null">#{channelRealtimeAmount,jdbcType=INTEGER},</if>
+                <if test="channelAccountAmount != null">#{channelAccountAmount,jdbcType=INTEGER},</if>
+                <if test="channelSplitRule != null">#{channelSplitRule,jdbcType=VARCHAR},</if>
+                <if test="status != null">#{status,jdbcType=INTEGER},</if>
+                <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
+                <if test="hasRefund != null">#{hasRefund,jdbcType=INTEGER},</if>
+                <if test="refundTotal != null">#{refundTotal,jdbcType=INTEGER},</if>
+                <if test="refundRetail != null">#{refundRetail,jdbcType=INTEGER},</if>
+                <if test="refundChannel != null">#{refundChannel,jdbcType=INTEGER},</if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaSplitrecord">
+        update aska_splitRecord
+        <set>
+                <if test="payId != null">
+                    payId = #{payId,jdbcType=INTEGER},
+                </if>
+                <if test="spiltOrderId != null">
+                    spiltOrderId = #{spiltOrderId,jdbcType=VARCHAR},
+                </if>
+                <if test="payAmount != null">
+                    payAmount = #{payAmount,jdbcType=INTEGER},
+                </if>
+                <if test="retailId != null">
+                    retailId = #{retailId,jdbcType=INTEGER},
+                </if>
+                <if test="retailName != null">
+                    retailName = #{retailName,jdbcType=VARCHAR},
+                </if>
+                <if test="retailAccount != null">
+                    retailAccount = #{retailAccount,jdbcType=VARCHAR},
+                </if>
+                <if test="retailAmount != null">
+                    retailAmount = #{retailAmount,jdbcType=VARCHAR},
+                </if>
+                <if test="retailRealtimeAmount != null">
+                    retailRealtimeAmount = #{retailRealtimeAmount,jdbcType=INTEGER},
+                </if>
+                <if test="retailAccountAmount != null">
+                    retailAccountAmount = #{retailAccountAmount,jdbcType=INTEGER},
+                </if>
+                <if test="retailSplitrule != null">
+                    retailSplitrule = #{retailSplitrule,jdbcType=VARCHAR},
+                </if>
+                <if test="channelId != null">
+                    channelId = #{channelId,jdbcType=INTEGER},
+                </if>
+                <if test="channelName != null">
+                    channelName = #{channelName,jdbcType=VARCHAR},
+                </if>
+                <if test="channelAccount != null">
+                    channelAccount = #{channelAccount,jdbcType=VARCHAR},
+                </if>
+                <if test="channelAmount != null">
+                    channelAmount = #{channelAmount,jdbcType=VARCHAR},
+                </if>
+                <if test="channelRealtimeAmount != null">
+                    channelRealtimeAmount = #{channelRealtimeAmount,jdbcType=INTEGER},
+                </if>
+                <if test="channelAccountAmount != null">
+                    channelAccountAmount = #{channelAccountAmount,jdbcType=INTEGER},
+                </if>
+                <if test="channelSplitRule != null">
+                    channelSplitRule = #{channelSplitRule,jdbcType=VARCHAR},
+                </if>
+                <if test="status != null">
+                    status = #{status,jdbcType=INTEGER},
+                </if>
+                <if test="createTime != null">
+                    createTime = #{createTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="hasRefund != null">
+                    hasRefund = #{hasRefund,jdbcType=INTEGER},
+                </if>
+                <if test="refundTotal != null">
+                    refundTotal = #{refundTotal,jdbcType=INTEGER},
+                </if>
+                <if test="refundRetail != null">
+                    refundRetail = #{refundRetail,jdbcType=INTEGER},
+                </if>
+                <if test="refundChannel != null">
+                    refundChannel = #{refundChannel,jdbcType=INTEGER},
+                </if>
+        </set>
+        where   id = #{id,jdbcType=INTEGER} 
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.AskaSplitrecord">
+        update aska_splitRecord
+        set 
+            payId =  #{payId,jdbcType=INTEGER},
+            spiltOrderId =  #{spiltOrderId,jdbcType=VARCHAR},
+            payAmount =  #{payAmount,jdbcType=INTEGER},
+            retailId =  #{retailId,jdbcType=INTEGER},
+            retailName =  #{retailName,jdbcType=VARCHAR},
+            retailAccount =  #{retailAccount,jdbcType=VARCHAR},
+            retailAmount =  #{retailAmount,jdbcType=VARCHAR},
+            retailRealtimeAmount =  #{retailRealtimeAmount,jdbcType=INTEGER},
+            retailAccountAmount =  #{retailAccountAmount,jdbcType=INTEGER},
+            retailSplitrule =  #{retailSplitrule,jdbcType=VARCHAR},
+            channelId =  #{channelId,jdbcType=INTEGER},
+            channelName =  #{channelName,jdbcType=VARCHAR},
+            channelAccount =  #{channelAccount,jdbcType=VARCHAR},
+            channelAmount =  #{channelAmount,jdbcType=VARCHAR},
+            channelRealtimeAmount =  #{channelRealtimeAmount,jdbcType=INTEGER},
+            channelAccountAmount =  #{channelAccountAmount,jdbcType=INTEGER},
+            channelSplitRule =  #{channelSplitRule,jdbcType=VARCHAR},
+            status =  #{status,jdbcType=INTEGER},
+            createTime =  #{createTime,jdbcType=TIMESTAMP},
+            hasRefund =  #{hasRefund,jdbcType=INTEGER},
+            refundTotal =  #{refundTotal,jdbcType=INTEGER},
+            refundRetail =  #{refundRetail,jdbcType=INTEGER},
+            refundChannel =  #{refundChannel,jdbcType=INTEGER}
+        where   id = #{id,jdbcType=INTEGER} 
+    </update>
+</mapper>

+ 108 - 18
dao/target/classes/mapper/PayRequestMapper.xml

@@ -11,15 +11,24 @@
             <result property="openId" column="open_id" jdbcType="VARCHAR"/>
             <result property="mobile" column="mobile" jdbcType="VARCHAR"/>
             <result property="orderId" column="order_id" jdbcType="VARCHAR"/>
-            <result property="amount" column="amount" jdbcType="DECIMAL"/>
+            <result property="amount" column="amount" jdbcType="INTEGER"/>
             <result property="itemId" column="item_id" jdbcType="VARCHAR"/>
-            <result property="itemName" column="item_name" jdbcType="VARCHAR"/>
             <result property="itemType" column="item_type" jdbcType="INTEGER"/>
+            <result property="itemName" column="item_name" jdbcType="VARCHAR"/>
             <result property="itemChannel" column="item_channel" jdbcType="VARCHAR"/>
+            <result property="retailId" column="retail_id" jdbcType="VARCHAR"/>
+            <result property="retailName" column="retail_name" jdbcType="VARCHAR"/>
+            <result property="useCouponId" column="use_coupon_id" jdbcType="VARCHAR"/>
             <result property="payChannel" column="pay_channel" jdbcType="INTEGER"/>
-            <result property="payStatus" column="pay_status" jdbcType="BIGINT"/>
-            <result property="payAmount" column="pay_amount" jdbcType="DECIMAL"/>
+            <result property="responseBody" column="response_body" jdbcType="VARCHAR"/>
+            <result property="payStatus" column="pay_status" jdbcType="INTEGER"/>
             <result property="payTime" column="pay_time" jdbcType="TIMESTAMP"/>
+            <result property="transactionId" column="transaction_id" jdbcType="VARCHAR"/>
+            <result property="payAmount" column="pay_amount" jdbcType="DECIMAL"/>
+            <result property="hasRefund" column="has_refund" jdbcType="INTEGER"/>
+            <result property="refundTotal" column="refund_total" jdbcType="DECIMAL"/>
+            <result property="clientType" column="client_type" jdbcType="VARCHAR"/>
+            <result property="cansplit" column="canSplit" jdbcType="INTEGER"/>
             <result property="callbackUrl" column="callback_url" jdbcType="VARCHAR"/>
             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
             <result property="modifiedTime" column="modified_time" jdbcType="TIMESTAMP"/>
@@ -28,9 +37,13 @@
     <sql id="Base_Column_List">
         id,request_body,order_sn,
         open_id,mobile,order_id,
-        amount,item_id,item_name,item_type,
-        item_channel,pay_channel,pay_status,pay_amount,pay_time,callback_url,create_time,
-        modified_time
+        amount,item_id,item_type,
+        item_name,item_channel,retail_id,
+        retail_name,use_coupon_id,pay_channel,
+        response_body,pay_status,pay_time,
+        transaction_id,pay_amount,has_refund,
+        refund_total,client_type,canSplit,
+        callback_url,create_time,modified_time
     </sql>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -39,6 +52,7 @@
         from pay_request
         where  id = #{id,jdbcType=INTEGER} 
     </select>
+
     <select id="selectByOrderSn" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List" />
@@ -66,6 +80,7 @@
         where mobile = #{phoneNo} and order_id = #{orderId}
     </select>
 
+
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
         delete from pay_request
         where  id = #{id,jdbcType=INTEGER} 
@@ -75,13 +90,23 @@
         ( id,request_body,order_sn
         ,open_id,mobile,order_id
         ,amount,item_id,item_type
-        ,item_channel,pay_channel,create_time
-        ,modified_time)
+        ,item_name,item_channel,retail_id
+        ,retail_name,use_coupon_id,pay_channel
+        ,response_body,pay_status,pay_time
+        ,transaction_id,pay_amount,has_refund
+        ,refund_total,client_type,canSplit
+        ,callback_url,create_time,modified_time
+        )
         values (#{id,jdbcType=INTEGER},#{requestBody,jdbcType=VARCHAR},#{orderSn,jdbcType=VARCHAR}
         ,#{openId,jdbcType=VARCHAR},#{mobile,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR}
         ,#{amount,jdbcType=DECIMAL},#{itemId,jdbcType=VARCHAR},#{itemType,jdbcType=INTEGER}
-        ,#{itemChannel,jdbcType=VARCHAR},#{payChannel,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP}
-        ,#{modifiedTime,jdbcType=TIMESTAMP})
+        ,#{itemName,jdbcType=VARCHAR},#{itemChannel,jdbcType=VARCHAR},#{retailId,jdbcType=VARCHAR}
+        ,#{retailName,jdbcType=VARCHAR},#{useCouponId,jdbcType=VARCHAR},#{payChannel,jdbcType=INTEGER}
+        ,#{responseBody,jdbcType=VARCHAR},#{payStatus,jdbcType=INTEGER},#{payTime,jdbcType=TIMESTAMP}
+        ,#{transactionId,jdbcType=VARCHAR},#{payAmount,jdbcType=DECIMAL},#{hasRefund,jdbcType=INTEGER}
+        ,#{refundTotal,jdbcType=DECIMAL},#{clientType,jdbcType=VARCHAR},#{cansplit,jdbcType=INTEGER}
+        ,#{callbackUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{modifiedTime,jdbcType=TIMESTAMP}
+        )
     </insert>
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest" useGeneratedKeys="true">
         insert into pay_request
@@ -95,11 +120,22 @@
                 <if test="amount != null">amount,</if>
                 <if test="itemId != null">item_id,</if>
                 <if test="itemType != null">item_type,</if>
+                <if test="itemName != null">item_name,</if>
                 <if test="itemChannel != null">item_channel,</if>
+                <if test="channelId != null">channel_id,</if>
+                <if test="retailId != null">retail_id,</if>
+                <if test="retailName != null">retail_name,</if>
+                <if test="useCouponId != null">use_coupon_id,</if>
                 <if test="payChannel != null">pay_channel,</if>
-                <if test="itemName != null">item_name,</if>
                 <if test="responseBody != null">response_body,</if>
                 <if test="payStatus != null">pay_status,</if>
+                <if test="payTime != null">pay_time,</if>
+                <if test="transactionId != null">transaction_id,</if>
+                <if test="payAmount != null">pay_amount,</if>
+                <if test="hasRefund != null">has_refund,</if>
+                <if test="refundTotal != null">refund_total,</if>
+                <if test="clientType != null">client_type,</if>
+                <if test="cansplit != null">canSplit,</if>
                 <if test="callbackUrl != null">callback_url,</if>
                 <if test="createTime != null">create_time,</if>
                 <if test="modifiedTime != null">modified_time,</if>
@@ -114,11 +150,22 @@
                 <if test="amount != null">#{amount,jdbcType=DECIMAL},</if>
                 <if test="itemId != null">#{itemId,jdbcType=VARCHAR},</if>
                 <if test="itemType != null">#{itemType,jdbcType=INTEGER},</if>
+                <if test="itemName != null">#{itemName,jdbcType=VARCHAR},</if>
                 <if test="itemChannel != null">#{itemChannel,jdbcType=VARCHAR},</if>
+                <if test="channelId != null">#{channelId,jdbcType=INTEGER},</if>
+                <if test="retailId != null">#{retailId,jdbcType=VARCHAR},</if>
+                <if test="retailName != null">#{retailName,jdbcType=VARCHAR},</if>
+                <if test="useCouponId != null">#{useCouponId,jdbcType=VARCHAR},</if>
                 <if test="payChannel != null">#{payChannel,jdbcType=INTEGER},</if>
-                <if test="itemName != null">#{itemName,jdbcType=VARCHAR},</if>
                 <if test="responseBody != null">#{responseBody,jdbcType=VARCHAR},</if>
-                <if test="payStatus != null">#{payStatus,jdbcType=BIGINT},</if>
+                <if test="payStatus != null">#{payStatus,jdbcType=INTEGER},</if>
+                <if test="payTime != null">#{payTime,jdbcType=TIMESTAMP},</if>
+                <if test="transactionId != null">#{transactionId,jdbcType=VARCHAR},</if>
+                <if test="payAmount != null">#{payAmount,jdbcType=DECIMAL},</if>
+                <if test="hasRefund != null">#{hasRefund,jdbcType=INTEGER},</if>
+                <if test="refundTotal != null">#{refundTotal,jdbcType=DECIMAL},</if>
+                <if test="clientType != null">#{clientType,jdbcType=VARCHAR},</if>
+                <if test="cansplit != null">#{cansplit,jdbcType=INTEGER},</if>
                 <if test="callbackUrl != null">#{callbackUrl,jdbcType=VARCHAR},</if>
                 <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
                 <if test="modifiedTime != null">#{modifiedTime,jdbcType=TIMESTAMP},</if>
@@ -151,9 +198,21 @@
                 <if test="itemType != null">
                     item_type = #{itemType,jdbcType=INTEGER},
                 </if>
+                <if test="itemName != null">
+                    item_name = #{itemName,jdbcType=VARCHAR},
+                </if>
                 <if test="itemChannel != null">
                     item_channel = #{itemChannel,jdbcType=VARCHAR},
                 </if>
+                <if test="retailId != null">
+                    retail_id = #{retailId,jdbcType=VARCHAR},
+                </if>
+                <if test="retailName != null">
+                    retail_name = #{retailName,jdbcType=VARCHAR},
+                </if>
+                <if test="useCouponId != null">
+                    use_coupon_id = #{useCouponId,jdbcType=VARCHAR},
+                </if>
                 <if test="payChannel != null">
                     pay_channel = #{payChannel,jdbcType=INTEGER},
                 </if>
@@ -161,13 +220,31 @@
                     response_body = #{responseBody,jdbcType=VARCHAR},
                 </if>
                 <if test="payStatus != null">
-                    pay_status = #{payStatus,jdbcType=BIGINT},
+                    pay_status = #{payStatus,jdbcType=INTEGER},
+                </if>
+                <if test="payTime != null">
+                    pay_time = #{payTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="transactionId != null">
+                    transaction_id = #{transactionId,jdbcType=VARCHAR},
                 </if>
                 <if test="payAmount != null">
                     pay_amount = #{payAmount,jdbcType=DECIMAL},
                 </if>
-                <if test="payTime != null">
-                    pay_time = #{payTime,jdbcType=TIMESTAMP},
+                <if test="hasRefund != null">
+                    has_refund = #{hasRefund,jdbcType=INTEGER},
+                </if>
+                <if test="refundTotal != null">
+                    refund_total = #{refundTotal,jdbcType=DECIMAL},
+                </if>
+                <if test="clientType != null">
+                    client_type = #{clientType,jdbcType=VARCHAR},
+                </if>
+                <if test="cansplit != null">
+                    canSplit = #{cansplit,jdbcType=INTEGER},
+                </if>
+                <if test="callbackUrl != null">
+                    callback_url = #{callbackUrl,jdbcType=VARCHAR},
                 </if>
                 <if test="createTime != null">
                     create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -189,9 +266,22 @@
             amount =  #{amount,jdbcType=DECIMAL},
             item_id =  #{itemId,jdbcType=VARCHAR},
             item_type =  #{itemType,jdbcType=INTEGER},
+            item_name =  #{itemName,jdbcType=VARCHAR},
             item_channel =  #{itemChannel,jdbcType=VARCHAR},
+            retail_id =  #{retailId,jdbcType=VARCHAR},
+            retail_name =  #{retailName,jdbcType=VARCHAR},
+            use_coupon_id =  #{useCouponId,jdbcType=VARCHAR},
             pay_channel =  #{payChannel,jdbcType=INTEGER},
-            response_body = #{responseBody,jdbcType=VARCHAR},
+            response_body =  #{responseBody,jdbcType=VARCHAR},
+            pay_status =  #{payStatus,jdbcType=INTEGER},
+            pay_time =  #{payTime,jdbcType=TIMESTAMP},
+            transaction_id =  #{transactionId,jdbcType=VARCHAR},
+            pay_amount =  #{payAmount,jdbcType=DECIMAL},
+            has_refund =  #{hasRefund,jdbcType=INTEGER},
+            refund_total =  #{refundTotal,jdbcType=DECIMAL},
+            client_type =  #{clientType,jdbcType=VARCHAR},
+            canSplit =  #{cansplit,jdbcType=INTEGER},
+            callback_url =  #{callbackUrl,jdbcType=VARCHAR},
             create_time =  #{createTime,jdbcType=TIMESTAMP},
             modified_time =  #{modifiedTime,jdbcType=TIMESTAMP}
         where   id = #{id,jdbcType=INTEGER} 

+ 15 - 9
dao/target/classes/mapper/RefundOrderMapper.xml

@@ -8,14 +8,16 @@
             <id property="id" column="id" jdbcType="INTEGER"/>
             <result property="orderSn" column="order_sn" jdbcType="VARCHAR"/>
             <result property="refundOrderSn" column="refund_order_sn" jdbcType="VARCHAR"/>
-            <result property="refundAmount" column="refund_amount" jdbcType="DECIMAL"/>
+            <result property="refundAmount" column="refund_amount" jdbcType="INTEGER"/>
+            <result property="message" column="message" jdbcType="VARCHAR"/>
             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
             <result property="modifiedTime" column="modified_time" jdbcType="TIMESTAMP"/>
     </resultMap>
 
     <sql id="Base_Column_List">
         id,order_sn,refund_order_sn,
-        refund_amount,create_time,modified_time
+        refund_amount,message,create_time,
+        modified_time
     </sql>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -32,11 +34,11 @@
     <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.RefundOrder" useGeneratedKeys="true">
         insert into refund_order
         ( id,order_sn,refund_order_sn
-        ,refund_amount,create_time,modified_time
-        )
+        ,refund_amount,message,create_time
+        ,modified_time)
         values (#{id,jdbcType=INTEGER},#{orderSn,jdbcType=VARCHAR},#{refundOrderSn,jdbcType=VARCHAR}
-        ,#{refundAmount,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{modifiedTime,jdbcType=TIMESTAMP}
-        )
+        ,#{refundAmount,jdbcType=INTEGER},#{message,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP}
+        ,#{modifiedTime,jdbcType=TIMESTAMP})
     </insert>
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.RefundOrder" useGeneratedKeys="true">
         insert into refund_order
@@ -53,7 +55,7 @@
                 <if test="id != null">#{id,jdbcType=INTEGER},</if>
                 <if test="orderSn != null">#{orderSn,jdbcType=VARCHAR},</if>
                 <if test="refundOrderSn != null">#{refundOrderSn,jdbcType=VARCHAR},</if>
-                <if test="refundAmount != null">#{refundAmount,jdbcType=DECIMAL},</if>
+                <if test="refundAmount != null">#{refundAmount,jdbcType=INTEGER},</if>
                 <if test="message != null">#{message,jdbcType=VARCHAR},</if>
                 <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
                 <if test="modifiedTime != null">#{modifiedTime,jdbcType=TIMESTAMP},</if>
@@ -69,7 +71,10 @@
                     refund_order_sn = #{refundOrderSn,jdbcType=VARCHAR},
                 </if>
                 <if test="refundAmount != null">
-                    refund_amount = #{refundAmount,jdbcType=DECIMAL},
+                    refund_amount = #{refundAmount,jdbcType=INTEGER},
+                </if>
+                <if test="message != null">
+                    message = #{message,jdbcType=VARCHAR},
                 </if>
                 <if test="createTime != null">
                     create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -85,7 +90,8 @@
         set 
             order_sn =  #{orderSn,jdbcType=VARCHAR},
             refund_order_sn =  #{refundOrderSn,jdbcType=VARCHAR},
-            refund_amount =  #{refundAmount,jdbcType=DECIMAL},
+            refund_amount =  #{refundAmount,jdbcType=INTEGER},
+            message =  #{message,jdbcType=VARCHAR},
             create_time =  #{createTime,jdbcType=TIMESTAMP},
             modified_time =  #{modifiedTime,jdbcType=TIMESTAMP}
         where   id = #{id,jdbcType=INTEGER} 

+ 10 - 6
dao/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -1,15 +1,19 @@
-com/mofangchuxing/aska/dao/mapper/AskaRetailsMapper.class
-com/mofangchuxing/aska/dao/domain/RefundOrder.class
-com/mofangchuxing/aska/dao/domain/AskaChannels.class
 com/mofangchuxing/aska/dao/mapper/SysMenuMapper.class
 com/mofangchuxing/aska/dao/domain/NotifyRecord.class
 com/mofangchuxing/aska/dao/mapper/AskaAccountsMapper.class
 com/mofangchuxing/aska/dao/domain/AskaRetails.class
-com/mofangchuxing/aska/dao/config/SqlConfig.class
 com/mofangchuxing/aska/dao/mapper/NotifyRecordMapper.class
 com/mofangchuxing/aska/dao/domain/AskaAccounts.class
-com/mofangchuxing/aska/dao/mapper/RefundOrderMapper.class
 com/mofangchuxing/aska/dao/mapper/PayRequestMapper.class
+com/mofangchuxing/aska/dao/domain/PayRequest.class
+com/mofangchuxing/aska/dao/mapper/AskaRetailsMapper.class
+com/mofangchuxing/aska/dao/domain/RefundOrder.class
+com/mofangchuxing/aska/dao/domain/AskaChannels.class
+com/mofangchuxing/aska/dao/config/SqlConfig.class
+com/mofangchuxing/aska/dao/mapper/AskaSplitrecordMapper.class
+com/mofangchuxing/aska/dao/domain/AskaSplitrecord.class
+com/mofangchuxing/aska/dao/mapper/RefundOrderMapper.class
+com/mofangchuxing/aska/dao/mapper/AskaChannelcouponnosMapper.class
 com/mofangchuxing/aska/dao/domain/SysMenu.class
 com/mofangchuxing/aska/dao/mapper/AskaChannelsMapper.class
-com/mofangchuxing/aska/dao/domain/PayRequest.class
+com/mofangchuxing/aska/dao/domain/AskaChannelcouponnos.class

+ 4 - 0
dao/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -4,12 +4,16 @@
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaChannelsMapper.java
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/domain/SysMenu.java
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/mapper/PayRequestMapper.java
+/Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaChannelcouponnos.java
+/Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaSplitrecordMapper.java
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaAccountsMapper.java
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaRetailsMapper.java
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/domain/RefundOrder.java
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/domain/NotifyRecord.java
+/Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/mapper/AskaChannelcouponnosMapper.java
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaRetails.java
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaChannels.java
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaAccounts.java
+/Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/domain/AskaSplitrecord.java
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/mapper/RefundOrderMapper.java
 /Users/syl/Desktop/work/aska/dao/src/main/java/com/mofangchuxing/aska/dao/mapper/NotifyRecordMapper.java

+ 3 - 0
domain/src/main/java/com/mofangchuxing/aska/domain/DelayObjectWrapper.java

@@ -1,5 +1,6 @@
 package com.mofangchuxing.aska.domain;
 
+import com.mofangchuxing.aska.domain.enums.DelayTypeEnum;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -21,6 +22,8 @@ public class DelayObjectWrapper<T> implements Serializable {
      */
     private Long timestamp;
 
+    private DelayTypeEnum type;
+
     private T data;
 
 }

+ 2 - 0
domain/src/main/java/com/mofangchuxing/aska/domain/PayRequestDto.java

@@ -41,6 +41,8 @@ public class PayRequestDto {
 
     private String retailId;
 
+    private String retailName;
+
     private String callBackUrl;
 
     private String clientType;

+ 35 - 0
domain/src/main/java/com/mofangchuxing/aska/domain/dto/WeiXinPayScoreServiceResourceDTO.java

@@ -0,0 +1,35 @@
+package com.mofangchuxing.aska.domain.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**  
+ * 微信先享后付用户服务状态回调接口参数——通知资源数据
+ */
+@Data
+public class WeiXinPayScoreServiceResourceDTO implements Serializable {
+
+    //临时加的
+    private String original_type;
+
+    /**
+     * 对开启结果数据进行加密的加密算法,目前只支持AEAD_AES_256_GCM
+     */
+    private String algorithm;
+
+    /**
+     * Base64编码后的开启结果数据密文
+     */
+    private String ciphertext;
+
+    /**
+     * 附加数据
+     */
+    private String associated_data;
+
+    /**
+     * 加密使用的随机串
+     */
+    private String nonce;
+}

+ 15 - 0
domain/src/main/java/com/mofangchuxing/aska/domain/entity/PlainCertificateItem.java

@@ -0,0 +1,15 @@
+package com.mofangchuxing.aska.domain.entity;
+
+import lombok.Data;
+
+@Data
+public class PlainCertificateItem {
+    private String serialNo;
+
+    private String effectiveTime;
+
+    private String expireTime;
+
+    private String plainCertificate;
+
+}

+ 28 - 0
domain/src/main/java/com/mofangchuxing/aska/domain/enums/DelayTypeEnum.java

@@ -0,0 +1,28 @@
+package com.mofangchuxing.aska.domain.enums;
+
+/**
+ * @Author: syl
+ * @Date: 2023/8/9
+ * @Description:
+ */
+public enum DelayTypeEnum {
+    TYPE_NOTIFY(1,"支付回调"),
+    TYPE_SPLIT(2, "分账"),
+    ;
+
+    DelayTypeEnum(int type, String desc) {
+        this.type = type;
+        this.desc = desc;
+    }
+
+    private int type;
+    private String desc;
+
+    public int getType() {
+        return type;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+}

+ 135 - 0
domain/src/main/java/com/mofangchuxing/aska/domain/vo/AskaRetailsVo.java

@@ -0,0 +1,135 @@
+package com.mofangchuxing.aska.domain.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: syl
+ * @Date: 2023/8/8
+ * @Description:
+ */
+@Data
+public class AskaRetailsVo {
+    /**
+     *
+     */
+    private Integer id;
+
+    /**
+     *
+     */
+    private String name;
+
+    private Integer retailId;
+
+    private String retailName;
+
+    /**
+     *
+     */
+    private String address;
+
+    /**
+     *
+     */
+    private String type;
+
+    /**
+     *
+     */
+    private Double lat;
+
+    /**
+     *
+     */
+    private Double lng;
+
+    /**
+     * 渠道负责人id
+     */
+    private Integer ownerId;
+
+    /**
+     *
+     */
+    private String phone;
+
+    /**
+     * 备注
+     */
+    private String note;
+
+    /**
+     * 收款账号mchid或openid
+     */
+    private String account;
+
+    /**
+     *
+     */
+    private String accountName;
+
+    /**
+     * {personal,merchant}
+     */
+    private String accountType;
+
+    /**
+     * {store,store_owner,staff,partner}
+     */
+    private String relation;
+
+    /**
+     *
+     */
+    private String apiv3;
+
+    /**
+     *
+     */
+    private String certPath;
+
+    /**
+     * 分账方式{定额,定比}
+     */
+    private String tripartite;
+
+    /**
+     * 分账值{定额:分,定比:千分之一}
+     */
+    private Integer tripvalue;
+
+    /**
+     * 是否实时分账
+     */
+    private Boolean realtimeSplit;
+
+    /**
+     * 渠道可用状态{运营,暂停}
+     */
+    private String status;
+
+    /**
+     * 收入总额
+     */
+    private Integer totalAmount;
+
+    /**
+     * 实时分账总 额
+     */
+    private Integer totalSplit;
+
+    /**
+     * 提现总额
+     */
+    private Integer totalCashOut;
+
+    /**
+     * 退款总额
+     */
+    private Integer totalRefund;
+
+    /**
+     * 余额
+     */
+    private Integer balance;
+}

+ 35 - 0
domain/src/main/java/com/mofangchuxing/aska/domain/vo/WeiXinPayScoreServiceResourceDTO.java

@@ -0,0 +1,35 @@
+package com.mofangchuxing.aska.domain.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**  
+ * 微信先享后付用户服务状态回调接口参数——通知资源数据
+ */
+@Data
+public class WeiXinPayScoreServiceResourceDTO implements Serializable {
+
+    //临时加的
+    private String original_type;
+
+    /**
+     * 对开启结果数据进行加密的加密算法,目前只支持AEAD_AES_256_GCM
+     */
+    private String algorithm;
+
+    /**
+     * Base64编码后的开启结果数据密文
+     */
+    private String ciphertext;
+
+    /**
+     * 附加数据
+     */
+    private String associated_data;
+
+    /**
+     * 加密使用的随机串
+     */
+    private String nonce;
+}

+ 47 - 0
domain/src/main/java/com/mofangchuxing/aska/domain/vo/WeiXinPlatformCredentialVO.java

@@ -0,0 +1,47 @@
+package com.mofangchuxing.aska.domain.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 微信平台证书实体
+ */
+@Data
+public class WeiXinPlatformCredentialVO implements Serializable {
+    /**
+     * 证书序列号
+     */
+    private String serial_no;
+
+    /**
+     * 有效时间
+     */
+    private String effective_time;
+
+    /**
+     * 过期时间
+     */
+    private String expire_time;
+
+    /**
+     * 证书加密数据 json格式
+     */
+    private WeiXinPayScoreServiceResourceDTO encrypt_certificate;
+    /**
+     * 小程序的appid
+     */
+    private String appid;
+    /**
+     * 服务id
+     */
+    private String service_id;
+    /**
+     * 商户系统内部授权协议号
+     */
+    private String authorization_code;
+    /**
+     * 微信支付分授权回调
+     */
+    private String notify_url;
+}

BIN
domain/target/aska-domain-1.0.jar


BIN
domain/target/classes/com/mofangchuxing/aska/domain/DelayObjectWrapper.class


BIN
domain/target/classes/com/mofangchuxing/aska/domain/PayRequestDto.class


BIN
domain/target/classes/com/mofangchuxing/aska/domain/dto/WeiXinPayScoreServiceResourceDTO.class


BIN
domain/target/classes/com/mofangchuxing/aska/domain/entity/PlainCertificateItem.class


BIN
domain/target/classes/com/mofangchuxing/aska/domain/enums/DelayTypeEnum.class


BIN
domain/target/classes/com/mofangchuxing/aska/domain/vo/AskaRetailsVo.class


BIN
domain/target/classes/com/mofangchuxing/aska/domain/vo/WeiXinPayScoreServiceResourceDTO.class


BIN
domain/target/classes/com/mofangchuxing/aska/domain/vo/WeiXinPlatformCredentialVO.class


+ 6 - 0
domain/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -1,4 +1,5 @@
 com/mofangchuxing/aska/domain/dto/ChannelDto.class
+com/mofangchuxing/aska/domain/vo/WeiXinPayScoreServiceResourceDTO.class
 com/mofangchuxing/aska/domain/dto/BaseDto.class
 com/mofangchuxing/aska/domain/dto/RetailDto.class
 com/mofangchuxing/aska/domain/entity/SysMenuEntity.class
@@ -6,13 +7,18 @@ com/mofangchuxing/aska/domain/enums/ResultEnum.class
 com/mofangchuxing/aska/domain/DelayObjectWrapper.class
 com/mofangchuxing/aska/domain/utils/PageUtils.class
 com/mofangchuxing/aska/domain/R.class
+com/mofangchuxing/aska/domain/dto/WeiXinPayScoreServiceResourceDTO.class
 com/mofangchuxing/aska/domain/enums/ClientTypeEnum.class
 com/mofangchuxing/aska/domain/dto/LoginDto.class
 com/mofangchuxing/aska/domain/ResponseResult.class
+com/mofangchuxing/aska/domain/vo/AskaRetailsVo.class
 com/mofangchuxing/aska/domain/enums/ItemTypeEnum.class
+com/mofangchuxing/aska/domain/enums/DelayTypeEnum.class
 com/mofangchuxing/aska/domain/enums/PayStatusEnum.class
 com/mofangchuxing/aska/domain/PayRequestDto.class
+com/mofangchuxing/aska/domain/vo/WeiXinPlatformCredentialVO.class
 com/mofangchuxing/aska/domain/Constant$MenuType.class
 com/mofangchuxing/aska/domain/Constant.class
 com/mofangchuxing/aska/domain/entity/SysMenuEntity$SysMenuEntityBuilder.class
+com/mofangchuxing/aska/domain/entity/PlainCertificateItem.class
 com/mofangchuxing/aska/domain/BizException.class

+ 6 - 0
domain/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -1,16 +1,22 @@
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/entity/SysMenuEntity.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/ResponseResult.java
+/Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/enums/DelayTypeEnum.java
+/Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/dto/WeiXinPayScoreServiceResourceDTO.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/enums/PayStatusEnum.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/DelayObjectWrapper.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/R.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/BizException.java
+/Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/vo/WeiXinPayScoreServiceResourceDTO.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/Constant.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/enums/ResultEnum.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/enums/ClientTypeEnum.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/dto/BaseDto.java
+/Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/vo/AskaRetailsVo.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/PayRequestDto.java
+/Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/vo/WeiXinPlatformCredentialVO.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/dto/RetailDto.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/utils/PageUtils.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/enums/ItemTypeEnum.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/dto/ChannelDto.java
+/Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/entity/PlainCertificateItem.java
 /Users/syl/Desktop/work/aska/domain/src/main/java/com/mofangchuxing/aska/domain/dto/LoginDto.java

+ 45 - 0
main/src/main/java/com/mofangchuxing/aska/controller/AskaController.java

@@ -1,19 +1,29 @@
 package com.mofangchuxing.aska.controller;
 
+import com.alibaba.fastjson.JSONObject;
+import com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos;
+import com.mofangchuxing.aska.domain.R;
 import com.mofangchuxing.aska.domain.enums.ItemTypeEnum;
 import com.mofangchuxing.aska.domain.PayRequestDto;
 import com.mofangchuxing.aska.domain.ResponseResult;
+import com.mofangchuxing.aska.domain.vo.AskaRetailsVo;
+import com.mofangchuxing.aska.service.CouponService;
 import com.mofangchuxing.aska.service.PayService;
+import com.mofangchuxing.aska.service.ProfitSharingService;
+import com.mofangchuxing.aska.service.RetailService;
 import lombok.extern.slf4j.Slf4j;
 import org.jdom2.JDOMException;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.crypto.IllegalBlockSizeException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @Author: syl
@@ -27,6 +37,12 @@ public class AskaController {
 
     @Resource
     private PayService payService;
+    @Resource
+    private ProfitSharingService profitSharingService;
+    @Resource
+    private CouponService couponService;
+    @Resource
+    private RetailService retailService;
 
     /**
      * 礼券支付
@@ -79,4 +95,33 @@ public class AskaController {
     public void notify(HttpServletRequest request, HttpServletResponse response) throws IOException, JDOMException {
         payService.payNotify(request,response);
     }
+
+    @GetMapping("/testAddProfit")
+    public void testAddProfit(String mchId, String mchName) throws IllegalBlockSizeException, IOException {
+        //profitSharingService.addProfitReceivers(mchId, mchName);
+    }
+
+    @GetMapping("/testSplit")
+    public R testSplit(Long payRequestId) {
+        payService.testPaySplit(payRequestId);
+        return R.ok();
+    }
+
+    @RequestMapping("/querySplit")
+    public R querySplit(String outOrderNo, String transactionId){
+        JSONObject jsonObject = profitSharingService.queryProfit(outOrderNo, transactionId);
+        return R.ok(jsonObject);
+    }
+
+    @RequestMapping("/checkCoupon")
+    public ResponseResult checkCoupon(String couponNo) {
+        AskaChannelcouponnos askaChannelcouponnos = couponService.checkCoupon(couponNo);
+        return new ResponseResult<>(askaChannelcouponnos);
+    }
+
+    @RequestMapping("/getRetails")
+    public ResponseResult getRetails() {
+        List<AskaRetailsVo> list = retailService.listAllRetails();
+        return new ResponseResult(list);
+    }
 }

+ 3 - 0
main/src/main/java/com/mofangchuxing/aska/handler/GlobalExceptionHandler.java

@@ -2,6 +2,7 @@ package com.mofangchuxing.aska.handler;
 
 import com.mofangchuxing.aska.domain.ResponseResult;
 import com.mofangchuxing.aska.domain.enums.ResultEnum;
+import lombok.extern.slf4j.Slf4j;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.http.HttpStatus;
@@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 
 @RestControllerAdvice
+@Slf4j
 public class GlobalExceptionHandler {
     public static final Logger LOGGER = LoggerFactory.getLogger(GlobalExceptionHandler.class);
 
@@ -17,6 +19,7 @@ public class GlobalExceptionHandler {
     @ExceptionHandler(Exception.class)
     public ResponseResult handleBaseException(HttpServletRequest request, Exception e) {
         e.printStackTrace();
+        log.error(e.getMessage(), e);
         return new ResponseResult(ResultEnum.UNKNOWN_ERROR);
     }
 }

+ 4 - 0
main/src/main/resources/application.yml

@@ -16,6 +16,7 @@ spring:
     host: 127.0.0.1  # 测试环境redis
     port: 6379
     password: server@188.24       # 密码(默认为空)
+    #password:
     jedis:
       pool:
         max-wait: -1              # 连接池最大阻塞等待时间(使用负值表示没有限制)
@@ -44,5 +45,8 @@ wx:
   app-appid: wxe5251793c19a48d5
   mch-id: 1641830577
   api-key: a8babfa0d75ac878dd76dc905bf677e2
+  apiv3-key: 87b90c2065d9caa1c767ff1b15b21e52
+  api-serial-no: 22098B381BAE268F47FE823C70C3AA7702EE54C4
+  public-serial-no: 5BB0B8268EB289373EDFA3B1572FE3F2F8FD3B80
   unified-order-url: https://api.mch.weixin.qq.com/pay/unifiedorder
   notify-url: https://biketest.mofangchuxing.com/askay/notify

+ 24 - 0
main/src/main/resources/wechatpay.pem

@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIIEFDCCAvygAwIBAgIUW7C4Jo6yiTc+36OxVy/j8vj9O4AwDQYJKoZIhvcNAQEL
+BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT
+FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg
+Q0EwHhcNMjMwNDEyMDE1NTQ3WhcNMjgwNDEwMDE1NTQ3WjBuMRgwFgYDVQQDDA9U
+ZW5wYXkuY29tIHNpZ24xEzARBgNVBAoMClRlbnBheS5jb20xHTAbBgNVBAsMFFRl
+bnBheS5jb20gQ0EgQ2VudGVyMQswCQYDVQQGDAJDTjERMA8GA1UEBwwIU2hlblpo
+ZW4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQD3iAUhkxTp/iOU0IsS
+PqEnJTBaO0FkCZwVEFdxK7B0+Bpc7d0fvhycHhRsNzUnHAKZBCA556WxkR9vakC4
++6/8q+WCQZxAyN8hl7kbOsPsXLWVVv+k5lRKQWA/6uK2dpTIWGh0osAqcB2ZuyKq
+gtXKgFVALs05v3Foah+vKlRUzHPabxS06woXIT/X+Fgu09BWgUP6c/fnChOMNbZ4
+udjC+vVPnfY31VFRS0Y+lzH8m2RRnVxYRM0hC2r57sETwmOGygq4TDwlKGtntSxH
+k1qlWGTLVVexIwJ0RG4wFlU6D6SS/3Mh1rsNjaEjnJwgidVgPKSDli+zyF6JARyz
+YPC3AgMBAAGjgbkwgbYwCQYDVR0TBAIwADALBgNVHQ8EBAMCA/gwgZsGA1UdHwSB
+kzCBkDCBjaCBiqCBh4aBhGh0dHA6Ly9ldmNhLml0cnVzLmNvbS5jbi9wdWJsaWMv
+aXRydXNjcmw/Q0E9MUJENDIyMEU1MERCQzA0QjA2QUQzOTc1NDk4NDZDMDFDM0U4
+RUJEMiZzZz1IQUNDNDcxQjY1NDIyRTEyQjI3QTlEMzNBODdBRDFDREY1OTI2RTE0
+MDM3MTANBgkqhkiG9w0BAQsFAAOCAQEAjen+JuuCsf36njlCYFQavlIKGbReTiUg
+IcRU95R5b2o0eHRg3dp+BIZeixO1DhTPoS8WkA/1Ovl76rsPzR+mg/m9igEJhR3t
+E8x2rCc2c4j5CgfPV04uvwdGGZ0qaJ/XRV16PDIdNmPfoBIUcj/8bBA2sdmob29+
+3vAGwO5ubZTLVVrXJN0eWSCOHIV8GOxbfLFQzw4hjgCBGetsT2iPgKVElbWI81ui
+4zJg9xLDpDbU0C7YhFjPNr3IkqI8Qp60X9FTRF+rYW2B8Zw3hJSItaI+eIqQt0n2
+uz6243l01WsyTRowPMp4mBmiYbs+K0QkQM6Hd7PrMqWNK90E6tMrQg==
+-----END CERTIFICATE-----

BIN
main/target/aska.jar


BIN
main/target/aska.jar.original


+ 4 - 0
main/target/classes/application.yml

@@ -16,6 +16,7 @@ spring:
     host: 127.0.0.1  # 测试环境redis
     port: 6379
     password: server@188.24       # 密码(默认为空)
+    #password:
     jedis:
       pool:
         max-wait: -1              # 连接池最大阻塞等待时间(使用负值表示没有限制)
@@ -44,5 +45,8 @@ wx:
   app-appid: wxe5251793c19a48d5
   mch-id: 1641830577
   api-key: a8babfa0d75ac878dd76dc905bf677e2
+  apiv3-key: 87b90c2065d9caa1c767ff1b15b21e52
+  api-serial-no: 22098B381BAE268F47FE823C70C3AA7702EE54C4
+  public-serial-no: 5BB0B8268EB289373EDFA3B1572FE3F2F8FD3B80
   unified-order-url: https://api.mch.weixin.qq.com/pay/unifiedorder
   notify-url: https://biketest.mofangchuxing.com/askay/notify

BIN
main/target/classes/com/mofangchuxing/aska/controller/AskaController.class


BIN
main/target/classes/com/mofangchuxing/aska/handler/GlobalExceptionHandler.class


+ 24 - 0
main/target/classes/wechatpay.pem

@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIIEFDCCAvygAwIBAgIUW7C4Jo6yiTc+36OxVy/j8vj9O4AwDQYJKoZIhvcNAQEL
+BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT
+FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg
+Q0EwHhcNMjMwNDEyMDE1NTQ3WhcNMjgwNDEwMDE1NTQ3WjBuMRgwFgYDVQQDDA9U
+ZW5wYXkuY29tIHNpZ24xEzARBgNVBAoMClRlbnBheS5jb20xHTAbBgNVBAsMFFRl
+bnBheS5jb20gQ0EgQ2VudGVyMQswCQYDVQQGDAJDTjERMA8GA1UEBwwIU2hlblpo
+ZW4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQD3iAUhkxTp/iOU0IsS
+PqEnJTBaO0FkCZwVEFdxK7B0+Bpc7d0fvhycHhRsNzUnHAKZBCA556WxkR9vakC4
++6/8q+WCQZxAyN8hl7kbOsPsXLWVVv+k5lRKQWA/6uK2dpTIWGh0osAqcB2ZuyKq
+gtXKgFVALs05v3Foah+vKlRUzHPabxS06woXIT/X+Fgu09BWgUP6c/fnChOMNbZ4
+udjC+vVPnfY31VFRS0Y+lzH8m2RRnVxYRM0hC2r57sETwmOGygq4TDwlKGtntSxH
+k1qlWGTLVVexIwJ0RG4wFlU6D6SS/3Mh1rsNjaEjnJwgidVgPKSDli+zyF6JARyz
+YPC3AgMBAAGjgbkwgbYwCQYDVR0TBAIwADALBgNVHQ8EBAMCA/gwgZsGA1UdHwSB
+kzCBkDCBjaCBiqCBh4aBhGh0dHA6Ly9ldmNhLml0cnVzLmNvbS5jbi9wdWJsaWMv
+aXRydXNjcmw/Q0E9MUJENDIyMEU1MERCQzA0QjA2QUQzOTc1NDk4NDZDMDFDM0U4
+RUJEMiZzZz1IQUNDNDcxQjY1NDIyRTEyQjI3QTlEMzNBODdBRDFDREY1OTI2RTE0
+MDM3MTANBgkqhkiG9w0BAQsFAAOCAQEAjen+JuuCsf36njlCYFQavlIKGbReTiUg
+IcRU95R5b2o0eHRg3dp+BIZeixO1DhTPoS8WkA/1Ovl76rsPzR+mg/m9igEJhR3t
+E8x2rCc2c4j5CgfPV04uvwdGGZ0qaJ/XRV16PDIdNmPfoBIUcj/8bBA2sdmob29+
+3vAGwO5ubZTLVVrXJN0eWSCOHIV8GOxbfLFQzw4hjgCBGetsT2iPgKVElbWI81ui
+4zJg9xLDpDbU0C7YhFjPNr3IkqI8Qp60X9FTRF+rYW2B8Zw3hJSItaI+eIqQt0n2
+uz6243l01WsyTRowPMp4mBmiYbs+K0QkQM6Hd7PrMqWNK90E6tMrQg==
+-----END CERTIFICATE-----

+ 15 - 0
service/pom.xml

@@ -74,6 +74,21 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-redis</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.github.wechatpay-apiv3</groupId>
+            <artifactId>wechatpay-java</artifactId>
+            <version>0.2.7</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.wechatpay-apiv3</groupId>
+            <artifactId>wechatpay-apache-httpclient</artifactId>
+            <version>0.2.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+            <version>3.8.1</version>
+        </dependency>
     </dependencies>
 
     <properties>

+ 12 - 0
service/src/main/java/com/mofangchuxing/aska/service/CouponService.java

@@ -0,0 +1,12 @@
+package com.mofangchuxing.aska.service;
+
+import com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos;
+
+/**
+ * @Author: syl
+ * @Date: 2023/8/10
+ * @Description:
+ */
+public interface CouponService {
+    AskaChannelcouponnos checkCoupon(String couponNo);
+}

+ 2 - 0
service/src/main/java/com/mofangchuxing/aska/service/PayService.java

@@ -24,4 +24,6 @@ public interface PayService {
     public ResponseResult queryDetail(PayRequestDto payRequestDto);
 
     public void payNotify(HttpServletRequest request, HttpServletResponse response) throws IOException, JDOMException;
+
+    public void testPaySplit(Long payRequestId);
 }

+ 23 - 0
service/src/main/java/com/mofangchuxing/aska/service/ProfitSharingService.java

@@ -0,0 +1,23 @@
+package com.mofangchuxing.aska.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+import javax.crypto.IllegalBlockSizeException;
+import java.io.IOException;
+import java.math.BigDecimal;
+
+/**
+ * @Author: syl
+ * @Date: 2023/8/8
+ * @Description:
+ */
+public interface ProfitSharingService {
+    void addSplitReceivers(String clientType, Long retailId, String couponNo) throws IllegalBlockSizeException, IOException;
+    void addProfitReceivers(String clientType, String accountType, String mchId, String name) throws IllegalBlockSizeException, IOException;
+
+    void profitSharing(String clientType, String orderNo, String transactionId, Integer payMoney, Long retailId, String couponNo);
+
+    JSONObject queryProfit(String outOrderNo, String transactionId);
+
+    void returnOrder(Integer payId);
+}

+ 5 - 0
service/src/main/java/com/mofangchuxing/aska/service/RetailService.java

@@ -3,6 +3,9 @@ package com.mofangchuxing.aska.service;
 import com.mofangchuxing.aska.dao.domain.AskaRetails;
 import com.mofangchuxing.aska.domain.dto.RetailDto;
 import com.mofangchuxing.aska.domain.utils.PageUtils;
+import com.mofangchuxing.aska.domain.vo.AskaRetailsVo;
+
+import java.util.List;
 
 /**
  * @Author: syl
@@ -21,5 +24,7 @@ public interface RetailService {
 
     PageUtils listAllRetails(RetailDto retailDto);
 
+    List<AskaRetailsVo> listAllRetails();
+
     AskaRetails getRetailDetail(RetailDto retailDto);
 }

+ 60 - 27
service/src/main/java/com/mofangchuxing/aska/service/common/DelayNotifyComponent.java

@@ -4,8 +4,12 @@ import cn.hutool.core.date.DateTime;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.mofangchuxing.aska.dao.domain.NotifyRecord;
+import com.mofangchuxing.aska.dao.domain.PayRequest;
 import com.mofangchuxing.aska.dao.mapper.NotifyRecordMapper;
+import com.mofangchuxing.aska.dao.mapper.PayRequestMapper;
 import com.mofangchuxing.aska.domain.DelayObjectWrapper;
+import com.mofangchuxing.aska.domain.enums.DelayTypeEnum;
+import com.mofangchuxing.aska.service.ProfitSharingService;
 import lombok.extern.slf4j.Slf4j;
 import org.redisson.RedissonShutdownException;
 import org.redisson.api.RBlockingQueue;
@@ -40,22 +44,27 @@ public class DelayNotifyComponent {
     private NotifyRecordMapper notifyRecordMapper;
     @Resource
     private RestTemplate restTemplate;
+    @Resource
+    private PayRequestMapper payRequestMapper;
+    @Resource
+    private ProfitSharingService profitSharingService;
 
-    public static final List<Integer> DELAY_TIME_ARRAY = Arrays.asList(5,10,15,30,60,300,600,1200,1800);
+    public static final List<Integer> DELAY_TIME_ARRAY = Arrays.asList(5, 10, 15, 30, 60, 300, 600, 1200, 1800);
 
     private static final String NOTIFY_QUEUE = "DelayQueue:notify";
 
-    public void delay(String unionKey, Integer delay, TimeUnit timeUnit) {
+    public void delay(String unionKey, DelayTypeEnum type, Integer delay, TimeUnit timeUnit) {
         log.info("redission begin offer delay. unionKey:{} delay:{} {}", unionKey, delay, timeUnit);
         RBlockingQueue<DelayObjectWrapper> blockingFairQueue = redissonClient.getBlockingQueue(NOTIFY_QUEUE);
         RDelayedQueue<DelayObjectWrapper> delayedQueue = redissonClient.getDelayedQueue(blockingFairQueue);
         final DelayObjectWrapper<Object> wrapper = new DelayObjectWrapper<>();
         wrapper.setTimestamp(System.currentTimeMillis());
         wrapper.setUnionKey(unionKey);
+        wrapper.setType(type);
         delayedQueue.offer(wrapper, delay, timeUnit);
     }
 
-    public void startDaemon(){
+    public void startDaemon() {
         Thread daemonThread = new Thread(() -> {
             log.info("daemonThread starting...");
             RBlockingQueue<DelayObjectWrapper> blockingFairQueue = redissonClient.getBlockingQueue(NOTIFY_QUEUE);
@@ -66,23 +75,17 @@ public class DelayNotifyComponent {
                         notifyWrapper = blockingFairQueue.take();
                         log.info("delay task time is up, unionKey:{}, data:{}", notifyWrapper.getUnionKey(), JSON.toJSONString(notifyWrapper.getData()));
                         String orderSn = notifyWrapper.getUnionKey();
-                        NotifyRecord notifyRecord = notifyRecordMapper.selectByOrderSn(orderSn);
-                        if (notifyRecord != null && notifyRecord.getStatus() == 0 && notifyRecord.getNotifyTimes() < 10){
-                            boolean result = notifyDown(orderSn,notifyRecord.getNotifyUrl());
-                            if (result){
-                                NotifyRecord updateRecord = new NotifyRecord();
-                                updateRecord.setId(notifyRecord.getId());
-                                updateRecord.setStatus(1);
-                                notifyRecordMapper.updateByPrimaryKeySelective(updateRecord);
-                                return;
-                            }
-                            int times = notifyRecord.getNotifyTimes();
-                            int delayTime = DELAY_TIME_ARRAY.get(times);
-                            delay(orderSn, delayTime, TimeUnit.SECONDS);
-                            NotifyRecord updateRecord = new NotifyRecord();
-                            updateRecord.setId(notifyRecord.getId());
-                            updateRecord.setNotifyTimes(times+1);
-                            notifyRecordMapper.updateByPrimaryKeySelective(updateRecord);
+                        DelayTypeEnum type = notifyWrapper.getType();
+                        // 时间紧迫 先这么写
+                        switch (type) {
+                            case TYPE_NOTIFY:
+                                handlePayNotify(orderSn);
+                                break;
+                            case TYPE_SPLIT:
+                                handleSplit(orderSn);
+                                break;
+                            default:
+                                break;
                         }
                     } catch (InterruptedException | RedissonShutdownException e) {
                         log.info("监听中断,程序要关闭了?", e);
@@ -99,7 +102,37 @@ public class DelayNotifyComponent {
         daemonThread.start();
     }
 
-    public boolean notifyDown(String orderId, String url){
+    private void handlePayNotify(String orderSn) {
+        NotifyRecord notifyRecord = notifyRecordMapper.selectByOrderSn(orderSn);
+        if (notifyRecord != null && notifyRecord.getStatus() == 0 && notifyRecord.getNotifyTimes() < 10) {
+            boolean result = notifyDown(orderSn, notifyRecord.getNotifyUrl());
+            if (result) {
+                NotifyRecord updateRecord = new NotifyRecord();
+                updateRecord.setId(notifyRecord.getId());
+                updateRecord.setStatus(1);
+                notifyRecordMapper.updateByPrimaryKeySelective(updateRecord);
+                return;
+            }
+            int times = notifyRecord.getNotifyTimes();
+            int delayTime = DELAY_TIME_ARRAY.get(times);
+            delay(orderSn, DelayTypeEnum.TYPE_NOTIFY, delayTime, TimeUnit.SECONDS);
+            NotifyRecord updateRecord = new NotifyRecord();
+            updateRecord.setId(notifyRecord.getId());
+            updateRecord.setNotifyTimes(times + 1);
+            notifyRecordMapper.updateByPrimaryKeySelective(updateRecord);
+        }
+    }
+
+    private void handleSplit(String orderSn) {
+        PayRequest payRequest = payRequestMapper.selectByOrderSn(orderSn);
+        if (payRequest == null) {
+            log.error("handleSplit payRequest 不存在? orderSn = {}",orderSn);
+            return;
+        }
+        profitSharingService.profitSharing(payRequest.getClientType(), orderSn, payRequest.getTransactionId(), payRequest.getPayAmount(), Long.parseLong(payRequest.getRetailId()), payRequest.getUseCouponId());
+    }
+
+    public boolean notifyDown(String orderId, String url) {
         JSONObject requestParams = new JSONObject();
         requestParams.put("orderId", orderId);
         HttpHeaders headers = new HttpHeaders();
@@ -107,26 +140,26 @@ public class DelayNotifyComponent {
         HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<Map<String, Object>>(requestParams, headers);
         try {
             JSONObject resObj = restTemplate.postForObject(url, requestEntity, JSONObject.class);
-            if (resObj.getInteger("code") == 200){
+            if (resObj.getInteger("code") == 200) {
                 return true;
             }
-            log.info("jsonObject = {}",resObj.toJSONString());
-        }catch (Exception e){
+            log.info("jsonObject = {}", resObj.toJSONString());
+        } catch (Exception e) {
             e.printStackTrace();
             return false;
         }
         return false;
     }
 
-    public boolean isDelay(String orderId){
+    public boolean isDelay(String orderId) {
         NotifyRecord notifyRecord = notifyRecordMapper.selectByOrderSn(orderId);
-        if (notifyRecord == null){
+        if (notifyRecord == null) {
             return false;
         }
         return true;
     }
 
-    public void saveDelayRecord(String mchId, String openId, String orderId, String totalFee, String url){
+    public void saveDelayRecord(String mchId, String openId, String orderId, String totalFee, String url) {
         NotifyRecord notifyRecord = new NotifyRecord();
         notifyRecord.setMchId(mchId);
         notifyRecord.setOpenId(openId);

+ 70 - 0
service/src/main/java/com/mofangchuxing/aska/service/config/WxPayV3Config.java

@@ -0,0 +1,70 @@
+package com.mofangchuxing.aska.service.config;
+
+
+import com.mofangchuxing.aska.service.common.PayCommonUtil;
+import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
+import com.wechat.pay.java.core.Config;
+import com.wechat.pay.java.core.RSAAutoCertificateConfig;
+import com.wechat.pay.java.core.http.DefaultHttpClientBuilder;
+import com.wechat.pay.java.core.http.HttpClient;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.ClassPathResource;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyFactory;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.PKCS8EncodedKeySpec;
+
+/**
+ * @Author: syl
+ * @Date: 2023/3/14
+ * @Description:
+ */
+@Configuration
+@Slf4j
+public class WxPayV3Config {
+
+    @Value("${wx.mch-id}")
+    private String MCH_ID;
+    @Value("${wx.api-serial-no}")
+    private String SERIAL_NO;
+    @Value("${wx.apiv3-key}")
+    private String APIv3_privateKey;
+
+    @Bean
+    @Primary
+    public HttpClient getHttpClient(){
+        Config config =
+                null;
+        try {
+            config = new RSAAutoCertificateConfig.Builder()
+                    .merchantId(MCH_ID)
+                    .privateKey(getPrivateKey())
+                    .merchantSerialNumber(SERIAL_NO)
+                    .apiV3Key(APIv3_privateKey)
+                    .build();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        HttpClient httpClient = new DefaultHttpClientBuilder().config(config).build();
+        return httpClient;
+    }
+
+    public static PrivateKey getPrivateKey()throws IOException {
+        ClassPathResource cpr = new ClassPathResource("apiclient_key.pem");
+        InputStream in = cpr.getInputStream();
+        String privateKey = PayCommonUtil.InputStream2String(in);
+        PrivateKey merchantPrivateKey = PemUtil.loadPrivateKey(
+                new ByteArrayInputStream(privateKey.getBytes("utf-8")));
+        return merchantPrivateKey;
+    }
+}

+ 28 - 0
service/src/main/java/com/mofangchuxing/aska/service/impl/CouponServiceImpl.java

@@ -0,0 +1,28 @@
+package com.mofangchuxing.aska.service.impl;
+
+import com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos;
+import com.mofangchuxing.aska.dao.mapper.AskaChannelcouponnosMapper;
+import com.mofangchuxing.aska.service.CouponService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @Author: syl
+ * @Date: 2023/8/10
+ * @Description:
+ */
+@Service
+@Slf4j
+public class CouponServiceImpl implements CouponService {
+
+    @Resource
+    private AskaChannelcouponnosMapper askaChannelcouponnosMapper;
+
+    @Override
+    public AskaChannelcouponnos checkCoupon(String couponNo) {
+        AskaChannelcouponnos askaChannelcouponnos = askaChannelcouponnosMapper.searchAllByCouponNo(couponNo);
+        return askaChannelcouponnos;
+    }
+}

+ 61 - 21
service/src/main/java/com/mofangchuxing/aska/service/impl/PayServiceImpl.java

@@ -3,16 +3,16 @@ package com.mofangchuxing.aska.service.impl;
 import cn.hutool.core.util.IdUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.mofangchuxing.aska.dao.domain.AskaChannelcouponnos;
 import com.mofangchuxing.aska.dao.domain.PayRequest;
 import com.mofangchuxing.aska.dao.domain.RefundOrder;
+import com.mofangchuxing.aska.dao.mapper.AskaChannelcouponnosMapper;
 import com.mofangchuxing.aska.dao.mapper.PayRequestMapper;
 import com.mofangchuxing.aska.dao.mapper.RefundOrderMapper;
 import com.mofangchuxing.aska.domain.*;
-import com.mofangchuxing.aska.domain.enums.ClientTypeEnum;
-import com.mofangchuxing.aska.domain.enums.ItemTypeEnum;
-import com.mofangchuxing.aska.domain.enums.PayStatusEnum;
-import com.mofangchuxing.aska.domain.enums.ResultEnum;
+import com.mofangchuxing.aska.domain.enums.*;
 import com.mofangchuxing.aska.service.PayService;
+import com.mofangchuxing.aska.service.ProfitSharingService;
 import com.mofangchuxing.aska.service.common.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
+import javax.crypto.IllegalBlockSizeException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.*;
@@ -56,7 +57,10 @@ public class PayServiceImpl implements PayService {
     private RefundOrderMapper refundOrderMapper;
     @Resource
     private DelayNotifyComponent delayNotifyComponent;
-
+    @Resource
+    private ProfitSharingService profitSharingService;
+    @Resource
+    private AskaChannelcouponnosMapper askaChannelcouponnosMapper;
 
     @Override
     public ResponseResult prePay(PayRequestDto payRequestDto, Integer itemType) {
@@ -73,22 +77,31 @@ public class PayServiceImpl implements PayService {
         payRequest.setOpenId(payRequestDto.getUserId());
         payRequest.setMobile(payRequestDto.getPhoneNo());
         payRequest.setOrderId(payRequestDto.getOrderId());
-        payRequest.setAmount(payRequestDto.getAmount());
-        payRequest.setItemType(itemType);
         payRequest.setItemChannel(payRequestDto.getChannel());
+        payRequest.setAmount(payRequestDto.getAmount().multiply(new BigDecimal(100)).intValue());
+        payRequest.setItemType(itemType);
         payRequest.setCallbackUrl(payRequestDto.getCallBackUrl());
+        payRequest.setClientType(payRequestDto.getClientType());
         if (itemType == ItemTypeEnum.TYPE_COUPON.getType()) {
             payRequest.setItemId(payRequestDto.getCouponId());
             payRequest.setItemName(payRequestDto.getCouponType());
+            payRequest.setCansplit(0);
         } else {
             payRequest.setItemId(payRequestDto.getItemId());
             payRequest.setItemName(payRequestDto.getOrderType());
             payRequest.setUseCouponId(payRequestDto.getCouponId());
+            payRequest.setRetailId(payRequestDto.getRetailId());
+            payRequest.setRetailName(payRequestDto.getRetailName());
+            payRequest.setCansplit(1);
+            AskaChannelcouponnos askaChannelcouponnos = askaChannelcouponnosMapper.searchAllByCouponNo(payRequestDto.getCouponId());
+            if (askaChannelcouponnos != null) {
+                payRequest.setChannelId(askaChannelcouponnos.getChannelId());
+            }
         }
         String orderSn = IdUtil.fastSimpleUUID();
         payRequest.setOrderSn(orderSn);
         payRequestMapper.insertSelective(payRequest);
-        String requestXML = makeParameters(orderSn, payRequestDto.getAmount().multiply(new BigDecimal(100)), payRequestDto.getUserId(), payRequest.getItemName(), payRequestDto.getClientType());
+        String requestXML = makeParameters(orderSn, payRequest.getCansplit(), payRequestDto.getAmount().multiply(new BigDecimal(100)), payRequestDto.getUserId(), payRequest.getItemName(), payRequestDto.getClientType());
         log.info("预支付 requestXML = {}", requestXML);
         Map<String, Object> resultMap = wxPrepayOrder(orderSn, requestXML, payRequestDto.getClientType());
         String outTradeNo = "";
@@ -117,24 +130,25 @@ public class PayServiceImpl implements PayService {
         if (payRequest == null) {
             return new ResponseResult(ResultEnum.NO_ORDER_ERROR);
         }
-        if (payRequest.getPayAmount().compareTo(payRequestDto.getAmount()) != 0) {
-            return new ResponseResult(ResultEnum.AMOUNT_ERROR);
-        }
+        Integer refundAmount = payRequestDto.getAmount().multiply(new BigDecimal(100)).intValue();
         String refundOrderNo = "refund" + payRequest.getOrderSn() + GenerateCodeUtil.getFiveNumber();
-        boolean result = wxRefund(payRequest, payRequest.getAmount(), refundOrderNo);
+        boolean result = wxRefund(payRequest, refundAmount, refundOrderNo);
         if (!result) {
             return new ResponseResult(ResultEnum.UNKNOWN_ERROR);
         }
+        profitSharingService.returnOrder(payRequest.getId());
         RefundOrder refundOrder = new RefundOrder();
         refundOrder.setOrderSn(payRequestDto.getPaymentId());
         refundOrder.setRefundOrderSn(refundOrderNo);
-        refundOrder.setRefundAmount(payRequestDto.getAmount());
+        refundOrder.setRefundAmount(refundAmount);
         refundOrder.setMessage(payRequestDto.getMessage());
         refundOrder.setCreateTime(new Date());
         refundOrderMapper.insertSelective(refundOrder);
         PayRequest updatePayRequest = new PayRequest();
         updatePayRequest.setId(payRequest.getId());
         updatePayRequest.setPayStatus(PayStatusEnum.refund_success.getCode());
+        updatePayRequest.setRefundTotal(refundAmount);
+        updatePayRequest.setHasRefund(1);
         payRequestMapper.updateByPrimaryKeySelective(updatePayRequest);
         return new ResponseResult<>();
     }
@@ -201,21 +215,31 @@ public class PayServiceImpl implements PayService {
                 log.info("收到微信支付回调信息,packageParams:{}", packageParams);
                 String totalFee = (String) packageParams.get("total_fee");//支付費用
                 String openid = (String) packageParams.get("openid");//
+                String transactionId = (String) packageParams.get("transaction_id");//支付订单号
 
-                String totalFeeYuan = new BigDecimal(totalFee).divide(new BigDecimal(100)).toString();
+                Integer totalFeeYuan = Integer.parseInt(totalFee);
                 PayRequest payRequest = payRequestMapper.selectByOrderSn(out_trade_no);
                 log.info("pay status = {} bol = {}", payRequest.getPayStatus(), PayStatusEnum.not_pay.getCode().equals(payRequest.getPayStatus()));
                 if (PayStatusEnum.not_pay.getCode().equals(payRequest.getPayStatus())) {
                     //将回调的金额赋值给流水对象
                     PayRequest updatePayRequest = new PayRequest();
                     updatePayRequest.setId(payRequest.getId());
+                    updatePayRequest.setTransactionId(transactionId);
                     updatePayRequest.setPayStatus(PayStatusEnum.pay_success.getCode());
-                    updatePayRequest.setPayAmount(new BigDecimal(totalFeeYuan).setScale(2, BigDecimal.ROUND_HALF_UP));
+                    updatePayRequest.setPayAmount(totalFeeYuan);
                     updatePayRequest.setPayTime(new Date());
                     payRequestMapper.updateByPrimaryKeySelective(updatePayRequest);
                     partOne = "SUCCESS";
                     partTwo = "OK";
                     log.info("订单已处理订单号:{},out_trade_no:{}", payRequest.getOrderSn(), out_trade_no);
+                    if (payRequest.getCansplit() != null && payRequest.getCansplit() == 1) {
+                        try {
+                            profitSharingService.addSplitReceivers(payRequest.getClientType(), Long.parseLong(payRequest.getRetailId()), payRequest.getUseCouponId());
+                            delayNotifyComponent.delay(payRequest.getOrderSn(), DelayTypeEnum.TYPE_SPLIT, 2, TimeUnit.MINUTES);
+                        } catch (IllegalBlockSizeException e) {
+                            e.printStackTrace();
+                        }
+                    }
                 } else {
                     log.info("订单已经支付,无需重复支付,自动完成回调,:paymentRecord:{}", JSONObject.toJSONString(payRequest));
                     //该订单已经支付
@@ -227,7 +251,7 @@ public class PayServiceImpl implements PayService {
                     boolean result = delayNotifyComponent.notifyDown(orderId, payRequest.getCallbackUrl());
                     if (!result) {
                         delayNotifyComponent.saveDelayRecord(mchId, openid, orderId, totalFee, payRequest.getCallbackUrl());
-                        delayNotifyComponent.delay(orderId, 5, TimeUnit.SECONDS);
+                        delayNotifyComponent.delay(orderId, DelayTypeEnum.TYPE_NOTIFY, 5, TimeUnit.SECONDS);
                     }
                 }
             } else {
@@ -256,7 +280,7 @@ public class PayServiceImpl implements PayService {
      * @param price
      * @return
      */
-    public String makeParameters(String orderNo, BigDecimal price, String openId, String body, String clientType) {
+    public String makeParameters(String orderNo, Integer canSplit, BigDecimal price, String openId, String body, String clientType) {
         // 根据appFrom获得默认参数
         SortedMap<Object, Object> parameters = new TreeMap<Object, Object>();
 
@@ -279,6 +303,9 @@ public class PayServiceImpl implements PayService {
         parameters.put("notify_url", notifyUrl);
         parameters.put("total_fee", price.intValue() + "");
         log.info("封装微信需要的参数 createSign parameters:{}", parameters);
+        if (canSplit == 1) {
+            parameters.put("profit_sharing", "Y");
+        }
         //设置签名
         String sign = PayCommonUtil.createSign("UTF-8", parameters, apiKey);
         parameters.put("sign", sign);
@@ -349,7 +376,7 @@ public class PayServiceImpl implements PayService {
         return resultMap;
     }
 
-    public Boolean wxRefund(PayRequest payRequest, BigDecimal realRefundAmount, String refundOrderSn) throws Exception {
+    public Boolean wxRefund(PayRequest payRequest, Integer realRefundAmount, String refundOrderSn) throws Exception {
         SortedMap<Object, Object> packageParams = new TreeMap<Object, Object>();
         packageParams.put("appid", appId);
         packageParams.put("mch_id", mchId);
@@ -358,11 +385,11 @@ public class PayServiceImpl implements PayService {
         packageParams.put("out_trade_no", payRequest.getOrderSn());
         //退款单号
         packageParams.put("out_refund_no", refundOrderSn);
-        BigDecimal totalFee = realRefundAmount;
+        Integer totalFee = realRefundAmount;
         //订单总金额Utils.getMoney()
-        packageParams.put("total_fee", totalFee.multiply(new BigDecimal(100)).intValue() + "");
+        packageParams.put("total_fee", totalFee + "");
         //退款总金额
-        packageParams.put("refund_fee", realRefundAmount.multiply(new BigDecimal(100)).intValue() + "");
+        packageParams.put("refund_fee", realRefundAmount + "");
         packageParams.put("notify_url", "https://www.baidu.com/");
 
         String sign = PayCommonUtil.createSign("UTF-8", packageParams, apiKey);
@@ -398,4 +425,17 @@ public class PayServiceImpl implements PayService {
         log.error("微信退款失败 orderNo:{}", payRequest.getOrderSn());
         return false;
     }
+
+    @Override
+    public void testPaySplit(Long payRequestId) {
+        PayRequest payRequest = payRequestMapper.selectByPrimaryKey(payRequestId);
+        if (payRequest.getCansplit() != null && payRequest.getCansplit() == 1) {
+            try {
+                profitSharingService.addSplitReceivers(payRequest.getClientType(), Long.parseLong(payRequest.getRetailId()), payRequest.getUseCouponId());
+                delayNotifyComponent.delay(payRequest.getOrderSn(), DelayTypeEnum.TYPE_SPLIT, 2, TimeUnit.MINUTES);
+            } catch (IllegalBlockSizeException | IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
 }

+ 312 - 0
service/src/main/java/com/mofangchuxing/aska/service/impl/ProfitSharingServiceImpl.java

@@ -0,0 +1,312 @@
+package com.mofangchuxing.aska.service.impl;
+
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.mofangchuxing.aska.dao.domain.*;
+import com.mofangchuxing.aska.dao.mapper.*;
+import com.mofangchuxing.aska.domain.Constant;
+import com.mofangchuxing.aska.domain.enums.ClientTypeEnum;
+import com.mofangchuxing.aska.service.ProfitSharingService;
+import com.mofangchuxing.aska.service.utils.WxPayV3Utils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.crypto.IllegalBlockSizeException;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.*;
+
+/**
+ * @Author: syl
+ * @Date: 2023/3/14
+ * @Description:
+ */
+@Service
+@Slf4j
+public class ProfitSharingServiceImpl implements ProfitSharingService {
+
+    @Resource
+    private WxPayV3Utils wxPayV3Utils;
+    @Value("${wx.app-id}")
+    private String SA_APP_ID;
+    @Value("${wx.app-appid}")
+    private String APP_ID;
+    @Resource
+    private AskaRetailsMapper askaRetailsMapper;
+    @Resource
+    private AskaChannelsMapper askaChannelsMapper;
+    @Resource
+    private AskaSplitrecordMapper askaSplitrecordMapper;
+    @Resource
+    private AskaChannelcouponnosMapper askaChannelcouponnosMapper;
+    @Resource
+    private PayRequestMapper payRequestMapper;
+
+    @Override
+    public void addSplitReceivers(String clientType, Long retailId, String couponNo) throws IllegalBlockSizeException, IOException {
+        AskaRetails askaRetails = askaRetailsMapper.selectByPrimaryKey(retailId);
+        if (askaRetails != null) {
+            addProfitReceivers(clientType,askaRetails.getAccountType(), askaRetails.getAccount(), askaRetails.getAccountName());
+        }
+        if (StringUtils.isEmpty(couponNo)) {
+            return;
+        }
+        AskaChannelcouponnos askaChannelcouponnos = askaChannelcouponnosMapper.searchAllByCouponNo(couponNo);
+        if (askaChannelcouponnos != null){
+            AskaChannels askaChannels = askaChannelsMapper.selectByPrimaryKey(askaChannelcouponnos.getChannelId().longValue());
+            if (askaChannels == null) {
+                return;
+            }
+            addProfitReceivers(clientType, askaChannels.getAccountType(), askaChannels.getAccount(), askaChannels.getAccountName());
+        }
+    }
+
+    @Override
+    public void addProfitReceivers(String clientType, String accountType, String mchId, String name) throws IllegalBlockSizeException, IOException {
+
+        String url = "https://api.mch.weixin.qq.com/v3/profitsharing/receivers/add";
+        Map<String, Object> param = new HashMap<>();
+        if (clientType.equals(ClientTypeEnum.app.getType())) {
+            param.put("appid", APP_ID);
+        } else {
+            param.put("appid", SA_APP_ID);
+        }
+        if ("merchant".equals(accountType)) {
+            param.put("type", "MERCHANT_ID");
+            param.put("name", wxPayV3Utils.rsaEncryptOAEP(name));
+        }else {
+            param.put("type", "PERSONAL_OPENID");
+        }
+        param.put("account", mchId);
+        param.put("relation_type", "CUSTOM");
+        param.put("custom_relation", "加盟商");
+        JSONObject jsonObject = wxPayV3Utils.postRequest(url, JSONUtil.toJsonStr(param), JSONObject.class);
+        log.info("测试添加分账 result = {}", jsonObject.toJSONString());
+    }
+
+    @Override
+    public void profitSharing(String clientType, String orderNo, String transactionId, Integer payMoney, Long retailId, String couponNo) {
+        String url = "https://api.mch.weixin.qq.com/v3/profitsharing/orders";
+        Map<String, Object> param = new HashMap<>();
+        if (clientType.equals(ClientTypeEnum.app.getType())) {
+            param.put("appid", APP_ID);
+        } else {
+            param.put("appid", SA_APP_ID);
+        }
+        param.put("transaction_id", transactionId);
+        //分账订单号为P+系统订单号
+        String pOrderNo = "P" + orderNo;
+        param.put("out_order_no", pOrderNo);
+        AskaSplitrecord askaSplitrecord = new AskaSplitrecord();
+        PayRequest payRequest = payRequestMapper.selectByOrderSn(orderNo);
+        askaSplitrecord.setPayId(payRequest.getId());
+        askaSplitrecord.setPayAmount(payMoney);
+        askaSplitrecord.setSpiltOrderId(pOrderNo);
+        Integer maxValue = new BigDecimal(payMoney).multiply(new BigDecimal(0.3)).intValue();
+        List<Map<String, Object>> receivers = new ArrayList<>();
+        // 从门店读取配置 计算需要分账的金额
+        AskaRetails askaRetails = askaRetailsMapper.selectByPrimaryKey(retailId);
+        Integer retailAmount = 0;
+        Map<String, Object> retailReceiver = new HashMap<>();
+        if (askaRetails != null) {
+            retailReceiver = getReceiverMap(askaRetails.getAccountType(),
+                    askaRetails.getAccount(), askaRetails.getTripartite(), payMoney, askaRetails.getTripvalue(), askaRetails.getAccountName(), "分账给门店-" + askaRetails.getName());
+            askaSplitrecord.setRetailId(askaRetails.getId());
+            askaSplitrecord.setRetailName(askaRetails.getName());
+            retailAmount = Integer.parseInt(retailReceiver.get("amount").toString());
+            askaSplitrecord.setRetailAccount(askaRetails.getAccount());
+            askaSplitrecord.setRetailAmount(retailAmount.toString());
+        }
+        // 如果使用礼券 根据礼券查询渠道 计算需要分账的金额
+        AskaChannelcouponnos askaChannelcouponnos = askaChannelcouponnosMapper.searchAllByCouponNo(couponNo);
+        Integer channelAmount = 0;
+        Map<String, Object> channelReceiver = new HashMap<>();
+        if (askaChannelcouponnos != null){
+            AskaChannels askaChannels = askaChannelsMapper.selectByPrimaryKey(askaChannelcouponnos.getChannelId().longValue());
+            channelReceiver = getReceiverMap(askaChannels.getAccountType(),
+                    askaChannels.getAccount(),askaChannels.getTripartite(), payMoney, askaChannels.getTripvalue(), askaChannels.getAccountName(), "分账给渠道-"+askaChannels.getName());
+            receivers.add(channelReceiver);
+            askaSplitrecord.setChannelName(askaChannels.getName());
+            askaSplitrecord.setChannelId(askaChannels.getId());
+            channelAmount = Integer.parseInt(channelReceiver.get("amount").toString());
+            askaSplitrecord.setChannelAmount(channelAmount.toString());
+        }
+        // 计算门店和渠道最大可分账金额 剩下的记账
+        askaSplitrecord = calculateRecord(askaSplitrecord, maxValue, retailAmount, channelAmount);
+        if (askaSplitrecord.getRetailRealtimeAmount() > 0) {
+            retailReceiver.put("amount", askaSplitrecord.getRetailRealtimeAmount());
+            receivers.add(retailReceiver);
+        }
+        if (askaSplitrecord.getChannelRealtimeAmount() > 0) {
+            channelReceiver.put("amount", askaSplitrecord.getRetailRealtimeAmount());
+            receivers.add(channelReceiver);
+        }
+        param.put("receivers", receivers);
+        param.put("unfreeze_unsplit", true);
+        try {
+            JSONObject jsonObject = wxPayV3Utils.postRequest(url, JSONUtil.toJsonStr(param), JSONObject.class);
+            log.info("测试分账 result = {}", jsonObject.toJSONString());
+            if ("PROCESSING".equals(jsonObject.getString("state")) || "FINISHED".equals(jsonObject.getString("state"))) {
+                askaSplitrecord.setStatus(1);
+            }else {
+                askaSplitrecord.setStatus(0);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.info("测试分账 exception = {}", e.getMessage());
+        }
+        askaSplitrecord.setCreateTime(new Date());
+        askaSplitrecordMapper.insertSelective(askaSplitrecord);
+    }
+
+    /**
+     * 5种情况
+     *
+     * 0 --[1]-- ChSpVa --[2]-- ReSpVa --[3]-- ChSpVa+ReSpVa --[4]-- OrderValue
+     * 其中[2]的情况存在 ChVa 和 ReVa 位置交换的可能,所以一共是 1 2 2' 3 4 5种情况
+     *
+     * 4: maxValue >= ChSpVa+ReSpVa
+     *
+     * 	正常分账
+     *
+     * 3: ( maxValue<ChSpVa+ReSpVa && maxValue > ReSpVa && maxValue > ChSpVa )
+     *
+     * 	Retail 正常分账
+     * 	Channel 分账+记账
+     *
+     * 2: ( maxValue<ChSpVa+ReSpVa && maxValue <= ReSpVa && maxValue > ChSpVa )
+     *
+     * 	Channel 正常分账
+     * 	Retail 分账+记账
+     *
+     * 2': ( maxValue<ChSpVa+ReSpVa && maxValue > ReSpVa && maxValue <= ChSpva )
+     *
+     * 	Retail 正常分账
+     * 	Channel 分账+记账
+     *
+     * 1: maxValue<ReSpVa && maxValue<ChSpVa
+     *
+     * 	Retail 记账
+     * 	Channel 分账+记账
+     *
+     */
+    private AskaSplitrecord calculateRecord(AskaSplitrecord askaSplitrecord, Integer maxValue, Integer retailAmount, Integer channelAmount) {
+        if (maxValue < retailAmount && maxValue < channelAmount) {
+            askaSplitrecord.setRetailRealtimeAmount(0);
+            askaSplitrecord.setRetailAccountAmount(retailAmount);
+            askaSplitrecord.setChannelRealtimeAmount(maxValue);
+            askaSplitrecord.setChannelAccountAmount(channelAmount - maxValue);
+            return askaSplitrecord;
+        }
+        if (maxValue < retailAmount + channelAmount && maxValue > retailAmount && maxValue <= channelAmount) {
+            askaSplitrecord.setRetailRealtimeAmount(retailAmount);
+            askaSplitrecord.setRetailAccountAmount(0);
+            Integer lastAmount = maxValue - retailAmount;
+            askaSplitrecord.setChannelRealtimeAmount(lastAmount);
+            askaSplitrecord.setChannelAccountAmount(channelAmount - lastAmount);
+            return askaSplitrecord;
+        }
+        if (maxValue < retailAmount + channelAmount && maxValue <= retailAmount && maxValue > channelAmount) {
+            askaSplitrecord.setChannelRealtimeAmount(channelAmount);
+            askaSplitrecord.setChannelAccountAmount(0);
+            Integer lastAmount = maxValue - channelAmount;
+            askaSplitrecord.setRetailRealtimeAmount(lastAmount);
+            askaSplitrecord.setRetailAccountAmount(retailAmount - lastAmount);
+            return askaSplitrecord;
+        }
+        if (maxValue < retailAmount + channelAmount && maxValue > retailAmount && maxValue > channelAmount) {
+            askaSplitrecord.setChannelRealtimeAmount(channelAmount);
+            askaSplitrecord.setChannelAccountAmount(0);
+            Integer lastAmount = maxValue - channelAmount;
+            Integer realTimeAmount = retailAmount > lastAmount ? lastAmount : retailAmount;
+            askaSplitrecord.setRetailRealtimeAmount(realTimeAmount);
+            askaSplitrecord.setRetailAccountAmount(retailAmount - realTimeAmount);
+            return askaSplitrecord;
+        }
+        if (maxValue >= retailAmount + channelAmount) {
+            askaSplitrecord.setChannelRealtimeAmount(channelAmount);
+            askaSplitrecord.setChannelAccountAmount(0);
+            askaSplitrecord.setRetailRealtimeAmount(retailAmount);
+            askaSplitrecord.setRetailAccountAmount(0);
+            return askaSplitrecord;
+        }
+        return askaSplitrecord;
+    }
+
+    private Map<String, Object> getReceiverMap(String accountType, String account, String profitType, Integer payMoney, Integer profitValue, String accountName, String description) {
+        Map<String, Object> receiver = new HashMap<>();
+        if ("merchant".equals(accountType)) {
+            receiver.put("type", "MERCHANT_ID");
+            try {
+                receiver.put("name", wxPayV3Utils.rsaEncryptOAEP(accountName));
+            } catch (IllegalBlockSizeException e) {
+                e.printStackTrace();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        } else {
+            receiver.put("type", "PERSONAL_OPENID");
+        }
+        receiver.put("account", account);
+        if ("rate".equals(profitType)) {
+            Integer amount = new BigDecimal(payMoney).multiply(new BigDecimal(profitValue)).divide(new BigDecimal(1000)).intValue();
+            receiver.put("amount", amount);
+        } else {
+            Integer amount = profitValue;
+            receiver.put("amount", amount);
+        }
+        receiver.put("description", description);
+        return receiver;
+    }
+
+    @Override
+    public void returnOrder(Integer payId) {
+        AskaSplitrecord askaSplitrecord = askaSplitrecordMapper.selectAllByPayId(payId);
+        if (askaSplitrecord != null) {
+            //门店分账回退
+            returnSplitApi(askaSplitrecord.getSpiltOrderId(), askaSplitrecord.getRetailAccount(), askaSplitrecord.getRetailRealtimeAmount());
+            //渠道分账回退
+            returnSplitApi(askaSplitrecord.getSpiltOrderId(), askaSplitrecord.getChannelAccount(), askaSplitrecord.getChannelRealtimeAmount());
+            AskaSplitrecord updateRecord = new AskaSplitrecord();
+            updateRecord.setId(askaSplitrecord.getId());
+            Integer totalRefund = askaSplitrecord.getRetailRealtimeAmount() + askaSplitrecord.getChannelRealtimeAmount();
+            updateRecord.setRefundTotal(totalRefund);
+            updateRecord.setHasRefund(1);
+            updateRecord.setRefundRetail(askaSplitrecord.getRetailRealtimeAmount());
+            updateRecord.setRefundChannel(askaSplitrecord.getChannelRealtimeAmount());
+            askaSplitrecordMapper.updateByPrimaryKeySelective(updateRecord);
+        }
+    }
+
+    public Boolean returnSplitApi(String pOrderSn, String account, Integer amount) {
+        if (StringUtils.isEmpty(account) || amount == null) {
+            return false;
+        }
+        String url = "https://api.mch.weixin.qq.com/v3/profitsharing/return-orders";
+        log.info("开始分账回退 pOrderSn = {}", pOrderSn);
+        Map<String, Object> param = new HashMap<>();
+        param.put("out_order_no", pOrderSn);
+        String orderNo = "R" + pOrderSn;
+        param.put("out_return_no", orderNo);
+        param.put("return_mchid", account);
+        param.put("amount", amount);
+        param.put("description", "用户退款");
+        JSONObject jsonObject = wxPayV3Utils.postRequest(url, JSONUtil.toJsonStr(param), JSONObject.class);
+        log.info("测试分账退款 result = {}", jsonObject.toJSONString());
+        if ("PROCESSING".equals(jsonObject.getString("result")) || "SUCCESS".equals(jsonObject.getString("result"))){
+            return true;
+        }
+        return false;
+    }
+
+    public JSONObject queryProfit(String outOrderNo, String transactionId) {
+        String url = "https://api.mch.weixin.qq.com/v3/profitsharing/orders/" + outOrderNo + "?transaction_id=" + transactionId;
+        JSONObject jsonObject = wxPayV3Utils.getRequest(url, JSONObject.class);
+        log.info("testQuery = {}", jsonObject.toJSONString());
+        return jsonObject;
+    }
+}

+ 10 - 3
service/src/main/java/com/mofangchuxing/aska/service/impl/RetailServiceImpl.java

@@ -7,6 +7,7 @@ import com.mofangchuxing.aska.dao.domain.AskaRetails;
 import com.mofangchuxing.aska.dao.mapper.AskaRetailsMapper;
 import com.mofangchuxing.aska.domain.dto.RetailDto;
 import com.mofangchuxing.aska.domain.utils.PageUtils;
+import com.mofangchuxing.aska.domain.vo.AskaRetailsVo;
 import com.mofangchuxing.aska.service.RetailService;
 import org.springframework.stereotype.Service;
 
@@ -61,7 +62,7 @@ public class RetailServiceImpl implements RetailService {
         if (askaRetails != null) {
             AskaRetails updateRetails = new AskaRetails();
             updateRetails.setId(askaRetails.getId());
-            updateRetails.setRealtimesplit(retailDto.getRealtimeSplit() ? 0 : 1);
+            updateRetails.setRealtimeSplit(retailDto.getRealtimeSplit() ? 0 : 1);
             updateRetails.setTripartite(retailDto.getTripartite());
             updateRetails.setTripvalue(Integer.parseInt(retailDto.getTripvalue()));
             updateRetails.setStatus(retailDto.getStatus());
@@ -74,8 +75,8 @@ public class RetailServiceImpl implements RetailService {
     @Override
     public PageUtils listAllRetails(RetailDto retailDto) {
         PageHelper.startPage(retailDto.getPageNum(), retailDto.getPageSize());
-        List<AskaRetails> list = askaRetailsMapper.listAllRetails(retailDto);
-        PageInfo<AskaRetails> pageInfo = new PageInfo<>(list);
+        List<AskaRetailsVo> list = askaRetailsMapper.listAllRetails(retailDto);
+        PageInfo<AskaRetailsVo> pageInfo = new PageInfo<>(list);
         PageUtils page = new PageUtils(pageInfo.getList(), (int) pageInfo.getTotal(), pageInfo.getPageSize(), pageInfo.getPageNum());
         return page;
     }
@@ -85,4 +86,10 @@ public class RetailServiceImpl implements RetailService {
         AskaRetails askaRetails = askaRetailsMapper.selectByPrimaryKey(retailDto.getRetailId());
         return askaRetails;
     }
+
+    @Override
+    public List<AskaRetailsVo> listAllRetails() {
+        List<AskaRetailsVo> list = askaRetailsMapper.listAllRetailsNoLimit();
+        return list;
+    }
 }

+ 273 - 0
service/src/main/java/com/mofangchuxing/aska/service/utils/WxPayV3Utils.java

@@ -0,0 +1,273 @@
+package com.mofangchuxing.aska.service.utils;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.mofangchuxing.aska.domain.entity.PlainCertificateItem;
+import com.mofangchuxing.aska.domain.vo.WeiXinPayScoreServiceResourceDTO;
+import com.mofangchuxing.aska.domain.vo.WeiXinPlatformCredentialVO;
+import com.mofangchuxing.aska.service.common.PayCommonUtil;
+import com.wechat.pay.java.core.http.*;
+import com.wechat.pay.java.core.util.PemUtil;
+import lombok.extern.slf4j.Slf4j;
+import okhttp3.HttpUrl;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
+import java.io.*;
+import java.nio.charset.StandardCharsets;
+import java.security.GeneralSecurityException;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Signature;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.List;
+import java.util.Random;
+import com.wechat.pay.contrib.apache.httpclient.util.AesUtil;
+
+@Component
+@Slf4j
+public class WxPayV3Utils {
+
+    @Resource
+    private HttpClient httpClient;
+    @Value("${wx.public-serial-no}")
+    private String publicSerialNo;
+
+    public <T> T postRequest(String url, String jsonBody, Class<T> t) {
+        log.info("WxPayV3Utils postRequest url = {}, jsonBody = {}", url, jsonBody);
+        HttpHeaders headers = new HttpHeaders();
+        headers.addHeader(Constant.ACCEPT, MediaType.APPLICATION_JSON.getValue());
+        headers.addHeader(Constant.CONTENT_TYPE, MediaType.APPLICATION_JSON.getValue());
+        HttpResponse<T> httpResponse = null;
+        headers.addHeader("Wechatpay-Serial", publicSerialNo);
+        JsonRequestBody body = new JsonRequestBody.Builder().body(JSONUtil.toJsonStr(jsonBody)).build();
+        HttpRequest httpRequest =
+                new HttpRequest.Builder()
+                        .httpMethod(HttpMethod.POST)
+                        .url(url)
+                        .headers(headers)
+                        .body(body)
+                        .build();
+
+        httpResponse = httpClient.execute(httpRequest, t);
+        return httpResponse.getServiceResponse();
+    }
+
+    public <T> T getRequest(String url, Class<T> t) {
+        log.info("WxPayV3Utils postRequest url = {}, jsonBody = {}", url);
+        HttpHeaders headers = new HttpHeaders();
+        headers.addHeader(Constant.ACCEPT, MediaType.APPLICATION_JSON.getValue());
+        headers.addHeader(Constant.CONTENT_TYPE, MediaType.APPLICATION_JSON.getValue());
+        headers.addHeader("Wechatpay-Serial", publicSerialNo);
+        HttpRequest httpRequest =
+                new HttpRequest.Builder()
+                        .httpMethod(HttpMethod.GET)
+                        .url(url)
+                        .headers(headers)
+                        .build();
+        HttpResponse<T> httpResponse =
+                httpClient.execute(httpRequest, t);
+        return httpResponse.getServiceResponse();
+    }
+
+    public String rsaEncryptOAEP(String message)
+            throws IllegalBlockSizeException, IOException {
+        try {
+            ClassPathResource cpr = new ClassPathResource("wechatpay.pem");
+            InputStream in = cpr.getInputStream();
+            CertificateFactory certificatefactory = CertificateFactory.getInstance("X.509");
+            X509Certificate cert = (X509Certificate) certificatefactory.generateCertificate(in);
+            Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-1AndMGF1Padding");
+            cipher.init(Cipher.ENCRYPT_MODE, cert.getPublicKey());
+
+            byte[] data = message.getBytes("utf-8");
+            byte[] cipherdata = cipher.doFinal(data);
+            return Base64.getEncoder().encodeToString(cipherdata);
+        } catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
+            throw new RuntimeException("当前Java环境不支持RSA v1.5/OAEP", e);
+        } catch (InvalidKeyException e) {
+            throw new IllegalArgumentException("无效的证书", e);
+        } catch (IllegalBlockSizeException | BadPaddingException e) {
+            throw new IllegalBlockSizeException("加密原串的长度不能超过214字节");
+        } catch (CertificateException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    //method(请求类型GET、POST url(请求url) body(请求body,GET请求时body传"",POST请求时body为请求参数的json串)  merchantId(商户号) certSerialNo(API证书序列号) keyPath(API证书路径)
+    public static String getToken(String method, String url, String body, String merchantId, String certSerialNo)throws Exception {
+        String signStr ="";
+        HttpUrl httpurl = HttpUrl.parse(url);
+        String nonceStr = create_nonce_str();
+        long timestamp = System.currentTimeMillis() /1000;
+        if (StringUtils.isEmpty(body)) {
+            body ="";
+        }
+        String message = buildMessage(method, httpurl, timestamp, nonceStr, body);
+        String signature = sign(message.getBytes("utf-8"));
+        signStr ="mchid=\"" + merchantId
+                +"\",nonce_str=\"" + nonceStr
+                +"\",timestamp=\"" + timestamp
+                +"\",serial_no=\"" + certSerialNo
+                +"\",signature=\"" + signature +"\"";
+        return signStr;
+    }
+
+
+    public static String buildMessage(String method, HttpUrl url,long timestamp, String nonceStr, String body) {
+        String canonicalUrl = url.encodedPath();
+        if (url.encodedQuery() !=null) {
+            canonicalUrl +="?" + url.encodedQuery();
+        }
+        return method +"\n"
+                + canonicalUrl +"\n"
+                + timestamp +"\n"
+                + nonceStr +"\n"
+                + body +"\n";
+    }
+
+    public static String sign(byte[] message)throws Exception {
+        Signature sign = Signature.getInstance("SHA256withRSA");
+        sign.initSign(PayCommonUtil.getPrivateKey());
+        sign.update(message);
+        return org.apache.commons.codec.binary.Base64.encodeBase64String(sign.sign());
+    }
+
+    private static String[] STR_ARR =new String[] {"a","b","c","d","e",
+            "f","g","h","i","j","k","l","m","n","o","p","q","r",
+            "s","t","u","v","w","x","y","z","A","B","C","D","E",
+            "F","G","H","I","J","K","L","M","N","O","P","Q","R",
+            "S","T","U","V","W","X","Y","Z","1","2","3","4","5",
+            "6","7","8","9","0" };
+
+    /**
+     * 获取32位随机数
+     * @return
+     */
+    public static String create_nonce_str() {
+        StringBuilder sb =new StringBuilder();
+        Random rand =new Random();
+        for (int i =0; i <32; i++) {
+            sb.append(STR_ARR[rand.nextInt(STR_ARR.length)]);
+        }
+        return sb.toString();
+    }
+
+    public static List<X509Certificate> getCertByAPI(String merchantId, String url, int timeout, String body, String certSerialNo, String keyPath)throws UnsupportedEncodingException, Exception {
+        String result ="";
+        //创建http请求
+        HttpGet httpGet =new HttpGet(url);
+        httpGet.addHeader("Content-Type","application/json");
+        httpGet.addHeader("Accept","application/json");
+
+        //设置认证信息
+        httpGet.setHeader("Authorization","WECHATPAY2-SHA256-RSA2048" +" " + getToken("GET", url,null, merchantId, certSerialNo));
+
+        //设置请求器配置:如超时限制等
+        RequestConfig config = RequestConfig.custom().setSocketTimeout(timeout *1000).setConnectTimeout(timeout *1000).build();
+        httpGet.setConfig(config);
+        List<X509Certificate> x509Certs =new ArrayList<X509Certificate>();
+        try {
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            CloseableHttpResponse response = httpClient.execute(httpGet);
+            int statusCode = response.getStatusLine().getStatusCode();
+            HttpEntity httpEntity = response.getEntity();
+            result = EntityUtils.toString(httpEntity,"UTF-8");
+            if (statusCode ==200) {
+                log.info("下载平台证书返回结果:" + result);
+                List<WeiXinPlatformCredentialVO> certList =new ArrayList<WeiXinPlatformCredentialVO>();
+                JSONObject json = JSONObject.parseObject(result);
+                log.info("查询结果json字符串转证书List:" + json.get("data"));
+                JSONArray jsonArray = (JSONArray) json.get("data");
+                for (int i =0; i < jsonArray.size(); i++) {
+                    WeiXinPlatformCredentialVO certificateItem =new WeiXinPlatformCredentialVO();
+                    WeiXinPayScoreServiceResourceDTO encryptCertificate =new WeiXinPayScoreServiceResourceDTO();
+                    JSONObject bo = JSONObject.parseObject(jsonArray.get(i).toString());
+                    certificateItem.setSerial_no(bo.get("serial_no").toString());
+                    certificateItem.setEffective_time(bo.get("effective_time").toString());
+                    certificateItem.setExpire_time(bo.get("expire_time").toString());
+                    JSONObject encryptBo = JSONObject.parseObject(bo.get("encrypt_certificate").toString());
+                    encryptCertificate.setAlgorithm(encryptBo.get("algorithm").toString());
+                    encryptCertificate.setNonce(encryptBo.get("nonce").toString());
+                    encryptCertificate.setAssociated_data(encryptBo.get("associated_data").toString());
+                    encryptCertificate.setCiphertext(encryptBo.get("ciphertext").toString());
+                    certificateItem.setEncrypt_certificate(encryptCertificate);
+                    certList.add(certificateItem);
+                }
+                log.info("证书List:" + certList);
+
+                List<PlainCertificateItem> plainList = decrypt(certList, response);
+                if (CollectionUtil.isNotEmpty(plainList)) {
+                    log.info("平台证书开始保存");
+                    x509Certs = saveCertificate(plainList);
+                }
+            }
+            response.close();
+            httpClient.close();//throw
+            return x509Certs;
+        }catch (Exception e) {
+            e.printStackTrace();
+            log.error("下载平台证书返回结果:" + e);
+        }
+        return x509Certs;
+    }
+
+    private static List<PlainCertificateItem> decrypt(List<WeiXinPlatformCredentialVO> certList,CloseableHttpResponse response) throws GeneralSecurityException, IOException{
+        List<PlainCertificateItem> plainCertificateList = new ArrayList<PlainCertificateItem>();
+        AesUtil aesUtil = new AesUtil("87b90c2065d9caa1c767ff1b15b21e52".getBytes(StandardCharsets.UTF_8));
+        for(WeiXinPlatformCredentialVO item:certList){
+            PlainCertificateItem bo = new PlainCertificateItem();
+            bo.setSerialNo(item.getSerial_no());
+            bo.setEffectiveTime(item.getEffective_time());
+            bo.setExpireTime(item.getExpire_time());
+            log.info("平台证书密文解密");
+            bo.setPlainCertificate(aesUtil.decryptToString(item.getEncrypt_certificate().getAssociated_data().getBytes(StandardCharsets.UTF_8),
+                    item.getEncrypt_certificate().getNonce().getBytes(StandardCharsets.UTF_8), item.getEncrypt_certificate().getCiphertext()));
+            log.info("平台证书公钥明文:"+bo.getPlainCertificate());
+            plainCertificateList.add(bo);
+        }
+        return plainCertificateList;
+    }
+    //证书保存
+    private static List<X509Certificate> saveCertificate(List<PlainCertificateItem> cert) throws IOException {
+        List<X509Certificate> x509Certs = new ArrayList<X509Certificate>();
+        File file = new File("666666666/");
+        file.mkdirs();
+        for (PlainCertificateItem item : cert) {
+            ByteArrayInputStream inputStream = new ByteArrayInputStream(item.getPlainCertificate().getBytes(StandardCharsets.UTF_8));
+            X509Certificate x509Cert = PemUtil.loadX509FromStream(inputStream);
+            x509Certs.add(x509Cert);
+            String outputAbsoluteFilename = file.getAbsolutePath() + File.separator + "wechatpay_" + item.getSerialNo() + ".pem";
+            try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputAbsoluteFilename), StandardCharsets.UTF_8))) {
+                writer.write(item.getPlainCertificate());
+            }
+            log.info("输出证书文件目录:"+outputAbsoluteFilename);
+        }
+        return x509Certs;
+    }
+
+    public static void main(String[] args) throws Exception {
+        getCertByAPI("1641830577", "https://api.mch.weixin.qq.com/v3/certificates", 10, "", "22098B381BAE268F47FE823C70C3AA7702EE54C4", "");
+    }
+}

BIN
service/target/aska-service-1.0.jar


BIN
service/target/classes/com/mofangchuxing/aska/service/CouponService.class


BIN
service/target/classes/com/mofangchuxing/aska/service/PayService.class


BIN
service/target/classes/com/mofangchuxing/aska/service/ProfitSharingService.class


BIN
service/target/classes/com/mofangchuxing/aska/service/RetailService.class


BIN
service/target/classes/com/mofangchuxing/aska/service/common/DelayNotifyComponent$1.class


BIN
service/target/classes/com/mofangchuxing/aska/service/common/DelayNotifyComponent.class


BIN
service/target/classes/com/mofangchuxing/aska/service/config/WxPayV3Config.class


BIN
service/target/classes/com/mofangchuxing/aska/service/impl/CouponServiceImpl.class


BIN
service/target/classes/com/mofangchuxing/aska/service/impl/PayServiceImpl.class


BIN
service/target/classes/com/mofangchuxing/aska/service/impl/ProfitSharingServiceImpl.class


BIN
service/target/classes/com/mofangchuxing/aska/service/impl/RetailServiceImpl.class


BIN
service/target/classes/com/mofangchuxing/aska/service/utils/WxPayV3Utils.class


+ 15 - 8
service/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -1,18 +1,25 @@
-com/mofangchuxing/aska/service/common/GenerateCodeUtil$Mythread.class
 com/mofangchuxing/aska/service/config/RedissonConfig.class
-com/mofangchuxing/aska/service/RetailService.class
 com/mofangchuxing/aska/service/impl/PayServiceImpl.class
+com/mofangchuxing/aska/service/impl/CouponServiceImpl.class
 com/mofangchuxing/aska/service/common/ClientCustomSSL.class
+com/mofangchuxing/aska/service/config/RedisConfig.class
+com/mofangchuxing/aska/service/common/XMLUtil.class
+com/mofangchuxing/aska/service/CouponService.class
+com/mofangchuxing/aska/service/impl/ProfitSharingServiceImpl.class
+com/mofangchuxing/aska/service/impl/RetailServiceImpl.class
+com/mofangchuxing/aska/service/common/PayCommonUtil.class
+com/mofangchuxing/aska/service/common/MyX509TrustManager.class
+com/mofangchuxing/aska/service/PayService.class
+com/mofangchuxing/aska/service/config/WxPayV3Config.class
+com/mofangchuxing/aska/service/common/GenerateCodeUtil$Mythread.class
+com/mofangchuxing/aska/service/RetailService.class
 com/mofangchuxing/aska/service/impl/ChannelServiceImpl.class
 com/mofangchuxing/aska/service/common/MD5Util.class
 com/mofangchuxing/aska/service/impl/UserServiceImpl.class
-com/mofangchuxing/aska/service/config/RedisConfig.class
 com/mofangchuxing/aska/service/common/DelayNotifyComponent.class
-com/mofangchuxing/aska/service/common/XMLUtil.class
+com/mofangchuxing/aska/service/ProfitSharingService.class
 com/mofangchuxing/aska/service/UserService.class
 com/mofangchuxing/aska/service/common/GenerateCodeUtil.class
 com/mofangchuxing/aska/service/ChannelService.class
-com/mofangchuxing/aska/service/impl/RetailServiceImpl.class
-com/mofangchuxing/aska/service/common/PayCommonUtil.class
-com/mofangchuxing/aska/service/common/MyX509TrustManager.class
-com/mofangchuxing/aska/service/PayService.class
+com/mofangchuxing/aska/service/utils/WxPayV3Utils.class
+com/mofangchuxing/aska/service/common/DelayNotifyComponent$1.class

+ 6 - 0
service/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -2,16 +2,22 @@
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/common/XMLUtil.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/impl/RetailServiceImpl.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/common/MD5Util.java
+/Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/impl/CouponServiceImpl.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/impl/UserServiceImpl.java
+/Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/impl/ProfitSharingServiceImpl.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/common/ClientCustomSSL.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/common/PayCommonUtil.java
+/Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/config/WxPayV3Config.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/ChannelService.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/common/GenerateCodeUtil.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/impl/PayServiceImpl.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/UserService.java
+/Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/CouponService.java
+/Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/utils/WxPayV3Utils.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/common/DelayNotifyComponent.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/PayService.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/common/MyX509TrustManager.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/config/RedisConfig.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/config/RedissonConfig.java
 /Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/impl/ChannelServiceImpl.java
+/Users/syl/Desktop/work/aska/service/src/main/java/com/mofangchuxing/aska/service/ProfitSharingService.java