refactor: 将 paytype 改为 sourcetype
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/PaytypeConfigDao.java b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/PaytypeConfigDao.java
deleted file mode 100644
index 50cf1e1..0000000
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/PaytypeConfigDao.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.supwisdom.dlpay.api.dao;
-
-import com.supwisdom.dlpay.api.domain.TPaytypeConfig;
-import com.supwisdom.dlpay.api.domain.TPaytypeConfigPK;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * Created by shuwei on 2019/4/9.
- */
-@Repository
-public interface PaytypeConfigDao extends JpaRepository<TPaytypeConfig, TPaytypeConfigPK> {
- List<TPaytypeConfig> getByPaytype(String paytype);
-
- TPaytypeConfig getByPaytypeAndAndConfigid(String paytype, String configid);
-
- List<TPaytypeConfig> getByPaytypeOrderByConfigid(String paytype);
-}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopPaytypeConfigDao.java b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopPaytypeConfigDao.java
deleted file mode 100644
index a7164c8..0000000
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopPaytypeConfigDao.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.supwisdom.dlpay.api.dao;
-
-import com.supwisdom.dlpay.api.domain.TShopPaytypeConfig;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface ShopPaytypeConfigDao extends JpaRepository<TShopPaytypeConfig, String> {
- @Query("select a from TShopPaytypeConfig a where a.paytype=?1 and a.shopaccno=?2 ")
- List<TShopPaytypeConfig> getShopPaytypeConfigs(String paytype, String shopaccno);
-
- @Query("select a from TShopPaytypeConfig a where a.shopaccno=?1 and a.paytype=?2 and a.configid=?3 ")
- TShopPaytypeConfig getShopPaytypeConfigById(String shopaccno,String paytype, String configid);
-}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopPaytypeDao.java b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopPaytypeDao.java
deleted file mode 100644
index 03196e1..0000000
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopPaytypeDao.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.supwisdom.dlpay.api.dao;
-
-import com.supwisdom.dlpay.api.domain.TShopPaytype;
-import com.supwisdom.dlpay.api.domain.TShopPaytypePK;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface ShopPaytypeDao extends JpaRepository<TShopPaytype, TShopPaytypePK>, JpaSpecificationExecutor<TShopPaytype> {
- @Query("select a from TShopPaytype a where a.paytype=?1 and a.shopaccno=?2 ")
- TShopPaytype getById(String paytype, String shopaccno);
-
-}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopSourceTypeConfigDao.java b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopSourceTypeConfigDao.java
new file mode 100644
index 0000000..e861165
--- /dev/null
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopSourceTypeConfigDao.java
@@ -0,0 +1,17 @@
+package com.supwisdom.dlpay.api.dao;
+
+import com.supwisdom.dlpay.api.domain.TShopSourceTypeConfig;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface ShopSourceTypeConfigDao extends JpaRepository<TShopSourceTypeConfig, String> {
+ @Query("select a from TShopSourceTypeConfig a where a.sourceType=?1 and a.shopaccno=?2 ")
+ List<TShopSourceTypeConfig> getShopSourceTypeConfigs(String paytype, String shopaccno);
+
+ @Query("select a from TShopSourceTypeConfig a where a.shopaccno=?1 and a.sourceType=?2 and a.configid=?3 ")
+ TShopSourceTypeConfig getShopSourceTypeConfigById(String shopaccno, String sourceType, String configid);
+}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopSourceTypeDao.java b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopSourceTypeDao.java
new file mode 100644
index 0000000..8099292
--- /dev/null
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/ShopSourceTypeDao.java
@@ -0,0 +1,14 @@
+package com.supwisdom.dlpay.api.dao;
+
+import com.supwisdom.dlpay.api.domain.TShopSourceType;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ShopSourceTypeDao extends JpaRepository<TShopSourceType, String>, JpaSpecificationExecutor<TShopSourceType> {
+ @Query("select a from TShopSourceType a where a.sourceType=?1 and a.shopaccno=?2 ")
+ TShopSourceType getById(String sourceType, String shopaccno);
+
+}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/SourceTypeConfigDao.java b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/SourceTypeConfigDao.java
new file mode 100644
index 0000000..9caf30d
--- /dev/null
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/SourceTypeConfigDao.java
@@ -0,0 +1,20 @@
+package com.supwisdom.dlpay.api.dao;
+
+import com.supwisdom.dlpay.api.domain.TSourceTypeConfig;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * Created by shuwei on 2019/4/9.
+ */
+@Repository
+public interface SourceTypeConfigDao extends JpaRepository<TSourceTypeConfig, String> {
+
+ List<TSourceTypeConfig> getBySourceType(String sourceType);
+
+ TSourceTypeConfig getBySourceTypeAndAndConfigid(String sourceType, String configid);
+
+ List<TSourceTypeConfig> getBySourceTypeOrderByConfigid(String paytype);
+}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfig.java b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfig.java
deleted file mode 100644
index 4a239dd..0000000
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfig.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.*;
-import javax.validation.constraints.NotNull;
-import java.io.Serializable;
-
-/**
- * Created by shuwei on 2019/4/9.
- */
-@Entity
-@Table(name = "TB_PAYTYPE_CONFIG")
-@IdClass(TPaytypeConfigPK.class)
-public class TPaytypeConfig implements Serializable {
- @Id
- @Column(name = "PAYTYPE", nullable = false, length = 20)
- private String paytype;
- @Id
- @Column(name = "CONFIGID", nullable = false, length = 40)
- private String configid;
-
- @Column(name = "CONFIG_VALUE", length = 2000)
- private String configValue;
-
- @Column(name = "CONFIG_NAME", length = 200)
- private String configName;
-
- @Column(name = "GLOBALFLAG", length = 200)
- private Boolean globalflag = false;
-
- @Column(name = "tenantid", length = 20)
- @NotNull
- private String tenantid = "";
-
- public String getPaytype() {
- return paytype;
- }
-
- public void setPaytype(String paytype) {
- this.paytype = paytype;
- }
-
- public String getConfigid() {
- return configid;
- }
-
- public void setConfigid(String configid) {
- this.configid = configid;
- }
-
- public String getConfigValue() {
- return configValue;
- }
-
- public void setConfigValue(String configValue) {
- this.configValue = configValue;
- }
-
- public String getConfigName() {
- return configName;
- }
-
- public void setConfigName(String configName) {
- this.configName = configName;
- }
-
- public String getTenantid() {
- return tenantid;
- }
-
- public void setTenantid(String tenantid) {
- this.tenantid = tenantid;
- }
-}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfigPK.java b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfigPK.java
deleted file mode 100644
index 8f7e46f..0000000
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfigPK.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-/**
- * Created by shuwei on 2019/4/9.
- */
-@Embeddable
-public class TPaytypeConfigPK implements Serializable {
- @Id
- @Column(name = "PAYTYPE", nullable = false, length = 20)
- private String paytype;
- @Id
- @Column(name = "CONFIGID", nullable = false, length = 40)
- private String configid;
-
- public String getPaytype() {
- return paytype;
- }
-
- public void setPaytype(String paytype) {
- this.paytype = paytype;
- }
-
- public String getConfigid() {
- return configid;
- }
-
- public void setConfigid(String configid) {
- this.configid = configid;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- TPaytypeConfigPK that = (TPaytypeConfigPK) o;
-
- if (!paytype.equals(that.paytype)) return false;
- return configid.equals(that.configid);
- }
-
- @Override
- public int hashCode() {
- int result = paytype.hashCode();
- result = 31 * result + configid.hashCode();
- return result;
- }
-}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypePK.java b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypePK.java
deleted file mode 100644
index 4196b55..0000000
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypePK.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-@Embeddable
-public class TShopPaytypePK implements Serializable {
- @Id
- @Column(name = "SHOPACCNO", nullable = false, length = 10)
- private String shopaccno;
-
- @Id
- @Column(name = "PAYTYPE", nullable = false, length = 20)
- private String paytype;
-
- public TShopPaytypePK() {
- }
-
- public TShopPaytypePK(String shopaccno, String paytype) {
- this.shopaccno = shopaccno;
- this.paytype = paytype;
- }
-
- public String getShopaccno() {
- return shopaccno;
- }
-
- public void setShopaccno(String shopaccno) {
- this.shopaccno = shopaccno;
- }
-
- public String getPaytype() {
- return paytype;
- }
-
- public void setPaytype(String paytype) {
- this.paytype = paytype;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- TShopPaytypePK tShopPaytypePK = (TShopPaytypePK) o;
- if (shopaccno != null ? !shopaccno.equals(tShopPaytypePK.getShopaccno()) : shopaccno != null)
- return false;
- if (paytype != null ? !paytype.equals(tShopPaytypePK.getPaytype()) : paytype != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = shopaccno != null ? shopaccno.hashCode() : 0;
- result = 31 * result + (paytype != null ? paytype.hashCode() : 0);
- return result;
- }
-}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytype.java b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopSourceType.java
similarity index 65%
rename from payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytype.java
rename to payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopSourceType.java
index 0310592..f28f307 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytype.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopSourceType.java
@@ -1,19 +1,31 @@
package com.supwisdom.dlpay.api.domain;
+import org.hibernate.annotations.GenericGenerator;
+
import javax.persistence.*;
import javax.validation.constraints.NotNull;
+import java.io.Serializable;
@Entity
-@Table(name = "TB_SHOP_PAYTYPE")
-@IdClass(TShopPaytypePK.class)
-public class TShopPaytype {
- @Id
- @Column(name = "SHOPACCNO", nullable = false, length = 10)
- private String shopaccno;
+@Table(name = "TB_SHOP_SOURCETYPE",
+ indexes = {@Index(name = "shop_sourcetype_idx",
+ columnList = "shopaccno, sourcetype, tenantid", unique = true)})
+public class TShopSourceType implements Serializable {
+ private static final long serialVersionUID = -5789612905074310179L;
@Id
- @Column(name = "PAYTYPE", nullable = false, length = 20)
- private String paytype;
+ @GenericGenerator(name = "idGenerator", strategy = "uuid")
+ @GeneratedValue(generator = "idGenerator")
+ @Column(name = "id")
+ private String id;
+
+ @Column(name = "SHOPACCNO", length = 10)
+ @NotNull
+ private String shopaccno;
+
+ @Column(name = "SOURCETYPE", length = 20)
+ @NotNull
+ private String sourceType;
@Column(name = "CONSUME_ENABLE", length = 10)
@NotNull
@@ -42,12 +54,12 @@
this.shopaccno = shopaccno;
}
- 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 boolean getConsumeEnable() {
@@ -89,4 +101,12 @@
public void setTenantid(String tenantid) {
this.tenantid = tenantid;
}
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypeConfig.java b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopSourceTypeConfig.java
similarity index 70%
rename from payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypeConfig.java
rename to payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopSourceTypeConfig.java
index a86da1c..981b0d1 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypeConfig.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TShopSourceTypeConfig.java
@@ -4,10 +4,15 @@
import javax.persistence.*;
import javax.validation.constraints.NotNull;
+import java.io.Serializable;
@Entity
-@Table(name = "TB_SHOP_PAYTYPE_CONFIG", indexes = {@Index(name = "shop_paytype_config_uk", unique = true, columnList = "shopaccno,paytype,configid")})
-public class TShopPaytypeConfig {
+@Table(name = "TB_SHOP_PAYTYPE_CONFIG",
+ indexes = {@Index(name = "shop_sourceype_config_idx", unique = true,
+ columnList = "shopaccno,sourcetype,configid,tenantid")})
+public class TShopSourceTypeConfig implements Serializable {
+ private static final long serialVersionUID = 135187738251025666L;
+
@Id
@GenericGenerator(name = "idGenerator", strategy = "uuid")
@GeneratedValue(generator = "idGenerator")
@@ -18,9 +23,9 @@
@NotNull
private String shopaccno;
- @Column(name = "PAYTYPE", length = 20)
+ @Column(name = "SOURCETYPE", length = 20)
@NotNull
- private String paytype;
+ private String sourceType;
@Column(name = "CONFIGID", length = 40)
@NotNull
@@ -36,12 +41,12 @@
@NotNull
private String tenantid = "";
- public TShopPaytypeConfig() {
+ public TShopSourceTypeConfig() {
}
- public TShopPaytypeConfig(String shopaccno, String paytype, String configid, String configValue, String configName) {
+ public TShopSourceTypeConfig(String shopaccno, String sourceType, String configid, String configValue, String configName) {
this.shopaccno = shopaccno;
- this.paytype = paytype;
+ this.sourceType = sourceType;
this.configid = configid;
this.configValue = configValue;
this.configName = configName;
@@ -63,12 +68,12 @@
this.shopaccno = shopaccno;
}
- 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 getConfigid() {
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TSourceType.java b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TSourceType.java
index 1748dc5..1a27f32 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TSourceType.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TSourceType.java
@@ -1,11 +1,10 @@
package com.supwisdom.dlpay.api.domain;
import com.supwisdom.dlpay.framework.domain.DictionaryTable;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@@ -13,9 +12,17 @@
* Created by shuwei on 2019/4/9.
*/
@Entity
-@Table(name = "TB_SOURCETYPE")
+@Table(name = "TB_SOURCETYPE",
+ indexes = {@Index(name = "sourcetype_idx", columnList = "sourcetype, tenantid", unique = true)})
public class TSourceType implements DictionaryTable, Serializable {
+ private static final long serialVersionUID = 2424711106241326859L;
+
@Id
+ @GenericGenerator(name = "idGenerator", strategy = "uuid")
+ @GeneratedValue(generator = "idGenerator")
+ @Column(name = "sourcetype_id", length = 32)
+ private String sourceTypeId;
+
@Column(name = "SOURCETYPE", nullable = false, length = 20)
private String sourceType;
@@ -131,4 +138,12 @@
public Object getDictValue() {
return this.paydesc;
}
+
+ public String getSourceTypeId() {
+ return sourceTypeId;
+ }
+
+ public void setSourceTypeId(String sourceTypeId) {
+ this.sourceTypeId = sourceTypeId;
+ }
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TSourceTypeConfig.java b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TSourceTypeConfig.java
new file mode 100644
index 0000000..df7ec88
--- /dev/null
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TSourceTypeConfig.java
@@ -0,0 +1,98 @@
+package com.supwisdom.dlpay.api.domain;
+
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.*;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * Created by shuwei on 2019/4/9.
+ */
+@Entity
+@Table(name = "TB_SOURCETYPE_CONFIG",
+ indexes = {@Index(name = "source_type_config_idx", columnList = "sourcetype, configid, tenantid", unique = true)})
+public class TSourceTypeConfig implements Serializable {
+ @Id
+ @SequenceGenerator(name = "sourcetype_cfg_id", sequenceName = "SEQ_SOURCETYPE_CONFIG", allocationSize = 1, initialValue = 1000)
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sourcetype_cfg_id")
+ @Column(name = "id", length = 32)
+ private String id;
+
+ @Column(name = "SOURCETYPE", length = 20)
+ @NotNull
+ private String sourceType;
+
+ @Column(name = "CONFIGID", length = 40)
+ @NotNull
+ private String configid;
+
+ @Column(name = "CONFIG_VALUE", length = 2000)
+ private String configValue;
+
+ @Column(name = "CONFIG_NAME", length = 200)
+ private String configName;
+
+ @Column(name = "GLOBALFLAG")
+ private Boolean globalflag = false;
+
+ @Column(name = "tenantid", length = 20)
+ @NotNull
+ private String tenantid = "";
+
+ public String getSourceType() {
+ return sourceType;
+ }
+
+ public void setSourceType(String sourceType) {
+ this.sourceType = sourceType;
+ }
+
+ public String getConfigid() {
+ return configid;
+ }
+
+ public void setConfigid(String configid) {
+ this.configid = configid;
+ }
+
+ public String getConfigValue() {
+ return configValue;
+ }
+
+ public void setConfigValue(String configValue) {
+ this.configValue = configValue;
+ }
+
+ public String getConfigName() {
+ return configName;
+ }
+
+ public void setConfigName(String configName) {
+ this.configName = configName;
+ }
+
+ public String getTenantid() {
+ return tenantid;
+ }
+
+ public void setTenantid(String tenantid) {
+ this.tenantid = tenantid;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Boolean getGlobalflag() {
+ return globalflag;
+ }
+
+ public void setGlobalflag(Boolean globalflag) {
+ this.globalflag = globalflag;
+ }
+}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/service/impl/SourceTypeServiceImpl.java b/payapi/src/main/java/com/supwisdom/dlpay/api/service/impl/SourceTypeServiceImpl.java
index 60cf1a5..c2c7f21 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/service/impl/SourceTypeServiceImpl.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/service/impl/SourceTypeServiceImpl.java
@@ -1,12 +1,10 @@
package com.supwisdom.dlpay.api.service.impl;
-import com.supwisdom.dlpay.api.dao.PaytypeConfigDao;
+import com.supwisdom.dlpay.api.dao.SourceTypeConfigDao;
import com.supwisdom.dlpay.api.dao.SourceTypeDao;
import com.supwisdom.dlpay.api.domain.TSourceType;
-import com.supwisdom.dlpay.api.domain.TPaytypeConfig;
+import com.supwisdom.dlpay.api.domain.TSourceTypeConfig;
import com.supwisdom.dlpay.api.service.SourceTypeService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
@@ -18,25 +16,27 @@
* Created by shuwei on 2019/4/9.
*/
@Service
-@CacheConfig(cacheNames = "sourcetypeCache")
public class SourceTypeServiceImpl implements SourceTypeService {
- @Autowired
- private SourceTypeDao paytypeDao;
- @Autowired
- private PaytypeConfigDao paytypeConfigDao;
+ private final SourceTypeDao paytypeDao;
+ private final SourceTypeConfigDao paytypeConfigDao;
+
+ public SourceTypeServiceImpl(SourceTypeDao paytypeDao, SourceTypeConfigDao paytypeConfigDao) {
+ this.paytypeDao = paytypeDao;
+ this.paytypeConfigDao = paytypeConfigDao;
+ }
@Override
- @Cacheable
+ @Cacheable(cacheNames = "source_type_cache", keyGenerator = "tenantCacheKey")
public TSourceType getByPaytype(String paytype) {
return paytypeDao.getOne(paytype);
}
@Override
- @Cacheable
+ @Cacheable(cacheNames = "source_type_config_cache", keyGenerator = "tenantCacheKey")
public Map<String, String> getPaytypeConfigByPaytype(String pattype) {
- List<TPaytypeConfig> list = paytypeConfigDao.getByPaytype(pattype);
+ List<TSourceTypeConfig> list = paytypeConfigDao.getBySourceType(pattype);
Map<String, String> map = new HashMap<>(list.size());
- for (TPaytypeConfig paytypeConfig : list) {
+ for (TSourceTypeConfig paytypeConfig : list) {
map.put(paytypeConfig.getConfigid(), paytypeConfig.getConfigValue());
}
return map;
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/DictionaryDao.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/DictionaryDao.java
index 6ffdc21..e9a19cf 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/DictionaryDao.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/DictionaryDao.java
@@ -1,16 +1,14 @@
package com.supwisdom.dlpay.framework.dao;
import com.supwisdom.dlpay.framework.domain.TDictionary;
-import com.supwisdom.dlpay.framework.domain.TDictionaryPK;
-import org.springframework.cache.annotation.CacheConfig;
-import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
-public interface DictionaryDao extends JpaRepository<TDictionary, TDictionaryPK> {
+public interface DictionaryDao extends JpaRepository<TDictionary, Integer> {
List<TDictionary> findAllByDicttype(String dicttype);
+
void deleteByDicttype(String dicttype);
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/FeetypeConfigDao.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/FeetypeConfigDao.java
index b626087..56ce647 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/FeetypeConfigDao.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/FeetypeConfigDao.java
@@ -1,13 +1,12 @@
package com.supwisdom.dlpay.framework.dao;
import com.supwisdom.dlpay.framework.domain.TFeetypeConfig;
-import com.supwisdom.dlpay.framework.domain.TFeetypeConfigPK;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
@Repository
-public interface FeetypeConfigDao extends JpaRepository<TFeetypeConfig, TFeetypeConfigPK> {
+public interface FeetypeConfigDao extends JpaRepository<TFeetypeConfig, Integer> {
@Query("select a from TFeetypeConfig a where a.feetype=?1 and a.paytype=?2 ")
TFeetypeConfig getById(String feetype, String paytype);
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/TranstypeDao.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/TranstypeDao.java
deleted file mode 100644
index a276c61..0000000
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/TranstypeDao.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.supwisdom.dlpay.framework.dao;
-
-import com.supwisdom.dlpay.framework.domain.TTranstype;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface TranstypeDao extends JpaRepository<TTranstype, Integer> {
- TTranstype findByTranstype(Integer transtype);
-}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TDictionary.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TDictionary.java
index 16c4a9a..76bcc21 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TDictionary.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TDictionary.java
@@ -5,15 +5,22 @@
import java.io.Serializable;
@Entity
-@Table(name = "TB_DICTIONARY")
-@IdClass(TDictionaryPK.class)
+@Table(name = "TB_DICTIONARY",
+ indexes = {@Index(name = "dictionary_idx", columnList = "dicttype, dictval, tenantid", unique = true)})
public class TDictionary implements DictionaryTable, Serializable {
@Id
- @Column(name = "DICTTYPE", nullable = false)
+ @Column(name = "id")
+ @SequenceGenerator(name = "dictid", sequenceName = "SEQ_DICTIONARY", allocationSize = 1, initialValue = 1000)
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "dictid")
+ @NotNull
+ private Integer dictid;
+
+ @Column(name = "DICTTYPE")
+ @NotNull
private String dicttype;
- @Id
- @Column(name = "DICTVAL", nullable = false, length = 30)
+ @Column(name = "DICTVAL", length = 30)
+ @NotNull
private String dictval;
@Column(name = "DICTTYPENAME", length = 60)
@@ -58,6 +65,14 @@
this.dictcaption = dictcaption;
}
+ public Integer getDictid() {
+ return dictid;
+ }
+
+ public void setDictid(Integer dictid) {
+ this.dictid = dictid;
+ }
+
@Override
public String getDictKey() {
return this.dictval;
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TDictionaryPK.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TDictionaryPK.java
deleted file mode 100644
index 1dbb4c8..0000000
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TDictionaryPK.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class TDictionaryPK implements Serializable {
- @Id
- @Column(name = "DICTTYPE", nullable = false)
- private String dicttype;
-
- @Id
- @Column(name = "DICTVAL", nullable = false, length = 30)
- private String dictval;
-
- public String getDicttype() {
- return dicttype;
- }
-
- public void setDicttype(String dicttype) {
- this.dicttype = dicttype;
- }
-
- public String getDictval() {
- return dictval;
- }
-
- public void setDictval(String dictval) {
- this.dictval = dictval;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- TDictionaryPK tDictionaryPK = (TDictionaryPK) o;
- if (dicttype != null ? !dicttype.equals(tDictionaryPK.getDicttype()) : dicttype != null)
- return false;
- if (dictval != null ? !dictval.equals(tDictionaryPK.getDictval()) : dictval != null)
- return false;
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = dicttype != null ? dicttype.hashCode() : 0;
- result = 31 * result + (dictval != null ? dictval.hashCode() : 0);
- return result;
- }
-}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfig.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfig.java
index ef85c21..9c27ac7 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfig.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfig.java
@@ -1,18 +1,26 @@
package com.supwisdom.dlpay.framework.domain;
import javax.persistence.*;
+import javax.validation.constraints.NegativeOrZero;
import javax.validation.constraints.NotNull;
@Entity
-@Table(name = "TB_FEETYPE_CONFIG")
-@IdClass(TFeetypeConfigPK.class)
+@Table(name = "TB_FEETYPE_CONFIG",
+ indexes = {@Index(name = "feetype_config_idx", columnList = "feetype, paytype, tenantid", unique = true)})
public class TFeetypeConfig {
@Id
- @Column(name = "FEETYPE", nullable = false, length = 20)
+ @SequenceGenerator(name = "feetype_cfg_id", sequenceName = "SEQ_FEETYPECONFIG", allocationSize = 1, initialValue = 10)
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "feetype_cfg_id")
+ @Column(name = "id")
+ @NotNull
+ private Integer id;
+
+ @Column(name = "FEETYPE", length = 20)
+ @NotNull
private String feetype;
- @Id
- @Column(name = "PAYTYPE", nullable = false, length = 20)
+ @Column(name = "PAYTYPE", length = 20)
+ @NotNull
private String paytype;
@Column(name = "DRSUBJNO", length = 10)
@@ -67,4 +75,20 @@
public void setSummary(String summary) {
this.summary = summary;
}
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfigPK.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfigPK.java
deleted file mode 100644
index 92fbf6a..0000000
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfigPK.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class TFeetypeConfigPK implements Serializable {
- @Id
- @Column(name = "FEETYPE", nullable = false, length = 20)
- private String feetype;
-
- @Id
- @Column(name = "PAYTYPE", nullable = false, length = 20)
- private String paytype;
-
- public String getFeetype() {
- return feetype;
- }
-
- public void setFeetype(String feetype) {
- this.feetype = feetype;
- }
-
- public String getPaytype() {
- return paytype;
- }
-
- public void setPaytype(String paytype) {
- this.paytype = paytype;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- TFeetypeConfigPK tFeetypeConfigPK = (TFeetypeConfigPK) o;
- if (feetype != null ? !feetype.equals(tFeetypeConfigPK.getFeetype()) : feetype != null)
- return false;
- if (paytype != null ? !paytype.equals(tFeetypeConfigPK.getPaytype()) : paytype != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = feetype != null ? feetype.hashCode() : 0;
- result = 31 * result + (paytype != null ? paytype.hashCode() : 0);
- return result;
- }
-}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TFunction.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TFunction.java
index 594a258..1477cec 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TFunction.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TFunction.java
@@ -7,7 +7,8 @@
import java.io.Serializable;
@Entity
-@Table(name = "TB_FUNCTION")
+@Table(name = "TB_FUNCTION",
+ indexes = {@Index(name = "function_idx", columnList = "tenantid")})
@JsonIgnoreProperties(value = {"hibernateLazyInitializer"})
@SequenceGenerator(name = "SEQ_FUNC", sequenceName = "SEQ_FUNC", allocationSize = 1, initialValue = 1000)
public class TFunction implements Serializable {
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperLog.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperLog.java
index 5fad64a..4d9c2f1 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperLog.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperLog.java
@@ -6,7 +6,8 @@
import javax.validation.constraints.NotNull;
@Entity
-@Table(name = "TB_OPER_LOG")
+@Table(name = "TB_OPER_LOG",
+ indexes = {@Index(name = "oper_log_idx", columnList = "tenantid")})
public class TOperLog {
@Id
@GenericGenerator(name = "idGenerator", strategy = "uuid")
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperator.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperator.java
index 22fadc9..17ca2dd 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperator.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperator.java
@@ -11,7 +11,7 @@
@Entity
@Table(name = "TB_OPERATOR",
- indexes = {@Index(name = "opercode_idx", columnList = "OPERCODE", unique = true)})
+ indexes = {@Index(name = "opercode_idx", columnList = "OPERCODE, tenantid", unique = true)})
public class TOperator implements UserDetails {
private static final long serialVersionUID = 2148742269021236587L;
@Id
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TPermission.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TPermission.java
index e6fd9e1..31f2481 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TPermission.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TPermission.java
@@ -6,7 +6,8 @@
import javax.validation.constraints.NotNull;
@Entity
-@Table(name = "TB_PERMISSION")
+@Table(name = "TB_PERMISSION",
+ indexes = {@Index(name = "permission_idx", columnList = "role_func_id, tenantid", unique = true)})
public class TPermission {
@Id
@GenericGenerator(name = "idGenerator", strategy = "uuid")
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TRole.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TRole.java
index 1ee94c3..110541f 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TRole.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TRole.java
@@ -6,7 +6,8 @@
import javax.validation.constraints.NotNull;
@Entity
-@Table(name = "TB_ROLE")
+@Table(name = "TB_ROLE",
+ indexes = {@Index(name = "role_idx", columnList = "rolecode, tenantid", unique = true)})
public class TRole {
@Id
@GenericGenerator(name = "idGenerator", strategy = "uuid")
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubject.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubject.java
index fa1554c..3a16f18 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubject.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubject.java
@@ -1,15 +1,20 @@
package com.supwisdom.dlpay.framework.domain;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Entity
-@Table(name = "TB_SUBJECT")
+@Table(name = "TB_SUBJECT",
+ indexes = {@Index(name = "subject_idx", columnList = "subjno, tenantid", unique = true)})
public class TSubject {
@Id
+ @Column(name = "id", length = 32)
+ @GenericGenerator(name = "idGenerator", strategy = "uuid")
+ @GeneratedValue(generator = "idGenerator")
+ private String id;
+
@Column(name = "SUBJNO", nullable = false, length = 10)
private String subjno;
@@ -121,4 +126,12 @@
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectbal.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectbal.java
index f58c591..93a64e1 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectbal.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectbal.java
@@ -1,16 +1,18 @@
package com.supwisdom.dlpay.framework.domain;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Entity
-@Table(name = "TB_SUBJECTBAL")
+@Table(name = "TB_SUBJECTBAL",
+ indexes = {@Index(name = "subjectbal_idx", columnList = "subjno, tenantid", unique = true)})
public class TSubjectbal {
@Id
- @Column(name = "SUBJNO", nullable = false, length = 10)
+ @Column(name = "subjid", nullable = false, length = 32)
+ private String subjid;
+
+ @Column(name = "SUBJNO", length = 10)
+ @NotNull
private String subjno;
@Column(name = "ACCUMDRAMT", precision = 15, scale = 2)
@@ -183,4 +185,12 @@
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
+
+ public String getSubjid() {
+ return subjid;
+ }
+
+ public void setSubjid(String subjid) {
+ this.subjid = subjid;
+ }
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectday.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectday.java
index eedf9b5..18b151d 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectday.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectday.java
@@ -8,38 +8,42 @@
@IdClass(TSubjectdayPK.class)
public class TSubjectday {
@Id
- @Column(name="ACCDATE", nullable = false, length = 8)
- private String accdate;
+ @Column(name = "subjid", nullable = false, length = 32)
+ private String subjid;
@Id
- @Column(name="SUBJNO", nullable = false, length = 10)
+ @Column(name = "ACCDATE", nullable = false, length = 8)
+ private String accdate;
+
+ @Column(name = "SUBJNO", length = 10)
+ @NotNull
private String subjno;
- @Column(name="PERIOD_YEAR", precision = 4)
+ @Column(name = "PERIOD_YEAR", precision = 4)
private Integer periodYear;
- @Column(name="PERIOD_MONTH", precision = 2)
+ @Column(name = "PERIOD_MONTH", precision = 2)
private Integer periodMonth;
- @Column(name="BEGINDRBAL", precision = 15, scale = 2)
+ @Column(name = "BEGINDRBAL", precision = 15, scale = 2)
private Double begindrbal;
- @Column(name="BEGINCRBAL", precision = 15, scale = 2)
+ @Column(name = "BEGINCRBAL", precision = 15, scale = 2)
private Double begincrbal;
- @Column(name="DRAMT", precision = 15, scale = 2)
+ @Column(name = "DRAMT", precision = 15, scale = 2)
private Double dramt;
- @Column(name="CRAMT", precision = 15, scale = 2)
+ @Column(name = "CRAMT", precision = 15, scale = 2)
private Double cramt;
- @Column(name="DRBAL", precision = 15, scale = 2)
+ @Column(name = "DRBAL", precision = 15, scale = 2)
private Double drbal;
- @Column(name="CRBAL", precision = 15, scale = 2)
+ @Column(name = "CRBAL", precision = 15, scale = 2)
private Double crbal;
- @Column(name="UPDTIME", precision = 15, scale = 2)
+ @Column(name = "UPDTIME", precision = 15, scale = 2)
private String updtime;
@Column(name = "tenantid", length = 20)
@@ -171,4 +175,12 @@
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
+
+ public String getSubjid() {
+ return subjid;
+ }
+
+ public void setSubjid(String subjid) {
+ this.subjid = subjid;
+ }
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectdayPK.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectdayPK.java
index a3fdd45..ac70e2f 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectdayPK.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectdayPK.java
@@ -10,8 +10,8 @@
private String accdate;
@Id
- @Column(name = "SUBJNO", nullable = false, length = 10)
- private String subjno;
+ @Column(name = "SUBJID", nullable = false, length = 32)
+ private String subjid;
public String getAccdate() {
return accdate;
@@ -21,12 +21,12 @@
this.accdate = accdate;
}
- public String getSubjno() {
- return subjno;
+ public String getSubjid() {
+ return subjid;
}
- public void setSubjno(String subjno) {
- this.subjno = subjno;
+ public void setSubjid(String subjid) {
+ this.subjid = subjid;
}
@Override
@@ -36,7 +36,7 @@
TSubjectdayPK tSubjectdayPK = (TSubjectdayPK) o;
if (accdate != null ? !accdate.equals(tSubjectdayPK.getAccdate()) : accdate != null)
return false;
- if (subjno != null ? !subjno.equals(tSubjectdayPK.getSubjno()) : subjno != null)
+ if (subjid != null ? !subjid.equals(tSubjectdayPK.getSubjid()) : subjid != null)
return false;
return true;
@@ -45,7 +45,7 @@
@Override
public int hashCode() {
int result = accdate != null ? accdate.hashCode() : 0;
- result = 31 * result + (subjno != null ? subjno.hashCode() : 0);
+ result = 31 * result + (subjid != null ? subjid.hashCode() : 0);
return result;
}
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSyspara.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSyspara.java
index d669146..8ec551c 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSyspara.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSyspara.java
@@ -5,19 +5,22 @@
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.framework.util.SysparaUtil;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "TB_SYSPARA")
+@IdClass(TSysparaPK.class)
public class TSyspara {
@Id
@Column(name = "PARAID", nullable = false, precision = 9)
private Integer paraid;
+ @Id
+ @Column(name = "tenantid", length = 20)
+ @NotNull
+ private String tenantId;
+
@Column(name = "PARAVAL", length = 100)
private String paraval;
@@ -45,9 +48,6 @@
@NotNull
private String lastsaved;
- @Column(name = "tenantid", length = 20)
- @NotNull
- private String tenantId;
public TSyspara() {
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSysparaPK.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSysparaPK.java
new file mode 100644
index 0000000..353225a
--- /dev/null
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TSysparaPK.java
@@ -0,0 +1,48 @@
+package com.supwisdom.dlpay.framework.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Objects;
+
+public class TSysparaPK implements Serializable {
+ @Id
+ @Column(name = "PARAID", nullable = false, precision = 9)
+ private Integer paraid;
+
+ @Id
+ @Column(name = "tenantid", length = 20)
+ @NotNull
+ private String tenantId;
+
+ public Integer getParaid() {
+ return paraid;
+ }
+
+ public void setParaid(Integer paraid) {
+ this.paraid = paraid;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof TSysparaPK)) return false;
+ TSysparaPK that = (TSysparaPK) o;
+ return Objects.equals(getParaid(), that.getParaid()) &&
+ Objects.equals(getTenantId(), that.getTenantId());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getParaid(), getTenantId());
+ }
+}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TTranscode.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TTranscode.java
index ac42871..46e53e4 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TTranscode.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TTranscode.java
@@ -1,16 +1,18 @@
package com.supwisdom.dlpay.framework.domain;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Entity
-@Table(name = "TB_TRANSCODE")
+@Table(name = "TB_TRANSCODE",
+ indexes = {@Index(name = "transcode_idx", columnList = "transcode, tenantid", unique = true)})
public class TTranscode implements DictionaryTable, Serializable {
@Id
+ @Column(name = "transcode_id")
+ @NotNull
+ private Integer trascodeId;
+
@Column(name = "TRANSCODE", nullable = false, precision = 4)
private Integer transcode;
@@ -54,4 +56,12 @@
public Object getDictValue() {
return this.transname;
}
+
+ public Integer getTrascodeId() {
+ return trascodeId;
+ }
+
+ public void setTrascodeId(Integer trascodeId) {
+ this.trascodeId = trascodeId;
+ }
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TTranstype.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TTranstype.java
deleted file mode 100644
index 5a52e0b..0000000
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TTranstype.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
-
-@Entity
-@Table(name = "TB_TRANSTYPE")
-public class TTranstype {
- @Id
- @Column(name = "TRANSTYPE", nullable = false, precision = 4)
- private Integer transtype;
-
- @Column(name = "DRSUBJNO", length = 10)
- private String drsubjno;
-
- @Column(name = "CRSUBJNO", length = 10)
- private String crsubjno;
-
- @Column(name = "SUMMARY", length = 200)
- private String summary;
-
- @Column(name = "tenantid", length = 20)
- @NotNull
- private String tenantId;
-
- public Integer getTranstype() {
- return transtype;
- }
-
- public void setTranstype(Integer transtype) {
- this.transtype = transtype;
- }
-
- public String getDrsubjno() {
- return drsubjno;
- }
-
- public void setDrsubjno(String drsubjno) {
- this.drsubjno = drsubjno;
- }
-
- public String getCrsubjno() {
- return crsubjno;
- }
-
- public void setCrsubjno(String crsubjno) {
- this.crsubjno = crsubjno;
- }
-
- public String getSummary() {
- return summary;
- }
-
- public void setSummary(String summary) {
- this.summary = summary;
- }
-
- public String getTenantId() {
- return tenantId;
- }
-
- public void setTenantId(String tenantId) {
- this.tenantId = tenantId;
- }
-}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucher.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucher.java
index 71b30d8..679d14e 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucher.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucher.java
@@ -4,7 +4,8 @@
import javax.validation.constraints.NotNull;
@Entity
-@Table(name = "TB_VOUCHER")
+@Table(name = "TB_VOUCHER",
+ indexes = {@Index(name = "voucher_idx", columnList = "voucherdate, tenantid")})
public class TVoucher {
@Id
@SequenceGenerator(name = "voucherid", sequenceName = "SEQ_VOUCHERID", allocationSize = 1)
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/filter/XssHttpServletRequestWrapper.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/filter/XssHttpServletRequestWrapper.java
index ba7ac78..f918b86 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/filter/XssHttpServletRequestWrapper.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/filter/XssHttpServletRequestWrapper.java
@@ -13,16 +13,13 @@
/**
* 防止sql注入,xss攻击
- * */
+ */
public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
private final static Logger log = LoggerFactory.getLogger(XssHttpServletRequestWrapper.class);
- private final static String key = "'|and|exec|execute|insert|select|delete|update|count|drop|%|chr|mid|master|truncate|" +
- "char|declare|sitename|net user|xp_cmdshell|;|or|-|+|,|like'|and|exec|execute|insert|create|drop|" +
- "table|from|grant|use|group_concat|column_name|" +
- "information_schema.columns|table_schema|union|where|select|delete|update|order|by|count|" +
- "chr|mid|master|truncate|char|declare|or|;|-|--|,|like|//|/|%|#";
+ private final static String key = "and|or|exec|insert|select|delete|update|truncate|declare";
private static Set<String> notAllowedKeyWords = new HashSet<String>(0);
- private static String replacedString="INVALID";
+ private static String replacedString = "INVALID";
+
static {
String keyStr[] = key.split("\\|");
for (String str : keyStr) {
@@ -43,7 +40,8 @@
currentUrl = request.getRequestURI();
}
- /**覆盖getParameter方法,将参数名和参数值都做xss过滤。
+ /**
+ * 覆盖getParameter方法,将参数名和参数值都做xss过滤。
* 如果需要获得原始的值,则通过super.getParameterValues(name)来获取
* getParameterNames,getParameterValues和getParameterMap也可能需要覆盖
*/
@@ -55,6 +53,7 @@
}
return cleanXSS(value);
}
+
@Override
public String[] getParameterValues(String parameter) {
String[] values = super.getParameterValues(parameter);
@@ -70,20 +69,20 @@
}
@Override
- public Map<String, String[]> getParameterMap(){
- Map<String, String[]> values=super.getParameterMap();
+ public Map<String, String[]> getParameterMap() {
+ Map<String, String[]> values = super.getParameterMap();
if (values == null) {
return null;
}
- Map<String, String[]> result=new HashMap<>();
- for(String key:values.keySet()){
- String encodedKey=cleanXSS(key);
- int count=values.get(key).length;
+ Map<String, String[]> result = new HashMap<>();
+ for (String key : values.keySet()) {
+ String encodedKey = cleanXSS(key);
+ int count = values.get(key).length;
String[] encodedValues = new String[count];
- for (int i = 0; i < count; i++){
- encodedValues[i]=cleanXSS(values.get(key)[i]);
+ for (int i = 0; i < count; i++) {
+ encodedValues[i] = cleanXSS(values.get(key)[i]);
}
- result.put(encodedKey,encodedValues);
+ result.put(encodedKey, encodedValues);
}
return result;
}
@@ -120,10 +119,10 @@
String paramValue = value;
for (String keyword : notAllowedKeyWords) {
if (paramValue.length() > keyword.length() + 4
- && (paramValue.contains(" "+keyword)||paramValue.contains(keyword+" ")||paramValue.contains(" "+keyword+" "))) {
+ && (paramValue.contains(" " + keyword) || paramValue.contains(keyword + " ") || paramValue.contains(" " + keyword + " "))) {
paramValue = StringUtils.replace(paramValue, keyword, replacedString);
log.error(this.currentUrl + "已被过滤,因为参数中包含不允许sql的关键词(" + keyword
- + ")"+";参数:"+value+";过滤后的参数:"+paramValue);
+ + ")" + ";参数:" + value + ";过滤后的参数:" + paramValue);
}
}
return paramValue;
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/service/impl/DayendSettleServiceImpl.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/service/impl/DayendSettleServiceImpl.java
index 2f4959b..8310435 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/framework/service/impl/DayendSettleServiceImpl.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/service/impl/DayendSettleServiceImpl.java
@@ -469,7 +469,7 @@
// List<TVoucherEntry> entryList = voucherEntryDao.getVoucherEntryByVoucherid(voucherid);
// if (null == voucher) {
// throw new Exception("凭证查询无记录");
-// } else if ("auto".equals(voucher.getSourcetype())) {
+// } else if ("auto".equals(voucher.getSourceType())) {
// throw new Exception("该凭证不是手工录入凭证");
// } else if (voucher.getCheckflag() != 1) {
// throw new Exception("该凭证未审核");
@@ -499,7 +499,7 @@
//
// //明细
// for (TVoucherEntry entry : entryList) {
-// if (Subject.SUBJNO_MACHANT_INCOME.equals(entry.getSubjno())) {
+// if (Subject.SUBJNO_MACHANT_INCOME.equals(entry.getSubjid())) {
// TShopaccbal tShopaccbal = shopaccbalDao.getTShopaccbalByIdWithLock(entry.getAccno());
// if (null == tShopaccbal) {
// throw new Exception("商户表商户账号[" + entry.getAccno() + "]不存在");
@@ -509,12 +509,12 @@
// entry.setBalflag(2);
// entry.setBalance(tShopaccbal.getBalance());
// } else {
-// TSubjectbal tSubjectbal = subjectbalDao.getTSubjectbalBySubjnoWithLock(entry.getSubjno());
-// TSubject subject = subjectDao.getOne(entry.getSubjno());
+// TSubjectbal tSubjectbal = subjectbalDao.getTSubjectbalBySubjnoWithLock(entry.getSubjid());
+// TSubject subject = subjectDao.getOne(entry.getSubjid());
// if (null == tSubjectbal || null == subject) {
-// throw new Exception("科目表科目号[" + entry.getSubjno() + "]不存在");
+// throw new Exception("科目表科目号[" + entry.getSubjid() + "]不存在");
// } else if (subject.getEndflag() != 1) {
-// throw new Exception("科目[" + entry.getSubjno() + "]非末级科目");
+// throw new Exception("科目[" + entry.getSubjid() + "]非末级科目");
// }
// entry.setBalflag(subject.getBalflag());
// if (subject.getBalflag() == 1) {
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/tenant/TenantCacheKeyGen.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/tenant/TenantCacheKeyGen.java
new file mode 100644
index 0000000..bbf9486
--- /dev/null
+++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/tenant/TenantCacheKeyGen.java
@@ -0,0 +1,25 @@
+package com.supwisdom.dlpay.framework.tenant;
+
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.cache.interceptor.KeyGenerator;
+
+import java.lang.reflect.Method;
+
+public class TenantCacheKeyGen implements KeyGenerator {
+ private static final char delimiter = ':';
+
+ @Override
+ public Object generate(Object target, Method method, Object... params) {
+ StringBuilder name = new StringBuilder();
+ String tenant = TenantContext.getTenantSchema();
+ if (StringUtils.isEmpty(tenant)) {
+ tenant = "default";
+ }
+ name.append(tenant);
+ for (Object item : params) {
+ name.append(delimiter).append(item.toString());
+ }
+ return name.toString();
+ }
+}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/bean/ShopConfigBean.java b/payapi/src/main/java/com/supwisdom/dlpay/system/bean/ShopConfigBean.java
index 1e477e7..9085d2e 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/system/bean/ShopConfigBean.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/system/bean/ShopConfigBean.java
@@ -3,7 +3,7 @@
public class ShopConfigBean {
private String shopaccno;
private String shopname;
- private String paytype;
+ private String sourceType;
private String paydesc;
private boolean consumeEnable;
private boolean anonymousEnable;
@@ -12,10 +12,10 @@
public ShopConfigBean() {
}
- public ShopConfigBean(String shopaccno, String shopname, String paytype, String paydesc, boolean consumeEnable, boolean anonymousEnable, boolean reverseEnable) {
+ public ShopConfigBean(String shopaccno, String shopname, String sourceType, String paydesc, boolean consumeEnable, boolean anonymousEnable, boolean reverseEnable) {
this.shopaccno = shopaccno;
this.shopname = shopname;
- this.paytype = paytype;
+ this.sourceType = sourceType;
this.paydesc = paydesc;
this.consumeEnable = consumeEnable;
this.anonymousEnable = anonymousEnable;
@@ -38,12 +38,12 @@
this.shopname = shopname;
}
- 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 getPaydesc() {
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ParamController.java b/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ParamController.java
index cdc4a4a..2bf71b3 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ParamController.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ParamController.java
@@ -2,7 +2,7 @@
import com.supwisdom.dlpay.api.bean.JsonResult;
import com.supwisdom.dlpay.api.domain.TSourceType;
-import com.supwisdom.dlpay.api.domain.TPaytypeConfig;
+import com.supwisdom.dlpay.api.domain.TSourceTypeConfig;
import com.supwisdom.dlpay.framework.domain.TApiClient;
import com.supwisdom.dlpay.framework.domain.TBusinesspara;
import com.supwisdom.dlpay.framework.domain.TSyspara;
@@ -355,45 +355,45 @@
* 支付能力配置
* ====================================================
*/
- @GetMapping("/param/paytype")
- public String paytypeView() {
- return "system/param/paytype";
+ @GetMapping("/param/sourcetype")
+ public String sourcetypeView() {
+ return "system/param/sourcetype";
}
- @GetMapping("/param/paytypelist")
- @PreAuthorize("hasPermission('/param/paytype','')")
+ @GetMapping("/param/sourcetypelist")
+ @PreAuthorize("hasPermission('/param/sourcetype','')")
@ResponseBody
public PageResult<TSourceType> getPaytypeDataList(@RequestParam("page") Integer pageNo,
@RequestParam("limit") Integer pageSize,
- @RequestParam(value = "paytype", required = false) String paytype) {
+ @RequestParam(value = "sourcetype", required = false) String sourcetype) {
try {
if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
- return paramService.getSourceTypePage(paytype, pageNo, pageSize);
+ return paramService.getSourceTypePage(sourcetype, pageNo, pageSize);
} catch (Exception e) {
e.printStackTrace();
return new PageResult<>(99, "系统查询错误");
}
}
- @GetMapping("/param/load4addpaytype")
- @PreAuthorize("hasPermission('/param/load4addpaytype','')")
+ @GetMapping("/param/load4addsourcetype")
+ @PreAuthorize("hasPermission('/param/load4addsourcetype','')")
public String load4AddPaytype(Model model) {
- return "system/param/paytypeform";
+ return "system/param/sourcetypeform";
}
- @PostMapping("/param/updatepaytypestate")
- @PreAuthorize("hasPermission('/param/updatepaytypestate','')")
+ @PostMapping("/param/updatesourcetypestate")
+ @PreAuthorize("hasPermission('/param/updatesourcetypestate','')")
@ResponseBody
- public JsonResult updatePaytypeState(@RequestParam("paytype") String paytype,
+ public JsonResult updatePaytypeState(@RequestParam("sourcetype") String sourcetype,
@RequestParam("state") Boolean state,
@RequestParam(value = "optype", required = false) String optype) {
- if (StringUtil.isEmpty(paytype)
+ if (StringUtil.isEmpty(sourcetype)
|| (!StringUtil.isEmpty(optype) && !"charge".equals(optype) && !"consume".equals(optype) && !"anonymous".equals(optype) && !"reversable".equals(optype) && !"checkable".equals(optype))) {
return JsonResult.error("参数传递错误");
}
try {
- TSourceType tPaytype = paramService.getSourceType(paytype);
+ TSourceType tPaytype = paramService.getSourceType(sourcetype);
if (null == tPaytype) {
return JsonResult.error("支付方式不存在!");
}
@@ -412,17 +412,17 @@
return JsonResult.error("状态错误,请重新查询后操作");
}
tPaytype.setAnonymousEnable(state);
- } else if("reversable".equals(optype)){
- if(state.equals(tPaytype.getReversable())){
+ } else if ("reversable".equals(optype)) {
+ if (state.equals(tPaytype.getReversable())) {
return JsonResult.error("状态错误,请重新查询后操作");
}
tPaytype.setReversable(state);
- }else if("checkable".equals(optype)){
- if(state.equals(tPaytype.getCheckable())){
+ } else if ("checkable".equals(optype)) {
+ if (state.equals(tPaytype.getCheckable())) {
return JsonResult.error("状态错误,请重新查询后操作");
}
tPaytype.setCheckable(state);
- }else{
+ } else {
if (state.equals(tPaytype.getEnable())) {
return JsonResult.error("状态错误,请重新查询后操作");
}
@@ -440,20 +440,20 @@
}
}
- @PostMapping("/param/updatepaytypename")
- @PreAuthorize("hasPermission('/param/updatepaytypename','')")
+ @PostMapping("/param/updatesourcetypename")
+ @PreAuthorize("hasPermission('/param/updatesourcetypename','')")
@ResponseBody
- public JsonResult updatePaytypeName(@RequestParam("paytype") String paytype,
- @RequestParam("paydesc") String paydesc) {
- if (StringUtil.isEmpty(paytype) || StringUtil.isEmpty(paydesc)) {
+ public JsonResult updatePaytypeName(@RequestParam("sourcetype") String sourcetype,
+ @RequestParam("paydesc") String desc) {
+ if (StringUtil.isEmpty(sourcetype) || StringUtil.isEmpty(desc)) {
return JsonResult.error("参数传递错误");
}
try {
- TSourceType tPaytype = paramService.getSourceType(paytype);
+ TSourceType tPaytype = paramService.getSourceType(sourcetype);
if (null == tPaytype) {
return JsonResult.error("支付方式不存在!");
}
- tPaytype.setPaydesc(paydesc.trim());
+ tPaytype.setPaydesc(desc.trim());
if (paramService.saveOrUpdateSourceType(tPaytype)) {
return JsonResult.ok("修改成功");
} else {
@@ -465,12 +465,12 @@
}
}
- @PostMapping("/param/deletepaytype")
- @PreAuthorize("hasPermission('/param/deletepaytype','')")
+ @PostMapping("/param/deletesourcetype")
+ @PreAuthorize("hasPermission('/param/deletesourcetype','')")
@ResponseBody
- public JsonResult deletePaytype(@RequestParam("paytype") String paytype) {
+ public JsonResult deletePaytype(@RequestParam("sourcetype") String sourcetype) {
try {
- TSourceType tPaytype = paramService.getSourceType(paytype);
+ TSourceType tPaytype = paramService.getSourceType(sourcetype);
if (null == tPaytype) {
return JsonResult.error("支付方式不存在!");
}
@@ -485,10 +485,10 @@
}
}
- @PostMapping("/param/addpaytype")
- @PreAuthorize("hasPermission('/param/addpaytype','')")
+ @PostMapping("/param/addsourcetype")
+ @PreAuthorize("hasPermission('/param/addsourcetype','')")
@ResponseBody
- public JsonResult addPaytype(@RequestParam("paytype") String paytype,
+ public JsonResult addPaytype(@RequestParam("sourcetype") String sourcetype,
@RequestParam(value = "enable", required = false, defaultValue = "no") String enable,
@RequestParam(value = "chargeEnable", required = false, defaultValue = "no") String chargeEnable,
@RequestParam(value = "consumeEnable", required = false, defaultValue = "no") String consumeEnable,
@@ -497,12 +497,12 @@
@RequestParam(value = "checkable", required = false, defaultValue = "no") String checkable,
@RequestParam("paydesc") String paydesc) {
try {
- TSourceType tPaytype = paramService.getSourceType(paytype);
+ TSourceType tPaytype = paramService.getSourceType(sourcetype);
if (null != tPaytype) {
return JsonResult.error("支付方式已经存在");
}
tPaytype = new TSourceType();
- tPaytype.setSourceType(paytype.trim());
+ tPaytype.setSourceType(sourcetype.trim());
if (StringUtil.isEmpty(paydesc)) return JsonResult.error("支付名称不能为空!");
tPaytype.setPaydesc(paydesc.trim());
tPaytype.setEnable(ConstantUtil.ENABLE_YES.equalsIgnoreCase(enable));
@@ -522,10 +522,10 @@
}
}
- @GetMapping("/param/checkpaytype")
+ @GetMapping("/param/checksourcetype")
@ResponseBody
- public JsonResult checkPaytype(@RequestParam("paytype") String paytype) {
- TSourceType tPaytype = paramService.getSourceType(paytype);
+ public JsonResult checkPaytype(@RequestParam("sourcetype") String sourcetype) {
+ TSourceType tPaytype = paramService.getSourceType(sourcetype);
if (null != tPaytype) {
return JsonResult.error("支付方式已经存在");
} else {
@@ -533,28 +533,28 @@
}
}
- @GetMapping("/param/load4paytypeconfig")
- @PreAuthorize("hasPermission('/param/load4paytypeconfig','')")
- public String load4PaytypeConfig(@RequestParam("paytype") String paytype, Model model) {
- List<TPaytypeConfig> configList = paramService.getSourceTypeConfigList(paytype);
+ @GetMapping("/param/load4sourcetypeconfig")
+ @PreAuthorize("hasPermission('/param/load4sourcetypeconfig','')")
+ public String load4PaytypeConfig(@RequestParam("sourcetype") String sourceType, Model model) {
+ List<TSourceTypeConfig> configList = paramService.getSourceTypeConfigList(sourceType);
model.addAttribute("configlist", configList);
- model.addAttribute("paytype", paytype);
- return "system/param/paytypeconfig";
+ model.addAttribute("sourcetype", sourceType);
+ return "system/param/sourcetypeconfig";
}
- @PostMapping("/param/addpaytypeconfig")
- @PreAuthorize("hasPermission('/param/addpaytypeconfig','')")
+ @PostMapping("/param/addsourcetypeconfig")
+ @PreAuthorize("hasPermission('/param/addsourcetypeconfig','')")
@ResponseBody
public JsonResult addPaytypeConfig(@RequestBody Map<String, String> param) {
- String paytypeHtmlKey = "hid_paytype"; //页面上传来paytype的KEY
- if (null == param || StringUtil.isEmpty(param.get(paytypeHtmlKey))) {
+ String sourcetypeHtmlKey = "hid_sourcetype"; //页面上传来sourcetype的KEY
+ if (null == param || StringUtil.isEmpty(param.get(sourcetypeHtmlKey))) {
return JsonResult.error("参数传递错误");
}
try {
- String paytype = param.get(paytypeHtmlKey).trim();
- param.remove(paytypeHtmlKey);
- if (paramService.saveSourceTypeConfig(paytype, param)) {
+ String sourcetype = param.get(sourcetypeHtmlKey).trim();
+ param.remove(sourcetypeHtmlKey);
+ if (paramService.saveSourceTypeConfig(sourcetype, param)) {
return JsonResult.ok("配置成功");
} else {
return JsonResult.error("配置失败");
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java b/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java
index b85095a..9cc74c5 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java
@@ -2,8 +2,8 @@
import com.supwisdom.dlpay.api.bean.JsonResult;
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.api.domain.TShopSourceType;
+import com.supwisdom.dlpay.api.domain.TShopSourceTypeConfig;
import com.supwisdom.dlpay.framework.domain.TShop;
import com.supwisdom.dlpay.framework.domain.TShopacc;
import com.supwisdom.dlpay.framework.service.SystemUtilService;
@@ -171,36 +171,36 @@
return JsonResult.ok("OK").put("data", shopDataService.getAllShopNodes());
}
- @GetMapping("/shop/shoppaytypelist")
- @PreAuthorize("hasPermission('/shop/shoppaytypelist','')")
+ @GetMapping("/shop/shopsourcetypelist")
+ @PreAuthorize("hasPermission('/shop/shopsourcetypelist','')")
@ResponseBody
public PageResult<ShopConfigBean> getShopPaytypeList(@RequestParam("page") Integer pageNo,
@RequestParam("limit") Integer pageSize,
- @RequestParam(value = "paytype", required = false) String paytype,
+ @RequestParam(value = "sourcetype", required = false) String sourcetype,
@RequestParam(value = "shopaccno", required = false) String shopaccno) {
try {
if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
- return shopDataService.getShopPaytypeInfos(shopaccno, paytype, pageNo, pageSize);
+ return shopDataService.getShopPaytypeInfos(shopaccno, sourcetype, pageNo, pageSize);
} catch (Exception e) {
e.printStackTrace();
return new PageResult<>(99, "系统查询错误");
}
}
- @PostMapping("/shop/updatepaytypestat")
- @PreAuthorize("hasPermission('/shop/updatepaytypestat','')")
+ @PostMapping("/shop/updatesourcetypestat")
+ @PreAuthorize("hasPermission('/shop/updatesourcetypestat','')")
@ResponseBody
- public JsonResult updateShopPaytypeStat(@RequestParam("shopaccno") String shopaccno, @RequestParam("paytype") String paytype,
+ public JsonResult updateShopPaytypeStat(@RequestParam("shopaccno") String shopaccno, @RequestParam("sourceType") String sourcetype,
@RequestParam("state") String state, @RequestParam("optype") String optype) {
- if (StringUtil.isEmpty(shopaccno) || StringUtil.isEmpty(paytype)
+ if (StringUtil.isEmpty(shopaccno) || StringUtil.isEmpty(sourcetype)
|| (!ConstantUtil.ENABLE_NO.equals(state) && !ConstantUtil.ENABLE_YES.equals(state))
|| (!"consume".equals(optype) && !"anonymous".equals(optype) && !"reverse".equals(optype))) {
return JsonResult.error("参数传递错误");
}
try {
- TShopPaytype shopPaytype = shopDataService.getShopPaytype(shopaccno.trim(), paytype.trim());
+ TShopSourceType shopPaytype = shopDataService.getShopPaytype(shopaccno.trim(), sourcetype.trim());
if (null == shopPaytype) {
return JsonResult.error("商户支付能力不存在!");
}
@@ -233,41 +233,41 @@
}
}
- @GetMapping("/shop/load4addpaytype")
- @PreAuthorize("hasPermission('/shop/load4addpaytype','')")
+ @GetMapping("/shop/load4addsourcetype")
+ @PreAuthorize("hasPermission('/shop/load4addsourcetype','')")
public String load4AddShopPaytype(Model model) {
model.addAttribute(Dictionary.PAY_TYPE,
dictionaryProxy.getDictionaryAsList(Dictionary.SOURCE_TYPE));
return "system/shop/configform";
}
- @PostMapping("/shop/addshoppaytype")
- @PreAuthorize("hasPermission('/shop/addshoppaytype','')")
+ @PostMapping("/shop/addshopsourcetype")
+ @PreAuthorize("hasPermission('/shop/addshopsourcetype','')")
@ResponseBody
- public JsonResult addShoppaytype(@RequestParam("shopaccno") String shopaccno,
- @RequestParam("paytype") String paytype,
- @RequestParam(value = "consumeEnable", required = false, defaultValue = "no") String consumeEnable,
- @RequestParam(value = "anonymousEnable", required = false, defaultValue = "no") String anonymousEnable,
- @RequestParam(value = "reverseEnable", required = false, defaultValue = "no") String reverseEnable) {
- if (StringUtil.isEmpty(shopaccno) || StringUtil.isEmpty(paytype)) {
+ public JsonResult addShopsourcetype(@RequestParam("shopaccno") String shopaccno,
+ @RequestParam("sourcetype") String sourcetype,
+ @RequestParam(value = "consumeEnable", required = false, defaultValue = "no") String consumeEnable,
+ @RequestParam(value = "anonymousEnable", required = false, defaultValue = "no") String anonymousEnable,
+ @RequestParam(value = "reverseEnable", required = false, defaultValue = "no") String reverseEnable) {
+ if (StringUtil.isEmpty(shopaccno) || StringUtil.isEmpty(sourcetype)) {
return JsonResult.error("参数传递错误");
}
try {
TShopacc shopacc = shopDataService.getShopaccByAccno(shopaccno.trim());
- TSourceType tPaytype = paramService.getSourceType(paytype.trim());
+ TSourceType tPaytype = paramService.getSourceType(sourcetype.trim());
if (null == shopacc) {
return JsonResult.error("商户账户不存在!");
}
if (null == tPaytype) {
return JsonResult.error("支付方式在系统中不存在!");
}
- TShopPaytype shopPaytype = shopDataService.getShopPaytype(shopaccno.trim(), paytype.trim());
+ TShopSourceType shopPaytype = shopDataService.getShopPaytype(shopaccno.trim(), sourcetype.trim());
if (null != shopPaytype) {
return JsonResult.error("商户该支付能力已经存在!");
}
- shopPaytype = new TShopPaytype();
+ shopPaytype = new TShopSourceType();
shopPaytype.setShopaccno(shopacc.getShopaccno());
- shopPaytype.setPaytype(tPaytype.getSourceType());
+ shopPaytype.setSourceType(tPaytype.getSourceType());
shopPaytype.setConsumeEnable(ConstantUtil.ENABLE_YES.equalsIgnoreCase(consumeEnable));
shopPaytype.setAnonymousEnable(ConstantUtil.ENABLE_YES.equalsIgnoreCase(anonymousEnable));
shopPaytype.setReverseEnable(ConstantUtil.ENABLE_YES.equalsIgnoreCase(reverseEnable));
@@ -283,33 +283,33 @@
}
}
- @GetMapping("/shop/load4paytypepara")
- @PreAuthorize("hasPermission('/shop/load4paytypepara','')")
+ @GetMapping("/shop/load4sourcetypepara")
+ @PreAuthorize("hasPermission('/shop/load4sourcetypepara','')")
public String load4AddShopPaytypePara(@RequestParam("shopaccno") String shopaccno,
- @RequestParam("paytype") String paytype,
+ @RequestParam("sourceType") String sourcetype,
Model model) {
- List<TShopPaytypeConfig> configList = shopDataService.getShopPaytypeConfigs(shopaccno, paytype);
+ List<TShopSourceTypeConfig> configList = shopDataService.getShopPaytypeConfigs(shopaccno, sourcetype);
model.addAttribute("configlist", configList);
model.addAttribute("shopaccno", shopaccno);
- model.addAttribute("paytype", paytype);
+ model.addAttribute("sourcetype", sourcetype);
return "system/shop/configpara";
}
- @PostMapping("/shop/addpaytypepara")
- @PreAuthorize("hasPermission('/shop/addpaytypepara','')")
+ @PostMapping("/shop/addsourcetypepara")
+ @PreAuthorize("hasPermission('/shop/addsourcetypepara','')")
@ResponseBody
public JsonResult addShopPaytypePara(@RequestBody Map<String, String> param) {
String shopaccnoHtmlKey = "hid_shopaccno"; //页面上传来shopaccno的KEY
- String paytypeHtmlKey = "hid_paytype"; //页面上传来paytype的KEY
- if (null == param || StringUtil.isEmpty(param.get(paytypeHtmlKey)) || StringUtil.isEmpty(param.get(shopaccnoHtmlKey))) {
+ String sourcetypeHtmlKey = "hid_sourcetype"; //页面上传来sourcetype的KEY
+ if (null == param || StringUtil.isEmpty(param.get(sourcetypeHtmlKey)) || StringUtil.isEmpty(param.get(shopaccnoHtmlKey))) {
return JsonResult.error("参数传递错误");
}
try {
String shopaccno = param.get(shopaccnoHtmlKey).trim();
- String paytype = param.get(paytypeHtmlKey).trim();
+ String sourcetype = param.get(sourcetypeHtmlKey).trim();
param.remove(shopaccnoHtmlKey);
- param.remove(paytypeHtmlKey);
- if (shopDataService.saveOrUpdateShopPaytypeConfig(shopaccno, paytype, param)) {
+ param.remove(sourcetypeHtmlKey);
+ if (shopDataService.saveOrUpdateShopPaytypeConfig(shopaccno, sourcetype, param)) {
return JsonResult.ok("配置成功");
} else {
return JsonResult.error("配置失败");
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/service/ParamService.java b/payapi/src/main/java/com/supwisdom/dlpay/system/service/ParamService.java
index dc9d180..b2a0334 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/system/service/ParamService.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/system/service/ParamService.java
@@ -1,7 +1,7 @@
package com.supwisdom.dlpay.system.service;
import com.supwisdom.dlpay.api.domain.TSourceType;
-import com.supwisdom.dlpay.api.domain.TPaytypeConfig;
+import com.supwisdom.dlpay.api.domain.TSourceTypeConfig;
import com.supwisdom.dlpay.framework.domain.TApiClient;
import com.supwisdom.dlpay.framework.domain.TBusinesspara;
import com.supwisdom.dlpay.framework.domain.TSyspara;
@@ -64,7 +64,7 @@
boolean deleteSourceType(TSourceType paytype);
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true)
- List<TPaytypeConfig> getSourceTypeConfigList(String paytype);
+ List<TSourceTypeConfig> getSourceTypeConfigList(String paytype);
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
boolean saveSourceTypeConfig(String paytype, Map<String, String> param) throws WebCheckException;
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java b/payapi/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java
index 9f5bd1a..606cb7c 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java
@@ -1,8 +1,7 @@
package com.supwisdom.dlpay.system.service;
-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.api.domain.TShopSourceType;
+import com.supwisdom.dlpay.api.domain.TShopSourceTypeConfig;
import com.supwisdom.dlpay.framework.domain.TShop;
import com.supwisdom.dlpay.framework.domain.TShopacc;
import com.supwisdom.dlpay.framework.util.PageResult;
@@ -32,16 +31,16 @@
PageResult<ShopConfigBean> getShopPaytypeInfos(String shopaccno, String paytype, int pageNo, int pageSize);
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
- TShopPaytype getShopPaytype(String shopaccno, String paytype);
+ TShopSourceType getShopPaytype(String shopaccno, String paytype);
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
TShopacc getShopaccByAccno(String shopaccno);
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
- boolean saveOrUpdateShopPaytype(TShopPaytype shopPaytype);
+ boolean saveOrUpdateShopPaytype(TShopSourceType shopPaytype);
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
- List<TShopPaytypeConfig> getShopPaytypeConfigs(String shopaccno, String paytype);
+ List<TShopSourceTypeConfig> getShopPaytypeConfigs(String shopaccno, String paytype);
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
boolean saveOrUpdateShopPaytypeConfig(String shopaccno, String paytype, Map<String, String> param) throws WebCheckException;
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java b/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java
index a0f86cd..d933a65 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ParamServiceImpl.java
@@ -1,8 +1,8 @@
package com.supwisdom.dlpay.system.service.impl;
-import com.supwisdom.dlpay.api.dao.PaytypeConfigDao;
+import com.supwisdom.dlpay.api.dao.SourceTypeConfigDao;
import com.supwisdom.dlpay.api.dao.SourceTypeDao;
-import com.supwisdom.dlpay.api.domain.TPaytypeConfig;
+import com.supwisdom.dlpay.api.domain.TSourceTypeConfig;
import com.supwisdom.dlpay.api.domain.TSourceType;
import com.supwisdom.dlpay.framework.dao.ApiClientDao;
import com.supwisdom.dlpay.framework.dao.BusinessparaDao;
@@ -46,7 +46,7 @@
@Autowired
private SourceTypeDao sourceTypeDao;
@Autowired
- private PaytypeConfigDao paytypeConfigDao;
+ private SourceTypeConfigDao paytypeConfigDao;
@Override
public PageResult<TSyspara> getSysparaPage(Integer paraid, String paraname, int pageNo, int pageSize) {
@@ -200,9 +200,9 @@
@Override
@Cacheable(cacheNames = "source_type_config_cache", key = "#p0")
- public List<TPaytypeConfig> getSourceTypeConfigList(String paytype) {
+ public List<TSourceTypeConfig> getSourceTypeConfigList(String paytype) {
if (!StringUtil.isEmpty(paytype)) {
- List<TPaytypeConfig> list = paytypeConfigDao.getByPaytypeOrderByConfigid(paytype.trim());
+ List<TSourceTypeConfig> list = paytypeConfigDao.getBySourceTypeOrderByConfigid(paytype.trim());
if (!StringUtil.isEmpty(list))
return list;
}
@@ -216,7 +216,7 @@
if (null == tPaytype) throw new WebCheckException("支付能力[" + paytype + "]不存在");
for (String key : param.keySet()) {
String value = param.get(key);
- TPaytypeConfig config = paytypeConfigDao.getByPaytypeAndAndConfigid(tPaytype.getSourceType(), key);
+ TSourceTypeConfig config = paytypeConfigDao.getBySourceTypeAndAndConfigid(tPaytype.getSourceType(), key);
if (null == config)
throw new WebCheckException("支付能力[" + tPaytype.getSourceType() + "]不存在配置项[" + key + "],请重新查询");
config.setConfigValue(StringUtil.isEmpty(value) ? null : value.trim());
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java b/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java
index 88d4deb..1993949 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java
@@ -1,13 +1,13 @@
package com.supwisdom.dlpay.system.service.impl;
-import com.supwisdom.dlpay.api.dao.PaytypeConfigDao;
+import com.supwisdom.dlpay.api.dao.SourceTypeConfigDao;
import com.supwisdom.dlpay.api.dao.SourceTypeDao;
-import com.supwisdom.dlpay.api.dao.ShopPaytypeConfigDao;
-import com.supwisdom.dlpay.api.dao.ShopPaytypeDao;
+import com.supwisdom.dlpay.api.dao.ShopSourceTypeConfigDao;
+import com.supwisdom.dlpay.api.dao.ShopSourceTypeDao;
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;
+import com.supwisdom.dlpay.api.domain.TSourceTypeConfig;
+import com.supwisdom.dlpay.api.domain.TShopSourceType;
+import com.supwisdom.dlpay.api.domain.TShopSourceTypeConfig;
import com.supwisdom.dlpay.framework.dao.ShopDao;
import com.supwisdom.dlpay.framework.dao.ShopaccDao;
import com.supwisdom.dlpay.framework.data.SystemDateTime;
@@ -22,7 +22,6 @@
import com.supwisdom.dlpay.system.bean.ShopConfigBean;
import com.supwisdom.dlpay.system.bean.ZTreeNode;
import com.supwisdom.dlpay.system.service.ShopDataService;
-import com.supwisdom.dlpay.util.ConstantUtil;
import com.supwisdom.dlpay.util.WebCheckException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
@@ -44,15 +43,15 @@
@Autowired
private ShopaccDao shopaccDao;
@Autowired
- private ShopPaytypeDao shopPaytypeDao;
+ private ShopSourceTypeDao shopSourceTypeDao;
@Autowired
private SystemUtilService systemUtilService;
@Autowired
- private SourceTypeDao paytypeDao;
+ private SourceTypeDao sourceTypeDao;
@Autowired
- private PaytypeConfigDao paytypeConfigDao;
+ private SourceTypeConfigDao sourceTypeConfigDao;
@Autowired
- private ShopPaytypeConfigDao shopPaytypeConfigDao;
+ private ShopSourceTypeConfigDao shopPaytypeConfigDao;
@Override
public List<ZTreeNode> getAllShopNodes() {
@@ -148,46 +147,46 @@
// TShopPaytype shopPaytype = new TShopPaytype();
// shopPaytype.setShopaccno(shopacc.getShopaccno());
-// shopPaytype.setPaytype(TradeDict.PAYTYPE_BALANCE);
+// shopPaytype.setSourceType(TradeDict.PAYTYPE_BALANCE);
// shopPaytype.setConsumeEnable(true);
// shopPaytype.setAnonymousEnable(false);
// shopPaytype.setReverseEnable(false);
// shopPaytype.setCreatetime(dt.getHostdatetime());
-// shopPaytypeDao.save(shopPaytype); //默认增加余额支付方式
+// shopSourceTypeDao.save(shopPaytype); //默认增加余额支付方式
}
return true;
}
}
@Override
- public PageResult<ShopConfigBean> getShopPaytypeInfos(String shopaccno, String paytype, int pageNo, int pageSize) {
- Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by("shopaccno", "paytype"));
+ public PageResult<ShopConfigBean> getShopPaytypeInfos(String shopaccno, String sourceType, int pageNo, int pageSize) {
+ Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by("shopaccno", "sourceType"));
- Page<TShopPaytype> page = shopPaytypeDao.findAll(new Specification<TShopPaytype>() {
+ Page<TShopSourceType> page = shopSourceTypeDao.findAll(new Specification<TShopSourceType>() {
@Override
- public Predicate toPredicate(Root<TShopPaytype> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
+ public Predicate toPredicate(Root<TShopSourceType> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
List<Predicate> predicates = new ArrayList<>();
if (!StringUtil.isEmpty(shopaccno)) {
predicates.add(criteriaBuilder.equal(root.get("shopaccno").as(String.class), shopaccno.trim()));
}
- if (!StringUtil.isEmpty(paytype)) {
- predicates.add(criteriaBuilder.equal(root.get("paytype").as(String.class), paytype.trim()));
+ if (!StringUtil.isEmpty(sourceType)) {
+ predicates.add(criteriaBuilder.equal(root.get("sourceType").as(String.class), sourceType.trim()));
}
return criteriaBuilder.and(predicates.toArray(new Predicate[0]));
}
}, pageable);
- if (null == page || page.getTotalElements() == 0) {
+ if (page.getTotalElements() == 0) {
return new PageResult<>(99, "无数据");
}
List<ShopConfigBean> list = new ArrayList<>(0);
- for (TShopPaytype pt : page.getContent()) {
+ for (TShopSourceType pt : page.getContent()) {
ShopConfigBean bean = new ShopConfigBean();
bean.setShopaccno(pt.getShopaccno());
TShopacc shopacc = shopaccDao.getByShopaccno(pt.getShopaccno());
bean.setShopname(shopacc == null ? "" : shopacc.getShopname());
- bean.setPaytype(pt.getPaytype());
- TSourceType tPaytype = paytypeDao.getBySourceType(pt.getPaytype());
+ bean.setSourceType(pt.getSourceType());
+ TSourceType tPaytype = sourceTypeDao.getBySourceType(pt.getSourceType());
bean.setPaydesc(tPaytype == null ? "" : tPaytype.getPaydesc());
bean.setConsumeEnable(pt.getConsumeEnable());
bean.setAnonymousEnable(pt.getAnonymousEnable());
@@ -198,8 +197,8 @@
}
@Override
- public TShopPaytype getShopPaytype(String shopaccno, String paytype) {
- return shopPaytypeDao.getById(paytype, shopaccno);
+ public TShopSourceType getShopPaytype(String shopaccno, String paytype) {
+ return shopSourceTypeDao.getById(paytype, shopaccno);
}
@Override
@@ -211,27 +210,27 @@
}
@Override
- public boolean saveOrUpdateShopPaytype(TShopPaytype shopPaytype) {
+ public boolean saveOrUpdateShopPaytype(TShopSourceType shopPaytype) {
if (null != shopPaytype) {
shopPaytype.setTenantid(TenantContext.getTenantSchema());
- shopPaytypeDao.save(shopPaytype);
+ shopSourceTypeDao.save(shopPaytype);
return true;
}
return false;
}
@Override
- public List<TShopPaytypeConfig> getShopPaytypeConfigs(String shopaccno, String paytype) {
- List<TShopPaytypeConfig> result = new ArrayList<>(0);
+ public List<TShopSourceTypeConfig> getShopPaytypeConfigs(String shopaccno, String paytype) {
+ List<TShopSourceTypeConfig> result = new ArrayList<>(0);
if (!StringUtil.isEmpty(paytype)) {
- List<TPaytypeConfig> list = paytypeConfigDao.getByPaytypeOrderByConfigid(paytype.trim());
+ List<TSourceTypeConfig> list = sourceTypeConfigDao.getBySourceTypeOrderByConfigid(paytype.trim());
if (!StringUtil.isEmpty(list)) {
- for (TPaytypeConfig pt : list) {
- TShopPaytypeConfig spc = shopPaytypeConfigDao.getShopPaytypeConfigById(shopaccno, pt.getPaytype(), pt.getConfigid());
+ for (TSourceTypeConfig pt : list) {
+ TShopSourceTypeConfig spc = shopPaytypeConfigDao.getShopSourceTypeConfigById(shopaccno, pt.getSourceType(), pt.getConfigid());
if (null == spc) {
- spc = new TShopPaytypeConfig();
+ spc = new TShopSourceTypeConfig();
spc.setShopaccno(shopaccno);
- spc.setPaytype(pt.getPaytype());
+ spc.setSourceType(pt.getSourceType());
spc.setConfigid(pt.getConfigid());
spc.setConfigName(pt.getConfigName());
spc.setConfigValue(null);
@@ -245,22 +244,22 @@
@Override
public boolean saveOrUpdateShopPaytypeConfig(String shopaccno, String paytype, Map<String, String> param) throws WebCheckException {
- TShopPaytype shopPaytype = getShopPaytype(shopaccno, paytype);
+ TShopSourceType shopPaytype = getShopPaytype(shopaccno, paytype);
if (null == shopPaytype) {
throw new WebCheckException("此商户[" + shopaccno + "]还不具有该支付能力[" + paytype + "]");
}
for (String key : param.keySet()) {
String value = param.get(key);
- TShopPaytypeConfig spc = shopPaytypeConfigDao.getShopPaytypeConfigById(shopPaytype.getShopaccno(), shopPaytype.getPaytype(), key);
+ TShopSourceTypeConfig spc = shopPaytypeConfigDao.getShopSourceTypeConfigById(shopPaytype.getShopaccno(), shopPaytype.getSourceType(), key);
if (null != spc) {
spc.setConfigValue(StringUtil.isEmpty(value) ? null : value.trim());
} else {
- spc = new TShopPaytypeConfig();
+ spc = new TShopSourceTypeConfig();
spc.setShopaccno(shopPaytype.getShopaccno());
- spc.setPaytype(shopPaytype.getPaytype());
+ spc.setSourceType(shopPaytype.getSourceType());
spc.setConfigid(key);
spc.setConfigValue(StringUtil.isEmpty(value) ? null : value.trim());
- TPaytypeConfig paytypeConfig = paytypeConfigDao.getByPaytypeAndAndConfigid(shopPaytype.getPaytype(), key);
+ TSourceTypeConfig paytypeConfig = sourceTypeConfigDao.getBySourceTypeAndAndConfigid(shopPaytype.getSourceType(), key);
if (null != paytypeConfig) {
spc.setConfigName(paytypeConfig.getConfigName());
}
diff --git a/payapi/src/main/kotlin/com/supwisdom/dlpay/PayApiApplication.kt b/payapi/src/main/kotlin/com/supwisdom/dlpay/PayApiApplication.kt
index 8632b7f..b6f81aa 100644
--- a/payapi/src/main/kotlin/com/supwisdom/dlpay/PayApiApplication.kt
+++ b/payapi/src/main/kotlin/com/supwisdom/dlpay/PayApiApplication.kt
@@ -1,15 +1,16 @@
package com.supwisdom.dlpay
+import com.supwisdom.dlpay.framework.tenant.TenantCacheKeyGen
import io.lettuce.core.ReadFrom
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.autoconfigure.data.redis.RedisProperties
import org.springframework.boot.builder.SpringApplicationBuilder
-import org.springframework.boot.runApplication
import org.springframework.boot.web.servlet.ServletComponentScan
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
import org.springframework.cache.annotation.EnableCaching
+import org.springframework.cache.interceptor.KeyGenerator
import org.springframework.cloud.client.discovery.EnableDiscoveryClient
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
@@ -44,6 +45,11 @@
serverConfig.database = redis.database
return LettuceConnectionFactory(serverConfig, clientConfig)
}
+
+ @Bean("tenantCacheKey")
+ fun createTenantCacheableKey(): KeyGenerator {
+ return TenantCacheKeyGen()
+ }
}
@Configuration
diff --git a/payapi/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/consume_pay_service_impl.kt b/payapi/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/consume_pay_service_impl.kt
index f367feb..fe0df77 100644
--- a/payapi/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/consume_pay_service_impl.kt
+++ b/payapi/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/consume_pay_service_impl.kt
@@ -1,15 +1,14 @@
package com.supwisdom.dlpay.api.service.impl
import com.supwisdom.dlpay.api.dao.SourceTypeDao
-import com.supwisdom.dlpay.api.dao.ShopPaytypeConfigDao
-import com.supwisdom.dlpay.api.dao.ShopPaytypeDao
+import com.supwisdom.dlpay.api.dao.ShopSourceTypeConfigDao
+import com.supwisdom.dlpay.api.dao.ShopSourceTypeDao
import com.supwisdom.dlpay.api.dao.TransactionMainDao
import com.supwisdom.dlpay.api.domain.TTransactionMain
import com.supwisdom.dlpay.api.service.ConsumePayService
import com.supwisdom.dlpay.exception.TransactionProcessException
import com.supwisdom.dlpay.framework.util.StringUtil
import com.supwisdom.dlpay.framework.util.TradeErrorCode
-import com.supwisdom.dlpay.util.ConstantUtil
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
@@ -18,9 +17,9 @@
@Autowired
lateinit var sourceTypeDao: SourceTypeDao
@Autowired
- lateinit var shopPaytypeDao: ShopPaytypeDao
+ lateinit var shopSourceTypeDao: ShopSourceTypeDao
@Autowired
- lateinit var shopPaytypeConfigDao: ShopPaytypeConfigDao
+ lateinit var shopSourceTypeConfigDao: ShopSourceTypeConfigDao
@Autowired
lateinit var transactionMainDao: TransactionMainDao
@@ -37,7 +36,7 @@
}
}
}
- shopPaytypeDao.getById(sourceType, shopaccno).let {
+ shopSourceTypeDao.getById(sourceType, shopaccno).let {
if (null == it) {
throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "该商户[$shopaccno]未启用支付方式[$sourceType]")
} else {
@@ -68,7 +67,7 @@
}
}
- shopPaytypeDao.getById(paytype, shopaccno).let {
+ shopSourceTypeDao.getById(paytype, shopaccno).let {
if (null == it) {
throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "该商户[$shopaccno]未启用支付方式[$paytype]")
} else {
@@ -82,7 +81,7 @@
}
}
- shopPaytypeConfigDao.getShopPaytypeConfigs(paytype, shopaccno)?.let {
+ shopSourceTypeConfigDao.getShopSourceTypeConfigs(paytype, shopaccno)?.let {
if (it.size < 1) {
throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "该商户[$shopaccno]的支付方式[$paytype]未配置参数")
} else {
diff --git a/payapi/src/main/kotlin/com/supwisdom/dlpay/security.kt b/payapi/src/main/kotlin/com/supwisdom/dlpay/security.kt
index 4b81a02..2e747ae 100644
--- a/payapi/src/main/kotlin/com/supwisdom/dlpay/security.kt
+++ b/payapi/src/main/kotlin/com/supwisdom/dlpay/security.kt
@@ -48,7 +48,6 @@
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
import javax.sql.DataSource
-import kotlin.collections.ArrayList
@Component
diff --git a/payapi/src/main/resources/data.sql b/payapi/src/main/resources/data.sql
index fdec8f7..b3ea34b 100644
--- a/payapi/src/main/resources/data.sql
+++ b/payapi/src/main/resources/data.sql
@@ -36,7 +36,7 @@
INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid)
VALUES (17, NULL, 1, NULL, 'layui-icon-util', '/param/apiclientpara', '应用参数配置', 3, 10, '{tenantid}');
INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid)
-VALUES (18, NULL, 1, NULL, 'layui-icon-util', '/param/paytype', '支付能力配置', 4, 10, '{tenantid}');
+VALUES (18, NULL, 1, NULL, 'layui-icon-util', '/param/sourceType', '支付能力配置', 4, 10, '{tenantid}');
INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid)
VALUES (19, NULL, 0, NULL, 'layui-icon-user', '#', '用户中心', 5, -1, '{tenantid}');
INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid)
@@ -183,21 +183,21 @@
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
VALUES (40, '', 17, '新增', '/param/addapiclientpara', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (41, '', 18, '查询', '/param/paytype', '{tenantid}');
+VALUES (41, '', 18, '查询', '/param/sourceType', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
VALUES (42, '', 21, '查询', '/user/list', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (43, '', 18, '新增跳转', '/param/load4addpaytype', '{tenantid}');
+VALUES (43, '', 18, '新增跳转', '/param/load4addsourcetype', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (44, '', 18, '切换状态', '/param/updatepaytypestate', '{tenantid}');
+VALUES (44, '', 18, '切换状态', '/param/updatesourcetypestate', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (45, '', 18, '修改', '/param/updatepaytypename', '{tenantid}');
+VALUES (45, '', 18, '修改', '/param/updatesourcetypename', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (46, '', 18, '删除', '/param/deletepaytype', '{tenantid}');
+VALUES (46, '', 18, '删除', '/param/deletesourcetype', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (48, '', 18, '配置跳转', '/param/load4paytypeconfig', '{tenantid}');
+VALUES (48, '', 18, '配置跳转', '/param/load4sourcetypeconfig', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (49, '', 18, '配置参数', '/param/addpaytypeconfig', '{tenantid}');
+VALUES (49, '', 18, '配置参数', '/param/addsourcetypeconfig', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
VALUES (50, '', 22, '查询', '/user/account', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
@@ -221,17 +221,17 @@
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
VALUES (63, '', 25, '商户树', '/shop/config', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (64, '', 25, '查询', '/shop/shoppaytypelist', '{tenantid}');
+VALUES (64, '', 25, '查询', '/shop/shopsourcetypelist', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (65, '', 25, '切换状态', '/shop/updatepaytypestat', '{tenantid}');
+VALUES (65, '', 25, '切换状态', '/shop/updatesourcetypestat', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (66, '', 25, '新增跳转', '/shop/load4addpaytype', '{tenantid}');
+VALUES (66, '', 25, '新增跳转', '/shop/load4addsourcetype', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (67, '', 25, '新增', '/shop/addshoppaytype', '{tenantid}');
+VALUES (67, '', 25, '新增', '/shop/addshopsourcetype', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (68, '', 25, '配置跳转', '/shop/load4paytypepara', '{tenantid}');
+VALUES (68, '', 25, '配置跳转', '/shop/load4sourcetypepara', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (69, '', 25, '配置', '/shop/addpaytypepara', '{tenantid}');
+VALUES (69, '', 25, '配置', '/shop/addsourcetypepara', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
VALUES (70, '', 27, '查询', '/dtl/userdtl', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
@@ -243,7 +243,7 @@
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
VALUES (74, '', 31, '查询', '/report/shopbusiness', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
-VALUES (76, '', 18, '新增', '/param/addpaytype', '{tenantid}');
+VALUES (76, '', 18, '新增', '/param/addsourcetype', '{tenantid}');
INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", tenantid)
VALUES ('ff8080816b7947ed016b795577300036', 16, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
@@ -373,117 +373,123 @@
VALUES ('ff8080816bbb130c016bbb6ea2f600b3', 26, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('1001', 1, 'y', 1, NULL, 20190430, 1, '库存现金', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('1002', 1, 'y', 1, NULL, 20190430, 1, '银行存款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('1121', 1, 'n', 0, NULL, 20190430, 1, '应收票据', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112101', 1, 'n', 1, '1121', 20190430, 2, '支票', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112102', 1, 'n', 1, '1121', 20190430, 2, '经费本', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('1122', 1, 'y', 0, NULL, 20190430, 1, '应收账款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112201', 1, 'y', 1, '1122', 20190430, 2, '现金充值款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112209', 1, 'y', 1, '1122', 20190617, 2, '其他第三方充值款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112210', 1, 'y', 1, '1122', 20190430, 2, '支付宝充值款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112211', 1, 'y', 1, '1122', 20190430, 2, '微信充值款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112212', 1, 'n', 1, '1122', 20190430, 2, '银联充值款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112213', 1, 'y', 1, '1122', 20190430, 2, '一卡通充值款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112230', 1, 'y', 1, '1122', 20190430, 2, '支付宝支付款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112231', 1, 'y', 1, '1122', 20190430, 2, '微信支付款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112232', 1, 'n', 1, '1122', 20190430, 2, '银联支付款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112233', 1, 'y', 1, '1122', 20190430, 2, '一卡通支付款', 1, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('112234', 1, 'y', 1, '1122', NULL, 2, '市民卡支付款', 1, '{tenantid}');
--负债
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('2001', 2, 'n', 1, NULL, 20190430, 1, '用户押金', 2, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('2004', 2, 'y', 1, NULL, 20190430, 1, '商户营业款', 2, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('2202', 2, 'y', 0, NULL, 20190430, 1, '应付账款', 2, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('220201', 2, 'y', 1, '2202', 20190430, 2, '个人存款', 2, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('220211', 2, 'n', 1, '2202', 20190430, 2, '销户退款', 2, '{tenantid}');
--损益
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('6021', 2, 'y', 0, NULL, 20190430, 1, '手续费收入', 6, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('602101', 2, 'y', 1, '6021', 20190430, 2, '支付宝充值手续费', 6, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('602102', 2, 'y', 1, '6021', 20190430, 2, '微信充值手续费', 6, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('602103', 2, 'n', 1, '6021', 20190430, 2, '银联充值手续费', 6, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('6601', 2, 'y', 0, NULL, 20190430, 1, '销售费用', 6, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('660101', 2, 'y', 1, '6601', 20190430, 2, '折扣优惠款', 6, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('660102', 2, 'y', 1, '6601', 20190430, 2, '积分抵扣款', 6, '{tenantid}');
-INSERT INTO "tb_subject" ("subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
+INSERT INTO "tb_subject" ("subjid", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES ('6602', 2, 'y', 1, NULL, 20190430, 1, '管理费收入', 6, '{tenantid}');
-INSERT INTO "tb_sourcetype" ("sourcetype", "checkable", "paydesc", "enable", "charge_enable", "consume_enable", "anonymous_enable", "reversable", "tenantid")
-VALUES ('citizenCard', 't', '大理市民卡', 't', 'f', 't', 'f', 't', '{tenantid}');
-INSERT INTO "tb_sourcetype" ("sourcetype", "checkable", "paydesc", "enable", "charge_enable", "consume_enable", "anonymous_enable", "reversable", "tenantid")
-VALUES ('balance', 'f', '账户余额', 't', 'f', 't', 'f', 't', '{tenantid}');
-INSERT INTO "tb_sourcetype" ("sourcetype", "checkable", "paydesc", "enable", "charge_enable", "consume_enable", "anonymous_enable", "reversable", "tenantid")
-VALUES ('thirdpart', 'f', '其他第三方支付', 't', 't', 'f', 'f', 'f', '{tenantid}');
-INSERT INTO "tb_sourcetype" ("sourcetype", "checkable", "paydesc", "enable", "charge_enable", "consume_enable", "anonymous_enable", "reversable", "tenantid")
-VALUES ('yktpay', 't', '一卡通支付', 't', 't', 't', 't', 't', '{tenantid}');
-INSERT INTO "tb_sourcetype" ("sourcetype", "checkable", "paydesc", "enable", "charge_enable", "consume_enable", "anonymous_enable", "reversable", "tenantid")
-VALUES ('alipay', 't', '支付宝', 't', 't', 't', 't', 'f', '{tenantid}');
-INSERT INTO "tb_sourcetype" ("sourcetype", "checkable", "paydesc", "enable", "charge_enable", "consume_enable", "anonymous_enable", "reversable", "tenantid")
-VALUES ('wechat', 't', '微信支付', 't', 't', 't', 't', 'f', '{tenantid}');
+INSERT INTO "tb_sourcetype" ("sourcetype_id", "sourceType", "checkable", "paydesc", "enable", "charge_enable",
+"consume_enable", "anonymous_enable", "reversable", "tenantid")
+VALUES ('D3820D49DACA49199E36537F6719665F', 'citizenCard', 't', '大理市民卡', 't', 'f', 't', 'f', 't', '{tenantid}');
+INSERT INTO "tb_sourcetype" ("sourcetype_id", "sourceType", "checkable", "paydesc", "enable", "charge_enable",
+"consume_enable", "anonymous_enable", "reversable", "tenantid")
+VALUES ('0997477F40904AD1A2E37FD15345CE00', 'balance', 'f', '账户余额', 't', 'f', 't', 'f', 't', '{tenantid}');
+INSERT INTO "tb_sourcetype" ("sourcetype_id", "sourceType", "checkable", "paydesc", "enable", "charge_enable",
+"consume_enable", "anonymous_enable", "reversable", "tenantid")
+VALUES ('F0CA47ADC0F24DFCA0D95DF4136CC2D0', 'thirdpart', 'f', '其他第三方支付', 't', 't', 'f', 'f', 'f', '{tenantid}');
+INSERT INTO "tb_sourcetype" ("sourcetype_id", "sourceType", "checkable", "paydesc", "enable", "charge_enable",
+"consume_enable", "anonymous_enable", "reversable", "tenantid")
+VALUES ('F5B344726FA24BD896E70DEE3D3F46CA', 'yktpay', 't', '一卡通支付', 't', 't', 't', 't', 't', '{tenantid}');
+INSERT INTO "tb_sourcetype" ("sourcetype_id", "sourceType", "checkable", "paydesc", "enable", "charge_enable",
+"consume_enable", "anonymous_enable", "reversable", "tenantid")
+VALUES ('28EE54CD3B044CC197D6C5B0E309F8B8', 'alipay', 't', '支付宝', 't', 't', 't', 't', 'f', '{tenantid}');
+INSERT INTO "tb_sourcetype" ("sourcetype_id", "sourceType", "checkable", "paydesc", "enable", "charge_enable",
+"consume_enable", "anonymous_enable", "reversable", "tenantid")
+VALUES ('DAEF88B54B684347B2B83940C38C7671', 'wechat', 't', '微信支付', 't', 't', 't', 't', 'f', '{tenantid}');
-- 支付方式
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('yktpay','appid',null,'100005', 't', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('yktpay','appkey',null,'adc4ac6822fd462780f878b86cb94688', 't', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('yktpay','orderurl',null,'http://172.28.201.101:9116/epayapi/services/thirdparty/common/pay', 't', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('yktpay','reverseurl',null,'http://172.28.201.101:9116/epayapi/services/thirdparty/common/payreverse', 't', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('alipay', 'alipay.gateway', '支付宝网关地址', 'https://openapi.alipay.com/gateway.do', 't', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('alipay', 'enable.paymethod', '支付渠道', 'balance,moneyFund,debitCardExpress,bankPay,pcredit', 'f', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('alipay', 'notify.url', '异步通知地址', 'http://ykt.supwisdom.com:9116/epay/zfb/newnotify', 't', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('alipay', 'timeout.express', '支付超时时间', '5m', 't', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('alipay', 'alipay.public.key', '支付宝商户应用的支付宝公钥', NULL, 'f', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('alipay', 'alipay.rsa.private.key', '支付宝商户应用RSA私钥', NULL, 'f', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('alipay', 'alipay.rsa.public.key', '支付宝商户应用RSA公钥', NULL, 'f', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('alipay', 'appid', '支付宝应用APPID', NULL, 'f', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('citizenCard', 'socket.ip', 'socket的IP', NULL, 't', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('citizenCard', 'socket.port', 'socket的端口', NULL, 't', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('citizenCard', 'bankcardno', '商户银行卡号', NULL, 'f', '{tenantid}');
-INSERT INTO TB_PAYTYPE_CONFIG (PAYTYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
-VALUES ('citizenCard', 'bankaccname', '银行开户名', NULL, 'f', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('1', 'yktpay','appid','模板','100005', 't', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('2', 'yktpay','appkey','模板','adc4ac6822fd462780f878b86cb94688', 't', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('3', 'yktpay','orderurl','模板','http://172.28.201.101:9116/epayapi/services/thirdparty/common/pay', 't', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('4', 'yktpay','reverseurl','模板','http://172.28.201.101:9116/epayapi/services/thirdparty/common/payreverse', 't', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('5', 'alipay', 'alipay.gateway', '支付宝网关地址', 'https://openapi.alipay.com/gateway.do', 't', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('6', 'alipay', 'enable.paymethod', '支付渠道', 'balance,moneyFund,debitCardExpress,bankPay,pcredit', 'f', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('7', 'alipay', 'notify.url', '异步通知地址', 'http://ykt.supwisdom.com:9116/epay/zfb/newnotify', 't', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('8', 'alipay', 'timeout.express', '支付超时时间', '5m', 't', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('9', 'alipay', 'alipay.public.key', '支付宝商户应用的支付宝公钥', NULL, 'f', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('10', 'alipay', 'alipay.rsa.private.key', '支付宝商户应用RSA私钥', NULL, 'f', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('11', 'alipay', 'alipay.rsa.public.key', '支付宝商户应用RSA公钥', NULL, 'f', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('12', 'alipay', 'appid', '支付宝应用APPID', NULL, 'f', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('13', 'citizenCard', 'socket.ip', 'socket的IP', NULL, 't', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('14', 'citizenCard', 'socket.port', 'socket的端口', NULL, 't', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('15', 'citizenCard', 'bankcardno', '商户银行卡号', NULL, 'f', '{tenantid}');
+INSERT INTO TB_SOURCETYPE_CONFIG (ID, SOURCETYPE,CONFIGID,CONFIG_NAME,CONFIG_VALUE,GLOBALFLAG, "tenantid")
+VALUES ('16', 'citizenCard', 'bankaccname', '银行开户名', NULL, 'f', '{tenantid}');
INSERT INTO "tb_syspara" ("paraid", "displayflag", "editflag", "lastsaved", "paraname", "paraunit", "paraval", "remark", "valuetype", "tenantid")
VALUES (1, 'yes', 1, '20190514165658', '账户最大余额默认值', '元', '10001', '账户开户时的默认账户最大余额', 'amount', '{tenantid}');
diff --git a/payapi/src/main/resources/templates/system/dtl/shopdtl.html b/payapi/src/main/resources/templates/system/dtl/shopdtl.html
index a83361b..ecebe4e 100644
--- a/payapi/src/main/resources/templates/system/dtl/shopdtl.html
+++ b/payapi/src/main/resources/templates/system/dtl/shopdtl.html
@@ -27,7 +27,7 @@
<div class="layui-inline">
<label class="layui-form-label">支付方式</label>
<div class="layui-input-block" style="height: 38px;">
- <select name="sourcetype" id="shopdtl-search-sourcetype" class="layui-select">
+ <select name="sourceType" id="shopdtl-search-sourceType" class="layui-select">
<option value=""> 全部</option>
<option th:each="pt:${paytypelist}" th:value="${pt.sourceType}"
th:text="${pt.paydesc}"></option>
@@ -184,7 +184,7 @@
endTransdate: $("#shopdtl-search-endTransdate").val(),
personname: $("#shopdtl-search-personname").val(),
shopaccno: $("#shopdtl-search-shopaccno").val(),
- sourcetype: $("#shopdtl-search-sourcetype").val(),
+ sourceType: $("#shopdtl-search-sourceType").val(),
tradeflag: $("#shopdtl-search-tradeflag").val(),
transcode: $("#shopdtl-search-transcode").val(),
transStatus: $("#shopdtl-search-transStatus").val()
@@ -200,7 +200,7 @@
"endTransdate": "",
"shopname": "",
"shopaccno": "",
- "sourcetype": "",
+ "sourceType": "",
"tradeflag": "",
"transcode": "",
"transStatus": ""
diff --git a/payapi/src/main/resources/templates/system/dtl/userdtl.html b/payapi/src/main/resources/templates/system/dtl/userdtl.html
index ead6ab2..85c7665 100644
--- a/payapi/src/main/resources/templates/system/dtl/userdtl.html
+++ b/payapi/src/main/resources/templates/system/dtl/userdtl.html
@@ -35,7 +35,7 @@
<div class="layui-inline">
<label class="layui-form-label">支付方式</label>
<div class="layui-input-block" style="height: 38px;">
- <select name="sourcetype" id="userdtl-search-sourcetype" class="layui-select">
+ <select name="sourceType" id="userdtl-search-sourceType" class="layui-select">
<option value=""> 全部</option>
<option th:each="pt:${paytypelist}" th:value="${pt.sourceType}"
th:text="${pt.paydesc}"></option>
@@ -148,7 +148,7 @@
endTransdate: $("#userdtl-search-endTransdate").val(),
personname: $("#userdtl-search-personname").val(),
cardno: $("#userdtl-search-cardno").val(),
- sourcetype: $("#userdtl-search-sourcetype").val(),
+ sourceType: $("#userdtl-search-sourceType").val(),
tradeflag: $("#userdtl-search-tradeflag").val(),
transcode: $("#userdtl-search-transcode").val(),
transStatus: $("#userdtl-search-transStatus").val()
@@ -164,7 +164,7 @@
"endTransdate": "",
"personname": "",
"cardno": "",
- "sourcetype": "",
+ "sourceType": "",
"tradeflag": "",
"transcode": "",
"transStatus": ""
diff --git a/payapi/src/main/resources/templates/system/param/paytype.html b/payapi/src/main/resources/templates/system/param/sourcetype.html
similarity index 86%
rename from payapi/src/main/resources/templates/system/param/paytype.html
rename to payapi/src/main/resources/templates/system/param/sourcetype.html
index 8c5d102..a288eea 100644
--- a/payapi/src/main/resources/templates/system/param/paytype.html
+++ b/payapi/src/main/resources/templates/system/param/sourcetype.html
@@ -18,7 +18,7 @@
<button id="btn-reset-param" class="layui-btn layui-btn-primary" data-type="reset"><i class="layui-icon"></i>清 空
</button>
</div>
- <table class="layui-table" id="paytypeTable" lay-filter="paytypeTable-filter"></table>
+ <table class="layui-table" id="sourcetypeTable" lay-filter="sourcetypeTable-filter"></table>
</div>
</div>
@@ -86,8 +86,8 @@
var admin = layui.admin;
// 渲染表格
table.render({
- elem: '#paytypeTable',
- url: '[[@{/param/paytypelist}]]',
+ elem: '#sourcetypeTable',
+ url: '[[@{/param/sourcetypelist}]]',
page: true,
cols: [
[
@@ -131,7 +131,7 @@
},
{
align: 'center', title: '操作', width: 150, fixed: 'right', templet: function (item) {
- if (item.sourceType != '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 '';
@@ -143,15 +143,15 @@
// 搜索按钮点击事件
$('#btn-search-param').click(function () {
var sourceType = $("#search-global-sourceType").val();
- table.reload('paytypeTable', {where: {paytype: sourceType}, page: {curr: 1}});
+ table.reload('sourcetypeTable', {where: {sourceType: sourceType}, page: {curr: 1}});
});
$('#btn-add-param').click(function () {
admin.popupCenter({
title: "新增支付能力",
- path: '[[@{/param/load4addpaytype}]]',
+ path: '[[@{/param/load4addsourcetype}]]',
finish: function () {
- table.reload('paytypeTable');
+ table.reload('sourcetypeTable');
}
});
});
@@ -163,19 +163,18 @@
// 修改总状态
form.on('switch(enable-tpl-state)', function (obj) {
var token = $("meta[name='_csrf_token']").attr("value");
- admin.go('[[@{/param/updatepaytypestate}]]', {
- paytype: obj.elem.value,
+ admin.go('[[@{/param/updatesourcetypestate}]]', {
+ sourceType: obj.elem.value,
state: obj.elem.checked,
_csrf: token
}, function (data) {
- if (data.code == 200) {
+ if (data.code === 200) {
layer.msg(data.msg, {icon: 1, time:1000});
- table.reload('paytypeTable');
- } else if (data.code == 401) {
+ table.reload('sourcetypeTable');
+ } else if (data.code === 401) {
layer.msg(data.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
- return;
} else {
layer.msg(data.msg, {icon: 2});
$(obj.elem).prop('checked', !obj.elem.checked);
@@ -215,19 +214,18 @@
function updatePaytypeState(obj, optype, token) {
- admin.go('[[@{/param/updatepaytypestate}]]', {
- paytype: obj.elem.value,
+ admin.go('[[@{/param/updatesourcetypestate}]]', {
+ sourceType: obj.elem.value,
state: obj.elem.checked,
optype: optype,
_csrf: token
}, function (data) {
- if (data.code == 200) {
+ if (data.code === 200) {
layer.msg(data.msg, {icon: 1, time: 1000});
- } else if (data.code == 401) {
+ } else if (data.code === 401) {
layer.msg(data.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
- return;
} else {
layer.msg(data.msg, {icon: 2});
$(obj.elem).prop('checked', !obj.elem.checked);
@@ -240,46 +238,45 @@
});
}
- table.on('edit(paytypeTable-filter)', function (obj) {
+ table.on('edit(sourcetypeTable-filter)', function (obj) {
var row = obj.data; //得到所在行所有键值
var newval = obj.value; //得到修改后的值
- admin.go('[[@{/param/updatepaytypename}]]', {
- paytype: row.sourceType,
+ admin.go('[[@{/param/updatesourcetypename}]]', {
+ sourceType: row.sourceType,
paydesc: newval,
- _csrf: $("meta[name='_csrf_token']").attr("value"),
+ _csrf: $("meta[name='_csrf_token']").attr("value")
}, function (data) {
- if (data.code == 200) {
+ if (data.code === 200) {
layer.msg("修改成功", {icon: 1, time: 1000});
- } else if (data.code == 401) {
+ } else if (data.code === 401) {
layer.msg(data.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
- return;
} else {
layer.msg(data.msg, {icon: 2});
- table.reload('paytypeTable');
+ table.reload('sourcetypeTable');
}
},function () {
layer.msg('修改失败了,请稍后再试', {icon: 2});
- table.reload('paytypeTable');
+ table.reload('sourcetypeTable');
});
})
//监听单元格
- table.on('tool(paytypeTable-filter)', function (obj) {
+ table.on('tool(sourcetypeTable-filter)', function (obj) {
var data = obj.data;
- if('del' == obj.event){
+ if('del' === obj.event){
if (confirm("确定要删除支付方式[" + data.sourceType + "_" + data.paydesc + "]吗?")) {
layer.load(2);
- admin.go('[[@{/param/deletepaytype}]]', {
- paytype: data.sourceType,
+ admin.go('[[@{/param/deletesourcetype}]]', {
+ sourceType: data.sourceType,
_csrf: $("meta[name='_csrf_token']").attr("value")
}, function (data) {
console.log(data.code);
layer.closeAll('loading');
- if (data.code == 200) {
+ if (data.code === 200) {
layer.msg(data.msg, {icon: 1, time: 1000});
- } else if (data.code == 401) {
+ } else if (data.code === 401) {
layer.msg(data.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
@@ -287,20 +284,20 @@
} else {
layer.msg(data.msg, {icon: 2});
}
- table.reload('paytypeTable');
+ table.reload('sourcetypeTable');
}, function (ret) {
console.log(ret);
layer.closeAll('loading');
layer.msg('请求失败了,请稍后再试', {icon: 2});
});
}
- }else if('config' ==obj.event){
+ }else if('config' ===obj.event){
admin.popupCenter({
title: "配置参数【" + data.sourceType + "_" + data.paydesc + "】",
- path: '[[@{/param/load4paytypeconfig}]]?paytype='+data.sourceType,
+ path: '[[@{/param/load4sourcetypeconfig}]]?sourceType='+data.sourceType,
area: '800px',
finish: function () {
- table.reload('paytypeTable');
+ table.reload('sourcetypeTable');
}
});
}
diff --git a/payapi/src/main/resources/templates/system/param/paytypeconfig.html b/payapi/src/main/resources/templates/system/param/sourcetypeconfig.html
similarity index 85%
rename from payapi/src/main/resources/templates/system/param/paytypeconfig.html
rename to payapi/src/main/resources/templates/system/param/sourcetypeconfig.html
index ad6c9cf..502a3be 100644
--- a/payapi/src/main/resources/templates/system/param/paytypeconfig.html
+++ b/payapi/src/main/resources/templates/system/param/sourcetypeconfig.html
@@ -1,6 +1,6 @@
<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_sourcetype" th:value="${sourceType}"/>
</div>
<div class="layui-form-item" style="text-align: center;" th:if="${configlist.size()} le 0">
@@ -32,35 +32,34 @@
form.on('submit(form-submit)', function (data) {
layer.load(2);
var vdata = data.field;
- if(JSON.stringify(vdata)=="{}"){
+ if(JSON.stringify(vdata)==="{}"){
layer.closeAll('loading');
admin.closePopupCenter();
return; //无配置项,直接关闭
}
var token=$("meta[name='_csrf_token']").attr("value");
- vdata["hid_paytype"] = $("#hid_paytype").val();
- console.log('addpaytype:',vdata);
+ vdata["hid_sourcetype"] = $("#hid_sourcetype").val();
+ console.log('addsourcetype:',vdata);
debugger
$.ajax({
type : "POST",
dataType : "json",
- url : '[[@{/param/addpaytypeconfig}]]',
+ url : '[[@{/param/addsourcetypeconfig}]]',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
- 'X-CSRF-TOKEN':token,
+ 'X-CSRF-TOKEN':token
},
data : JSON.stringify(vdata),
success : function(result) {
layer.closeAll('loading');
- if (result.code == 200) {
+ if (result.code === 200) {
layer.msg(result.msg, {icon: 1});
admin.finishPopupCenter();
- } else if (result.code == 401) {
+ } else if (result.code === 401) {
layer.msg(result.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
- return;
} else {
console.log('err:' + result.code);
layer.msg(result.msg, {icon: 2});
diff --git a/payapi/src/main/resources/templates/system/param/paytypeform.html b/payapi/src/main/resources/templates/system/param/sourcetypeform.html
similarity index 75%
rename from payapi/src/main/resources/templates/system/param/paytypeform.html
rename to payapi/src/main/resources/templates/system/param/sourcetypeform.html
index 1ec0c3d..f3650db 100644
--- a/payapi/src/main/resources/templates/system/param/paytypeform.html
+++ b/payapi/src/main/resources/templates/system/param/sourcetypeform.html
@@ -2,7 +2,7 @@
<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"
+ <input name="sourceType" placeholder="请输入支付方式代码" type="text" class="layui-input" maxlength="20"
lay-verify="required|sourceType" required/>
</div>
</div>
@@ -16,48 +16,54 @@
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
- <input name="enable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes" lay-verify="required" checked/>
+ <input name="enable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes"
+ lay-verify="required" checked/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">能否充值</label>
<div class="layui-input-block">
- <input name="chargeEnable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes" lay-verify="required" checked/>
+ <input name="chargeEnable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes"
+ lay-verify="required" checked/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">能否消费</label>
<div class="layui-input-block">
- <input name="consumeEnable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes" lay-verify="required" checked/>
+ <input name="consumeEnable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes"
+ lay-verify="required" checked/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">匿名消费</label>
<div class="layui-input-block">
- <input name="anonymousEnable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes" lay-verify="required" checked/>
+ <input name="anonymousEnable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes"
+ lay-verify="required" checked/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">能否冲正</label>
<div class="layui-input-block">
- <input name="reversable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes" lay-verify="required" checked/>
+ <input name="reversable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes"
+ lay-verify="required" checked/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否清算</label>
<div class="layui-input-block">
- <input name="checkable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes" lay-verify="required" checked/>
+ <input name="checkable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes"
+ lay-verify="required" checked/>
</div>
</div>
<div class="layui-form-item model-form-footer">
<button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
- <button class="layui-btn" lay-filter="form-submit" lay-submit id="submitbtn">保存</button>
+ <button class="layui-btn" lay-filter="form-submit" lay-submit id="submitbtn">保存</button>
</div>
</form>
@@ -73,13 +79,13 @@
var msg = "";
$.ajax({
type: "GET",
- url: '[[@{/param/checkpaytype}]]',
+ url: '[[@{/param/checksourcetype}]]',
async: false,
data: {
- paytype: e
+ sourceType: e
},
success: function (result) {
- if (result.code != 200) {
+ if (result.code !== 200) {
msg = result.msg;
}
},
@@ -87,7 +93,7 @@
msg = "请求服务器校验支付方式失败";
}
});
- if (msg != "") {
+ if (msg !== "") {
return msg;
}
}
@@ -99,26 +105,25 @@
var vdata = data.field;
vdata["_csrf"] = $("meta[name='_csrf_token']").attr("value");
$.ajax({
- type : "POST",
- dataType : "json",
- url : '[[@{/param/addpaytype}]]',
- data : vdata,
- success : function(result) {
+ type: "POST",
+ dataType: "json",
+ url: '[[@{/param/addsourcetype}]]',
+ data: vdata,
+ success: function (result) {
layer.closeAll('loading');
- if (result.code == 200) {
+ if (result.code === 200) {
layer.msg(result.msg, {icon: 1});
admin.finishPopupCenter();
- } else if (result.code == 401) {
+ } else if (result.code === 401) {
layer.msg(result.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
- return;
} else {
console.log('err:' + result.code);
layer.msg(result.msg, {icon: 2});
}
},
- error : function(err){
+ error: function (err) {
admin.errorBack(err);
}
});
diff --git a/payapi/src/main/resources/templates/system/report/subjectday.html b/payapi/src/main/resources/templates/system/report/subjectday.html
index 41cdf17..bcff987 100644
--- a/payapi/src/main/resources/templates/system/report/subjectday.html
+++ b/payapi/src/main/resources/templates/system/report/subjectday.html
@@ -78,7 +78,7 @@
title: '科目汇总表',
treeColIndex: 0,
treeSpid: '-1',
- treeIdName: 'subjno',
+ treeIdName: 'subjid',
treePidName: 'fsubjno',
treeDefaultClose: false,
treeLinkage: false,
@@ -90,7 +90,7 @@
toolbar:'#subjectday-toolbar',
cols: [
[
- {field: 'subjno', title: '科目号', align: 'left', rowspan: 2},
+ {field: 'subjid', title: '科目号', align: 'left', rowspan: 2},
{
field: 'subjname', title: '科目名称', align: 'left', rowspan: 2, templet: function (d) {
if (d.subjlevel == 1) {
@@ -115,7 +115,7 @@
],
// cols: [
// [
- // {field: 'subjno', title: '科目号', align: 'left'},
+ // {field: 'subjid', title: '科目号', align: 'left'},
// {
// field: 'subjname', title: '科目名称', align: 'left', templet: function (d) {
// if (d.subjlevel == 1) {
diff --git a/payapi/src/main/resources/templates/system/report/subjectdetail.html b/payapi/src/main/resources/templates/system/report/subjectdetail.html
index 7776301..b8956f2 100644
--- a/payapi/src/main/resources/templates/system/report/subjectdetail.html
+++ b/payapi/src/main/resources/templates/system/report/subjectdetail.html
@@ -26,7 +26,7 @@
<div class="layui-inline">
<label class="layui-form-label">选择科目</label>
<div class="layui-input-block">
- <input type="text" name="subjno" id="subjectdetail-search-subjno" placeholder="选择科目" lay-filter="subjectdetail-search-subjno-filter"
+ <input type="text" name="subjid" id="subjectdetail-search-subjid" placeholder="选择科目" lay-filter="subjectdetail-search-subjid-filter"
autocomplete="off" class="layui-input"/>
</div>
</div>
@@ -70,7 +70,7 @@
});
treeSelect.render({
- elem: '#subjectdetail-search-subjno',
+ elem: '#subjectdetail-search-subjid',
data: '[[@{/report/subjectselecttree}]]',
type: 'get',
placeholder: '选择科目',
@@ -89,8 +89,8 @@
console.log(treeNode);
if(treeNode.accno == '0'){
layer.msg("请选择末级科目", {icon: 2, time:1500});
- $("#subjectdetail-search-subjno").val("");
- treeSelect.revokeNode('subjectdetail-search-subjno-filter');
+ $("#subjectdetail-search-subjid").val("");
+ treeSelect.revokeNode('subjectdetail-search-subjid-filter');
return false;
}
return true;
@@ -139,14 +139,14 @@
renderTable({
startdate: $('#subjectdetail-search-startdate').val(),
enddate: $('#subjectdetail-search-enddate').val(),
- subjno: null
+ subjid: null
})
$('#subjectdetail-search-btn').click(function () {
var startdate = $("#subjectdetail-search-startdate").val();
var enddate = $("#subjectdetail-search-enddate").val();
- var subjno = $("#subjectdetail-search-subjno").val();
+ var subjid = $("#subjectdetail-search-subjid").val();
if (null == startdate || "" == $.trim(startdate)) {
layer.msg('请选择起始日期', {icon: 2, time: 1500});
return;
@@ -155,7 +155,7 @@
layer.msg('请选择截止日期', {icon: 2, time: 1500});
return;
}
- if (null == subjno || "" == $.trim(subjno)) {
+ if (null == subjid || "" == $.trim(subjid)) {
layer.msg('请选择科目', {icon: 2, time: 1500});
return;
}
@@ -163,7 +163,7 @@
renderTable({
startdate: startdate,
enddate: enddate,
- subjno: subjno
+ subjid: subjid
})
});
diff --git a/payapi/src/main/resources/templates/system/shop/config.html b/payapi/src/main/resources/templates/system/shop/config.html
index 56400e7..b8acc1d 100644
--- a/payapi/src/main/resources/templates/system/shop/config.html
+++ b/payapi/src/main/resources/templates/system/shop/config.html
@@ -28,12 +28,12 @@
<option th:each="pt:${paytypelist}" th:value="${pt.sourceType}"
th:text="${pt.paydesc}"></option>
</select> 
- <button id="btn-search-shoppaytype" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ <button id="btn-search-shopsourcetype" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
</button>
- <button id="btn-add-shoppaytype" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>新
+ <button id="btn-add-shopsourcetype" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>新
增
</button>
- <button id="btn-reset-shoppaytype" class="layui-btn layui-btn-primary" data-type="reset"><i
+ <button id="btn-reset-shopsourcetype" class="layui-btn layui-btn-primary" data-type="reset"><i
class="layui-icon"></i>清 空
</button>
</div>
@@ -47,22 +47,22 @@
<!-- 表格状态列 -->
<script type="text/html" id="shop-consumeenable-tpl-state">
- <input type="checkbox" lay-filter="shop-consumeenable-tpl-state" value="{{d.shopaccno}}" def-sourceType="{{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==true?'checked':''}}/>
</script>
<script type="text/html" id="shop-anonymousenable-tpl-state">
{{# if(d.consumeEnable == true ){ }}
- <input type="checkbox" lay-filter="shop-anonymousenable-tpl-state" value="{{d.shopaccno}}" def-sourceType="{{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==true && d.anonymousEnable==true)?'checked':''}}/>
{{# }else{ }}
- <input type="checkbox" lay-filter="shop-anonymousenable-tpl-state" value="{{d.shopaccno}}" def-sourceType="{{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==true && d.anonymousEnable==true)?'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-sourceType="{{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==true?'checked':''}}/>
</script>
@@ -106,13 +106,13 @@
layer.msg('查询商户树失败了,请稍后再试', {icon: 2});
});
- $('#btn-reset-shoppaytype').click(function () {
+ $('#btn-reset-shopsourcetype').click(function () {
$("#search-sourceType").val("");
form.render('select');
});
- $('#btn-search-shoppaytype').click(function(){
+ $('#btn-search-shopsourcetype').click(function(){
var ptype = $("#search-sourceType").val();
- table.reload('shopPaytypeTable', {where: {paytype: ptype, shopaccno:""}, page: {curr: 1}});
+ table.reload('shopPaytypeTable', {where: {sourceType: ptype, shopaccno:""}, page: {curr: 1}});
});
function ondblclick(event, treeId, treeNode) {
@@ -121,13 +121,13 @@
return;
}
var ptype = $("#search-sourceType").val();
- table.reload('shopPaytypeTable', {where: {paytype: ptype, shopaccno: treeNode.shopaccno}, page: {curr: 1}});
+ table.reload('shopPaytypeTable', {where: {sourceType: ptype, shopaccno: treeNode.shopaccno}, page: {curr: 1}});
}
// 渲染表格
table.render({
elem: '#shopPaytypeTable',
- url: '[[@{/shop/shoppaytypelist}]]',
+ url: '[[@{/shop/shopsourcetypelist}]]',
page: true,
width: 1010,
cols: [
@@ -160,7 +160,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>';
@@ -173,9 +173,9 @@
// 修改总状态
form.on('switch(shop-consumeenable-tpl-state)', function (obj) {
var token = $("meta[name='_csrf_token']").attr("value");
- admin.go('[[@{/shop/updatepaytypestat}]]', {
+ admin.go('[[@{/shop/updatesourcetypestat}]]', {
shopaccno: obj.elem.value,
- paytype: $(obj.elem).attr("def-sourceType"),
+ sourceType: $(obj.elem).attr("def-sourceType"),
optype: "consume",
state: obj.elem.checked ? 'yes' : 'no',
_csrf: token
@@ -210,9 +210,9 @@
});
function updateShopPaytypeState(obj, optype, token) {
- admin.go('[[@{/shop/updatepaytypestat}]]', {
+ admin.go('[[@{/shop/updatesourcetypestat}]]', {
shopaccno: obj.elem.value,
- paytype: $(obj.elem).attr("def-sourceType"),
+ sourceType: $(obj.elem).attr("def-sourceType"),
state: obj.elem.checked ? 'yes' : 'no',
optype: optype,
_csrf: token
@@ -235,7 +235,7 @@
});
}
- $('#btn-add-shoppaytype').click(function () {
+ $('#btn-add-shopsourcetype').click(function () {
var ztree = $.fn.zTree.getZTreeObj("shopacctree");
var shopNodes = ztree.getSelectedNodes();
if (undefined === shopNodes || null == shopNodes || shopNodes.length < 1) {
@@ -247,16 +247,16 @@
layer.msg("请选择结算商户!", {icon: 2, time: 1000});
return;
}
- admin.putTempData('t_addshoppaytype', {
+ admin.putTempData('t_addshopsourcetype', {
shopaccno:shopNode.shopaccno,
shopname: shopNode.name.slice(shopNode.id.length+1) //23_第一食堂,截取商户名称
});
admin.popupCenter({
title: "新增支付能力",
- path: '[[@{/shop/load4addpaytype}]]',
+ path: '[[@{/shop/load4addsourcetype}]]',
finish: function () {
table.reload('shopPaytypeTable', {
- where: {paytype: "", shopaccno: shopNode.shopaccno},
+ where: {sourceType: "", shopaccno: shopNode.shopaccno},
page: {curr: 1}
});
}
@@ -269,7 +269,7 @@
if ('config' === obj.event) {
admin.popupCenter({
title: "配置参数【" + data.shopname + "_" + data.paydesc + "】",
- path: '[[@{/shop/load4paytypepara}]]?shopaccno=' + data.shopaccno + '&paytype=' + data.paytype,
+ path: '[[@{/shop/load4sourcetypepara}]]?shopaccno=' + data.shopaccno + '&sourceType=' + data.sourceType,
area: '800px',
finish: function () {
table.reload('shopPaytypeTable');
diff --git a/payapi/src/main/resources/templates/system/shop/configform.html b/payapi/src/main/resources/templates/system/shop/configform.html
index e0bd620..0532b6a 100644
--- a/payapi/src/main/resources/templates/system/shop/configform.html
+++ b/payapi/src/main/resources/templates/system/shop/configform.html
@@ -14,7 +14,7 @@
<div class="layui-form-item">
<label class="layui-form-label">支付方式</label>
<div class="layui-input-block">
- <select name="paytype" lay-verify="required">
+ <select name="sourceType" lay-verify="required">
<option th:each="pt:${paytypelist}" th:value="${pt.sourceType}"
th:text="${pt.paydesc}"></option>
</select> 
@@ -57,7 +57,7 @@
form.render('checkbox');
form.render('select');
// 回显数据
- var shop = admin.getTempData('t_addshoppaytype');
+ var shop = admin.getTempData('t_addshopsourcetype');
if (shop) {
form.val('shop-sourceType-form', {
shopaccno: shop.shopaccno,
@@ -73,18 +73,17 @@
$.ajax({
type : "POST",
dataType : "json",
- url : '[[@{/shop/addshoppaytype}]]',
+ url : '[[@{/shop/addshopsourcetype}]]',
data : vdata,
success : function(result) {
layer.closeAll('loading');
- if (result.code == 200) {
+ if (result.code === 200) {
layer.msg(result.msg, {icon: 1});
admin.finishPopupCenter();
- } else if (result.code == 401) {
+ } else if (result.code === 401) {
layer.msg(result.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
- return;
} else {
console.log('err:', result);
layer.msg(result.msg, {icon: 2});
diff --git a/payapi/src/main/resources/templates/system/shop/configpara.html b/payapi/src/main/resources/templates/system/shop/configpara.html
index 6e77151..dcaeb05 100644
--- a/payapi/src/main/resources/templates/system/shop/configpara.html
+++ b/payapi/src/main/resources/templates/system/shop/configpara.html
@@ -1,7 +1,8 @@
-<form id="shop-sourceType-config-form" lay-filter="shop-sourceType-config-form" class="layui-form model-form">
+<form id="shop-sourceType-config-form" lay-filter="shop-sourceType-config-form" class="layui-form model-form"
+ xmlns:th="http://www.w3.org/1999/xhtml">
<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_sourcetype" th:value="${sourcetype}"/>
</div>
<div class="layui-form-item" style="text-align: center;" th:if="${configlist.size()} le 0">
@@ -33,36 +34,35 @@
form.on('submit(form-submit)', function (data) {
layer.load(2);
var vdata = data.field;
- if(JSON.stringify(vdata)=="{}"){
+ if(JSON.stringify(vdata)==="{}"){
layer.closeAll('loading');
admin.closePopupCenter();
return; //无配置项,直接关闭
}
var token = $("meta[name='_csrf_token']").attr("value");
- vdata["hid_paytype"] = $("#hid_paytype").val();
+ vdata["hid_sourcetype"] = $("#hid_sourcetype").val();
vdata["hid_shopaccno"] = $("#hid_shopaccno").val();
console.log('addShopPaytype:', vdata);
debugger
$.ajax({
type : "POST",
dataType : "json",
- url : '[[@{/shop/addpaytypepara}]]',
+ url : '[[@{/shop/addsourcetypepara}]]',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
- 'X-CSRF-TOKEN':token,
+ 'X-CSRF-TOKEN':token
},
data : JSON.stringify(vdata),
success : function(result) {
layer.closeAll('loading');
- if (result.code == 200) {
+ if (result.code === 200) {
layer.msg(result.msg, {icon: 1});
admin.finishPopupCenter();
- } else if (result.code == 401) {
+ } else if (result.code === 401) {
layer.msg(result.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
- return;
} else {
console.log('err:' + result.code);
layer.msg(result.msg, {icon: 2});