refactor: 将 paytype 改为 sourcetype , 定义来源,包括消费、充值
diff --git a/src/main/java/com/supwisdom/dlpay/api/dao/PaytypeDao.java b/src/main/java/com/supwisdom/dlpay/api/dao/PaytypeDao.java
index bd2c959..dd6503b 100644
--- a/src/main/java/com/supwisdom/dlpay/api/dao/PaytypeDao.java
+++ b/src/main/java/com/supwisdom/dlpay/api/dao/PaytypeDao.java
@@ -1,6 +1,6 @@
 package com.supwisdom.dlpay.api.dao;
 
-import com.supwisdom.dlpay.api.domain.TPaytype;
+import com.supwisdom.dlpay.api.domain.TSourceType;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.repository.JpaRepository;
@@ -13,11 +13,11 @@
  * Created by shuwei on 2019/4/9.
  */
 @Repository
-public interface PaytypeDao extends JpaRepository<TPaytype, String> {
-  TPaytype getByPaytype(String paytype);
+public interface PaytypeDao extends JpaRepository<TSourceType, String> {
+  TSourceType getByPaytype(String paytype);
 
-  Page<TPaytype> findByPaytypeContaining(String paytype, Pageable pageable);
+  Page<TSourceType> findByPaytypeContaining(String paytype, Pageable pageable);
 
-  @Query("select t from TPaytype t")
-  List<TPaytype> getConsumePaytypes();
+  @Query("select t from TSourceType t")
+  List<TSourceType> getConsumePaytypes();
 }
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TPaytype.java b/src/main/java/com/supwisdom/dlpay/api/domain/TPaytype.java
deleted file mode 100644
index 088cb9e..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPaytype.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.*;
-
-/**
- * Created by shuwei on 2019/4/9.
- */
-@Entity
-@Table(name = "TB_PAYTYPE")
-public class TPaytype {
-    @Id
-    @Column(name = "PAYTYPE", nullable = false, length = 20)
-    private String paytype;
-
-    @Column(name = "ENABLE", nullable = false, length = 20)
-    private String enable;
-
-    @Column(name = "CHARGE_ENABLE", nullable = false, length = 10)
-    private String chargeEnable; //充值总开关
-
-    @Column(name = "CONSUME_ENABLE",nullable = false, length = 10)
-    private String consumeEnable; //消费总开关
-
-    @Column(name = "ANONYMOUS_ENABLE", nullable = false, length = 10)
-    private String anonymousEnable; //匿名消费总开关
-
-    @Column(name = "PAYDESC",  length = 200)
-    private String paydesc;
-
-    public String getPaytype() {
-        return paytype;
-    }
-
-    public void setPaytype(String paytype) {
-        this.paytype = paytype;
-    }
-
-    public String getEnable() {
-        return enable;
-    }
-
-    public void setEnable(String enable) {
-        this.enable = enable;
-    }
-
-    public String getChargeEnable() {
-        return chargeEnable;
-    }
-
-    public void setChargeEnable(String chargeEnable) {
-        this.chargeEnable = chargeEnable;
-    }
-
-    public String getConsumeEnable() {
-        return consumeEnable;
-    }
-
-    public void setConsumeEnable(String consumeEnable) {
-        this.consumeEnable = consumeEnable;
-    }
-
-    public String getAnonymousEnable() {
-        return anonymousEnable;
-    }
-
-    public void setAnonymousEnable(String anonymousEnable) {
-        this.anonymousEnable = anonymousEnable;
-    }
-
-    public String getPaydesc() {
-        return paydesc;
-    }
-
-    public void setPaydesc(String paydesc) {
-        this.paydesc = paydesc;
-    }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TPersondtl.java b/src/main/java/com/supwisdom/dlpay/api/domain/TPersondtl.java
index bb52bba..3db4e5a 100644
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPersondtl.java
+++ b/src/main/java/com/supwisdom/dlpay/api/domain/TPersondtl.java
@@ -41,8 +41,8 @@
   @Column(name = "amount", precision = 9, scale = 2, nullable = false)
   private Double amount; //实际付款金额
 
-  @Column(name = "PAYTYPE", length = 20)
-  private String paytype; //支付方式 balance,wechat,alipay
+  @Column(name = "SOURCETYPE", length = 20)
+  private String sourceType; //支付方式 balance,wechat,alipay
 
   @Column(name = "PAYINFO", length = 200)
   private String payinfo; //记录支付信息备用字段
@@ -141,12 +141,12 @@
     this.amount = amount;
   }
 
-  public String getPaytype() {
-    return paytype;
+  public String getSourceType() {
+    return sourceType;
   }
 
-  public void setPaytype(String paytype) {
-    this.paytype = paytype;
+  public void setSourceType(String sourceType) {
+    this.sourceType = sourceType;
   }
 
   public String getPayinfo() {
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TShopdtl.java b/src/main/java/com/supwisdom/dlpay/api/domain/TShopdtl.java
index 95a7b0f..681085d 100644
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TShopdtl.java
+++ b/src/main/java/com/supwisdom/dlpay/api/domain/TShopdtl.java
@@ -1,7 +1,5 @@
 package com.supwisdom.dlpay.api.domain;
 
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-
 import javax.persistence.*;
 
 @Entity
@@ -35,8 +33,8 @@
   @Column(name = "tradecode", precision = 8)
   private Integer tradeCode;
 
-  @Column(name = "paytype", length = 20)
-  private String payType;
+  @Column(name = "sourcetype", length = 20)
+  private String sourceType;
 
   @Column(name = "payinfo", length = 200)
   private String payInfo;
@@ -118,12 +116,12 @@
     this.transTime = transTime;
   }
 
-  public String getPayType() {
-    return payType;
+  public String getSourceType() {
+    return sourceType;
   }
 
-  public void setPayType(String payType) {
-    this.payType = payType;
+  public void setSourceType(String sourceType) {
+    this.sourceType = sourceType;
   }
 
   public String getPayInfo() {
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TSourceType.java b/src/main/java/com/supwisdom/dlpay/api/domain/TSourceType.java
new file mode 100644
index 0000000..ef6b430
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/api/domain/TSourceType.java
@@ -0,0 +1,88 @@
+package com.supwisdom.dlpay.api.domain;
+
+import javax.persistence.*;
+
+/**
+ * Created by shuwei on 2019/4/9.
+ */
+@Entity
+@Table(name = "TB_SOURCETYPE")
+public class TSourceType {
+  @Id
+  @Column(name = "PAYTYPE", nullable = false, length = 20)
+  private String sourceType;
+
+  @Column(name = "ENABLE", nullable = false, length = 20)
+  private String enable;
+
+  @Column(name = "CHARGE_ENABLE", nullable = false, length = 10)
+  private String chargeEnable; //充值总开关
+
+  @Column(name = "CONSUME_ENABLE", nullable = false, length = 10)
+  private String consumeEnable; //消费总开关
+
+  @Column(name = "ANONYMOUS_ENABLE", nullable = false, length = 10)
+  private String anonymousEnable; //匿名消费总开关
+
+  @Column(name = "checkable")
+  private Boolean checkable; // 是否需要清算
+
+  @Column(name = "PAYDESC", length = 200)
+  private String paydesc;
+
+  public String getSourceType() {
+    return sourceType;
+  }
+
+  public void setSourceType(String sourceType) {
+    this.sourceType = sourceType;
+  }
+
+  public String getEnable() {
+    return enable;
+  }
+
+  public void setEnable(String enable) {
+    this.enable = enable;
+  }
+
+  public String getChargeEnable() {
+    return chargeEnable;
+  }
+
+  public void setChargeEnable(String chargeEnable) {
+    this.chargeEnable = chargeEnable;
+  }
+
+  public String getConsumeEnable() {
+    return consumeEnable;
+  }
+
+  public void setConsumeEnable(String consumeEnable) {
+    this.consumeEnable = consumeEnable;
+  }
+
+  public String getAnonymousEnable() {
+    return anonymousEnable;
+  }
+
+  public void setAnonymousEnable(String anonymousEnable) {
+    this.anonymousEnable = anonymousEnable;
+  }
+
+  public String getPaydesc() {
+    return paydesc;
+  }
+
+  public void setPaydesc(String paydesc) {
+    this.paydesc = paydesc;
+  }
+
+  public Boolean getCheckable() {
+    return checkable;
+  }
+
+  public void setCheckable(Boolean checkable) {
+    this.checkable = checkable;
+  }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TTransactionMain.java b/src/main/java/com/supwisdom/dlpay/api/domain/TTransactionMain.java
index fa3fc8d..bd4a00f 100644
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TTransactionMain.java
+++ b/src/main/java/com/supwisdom/dlpay/api/domain/TTransactionMain.java
@@ -38,6 +38,9 @@
   @Column(name = "status", length = 20)
   private String status = "none";
 
+  @Column(name = "sourcetype", length = 20)
+  private String sourceType = "";
+
   @Column(name = "outtradeno", length = 60)
   private String outTradeNo = "";
 
@@ -50,6 +53,9 @@
   @Column(name = "OPERTYPE", length = 10)
   private String opertype; // person - 个人, shop - 商户, operator - 操作员
 
+  @Column(name = "settledate", length = 8)
+  private String settleDate;
+
   @Column(name = "create_time")
   private Timestamp createTime;
 
@@ -228,6 +234,22 @@
     this.checkable = checkable;
   }
 
+  public String getSettleDate() {
+    return settleDate;
+  }
+
+  public void setSettleDate(String settleDate) {
+    this.settleDate = settleDate;
+  }
+
+  public String getSourceType() {
+    return sourceType;
+  }
+
+  public void setSourceType(String sourceType) {
+    this.sourceType = sourceType;
+  }
+
   public Double sumAmountByAccno(String accno, String subjno,
                                  int balanceFlag, String debitOrCredit) {
     Double debitSum = 0.0;
diff --git a/src/main/java/com/supwisdom/dlpay/api/service/PaytypeService.java b/src/main/java/com/supwisdom/dlpay/api/service/SourceTypeService.java
similarity index 79%
rename from src/main/java/com/supwisdom/dlpay/api/service/PaytypeService.java
rename to src/main/java/com/supwisdom/dlpay/api/service/SourceTypeService.java
index 22ca374..036007d 100644
--- a/src/main/java/com/supwisdom/dlpay/api/service/PaytypeService.java
+++ b/src/main/java/com/supwisdom/dlpay/api/service/SourceTypeService.java
@@ -1,6 +1,6 @@
 package com.supwisdom.dlpay.api.service;
 
-import com.supwisdom.dlpay.api.domain.TPaytype;
+import com.supwisdom.dlpay.api.domain.TSourceType;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -9,10 +9,10 @@
 /**
  * Created by shuwei on 2019/4/9.
  */
-public interface PaytypeService {
+public interface SourceTypeService {
 
     @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class,readOnly = true)
-    TPaytype getByPaytype(String paytype);
+    TSourceType getByPaytype(String paytype);
 
     @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class,readOnly = true)
     Map<String,String> getPaytypeConfigByPaytype(String pattype);
diff --git a/src/main/java/com/supwisdom/dlpay/api/service/impl/PaytypeServiceImpl.java b/src/main/java/com/supwisdom/dlpay/api/service/impl/SourceTypeServiceImpl.java
similarity index 80%
rename from src/main/java/com/supwisdom/dlpay/api/service/impl/PaytypeServiceImpl.java
rename to src/main/java/com/supwisdom/dlpay/api/service/impl/SourceTypeServiceImpl.java
index d1d1e5c..a9651a0 100644
--- a/src/main/java/com/supwisdom/dlpay/api/service/impl/PaytypeServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/api/service/impl/SourceTypeServiceImpl.java
@@ -2,9 +2,9 @@
 
 import com.supwisdom.dlpay.api.dao.PaytypeConfigDao;
 import com.supwisdom.dlpay.api.dao.PaytypeDao;
-import com.supwisdom.dlpay.api.domain.TPaytype;
+import com.supwisdom.dlpay.api.domain.TSourceType;
 import com.supwisdom.dlpay.api.domain.TPaytypeConfig;
-import com.supwisdom.dlpay.api.service.PaytypeService;
+import com.supwisdom.dlpay.api.service.SourceTypeService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -16,14 +16,14 @@
  * Created by shuwei on 2019/4/9.
  */
 @Service
-public class PaytypeServiceImpl implements PaytypeService {
+public class SourceTypeServiceImpl implements SourceTypeService {
   @Autowired
   private PaytypeDao paytypeDao;
   @Autowired
   private PaytypeConfigDao paytypeConfigDao;
 
   @Override
-  public TPaytype getByPaytype(String paytype) {
+  public TSourceType getByPaytype(String paytype) {
     return paytypeDao.getOne(paytype);
   }
 
diff --git a/src/main/java/com/supwisdom/dlpay/system/controller/ParamController.java b/src/main/java/com/supwisdom/dlpay/system/controller/ParamController.java
index eb9f3f4..96e9458 100644
--- a/src/main/java/com/supwisdom/dlpay/system/controller/ParamController.java
+++ b/src/main/java/com/supwisdom/dlpay/system/controller/ParamController.java
@@ -1,7 +1,7 @@
 package com.supwisdom.dlpay.system.controller;
 
 import com.supwisdom.dlpay.api.bean.JsonResult;
-import com.supwisdom.dlpay.api.domain.TPaytype;
+import com.supwisdom.dlpay.api.domain.TSourceType;
 import com.supwisdom.dlpay.api.domain.TPaytypeConfig;
 import com.supwisdom.dlpay.framework.domain.TApiClient;
 import com.supwisdom.dlpay.framework.domain.TBusinesspara;
@@ -361,9 +361,9 @@
   @GetMapping("/param/paytypelist")
   @PreAuthorize("hasPermission('/param/paytype','')")
   @ResponseBody
-  public PageResult<TPaytype> getPaytypeDataList(@RequestParam("page") Integer pageNo,
-                                                 @RequestParam("limit") Integer pageSize,
-                                                 @RequestParam(value = "paytype", required = false) String paytype) {
+  public PageResult<TSourceType> getPaytypeDataList(@RequestParam("page") Integer pageNo,
+                                                    @RequestParam("limit") Integer pageSize,
+                                                    @RequestParam(value = "paytype", required = false) String paytype) {
     try {
       if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
       if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
@@ -390,7 +390,7 @@
       return JsonResult.error("参数传递错误");
     }
     try {
-      TPaytype tPaytype = paramService.getPaytype(paytype);
+      TSourceType tPaytype = paramService.getPaytype(paytype);
       if (null == tPaytype) {
         return JsonResult.error("支付方式不存在!");
       }
@@ -436,7 +436,7 @@
       return JsonResult.error("参数传递错误");
     }
     try {
-      TPaytype tPaytype = paramService.getPaytype(paytype);
+      TSourceType tPaytype = paramService.getPaytype(paytype);
       if (null == tPaytype) {
         return JsonResult.error("支付方式不存在!");
       }
@@ -457,7 +457,7 @@
   @ResponseBody
   public JsonResult deletePaytype(@RequestParam("paytype") String paytype) {
     try {
-      TPaytype tPaytype = paramService.getPaytype(paytype);
+      TSourceType tPaytype = paramService.getPaytype(paytype);
       if (null == tPaytype) {
         return JsonResult.error("支付方式不存在!");
       }
@@ -482,12 +482,12 @@
                                @RequestParam(value = "anonymousEnable",required = false,defaultValue = "no") String anonymousEnable,
                                @RequestParam("paydesc") String paydesc) {
     try {
-      TPaytype tPaytype = paramService.getPaytype(paytype);
+      TSourceType tPaytype = paramService.getPaytype(paytype);
       if (null != tPaytype) {
         return JsonResult.error("支付方式已经存在");
       }
-      tPaytype = new TPaytype();
-      tPaytype.setPaytype(paytype.trim());
+      tPaytype = new TSourceType();
+      tPaytype.setSourceType(paytype.trim());
       if (StringUtil.isEmpty(paydesc)) return JsonResult.error("支付名称不能为空!");
       tPaytype.setPaydesc(paydesc.trim());
       tPaytype.setEnable(ConstantUtil.ENABLE_YES.equalsIgnoreCase(enable) ? ConstantUtil.ENABLE_YES : ConstantUtil.ENABLE_NO);
@@ -508,7 +508,7 @@
   @GetMapping("/param/checkpaytype")
   @ResponseBody
   public JsonResult checkPaytype(@RequestParam("paytype") String paytype) {
-    TPaytype tPaytype = paramService.getPaytype(paytype);
+    TSourceType tPaytype = paramService.getPaytype(paytype);
     if (null != tPaytype) {
       return JsonResult.error("支付方式已经存在");
     } else {
diff --git a/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java b/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java
index 2aba10b..ed3dde1 100644
--- a/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java
+++ b/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java
@@ -1,7 +1,7 @@
 package com.supwisdom.dlpay.system.controller;
 
 import com.supwisdom.dlpay.api.bean.JsonResult;
-import com.supwisdom.dlpay.api.domain.TPaytype;
+import com.supwisdom.dlpay.api.domain.TSourceType;
 import com.supwisdom.dlpay.api.domain.TShopPaytype;
 import com.supwisdom.dlpay.api.domain.TShopPaytypeConfig;
 import com.supwisdom.dlpay.framework.domain.TShop;
@@ -250,7 +250,7 @@
     }
     try {
       TShopacc shopacc = shopDataService.getShopaccByAccno(shopaccno.trim());
-      TPaytype tPaytype = paramService.getPaytype(paytype.trim());
+      TSourceType tPaytype = paramService.getPaytype(paytype.trim());
       if (null == shopacc) {
         return JsonResult.error("商户账户不存在!");
       }
@@ -263,7 +263,7 @@
       }
       shopPaytype = new TShopPaytype();
       shopPaytype.setShopaccno(shopacc.getShopaccno());
-      shopPaytype.setPaytype(tPaytype.getPaytype());
+      shopPaytype.setPaytype(tPaytype.getSourceType());
       shopPaytype.setConsumeEnable(ConstantUtil.ENABLE_YES.equalsIgnoreCase(consumeEnable) ? ConstantUtil.ENABLE_YES : ConstantUtil.ENABLE_NO);
       shopPaytype.setAnonymousEnable(ConstantUtil.ENABLE_YES.equalsIgnoreCase(anonymousEnable) ? ConstantUtil.ENABLE_YES : ConstantUtil.ENABLE_NO);
       shopPaytype.setReverseEnable(ConstantUtil.ENABLE_YES.equalsIgnoreCase(reverseEnable) ? ConstantUtil.ENABLE_YES : ConstantUtil.ENABLE_NO);
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/ParamService.java b/src/main/java/com/supwisdom/dlpay/system/service/ParamService.java
index 4dedc44..3d2b0e8 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/ParamService.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/ParamService.java
@@ -1,6 +1,6 @@
 package com.supwisdom.dlpay.system.service;
 
-import com.supwisdom.dlpay.api.domain.TPaytype;
+import com.supwisdom.dlpay.api.domain.TSourceType;
 import com.supwisdom.dlpay.api.domain.TPaytypeConfig;
 import com.supwisdom.dlpay.framework.domain.TApiClient;
 import com.supwisdom.dlpay.framework.domain.TBusinesspara;
@@ -49,16 +49,16 @@
   boolean deleteApiClient(TApiClient apiClient);
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true)
-  PageResult<TPaytype> getPaytypePage(String paytype, int pageNo, int pageSize);
+  PageResult<TSourceType> getPaytypePage(String paytype, int pageNo, int pageSize);
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true)
-  TPaytype getPaytype(String paytype);
+  TSourceType getPaytype(String paytype);
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-  boolean saveOrUpdatePaytype(TPaytype paytype);
+  boolean saveOrUpdatePaytype(TSourceType paytype);
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-  boolean deletePaytype(TPaytype paytype);
+  boolean deletePaytype(TSourceType paytype);
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true)
   List<TPaytypeConfig> getPaytypeConfigList(String paytype);
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java b/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java
index 63b9f27..b2eb69b 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java
@@ -1,6 +1,6 @@
 package com.supwisdom.dlpay.system.service;
 
-import com.supwisdom.dlpay.api.domain.TPaytype;
+import com.supwisdom.dlpay.api.domain.TSourceType;
 import com.supwisdom.dlpay.api.domain.TShopPaytype;
 import com.supwisdom.dlpay.api.domain.TShopPaytypeConfig;
 import com.supwisdom.dlpay.framework.domain.TShop;
@@ -29,7 +29,7 @@
   boolean saveOrUpdateShop(TShop shop) throws WebCheckException;
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
-  List<TPaytype> getConsumePaytypes();
+  List<TSourceType> getConsumePaytypes();
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
   PageResult<ShopConfigBean> getShopPaytypeInfos(String shopaccno, String paytype, int pageNo, int pageSize);
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java b/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java
index 72cbb37..e057236 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java
@@ -2,7 +2,7 @@
 
 import com.supwisdom.dlpay.api.dao.PaytypeConfigDao;
 import com.supwisdom.dlpay.api.dao.PaytypeDao;
-import com.supwisdom.dlpay.api.domain.TPaytype;
+import com.supwisdom.dlpay.api.domain.TSourceType;
 import com.supwisdom.dlpay.api.domain.TPaytypeConfig;
 import com.supwisdom.dlpay.framework.dao.ApiClientDao;
 import com.supwisdom.dlpay.framework.dao.BusinessparaDao;
@@ -150,7 +150,7 @@
   }
 
   @Override
-  public PageResult<TPaytype> getPaytypePage(String paytype, int pageNo, int pageSize) {
+  public PageResult<TSourceType> getPaytypePage(String paytype, int pageNo, int pageSize) {
     Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by("paytype"));
     if (!StringUtil.isEmpty(paytype)) {
       return new PageResult<>(paytypeDao.findByPaytypeContaining(paytype.trim(), pageable));
@@ -159,7 +159,7 @@
   }
 
   @Override
-  public TPaytype getPaytype(String paytype) {
+  public TSourceType getPaytype(String paytype) {
     if (!StringUtil.isEmpty(paytype)) {
       return paytypeDao.getByPaytype(paytype.trim());
     }
@@ -167,7 +167,7 @@
   }
 
   @Override
-  public boolean saveOrUpdatePaytype(TPaytype paytype){
+  public boolean saveOrUpdatePaytype(TSourceType paytype){
     if(null!=paytype){
       paytypeDao.save(paytype);
       return true;
@@ -176,7 +176,7 @@
   }
 
   @Override
-  public boolean deletePaytype(TPaytype paytype){
+  public boolean deletePaytype(TSourceType paytype){
     if(null!=paytype){
       paytypeDao.delete(paytype);
       return true;
@@ -196,12 +196,12 @@
 
   @Override
   public boolean savePaytypeConfig(String paytype, Map<String, String> param) throws WebCheckException {
-    TPaytype tPaytype = getPaytype(paytype);
+    TSourceType tPaytype = getPaytype(paytype);
     if (null == tPaytype) throw new WebCheckException("支付能力[" + paytype + "]不存在");
     for (String key : param.keySet()) {
       String value = param.get(key);
-      TPaytypeConfig config = paytypeConfigDao.getByPaytypeAndAndConfigid(tPaytype.getPaytype(), key);
-      if (null == config) throw new WebCheckException("支付能力[" + tPaytype.getPaytype() + "]不存在配置项[" + key + "],请重新查询");
+      TPaytypeConfig config = paytypeConfigDao.getByPaytypeAndAndConfigid(tPaytype.getSourceType(), key);
+      if (null == config) throw new WebCheckException("支付能力[" + tPaytype.getSourceType() + "]不存在配置项[" + key + "],请重新查询");
       config.setConfigValue(StringUtil.isEmpty(value) ? null : value.trim());
       paytypeConfigDao.save(config);
     }
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java b/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java
index 37101ad..5136bcc 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java
@@ -4,7 +4,7 @@
 import com.supwisdom.dlpay.api.dao.PaytypeDao;
 import com.supwisdom.dlpay.api.dao.ShopPaytypeConfigDao;
 import com.supwisdom.dlpay.api.dao.ShopPaytypeDao;
-import com.supwisdom.dlpay.api.domain.TPaytype;
+import com.supwisdom.dlpay.api.domain.TSourceType;
 import com.supwisdom.dlpay.api.domain.TPaytypeConfig;
 import com.supwisdom.dlpay.api.domain.TShopPaytype;
 import com.supwisdom.dlpay.api.domain.TShopPaytypeConfig;
@@ -157,12 +157,12 @@
   }
 
   @Override
-  public List<TPaytype> getConsumePaytypes() {
-    List<TPaytype> list = paytypeDao.getConsumePaytypes();
+  public List<TSourceType> getConsumePaytypes() {
+    List<TSourceType> list = paytypeDao.getConsumePaytypes();
     if (!StringUtil.isEmpty(list)) {
       return list;
     }
-    return new ArrayList<TPaytype>(0);
+    return new ArrayList<TSourceType>(0);
   }
 
   @Override
@@ -193,7 +193,7 @@
       TShopacc shopacc = shopaccDao.getByShopaccno(pt.getShopaccno());
       bean.setShopname(shopacc == null ? "" : shopacc.getShopname());
       bean.setPaytype(pt.getPaytype());
-      TPaytype tPaytype = paytypeDao.getByPaytype(pt.getPaytype());
+      TSourceType tPaytype = paytypeDao.getByPaytype(pt.getPaytype());
       bean.setPaydesc(tPaytype == null ? "" : tPaytype.getPaydesc());
       bean.setConsumeEnable(pt.getConsumeEnable());
       bean.setAnonymousEnable(pt.getAnonymousEnable());
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/controller/consume_api_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/api/controller/consume_api_controller.kt
index 1b68789..5e8cec5 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/api/controller/consume_api_controller.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/api/controller/consume_api_controller.kt
@@ -71,7 +71,7 @@
             return ResponseEntity.ok(ResponseBodyBuilder.create()
                     .data("refno", dtl.refno)
                     .data("amount", dtl.personDtl.amount)
-                    .data("paytype", dtl.personDtl.paytype)
+                    .data("paytype", dtl.personDtl.sourceType)
                     .data("payinfo", dtl.personDtl.payinfo)
                     .also {
                         if (null != person) {
@@ -149,10 +149,11 @@
                 val shopacc = accountUtilServcie.readShopbyShopaccno(param.shopaccno)
 
                 val builder = TransactionBuilder().apply {
-                    setTransInfo(param.transdate, param.transtime, TradeCode.TRANSCODE_BALANCE_PAY, false)
+                    setTransInfo(param.transdate, param.transtime,
+                            TradeCode.TRANSCODE_BALANCE_PAY,
+                            TradeDict.PAYTYPE_BALANCE)
                     setOutTransInfo(shopacc.shopaccno, param.billno)
                     operator(param.shopaccno, TradeDict.OPERTYPE_SHOP)
-                    paytype = TradeDict.PAYTYPE_BALANCE
                     payinfo = "账户余额消费"
                     description = "账户余额消费"
                 }.person(account).apply {
@@ -218,10 +219,11 @@
                 val shopacc = accountUtilServcie.readShopbyShopaccno(param.shopaccno)
                 val subject = accountUtilServcie.readSubject(Subject.SUBJNO_PAY_CITIZEN_CARD)
                 val transaction = TransactionBuilder().apply {
-                    setTransInfo(param.transdate, param.transtime, TradeCode.TRANSCODE_CITIZENCARD_PAY, true)
+                    setTransInfo(param.transdate, param.transtime,
+                            TradeCode.TRANSCODE_CITIZENCARD_PAY,
+                            TradeDict.PAYTYPE_CITIZEN_CARD)
                     setOutTransInfo(shopacc.shopaccno, param.billno)
                     operator(param.shopaccno, TradeDict.OPERTYPE_SHOP)
-                    paytype = TradeDict.PAYTYPE_CITIZEN_CARD
                     payinfo = "市民卡代扣消费"
                     description = "市民卡代扣消费"
                 }.person(account).apply {
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/controller/notify_api_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/api/controller/notify_api_controller.kt
index 2337682..d57c96d 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/api/controller/notify_api_controller.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/api/controller/notify_api_controller.kt
@@ -1,7 +1,7 @@
 package com.supwisdom.dlpay.api.controller
 
 import com.supwisdom.dlpay.api.service.AccountUtilServcie
-import com.supwisdom.dlpay.api.service.PaytypeService
+import com.supwisdom.dlpay.api.service.SourceTypeService
 import com.supwisdom.dlpay.api.service.TransactionService
 import com.supwisdom.dlpay.framework.util.MD5
 import com.supwisdom.dlpay.framework.util.StringUtil
@@ -26,7 +26,7 @@
 class NotifyController {
     private val logger = LoggerFactory.getLogger(NotifyController::class.java)
     @Autowired
-    lateinit var paytypeService: PaytypeService
+    lateinit var paytypeService: SourceTypeService
     @Autowired
     lateinit var accountUtilServcie: AccountUtilServcie
 
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/transaction_service_impl.kt b/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/transaction_service_impl.kt
index a972d3f..48b7105 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/transaction_service_impl.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/transaction_service_impl.kt
@@ -5,6 +5,7 @@
 import com.supwisdom.dlpay.api.domain.*
 import com.supwisdom.dlpay.api.repositories.ShopaccRepositoryImpl
 import com.supwisdom.dlpay.api.repositories.TAccountRepositoryImpl
+import com.supwisdom.dlpay.api.service.SourceTypeService
 import com.supwisdom.dlpay.api.service.TransactionService
 import com.supwisdom.dlpay.exception.TransactionCheckException
 import com.supwisdom.dlpay.exception.TransactionProcessException
@@ -41,13 +42,20 @@
     @Autowired
     lateinit var systemUtilService: SystemUtilService
 
+    @Autowired
+    lateinit var sourceTypeService: SourceTypeService
+
     private fun preCheck(builder: TransactionBuilder) {
         builder.preCheck()
+
     }
 
     private fun builderRecords(builder: TransactionBuilder, status: String): TTransactionMain {
         try {
             preCheck(builder)
+            val sourceType = sourceTypeService.getByPaytype(builder.sourceType)
+                    ?: throw TransactionCheckException(TradeErrorCode.BUSINESS_PAYTYPE_NOSUPPORT,
+                            "交易源未定义,sourctype <${builder.sourceType}>")
             // 记录三方的交易流水(个人,商户,科目)
             val transaction = TTransactionMain().apply {
                 refno = systemUtilService.refno
@@ -58,6 +66,9 @@
                 operid = builder.operId
                 opertype = builder.operType
                 reverseFlag = builder.tradeType
+                checkable = sourceType.checkable
+                checkDate = null
+                settleDate = null
             }
 
             if (builder.hasPerson()) {
@@ -76,7 +87,7 @@
                     } else {
                         -builder.person().amount
                     }
-                    paytype = builder.person().paytype
+                    this.sourceType = builder.sourceType
                     payinfo = builder.person().payinfo
                     transcode = builder.transCode
                     tradeflag = builder.person().tradeFlag
@@ -99,10 +110,11 @@
                     this.accdate = transaction.accdate
                     this.amount = builder.shop().amount
                     this.payInfo = builder.shop().payinfo
-                    this.payType = builder.shop().paytype
+                    this.sourceType = builder.sourceType
                     this.transDate = builder.transDate
                     this.transTime = builder.transTime
                     this.tradeCode = builder.transCode
+                    this.sourceType = builder.sourceType
                     amount = if (builder.shop().tradeFlag == TradeDict.TRADE_FLAG_IN) {
                         builder.shop().amount
                     } else {
@@ -130,7 +142,7 @@
                     this.accdate = transaction.accdate
                     this.amount = builder.subject().amount
                     this.payInfo = builder.subject().payinfo
-                    this.payType = builder.subject().paytype
+                    this.payType = builder.sourceType
                     this.tradeCode = builder.transCode
                     this.transDate = builder.transDate
                     this.transTime = builder.transTime
@@ -153,6 +165,7 @@
                     this.crsubjno = line.credit.getSubjectNo()
                     this.amount = line.amount
                     this.summary = line.summary
+                    this.settleDate = null
                 }
             }.apply {
                 transaction.details = this
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/transaction_builder.kt b/src/main/kotlin/com/supwisdom/dlpay/api/transaction_builder.kt
index 15a23d4..9dc29ac 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/api/transaction_builder.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/api/transaction_builder.kt
@@ -10,11 +10,6 @@
 import com.supwisdom.dlpay.framework.util.TradeErrorCode
 
 open class SubTransactionBuilder<T : SubTransactionBuilder<T>>(val parent: TransactionBuilder) {
-    var paytype: String = ""
-        get() {
-            return if (field.isEmpty()) parent.paytype else field
-        }
-
     var payinfo: String = ""
         get() {
             return if (field.isEmpty()) parent.payinfo else field
@@ -146,15 +141,15 @@
     var transCode: Int = 0 //交易码,各明细流水统一
         private set
 
-    // 是否需要清算的交易
-    var checkable: Boolean = false
+    // 资金来源方案
+    var sourceType: String = ""
         private set
 
-    fun setTransInfo(date: String, time: String, code: Int, checkable: Boolean = false): TransactionBuilder {
+    fun setTransInfo(date: String, time: String, code: Int, sourceType: String): TransactionBuilder {
         this.transDate = date
         this.transTime = time
         this.transCode = code
-        this.checkable = checkable
+        this.sourceType = sourceType
         return this
     }
 
@@ -195,7 +190,6 @@
 
 
     // 以下属性可以在子表中不同
-    var paytype: String = ""
     var payinfo: String = ""
     var description: String = ""
     var remark: String = ""
@@ -300,6 +294,10 @@
                     "操作员类型错误")
         }
 
+        if (sourceType.isEmpty()) {
+            throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
+                    "交易源类型错误")
+        }
         if (hasPerson()) {
             person().also {
                 if (it.tradeFlag !in VALID_TRADEFLAG) {
@@ -314,7 +312,7 @@
                     throw  TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
                             "个人交易对方账户未设置")
                 }
-                if (it.payinfo.isEmpty() || it.paytype.isEmpty()) {
+                if (it.payinfo.isEmpty()) {
                     throw  TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
                             "个人交易信息未设置")
                 }
diff --git a/src/main/resources/templates/system/param/paytype.html b/src/main/resources/templates/system/param/paytype.html
index a235ff9..fd065d6 100644
--- a/src/main/resources/templates/system/param/paytype.html
+++ b/src/main/resources/templates/system/param/paytype.html
@@ -9,7 +9,7 @@
     <div class="layui-card-body">
         <div class="layui-form toolbar">
             搜索:
-            <input id="search-global-paytype" class="layui-input search-input" type="text" maxlength="40" style="width: 300px;"
+            <input id="search-global-sourceType" class="layui-input search-input" type="text" maxlength="40" style="width: 300px;"
                    placeholder="输入支付方式查询"/>
             <button id="btn-search-param" class="layui-btn icon-btn" data-type="search"><i class="layui-icon">&#xe615;</i>搜索
             </button>
@@ -24,34 +24,34 @@
 
 <!-- 表格状态列 -->
 <script type="text/html" id="enable-tpl-state">
-    <input type="checkbox" lay-filter="enable-tpl-state" value="{{d.paytype}}" lay-skin="switch" lay-text="启用|关闭"
+    <input type="checkbox" lay-filter="enable-tpl-state" value="{{d.sourceType}}" lay-skin="switch" lay-text="启用|关闭"
            {{d.enable=='yes'?'checked':''}}/>
 </script>
 <script type="text/html" id="chargeenable-tpl-state">
     {{# if(d.enable =='yes'){ }}
-    <input type="checkbox" lay-filter="chargeenable-tpl-state" value="{{d.paytype}}" lay-skin="switch" lay-text="启用|关闭"
+    <input type="checkbox" lay-filter="chargeenable-tpl-state" value="{{d.sourceType}}" lay-skin="switch" lay-text="启用|关闭"
            {{(d.enable=='yes' && d.chargeEnable=='yes')?'checked':''}}/>
     {{# }else{ }}
-    <input type="checkbox" lay-filter="chargeenable-tpl-state" value="{{d.paytype}}" lay-skin="switch" lay-text="启用|关闭"
+    <input type="checkbox" lay-filter="chargeenable-tpl-state" value="{{d.sourceType}}" lay-skin="switch" lay-text="启用|关闭"
            {{(d.enable=='yes' && d.chargeEnable=='yes')?'checked':''}} disabled/>
     {{# } }}
 </script>
 <script type="text/html" id="consumeenable-tpl-state">
     {{# if(d.enable =='yes'){ }}
-    <input type="checkbox" lay-filter="consumeenable-tpl-state" value="{{d.paytype}}" lay-skin="switch" lay-text="启用|关闭"
+    <input type="checkbox" lay-filter="consumeenable-tpl-state" value="{{d.sourceType}}" lay-skin="switch" lay-text="启用|关闭"
            {{(d.enable=='yes' && d.consumeEnable=='yes')?'checked':''}}/>
     {{# }else{ }}
-    <input type="checkbox" lay-filter="consumeenable-tpl-state" value="{{d.paytype}}" lay-skin="switch" lay-text="启用|关闭"
+    <input type="checkbox" lay-filter="consumeenable-tpl-state" value="{{d.sourceType}}" lay-skin="switch" lay-text="启用|关闭"
            {{(d.enable=='yes' && d.consumeEnable=='yes')?'checked':''}} disabled/>
     {{# } }}
 </script>
 <script type="text/html" id="anonymousenable-tpl-state">
     {{# if(d.enable =='yes' ){ }}
-    <input type="checkbox" lay-filter="anonymousenable-tpl-state" value="{{d.paytype}}" lay-skin="switch"
+    <input type="checkbox" lay-filter="anonymousenable-tpl-state" value="{{d.sourceType}}" lay-skin="switch"
            lay-text="启用|关闭"
            {{(d.enable=='yes' && d.anonymousEnable=='yes')?'checked':''}}/>
     {{# }else{ }}
-    <input type="checkbox" lay-filter="anonymousenable-tpl-state" value="{{d.paytype}}" lay-skin="switch"
+    <input type="checkbox" lay-filter="anonymousenable-tpl-state" value="{{d.sourceType}}" lay-skin="switch"
            lay-text="启用|关闭"
            {{(d.enable=='yes' && d.anonymousEnable=='yes')?'checked':''}} disabled/>
     {{# } }}
@@ -69,7 +69,7 @@
             page: true,
             cols: [
                 [
-                    {field: 'paytype', title: '支付方式', width: 200, align: 'center', fixed: 'left', sort: true},
+                    {field: 'sourceType', title: '支付方式', width: 200, align: 'center', fixed: 'left', sort: true},
                     {field: 'paydesc', title: '名称', align: 'center', sort: true, edit:'text'},
                     {field: 'enable', title: '状态', align: 'center', templet: '#enable-tpl-state', sort: true},
                     {
@@ -95,7 +95,7 @@
                     },
                     {
                         align: 'center', title: '操作', width: 150, fixed: 'right', templet: function (item) {
-                            if (item.paytype != 'balance') {
+                            if (item.sourceType != 'balance') {
                                 return '<a class="layui-btn layui-btn-xs" lay-event="config">配置</a> <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>';
                             }
                             return '';
@@ -106,8 +106,8 @@
         });
         // 搜索按钮点击事件
         $('#btn-search-param').click(function () {
-            var paytype = $("#search-global-paytype").val();
-            table.reload('paytypeTable', {where: {paytype: paytype}, page: {curr: 1}});
+            var sourceType = $("#search-global-sourceType").val();
+            table.reload('paytypeTable', {where: {sourceType: sourceType}, page: {curr: 1}});
         });
 
         $('#btn-add-param').click(function () {
@@ -121,14 +121,14 @@
         });
 
         $('#btn-reset-param').click(function () {
-            $("#search-global-paytype").val("");
+            $("#search-global-sourceType").val("");
         });
 
         // 修改总状态
         form.on('switch(enable-tpl-state)', function (obj) {
             var token = $("meta[name='_csrf_token']").attr("value");
             admin.go('/param/updatepaytypestate', {
-                paytype: obj.elem.value,
+                sourceType: obj.elem.value,
                 state: obj.elem.checked ? 'yes' : 'no',
                 _csrf: token
             }, function (data) {
@@ -170,7 +170,7 @@
 
         function updatePaytypeState(obj, optype, token) {
             admin.go('/param/updatepaytypestate', {
-                paytype: obj.elem.value,
+                sourceType: obj.elem.value,
                 state: obj.elem.checked ? 'yes' : 'no',
                 optype: optype,
                 _csrf: token
@@ -198,7 +198,7 @@
             var row = obj.data; //得到所在行所有键值
             var newval = obj.value; //得到修改后的值
             admin.go('/param/updatepaytypename', {
-                paytype: row.paytype,
+                sourceType: row.sourceType,
                 paydesc: newval,
                 _csrf: $("meta[name='_csrf_token']").attr("value"),
             }, function (data) {
@@ -223,10 +223,10 @@
         table.on('tool(paytypeTable-filter)', function (obj) {
             var data = obj.data;
             if('del' == obj.event){
-                if (confirm("确定要删除支付方式[" + data.paytype + "_" + data.paydesc + "]吗?")) {
+                if (confirm("确定要删除支付方式[" + data.sourceType + "_" + data.paydesc + "]吗?")) {
                     layer.load(2);
                     admin.go('/param/deletepaytype', {
-                        paytype: data.paytype,
+                        sourceType: data.sourceType,
                         _csrf: $("meta[name='_csrf_token']").attr("value")
                     }, function (data) {
                         console.log(data.code);
@@ -250,8 +250,8 @@
                 }
             }else if('config' ==obj.event){
                 admin.popupCenter({
-                    title: "配置参数【" + data.paytype + "_" + data.paydesc + "】",
-                    path: '/param/load4paytypeconfig?paytype='+data.paytype,
+                    title: "配置参数【" + data.sourceType + "_" + data.paydesc + "】",
+                    path: '/param/load4paytypeconfig?sourceType='+data.sourceType,
                     area: '800px',
                     finish: function () {
                         table.reload('paytypeTable');
diff --git a/src/main/resources/templates/system/param/paytypeconfig.html b/src/main/resources/templates/system/param/paytypeconfig.html
index 5f81755..f964907 100644
--- a/src/main/resources/templates/system/param/paytypeconfig.html
+++ b/src/main/resources/templates/system/param/paytypeconfig.html
@@ -1,6 +1,6 @@
-<form id="paytype-config-form" lay-filter="paytype-config-form" class="layui-form model-form">
+<form id="sourceType-config-form" lay-filter="sourceType-config-form" class="layui-form model-form">
     <div class="layui-form-item" style="display: none;">
-        <input type="hidden" class="layui-input" id="hid_paytype" th:value="${paytype}"/>
+        <input type="hidden" class="layui-input" id="hid_paytype" th:value="${sourceType}"/>
     </div>
 
     <div class="layui-form-item" style="text-align: center;" th:if="${configlist.size()} le 0">
diff --git a/src/main/resources/templates/system/param/paytypeform.html b/src/main/resources/templates/system/param/paytypeform.html
index 705c9b2..5bd04c5 100644
--- a/src/main/resources/templates/system/param/paytypeform.html
+++ b/src/main/resources/templates/system/param/paytypeform.html
@@ -1,9 +1,9 @@
-<form id="paytype-form" lay-filter="form" class="layui-form model-form">
+<form id="sourceType-form" lay-filter="form" class="layui-form model-form">
     <div class="layui-form-item">
         <label class="layui-form-label">支付方式</label>
         <div class="layui-input-block">
-            <input name="paytype" placeholder="请输入支付方式代码" type="text" class="layui-input" maxlength="20"
-                   lay-verify="required|paytype" required/>
+            <input name="sourceType" placeholder="请输入支付方式代码" type="text" class="layui-input" maxlength="20"
+                   lay-verify="required|sourceType" required/>
         </div>
     </div>
     <div class="layui-form-item">
@@ -55,14 +55,14 @@
         var form = layui.form;
         form.render('checkbox');
         form.verify({
-            "paytype": function (e) {
+            "sourceType": function (e) {
                 var msg = "";
                 $.ajax({
                     type: "GET",
                     url: '/param/checkpaytype',
                     async: false,
                     data: {
-                        paytype: e
+                        sourceType: e
                     },
                     success: function (result) {
                         if (result.code != 200) {
diff --git a/src/main/resources/templates/system/shop/config.html b/src/main/resources/templates/system/shop/config.html
index afb00d3..9afd11f 100644
--- a/src/main/resources/templates/system/shop/config.html
+++ b/src/main/resources/templates/system/shop/config.html
@@ -24,9 +24,9 @@
                     <div class="layui-card-body">
                         <div class="layui-form toolbar">
                             支付方式:
-                            <select id="search-paytype">
+                            <select id="search-sourceType">
                                 <option value=""> 全部</option>
-                                <option th:each="pt:${paytypelist}" th:value="${pt.paytype}"
+                                <option th:each="pt:${paytypelist}" th:value="${pt.sourceType}"
                                         th:text="${pt.paydesc}"></option>
                             </select>&emsp;
                             <button id="btn-search-shoppaytype" class="layui-btn icon-btn" data-type="search"><i class="layui-icon">&#xe615;</i>搜索
@@ -48,22 +48,22 @@
 
 <!-- 表格状态列 -->
 <script type="text/html" id="shop-consumeenable-tpl-state">
-    <input type="checkbox" lay-filter="shop-consumeenable-tpl-state" value="{{d.shopaccno}}" def-paytype="{{d.paytype}}" lay-skin="switch" lay-text="启用|关闭"
+    <input type="checkbox" lay-filter="shop-consumeenable-tpl-state" value="{{d.shopaccno}}" def-sourceType="{{d.sourceType}}" lay-skin="switch" lay-text="启用|关闭"
            {{d.consumeEnable=='yes'?'checked':''}}/>
 </script>
 <script type="text/html" id="shop-anonymousenable-tpl-state">
     {{# if(d.consumeEnable =='yes' ){ }}
-    <input type="checkbox" lay-filter="shop-anonymousenable-tpl-state" value="{{d.shopaccno}}" def-paytype="{{d.paytype}}" lay-skin="switch"
+    <input type="checkbox" lay-filter="shop-anonymousenable-tpl-state" value="{{d.shopaccno}}" def-sourceType="{{d.sourceType}}" lay-skin="switch"
            lay-text="启用|关闭"
            {{(d.consumeEnable=='yes' && d.anonymousEnable=='yes')?'checked':''}}/>
     {{# }else{ }}
-    <input type="checkbox" lay-filter="shop-anonymousenable-tpl-state" value="{{d.shopaccno}}" def-paytype="{{d.paytype}}" lay-skin="switch"
+    <input type="checkbox" lay-filter="shop-anonymousenable-tpl-state" value="{{d.shopaccno}}" def-sourceType="{{d.sourceType}}" lay-skin="switch"
            lay-text="启用|关闭"
            {{(d.consumeEnable=='yes' && d.anonymousEnable=='yes')?'checked':''}} disabled/>
     {{# } }}
 </script>
 <script type="text/html" id="shop-reverseenable-tpl-state">
-    <input type="checkbox" lay-filter="shop-reverseenable-tpl-state" value="{{d.shopaccno}}" def-paytype="{{d.paytype}}" lay-skin="switch" lay-text="启用|关闭"
+    <input type="checkbox" lay-filter="shop-reverseenable-tpl-state" value="{{d.shopaccno}}" def-sourceType="{{d.sourceType}}" lay-skin="switch" lay-text="启用|关闭"
            {{d.reverseEnable=='yes'?'checked':''}}/>
 </script>
 
@@ -109,12 +109,12 @@
         });
 
         $('#btn-reset-shoppaytype').click(function () {
-            $("#search-paytype").val("");
+            $("#search-sourceType").val("");
             form.render('select');
         });
         $('#btn-search-shoppaytype').click(function(){
-            var ptype = $("#search-paytype").val();
-            table.reload('shopPaytypeTable', {where: {paytype: ptype, shopaccno:""}, page: {curr: 1}});
+            var ptype = $("#search-sourceType").val();
+            table.reload('shopPaytypeTable', {where: {sourceType: ptype, shopaccno:""}, page: {curr: 1}});
         });
 
         function ondblclick(event, treeId, treeNode) {
@@ -122,8 +122,8 @@
                 layer.msg("请选择结算商户查询", {icon: 2, time: 1000});
                 return;
             }
-            var ptype = $("#search-paytype").val();
-            table.reload('shopPaytypeTable', {where: {paytype: ptype, shopaccno: treeNode.shopaccno}, page: {curr: 1}});
+            var ptype = $("#search-sourceType").val();
+            table.reload('shopPaytypeTable', {where: {sourceType: ptype, shopaccno: treeNode.shopaccno}, page: {curr: 1}});
         }
 
         // 渲染表格
@@ -162,7 +162,7 @@
                         sort: true
                     },
                     {align: 'center', title: '操作', width: 90, fixed: 'right', templet: function (item) {
-                            if (item.paytype != 'balance') {
+                            if (item.sourceType != 'balance') {
                                 return '<a class="layui-btn layui-btn-xs" lay-event="config">配置</a>';
                             }
                             return '<span style="font-size: 12px;color: #D3D4D3;">无配置</span>';
@@ -177,7 +177,7 @@
             var token = $("meta[name='_csrf_token']").attr("value");
             admin.go('/shop/updatepaytypestat', {
                 shopaccno: obj.elem.value,
-                paytype: $(obj.elem).attr("def-paytype"),
+                sourceType: $(obj.elem).attr("def-sourceType"),
                 optype: "consume",
                 state: obj.elem.checked ? 'yes' : 'no',
                 _csrf: token
@@ -215,7 +215,7 @@
         function updateShopPaytypeState(obj, optype, token) {
             admin.go('/shop/updatepaytypestat', {
                 shopaccno: obj.elem.value,
-                paytype: $(obj.elem).attr("def-paytype"),
+                sourceType: $(obj.elem).attr("def-sourceType"),
                 state: obj.elem.checked ? 'yes' : 'no',
                 optype: optype,
                 _csrf: token
@@ -260,7 +260,7 @@
                 path: '/shop/load4addpaytype',
                 finish: function () {
                     table.reload('shopPaytypeTable', {
-                        where: {paytype: "", shopaccno: shopNode.shopaccno},
+                        where: {sourceType: "", shopaccno: shopNode.shopaccno},
                         page: {curr: 1}
                     });
                 }
@@ -273,7 +273,7 @@
             if ('config' == obj.event) {
                 admin.popupCenter({
                     title: "配置参数【" + data.shopname + "_" + data.paydesc + "】",
-                    path: '/shop/load4paytypepara?shopaccno=' + data.shopaccno + '&paytype=' + data.paytype,
+                    path: '/shop/load4paytypepara?shopaccno=' + data.shopaccno + '&sourceType=' + data.sourceType,
                     area: '800px',
                     finish: function () {
                         table.reload('shopPaytypeTable');
diff --git a/src/main/resources/templates/system/shop/configform.html b/src/main/resources/templates/system/shop/configform.html
index 9f60ecf..b88732e 100644
--- a/src/main/resources/templates/system/shop/configform.html
+++ b/src/main/resources/templates/system/shop/configform.html
@@ -1,4 +1,4 @@
-<form id="shop-paytype-form" lay-filter="shop-paytype-form" class="layui-form model-form">
+<form id="shop-sourceType-form" lay-filter="shop-sourceType-form" class="layui-form model-form">
     <div class="layui-form-item">
         <label class="layui-form-label">商户账号</label>
         <div class="layui-input-block">
@@ -14,8 +14,8 @@
     <div class="layui-form-item">
         <label class="layui-form-label">支付方式</label>
         <div class="layui-input-block">
-            <select name="paytype" lay-verify="required">
-                <option th:each="pt:${paytypelist}" th:value="${pt.paytype}"
+            <select name="sourceType" lay-verify="required">
+                <option th:each="pt:${paytypelist}" th:value="${pt.sourceType}"
                         th:text="${pt.paydesc}"></option>
             </select>&emsp;
         </div>
@@ -59,7 +59,7 @@
         // 回显数据
         var shop = admin.getTempData('t_addshoppaytype');
         if (shop) {
-            form.val('shop-paytype-form', {
+            form.val('shop-sourceType-form', {
                 shopaccno: shop.shopaccno,
                 shopname: shop.shopname
             });
diff --git a/src/main/resources/templates/system/shop/configpara.html b/src/main/resources/templates/system/shop/configpara.html
index 231b6ae..47acb3a 100644
--- a/src/main/resources/templates/system/shop/configpara.html
+++ b/src/main/resources/templates/system/shop/configpara.html
@@ -1,7 +1,7 @@
-<form id="shop-paytype-config-form" lay-filter="shop-paytype-config-form" class="layui-form model-form">
+<form id="shop-sourceType-config-form" lay-filter="shop-sourceType-config-form" class="layui-form model-form">
     <div class="layui-form-item" style="display: none;">
         <input type="hidden" class="layui-input" id="hid_shopaccno" th:value="${shopaccno}"/>
-        <input type="hidden" class="layui-input" id="hid_paytype" th:value="${paytype}"/>
+        <input type="hidden" class="layui-input" id="hid_paytype" th:value="${sourceType}"/>
     </div>
 
     <div class="layui-form-item" style="text-align: center;" th:if="${configlist.size()} le 0">