From: Tang Cheng Date: Thu, 11 Jul 2019 08:04:58 +0000 (+0800) Subject: refactor: 将 paytype 改为 sourcetype X-Git-Tag: 1.0.0^2~67 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=e743634d5d6f807403a623a2bcb15d82b2af1155;p=epayment%2Ffood_payapi.git refactor: 将 paytype 改为 sourcetype --- diff --git a/payapi/build.gradle b/payapi/build.gradle index e62b4712..eb51a3c2 100644 --- a/payapi/build.gradle +++ b/payapi/build.gradle @@ -57,6 +57,7 @@ dependencies { implementation 'org.jetbrains.kotlin:kotlin-reflect' implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' implementation 'commons-codec:commons-codec:1.12' + implementation 'org.apache.commons:commons-lang3:3.9' implementation 'org.springframework.cloud:spring-cloud-starter-consul-discovery:2.1.2.RELEASE' 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 50cf1e18..00000000 --- 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 { - List getByPaytype(String paytype); - - TPaytypeConfig getByPaytypeAndAndConfigid(String paytype, String configid); - - List 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 a7164c84..00000000 --- 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 { - @Query("select a from TShopPaytypeConfig a where a.paytype=?1 and a.shopaccno=?2 ") - List 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 03196e1e..00000000 --- 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, JpaSpecificationExecutor { - @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 00000000..e861165a --- /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 { + @Query("select a from TShopSourceTypeConfig a where a.sourceType=?1 and a.shopaccno=?2 ") + List 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 00000000..8099292b --- /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, JpaSpecificationExecutor { + @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 00000000..9caf30de --- /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 { + + List getBySourceType(String sourceType); + + TSourceTypeConfig getBySourceTypeAndAndConfigid(String sourceType, String configid); + + List 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 4a239dd1..00000000 --- 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 8f7e46f0..00000000 --- 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 4196b558..00000000 --- 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 0310592a..f28f307b 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 { +@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 = "SHOPACCNO", nullable = false, length = 10) + @GenericGenerator(name = "idGenerator", strategy = "uuid") + @GeneratedValue(generator = "idGenerator") + @Column(name = "id") + private String id; + + @Column(name = "SHOPACCNO", length = 10) + @NotNull private String shopaccno; - @Id - @Column(name = "PAYTYPE", nullable = false, length = 20) - private String paytype; + @Column(name = "SOURCETYPE", length = 20) + @NotNull + private String sourceType; @Column(name = "CONSUME_ENABLE", length = 10) @NotNull @@ -42,12 +54,12 @@ public class TShopPaytype { 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 class TShopPaytype { 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 a86da1ce..981b0d1a 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 org.hibernate.annotations.GenericGenerator; 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 @@ public class TShopPaytypeConfig { @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 @@ public class TShopPaytypeConfig { @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 @@ public class TShopPaytypeConfig { 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 1748dc5b..1a27f325 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 @@ import java.io.Serializable; * 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 class TSourceType implements DictionaryTable, Serializable { 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 00000000..df7ec883 --- /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 60cf1a57..c2c7f215 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 @@ import java.util.Map; * 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 getPaytypeConfigByPaytype(String pattype) { - List list = paytypeConfigDao.getByPaytype(pattype); + List list = paytypeConfigDao.getBySourceType(pattype); Map 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 6ffdc211..e9a19cf7 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 { +public interface DictionaryDao extends JpaRepository { List 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 b626087d..56ce6471 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 { +public interface FeetypeConfigDao extends JpaRepository { @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 a276c617..00000000 --- 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 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 16c4a9a9..76bcc21a 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 javax.validation.constraints.NotNull; 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 @@ public class TDictionary implements DictionaryTable, Serializable { 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 1dbb4c8b..00000000 --- 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 ef85c210..9c27ac71 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 class TFeetypeConfig { 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 92fbf6ac..00000000 --- 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 594a2586..1477cec7 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 javax.validation.constraints.NotNull; 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 5fad64a1..4d9c2f1e 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.persistence.*; 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 22fadc97..17ca2ddb 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 @@ import java.util.Collection; @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 e6fd9e18..31f24811 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.persistence.*; 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 1ee94c35..110541fe 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.persistence.*; 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 fa1554c7..3a16f18a 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 class TSubject { 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 f58c5919..93a64e16 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 class TSubjectbal { 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 eedf9b5c..18b151d7 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 @@ import javax.validation.constraints.NotNull; @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 class TSubjectday { 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 a3fdd452..ac70e2f9 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 @@ public class TSubjectdayPK implements Serializable { 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 @@ public class TSubjectdayPK implements Serializable { 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 @@ public class TSubjectdayPK implements Serializable { 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 @@ public class TSubjectdayPK implements Serializable { @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 d6691460..8ec551c3 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.NumberUtil; 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 @@ public class TSyspara { @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 00000000..353225ad --- /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 ac42871e..46e53e4f 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 class TTranscode implements DictionaryTable, Serializable { 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 5a52e0b5..00000000 --- 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 71b30d87..679d14e8 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.persistence.*; 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 ba7ac786..f918b86e 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 @@ import java.util.Set; /** * 防止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 notAllowedKeyWords = new HashSet(0); - private static String replacedString="INVALID"; + private static String replacedString = "INVALID"; + static { String keyStr[] = key.split("\\|"); for (String str : keyStr) { @@ -43,7 +40,8 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { currentUrl = request.getRequestURI(); } - /**覆盖getParameter方法,将参数名和参数值都做xss过滤。 + /** + * 覆盖getParameter方法,将参数名和参数值都做xss过滤。 * 如果需要获得原始的值,则通过super.getParameterValues(name)来获取 * getParameterNames,getParameterValues和getParameterMap也可能需要覆盖 */ @@ -55,6 +53,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { } return cleanXSS(value); } + @Override public String[] getParameterValues(String parameter) { String[] values = super.getParameterValues(parameter); @@ -70,20 +69,20 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { } @Override - public Map getParameterMap(){ - Map values=super.getParameterMap(); + public Map getParameterMap() { + Map values = super.getParameterMap(); if (values == null) { return null; } - Map result=new HashMap<>(); - for(String key:values.keySet()){ - String encodedKey=cleanXSS(key); - int count=values.get(key).length; + Map 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 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { 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 2f4959be..8310435b 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 @@ public class DayendSettleServiceImpl implements DayendSettleService { // List 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 @@ public class DayendSettleServiceImpl implements DayendSettleService { // // //明细 // 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 @@ public class DayendSettleServiceImpl implements DayendSettleService { // 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 00000000..bbf94866 --- /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 1e477e7d..9085d2ee 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 @@ package com.supwisdom.dlpay.system.bean; 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 class ShopConfigBean { 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 @@ public class ShopConfigBean { 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 cdc4a4ab..2bf71b3e 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 @@ package com.supwisdom.dlpay.system.controller; 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 @@ public class ParamController { * 支付能力配置 * ==================================================== */ - @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 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 @@ public class ParamController { 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 @@ public class ParamController { } } - @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 @@ public class ParamController { } } - @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 @@ public class ParamController { } } - @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 @@ public class ParamController { @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 @@ public class ParamController { } } - @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 @@ public class ParamController { } } - @GetMapping("/param/load4paytypeconfig") - @PreAuthorize("hasPermission('/param/load4paytypeconfig','')") - public String load4PaytypeConfig(@RequestParam("paytype") String paytype, Model model) { - List configList = paramService.getSourceTypeConfigList(paytype); + @GetMapping("/param/load4sourcetypeconfig") + @PreAuthorize("hasPermission('/param/load4sourcetypeconfig','')") + public String load4PaytypeConfig(@RequestParam("sourcetype") String sourceType, Model model) { + List 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 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 b85095ad..9cc74c55 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 @@ package com.supwisdom.dlpay.system.controller; 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 @@ public class ShopController { 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 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 @@ public class ShopController { } } - @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 @@ public class ShopController { } } - @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 configList = shopDataService.getShopPaytypeConfigs(shopaccno, paytype); + List 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 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 dc9d1806..b2a03348 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 @@ public interface ParamService { boolean deleteSourceType(TSourceType paytype); @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true) - List getSourceTypeConfigList(String paytype); + List getSourceTypeConfigList(String paytype); @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) boolean saveSourceTypeConfig(String paytype, Map 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 9f5bd1a8..606cb7ca 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 @@ public interface ShopDataService { PageResult 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 getShopPaytypeConfigs(String shopaccno, String paytype); + List getShopPaytypeConfigs(String shopaccno, String paytype); @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) boolean saveOrUpdateShopPaytypeConfig(String shopaccno, String paytype, Map 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 a0f86cd2..d933a65f 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 @@ public class ParamServiceImpl implements ParamService { @Autowired private SourceTypeDao sourceTypeDao; @Autowired - private PaytypeConfigDao paytypeConfigDao; + private SourceTypeConfigDao paytypeConfigDao; @Override public PageResult getSysparaPage(Integer paraid, String paraname, int pageNo, int pageSize) { @@ -200,9 +200,9 @@ public class ParamServiceImpl implements ParamService { @Override @Cacheable(cacheNames = "source_type_config_cache", key = "#p0") - public List getSourceTypeConfigList(String paytype) { + public List getSourceTypeConfigList(String paytype) { if (!StringUtil.isEmpty(paytype)) { - List list = paytypeConfigDao.getByPaytypeOrderByConfigid(paytype.trim()); + List list = paytypeConfigDao.getBySourceTypeOrderByConfigid(paytype.trim()); if (!StringUtil.isEmpty(list)) return list; } @@ -216,7 +216,7 @@ public class ParamServiceImpl implements ParamService { 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 88d4deb0..1993949f 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.framework.util.TradeDict; 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 @@ public class ShopDataServiceImpl implements ShopDataService { @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 getAllShopNodes() { @@ -148,46 +147,46 @@ public class ShopDataServiceImpl implements ShopDataService { // 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 getShopPaytypeInfos(String shopaccno, String paytype, int pageNo, int pageSize) { - Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by("shopaccno", "paytype")); + public PageResult getShopPaytypeInfos(String shopaccno, String sourceType, int pageNo, int pageSize) { + Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by("shopaccno", "sourceType")); - Page page = shopPaytypeDao.findAll(new Specification() { + Page page = shopSourceTypeDao.findAll(new Specification() { @Override - public Predicate toPredicate(Root root, CriteriaQuery query, CriteriaBuilder criteriaBuilder) { + public Predicate toPredicate(Root root, CriteriaQuery query, CriteriaBuilder criteriaBuilder) { List 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 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 @@ public class ShopDataServiceImpl implements ShopDataService { } @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 @@ public class ShopDataServiceImpl implements ShopDataService { } @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 getShopPaytypeConfigs(String shopaccno, String paytype) { - List result = new ArrayList<>(0); + public List getShopPaytypeConfigs(String shopaccno, String paytype) { + List result = new ArrayList<>(0); if (!StringUtil.isEmpty(paytype)) { - List list = paytypeConfigDao.getByPaytypeOrderByConfigid(paytype.trim()); + List 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 @@ public class ShopDataServiceImpl implements ShopDataService { @Override public boolean saveOrUpdateShopPaytypeConfig(String shopaccno, String paytype, Map 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 8632b7ff..b6f81aa0 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 @@ class AppConfig { 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 f367feb3..fe0df772 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 @@ class ConsumePayServiceImpl : ConsumePayService { @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 @@ class ConsumePayServiceImpl : ConsumePayService { } } } - 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 @@ class ConsumePayServiceImpl : ConsumePayService { } } - 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 @@ class ConsumePayServiceImpl : ConsumePayService { } } - 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 4b81a024..2e747aea 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.FilterChain 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 fdec8f7a..b3ea34b2 100644 --- a/payapi/src/main/resources/data.sql +++ b/payapi/src/main/resources/data.sql @@ -36,7 +36,7 @@ VALUES (12, NULL, 1, NULL, 'layui-icon-util', '/param/businesspara', '业务参 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 @@ VALUES (39, '', 17, '修改', '/param/updateapiclientpara', '{tenantid}'); 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 @@ VALUES (61, '', 21, '删除积分账户', '/user/delpoint', '{tenantid}'); 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 @@ VALUES (73, '', 30, '查询', '/report/subjectdetail', '{tenantid}'); 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 @@ INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid 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 a83361b1..ecebe4e9 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 @@
- @@ -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 ead6ab2d..85c7665a 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 @@
- @@ -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 8c5d1026..a288eeaf 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 @@
-
+
@@ -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 '配置 删除'; } 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 ad6c9cff..502a3be7 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 @@
@@ -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 1ec0c3d5..f3650db5 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 @@
-
@@ -16,48 +16,54 @@
- +
- +
- +
- +
- +
- +
@@ -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 41cdf178..bcff987e 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 77763010..b8956f2c 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 @@
-
@@ -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 56400e76..b8acc1d1 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 @@   - - -
@@ -47,22 +47,22 @@ @@ -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 '配置'; } return '无配置'; @@ -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 e0bd6201..0532b6af 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 @@
-   @@ -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 6e77151a..dcaeb055 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 @@ -
+
@@ -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});