重构代码
diff --git a/src/main/java/com/supwisdom/dlpay/api/dao/PersonDao.java b/src/main/java/com/supwisdom/dlpay/api/dao/PersonDao.java
index 988afaa..df40228 100644
--- a/src/main/java/com/supwisdom/dlpay/api/dao/PersonDao.java
+++ b/src/main/java/com/supwisdom/dlpay/api/dao/PersonDao.java
@@ -1,6 +1,6 @@
package com.supwisdom.dlpay.api.dao;
-import com.supwisdom.dlpay.api.domain.TPerson;
+import com.supwisdom.dlpay.framework.domain.TPerson;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TAccount.java b/src/main/java/com/supwisdom/dlpay/api/domain/TAccount.java
index dc97643..7ded6e8 100644
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TAccount.java
+++ b/src/main/java/com/supwisdom/dlpay/api/domain/TAccount.java
@@ -1,5 +1,6 @@
package com.supwisdom.dlpay.api.domain;
+import com.supwisdom.dlpay.framework.domain.TPerson;
import com.supwisdom.dlpay.framework.util.MD5;
import com.supwisdom.dlpay.framework.util.MoneyUtil;
import org.hibernate.annotations.GenericGenerator;
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TPersonIdentity.java b/src/main/java/com/supwisdom/dlpay/api/domain/TPersonIdentity.java
index 1125f8e..bd3c315 100644
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPersonIdentity.java
+++ b/src/main/java/com/supwisdom/dlpay/api/domain/TPersonIdentity.java
@@ -1,5 +1,7 @@
package com.supwisdom.dlpay.api.domain;
+import com.supwisdom.dlpay.framework.domain.TPerson;
+
import javax.persistence.*;
@Entity
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TPointsAccount.java b/src/main/java/com/supwisdom/dlpay/api/domain/TPointsAccount.java
index d19e905..8485d32 100644
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPointsAccount.java
+++ b/src/main/java/com/supwisdom/dlpay/api/domain/TPointsAccount.java
@@ -1,5 +1,6 @@
package com.supwisdom.dlpay.api.domain;
+import com.supwisdom.dlpay.framework.domain.TPerson;
import com.supwisdom.dlpay.framework.util.MD5;
import javax.persistence.*;
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfig.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfig.java
deleted file mode 100644
index beb3489..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfig.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_FEETYPE_CONFIG")
-@IdClass(TFeetypeConfigPK.class)
-public class TFeetypeConfig {
- @Id
- @Column(name = "FEETYPE", nullable = false, length = 20)
- private String feetype;
-
- @Id
- @Column(name = "PAYTYPE", nullable = false, length = 20)
- private String paytype;
-
- @Column(name="DRSUBJNO", length = 10)
- private String drsubjno;
-
- @Column(name="CRSUBJNO", length = 10)
- private String crsubjno;
-
- @Column(name="SUMMARY", length = 200)
- private String summary;
-
- 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;
- }
-
- 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;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfigPK.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TFeetypeConfigPK.java
deleted file mode 100644
index 92fbf6a..0000000
--- a/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/src/main/java/com/supwisdom/dlpay/api/domain/TPerson.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TPerson.java
similarity index 98%
rename from src/main/java/com/supwisdom/dlpay/api/domain/TPerson.java
rename to src/main/java/com/supwisdom/dlpay/framework/domain/TPerson.java
index fafd0e6..a2e361c 100644
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPerson.java
+++ b/src/main/java/com/supwisdom/dlpay/framework/domain/TPerson.java
@@ -1,4 +1,4 @@
-package com.supwisdom.dlpay.api.domain;
+package com.supwisdom.dlpay.framework.domain;
import org.hibernate.annotations.GenericGenerator;
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TSettleLog.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TSettleLog.java
deleted file mode 100644
index abdd5e7..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TSettleLog.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import org.hibernate.annotations.GenericGenerator;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_SETTLE_LOG")
-public class TSettleLog {
- @Id
- @GenericGenerator(name = "idGenerator", strategy = "uuid")
- @GeneratedValue(generator = "idGenerator")
- @Column(name = "ID", nullable = false, length = 32)
- private String id;
-
- @Column(name = "STARTTIME", length = 14)
- private String starttime;
-
- @Column(name = "ENDTIME", length = 14)
- private String endtime;
-
- @Column(name = "ERRCODE", length = 10)
- private String errcode;
-
- @Column(name = "ERRMSG", length = 600)
- private String errmsg;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getStarttime() {
- return starttime;
- }
-
- public void setStarttime(String starttime) {
- this.starttime = starttime;
- }
-
- public String getEndtime() {
- return endtime;
- }
-
- public void setEndtime(String endtime) {
- this.endtime = endtime;
- }
-
- public String getErrcode() {
- return errcode;
- }
-
- public void setErrcode(String errcode) {
- this.errcode = errcode;
- }
-
- public String getErrmsg() {
- return errmsg;
- }
-
- public void setErrmsg(String errmsg) {
- this.errmsg = errmsg;
- }
-
- public TSettleLog update(String errcode, String errmsg) {
- this.errcode = errcode;
- this.errmsg = errmsg;
- return this;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TSettlectl.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TSettlectl.java
deleted file mode 100644
index 73dbf10..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TSettlectl.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "TB_SETTLECTL")
-public class TSettlectl {
- @Id
- @Column(name="BOOKSETNO", nullable = false, precision = 2)
- private Integer booksetno;
-
- @Column(name="PERIODYEAR", nullable = false, precision = 4)
- private Integer periodYear;
-
- @Column(name="PERIODMONTH", nullable = false, precision = 2)
- private Integer periodMonth;
-
- @Column(name="STATDATE", precision = 8)
- private Integer statdate;
-
- @Column(name="SETTLEDATE",nullable = false, precision = 8)
- private Integer settledate;
-
- @Column(name="STATUS", nullable = false, precision = 1)
- private Integer status;
-
- @Column(name="UPDTIME", length = 14)
- private String updtime;
-
- public Integer getBooksetno() {
- return booksetno;
- }
-
- public void setBooksetno(Integer booksetno) {
- this.booksetno = booksetno;
- }
-
- public Integer getPeriodYear() {
- return periodYear;
- }
-
- public void setPeriodYear(Integer periodYear) {
- this.periodYear = periodYear;
- }
-
- public Integer getPeriodMonth() {
- return periodMonth;
- }
-
- public void setPeriodMonth(Integer periodMonth) {
- this.periodMonth = periodMonth;
- }
-
- public Integer getStatdate() {
- return statdate;
- }
-
- public void setStatdate(Integer statdate) {
- this.statdate = statdate;
- }
-
- public Integer getSettledate() {
- return settledate;
- }
-
- public void setSettledate(Integer settledate) {
- this.settledate = settledate;
- }
-
- public Integer getStatus() {
- return status;
- }
-
- public void setStatus(Integer status) {
- this.status = status;
- }
-
- public String getUpdtime() {
- return updtime;
- }
-
- public void setUpdtime(String updtime) {
- this.updtime = updtime;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TShop.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TShop.java
deleted file mode 100644
index 664e1ad..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TShop.java
+++ /dev/null
@@ -1,224 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_SHOP",
- indexes = {@Index(name = "shop_shopaccno_idx", columnList = "shopaccno")})
-public class TShop {
- @Id
- @SequenceGenerator(name = "shopid", sequenceName = "SEQ_SHOP", allocationSize = 1)
- @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "shopid")
- @Column(name="SHOPID", nullable = false, precision = 9)
- private Integer shopid;
-
- @Column(name="FSHOPID", precision = 9)
- private Integer fshopid;
-
- @Column(name="SHOPNAME", length = 200)
- private String shopname;
-
- @Column(name = "SHOPTYPE", precision = 1)
- private Integer shoptype;
-
- @Column(name="STATUS", length = 20)
- private String status;
-
- @Column(name="SHOPACCNO", length = 20)
- private String shopaccno;
-
- @Column(name="CONTACTMAN", length = 60)
- private String contactman;
-
- @Column(name="IDTYPE", length = 1)
- private String idtype;
-
- @Column(name="IDNO", length = 60)
- private String idno;
-
- @Column(name="TEL", length = 20)
- private String tel;
-
- @Column(name="MOBILE", length = 30)
- private String mobile;
-
- @Column(name="EMAIL", length = 60)
- private String email;
-
- @Column(name="ADDR", length = 240)
- private String addr;
-
- @Column(name="ZIPCODE", length = 10)
- private String zipcode;
-
- @Column(name="OPENDATE", length = 8)
- private String opendate;
-
- @Column(name="CLOSEDATE", length = 8)
- private String closedate;
-
- /**
- * 第三方唯一ID
- * */
- @Column(name="THIRD_UNIQUE_IDENTY", length = 200)
- private String thirdUniqueIdenty;
-
- public TShop() {
- }
-
- public TShop(Integer fshopid, String shopname, Integer shoptype, String status, String shopaccno, String contactman, String idtype, String idno, String tel, String mobile, String email, String addr, String zipcode, String opendate, String closedate, String thirdUniqueIdenty) {
- this.fshopid = fshopid;
- this.shopname = shopname;
- this.shoptype = shoptype;
- this.status = status;
- this.shopaccno = shopaccno;
- this.contactman = contactman;
- this.idtype = idtype;
- this.idno = idno;
- this.tel = tel;
- this.mobile = mobile;
- this.email = email;
- this.addr = addr;
- this.zipcode = zipcode;
- this.opendate = opendate;
- this.closedate = closedate;
- this.thirdUniqueIdenty = thirdUniqueIdenty;
- }
-
- public String getThirdUniqueIdenty() {
- return thirdUniqueIdenty;
- }
-
- public void setThirdUniqueIdenty(String thirdUniqueIdenty) {
- this.thirdUniqueIdenty = thirdUniqueIdenty;
- }
-
- public Integer getShopid() {
- return shopid;
- }
-
- public void setShopid(Integer shopid) {
- this.shopid = shopid;
- }
-
- public Integer getFshopid() {
- return fshopid;
- }
-
- public void setFshopid(Integer fshopid) {
- this.fshopid = fshopid;
- }
-
- public String getShopname() {
- return shopname;
- }
-
- public void setShopname(String shopname) {
- this.shopname = shopname;
- }
-
- public Integer getShoptype() {
- return shoptype;
- }
-
- public void setShoptype(Integer shoptype) {
- this.shoptype = shoptype;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getShopaccno() {
- return shopaccno;
- }
-
- public void setShopaccno(String shopaccno) {
- this.shopaccno = shopaccno;
- }
-
- public String getContactman() {
- return contactman;
- }
-
- public void setContactman(String contactman) {
- this.contactman = contactman;
- }
-
- public String getIdtype() {
- return idtype;
- }
-
- public void setIdtype(String idtype) {
- this.idtype = idtype;
- }
-
- public String getIdno() {
- return idno;
- }
-
- public void setIdno(String idno) {
- this.idno = idno;
- }
-
- public String getTel() {
- return tel;
- }
-
- public void setTel(String tel) {
- this.tel = tel;
- }
-
- public String getMobile() {
- return mobile;
- }
-
- public void setMobile(String mobile) {
- this.mobile = mobile;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public String getAddr() {
- return addr;
- }
-
- public void setAddr(String addr) {
- this.addr = addr;
- }
-
- public String getZipcode() {
- return zipcode;
- }
-
- public void setZipcode(String zipcode) {
- this.zipcode = zipcode;
- }
-
- public String getOpendate() {
- return opendate;
- }
-
- public void setOpendate(String opendate) {
- this.opendate = opendate;
- }
-
- public String getClosedate() {
- return closedate;
- }
-
- public void setClosedate(String closedate) {
- this.closedate = closedate;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TShopacc.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TShopacc.java
deleted file mode 100644
index 9d8b8b4..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TShopacc.java
+++ /dev/null
@@ -1,128 +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 java.sql.Timestamp;
-
-@Entity
-@Table(name = "TB_SHOPACC")
-public class TShopacc {
- @Id
- @Column(name = "SHOPACCNO", length = 10)
- private String shopaccno;
-
- @Column(name = "SHOPID", precision = 9)
- private Integer shopid;
-
- @Column(name = "SHOPNAME", length = 200)
- private String shopname;
-
- @Column(name = "SUBJNO", length = 10)
- private String subjno;
-
- @Column(name = "STATUS", length = 20)
- private String status;
-
- @Column(name = "OPENDATE", length = 8)
- private String opendate;
-
- @Column(name = "CLOSEDATE", length = 8)
- private String closedate;
-
- @Column(name = "BALANCE", length = 15, precision = 2)
- private Double balance = 0.0;
-
- @Column(name = "VERSION")
- private Long version = 1L;
-
- @Column(name = "LASTUPDATE")
- private Timestamp lastUpdate = new Timestamp(System.currentTimeMillis());
-
- @Column(name = "MAC")
- private String mac;
-
- public String getShopaccno() {
- return shopaccno;
- }
-
- public void setShopaccno(String shopaccno) {
- this.shopaccno = shopaccno;
- }
-
- public Integer getShopid() {
- return shopid;
- }
-
- public void setShopid(Integer shopid) {
- this.shopid = shopid;
- }
-
- public String getShopname() {
- return shopname;
- }
-
- public void setShopname(String shopname) {
- this.shopname = shopname;
- }
-
- public String getSubjno() {
- return subjno;
- }
-
- public void setSubjno(String subjno) {
- this.subjno = subjno;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getOpendate() {
- return opendate;
- }
-
- public void setOpendate(String opendate) {
- this.opendate = opendate;
- }
-
- public String getClosedate() {
- return closedate;
- }
-
- public void setClosedate(String closedate) {
- this.closedate = closedate;
- }
-
- public void setBalance(Double balance) {
- this.balance = balance;
- }
-
- public Double getBalance() {
- return balance;
- }
-
- public Long getVersion() {
- return this.version;
- }
-
- public String getMac() {
- return mac;
- }
-
- public void setMac(String mac) {
- this.mac = mac;
- }
-
- public void incrOrDecrBalance(Double amount) {
- this.balance += amount;
- this.lastUpdate = new Timestamp(System.currentTimeMillis());
- this.version++;
- }
-
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TShopaccday.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TShopaccday.java
deleted file mode 100644
index 90671b8..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TShopaccday.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_SHOPACCDAY")
-@IdClass(TShopaccdayPK.class)
-public class TShopaccday {
- @Id
- @Column(name="ACCDATE", nullable = false, length = 8)
- private String accdate;
-
- @Id
- @Column(name="SHOPACCNO", nullable = false, length = 10)
- private String shopaccno;
-
- @Column(name="PERIOD_YEAR", precision = 8)
- private Integer periodYear;
-
- @Column(name="PERIOD_MONTH", precision = 2)
- private Integer periodMonth;
-
- @Column(name="BEGINBAL", precision = 15, scale = 2)
- private Double beginbal;
-
- @Column(name="DRAMT", precision = 15, scale = 2)
- private Double dramt;
-
- @Column(name="CRAMT", precision = 15, scale = 2)
- private Double cramt;
-
- @Column(name="BALANCE", precision = 15, scale = 2)
- private Double balance;
-
- @Column(name="UPDTIME", precision = 15, scale = 2)
- private String updtime;
-
- public TShopaccday() {
- }
-
- public TShopaccday(String accdate, String shopaccno, Integer periodYear, Integer periodMonth, Double beginbal, Double dramt, Double cramt, Double balance) {
- this.accdate = accdate;
- this.shopaccno = shopaccno;
- this.periodYear = periodYear;
- this.periodMonth = periodMonth;
- this.beginbal = beginbal;
- this.dramt = dramt;
- this.cramt = cramt;
- this.balance = balance;
- }
-
- public TShopaccday(String accdate, String shopaccno, Integer periodYear, Integer periodMonth, Double beginbal, Double dramt, Double cramt, Double balance, String updtime) {
- this.accdate = accdate;
- this.shopaccno = shopaccno;
- this.periodYear = periodYear;
- this.periodMonth = periodMonth;
- this.beginbal = beginbal;
- this.dramt = dramt;
- this.cramt = cramt;
- this.balance = balance;
- this.updtime = updtime;
- }
-
- public String getAccdate() {
- return accdate;
- }
-
- public void setAccdate(String accdate) {
- this.accdate = accdate;
- }
-
- public String getShopaccno() {
- return shopaccno;
- }
-
- public void setShopaccno(String shopaccno) {
- this.shopaccno = shopaccno;
- }
-
- public Integer getPeriodYear() {
- return periodYear;
- }
-
- public void setPeriodYear(Integer periodYear) {
- this.periodYear = periodYear;
- }
-
- public Integer getPeriodMonth() {
- return periodMonth;
- }
-
- public void setPeriodMonth(Integer periodMonth) {
- this.periodMonth = periodMonth;
- }
-
- public Double getBeginbal() {
- return beginbal;
- }
-
- public void setBeginbal(Double beginbal) {
- this.beginbal = beginbal;
- }
-
- public Double getDramt() {
- return dramt;
- }
-
- public void setDramt(Double dramt) {
- this.dramt = dramt;
- }
-
- public Double getCramt() {
- return cramt;
- }
-
- public void setCramt(Double cramt) {
- this.cramt = cramt;
- }
-
- public Double getBalance() {
- return balance;
- }
-
- public void setBalance(Double balance) {
- this.balance = balance;
- }
-
- public String getUpdtime() {
- return updtime;
- }
-
- public void setUpdtime(String updtime) {
- this.updtime = updtime;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TShopaccdayPK.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TShopaccdayPK.java
deleted file mode 100644
index 8ebf93b..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TShopaccdayPK.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 TShopaccdayPK implements Serializable {
- @Id
- @Column(name="ACCDATE", nullable = false, length = 8)
- private String accdate;
-
- @Id
- @Column(name="SHOPACCNO", nullable = false, length = 10)
- private String shopaccno;
-
- public String getAccdate() {
- return accdate;
- }
-
- public void setAccdate(String accdate) {
- this.accdate = accdate;
- }
-
- public String getShopaccno() {
- return shopaccno;
- }
-
- public void setShopaccno(String shopaccno) {
- this.shopaccno = shopaccno;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- TShopaccdayPK tShopaccdayPK = (TShopaccdayPK) o;
- if (accdate != null ? !accdate.equals(tShopaccdayPK.getAccdate()) : accdate != null)
- return false;
- if (shopaccno != null ? !shopaccno.equals(tShopaccdayPK.getShopaccno()) : shopaccno != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = accdate != null ? accdate.hashCode() : 0;
- result = 31 * result + (shopaccno != null ? shopaccno.hashCode() : 0);
- return result;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TSubject.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TSubject.java
deleted file mode 100644
index 2e48915..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TSubject.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "TB_SUBJECT")
-public class TSubject {
- @Id
- @Column(name = "SUBJNO", nullable = false, length = 10)
- private String subjno;
-
- @Column(name = "SUBJNAME", nullable = false, length = 60)
- private String subjname;
-
- @Column(name = "SUBJTYPE", precision = 1)
- private Integer subjtype;
-
- @Column(name="BALFLAG", precision = 1)
- private Integer balflag;
-
- @Column(name="FSUBJNO", length = 10)
- private String fsubjno;
-
- @Column(name="SUBJLEVEL", precision = 1)
- private Integer subjlevel;
-
- @Column(name="ENDFLAG", precision = 1)
- private Integer endflag;
-
- @Column(name="OPENDATE", precision = 8)
- private Integer opendate;
-
- @Column(name="DISPLAYFLAG", length = 1)
- private String displayflag;
-
- public String getSubjno() {
- return subjno;
- }
-
- public void setSubjno(String subjno) {
- this.subjno = subjno;
- }
-
- public String getSubjname() {
- return subjname;
- }
-
- public void setSubjname(String subjname) {
- this.subjname = subjname;
- }
-
- public Integer getSubjtype() {
- return subjtype;
- }
-
- public void setSubjtype(Integer subjtype) {
- this.subjtype = subjtype;
- }
-
- public Integer getBalflag() {
- return balflag;
- }
-
- public void setBalflag(Integer balflag) {
- this.balflag = balflag;
- }
-
- public String getFsubjno() {
- return fsubjno;
- }
-
- public void setFsubjno(String fsubjno) {
- this.fsubjno = fsubjno;
- }
-
- public Integer getSubjlevel() {
- return subjlevel;
- }
-
- public void setSubjlevel(Integer subjlevel) {
- this.subjlevel = subjlevel;
- }
-
- public Integer getEndflag() {
- return endflag;
- }
-
- public void setEndflag(Integer endflag) {
- this.endflag = endflag;
- }
-
- public Integer getOpendate() {
- return opendate;
- }
-
- public void setOpendate(Integer opendate) {
- this.opendate = opendate;
- }
-
- public String getDisplayflag() {
- return displayflag;
- }
-
- public void setDisplayflag(String displayflag) {
- this.displayflag = displayflag;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectbal.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectbal.java
deleted file mode 100644
index 4f19413..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectbal.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "TB_SUBJECTBAL")
-public class TSubjectbal {
- @Id
- @Column(name = "SUBJNO", nullable = false, length = 10)
- private String subjno;
-
- @Column(name = "ACCUMDRAMT", precision = 15, scale = 2)
- private Double accumdramt;
-
- @Column(name = "ACCUMCRAMT", precision = 15, scale = 2)
- private Double accumcramt;
-
- @Column(name = "BEGINDRBAL", precision = 15, scale = 2)
- private Double begindrbal;
-
- @Column(name = "BEGINCRBAL", precision = 15, scale = 2)
- private Double begincrbal;
-
- @Column(name = "DRAMT", precision = 15, scale = 2)
- private Double dramt;
-
- @Column(name = "CRAMT", precision = 15, scale = 2)
- private Double cramt;
-
- @Column(name = "DRBAL", precision = 15, scale = 2)
- private Double drbal;
-
- @Column(name = "CRBAL", precision = 15, scale = 2)
- private Double crbal;
-
- @Column(name = "UPDTIME", length = 14)
- private String updtime;
-
- @Column(name = "LASTSETTLEDAY", length = 8)
- private Integer lastsettleday;
-
- @Column(name = "ACCUMSETTLEAMT", precision = 15, scale = 2)
- private Double accumsettleamt;
-
- public TSubjectbal() {
- }
-
- public TSubjectbal(String subjno) {
- this.subjno = subjno;
- this.accumdramt = 0D;
- this.accumcramt = 0D;
- this.begindrbal = 0D;
- this.begincrbal = 0D;
- this.dramt = 0D;
- this.cramt = 0D;
- this.drbal = 0D;
- this.crbal = 0D;
- }
-
- public TSubjectbal(String subjno, Double accumdramt, Double accumcramt, Double begindrbal, Double begincrbal, Double dramt, Double cramt, Double drbal, Double crbal, String updtime, Integer lastsettleday, Double accumsettleamt) {
- this.subjno = subjno;
- this.accumdramt = accumdramt;
- this.accumcramt = accumcramt;
- this.begindrbal = begindrbal;
- this.begincrbal = begincrbal;
- this.dramt = dramt;
- this.cramt = cramt;
- this.drbal = drbal;
- this.crbal = crbal;
- this.updtime = updtime;
- this.lastsettleday = lastsettleday;
- this.accumsettleamt = accumsettleamt;
- }
-
- public String getSubjno() {
- return subjno;
- }
-
- public void setSubjno(String subjno) {
- this.subjno = subjno;
- }
-
- public Double getAccumdramt() {
- return accumdramt;
- }
-
- public void setAccumdramt(Double accumdramt) {
- this.accumdramt = accumdramt;
- }
-
- public Double getAccumcramt() {
- return accumcramt;
- }
-
- public void setAccumcramt(Double accumcramt) {
- this.accumcramt = accumcramt;
- }
-
- public Double getBegindrbal() {
- return begindrbal;
- }
-
- public void setBegindrbal(Double begindrbal) {
- this.begindrbal = begindrbal;
- }
-
- public Double getBegincrbal() {
- return begincrbal;
- }
-
- public void setBegincrbal(Double begincrbal) {
- this.begincrbal = begincrbal;
- }
-
- public Double getDramt() {
- return dramt;
- }
-
- public void setDramt(Double dramt) {
- this.dramt = dramt;
- }
-
- public Double getCramt() {
- return cramt;
- }
-
- public void setCramt(Double cramt) {
- this.cramt = cramt;
- }
-
- public Double getDrbal() {
- return drbal;
- }
-
- public void setDrbal(Double drbal) {
- this.drbal = drbal;
- }
-
- public Double getCrbal() {
- return crbal;
- }
-
- public void setCrbal(Double crbal) {
- this.crbal = crbal;
- }
-
- public String getUpdtime() {
- return updtime;
- }
-
- public void setUpdtime(String updtime) {
- this.updtime = updtime;
- }
-
- public Integer getLastsettleday() {
- return lastsettleday;
- }
-
- public void setLastsettleday(Integer lastsettleday) {
- this.lastsettleday = lastsettleday;
- }
-
- public Double getAccumsettleamt() {
- return accumsettleamt;
- }
-
- public void setAccumsettleamt(Double accumsettleamt) {
- this.accumsettleamt = accumsettleamt;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectday.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectday.java
deleted file mode 100644
index 57abe7a..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectday.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_SUBJECTDAY")
-@IdClass(TSubjectdayPK.class)
-public class TSubjectday {
- @Id
- @Column(name="ACCDATE", nullable = false, length = 8)
- private String accdate;
-
- @Id
- @Column(name="SUBJNO", nullable = false, length = 10)
- private String subjno;
-
- @Column(name="PERIOD_YEAR", precision = 4)
- private Integer periodYear;
-
- @Column(name="PERIOD_MONTH", precision = 2)
- private Integer periodMonth;
-
- @Column(name="BEGINDRBAL", precision = 15, scale = 2)
- private Double begindrbal;
-
- @Column(name="BEGINCRBAL", precision = 15, scale = 2)
- private Double begincrbal;
-
- @Column(name="DRAMT", precision = 15, scale = 2)
- private Double dramt;
-
- @Column(name="CRAMT", precision = 15, scale = 2)
- private Double cramt;
-
- @Column(name="DRBAL", precision = 15, scale = 2)
- private Double drbal;
-
- @Column(name="CRBAL", precision = 15, scale = 2)
- private Double crbal;
-
- @Column(name="UPDTIME", precision = 15, scale = 2)
- private String updtime;
-
- public TSubjectday() {
- }
-
- public TSubjectday(String accdate, String subjno, Integer periodYear, Integer periodMonth, Double begindrbal, Double begincrbal, Double dramt, Double cramt, Double drbal, Double crbal) {
- this.accdate = accdate;
- this.subjno = subjno;
- this.periodYear = periodYear;
- this.periodMonth = periodMonth;
- this.begindrbal = begindrbal;
- this.begincrbal = begincrbal;
- this.dramt = dramt;
- this.cramt = cramt;
- this.drbal = drbal;
- this.crbal = crbal;
- }
-
- public TSubjectday(String accdate, String subjno, Integer periodYear, Integer periodMonth, Double begindrbal, Double begincrbal, Double dramt, Double cramt, Double drbal, Double crbal, String updtime) {
- this.accdate = accdate;
- this.subjno = subjno;
- this.periodYear = periodYear;
- this.periodMonth = periodMonth;
- this.begindrbal = begindrbal;
- this.begincrbal = begincrbal;
- this.dramt = dramt;
- this.cramt = cramt;
- this.drbal = drbal;
- this.crbal = crbal;
- this.updtime = updtime;
- }
-
- public String getAccdate() {
- return accdate;
- }
-
- public void setAccdate(String accdate) {
- this.accdate = accdate;
- }
-
- public String getSubjno() {
- return subjno;
- }
-
- public void setSubjno(String subjno) {
- this.subjno = subjno;
- }
-
- public Integer getPeriodYear() {
- return periodYear;
- }
-
- public void setPeriodYear(Integer periodYear) {
- this.periodYear = periodYear;
- }
-
- public Integer getPeriodMonth() {
- return periodMonth;
- }
-
- public void setPeriodMonth(Integer periodMonth) {
- this.periodMonth = periodMonth;
- }
-
- public Double getBegindrbal() {
- return begindrbal;
- }
-
- public void setBegindrbal(Double begindrbal) {
- this.begindrbal = begindrbal;
- }
-
- public Double getBegincrbal() {
- return begincrbal;
- }
-
- public void setBegincrbal(Double begincrbal) {
- this.begincrbal = begincrbal;
- }
-
- public Double getDramt() {
- return dramt;
- }
-
- public void setDramt(Double dramt) {
- this.dramt = dramt;
- }
-
- public Double getCramt() {
- return cramt;
- }
-
- public void setCramt(Double cramt) {
- this.cramt = cramt;
- }
-
- public Double getDrbal() {
- return drbal;
- }
-
- public void setDrbal(Double drbal) {
- this.drbal = drbal;
- }
-
- public Double getCrbal() {
- return crbal;
- }
-
- public void setCrbal(Double crbal) {
- this.crbal = crbal;
- }
-
- public String getUpdtime() {
- return updtime;
- }
-
- public void setUpdtime(String updtime) {
- this.updtime = updtime;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectdayPK.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectdayPK.java
deleted file mode 100644
index a3fdd45..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TSubjectdayPK.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 TSubjectdayPK implements Serializable {
- @Id
- @Column(name = "ACCDATE", nullable = false, length = 8)
- private String accdate;
-
- @Id
- @Column(name = "SUBJNO", nullable = false, length = 10)
- private String subjno;
-
- public String getAccdate() {
- return accdate;
- }
-
- public void setAccdate(String accdate) {
- this.accdate = accdate;
- }
-
- public String getSubjno() {
- return subjno;
- }
-
- public void setSubjno(String subjno) {
- this.subjno = subjno;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- TSubjectdayPK tSubjectdayPK = (TSubjectdayPK) o;
- if (accdate != null ? !accdate.equals(tSubjectdayPK.getAccdate()) : accdate != null)
- return false;
- if (subjno != null ? !subjno.equals(tSubjectdayPK.getSubjno()) : subjno != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = accdate != null ? accdate.hashCode() : 0;
- result = 31 * result + (subjno != null ? subjno.hashCode() : 0);
- return result;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TTranstype.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TTranstype.java
deleted file mode 100644
index 6f0c036..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TTranstype.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@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;
-
- 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;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucher.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucher.java
deleted file mode 100644
index cd13743..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucher.java
+++ /dev/null
@@ -1,296 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_VOUCHER")
-public class TVoucher {
- @Id
- @SequenceGenerator(name = "voucherid", sequenceName = "SEQ_VOUCHERID", allocationSize = 1)
- @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "voucherid")
- @Column(name="VOUCHERID", nullable = false, precision = 9)
- private Integer voucherid;
-
- @Column(name="PERIODYEAR", precision = 8)
- private Integer periodYear;
-
- @Column(name="PERIODMONTH", precision = 2)
- private Integer periodMonth;
-
- @Column(name="VOUCHERNO", precision = 9)
- private Integer voucherno;
-
- @Column(name="VOUCHERDATE", precision = 8)
- private Integer voucherdate;
-
- @Column(name="TRANSDATE", precision = 8)
- private Integer transdate;
-
- @Column(name="TRANSCNT", precision = 9)
- private Integer transcnt;
-
- @Column(name="AMOUNT", precision = 15, scale = 2)
- private Double amount;
-
- @Column(name="SUMMARY", length = 200)
- private String summary;
-
- @Column(name="ENTRYCNT", precision = 2)
- private Integer entrycnt=2;
-
- @Column(name="ATTACHMENTS", precision = 1)
- private Integer attachments;
-
- @Column(name="SOURCETYPE", length = 20)
- private String sourcetype;
-
- @Column(name="SIGNFLAG", precision = 1)
- private Integer signflag;
-
- @Column(name="CHECKFLAG", precision =1)
- private Integer checkflag;
-
- @Column(name="POSTFLAG", precision = 1)
- private Integer postflag;
-
- @Column(name="INVALIDFLAG", precision =1)
- private Integer invalidflag;
-
- @Column(name="EDITFLAG", precision =1)
- private Integer editflag;
-
- @Column(name="PREPARER", length = 32)
- private String preparer;
-
- @Column(name="CASHIER", length = 32)
- private String cashier;
-
- @Column(name="CHECKER", length = 32)
- private String checker;
-
- @Column(name="POSTER", length = 32)
- private String poster;
-
- @Column(name="CREATEDATE", precision =8)
- private Integer createdate;
-
- public TVoucher(Integer periodYear, Integer periodMonth, Integer voucherno, Integer voucherdate, Integer transdate, Integer transcnt, Double amount, String summary, String sourcetype, Integer createdate) {
- this.periodYear = periodYear;
- this.periodMonth = periodMonth;
- this.voucherno = voucherno;
- this.voucherdate = voucherdate;
- this.transdate = transdate;
- this.transcnt = transcnt;
- this.amount = amount;
- this.summary = summary;
- this.entrycnt = 2;
- this.attachments = 0;
- this.sourcetype = sourcetype;
- this.signflag = 0;
- this.checkflag = 1;
- this.postflag = 0;
- this.invalidflag = 0;
- this.editflag = 0;
- this.createdate = createdate;
- }
-
- public TVoucher(Integer periodYear, Integer periodMonth, Integer voucherno, Integer voucherdate, Integer transdate, Integer transcnt, Double amount, String summary, Integer entrycnt, Integer attachments, String sourcetype, Integer signflag, Integer checkflag, Integer postflag, Integer invalidflag, Integer editflag, String preparer, String cashier, String checker, String poster, Integer createdate) {
- this.periodYear = periodYear;
- this.periodMonth = periodMonth;
- this.voucherno = voucherno;
- this.voucherdate = voucherdate;
- this.transdate = transdate;
- this.transcnt = transcnt;
- this.amount = amount;
- this.summary = summary;
- this.entrycnt = entrycnt;
- this.attachments = attachments;
- this.sourcetype = sourcetype;
- this.signflag = signflag;
- this.checkflag = checkflag;
- this.postflag = postflag;
- this.invalidflag = invalidflag;
- this.editflag = editflag;
- this.preparer = preparer;
- this.cashier = cashier;
- this.checker = checker;
- this.poster = poster;
- this.createdate = createdate;
- }
-
- public Integer getVoucherid() {
- return voucherid;
- }
-
- public void setVoucherid(Integer voucherid) {
- this.voucherid = voucherid;
- }
-
- public Integer getPeriodYear() {
- return periodYear;
- }
-
- public void setPeriodYear(Integer periodYear) {
- this.periodYear = periodYear;
- }
-
- public Integer getPeriodMonth() {
- return periodMonth;
- }
-
- public void setPeriodMonth(Integer periodMonth) {
- this.periodMonth = periodMonth;
- }
-
- public Integer getVoucherno() {
- return voucherno;
- }
-
- public void setVoucherno(Integer voucherno) {
- this.voucherno = voucherno;
- }
-
- public Integer getVoucherdate() {
- return voucherdate;
- }
-
- public void setVoucherdate(Integer voucherdate) {
- this.voucherdate = voucherdate;
- }
-
- public Integer getTransdate() {
- return transdate;
- }
-
- public void setTransdate(Integer transdate) {
- this.transdate = transdate;
- }
-
- public Integer getTranscnt() {
- return transcnt;
- }
-
- public void setTranscnt(Integer transcnt) {
- this.transcnt = transcnt;
- }
-
- public Double getAmount() {
- return amount;
- }
-
- public void setAmount(Double amount) {
- this.amount = amount;
- }
-
- public String getSummary() {
- return summary;
- }
-
- public void setSummary(String summary) {
- this.summary = summary;
- }
-
- public Integer getEntrycnt() {
- return entrycnt;
- }
-
- public void setEntrycnt(Integer entrycnt) {
- this.entrycnt = entrycnt;
- }
-
- public Integer getAttachments() {
- return attachments;
- }
-
- public void setAttachments(Integer attachments) {
- this.attachments = attachments;
- }
-
- public String getSourcetype() {
- return sourcetype;
- }
-
- public void setSourcetype(String sourcetype) {
- this.sourcetype = sourcetype;
- }
-
- public Integer getSignflag() {
- return signflag;
- }
-
- public void setSignflag(Integer signflag) {
- this.signflag = signflag;
- }
-
- public Integer getCheckflag() {
- return checkflag;
- }
-
- public void setCheckflag(Integer checkflag) {
- this.checkflag = checkflag;
- }
-
- public Integer getPostflag() {
- return postflag;
- }
-
- public void setPostflag(Integer postflag) {
- this.postflag = postflag;
- }
-
- public Integer getInvalidflag() {
- return invalidflag;
- }
-
- public void setInvalidflag(Integer invalidflag) {
- this.invalidflag = invalidflag;
- }
-
- public Integer getEditflag() {
- return editflag;
- }
-
- public void setEditflag(Integer editflag) {
- this.editflag = editflag;
- }
-
- public String getPreparer() {
- return preparer;
- }
-
- public void setPreparer(String preparer) {
- this.preparer = preparer;
- }
-
- public String getCashier() {
- return cashier;
- }
-
- public void setCashier(String cashier) {
- this.cashier = cashier;
- }
-
- public String getChecker() {
- return checker;
- }
-
- public void setChecker(String checker) {
- this.checker = checker;
- }
-
- public String getPoster() {
- return poster;
- }
-
- public void setPoster(String poster) {
- this.poster = poster;
- }
-
- public Integer getCreatedate() {
- return createdate;
- }
-
- public void setCreatedate(Integer createdate) {
- this.createdate = createdate;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucherEntry.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucherEntry.java
deleted file mode 100644
index 4a8e005..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucherEntry.java
+++ /dev/null
@@ -1,172 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_VOUCHERENTRY")
-@IdClass(TVoucherEntryPK.class)
-public class TVoucherEntry {
- @Id
- @Column(name = "VOUCHERID",nullable = false, precision = 9)
- private Integer voucherid;
-
- @Id
- @Column(name = "ENTRYID", precision = 2)
- private Integer entryid;
-
- @Column(name="SUBJNO", length = 10)
- private String subjno;
-
- @Column(name="ACCNO", length = 32)
- private String accno;
-
- @Column(name="DRAMT", precision = 15, scale = 2)
- private Double dramt;
-
- @Column(name="CRAMT", precision = 15, scale = 2)
- private Double cramt;
-
- @Column(name="BALANCE", precision = 15, scale = 2)
- private Double balance;
-
- @Column(name="BALFLAG", precision = 1)
- private Integer balflag;
-
- @Column(name="SUMMARY", length = 240)
- private String summary;
-
- @Column(name="OPPSUBJNO", length = 10)
- private String oppsubjno;
-
- @Column(name="OPPACCNO", length = 32)
- private String oppaccno;
-
- @Column(name = "OPPNAME", length = 240)
- private String oppname;
-
- public TVoucherEntry() {
- }
-
- public TVoucherEntry(Integer voucherid, Integer entryid, String subjno, String accno, Double dramt, Double cramt, String summary, String oppsubjno, String oppaccno) {
- this.voucherid = voucherid;
- this.entryid = entryid;
- this.subjno = subjno;
- this.accno = accno;
- this.dramt = dramt;
- this.cramt = cramt;
- this.summary = summary;
- this.oppsubjno = oppsubjno;
- this.oppaccno = oppaccno;
- }
-
- public TVoucherEntry(Integer voucherid, Integer entryid, String subjno, String accno, Double dramt, Double cramt, Double balance, Integer balflag, String summary, String oppsubjno, String oppaccno, String oppname) {
- this.voucherid = voucherid;
- this.entryid = entryid;
- this.subjno = subjno;
- this.accno = accno;
- this.dramt = dramt;
- this.cramt = cramt;
- this.balance = balance;
- this.balflag = balflag;
- this.summary = summary;
- this.oppsubjno = oppsubjno;
- this.oppaccno = oppaccno;
- this.oppname = oppname;
- }
-
- public Integer getVoucherid() {
- return voucherid;
- }
-
- public void setVoucherid(Integer voucherid) {
- this.voucherid = voucherid;
- }
-
- public Integer getEntryid() {
- return entryid;
- }
-
- public void setEntryid(Integer entryid) {
- this.entryid = entryid;
- }
-
- public String getSubjno() {
- return subjno;
- }
-
- public void setSubjno(String subjno) {
- this.subjno = subjno;
- }
-
- public String getAccno() {
- return accno;
- }
-
- public void setAccno(String accno) {
- this.accno = accno;
- }
-
- public Double getDramt() {
- return dramt;
- }
-
- public void setDramt(Double dramt) {
- this.dramt = dramt;
- }
-
- public Double getCramt() {
- return cramt;
- }
-
- public void setCramt(Double cramt) {
- this.cramt = cramt;
- }
-
- public Double getBalance() {
- return balance;
- }
-
- public void setBalance(Double balance) {
- this.balance = balance;
- }
-
- public Integer getBalflag() {
- return balflag;
- }
-
- public void setBalflag(Integer balflag) {
- this.balflag = balflag;
- }
-
- public String getSummary() {
- return summary;
- }
-
- public void setSummary(String summary) {
- this.summary = summary;
- }
-
- public String getOppsubjno() {
- return oppsubjno;
- }
-
- public void setOppsubjno(String oppsubjno) {
- this.oppsubjno = oppsubjno;
- }
-
- public String getOppaccno() {
- return oppaccno;
- }
-
- public void setOppaccno(String oppaccno) {
- this.oppaccno = oppaccno;
- }
-
- public String getOppname() {
- return oppname;
- }
-
- public void setOppname(String oppname) {
- this.oppname = oppname;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucherEntryPK.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucherEntryPK.java
deleted file mode 100644
index 9fa5279..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TVoucherEntryPK.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 TVoucherEntryPK implements Serializable {
- @Id
- @Column(name = "VOUCHERID", nullable = false, precision = 9)
- private Integer voucherid;
-
- @Id
- @Column(name = "ENTRYID", precision = 2)
- private Integer entryid;
-
- public Integer getVoucherid() {
- return voucherid;
- }
-
- public void setVoucherid(Integer voucherid) {
- this.voucherid = voucherid;
- }
-
- public Integer getEntryid() {
- return entryid;
- }
-
- public void setEntryid(Integer entryid) {
- this.entryid = entryid;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- TVoucherEntryPK tVoucherEntryPK = (TVoucherEntryPK) o;
- if (voucherid != null ? !voucherid.equals(tVoucherEntryPK.getVoucherid()) : voucherid != null)
- return false;
- if (entryid != null ? !entryid.equals(tVoucherEntryPK.getEntryid()) : entryid != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = voucherid != null ? voucherid.hashCode() : 0;
- result = 31 * result + (entryid != null ? entryid.hashCode() : 0);
- return result;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/domain/TVouchernoCtl.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TVouchernoCtl.java
deleted file mode 100644
index 24f75c3..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TVouchernoCtl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.supwisdom.dlpay.framework.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "TB_VOUCHERNOCTL")
-public class TVouchernoCtl {
- @Id
- @Column(name="VOUCHERTYPE", nullable = false, precision = 2)
- private Integer vouchertype;
-
- @Column(name="PERIODMONTH", nullable = false, precision = 2)
- private Integer periodMonth;
-
- @Column(name = "VOUCHERNO", nullable = false, precision = 9)
- private Integer voucherno;
-
- public TVouchernoCtl() {
- }
-
- public TVouchernoCtl(Integer vouchertype, Integer periodMonth, Integer voucherno) {
- this.vouchertype = vouchertype;
- this.periodMonth = periodMonth;
- this.voucherno = voucherno;
- }
-
- public Integer getVouchertype() {
- return vouchertype;
- }
-
- public void setVouchertype(Integer vouchertype) {
- this.vouchertype = vouchertype;
- }
-
- public Integer getPeriodMonth() {
- return periodMonth;
- }
-
- public void setPeriodMonth(Integer periodMonth) {
- this.periodMonth = periodMonth;
- }
-
- public Integer getVoucherno() {
- return voucherno;
- }
-
- public void setVoucherno(Integer voucherno) {
- this.voucherno = voucherno;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/util/TradeErrorCode.java b/src/main/java/com/supwisdom/dlpay/framework/util/TradeErrorCode.java
index b3fee04..3740b9a 100644
--- a/src/main/java/com/supwisdom/dlpay/framework/util/TradeErrorCode.java
+++ b/src/main/java/com/supwisdom/dlpay/framework/util/TradeErrorCode.java
@@ -13,7 +13,7 @@
/**
* 账户不存在
- * */
+ */
public static final int ACCOUNT_NOT_EXISTS = 10001;
/**
@@ -42,78 +42,78 @@
public static final int TRANSACTION_HAS_CANCELED = 10006;
/**
* 商户不存在
- * */
+ */
public static final int SHOP_NOT_EXISTS = 10007;
/**
* 科目不存在
- * */
+ */
public static final int SUBJECT_NOT_EXISTS = 10008;
/**
* 外部流水号重复
- * */
+ */
public static final int OUTTRADENO_ALREADY_EXISTS = 10009;
/**
* 账户TAC校验异常
- * */
+ */
public static final int ACCOUNT_TAC_ERROR = 10010;
/**
* 账户余额超上限
- * */
+ */
public static final int OVERFLOW_BALANCE_ERROR = 10011;
/**
* 未指定明确的交易结束状态
- * */
+ */
public static final int TRANSDTL_STATUS_ERROR = 10012;
/**
* 非初始化流水
- * */
+ */
public static final int TRANSDTL_STATUS_NOT_INIT = 10013;
/**
* 账户交易繁忙
- * */
+ */
public static final int ACCOUNT_TRADE_BUSY = 10014;
/**
* 非等待锁查询超时异常
- * */
+ */
public static final int LOCK_READ_TIMEOUT = 10015;
/**
- * 卡已挂失
- * */
+ * 卡已挂失
+ */
public static final int ACCOUNT_IS_LOSS = 10016;
/**
- * 卡已锁定
- * */
+ * 卡已锁定
+ */
public static final int ACCOUNT_IS_LOCKED = 10017;
/**
* 费用类别未定义
- * */
+ */
public static final int FEETYPE_NOT_EXISTS = 10018;
/**
* 费用类别不支持
- * */
+ */
public static final int FEETYPE_NOT_NOSUPPORT = 10019;
/**
* 请求参数错误
- * */
+ */
public static final int REQUEST_PARAM_ERROR = 20000;
/**
* 请求参数错误签名错误
- * */
+ */
public static final int REQUEST_SIGN_ERROR = 20001;
/**
@@ -132,4 +132,6 @@
public static final int BUSINESS_PAYTYPE_NOSUPPORT = 30003; //支付方式不支持
+ public static final int REQUEST_PARAM_EEROR = 300003; //请求参数错误
+
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java b/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java
index a39aa52..4ea1598 100644
--- a/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java
+++ b/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java
@@ -2,10 +2,8 @@
import com.supwisdom.dlpay.api.bean.JsonResult;
import com.supwisdom.dlpay.api.domain.TAccount;
-import com.supwisdom.dlpay.api.domain.TPerson;
-import com.supwisdom.dlpay.api.domain.TPersonIdentity;
+import com.supwisdom.dlpay.framework.domain.TPerson;
import com.supwisdom.dlpay.api.domain.TPointsAccount;
-import com.supwisdom.dlpay.framework.domain.TOperator;
import com.supwisdom.dlpay.framework.util.PageResult;
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.framework.util.WebConstant;
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/UserDataService.java b/src/main/java/com/supwisdom/dlpay/system/service/UserDataService.java
index 942196e..e74eaa9 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/UserDataService.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/UserDataService.java
@@ -2,7 +2,7 @@
import com.supwisdom.dlpay.api.bean.JsonResult;
import com.supwisdom.dlpay.api.domain.TAccount;
-import com.supwisdom.dlpay.api.domain.TPerson;
+import com.supwisdom.dlpay.framework.domain.TPerson;
import com.supwisdom.dlpay.api.domain.TPersonIdentity;
import com.supwisdom.dlpay.api.domain.TPointsAccount;
import com.supwisdom.dlpay.framework.util.PageResult;
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java b/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java
index 54694f5..9ca9a4b 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java
@@ -6,7 +6,7 @@
import com.supwisdom.dlpay.api.dao.PersonIdentityDao;
import com.supwisdom.dlpay.api.dao.PointsAccountDao;
import com.supwisdom.dlpay.api.domain.TAccount;
-import com.supwisdom.dlpay.api.domain.TPerson;
+import com.supwisdom.dlpay.framework.domain.TPerson;
import com.supwisdom.dlpay.api.domain.TPersonIdentity;
import com.supwisdom.dlpay.api.domain.TPointsAccount;
import com.supwisdom.dlpay.framework.data.SystemDateTime;
diff --git a/src/main/java/com/supwisdom/dlpay/water/dao/DeviceDao.java b/src/main/java/com/supwisdom/dlpay/water/dao/DeviceDao.java
index f824147..a7a9348 100644
--- a/src/main/java/com/supwisdom/dlpay/water/dao/DeviceDao.java
+++ b/src/main/java/com/supwisdom/dlpay/water/dao/DeviceDao.java
@@ -9,14 +9,14 @@
import java.util.List;
@Repository
-public interface DeviceDao extends JpaRepository<TDevice, Integer>, JpaSpecificationExecutor<TDevice> {
+public interface DeviceDao extends JpaRepository<TDevice, String>, JpaSpecificationExecutor<TDevice> {
- List<TDevice> findByRegino(Integer regino);
+ List<TDevice> findByRegino(Integer regino);
- List<TDevice> findByDevinameAndDevinoNot(String deviname, Integer devino);
+ List<TDevice> findByDevinameAndDevinoNot(String deviname, String devino);
- List<TDevice> findByDeviname(String deviname);
+ List<TDevice> findByDeviname(String deviname);
- @Query("select devistatus from TDevice group by devistatus")
- List<String> groupStatus();
+ @Query("select devistatus from TDevice group by devistatus")
+ List<String> groupStatus();
}
diff --git a/src/main/java/com/supwisdom/dlpay/water/dao/RegionDao.java b/src/main/java/com/supwisdom/dlpay/water/dao/RegionDao.java
index c5396cb..4f9d450 100644
--- a/src/main/java/com/supwisdom/dlpay/water/dao/RegionDao.java
+++ b/src/main/java/com/supwisdom/dlpay/water/dao/RegionDao.java
@@ -1,6 +1,6 @@
package com.supwisdom.dlpay.water.dao;
-import com.supwisdom.dlpay.water.domain.TRegion;
+import com.supwisdom.dlpay.water.domain.TArea;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
@@ -10,25 +10,25 @@
import java.util.Optional;
@Repository
-public interface RegionDao extends JpaRepository<TRegion, Integer> {
+public interface RegionDao extends JpaRepository<TArea, Integer> {
- List<TRegion> findByParentId(Integer parentId);
+ List<TArea> findByParentId(Integer parentId);
- List<TRegion> findAllByAvailable(Integer available);
+ List<TArea> findAllByAvailable(Integer available);
- List<TRegion> findByAvailableAndLevelNot(Integer available, Integer level);
+ List<TArea> findByAvailableAndLevelNot(Integer available, Integer level);
- Optional<TRegion> findByAvailableAndRegino(Integer available,Integer regino);
+ Optional<TArea> findByAvailableAndRegino(Integer available, Integer regino);
- Page<TRegion> findAllByAvailable(Integer available,Pageable pageable);
+ Page<TArea> findAllByAvailable(Integer available, Pageable pageable);
- Page<TRegion> findByAvailableAndParentId(Integer available,Integer parentId, Pageable pageable);
+ Page<TArea> findByAvailableAndParentId(Integer available, Integer parentId, Pageable pageable);
- Page<TRegion> findAllByAvailableAndRegiNameContaining(Integer available,String regiName, Pageable pageable);
+ Page<TArea> findAllByAvailableAndRegiNameContaining(Integer available, String regiName, Pageable pageable);
- TRegion findAllByAvailableAndRegiName(Integer available, String reiName);
+ TArea findAllByAvailableAndRegiName(Integer available, String reiName);
- TRegion findByAvailableAndRegiNameAndReginoNot(Integer available, String reiName, Integer regino);
+ TArea findByAvailableAndRegiNameAndReginoNot(Integer available, String reiName, Integer regino);
- List<TRegion> findByAvailableAndParentId(Integer available, Integer parentId);
+ List<TArea> findByAvailableAndParentId(Integer available, Integer parentId);
}
diff --git a/src/main/java/com/supwisdom/dlpay/water/dao/TransdtlDao.java b/src/main/java/com/supwisdom/dlpay/water/dao/TransdtlDao.java
new file mode 100644
index 0000000..05260db
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/water/dao/TransdtlDao.java
@@ -0,0 +1,19 @@
+package com.supwisdom.dlpay.water.dao;
+
+import com.supwisdom.dlpay.water.domain.TTransdtl;
+import org.springframework.data.jpa.repository.Lock;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.jpa.repository.QueryHints;
+import org.springframework.data.repository.CrudRepository;
+import org.springframework.stereotype.Repository;
+
+import javax.persistence.LockModeType;
+import javax.persistence.QueryHint;
+
+@Repository
+public interface TransdtlDao extends CrudRepository<TTransdtl, String> {
+ @Lock(LockModeType.PESSIMISTIC_WRITE)
+ @Query("select t from TTransdtl t where t.billno=?1")
+ @QueryHints({@QueryHint(name = "javax.persistence.lock.timeout", value = "0")})
+ TTransdtl findByBillnoForUpdate(String billno);
+}
diff --git a/src/main/java/com/supwisdom/dlpay/water/domain/TArea.java b/src/main/java/com/supwisdom/dlpay/water/domain/TArea.java
new file mode 100644
index 0000000..4df2f06
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/water/domain/TArea.java
@@ -0,0 +1,99 @@
+package com.supwisdom.dlpay.water.domain;
+
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "TB_AREA")
+@SequenceGenerator(name = "SEQ_AREA", sequenceName = "SEQ_AREA", allocationSize = 1)
+public class TArea {
+ @Id
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_AREA")
+ @Column(name = "areano", nullable = false)
+ private Integer areano;
+
+ @Column(name = "PARENTID")
+ private Integer parentId;
+
+ @Column(name = "AREANAME", length = 200)
+ private String areaName;
+
+ @Column(name = "AREALEVEL", length = 10)
+ private Integer level;
+
+ @Column(name = "ADDRESS")
+ private String address;
+
+ @Column(name = "REMARKS")
+ private String remarks;
+
+ @Column(name = "PARENTNAME")
+ private String parentName;
+
+ @Column(name = "AVAILABLE")
+ private Integer available;
+
+ public Integer getAvailable() {
+ return available;
+ }
+
+ public void setAvailable(Integer available) {
+ this.available = available;
+ }
+
+ public String getParentName() {
+ return parentName;
+ }
+
+ public void setParentName(String parentName) {
+ this.parentName = parentName;
+ }
+
+ public Integer getAreano() {
+ return areano;
+ }
+
+ public void setAreano(Integer areano) {
+ this.areano = areano;
+ }
+
+ public Integer getParentId() {
+ return parentId;
+ }
+
+ public void setParentId(Integer parentId) {
+ this.parentId = parentId;
+ }
+
+ public String getAreaName() {
+ return areaName;
+ }
+
+ public void setAreaName(String areaName) {
+ this.areaName = areaName;
+ }
+
+ public Integer getLevel() {
+ return level;
+ }
+
+ public void setLevel(Integer level) {
+ this.level = level;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getRemarks() {
+ return remarks;
+ }
+
+ public void setRemarks(String remarks) {
+ this.remarks = remarks;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/water/domain/TDevice.java b/src/main/java/com/supwisdom/dlpay/water/domain/TDevice.java
index d93012b..2e148b2 100644
--- a/src/main/java/com/supwisdom/dlpay/water/domain/TDevice.java
+++ b/src/main/java/com/supwisdom/dlpay/water/domain/TDevice.java
@@ -5,59 +5,82 @@
@Entity
@Table(name = "TB_DEVICE")
public class TDevice {
- @Id
- @Column(name = "DEVINO", nullable = false)
- private Integer devino;
+ @Id
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "deviceid_seq")
+ @SequenceGenerator(name = "deviceid_seq", sequenceName = "seq_deviceid")
+ private Integer deviceid;
- @Column(name = "DEVINAME",length = 200)
- private String deviname;
+ @Column(name = "deviceno", nullable = false, length = 8)
+ private String deviceno;
- @Column(name = "DEVISTATUS",length = 100)
- private String devistatus;
+ @Column(name = "devicename", length = 200)
+ private String devicename;
- @Column(name = "REGINO",length = 32)
- private Integer regino;
+ @Column(name = "DEVISTATUS", length = 10)
+ private String deviceStatus;
- @Column(name = "REGINAME",length = 200)
- private String reginame;
+ @Column(name = "AREANO")
+ private Integer areano;
- public Integer getDevino() {
- return devino;
- }
+ @Column(name = "linecheck", length = 14)
+ private String deviceLineCheck; // 心跳更新时间
- public void setDevino(Integer devino) {
- this.devino = devino;
- }
+ @Column(name = "soft_verno", length = 30)
+ private String softVer; // 软件版本
- public String getDeviname() {
- return deviname;
- }
+ public Integer getDeviceid() {
+ return deviceid;
+ }
- public void setDeviname(String deviname) {
- this.deviname = deviname;
- }
+ public void setDeviceid(Integer deviceid) {
+ this.deviceid = deviceid;
+ }
- public String getDevistatus() {
- return devistatus;
- }
+ public String getDeviceno() {
+ return deviceno;
+ }
- public void setDevistatus(String devistatus) {
- this.devistatus = devistatus;
- }
+ public void setDeviceno(String deviceno) {
+ this.deviceno = deviceno;
+ }
- public Integer getRegino() {
- return regino;
- }
+ public String getDevicename() {
+ return devicename;
+ }
- public void setRegino(Integer regino) {
- this.regino = regino;
- }
+ public void setDevicename(String devicename) {
+ this.devicename = devicename;
+ }
- public String getReginame() {
- return reginame;
- }
+ public String getDeviceStatus() {
+ return deviceStatus;
+ }
- public void setReginame(String reginame) {
- this.reginame = reginame;
- }
+ public void setDeviceStatus(String deviceStatus) {
+ this.deviceStatus = deviceStatus;
+ }
+
+ public Integer getAreano() {
+ return areano;
+ }
+
+ public void setAreano(Integer areano) {
+ this.areano = areano;
+ }
+
+ public String getDeviceLineCheck() {
+ return deviceLineCheck;
+ }
+
+ public void setDeviceLineCheck(String deviceLineCheck) {
+ this.deviceLineCheck = deviceLineCheck;
+ }
+
+ public String getSoftVer() {
+ return softVer;
+ }
+
+ public void setSoftVer(String softVer) {
+ this.softVer = softVer;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/water/domain/TDeviceFeeConfig.java b/src/main/java/com/supwisdom/dlpay/water/domain/TDeviceFeeConfig.java
new file mode 100644
index 0000000..4f81f00
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/water/domain/TDeviceFeeConfig.java
@@ -0,0 +1,41 @@
+package com.supwisdom.dlpay.water.domain;
+
+import javax.persistence.*;
+
+@Table(name = "tb_devicefeeconfig" )
+@Entity
+public class TDeviceFeeConfig {
+ @Id
+ @Column(name = "deviceid")
+ private String deviceid;
+
+ @Column(name = "feeconfig")
+ private Integer feeConfig;
+
+ @Column(name = "feecfgversion")
+ private Integer feeCfgVersion;
+
+ public String getDeviceid() {
+ return deviceid;
+ }
+
+ public void setDeviceid(String deviceid) {
+ this.deviceid = deviceid;
+ }
+
+ public Integer getFeeConfig() {
+ return feeConfig;
+ }
+
+ public void setFeeConfig(Integer feeConfig) {
+ this.feeConfig = feeConfig;
+ }
+
+ public Integer getFeeCfgVersion() {
+ return feeCfgVersion;
+ }
+
+ public void setFeeCfgVersion(Integer feeCfgVersion) {
+ this.feeCfgVersion = feeCfgVersion;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/water/domain/TFeeConfig.java b/src/main/java/com/supwisdom/dlpay/water/domain/TFeeConfig.java
new file mode 100644
index 0000000..22a7a96
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/water/domain/TFeeConfig.java
@@ -0,0 +1,54 @@
+package com.supwisdom.dlpay.water.domain;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "tb_feeconfig")
+public class TFeeConfig {
+ @Id
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "feeconfig_seq")
+ @SequenceGenerator(name = "feeconfig_seq", sequenceName = "seq_feeconfig")
+ private Integer id;
+
+ @Column(name = "amount")
+ private Integer amount = 0;
+
+ @Column(name = "max_water_litre")
+ private Integer maxWaterLitre = 0;
+
+ @Version
+ @Column(name = "cfg_version")
+ private Integer version = 0;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Integer getAmount() {
+ return amount;
+ }
+
+ public void setAmount(Integer amount) {
+ this.amount = amount;
+ }
+
+ public Integer getMaxWaterLitre() {
+ return maxWaterLitre;
+ }
+
+ public void setMaxWaterLitre(Integer maxWaterLitre) {
+ this.maxWaterLitre = maxWaterLitre;
+ }
+
+ public Integer getVersion() {
+ return version;
+ }
+
+ public void setVersion(Integer version) {
+ this.version = version;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/water/domain/TRegion.java b/src/main/java/com/supwisdom/dlpay/water/domain/TRegion.java
deleted file mode 100644
index 5c7c0d3..0000000
--- a/src/main/java/com/supwisdom/dlpay/water/domain/TRegion.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package com.supwisdom.dlpay.water.domain;
-
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_REGION")
-@SequenceGenerator(name="SEQ_REGI",sequenceName="SEQ_REGI",allocationSize=1)
-public class TRegion {
- @Id
- @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_REGI")
- @Column(name="REGINO", nullable = false)
- private Integer regino;
-
- @Column(name="PARENTID",length = 32)
- private Integer parentId;
-
- @Column(name="REGINAME", length = 200)
- private String regiName;
-
- @Column(name="LEVEL",length = 10)
- private Integer level;
-
- @Column(name="ADDRESS")
- private String address;
-
- @Column(name="REMARKS")
- private String remarks;
-
- @Column(name = "PARENTNAME")
- private String parentName;
-
- @Column(name = "AVAILABLE")
- private Integer available;
-
- public Integer getAvailable() {
- return available;
- }
-
- public void setAvailable(Integer available) {
- this.available = available;
- }
-
- public String getParentName() {
- return parentName;
- }
-
- public void setParentName(String parentName) {
- this.parentName = parentName;
- }
-
- public Integer getRegino() {
- return regino;
- }
-
- public void setRegino(Integer regino) {
- this.regino = regino;
- }
-
- public Integer getParentId() {
- return parentId;
- }
-
- public void setParentId(Integer parentId) {
- this.parentId = parentId;
- }
-
- public String getRegiName() {
- return regiName;
- }
-
- public void setRegiName(String regiName) {
- this.regiName = regiName;
- }
-
- public Integer getLevel() {
- return level;
- }
-
- public void setLevel(Integer level) {
- this.level = level;
- }
-
- public String getAddress() {
- return address;
- }
-
- public void setAddress(String address) {
- this.address = address;
- }
-
- public String getRemarks() {
- return remarks;
- }
-
- public void setRemarks(String remarks) {
- this.remarks = remarks;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/water/domain/TTransdtl.java b/src/main/java/com/supwisdom/dlpay/water/domain/TTransdtl.java
new file mode 100644
index 0000000..467d421
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/water/domain/TTransdtl.java
@@ -0,0 +1,121 @@
+package com.supwisdom.dlpay.water.domain;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "tb_transdtl")
+public class TTransdtl {
+ @Id
+ private String billno;
+
+ private String transDate;
+
+ private String transTime;
+
+ private String deviceno;
+
+ private String userid;
+
+ private String bankCardNo;
+
+ private String mode;
+
+ private Double amount;
+
+ private Integer waterSumHundredLitre;
+
+ private String status;
+
+ private String uploadTime;
+
+
+ public String getBillno() {
+ return billno;
+ }
+
+ public void setBillno(String billno) {
+ this.billno = billno;
+ }
+
+ public String getDeviceno() {
+ return deviceno;
+ }
+
+ public void setDeviceno(String deviceno) {
+ this.deviceno = deviceno;
+ }
+
+ public String getTransDate() {
+ return transDate;
+ }
+
+ public void setTransDate(String transDate) {
+ this.transDate = transDate;
+ }
+
+ public String getTransTime() {
+ return transTime;
+ }
+
+ public void setTransTime(String transTime) {
+ this.transTime = transTime;
+ }
+
+ public String getUserid() {
+ return userid;
+ }
+
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+
+ public String getBankCardNo() {
+ return bankCardNo;
+ }
+
+ public void setBankCardNo(String bankCardNo) {
+ this.bankCardNo = bankCardNo;
+ }
+
+ public String getMode() {
+ return mode;
+ }
+
+ public void setMode(String mode) {
+ this.mode = mode;
+ }
+
+ public Double getAmount() {
+ return amount;
+ }
+
+ public void setAmount(Double amount) {
+ this.amount = amount;
+ }
+
+ public Integer getWaterSumHundredLitre() {
+ return waterSumHundredLitre;
+ }
+
+ public void setWaterSumHundredLitre(Integer waterSumHundredLitre) {
+ this.waterSumHundredLitre = waterSumHundredLitre;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getUploadTime() {
+ return uploadTime;
+ }
+
+ public void setUploadTime(String uploadTime) {
+ this.uploadTime = uploadTime;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/water/service/AreaService.java b/src/main/java/com/supwisdom/dlpay/water/service/AreaService.java
new file mode 100644
index 0000000..a7c7eec
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/water/service/AreaService.java
@@ -0,0 +1,41 @@
+package com.supwisdom.dlpay.water.service;
+
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.water.system.bean.RegionSearchBean;
+import com.supwisdom.dlpay.water.domain.TArea;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+public interface AreaService {
+ @Transactional
+ PageResult<TArea> queryAreasByParentId(RegionSearchBean param);
+
+ @Transactional
+ List<Map<String, Object>> getAreaTree(List<TArea> regions, Integer parentId);
+
+ @Transactional
+ List<TArea> queryAllAreas();
+
+ @Transactional
+ List<TArea> queryAllNotFLevelArea();
+
+ @Transactional
+ PageResult<TArea> queryAreasBySearchKey(RegionSearchBean param);
+
+ @Transactional
+ boolean saveArea(TArea region);
+
+ @Transactional
+ boolean checkAreaName(TArea region);
+
+ @Transactional
+ boolean updateArea(TArea region);
+
+ @Transactional
+ boolean deleteArea(Integer regino);
+
+ @Transactional
+ boolean existSubArea(Integer regino);
+}
diff --git a/src/main/java/com/supwisdom/dlpay/water/service/DeviceService.java b/src/main/java/com/supwisdom/dlpay/water/service/DeviceService.java
index 663a0a9..fb750c5 100644
--- a/src/main/java/com/supwisdom/dlpay/water/service/DeviceService.java
+++ b/src/main/java/com/supwisdom/dlpay/water/service/DeviceService.java
@@ -9,21 +9,21 @@
public interface DeviceService {
- boolean existSubDevice(Integer regino);
+ boolean existSubDevice(Integer regino);
- PageResult<TDevice> queryDeviceList(DeviceSearchBean param);
+ PageResult<TDevice> queryDeviceList(DeviceSearchBean param);
- TDevice queryDeviceById(Integer devino);
+ TDevice queryDeviceById(String devino);
- boolean updateDevice(TDevice device);
+ boolean updateDevice(TDevice device);
- boolean saveDevice(TDevice device);
+ boolean saveDevice(TDevice device);
- Map<String,Object> checkParams(TDevice device);
+ Map<String, Object> checkParams(TDevice device);
- boolean deleteDevice(Integer devino);
+ boolean deleteDevice(String devino);
- List<String> groupStatus();
+ List<String> groupStatus();
- PageResult<TDevice> queryDeviceByParams(DeviceSearchBean param);
+ PageResult<TDevice> queryDeviceByParams(DeviceSearchBean param);
}
diff --git a/src/main/java/com/supwisdom/dlpay/water/service/RegionService.java b/src/main/java/com/supwisdom/dlpay/water/service/RegionService.java
deleted file mode 100644
index d894d8f..0000000
--- a/src/main/java/com/supwisdom/dlpay/water/service/RegionService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.supwisdom.dlpay.water.service;
-
-import com.supwisdom.dlpay.framework.util.PageResult;
-import com.supwisdom.dlpay.water.system.bean.RegionSearchBean;
-import com.supwisdom.dlpay.water.domain.TRegion;
-
-import java.util.List;
-import java.util.Map;
-
-public interface RegionService {
- PageResult<TRegion> queryRegionsByParentId(RegionSearchBean param);
-
- List<Map<String, Object>> getRegionTree(List<TRegion> regions, Integer parentId);
-
- List<TRegion> queryAllRegion();
-
- List<TRegion> queryAllNotFLevelRegion();
-
- PageResult<TRegion> queryRegionsBySearchKey(RegionSearchBean param);
-
- boolean saveRegion(TRegion region);
-
- boolean checkRegiName(TRegion region);
-
- boolean updateRegion(TRegion region);
-
- boolean deleteRegion(Integer regino);
-
- boolean existSubRegion(Integer regino);
-}
diff --git a/src/main/java/com/supwisdom/dlpay/water/service/TransdtlService.java b/src/main/java/com/supwisdom/dlpay/water/service/TransdtlService.java
new file mode 100644
index 0000000..50c6030
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/water/service/TransdtlService.java
@@ -0,0 +1,14 @@
+package com.supwisdom.dlpay.water.service;
+
+import com.supwisdom.dlpay.water.UploadRecordRequest;
+import com.supwisdom.dlpay.water.domain.TTransdtl;
+import org.springframework.transaction.annotation.Transactional;
+
+public interface TransdtlService {
+ @Transactional
+ TTransdtl createNewTransdtl(TTransdtl dtl);
+
+ @Transactional
+ TTransdtl saveDeviceDtlData(UploadRecordRequest record);
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/water/service/impl/AreaServiceImpl.java b/src/main/java/com/supwisdom/dlpay/water/service/impl/AreaServiceImpl.java
new file mode 100644
index 0000000..8c3a0a4
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/water/service/impl/AreaServiceImpl.java
@@ -0,0 +1,140 @@
+package com.supwisdom.dlpay.water.service.impl;
+
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import com.supwisdom.dlpay.water.system.bean.RegionSearchBean;
+import com.supwisdom.dlpay.water.dao.RegionDao;
+import com.supwisdom.dlpay.water.domain.TArea;
+import com.supwisdom.dlpay.water.service.AreaService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+@Service
+public class AreaServiceImpl implements AreaService {
+
+ @Autowired
+ private RegionDao regionDao;
+
+ /**
+ * 根据父区域id查询区域列表
+ *
+ * @param param
+ * @return
+ */
+ @Override
+ public PageResult<TArea> queryAreasByParentId(RegionSearchBean param) {
+ Pageable pageable = PageRequest.of(param.getPageNo() - 1, param.getPageSize());
+ PageResult<TArea> result = new PageResult<>(regionDao.findByAvailableAndParentId(1, param.getParentId(), pageable));
+ List<TArea> data = result.getData();
+ if (param.getPageNo()==1) {
+ Optional<TArea> optional = regionDao.findByAvailableAndRegino(1, param.getParentId());
+ if (optional.isPresent()) {
+ data = new ArrayList<>(data);
+ data.add(0, optional.get());
+ result.setData(data);
+ }
+ }
+ return result;
+ }
+
+ public List<Map<String, Object>> getAreaTree(List<TArea> regions, Integer parentId) {
+ List<Map<String, Object>> list = new ArrayList<>(0);
+ for (TArea region : regions) {
+ if (parentId.equals(region.getParentId())) {
+ Map<String, Object> map = new HashMap<>(0);
+ map.put("title", region.getAreaName());
+ map.put("id", region.getAreano());
+ map.put("children", getAreaTree(regions, region.getAreano()));
+ list.add(map);
+ }
+ }
+ return list;
+ }
+
+ public List<TArea> queryAllAreas() {
+ List<TArea> regions = regionDao.findAllByAvailable(1);
+ return regions.size() != 0 ? regions : null;
+ }
+
+ @Override
+ public List<TArea> queryAllNotFLevelArea() {
+ List<TArea> regions = regionDao.findByAvailableAndLevelNot(1, 1);
+ return regions.size() != 0 ? regions : null;
+ }
+
+ @Override
+ public PageResult<TArea> queryAreasBySearchKey(RegionSearchBean param) {
+ Pageable pageable = PageRequest.of(param.getPageNo() - 1, param.getPageSize());
+ if (!StringUtil.isEmpty(param.getSearchKey())) {
+ return new PageResult<>(regionDao.findAllByAvailableAndRegiNameContaining(1, param.getSearchKey(), pageable));
+ }
+ return new PageResult<>(regionDao.findAllByAvailable(1, pageable));
+ }
+
+ @Override
+ public boolean saveArea(TArea region) {
+ if (region.getParentId() == 0) {
+ region.setParentName("无");
+ region.setLevel(1);
+ } else {
+ Optional<TArea> optional = regionDao.findByAvailableAndRegino(1, region.getParentId());
+ if (optional.isPresent()) {
+ region.setParentName(optional.get().getAreaName());
+ region.setLevel(optional.get().getLevel() + 1);
+ }else {
+ return false;
+ }
+ }
+ region.setAvailable(1);
+ regionDao.save(region);
+ return true;
+ }
+
+ public boolean updateArea(TArea region) {
+ Optional<TArea> optional = regionDao.findByAvailableAndRegino(1, region.getAreano());
+ if (optional.isPresent()) {
+ TArea oldRegion = optional.get();
+ oldRegion.setAreaName(region.getAreaName());
+ oldRegion.setAddress(region.getAddress());
+ oldRegion.setRemarks(region.getRemarks());
+ regionDao.save(oldRegion);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkAreaName(TArea region) {
+ if (region.getAreano() == null) {
+ return regionDao.findAllByAvailableAndRegiName(1, region.getAreaName()) == null;
+ }else {
+ return regionDao.findByAvailableAndRegiNameAndReginoNot(1,
+ region.getAreaName(),
+ region.getAreano()) == null;
+ }
+ }
+
+ @Override
+ public boolean deleteArea(Integer regino) {
+ Optional<TArea> optional = regionDao.findByAvailableAndRegino(1, regino);
+ if (optional.isPresent()) {
+ TArea region = optional.get();
+ region.setAvailable(0);
+ regionDao.save(region);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean existSubArea(Integer regino) {
+ List<TArea> subRegion = regionDao.findByAvailableAndParentId(1, regino);
+ return subRegion != null && subRegion.size() != 0;
+ }
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/water/service/impl/DeviceServiceImpl.java b/src/main/java/com/supwisdom/dlpay/water/service/impl/DeviceServiceImpl.java
index 6d90f4e..25cab05 100644
--- a/src/main/java/com/supwisdom/dlpay/water/service/impl/DeviceServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/water/service/impl/DeviceServiceImpl.java
@@ -4,152 +4,147 @@
import com.supwisdom.dlpay.water.dao.DeviceDao;
import com.supwisdom.dlpay.water.dao.RegionDao;
import com.supwisdom.dlpay.water.domain.TDevice;
-import com.supwisdom.dlpay.water.domain.TRegion;
+import com.supwisdom.dlpay.water.domain.TArea;
import com.supwisdom.dlpay.water.service.DeviceService;
import com.supwisdom.dlpay.water.system.bean.DeviceSearchBean;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
import java.util.*;
@Service
public class DeviceServiceImpl implements DeviceService {
- @Autowired
- private DeviceDao deviceDao;
+ @Autowired
+ private DeviceDao deviceDao;
- @Autowired
- private RegionDao regionDao;
+ @Autowired
+ private RegionDao regionDao;
- @Override
- public boolean existSubDevice(Integer regino) {
- List<TDevice> devices = deviceDao.findByRegino(regino);
- return devices != null && devices.size() != 0;
+ @Override
+ public boolean existSubDevice(Integer regino) {
+ List<TDevice> devices = deviceDao.findByRegino(regino);
+ return devices != null && devices.size() != 0;
+ }
+
+ @Override
+ public PageResult<TDevice> queryDeviceList(DeviceSearchBean param) {
+ Pageable pageable = PageRequest.of(param.getPageNo() - 1, param.getPageSize());
+ return new PageResult<>(deviceDao.findAll(pageable));
+ }
+
+ @Override
+ public TDevice queryDeviceById(String devino) {
+ Optional<TDevice> optional = deviceDao.findById(devino);
+ return optional.orElse(null);
+ }
+
+ @Override
+ public boolean updateDevice(TDevice device) {
+ Optional<TDevice> deviOption = deviceDao.findById(device.getDeviceno());
+ Optional<TArea> regiOption = regionDao.findByAvailableAndRegino(1, device.getAreano());
+ if (deviOption.isPresent() && regiOption.isPresent()) {
+ TDevice oldDevice = deviOption.get();
+ TArea region = regiOption.get();
+ oldDevice.setDevicename(device.getDevicename());
+ oldDevice.setAreano(region.getAreano());
+ deviceDao.save(oldDevice);
+ return true;
}
+ return false;
+ }
- @Override
- public PageResult<TDevice> queryDeviceList(DeviceSearchBean param) {
- Pageable pageable = PageRequest.of(param.getPageNo() - 1, param.getPageSize());
- return new PageResult<>(deviceDao.findAll(pageable));
+ @Override
+ public boolean saveDevice(TDevice device) {
+ Optional<TArea> regiOption = regionDao.findByAvailableAndRegino(1, device.getAreano());
+ if (regiOption.isPresent()) {
+ TArea region = regiOption.get();
+ device.setAreano(region.getAreano());
+ device.setDeviceStatus("正常");
+ deviceDao.save(device);
+ return true;
}
+ return false;
+ }
- @Override
- public TDevice queryDeviceById(Integer devino) {
- Optional<TDevice> optional = deviceDao.findById(devino);
- return optional.orElse(null);
+ @Override
+ public Map<String, Object> checkParams(TDevice device) {
+ Map<String, Object> result = new HashMap<>();
+ if (null == device.getDevicename()) {
+ result.put("flag", false);
+ result.put("msg", "设备名称不能为空");
+ return result;
}
+ if (null == device.getDeviceno()) {
+ result.put("flag", false);
+ result.put("msg", "设备编号不能为空");
+ return result;
+ }
+ if (device.getDeviceno().toString().length() != 8) {
+ result.put("flag", false);
+ result.put("msg", "请输入合法的设备编号");
+ return result;
+ }
+ Optional<TDevice> optional = deviceDao.findById(device.getDeviceno());
+ List<TDevice> devices;
+ if (optional.isPresent()) {
+ // 更新
+ devices = deviceDao.findByDevinameAndDevinoNot(device.getDevicename(), device.getDeviceno());
+ result.put("type", "update");
+ } else {
+ // 新增
+ devices = deviceDao.findByDeviname(device.getDevicename());
+ result.put("type", "insert");
+ }
+ if (devices != null && devices.size() != 0) {
+ result.put("flag", false);
+ result.put("msg", "已存在的设备名");
+ return result;
+ }
+ result.put("flag", true);
+ return result;
+ }
- @Override
- public boolean updateDevice(TDevice device) {
- Optional<TDevice> deviOption = deviceDao.findById(device.getDevino());
- Optional<TRegion> regiOption = regionDao.findByAvailableAndRegino(1, device.getRegino());
- if (deviOption.isPresent() && regiOption.isPresent()) {
- TDevice oldDevice = deviOption.get();
- TRegion region = regiOption.get();
- oldDevice.setDeviname(device.getDeviname());
- oldDevice.setRegino(region.getRegino());
- oldDevice.setReginame(region.getRegiName());
- deviceDao.save(oldDevice);
- return true;
- }
- return false;
+ @Override
+ public boolean deleteDevice(String devino) {
+ TDevice device = queryDeviceById(devino);
+ if (device != null) {
+ device.setDeviceStatus("注销");
+ deviceDao.save(device);
+ return true;
}
+ return false;
+ }
- @Override
- public boolean saveDevice(TDevice device) {
- Optional<TRegion> regiOption = regionDao.findByAvailableAndRegino(1, device.getRegino());
- if (regiOption.isPresent()) {
- TRegion region = regiOption.get();
- device.setReginame(region.getRegiName());
- device.setDevistatus("正常");
- deviceDao.save(device);
- return true;
- }
- return false;
- }
+ @Override
+ public List<String> groupStatus() {
+ List<String> status = deviceDao.groupStatus();
+ return status == null || status.size() == 0 ? null : status;
+ }
- @Override
- public Map<String, Object> checkParams(TDevice device) {
- Map<String, Object> result = new HashMap<>();
- if (null == device.getDeviname()) {
- result.put("flag", false);
- result.put("msg", "设备名称不能为空");
- return result;
- }
- if (null == device.getDevino()) {
- result.put("flag", false);
- result.put("msg", "设备编号不能为空");
- return result;
- }
- if (device.getDevino().toString().length() != 8) {
- result.put("flag", false);
- result.put("msg", "请输入合法的设备编号");
- return result;
- }
- Optional<TDevice> optional = deviceDao.findById(device.getDevino());
- List<TDevice> devices;
- if (optional.isPresent()) {
- // 更新
- devices = deviceDao.findByDevinameAndDevinoNot(device.getDeviname(), device.getDevino());
- result.put("type", "update");
- } else {
- // 新增
- devices = deviceDao.findByDeviname(device.getDeviname());
- result.put("type", "insert");
- }
- if (devices != null && devices.size() != 0) {
- result.put("flag", false);
- result.put("msg", "已存在的设备名");
- return result;
- }
- result.put("flag", true);
- return result;
- }
-
- @Override
- public boolean deleteDevice(Integer devino) {
- TDevice device = queryDeviceById(devino);
- if (device != null) {
- device.setDevistatus("注销");
- deviceDao.save(device);
- return true;
- }
- return false;
- }
-
- @Override
- public List<String> groupStatus() {
- List<String> status = deviceDao.groupStatus();
- return status == null || status.size() == 0 ? null : status;
- }
-
- @Override
- public PageResult<TDevice> queryDeviceByParams(DeviceSearchBean param) {
- Pageable pageable = PageRequest.of(param.getPageNo() - 1, param.getPageSize());
- Specification<TDevice> specification = (Specification<TDevice>) (root, query, cb) -> {
- List<Predicate> predicates = new ArrayList<>();
- if (param.getDevino() != null) {
- predicates.add(cb.equal(root.get("devino").as(Integer.class), param.getDevino()));
- }
- if (param.getRegino() != null) {
- predicates.add(cb.equal(root.get("regino").as(Integer.class), param.getRegino()));
- }
- if (param.getDevistatus() != null) {
- predicates.add(cb.equal(root.get("devistatus").as(String.class), param.getDevistatus()));
- }
- if (param.getDeviname() != null) {
- predicates.add(cb.like(root.get("deviname"), "%" + param.getDeviname() + "%"));
- }
- Predicate[] pre = new Predicate[predicates.size()];
- return query.where(predicates.toArray(pre)).getRestriction();
- };
- return new PageResult<>(deviceDao.findAll(specification, pageable));
- }
+ @Override
+ public PageResult<TDevice> queryDeviceByParams(DeviceSearchBean param) {
+ Pageable pageable = PageRequest.of(param.getPageNo() - 1, param.getPageSize());
+ Specification<TDevice> specification = (Specification<TDevice>) (root, query, cb) -> {
+ List<Predicate> predicates = new ArrayList<>();
+ if (param.getDevino() != null) {
+ predicates.add(cb.equal(root.get("devino").as(Integer.class), param.getDevino()));
+ }
+ if (param.getRegino() != null) {
+ predicates.add(cb.equal(root.get("regino").as(Integer.class), param.getRegino()));
+ }
+ if (param.getDevistatus() != null) {
+ predicates.add(cb.equal(root.get("devistatus").as(String.class), param.getDevistatus()));
+ }
+ if (param.getDeviname() != null) {
+ predicates.add(cb.like(root.get("deviname"), "%" + param.getDeviname() + "%"));
+ }
+ Predicate[] pre = new Predicate[predicates.size()];
+ return query.where(predicates.toArray(pre)).getRestriction();
+ };
+ return new PageResult<>(deviceDao.findAll(specification, pageable));
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/water/service/impl/RegionServiceImpl.java b/src/main/java/com/supwisdom/dlpay/water/service/impl/RegionServiceImpl.java
deleted file mode 100644
index fe9b856..0000000
--- a/src/main/java/com/supwisdom/dlpay/water/service/impl/RegionServiceImpl.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package com.supwisdom.dlpay.water.service.impl;
-
-import com.supwisdom.dlpay.framework.util.PageResult;
-import com.supwisdom.dlpay.framework.util.StringUtil;
-import com.supwisdom.dlpay.water.system.bean.RegionSearchBean;
-import com.supwisdom.dlpay.water.dao.RegionDao;
-import com.supwisdom.dlpay.water.domain.TRegion;
-import com.supwisdom.dlpay.water.service.RegionService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.domain.Pageable;
-import org.springframework.stereotype.Service;
-
-import java.util.*;
-
-@Service
-public class RegionServiceImpl implements RegionService {
-
- @Autowired
- private RegionDao regionDao;
-
- /**
- * 根据父区域id查询区域列表
- *
- * @param param
- * @return
- */
- @Override
- public PageResult<TRegion> queryRegionsByParentId(RegionSearchBean param) {
- Pageable pageable = PageRequest.of(param.getPageNo() - 1, param.getPageSize());
- PageResult<TRegion> result = new PageResult<>(regionDao.findByAvailableAndParentId(1, param.getParentId(), pageable));
- List<TRegion> data = result.getData();
- if (param.getPageNo()==1) {
- Optional<TRegion> optional = regionDao.findByAvailableAndRegino(1, param.getParentId());
- if (optional.isPresent()) {
- data = new ArrayList<>(data);
- data.add(0, optional.get());
- result.setData(data);
- }
- }
- return result;
- }
-
- public List<Map<String, Object>> getRegionTree(List<TRegion> regions, Integer parentId) {
- List<Map<String, Object>> list = new ArrayList<>(0);
- for (TRegion region : regions) {
- if (parentId.equals(region.getParentId())) {
- Map<String, Object> map = new HashMap<>(0);
- map.put("title", region.getRegiName());
- map.put("id", region.getRegino());
- map.put("children", getRegionTree(regions, region.getRegino()));
- list.add(map);
- }
- }
- return list;
- }
-
- public List<TRegion> queryAllRegion() {
- List<TRegion> regions = regionDao.findAllByAvailable(1);
- return regions.size() != 0 ? regions : null;
- }
-
- @Override
- public List<TRegion> queryAllNotFLevelRegion() {
- List<TRegion> regions = regionDao.findByAvailableAndLevelNot(1, 1);
- return regions.size() != 0 ? regions : null;
- }
-
- @Override
- public PageResult<TRegion> queryRegionsBySearchKey(RegionSearchBean param) {
- Pageable pageable = PageRequest.of(param.getPageNo() - 1, param.getPageSize());
- if (!StringUtil.isEmpty(param.getSearchKey())) {
- return new PageResult<>(regionDao.findAllByAvailableAndRegiNameContaining(1, param.getSearchKey(), pageable));
- }
- return new PageResult<>(regionDao.findAllByAvailable(1, pageable));
- }
-
- @Override
- public boolean saveRegion(TRegion region) {
- if (region.getParentId() == 0) {
- region.setParentName("无");
- region.setLevel(1);
- } else {
- Optional<TRegion> optional = regionDao.findByAvailableAndRegino(1, region.getParentId());
- if (optional.isPresent()) {
- region.setParentName(optional.get().getRegiName());
- region.setLevel(optional.get().getLevel() + 1);
- }else {
- return false;
- }
- }
- region.setAvailable(1);
- regionDao.save(region);
- return true;
- }
-
- public boolean updateRegion(TRegion region) {
- Optional<TRegion> optional = regionDao.findByAvailableAndRegino(1, region.getRegino());
- if (optional.isPresent()) {
- TRegion oldRegion = optional.get();
- oldRegion.setRegiName(region.getRegiName());
- oldRegion.setAddress(region.getAddress());
- oldRegion.setRemarks(region.getRemarks());
- regionDao.save(oldRegion);
- return true;
- }
- return false;
- }
-
- @Override
- public boolean checkRegiName(TRegion region) {
- if (region.getRegino() == null) {
- return regionDao.findAllByAvailableAndRegiName(1, region.getRegiName()) == null;
- }else {
- return regionDao.findByAvailableAndRegiNameAndReginoNot(1,
- region.getRegiName(),
- region.getRegino()) == null;
- }
- }
-
- @Override
- public boolean deleteRegion(Integer regino) {
- Optional<TRegion> optional = regionDao.findByAvailableAndRegino(1, regino);
- if (optional.isPresent()) {
- TRegion region = optional.get();
- region.setAvailable(0);
- regionDao.save(region);
- return true;
- }
- return false;
- }
-
- @Override
- public boolean existSubRegion(Integer regino) {
- List<TRegion> subRegion = regionDao.findByAvailableAndParentId(1, regino);
- return subRegion != null && subRegion.size() != 0;
- }
-
-
-}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/ThirdPayCall.kt b/src/main/kotlin/com/supwisdom/dlpay/api/ThirdPayCall.kt
deleted file mode 100644
index 3b5bd5e..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/ThirdPayCall.kt
+++ /dev/null
@@ -1,245 +0,0 @@
-package com.supwisdom.dlpay.api
-
-import com.google.gson.Gson
-import com.sun.jersey.api.client.Client
-import com.sun.jersey.api.client.ClientResponse
-import com.supwisdom.dlpay.api.bean.BaseResp
-import com.supwisdom.dlpay.api.bean.SupStatusRevResp
-import com.supwisdom.dlpay.api.bean.SupYktResp
-import com.supwisdom.dlpay.api.bean.WechatReqResp
-import com.supwisdom.dlpay.api.domain.TPersondtl
-import com.supwisdom.dlpay.api.domain.TShopdtl
-import com.supwisdom.dlpay.framework.util.*
-import com.supwisdom.dlpay.util.Code
-
-class CallBackResp {
- var retcode: String = "99"
- var retmsg: String? = null
- val data = mutableMapOf<String, String>()
- fun add(key: String, value: String) {
- this.data.plus(mapOf(key to value))
- }
-}
-
-class CallService {
-
- companion object {
- fun callYktPay(config: Map<String, String?>, paydtl: TPersondtl, time: String, stuempno: String, yktshopid: String, devphyid: String?): CallBackResp {
- val code = CallBackResp()
- val appid = config["appid"]
- if (appid.isNullOrEmpty()) {
- code.retcode = "1"
- code.retmsg = "一卡通支付方式未启用或未配置"
- return code
- }
-
- val appkey = config["appkey"]
- val orderurl = config["orderurl"]
-
- val params = hashMapOf<String, String?>()
- params.put("partner_id", appid)
- params.put("stuempno", stuempno)
- params.put("tradeno", paydtl.refno)
- params.put("tradename", paydtl.payinfo)
- params.put("amount", MoneyUtil.YuanToFen(paydtl.amount).toString())
- params.put("shopid", yktshopid)
- params.put("devphyid", devphyid)
- params.put("calcmanagefee", "T") //是否计算费率
- params.put("timestamp", time)
- params.put("sign_method", "HMAC");
- params.put("limitflag", "off") //是否判断消费限额,on-判断;off-不判断。默认on(判断限额)。为空或不为off都是on;
- var signstr = StringUtil.createLinkString(HmacUtil.paraFilter(params))
- val sign = HmacUtil.HMACSHA1(signstr, appkey)
- signstr = "$signstr&sign=$sign&sourcetype=food"
- val c = Client.create()
- c.setConnectTimeout(20000)
- val r = c.resource(orderurl)
- val respClient = r.post(ClientResponse::class.java, signstr)
- if (200 == respClient.status) {
- val ret = respClient.getEntity(String::class.java)
- if (ret != null) {
- try {
- val gson = Gson()
- val result = gson.fromJson(ret, SupYktResp::class.java)
- if (result == null) {
- code.retcode = "1"
- code.retmsg = "返回内容为空"
- return code
- }
- if ("0" != result.retcode) {
- if ("30" == result.retcode) {
- if (result.other != null) {
- try {
- val supStatusRevResp = gson.fromJson(result.other,
- SupStatusRevResp::class.java)
- if (supStatusRevResp != null) {
- //同流水号,同一笔已经支付完成的,不重复支付。
- if (3 == supStatusRevResp.status
- && supStatusRevResp.revflag != null
- && !supStatusRevResp.revflag) {
- code.retcode = "0"
- code.retmsg = "成功"
- return code
- }
- }
- } catch (e: Exception) {
- e.printStackTrace()
- }
- }
- }
- code.retcode = "1"
- code.retmsg = "交易失败:" + result.retmsg
- return code
- }
- code.retcode = "0"
- code.retmsg = "成功"
- return code
- } catch (e: Exception) {
- e.printStackTrace()
- }
- }
- }
- code.retcode = "1"
- code.retmsg = "请求失败"
- return code
- }
-
- fun callWechatPay(config: Map<String, String>, paydtl: TPersondtl, time: String, wechattype: String,
- realip: String?, qrcode: String?, openid: String?): BaseResp {
- val code = BaseResp()
- val appid = config["appid"]
- if (appid.isNullOrEmpty()) {
- code.retcode = "1"
- code.retmsg = "微信支付方式未启用或未配置"
- return code
- }
- val appkey = config["appkey"]
- val orderurl = config["orderurl"]
- val mchid = config["mchid"]
- val wechatReqResp = WechatReqResp()
- wechatReqResp.openid = openid
- wechatReqResp.appid = appid
- wechatReqResp.total_fee = MoneyUtil.YuanToFen(paydtl.amount)
- wechatReqResp.body = paydtl.payinfo
- wechatReqResp.key = appkey
- wechatReqResp.mch_id = mchid
- wechatReqResp.notify_url = config["notifyurl"] + "/notify/wechat"
- wechatReqResp.out_trade_no = paydtl.refno
- wechatReqResp.spbill_create_ip = realip
- val c = Client.create()
- c.setConnectTimeout(20000)
- return when (wechattype) {
- "qrcode" -> {
- code
- }
- "app" -> {
- wechatReqResp.trade_type = "APP"
- code
- }
- "mp" -> {
- wechatReqResp.trade_type = "JSAPI"
- wechatReqResp.generaSign()
- val xml = wechatReqResp.generaXML()
- val r = c.resource(orderurl)
- val respClient = r.post(ClientResponse::class.java, xml)
- if (200 == respClient.status) {
- try {
- val ret = respClient.getEntity(String::class.java)
- if (ret != null) {
- val eleMap = XmlUtils.parseXml(ret)
- val retcode = eleMap["return_code"]
- val result_code = eleMap["result_code"]
- val prepay_id = eleMap["prepay_id"]
- if (!retcode.isNullOrEmpty() && "SUCCESS" == retcode
- && !result_code.isNullOrEmpty() && "SUCCESS" == result_code
- && !prepay_id.isNullOrEmpty()) {
- wechatReqResp.retcode = 0
- wechatReqResp.retmsg = "初始化成功"
- wechatReqResp.prepay_id = prepay_id
- //TODO prepay_id 是否保存
- wechatReqResp.timestamp = DateUtil.getNowSecond().toString()
- wechatReqResp.nonce_str = RandomUtils.getRandomString(30)
- wechatReqResp.generaJSAPISign()
- val params = wechatReqResp.generaJSAPIParamters()
- code.setCode(Code.SUCCESS)
- code.data = params
- } else {
- code.retcode = "1"
- code.retmsg = eleMap["return_msg"]
- }
- } else {
- code.retcode = "1"
- code.retmsg = "微信支付请求失败"
- }
- } catch (e: Exception) {
- e.printStackTrace()
- code.retcode = "1"
- code.retmsg = "微信支付请求异常"
- }
-
- } else {
- code.retcode = "1"
- code.retmsg = "微信支付请求返回失败"
- }
- code
- }
- "h5" -> {
- wechatReqResp.trade_type = "MWEB"
- wechatReqResp.scene_info = "{\"h5_info\": {\"type\":\"Wap\",\"wap_url\": \"" + config["notifyurl"] + "\",\"wap_name\": \"${paydtl.payinfo}\"}}"
- val xml = wechatReqResp.generaXML()
- val r = c.resource(orderurl)
- val respClient = r.post(ClientResponse::class.java, xml)
- if (200 == respClient.status) {
- try {
- val ret = respClient.getEntity(String::class.java)
- if (ret != null) {
- val eleMap = XmlUtils.parseXml(ret)
- val retcode = eleMap["return_code"]
- val result_code = eleMap["result_code"]
- val prepay_id = eleMap["prepay_id"]
- val mweb_url = eleMap["mweb_url"]
- if (!retcode.isNullOrEmpty() && "SUCCESS" == retcode
- && !result_code.isNullOrEmpty() && "SUCCESS" == result_code
- && !prepay_id.isNullOrEmpty()) {
- wechatReqResp.retcode = 0
- wechatReqResp.retmsg = "初始化成功"
- wechatReqResp.prepay_id = prepay_id
- wechatReqResp.mweb_url = mweb_url
- code.setCode(Code.SUCCESS)
- code.data = mweb_url
- } else {
- code.retcode = "1"
- code.retmsg = eleMap["return_msg"]
- }
- } else {
- code.retcode = "1"
- code.retmsg = "微信支付请求失败"
- }
- } catch (e: Exception) {
- e.printStackTrace()
- code.retcode = "1"
- code.retmsg = "微信支付请求异常"
- }
-
- } else {
- code.retcode = "1"
- code.retmsg = "微信支付请求返回失败"
- }
- code
- }
- else -> {
- code.retcode = "1"
- code.retmsg = "未标识的类型:wechattype=$wechattype"
- code
- }
- }
- }
-
- fun CallCitizenCardPay(config: Map<String, String?>, paydtl: TShopdtl): CallBackResp {
- val resp = CallBackResp()
- resp.retcode = "0"
- // TODO: 代扣逻辑
- return resp
- }
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/controller/consume_api_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/api/controller/consume_api_controller.kt
deleted file mode 100644
index 4a8241d..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/controller/consume_api_controller.kt
+++ /dev/null
@@ -1,516 +0,0 @@
-package com.supwisdom.dlpay.api.controller
-
-import com.supwisdom.dlpay.api.AccountProxy
-import com.supwisdom.dlpay.api.CallService
-import com.supwisdom.dlpay.api.TransactionBuilder
-import com.supwisdom.dlpay.api.bean.*
-import com.supwisdom.dlpay.api.dao.TransactionMainDao
-import com.supwisdom.dlpay.api.domain.TAccount
-import com.supwisdom.dlpay.api.service.AccountUtilServcie
-import com.supwisdom.dlpay.api.service.ConsumePayService
-import com.supwisdom.dlpay.api.service.TransactionService
-import com.supwisdom.dlpay.api.service.UserService
-import com.supwisdom.dlpay.exception.RequestParamCheckException
-import com.supwisdom.dlpay.exception.TransactionCheckException
-import com.supwisdom.dlpay.exception.TransactionException
-import com.supwisdom.dlpay.framework.ResponseBodyBuilder
-import com.supwisdom.dlpay.framework.domain.TShopacc
-import com.supwisdom.dlpay.framework.service.CommonService
-import com.supwisdom.dlpay.framework.service.SystemUtilService
-import com.supwisdom.dlpay.framework.util.*
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.http.ResponseEntity
-import org.springframework.security.core.Authentication
-import org.springframework.web.bind.annotation.PostMapping
-import org.springframework.web.bind.annotation.RequestBody
-import org.springframework.web.bind.annotation.RequestMapping
-import org.springframework.web.bind.annotation.RestController
-import javax.servlet.http.HttpServletRequest
-import javax.servlet.http.HttpServletResponse
-
-@RestController
-@RequestMapping("/api/consume")
-class ConsumeController {
- @Autowired
- lateinit var accountUtilServcie: AccountUtilServcie
- @Autowired
- lateinit var userService: UserService
- @Autowired
- lateinit var systemUtilService: SystemUtilService
- @Autowired
- lateinit var consumePayService: ConsumePayService
- @Autowired
- lateinit var commonService: CommonService
-
- @Autowired
- lateinit var transactionMainDao: TransactionMainDao
-
- @Autowired
- lateinit var transactionService: TransactionService
-
- /**
- * 流水结果查询统一接口
- * */
- fun queryDtlResult(@RequestBody param: QueryDtlResultParam,
- request: HttpServletRequest, response: HttpServletResponse): ResponseEntity<Any> {
- try {
- if (param.checkParam() && param.checkSign(commonService.getAppidSecretByRequest(request))) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.REQUEST_SIGN_ERROR, "参数签名错误"))
- }
-
- val dtl = transactionMainDao.findByRefnoForUpdate(param.refno)
- ?: return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.TRANSACTION_NOT_EXISTS, "交易参考号错误<${param.refno}>"))
-
- val person = if (dtl.person) {
- userService.findPersonByUserid(dtl.personDtl.userid)
- } else {
- null
- }
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .data("refno", dtl.refno)
- .data("amount", dtl.personDtl.amount)
- .data("paytype", dtl.personDtl.sourceType)
- .data("payinfo", dtl.personDtl.payinfo)
- .also {
- if (null != person) {
- it.data("name", person.name)
- }
- }
- .success("查询成功"))
- } catch (ex: RequestParamCheckException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .requestException(ex, "请求参数错误"))
- } catch (et: TransactionException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .transException(et, "查询错误"))
- }
- }
-
- private fun consumeMealer(@Suppress("UNUSED_PARAMETER") param: CitizenCardPayinitParam,
- builder: TransactionBuilder,
- feetype: ConsumeFeetype, person: TAccount, shop: TShopacc) {
- val feetypeConfig = accountUtilServcie.readFeetype(TradeDict.FEETYPE_CONSUME_MEALER,
- TradeDict.PAYTYPE_BALANCE)
- val amount = feetype.amount / 100.0
- when (feetypeConfig.crsubjno) {
- shop.subjno -> {
- builder.addDebitCreditRecord(AccountProxy(person), AccountProxy(shop),
- amount, feetypeConfig.summary)
- .shop().also {
- it.addAmount(amount)
- }
- }
- else -> {
- val subject = accountUtilServcie.readSubject(feetypeConfig.crsubjno)
- builder.addDebitCreditRecord(AccountProxy(person), AccountProxy(subject),
- amount, feetypeConfig.summary)
- }
- }
-
- }
-
- private fun consumeDiscount(@Suppress("UNUSED_PARAMETER") param: CitizenCardPayinitParam,
- builder: TransactionBuilder,
- feetype: ConsumeFeetype, person: TAccount, shop: TShopacc) {
- val feetypeConfig = accountUtilServcie.readFeetype(TradeDict.FEETYPE_CONSUME_MEALER,
- TradeDict.PAYTYPE_BALANCE)
- val amount = feetype.amount / 100.0
- when (feetypeConfig.drsubjno) {
- shop.subjno -> {
- builder.addDebitCreditRecord(AccountProxy(shop), AccountProxy(person),
- amount, feetypeConfig.summary)
- }
- else -> {
- val subject = accountUtilServcie.readSubject(feetypeConfig.drsubjno)
- builder.addDebitCreditRecord(AccountProxy(subject), AccountProxy(shop),
- amount, feetypeConfig.summary)
- }
- }
- }
-
- /**
- * ============================================================================
- * 账户【余额支付】
- * ============================================================================
- * */
- @PostMapping("/balance/pay")
- fun balancePay(@RequestBody param: CitizenCardPayinitParam, authentication: Authentication): ResponseEntity<Any> {
- try {
- if (param.checkParam() && param.checkSign(commonService.getSecretByAppid(authentication.name))) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.REQUEST_SIGN_ERROR, "参数签名错误"))
- }
-
- val person = userService.findPersonByIdentityCheckStatus(param.cardNo)
- if (consumePayService.checkShopPaytype(param.shopaccno, TradeDict.PAYTYPE_BALANCE)) {
- val account = accountUtilServcie.readAccount(person.userid)
- val shopacc = accountUtilServcie.readShopbyShopaccno(param.shopaccno)
-
- val builder = TransactionBuilder().apply {
- setTransInfo(param.transdate, param.transtime,
- TradeCode.TRANSCODE_BALANCE_PAY,
- TradeDict.PAYTYPE_BALANCE)
- setOutTransInfo(shopacc.shopaccno, param.billno)
- operator(param.shopaccno, TradeDict.OPERTYPE_SHOP)
- payinfo = "账户余额消费"
- description = "账户余额消费"
- }.person(account).apply {
- setAmount(param.amount / 100.0, TradeDict.TRADE_FLAG_OUT)
- opposite = AccountProxy(shopacc)
- }.and().shop(shopacc).apply {
- setAmount(param.amount / 100.0, TradeDict.TRADE_FLAG_IN)
- opposite = AccountProxy(account)
- }.and()
-
- param.feelist?.forEach {
- when (it.feetype) {
- TradeDict.FEETYPE_CONSUME_MEALER -> {
- consumeMealer(param, builder, it, account, shopacc)
- }
- TradeDict.FEETYPE_CONSUME_DISCOUNT -> {
- consumeDiscount(param, builder, it, account, shopacc)
- }
- else -> throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "支付费率清单不支持feetype<${it.feetype}>")
- }
- }
-
- val dtl = builder.init(transactionService)
- transactionService.success(dtl.refno)
-
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .data("refno", dtl.refno)
- .data("amount", dtl.personDtl.amount)
- .success("交易成功"))
- }
-
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.BUSINESS_PAYTYPE_NOSUPPORT, "不支持支付方式<账户余额>"))
-
- } catch (ex: RequestParamCheckException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .requestException(ex, "请求参数错误"))
- } catch (et: TransactionException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .transException(et, "业务处理错误"))
- }
- }
-
-
- /**
- * ============================================================================
- * 市民卡【交易初始化】
- * ============================================================================
- * */
- @PostMapping("/citizencard/payinit")
- fun citizencardPayinit(@RequestBody param: CitizenCardPayinitParam, authenticateAction: Authentication): ResponseEntity<Any> {
- try {
- if (param.checkParam() && param.checkSign(commonService.getSecretByAppid(authenticateAction.name))) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.REQUEST_SIGN_ERROR, "参数签名错误"))
- }
-
- val person = userService.findPersonByIdentityCheckStatus(param.cardNo)
- if (consumePayService.checkShopPaytype(param.shopaccno, TradeDict.PAYTYPE_CITIZEN_CARD)) {
-
- val account = accountUtilServcie.readAccount(person.userid)
- val shopacc = accountUtilServcie.readShopbyShopaccno(param.shopaccno)
- val subject = accountUtilServcie.readSubject(Subject.SUBJNO_PAY_CITIZEN_CARD)
- val transaction = TransactionBuilder().apply {
- setTransInfo(param.transdate, param.transtime,
- TradeCode.TRANSCODE_CITIZENCARD_PAY,
- TradeDict.PAYTYPE_CITIZEN_CARD)
- setOutTransInfo(shopacc.shopaccno, param.billno)
- operator(param.shopaccno, TradeDict.OPERTYPE_SHOP)
- payinfo = "市民卡代扣消费"
- description = "市民卡代扣消费"
- }.person(account).apply {
- setAmount(param.amount / 100.0, TradeDict.TRADE_FLAG_OUT)
- opposite = AccountProxy(shopacc)
- }.and().shop(shopacc).apply {
- setAmount(param.amount / 100.0, TradeDict.TRADE_FLAG_IN)
- opposite = AccountProxy(account)
- }.and().addDebitCreditRecord(AccountProxy(subject), AccountProxy(account),
- param.amount / 100.0, "市民卡代扣消费")
- .addDebitCreditRecord(AccountProxy(account), AccountProxy(shopacc),
- param.amount / 100.0, "市民卡代扣消费")
- .also { builder ->
- param.feelist?.forEach {
- //fixme: 科目 -> 商户 与个人无关
- val feeconfig = accountUtilServcie.readFeetype(it.feetype,
- TradeDict.PAYTYPE_CITIZEN_CARD)
- val subj = accountUtilServcie.readSubject(feeconfig.drsubjno)
- builder.addDebitCreditRecord(AccountProxy(subj), AccountProxy(shopacc),
- it.amount / 100.0, feeconfig.summary)
-
- }
- }.init(transactionService)
-
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .data("refno", transaction.refno)
- .data("amount", transaction.shopDtl.amount)
- .success("交易初始化成功"))
- }
-
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.BUSINESS_PAYTYPE_NOSUPPORT, "不支持支付方式<市民卡代扣>"))
-
- } catch (ex: RequestParamCheckException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .requestException(ex, "请求参数错误"))
- } catch (et: TransactionException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .transException(et, "业务处理错误"))
- }
- }
-
- /**
- * ============================================================================
- * 市民卡【交易确认】
- * ============================================================================
- * */
- @PostMapping("/citizencard/payfinish")
- fun citizencardPayinit(@RequestBody param: CitizenCardPayfinishParam, authentication: Authentication): ResponseEntity<Any> {
- try {
- if (param.checkParam() && param.checkSign(commonService.getSecretByAppid(authentication.name))) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.REQUEST_SIGN_ERROR, "参数签名错误"))
- }
-
- val code = transactionService.wip(param.refno).let {
- CallService.CallCitizenCardPay(
- consumePayService.getPaytypeConfig(TradeDict.PAYTYPE_CITIZEN_CARD, it.shopDtl.shopaccno),
- it.shopDtl)
- }
- if (code.retcode == "0") {
- transactionService.success(param.refno).let {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .data("refno", it.refno)
- .data("billno", it.outTradeNo)
- .success("交易确认成功"))
- }
- } else {
- transactionService.fail(param.refno).let {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.BUSINESS_DEAL_ERROR, "交易扣费失败-${code.retmsg}"))
- }
- }
- } catch (ex: RequestParamCheckException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .requestException(ex, "请求参数错误"))
- } catch (et: TransactionException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .transException(et, "业务处理错误"))
- }
- }
-
-
- /**
- * ============================================================================
- * 一卡通支付【交易初始化】
- * ============================================================================
- * */
- @PostMapping("/ykt/payinit")
- fun yktPayInit(@RequestBody param: YktCardPayinitParam, authentication: Authentication): ResponseEntity<Any> {
- try {
- if (param.checkParam() && param.checkSign(commonService.getSecretByAppid(authentication.name))) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.REQUEST_SIGN_ERROR, "参数签名错误"))
- }
-//
-// val person = param.uid?.let { userService.findByThirdUniqueIdenty(it) } //没注册,可能匿名?
-// if (consumePayService.checkShopPaytype(param.shopaccno, TradeDict.PAYTYPE_YKT_CARD, person == null)) {
-// val dtl = PersonTransBuilder.newBuilder(accountUtilServcie)
-// .chooseTradetype(Tradetype.CONSUME) //消费
-// .also {
-// if (null != person) it.setOwner(person)
-// }
-// .setTransinfo(TradeCode.TRANSCODE_YKTCARD_PAY, "一卡通支付")
-// .setTransDatetime(param.transdate, param.transtime) //交易时间
-// .selectPaytype(TradeDict.PAYTYPE_YKT_CARD, param.stuempno)
-// .addDetail(AccountHolder.subject(Subject.SUBJNO_PAY_YKT),
-// AccountHolder.shop(param.shopaccno),
-// param.amount / 100.0, "一卡通支付")
-// .also { builder ->
-// param.feelist?.forEach {
-// //fixme: 科目 -> 商户 与个人无关
-// builder.addDetail(AccountHolder.feetype(it.feetype, TradeDict.PAYTYPE_YKT_CARD)
-// .with(AccountHolder.shop(param.shopaccno))
-// .with(AccountHolder.subject(Subject.SUBJNO_PAY_YKT))
-// , it.amount / 100.0)
-// }
-// }
-// .addExtendParam("stuempno", param.stuempno)
-// .addExtendParam("yktshopid", param.yktshopid ?: "")
-// .addExtendParam("devphyid", param.devphyid ?: "")
-// //.addExtendParam(param.extendmap) //fixme: 保存调一卡通附加参数 (是否直接传附加参数map)
-// .init(personBalancePayService)
-//
-// return ResponseEntity.ok(ResponseBodyBuilder.create()
-// .data("refno", dtl.refno)
-// .data("amount", dtl.amount)
-// .success("交易初始化成功"))
-//
-// }
-
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.BUSINESS_PAYTYPE_NOSUPPORT, "不支持支付方式<一卡通支付>"))
- } catch (ex: RequestParamCheckException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .requestException(ex, "请求参数错误"))
- } catch (et: TransactionException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .transException(et, "业务处理错误"))
- }
- }
-
-
- /**
- * ============================================================================
- * 一卡通支付【交易确认】
- * ============================================================================
- * */
- @PostMapping("/ykt/payfinish")
- fun yktPayFinish(@RequestBody param: CitizenCardPayfinishParam, authentication: Authentication): ResponseEntity<Any> {
- try {
- if (param.checkParam() && param.checkSign(commonService.getSecretByAppid(authentication.name))) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.REQUEST_SIGN_ERROR, "参数签名错误"))
- }
-//
-// var dtl = PersonTransBuilder.newBuilder(accountUtilServcie)
-// .setRefno(param.refno)
-// .wip(personBalancePayService)
-// val extendMap = consumePayService.getUserdtlExtendParamMap(dtl.refno)
-// val code = CallService.callYktPay(consumePayService.getPaytypeConfig(TradeDict.PAYTYPE_YKT_CARD, dtl.shopaccno, dtl.userid == null),
-// dtl, DateUtil.getNow(), extendMap["stuempno"]!!, extendMap["yktshopid"]!!, extendMap["devphyid"])
-// if (code.retcode == "0") {
-// dtl = PersonTransBuilder.newBuilder(accountUtilServcie)
-// .setRefno(param.refno)
-// .addResult(code.data)
-// .success(personBalancePayService) //流水置成功
-//
-// return ResponseEntity.ok(ResponseBodyBuilder.create()
-// .data("refno", dtl.refno)
-// .data("billno", dtl.outtradeno)
-// .success())
-// } else {
-// PersonTransBuilder.newBuilder(accountUtilServcie)
-// .setRefno(param.refno)
-// .addResult("errmsg", code.retmsg!!)
-// .finish(personBalancePayService, TradeDict.DTL_STATUS_FAIL) //流水置成功
-//
-// return ResponseEntity.ok(ResponseBodyBuilder.create()
-// .fail(TradeErrorCode.BUSINESS_DEAL_ERROR, "交易扣费失败-${code.retmsg}"))
-// }
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.BUSINESS_DEAL_ERROR, "交易扣费失败"))
- } catch (ex: RequestParamCheckException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .requestException(ex, "请求参数错误"))
- } catch (et: TransactionException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .transException(et, "业务处理错误"))
- }
- }
-
-// ============================================== //
-//
-// @GetMapping("/account/payinit")
-// fun accountPayInit(userid: String, amount: Int, manageFee: Int): ResponseEntity<Any> {
-// val dtl = PersonTransBuilder.newBuilder(accountUtilServcie)
-// .setTransDatetime("20190411", "112311")
-// .enableOverdraft(false)
-// .addDetail(AccountHolder.person(userid),
-// AccountHolder.shop("12323"),
-// amount / 100.0, "")
-// .addDetail(AccountHolder.person(userid), AccountHolder.transType(301),
-// manageFee / 100.0, "")
-// .done(personBalancePayService, false)
-//
-// return ResponseEntity.ok(dtl)
-// }
-//
-// @GetMapping("/account/payfinish")
-// fun accountPayFinish(refno: String): ResponseEntity<Any> {
-// val dtl = PersonTransBuilder.newBuilder(accountUtilServcie)
-// .done(refno, TradeDict.DTL_STATUS_SUCCESS, personBalancePayService)
-// return ResponseEntity.ok(dtl)
-// }
-
-
-//
-// /**
-// * 微信支付
-// * wechattype
-// * qrcode-扫微信二维码支付
-// * app-原生app微信支付
-// * mp-微信公众号支付
-// * h5-微信h5支付
-// *
-// * */
-// @PostMapping("/wechat/payinit")
-// fun wechatPayInit(userid: String, amount: Int, manageFee: Int,
-// stuempno: String, shopid: String, transdate: String, transtime: String,
-// outtradeno: String, payinfo: String, feetype: String,
-// wechattype: String, realip: String?, qrcode: String?, openid: String?): ResponseEntity<Any> {
-// return try {
-// val paytype = paytypeService.getBySourceType(PaytypeUtil.WECHAT)
-// if (paytype == null || ConstantUtil.ENABLE_YES != paytype.enable) {
-// ResponseEntity.ok(ResponseBodyBuilder.create()
-// .fail(1, "支付方式未开启"))
-// }
-// val person = userService.findByThirdUniqueIdenty(stuempno)
-// val dtl = PersonTransBuilder.newBuilder(accountUtilServcie)
-// .setTransDatetime(transdate, transtime)
-// .selectPaytype(PaytypeUtil.WECHAT, payinfo)
-// .setOuttradeno(outtradeno)
-// .also {
-// if (null != person) it.setOwner(person)
-// }
-// .tryLock(true)
-// .setTransinfo(TradeCode.TRANSCODE_WECHAT, "微信支付")
-// .chooseTradetype(Tradetype.CONSUME)
-// .also {
-// when (feetype) {
-// TradeDict.FEETYPE_CONSUME_MEALER -> {
-// it.addDetail(AccountHolder.subject(Subject.SUBJNO_PAY_WECHAT),
-// AccountHolder.shop(shopid),
-// amount / 100.0, "微信支付")
-// .addDetail(AccountHolder.transType(TranstypeCode.TT_CONSUUME_MANAGE_FEE)
-// .with(AccountHolder.shop(shopid)),
-// manageFee / 100.0)
-// }
-// TradeDict.FEETYPE_CONSUME_DISCOUNT -> {
-// it.addDetail(AccountHolder.subject(Subject.SUBJNO_PAY_WECHAT),
-// AccountHolder.shop(shopid),
-// (amount - manageFee) / 100.0, "微信支付")
-// .addDetail(AccountHolder.subject(Subject.SUBJNO_CONSUME_DISCOUNT),
-// AccountHolder.shop(shopid),
-// manageFee / 100.0, "优惠折扣")
-// }
-// else -> {
-// it.addDetail(AccountHolder.subject(Subject.SUBJNO_PAY_WECHAT),
-// AccountHolder.shop(shopid),
-// amount / 100.0, "微信支付")
-// }
-// }
-// }.done(personBalancePayService, false)
-// val code = CallService.callWechatPay(paytypeService.getPaytypeConfigByPaytype(PaytypeUtil.WECHAT),
-// dtl, DateUtil.getNow(), wechattype, realip, qrcode, openid)
-// if (code.retcode == "0") {
-// ResponseEntity.ok(ResponseBodyBuilder.create()
-// .data("refno", dtl.refno)
-// .success())
-// } else {
-// ResponseEntity.ok(ResponseBodyBuilder.create()
-// .fail(TradeErrorCode.TRANSACTION_NOT_EXISTS, "交易请求失败-${code.retcode}"))
-// }
-// } catch (e: TransactionException) {
-// ResponseEntity.ok(ResponseBodyBuilder.create()
-// .transException(e, "交易初始化异常"))
-// }
-// }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/controller/notify_api_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/api/controller/notify_api_controller.kt
deleted file mode 100644
index d57c96d..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/controller/notify_api_controller.kt
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.supwisdom.dlpay.api.controller
-
-import com.supwisdom.dlpay.api.service.AccountUtilServcie
-import com.supwisdom.dlpay.api.service.SourceTypeService
-import com.supwisdom.dlpay.api.service.TransactionService
-import com.supwisdom.dlpay.framework.util.MD5
-import com.supwisdom.dlpay.framework.util.StringUtil
-import com.supwisdom.dlpay.util.PaytypeUtil
-import org.dom4j.io.SAXReader
-import org.slf4j.LoggerFactory
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.util.StringUtils
-import org.springframework.web.bind.annotation.PathVariable
-import org.springframework.web.bind.annotation.RequestMapping
-import org.springframework.web.bind.annotation.ResponseBody
-import org.springframework.web.bind.annotation.RestController
-import java.util.*
-import javax.servlet.http.HttpServletRequest
-import javax.servlet.http.HttpServletResponse
-
-/**
- * Created by shuwei on 2019/4/22.
- */
-@RestController
-@RequestMapping("/api/notify")
-class NotifyController {
- private val logger = LoggerFactory.getLogger(NotifyController::class.java)
- @Autowired
- lateinit var paytypeService: SourceTypeService
- @Autowired
- lateinit var accountUtilServcie: AccountUtilServcie
-
- @Autowired
- lateinit var transactionService: TransactionService
-
- @RequestMapping(value = ["/wechat"])
- @ResponseBody
- fun index(@PathVariable schema: String, request: HttpServletRequest,
- response: HttpServletResponse): String {
- try {
- // 解析结果存储在HashMap
- var map: MutableMap<String, String> = HashMap()
- val inputStream = request.inputStream
- // 读取输入流
- val reader = SAXReader()
- val document = reader.read(inputStream)
- // 得到xml根元素
- val root = document.rootElement
- // 得到根元素的所有子节点
- val elementList = root.elements()
- // 遍历所有子节点
- for (e in elementList) {
- map[e.name] = e.text
- logger.error("*************" + e.name + "=" + e.text + "************************")
- }
- // 释放资源
- inputStream.close()
-
- val sign = map["sign"]
- if (StringUtils.isEmpty(sign)) {
- logger.error("签名错误")
- return "<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA[签名错误]]></return_msg></xml>"
- }
- map = StringUtil.paraFilter(map)
- //TODO 校验签名
- var signStr = StringUtil.createLinkString(map)
- val config = paytypeService.getPaytypeConfigByPaytype(PaytypeUtil.WECHAT)
- if (config["appkey"].isNullOrEmpty()) {
- logger.error("签名错误")
- return "<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA[签名错误]]></return_msg></xml>"
- }
- val key = config["appkey"]
- signStr += "&key=$key"
- val signRet = MD5.encodeByMD5(signStr)
- logger.error("*******signStr=$signStr")
- if (!signRet.equals(sign, ignoreCase = true)) {
- return "<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA[签名失败]]></return_msg></xml>"
- }
- logger.error("*******signRet=$signRet,sign=$sign*****************")
- val return_code = map["return_code"]
- val result_code = map["result_code"]
- val out_trade_no = map["out_trade_no"]
- if (out_trade_no == null || StringUtils.isEmpty(out_trade_no)) {
- return "<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA[订单信息错误]]></return_msg></xml>"
- }
- if (!StringUtils.isEmpty(return_code) && "SUCCESS" == return_code
- && !StringUtils.isEmpty(result_code) && "SUCCESS" == result_code) {
- //map.get("transaction_id") 第三方流水号
- transactionService.success(out_trade_no)
- }
- return "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>"
- } catch (e: Exception) {
- e.printStackTrace()
- logger.error("------------step7----------------" + e.message)
- return "<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA[解析失败]]></return_msg></xml>"
- }
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/controller/shop_api_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/api/controller/shop_api_controller.kt
index d7f333b..475a42a 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/api/controller/shop_api_controller.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/api/controller/shop_api_controller.kt
@@ -45,8 +45,6 @@
.success("注册成功"))
}
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.BUSINESS_DEAL_ERROR, "商户注册失败"))
} catch (ex: RequestParamCheckException) {
return ResponseEntity.ok(ResponseBodyBuilder.create()
.requestException(ex, "请求参数错误"))
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/service/consume_pay_service.kt b/src/main/kotlin/com/supwisdom/dlpay/api/service/consume_pay_service.kt
deleted file mode 100644
index 412fdf5..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/service/consume_pay_service.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.supwisdom.dlpay.api.service
-
-import org.springframework.transaction.annotation.Propagation
-import org.springframework.transaction.annotation.Transactional
-
-interface ConsumePayService {
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun checkShopPaytype(shopaccno: String, sourceType: String, anonymousflag: Boolean? = false): Boolean
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun getPaytypeConfig(paytype: String, shopaccno: String, anonymousflag: Boolean? = false, ignoreStatus: Boolean? = false): Map<String, String?>
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun getUserdtlExtendParamMap(refno: String): Map<String, String>
-}
\ No newline at end of file
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/Consume_pay_service_impl.kt b/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/Consume_pay_service_impl.kt
deleted file mode 100644
index 3eb78fd..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/Consume_pay_service_impl.kt
+++ /dev/null
@@ -1,97 +0,0 @@
-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.service.ConsumePayService
-import com.supwisdom.dlpay.exception.TransactionProcessException
-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
-
-@Service
-class ConsumePayServiceImpl : ConsumePayService {
- @Autowired
- lateinit var sourceTypeDao: SourceTypeDao
- @Autowired
- lateinit var shopPaytypeDao: ShopPaytypeDao
- @Autowired
- lateinit var shopPaytypeConfigDao: ShopPaytypeConfigDao
-
- override fun checkShopPaytype(shopaccno: String, sourceType: String, anonymousflag: Boolean?): Boolean {
- sourceTypeDao.getBySourceType(sourceType).let {
- if (null == it) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "系统不支持支付方式[$sourceType]")
- } else {
- if (!it.enable || !it.consumeEnable) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "系统未启用支付方式[$sourceType]消费")
- }
- if (true == anonymousflag && !it.anonymousEnable) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "系统支付方式[$sourceType]未启用匿名消费")
- }
- }
- }
- shopPaytypeDao.getById(sourceType, shopaccno).let {
- if (null == it) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "该商户[$shopaccno]未启用支付方式[$sourceType]")
- } else {
- if (!it.consumeEnable) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "该商户[$shopaccno]未启用支付方式[$sourceType]")
- }
- if (true == anonymousflag && !it.anonymousEnable) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "该商户[$shopaccno]的支付方式[$sourceType]未启用匿名消费")
- }
- }
- }
- return true
- }
-
- override fun getPaytypeConfig(paytype: String, shopaccno: String,
- anonymousflag: Boolean?, ignoreStatus: Boolean?): Map<String, String?> {
- sourceTypeDao.getBySourceType(paytype).let {
- if (null == it) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "系统不支持支付方式[$paytype]")
- } else {
- //对账取配置时不关心状态,不能报错
- if (true != ignoreStatus && (!it.enable || !it.consumeEnable)) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "系统未启用支付方式[$paytype]消费")
- }
- if (true != ignoreStatus && true == anonymousflag && !it.anonymousEnable) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "系统支付方式[$paytype]未启用匿名消费")
- }
- }
- }
-
- shopPaytypeDao.getById(paytype, shopaccno).let {
- if (null == it) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "该商户[$shopaccno]未启用支付方式[$paytype]")
- } else {
- //对账取配置时不关心状态,不能报错
- if (true != ignoreStatus && !it.consumeEnable) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "该商户[$shopaccno]未启用支付方式[$paytype]")
- }
- if (true != ignoreStatus && true == anonymousflag && !it.anonymousEnable) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "该商户[$shopaccno]的支付方式[$paytype]未启用匿名消费")
- }
- }
- }
-
- shopPaytypeConfigDao.getShopPaytypeConfigs(paytype, shopaccno)?.let {
- if (it.size < 1) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "该商户[$shopaccno]的支付方式[$paytype]未配置参数")
- } else {
- val result = mutableMapOf<String, String?>()
- it.forEach { paytypeConfig ->
- result.plus(mapOf(paytypeConfig.configid to paytypeConfig.configValue))
- }
- return result
- }
- }
- ?: throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR, "该商户[$shopaccno]的支付方式[$paytype]未配置参数")
- }
-
- override fun getUserdtlExtendParamMap(refno: String): Map<String, String> {
- TODO("未实现方法")
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/pay_service_impl.kt b/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/pay_service_impl.kt
deleted file mode 100644
index e54f063..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/pay_service_impl.kt
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.supwisdom.dlpay.api.service.impl
-
-import com.supwisdom.dlpay.api.dao.AccountDao
-import com.supwisdom.dlpay.api.domain.TAccount
-import com.supwisdom.dlpay.api.service.AccountUtilServcie
-import com.supwisdom.dlpay.exception.TransactionException
-import com.supwisdom.dlpay.exception.TransactionProcessException
-import com.supwisdom.dlpay.framework.dao.FeetypeConfigDao
-import com.supwisdom.dlpay.framework.dao.ShopaccDao
-import com.supwisdom.dlpay.framework.dao.SubjectDao
-import com.supwisdom.dlpay.framework.domain.TFeetypeConfig
-import com.supwisdom.dlpay.framework.domain.TShopacc
-import com.supwisdom.dlpay.framework.domain.TSubject
-import com.supwisdom.dlpay.framework.util.TradeErrorCode
-import org.hibernate.exception.LockTimeoutException
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.dao.CannotAcquireLockException
-import org.springframework.stereotype.Service
-
-
-@Service
-class AccountUtilServcieImpl : AccountUtilServcie {
-
- @Autowired
- lateinit var accountDao: AccountDao
-
- @Autowired
- lateinit var shopaccDao: ShopaccDao
-
- @Autowired
- lateinit var subjectDao: SubjectDao
-
- @Autowired
- lateinit var feetypeConfigDao: FeetypeConfigDao
-
- override fun readAccountForUpdateNowait(userid: String): TAccount {
- return try {
- accountDao.getByUseridForUpdateNowait(userid)
- ?: throw TransactionProcessException(TradeErrorCode.ACCOUNT_NOT_EXISTS, "账户<$userid>不存在")
- } catch (ex: Exception) {
- when (ex) {
- is CannotAcquireLockException, is LockTimeoutException -> throw TransactionException(TradeErrorCode.ACCOUNT_TRADE_BUSY, "账户<$userid>交易繁忙,请稍后再试")
- else -> throw ex
- }
- }
- }
-
- override fun readAccount(userid: String): TAccount {
- return accountDao.findByUserid(userid)
- ?: throw TransactionProcessException(TradeErrorCode.ACCOUNT_NOT_EXISTS, "账户<$userid>不存在")
- }
-
- override fun readShopAcc(shopId: Int): TShopacc {
- return shopaccDao.findByShopid(shopId)
- ?: throw TransactionProcessException(TradeErrorCode.SHOP_NOT_EXISTS, "商户<$shopId>不存在")
- }
-
- override fun readShopbyShopaccno(shopaccno: String): TShopacc {
- return shopaccDao.findByShopaccno(shopaccno)
- ?: throw TransactionProcessException(TradeErrorCode.SHOP_NOT_EXISTS, "商户<$shopaccno>不存在")
- }
-
- override fun readSubject(subjno: String): TSubject {
- return subjectDao.findBySubjno(subjno)
- ?: throw TransactionProcessException(TradeErrorCode.SUBJECT_NOT_EXISTS, "科目<$subjno>不存在")
- }
-
- override fun readFeetype(feetype: String, paytype: String): TFeetypeConfig {
- return feetypeConfigDao.getById(feetype, paytype)
- ?: throw TransactionProcessException(TradeErrorCode.FEETYPE_NOT_EXISTS, "在支付方式<$paytype>下不存在费用类别<$feetype>")
- }
-}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/transaction_service_impl.kt b/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/transaction_service_impl.kt
deleted file mode 100644
index d7e8895..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/transaction_service_impl.kt
+++ /dev/null
@@ -1,426 +0,0 @@
-package com.supwisdom.dlpay.api.service.impl
-
-import com.supwisdom.dlpay.api.TransactionBuilder
-import com.supwisdom.dlpay.api.dao.*
-import com.supwisdom.dlpay.api.domain.*
-import com.supwisdom.dlpay.api.repositories.ShopaccRepositoryImpl
-import com.supwisdom.dlpay.api.repositories.TAccountRepositoryImpl
-import com.supwisdom.dlpay.api.service.SourceTypeService
-import com.supwisdom.dlpay.api.service.TransactionService
-import com.supwisdom.dlpay.exception.TransactionCheckException
-import com.supwisdom.dlpay.exception.TransactionProcessException
-import com.supwisdom.dlpay.framework.service.SystemUtilService
-import com.supwisdom.dlpay.framework.util.Subject
-import com.supwisdom.dlpay.framework.util.TradeDict
-import com.supwisdom.dlpay.framework.util.TradeErrorCode
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.stereotype.Service
-import java.sql.SQLException
-import java.sql.Timestamp
-
-
-@Service
-class TransactionServiceImpl : TransactionService {
-
- companion object {
- const val PERSON_BALANCE_FLAG = 2
- const val SHOP_BALANCE_FLAG = 2
- }
-
- @Autowired
- lateinit var transactionMainDao: TransactionMainDao
-
- @Autowired
- lateinit var persondtlDao: PersondtlDao
-
- @Autowired
- lateinit var accountRepository: TAccountRepositoryImpl
-
- @Autowired
- lateinit var shopaccRepository: ShopaccRepositoryImpl
-
- @Autowired
- lateinit var systemUtilService: SystemUtilService
-
- @Autowired
- lateinit var sourceTypeService: SourceTypeService
-
- private fun preCheck(builder: TransactionBuilder) {
- builder.preCheck()
-
- }
-
- private fun builderRecords(builder: TransactionBuilder, status: String): TTransactionMain {
- try {
- preCheck(builder)
- val sourceType = sourceTypeService.getByPaytype(builder.sourceType)
- ?: throw TransactionCheckException(TradeErrorCode.BUSINESS_PAYTYPE_NOSUPPORT,
- "交易源未定义,sourctype <${builder.sourceType}>")
- // 记录三方的交易流水(个人,商户,科目)
- val transaction = TTransactionMain().apply {
- refno = systemUtilService.refno
- accdate = systemUtilService.accdate
- outTradeNo = builder.outtradeno
- outId = builder.outId
- createTime = Timestamp(systemUtilService.sysdatetime.sysdate.time)
- operid = builder.operId
- opertype = builder.operType
- reverseFlag = builder.tradeType
- checkable = sourceType.checkable
- checkDate = null
- settleDate = null
- }
-
- if (builder.hasPerson()) {
- TPersondtl().apply {
- this.refno = transaction.refno
- this.accdate = transaction.accdate
- userid = builder.person().person.userid
- accountNo = builder.person().person.accno
- userName = builder.person().person.accname
- outtradeno = builder.outtradeno
- transdate = builder.transDate
- transtime = builder.transTime
- befbal = builder.person().person.availbal
- amount = if (builder.person().tradeFlag == TradeDict.TRADE_FLAG_IN) {
- builder.person().amount
- } else {
- -builder.person().amount
- }
- this.sourceType = builder.sourceType
- payinfo = builder.person().payinfo
- transcode = builder.transCode
- tradeflag = builder.person().tradeFlag
- transdesc = builder.person().description
- oppositeAccNo = builder.person().opposite.getAccountNo()
- oppositeAccName = builder.person().opposite.getAccountName()
- this.reverseFlag = TradeDict.REVERSE_FLAG_NONE
- remark = builder.person().remark
- this.status = status
- }.also {
- // save persondtl
- persondtlDao.save(it)
- transaction.personDtl = it
- transaction.person = true
- }
- }
- if (builder.hasShop()) {
- TShopdtl().apply {
- this.refno = transaction.refno
- this.accdate = transaction.accdate
- this.amount = builder.shop().amount
- this.payInfo = builder.shop().payinfo
- this.sourceType = builder.sourceType
- this.transdate = builder.transDate
- this.transtime = builder.transTime
- this.transcode = builder.transCode
- this.sourceType = builder.sourceType
- amount = if (builder.shop().tradeFlag == TradeDict.TRADE_FLAG_IN) {
- builder.shop().amount
- } else {
- -builder.shop().amount
- }
- this.tradeflag = builder.shop().tradeFlag
- this.shopaccno = builder.shop().shopacc.shopaccno
- this.shopname = builder.shop().shopacc.shopname
- this.transdesc = builder.shop().description
- this.oppositeAccNo = builder.shop().opposite.getAccountNo()
- this.oppositeAccName = builder.shop().opposite.getAccountName()
- this.remark = builder.shop().remark
- this.reverseFlag = TradeDict.REVERSE_FLAG_NONE
- this.status = status
- }.also {
- // save shopdtl
- transaction.shopDtl = it
- transaction.shop = true
- }
- }
- if (builder.hasSubject()) {
- // save subjectdtl
- TSubjectdtl().apply {
- this.refno = transaction.refno
- this.accdate = transaction.accdate
- this.amount = builder.subject().amount
- this.payInfo = builder.subject().payinfo
- this.payType = builder.sourceType
- this.tradeCode = builder.transCode
- this.transDate = builder.transDate
- this.transTime = builder.transTime
- this.oppositeAccNo = builder.subject().opposite.getAccountNo()
- this.oppositeAccName = builder.subject().opposite.getAccountName()
- this.status = status
- }.also {
- transaction.subjectDtl = it
- transaction.subject = true
- }
- }
-
- builder.getAllDetails().map { line ->
- TDebitCreditDtl().apply {
- this.refno = transaction.refno
- this.seqno = line.seqno
- this.draccno = line.debit.getAccountNo()
- this.drsubjno = line.debit.getSubjectNo()
- this.craccno = line.credit.getAccountNo()
- this.crsubjno = line.credit.getSubjectNo()
- this.amount = line.amount
- this.summary = line.summary
- this.settleDate = null
- }
- }.apply {
- transaction.details = this
- }
-
-
- if (builder.hasPerson()) {
- val dc = getDebitOrCredit(builder.person().tradeFlag)
- transaction.sumAmountByAccno(builder.person().person.accno,
- Subject.SUBJNO_PERSONAL_DEPOSIT,
- PERSON_BALANCE_FLAG, dc).also {
- if (transaction.personDtl.amount != it) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR,
- "输入金额错误,个人余额不符<${transaction.personDtl.amount}>")
- }
- }
- }
-
- if (builder.hasShop()) {
- val dc = getDebitOrCredit(builder.shop().tradeFlag)
- transaction.sumAmountByAccno(builder.shop().shopacc.shopaccno,
- Subject.SUBJNO_MACHANT_INCOME,
- SHOP_BALANCE_FLAG, dc).also {
- if (transaction.shopDtl.amount != it) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR,
- "输入金额错误,商户余额不符<${transaction.shopDtl.amount}>")
- }
- }
- }
-
- if (builder.hasSubject()) {
- transaction.sumAmountByAccno(builder.subject().subject.subjno,
- builder.subject().subject.subjno,
- builder.subject().subject.balflag,
- "both").also {
- if (transaction.subjectDtl.amount != it) {
- throw TransactionProcessException(TradeErrorCode.INPUT_DATA_ERROR,
- "输入金额错误,科目余额不符<${transaction.subjectDtl.amount}>")
- }
- }
- }
-
- transaction.status = status
- transactionMainDao.save(transaction)
- return transaction
- } catch (ex: SQLException) {
- throw TransactionProcessException(TradeErrorCode.BUSINESS_DEAL_ERROR, ex.message)
- }
- }
-
- private fun getDebitOrCredit(tradeFlag: String): String {
- return when (tradeFlag) {
- TradeDict.TRADE_FLAG_IN -> "credit"
- TradeDict.TRADE_FLAG_OUT -> "debit"
- else -> "both"
- }
- }
-
- override fun init(builder: TransactionBuilder): TTransactionMain {
- return builderRecords(builder, TradeDict.DTL_STATUS_INIT)
- }
-
- override fun wip(builder: TransactionBuilder): TTransactionMain {
- return builderRecords(builder, TradeDict.DTL_STATUS_WIP)
- }
-
- private fun updateRecordStatus(transaction: TTransactionMain, status: String) {
- if (transaction.person) {
- transaction.personDtl?.also {
- if (it.status != transaction.status) {
- throw TransactionProcessException(TradeErrorCode.TRANSACTION_IS_FINISHED,
- "个人流水<${transaction.refno}>状态错误")
- }
- it.status = status
- } ?: throw TransactionProcessException(TradeErrorCode.TRANSACTION_NOT_EXISTS,
- "个人流水<${transaction.refno}>不存在")
- }
-
- if (transaction.shop) {
- transaction.shopDtl?.also {
- if (it.status != transaction.status) {
- throw TransactionProcessException(TradeErrorCode.TRANSACTION_IS_FINISHED,
- "商户流水<${transaction.refno}>状态错误")
- }
- it.status = status
- } ?: throw TransactionProcessException(TradeErrorCode.TRANSACTION_NOT_EXISTS,
- "商户流水<${transaction.refno}>不存在")
- }
-
- if (transaction.subject) {
- transaction.subjectDtl?.also {
- if (it.status != transaction.status) {
- throw TransactionProcessException(TradeErrorCode.TRANSACTION_IS_FINISHED,
- "科目流水<${transaction.refno}>状态错误")
- }
- it.status = status
- } ?: throw TransactionProcessException(TradeErrorCode.TRANSACTION_NOT_EXISTS,
- "科目流水<${transaction.refno}>不存在")
- }
- transaction.status = status
- }
-
- override fun wip(refno: String): TTransactionMain {
- val transaction = transactionMainDao.findByRefnoForUpdate(refno)
- ?: throw TransactionProcessException(TradeErrorCode.TRANSACTION_IS_FINISHED, "流水<$refno>参考号错误")
-
- if (transaction.status != TradeDict.DTL_STATUS_INIT
- && transaction.status != TradeDict.DTL_STATUS_WIP) {
- throw TransactionProcessException(TradeErrorCode.TRANSACTION_IS_FINISHED, "流水<$refno>状态错误")
- }
-
- updateRecordStatus(transaction, TradeDict.DTL_STATUS_WIP)
- transactionMainDao.save(transaction)
- return transaction
- }
-
- override fun fail(refno: String): TTransactionMain {
- return fail(refno, "")
- }
-
-
- override fun success(refno: String): TTransactionMain {
- return success(refno, "")
- }
-
- override fun fail(refno: String, remark: String): TTransactionMain {
- val transaction = transactionMainDao.findByRefnoForUpdate(refno)
- ?: throw TransactionProcessException(TradeErrorCode.TRANSACTION_IS_FINISHED, "流水<$refno>参考号错误")
-
- val errorStatus = setOf(TradeDict.DTL_STATUS_SUCCESS, TradeDict.DTL_STATUS_CANCEL)
- if (transaction.status in errorStatus) {
- throw TransactionProcessException(TradeErrorCode.TRANSACTION_IS_FINISHED, "流水<$refno>状态错误")
- }
-
- updateRecordStatus(transaction, TradeDict.DTL_STATUS_FAIL)
- if (transaction.person) {
- transaction.personDtl.remark = remark
- }
- if (transaction.shop) {
- transaction.shopDtl.remark = remark
- }
- transaction.endTime = Timestamp(systemUtilService.sysdatetime.sysdate.time)
- transactionMainDao.save(transaction)
- return transaction
- }
-
- override fun success(refno: String, remark: String): TTransactionMain {
- val transaction = transactionMainDao.findByRefnoForUpdate(refno)
- ?: throw TransactionProcessException(TradeErrorCode.TRANSACTION_IS_FINISHED, "流水<$refno>参考号错误")
-
- val errorStatus = setOf(TradeDict.DTL_STATUS_SUCCESS, TradeDict.DTL_STATUS_CANCEL)
- if (transaction.status in errorStatus) {
- throw TransactionProcessException(TradeErrorCode.TRANSACTION_IS_FINISHED, "流水<$refno>状态错误")
- }
- transaction.status = TradeDict.DTL_STATUS_SUCCESS
- transaction.accdate = systemUtilService.accdate
- transactionOnSuccess(transaction, remark, false)
-
- transaction.endTime = Timestamp(systemUtilService.sysdatetime.sysdate.time)
- transactionMainDao.save(transaction)
- return transaction
- }
-
- override fun reverse(originRefno: String): TTransactionMain {
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
- }
-
- override fun reverseInit(originRefno: String): TTransactionMain {
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
- }
-
- override fun reverseConfirm(refno: String): TTransactionMain {
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
- }
-
- override fun reverseFail(refno: String): TTransactionMain {
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
- }
-
- override fun cancel(originRefno: String): TTransactionMain {
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
- }
-
- override fun cancelInit(originRefno: String): TTransactionMain {
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
- }
-
- override fun cancelConfirm(refno: String): TTransactionMain {
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
- }
-
- override fun cancelFail(refno: String): TTransactionMain {
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
- }
-
- private fun transactionOnSuccess(transaction: TTransactionMain, remark: String, overdraft: Boolean) {
- if (transaction.person) {
- // update account balance
- val amount = transaction.sumAmountByAccno(
- transaction.personDtl.accountNo, Subject.SUBJNO_PERSONAL_DEPOSIT,
- PERSON_BALANCE_FLAG, "both")
- if (amount.compareTo(0.0) != 0) {
- transaction.personDtl?.let {
- if (accountRepository.recalcAccountBalance(it, amount, overdraft) != 1) {
- throw TransactionProcessException(TradeErrorCode.ACCOUNT_TRADE_BUSY,
- "个人账户交易冲突")
- }
- transaction.personDtl.accdate = transaction.accdate
- } ?: throw TransactionProcessException(TradeErrorCode.TRANSACTION_NOT_EXISTS,
- "个人流水<${transaction.refno}>不存在")
- }
- transaction.personDtl.status = TradeDict.DTL_STATUS_SUCCESS
- transaction.personDtl.remark = remark
- }
- if (transaction.shop) {
- // update shop balance
- val amount = transaction.sumAmountByAccno(
- transaction.shopDtl.shopaccno, Subject.SUBJNO_MACHANT_INCOME,
- SHOP_BALANCE_FLAG, "both")
- if (amount.compareTo(0.0) != 0) {
- transaction.shopDtl?.let {
- if (shopaccRepository.recalcShopBalance(it, it.amount, overdraft) != 1) {
- throw TransactionProcessException(TradeErrorCode.ACCOUNT_TRADE_BUSY,
- "商户账户交易冲突")
- }
- } ?: throw TransactionProcessException(TradeErrorCode.TRANSACTION_NOT_EXISTS,
- "商户流水<${transaction.refno}>不存在")
- }
- transaction.shopDtl.status = TradeDict.DTL_STATUS_SUCCESS
- transaction.shopDtl.accdate = transaction.accdate
- transaction.shopDtl.remark = remark
- }
-
- if (transaction.subject) {
- // update subject balance
- }
- }
-
- override fun repair(refno: String, remark: String): TTransactionMain {
- val transaction = transactionMainDao.findByRefnoForUpdate(refno)
- ?: throw TransactionProcessException(TradeErrorCode.TRANSACTION_NOT_EXISTS,
- "补帐交易流水<$refno>不存在")
- val checkStatus = setOf(TradeDict.DTL_STATUS_FAIL, TradeDict.DTL_STATUS_CANCEL,
- TradeDict.DTL_STATUS_WIP)
-
- if (transaction.status !in checkStatus) {
- throw TransactionCheckException(TradeErrorCode.TRANSDTL_STATUS_ERROR,
- "补帐交易<$refno>状态错误,status<${transaction.status}>")
- }
-
- transactionOnSuccess(transaction, remark, true)
- transaction.checkDate = systemUtilService.accdate
- transaction.endTime = Timestamp(systemUtilService.sysdatetime.sysdate.time)
-
- transactionMainDao.save(transaction)
- return transaction
- }
-}
\ No newline at end of file
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/user_service_impl.kt b/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/user_service_impl.kt
index fa30ada..43a2514 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/user_service_impl.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/user_service_impl.kt
@@ -7,7 +7,7 @@
import com.supwisdom.dlpay.api.dao.PersonIdentityDao
import com.supwisdom.dlpay.api.dao.PointsAccountDao
import com.supwisdom.dlpay.api.domain.TAccount
-import com.supwisdom.dlpay.api.domain.TPerson
+import com.supwisdom.dlpay.framework.domain.TPerson
import com.supwisdom.dlpay.api.domain.TPersonIdentity
import com.supwisdom.dlpay.api.domain.TPointsAccount
import com.supwisdom.dlpay.framework.service.SystemUtilService
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/service/transaction_service.kt b/src/main/kotlin/com/supwisdom/dlpay/api/service/transaction_service.kt
deleted file mode 100644
index f0acef4..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/service/transaction_service.kt
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.supwisdom.dlpay.api.service
-
-import com.supwisdom.dlpay.api.TransactionBuilder
-import com.supwisdom.dlpay.api.domain.TTransactionMain
-import org.springframework.transaction.annotation.Propagation
-import org.springframework.transaction.annotation.Transactional
-
-interface TransactionService {
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun init(builder: TransactionBuilder): TTransactionMain
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun wip(refno: String): TTransactionMain
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun wip(builder: TransactionBuilder): TTransactionMain
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun fail(refno: String): TTransactionMain
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun fail(refno: String, remark: String): TTransactionMain
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun success(refno: String): TTransactionMain
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun success(refno: String, remark: String): TTransactionMain
-
- // 撤销接口冲正类接口
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun reverse(originRefno: String): TTransactionMain
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun reverseInit(originRefno: String): TTransactionMain
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun reverseConfirm(refno: String): TTransactionMain
-
- fun reverseFail(refno: String): TTransactionMain
-
- // 冲正类接口
- /**
- * 冲正业务
- */
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun cancel(originRefno: String): TTransactionMain
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun cancelInit(originRefno: String): TTransactionMain
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun cancelConfirm(refno: String): TTransactionMain
-
- fun cancelFail(refno: String): TTransactionMain
-
- // 补帐接口
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = [Exception::class])
- fun repair(refno: String, remark: String): TTransactionMain
-}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/service/user_service.kt b/src/main/kotlin/com/supwisdom/dlpay/api/service/user_service.kt
index c4d9b20..1f35b88 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/api/service/user_service.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/api/service/user_service.kt
@@ -3,7 +3,7 @@
import com.supwisdom.dlpay.api.bean.ModifyUserParam
import com.supwisdom.dlpay.api.bean.OpenUserParam
import com.supwisdom.dlpay.api.domain.TAccount
-import com.supwisdom.dlpay.api.domain.TPerson
+import com.supwisdom.dlpay.framework.domain.TPerson
import com.supwisdom.dlpay.api.domain.TPersonIdentity
import com.supwisdom.dlpay.api.domain.TPointsAccount
import org.springframework.transaction.annotation.Propagation
@@ -23,7 +23,7 @@
fun findByUseridOrThirdUniqueIdenty(userid: String?, thirdUniqueIdenty: String?): TPerson?
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = arrayOf(Exception::class), readOnly = true)
- fun modifyUserInfo(person:TPerson,param: ModifyUserParam):Boolean
+ fun modifyUserInfo(person: TPerson, param: ModifyUserParam):Boolean
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = arrayOf(Exception::class), readOnly = true)
fun findPersonByUserid(userid: String): TPerson?
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/transaction_builder.kt b/src/main/kotlin/com/supwisdom/dlpay/api/transaction_builder.kt
deleted file mode 100644
index 9dc29ac..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/transaction_builder.kt
+++ /dev/null
@@ -1,355 +0,0 @@
-package com.supwisdom.dlpay.api
-
-import com.supwisdom.dlpay.api.domain.TAccount
-import com.supwisdom.dlpay.api.domain.TTransactionMain
-import com.supwisdom.dlpay.api.service.TransactionService
-import com.supwisdom.dlpay.exception.TransactionCheckException
-import com.supwisdom.dlpay.framework.domain.TShopacc
-import com.supwisdom.dlpay.framework.domain.TSubject
-import com.supwisdom.dlpay.framework.util.TradeDict
-import com.supwisdom.dlpay.framework.util.TradeErrorCode
-
-open class SubTransactionBuilder<T : SubTransactionBuilder<T>>(val parent: TransactionBuilder) {
- var payinfo: String = ""
- get() {
- return if (field.isEmpty()) parent.payinfo else field
- }
-
- var description: String = ""
- get() {
- return if (field.isEmpty()) parent.description else field
- }
-
- var remark: String = ""
- get() {
- return if (field.isEmpty()) parent.remark else field
- }
-
- lateinit var opposite: AccountProxy<*>
-
- fun hasOpposite(): Boolean {
- return this::opposite.isInitialized
- }
-
- fun and(): TransactionBuilder {
- return parent
- }
-
- // 收支方向, in / out
- var tradeFlag: String = ""
- private set
-
- var amount: Double = 0.0
- private set
-
- /**
- * amount : 交易金额, 正向交易金额必须 >= 0, 冲正交易金额必须 <= 0
- */
- fun setAmount(amount: Double, inOut: String): SubTransactionBuilder<T> {
- this.amount = amount
- this.tradeFlag = inOut
- return this
- }
-
- /**
- * amount : 交易金额, 正向交易金额必须 >= 0, 冲正交易金额必须 <= 0
- */
- fun addAmount(amount: Double): SubTransactionBuilder<T> {
- this.amount += amount
- return this
- }
-
-}
-
-class PersonTranactionBuilder(parent: TransactionBuilder, val person: TAccount)
- : SubTransactionBuilder<PersonTranactionBuilder>(parent) {
-}
-
-class ShopTransactionBuilder(parent: TransactionBuilder, val shopacc: TShopacc)
- : SubTransactionBuilder<ShopTransactionBuilder>(parent) {
-}
-
-class SubjectTransactionBuilder(parent: TransactionBuilder, val subject: TSubject)
- : SubTransactionBuilder<SubjectTransactionBuilder>(parent) {
-}
-
-class AccountProxy<T>(private val accountObj: T) {
- fun getAccountNo(): String {
- return when (accountObj) {
- is TAccount -> (accountObj as TAccount).accno
- is TShopacc -> (accountObj as TShopacc).shopaccno
- is TSubject -> (accountObj as TSubject).subjno
- else -> throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "不支持的账户类型, $accountObj")
- }
- }
-
- fun getSubjectNo(): String {
- return when (accountObj) {
- is TAccount -> (accountObj as TAccount).subjno
- is TShopacc -> (accountObj as TShopacc).subjno
- is TSubject -> (accountObj as TSubject).subjno
- else -> throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "不支持的账户类型, $accountObj")
- }
- }
-
- fun getAccountName(): String {
- return when (accountObj) {
- is TAccount -> (accountObj as TAccount).accname
- is TShopacc -> (accountObj as TShopacc).shopname
- is TSubject -> (accountObj as TSubject).subjname
- else -> throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "不支持的账户类型, $accountObj")
- }
- }
-
- fun get(): T {
- return accountObj
- }
-}
-
-data class DebitCreditLine(val debit: AccountProxy<*>, val credit: AccountProxy<*>,
- val amount: Double, val summary: String,
- val seqno: Int)
-
-// 在 constructor 中加入 service 接口
-class TransactionBuilder {
- companion object {
- private val VALID_REVERSEFLAG = setOf(TradeDict.REVERSE_FLAG_CANCEL,
- TradeDict.REVERSE_FLAG_REVERSE,
- TradeDict.REVERSE_FLAG_NONE)
-
- private val VALID_OPERTYPE = setOf(TradeDict.OPERTYPE_OPER,
- TradeDict.OPERTYPE_SHOP, TradeDict.OPERTYPE_PERSON)
-
- private val VALID_TRADEFLAG = setOf(TradeDict.TRADE_FLAG_IN,
- TradeDict.TRADE_FLAG_OUT)
- }
-
- private lateinit var personBuilder: PersonTranactionBuilder
- private lateinit var shopBuilder: ShopTransactionBuilder
- private lateinit var subjectBuilder: SubjectTransactionBuilder
-
- private val debitCreditLines = mutableListOf<DebitCreditLine>()
-
- // 以下是交易主表属性
- var transDate: String = ""
- private set
- var transTime: String = ""
- private set
- var transCode: Int = 0 //交易码,各明细流水统一
- private set
-
- // 资金来源方案
- var sourceType: String = ""
- private set
-
- fun setTransInfo(date: String, time: String, code: Int, sourceType: String): TransactionBuilder {
- this.transDate = date
- this.transTime = time
- this.transCode = code
- this.sourceType = sourceType
- return this
- }
-
- var outtradeno: String = "" //第三方流水号
- private set
- var outId: String = ""
- private set
-
- fun setOutTransInfo(id: String, tradeno: String): TransactionBuilder {
- this.outId = id
- this.outtradeno = tradeno
- return this
- }
-
- var operId: String = ""
- private set
- var operType: String = ""
- private set
-
- fun operator(id: String, type: String): TransactionBuilder {
- this.operId = id
- this.operType = type
- return this
- }
-
- var tradeType: String = "none"
- private set
-
- fun reverse(): TransactionBuilder {
- this.tradeType = TradeDict.REVERSE_FLAG_REVERSE
- return this
- }
-
- fun cancel(): TransactionBuilder {
- this.tradeType = TradeDict.REVERSE_FLAG_CANCEL
- return this
- }
-
-
- // 以下属性可以在子表中不同
- var payinfo: String = ""
- var description: String = ""
- var remark: String = ""
-
- fun person(): PersonTranactionBuilder {
- return this.personBuilder
- }
-
- fun person(account: TAccount): PersonTranactionBuilder {
- return if (!this::personBuilder.isInitialized) {
- PersonTranactionBuilder(this, account).also {
- this.personBuilder = it
- }
- } else {
- this.personBuilder
- }
- }
-
- fun hasPerson(): Boolean {
- return this::personBuilder.isInitialized
- }
-
- fun shop(): ShopTransactionBuilder {
- return this.shopBuilder
- }
-
- fun shop(shopacc: TShopacc): ShopTransactionBuilder {
- return if (!this::shopBuilder.isInitialized) {
- ShopTransactionBuilder(this, shopacc).also {
- this.shopBuilder = it
- }
- } else {
- this.shopBuilder
- }
- }
-
- fun hasShop(): Boolean {
- return this::shopBuilder.isInitialized
- }
-
- fun subject(acc: TSubject): SubjectTransactionBuilder {
- return if (!this::subjectBuilder.isInitialized) {
- SubjectTransactionBuilder(this, acc).also {
- this.subjectBuilder = it
- }
- } else {
- this.subjectBuilder
- }
- }
-
- fun subject(): SubjectTransactionBuilder {
- return this.subjectBuilder
- }
-
- fun hasSubject(): Boolean {
- return this::subjectBuilder.isInitialized
- }
-
- fun <T, U> addDebitCreditRecord(debit: AccountProxy<T>, credit: AccountProxy<U>,
- amount: Double, summary: String): TransactionBuilder {
- debitCreditLines.add(DebitCreditLine(debit, credit, amount, summary,
- debitCreditLines.size + 1))
- return this
- }
-
- fun getAllDetails(): List<DebitCreditLine> {
- return debitCreditLines.toList()
- }
-
- private fun checkAmount(amount: Double): Boolean {
- return if (tradeType == TradeDict.REVERSE_FLAG_NONE) {
- amount >= 0.0
- } else {
- amount <= 0.0
- }
- }
-
- fun preCheck() {
- if (outId.isNotEmpty() && outtradeno.isEmpty()) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "第三方账号未指定第三方流水号")
- }
-
- if (transDate.length != 8 || transTime.length != 6) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "交易发生日期错误")
- }
-
- if (transCode <= 0) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "交易码错误")
- }
-
- if (tradeType !in VALID_REVERSEFLAG) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "冲正标志错误")
- }
-
- if ((operId.isNotEmpty() || operType.isNotEmpty())
- && operType !in VALID_OPERTYPE) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "操作员类型错误")
- }
-
- if (sourceType.isEmpty()) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "交易源类型错误")
- }
- if (hasPerson()) {
- person().also {
- if (it.tradeFlag !in VALID_TRADEFLAG) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "个人交易收支方向错误")
- }
- if (!checkAmount(it.amount)) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "个人交易金额不正确")
- }
- if (!it.hasOpposite()) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "个人交易对方账户未设置")
- }
- if (it.payinfo.isEmpty()) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "个人交易信息未设置")
- }
- }
- }
-
- if (hasShop()) {
- shop().also {
- if (it.tradeFlag !in VALID_TRADEFLAG) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "商户交易收支方向错误")
- }
- if (!checkAmount(it.amount)) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "商户交易金额不正确")
- }
- if (!it.hasOpposite()) {
- throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR,
- "商户交易对方账户未设置")
- }
- }
- }
- }
-
- fun init(transactionService: TransactionService): TTransactionMain {
- return transactionService.init(this)
- }
-
- fun wip(transactionService: TransactionService): TTransactionMain {
- return transactionService.wip(this)
- }
-
- fun cancel(transactionService: TransactionService, originRefno: String): TTransactionMain {
- TODO("not implement")
- }
-
- fun reverse(transactionService: TransactionService, originRefno: String, amount: Double): TTransactionMain {
- TODO("not implement")
- }
-}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/security.kt b/src/main/kotlin/com/supwisdom/dlpay/security.kt
index 30c0edd..2ec292e 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/security.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/security.kt
@@ -126,7 +126,6 @@
.antMatchers("/api/notify/**").permitAll()
.antMatchers("/api/common/**").hasAnyRole("THIRD_COMMON", "THIRD_ADMIN")
.antMatchers("/api/consume/**").hasRole("THIRD_CONSUME")
- .antMatchers("/api/deposit/**").hasRole("THIRD_DEPOSIT")
.antMatchers("/api/user/**").hasRole("THIRD_ADMIN")
.antMatchers("/api/shop/**").hasRole("THIRD_SHOP")
.anyRequest().hasRole("THIRD_COMMON")
diff --git a/src/main/kotlin/com/supwisdom/dlpay/water/advices.kt b/src/main/kotlin/com/supwisdom/dlpay/water/advices.kt
new file mode 100644
index 0000000..acbe006
--- /dev/null
+++ b/src/main/kotlin/com/supwisdom/dlpay/water/advices.kt
@@ -0,0 +1,90 @@
+package com.supwisdom.dlpay.water
+
+import com.supwisdom.dlpay.exception.RequestParamCheckException
+import com.supwisdom.dlpay.exception.TransactionCheckException
+import com.supwisdom.dlpay.exception.TransactionException
+import com.supwisdom.dlpay.framework.ResponseBodyBuilder
+import com.supwisdom.dlpay.framework.service.CommonService
+import com.supwisdom.dlpay.framework.util.APIRequestParam
+import com.supwisdom.dlpay.framework.util.TradeErrorCode
+import mu.KotlinLogging
+import org.aspectj.lang.ProceedingJoinPoint
+import org.aspectj.lang.annotation.Around
+import org.aspectj.lang.annotation.Aspect
+import org.aspectj.lang.annotation.Pointcut
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.beans.factory.annotation.Value
+import org.springframework.http.ResponseEntity
+import org.springframework.security.core.context.SecurityContextHolder
+import org.springframework.stereotype.Component
+import org.springframework.web.bind.annotation.ExceptionHandler
+import org.springframework.web.bind.annotation.RestControllerAdvice
+import java.lang.reflect.UndeclaredThrowableException
+import javax.servlet.http.HttpServletRequest
+
+
+@RestControllerAdvice("com.supwisdom.dlpay.water")
+class RestControllerAdvice {
+ val logger = KotlinLogging.logger { }
+
+ @ExceptionHandler
+ fun handleException(ex: Exception, request: HttpServletRequest): ResponseEntity<Any> {
+ logger.error { "Request unhandler exception, url<${request.requestURI}>, ex<${ex.cause}>" }
+ val undeclared = if (ex is UndeclaredThrowableException) ex.undeclaredThrowable else ex
+ if (undeclared is RequestParamCheckException) {
+ return ResponseEntity.ok(ResponseBodyBuilder.create()
+ .requestException(undeclared, "请求参数错误"))
+ } else if (undeclared is TransactionException) {
+ return ResponseEntity.ok(ResponseBodyBuilder.create()
+ .exception(undeclared.code(), undeclared, "业务处理错误"))
+ }
+
+ return ResponseEntity.ok().body(ResponseBodyBuilder.create()
+ .exception(TradeErrorCode.BUSINESS_DEAL_ERROR, undeclared, "业务处理报错"))
+ }
+}
+
+@Component
+@Aspect
+class RestControllerAspect {
+ @Autowired
+ lateinit var commonService: CommonService
+
+ @Value("\${security.request.sign: true}")
+ private var requestSignCheck: Boolean = true
+
+ private val logger = KotlinLogging.logger { }
+
+ @Pointcut("@within(org.springframework.web.bind.annotation.RestController)")
+ fun restcontroller() {
+ }
+
+ @Pointcut("@annotation(org.springframework.web.bind.annotation.PostMapping)")
+ fun postmapping() {
+ }
+
+ @Around("restcontroller() && postmapping() && args(@RequestBody body, ..)")
+ @Throws(Throwable::class)
+ fun logPostMethods(joinPoint: ProceedingJoinPoint, body: Any): Any {
+ return try {
+ if (body is APIRequestParam) {
+ body.checkParam()
+
+ if (requestSignCheck &&
+ !body.checkSign(commonService.getSecretByAppid(
+ SecurityContextHolder.getContext().authentication.name))) {
+ throw RequestParamCheckException(TradeErrorCode.REQUEST_SIGN_ERROR, "参数签名错误")
+ }
+ } else {
+ throw TransactionCheckException(TradeErrorCode.REQUEST_PARAM_EEROR, "请求参数实体位置错误")
+ }
+
+ val result = joinPoint.proceed()
+ logger.debug(result.toString())
+ result
+ } catch (t: Throwable) {
+ logger.error { "request error , ex<${t.message}>" }
+ throw t
+ }
+ }
+}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/water/api_request_param.kt b/src/main/kotlin/com/supwisdom/dlpay/water/api_request_param.kt
index 9ac3ca6..9b4de45 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/water/api_request_param.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/water/api_request_param.kt
@@ -121,6 +121,15 @@
@Sign
var deviceTime: String = ""
+ @Sign
+ var billno: String = ""
+
+ @Sign
+ var amount: Int = 0
+
+ @Sign
+ var waterIn100ML: Int = 0
+
override fun checkParam(): Boolean {
if (deviceNo.length != 8 || deviceNo.any { it !in '0'..'9' }) {
throw RequestParamCheckException(TradeErrorCode.INPUT_DATA_ERROR, "设备ID号长度不符")
diff --git a/src/main/kotlin/com/supwisdom/dlpay/water/controller/api_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/water/controller/api_controller.kt
index d3988f4..5561321 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/water/controller/api_controller.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/water/controller/api_controller.kt
@@ -1,11 +1,20 @@
package com.supwisdom.dlpay.water.controller
+import com.supwisdom.dlpay.framework.ResponseBodyBuilder
+import com.supwisdom.dlpay.framework.service.SystemUtilService
+import com.supwisdom.dlpay.framework.util.TradeDict
import com.supwisdom.dlpay.water.*
+import com.supwisdom.dlpay.water.domain.TTransdtl
+import org.springframework.beans.factory.annotation.Autowired
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.*
@RestController("/api")
class WaterApiController {
+
+ @Autowired
+ private lateinit var systemUtilService: SystemUtilService
+
@GetMapping("/login")
fun deviceLogin(@RequestBody param: DeviceLoginParam): ResponseEntity<Any> {
TODO("")
@@ -18,7 +27,26 @@
@PostMapping("/card/purseinit")
fun cardPurseInit(@RequestBody param: CardPayRequest): ResponseEntity<Any> {
- TODO("")
+ //1. 通过 cardNo 检查用户以及合法性
+ //2. 通过 deviceno 查询设备费率参数
+ //3. 创建 transdtl 记录初始流水
+ //4. 将流水 billno 和费率信息返回给终端
+ val trans = TTransdtl().apply {
+ billno = systemUtilService.refno
+ transDate = param.deviceDate
+ transTime = param.deviceTime
+ deviceno = param.deviceNo
+ bankCardNo = param.cardNo
+ amount = 0.0
+ waterSumHundredLitre = 0
+ status = TradeDict.DTL_STATUS_INIT
+ }
+
+ return ResponseEntity.ok(ResponseBodyBuilder.create()
+ .data("billno", trans.billno)
+ .data("feeamount", 1)
+ .data("max_litre", 50)
+ .success())
}
@PostMapping("/qrcode/init")
@@ -28,6 +56,7 @@
@PostMapping("/uploadrecord")
fun transdtlUpload(@RequestBody param: UploadRecordRequest): ResponseEntity<Any> {
+ // 1. 根据 billno 查询 transdtl , 并加锁
TODO("")
}
}
\ No newline at end of file
diff --git a/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt
index 0086ee8..717a8aa 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt
@@ -5,10 +5,10 @@
import com.supwisdom.dlpay.framework.util.TradeErrorCode
import com.supwisdom.dlpay.framework.util.WaterErrorCode
import com.supwisdom.dlpay.water.domain.TDevice
-import com.supwisdom.dlpay.water.domain.TRegion
+import com.supwisdom.dlpay.water.domain.TArea
import com.supwisdom.dlpay.water.service.DeviceService
import com.supwisdom.dlpay.water.system.bean.RegionSearchBean
-import com.supwisdom.dlpay.water.service.RegionService
+import com.supwisdom.dlpay.water.service.AreaService
import com.supwisdom.dlpay.water.system.bean.DeviceSearchBean
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.http.ResponseEntity
@@ -19,7 +19,7 @@
class RegionController {
@Autowired
- lateinit var regionService: RegionService
+ lateinit var areaService: AreaService
@Autowired
lateinit var deviceService: DeviceService
@@ -34,7 +34,7 @@
@ResponseBody
fun queryAllRegion(): ResponseEntity<Any> {
try {
- regionService.queryAllRegion()?.let {
+ areaService.queryAllAreas()?.let {
return ResponseEntity.ok(ResponseBodyBuilder.create()
.data("regions", it)
.success())
@@ -50,7 +50,7 @@
@ResponseBody
fun queryRegions(@PathVariable parentId: Int,
@RequestParam("page", defaultValue = "1", required = false) pageNo: Int,
- @RequestParam("limit", defaultValue = "10", required = false) pageSize: Int): PageResult<TRegion> {
+ @RequestParam("limit", defaultValue = "10", required = false) pageSize: Int): PageResult<TArea> {
try {
if (pageNo < 1 || pageSize < 1) {
return PageResult(WaterErrorCode.REQUEST_DATA_ERROR, "请求参数错误")
@@ -60,7 +60,7 @@
this.pageSize = pageSize
this.parentId = parentId
}
- regionService.queryRegionsByParentId(searchBean)?.let {
+ areaService.queryAreasByParentId(searchBean)?.let {
return it
}
return PageResult(WaterErrorCode.DATA_NOTFOUND_ERROR, "区域未找到")
@@ -73,7 +73,7 @@
@ResponseBody
fun queryRegions(@RequestParam(value = "searchkey", required = false) searchKey: String,
@RequestParam("page", defaultValue = "1", required = false) pageNo: Int,
- @RequestParam("limit", defaultValue = "10", required = false) pageSize: Int): PageResult<TRegion> {
+ @RequestParam("limit", defaultValue = "10", required = false) pageSize: Int): PageResult<TArea> {
try {
if (pageNo < 1 || pageSize < 1) {
return PageResult(WaterErrorCode.REQUEST_DATA_ERROR, "请求参数错误")
@@ -83,7 +83,7 @@
this.pageSize = pageSize
this.searchKey = searchKey
}
- regionService.queryRegionsBySearchKey(searchBean)?.let {
+ areaService.queryAreasBySearchKey(searchBean)?.let {
return it
}
return PageResult(WaterErrorCode.REQUEST_DATA_ERROR, "区域未找到")
@@ -96,8 +96,8 @@
@ResponseBody
fun getRegionTree(): ResponseEntity<Any> {
try {
- regionService.queryAllRegion()?.let { it ->
- regionService.getRegionTree(it, 0)?.let {
+ areaService.queryAllAreas()?.let { it ->
+ areaService.getAreaTree(it, 0)?.let {
return ResponseEntity.ok(ResponseBodyBuilder.create()
.data("regions", it)
.success())
@@ -112,19 +112,19 @@
@PostMapping("/region/add")
@ResponseBody
- fun addRegion(@RequestBody region: TRegion): ResponseEntity<Any> {
+ fun addRegion(@RequestBody area: TArea): ResponseEntity<Any> {
try {
- if (null == region.regiName) {
+ if (null == area.areaName) {
return ResponseEntity.ok(ResponseBodyBuilder.create()
.fail(WaterErrorCode.REQUEST_DATA_ERROR, "区域名不能为空"))
}
- if (!regionService.checkRegiName(region)) {
+ if (!areaService.checkAreaName(area)) {
return ResponseEntity.ok(ResponseBodyBuilder.create()
.fail(WaterErrorCode.REQUEST_DATA_ERROR, "区域名已存在"))
}
- if (null == region.regino) {
- return if (regionService.saveRegion(region)) {
+ if (null == area.areano) {
+ return if (areaService.saveArea(area)) {
ResponseEntity.ok(ResponseBodyBuilder.create()
.data("msg", "新增成功")
.success())
@@ -133,7 +133,7 @@
.fail(WaterErrorCode.PROCESS_ERROR, "新增失败"))
}
} else {
- return if (regionService.updateRegion(region)) {
+ return if (areaService.updateArea(area)) {
ResponseEntity.ok(ResponseBodyBuilder.create()
.data("msg", "更新成功")
.success())
@@ -152,15 +152,15 @@
@ResponseBody
fun del(@RequestParam("regino") regino: Int): ResponseEntity<Any> {
try {
- if (regionService.existSubRegion(regino)) {
+ if (areaService.existSubArea(regino)) {
return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(WaterErrorCode.REQUEST_DATA_ERROR ,"该区域存在子区域,删除失败"))
+ .fail(WaterErrorCode.REQUEST_DATA_ERROR, "该区域存在子区域,删除失败"))
}
if (deviceService.existSubDevice(regino)) {
return ResponseEntity.ok(ResponseBodyBuilder.create()
.fail(WaterErrorCode.REQUEST_DATA_ERROR, "该区域有关联设备,删除失败"))
}
- return if (regionService.deleteRegion(regino)) {
+ return if (areaService.deleteArea(regino)) {
ResponseEntity.ok(ResponseBodyBuilder.create()
.data("msg", "删除成功")
.success())
@@ -247,7 +247,7 @@
@GetMapping("/device/devino/{devino}")
@ResponseBody
- fun checkDevino(@PathVariable devino: Int): ResponseEntity<Any> {
+ fun checkDevino(@PathVariable devino: String): ResponseEntity<Any> {
try {
deviceService.queryDeviceById(devino)?.let {
return ResponseEntity.ok(ResponseBodyBuilder.create()
@@ -265,7 +265,7 @@
@PostMapping("/device/del")
@ResponseBody
- fun del(@RequestParam devino: Int): ResponseEntity<Any> {
+ fun del(@RequestParam devino: String): ResponseEntity<Any> {
return try {
if (deviceService.deleteDevice(devino)) {
ResponseEntity.ok(ResponseBodyBuilder.create()
@@ -314,9 +314,9 @@
this.pageNo = pageNo
this.pageSize = pageSize
this.deviname = deviname
- this.devino=devino
- this.regino=regino
- this.devistatus=devistatus
+ this.devino = devino
+ this.regino = regino
+ this.devistatus = devistatus
}
deviceService.queryDeviceByParams(searchBean)?.let {
return it
diff --git a/src/main/kotlin/com/supwisdom/dlpay/water/service/transdtl_service.kt b/src/main/kotlin/com/supwisdom/dlpay/water/service/transdtl_service.kt
new file mode 100644
index 0000000..e359f81
--- /dev/null
+++ b/src/main/kotlin/com/supwisdom/dlpay/water/service/transdtl_service.kt
@@ -0,0 +1,30 @@
+package com.supwisdom.dlpay.water.service
+
+import com.supwisdom.dlpay.exception.TransactionProcessException
+import com.supwisdom.dlpay.framework.util.WaterErrorCode
+import com.supwisdom.dlpay.water.UploadRecordRequest
+import com.supwisdom.dlpay.water.dao.TransdtlDao
+import com.supwisdom.dlpay.water.domain.TTransdtl
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Service
+
+@Service
+class TransdtlServiceImpl : TransdtlService {
+ @Autowired
+ private lateinit var transdtlDao: TransdtlDao
+
+ override fun createNewTransdtl(dtl: TTransdtl): TTransdtl {
+ transdtlDao.save(dtl)
+ return dtl
+ }
+
+ override fun saveDeviceDtlData(record: UploadRecordRequest): TTransdtl {
+ val dtl = transdtlDao.findByBillnoForUpdate(record.billno)
+ ?: throw TransactionProcessException(WaterErrorCode.DATA_NOTFOUND_ERROR,
+ "交易订单号不存在")
+ dtl.amount = record.amount / 100.0
+ dtl.waterSumHundredLitre = record.waterIn100ML
+ transdtlDao.save(dtl)
+ return dtl
+ }
+}
\ No newline at end of file
diff --git a/src/main/resources/db/migration/V1.3__init_data.sql b/src/main/resources/db/migration/V1.3__init_data.sql
index cc069ad..46f944d 100644
--- a/src/main/resources/db/migration/V1.3__init_data.sql
+++ b/src/main/resources/db/migration/V1.3__init_data.sql
@@ -7,46 +7,46 @@
CREATE SEQUENCE "public"."seq_regi" INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1;
ALTER SEQUENCE "public"."seq_regi" OWNER TO "watermanager";
CREATE TABLE "public"."tb_region" (
- "regino" int4 NOT NULL DEFAULT nextval('seq_regi'::regclass),
+ "areano" int4 NOT NULL DEFAULT nextval('seq_regi'::regclass),
"address" varchar(255) COLLATE "pg_catalog"."default",
"level" int4,
"parentid" int4,
- "reginame" varchar(200) COLLATE "pg_catalog"."default",
+ "areaname" varchar(200) COLLATE "pg_catalog"."default",
"remarks" varchar(255) COLLATE "pg_catalog"."default",
"parentname" varchar(200) COLLATE "pg_catalog"."default",
"available" int4,
- CONSTRAINT "tb_region_pkey" PRIMARY KEY ("regino")
+ CONSTRAINT "tb_region_pkey" PRIMARY KEY ("areano")
);
ALTER TABLE "public"."tb_region" OWNER TO "watermanager";
-COMMENT ON COLUMN "public"."tb_region"."regino" IS '区域编号';
+COMMENT ON COLUMN "public"."tb_region"."areano" IS '区域编号';
COMMENT ON COLUMN "public"."tb_region"."address" IS '详细地址';
COMMENT ON COLUMN "public"."tb_region"."level" IS '区域级别';
COMMENT ON COLUMN "public"."tb_region"."parentid" IS '父区域编号,根节点为0';
-COMMENT ON COLUMN "public"."tb_region"."reginame" IS '区域名';
+COMMENT ON COLUMN "public"."tb_region"."areaname" IS '区域名';
COMMENT ON COLUMN "public"."tb_region"."remarks" IS '备注';
COMMENT ON COLUMN "public"."tb_region"."parentname" IS '父区域名';
COMMENT ON COLUMN "public"."tb_region"."available" IS '是否可用,0否1是';
-INSERT INTO "public"."tb_region"("address", "level", "parentid", "reginame", "remarks", "parentname","available") VALUES (NULL, 1, 0, '杨浦区', NULL, '无',1);
-INSERT INTO "public"."tb_region"("address", "level", "parentid", "reginame", "remarks", "parentname","available") VALUES (NULL, 1, 0, '虹口区', NULL, '无',1);
-INSERT INTO "public"."tb_region"("address", "level", "parentid", "reginame", "remarks", "parentname","available") VALUES ('隆昌路18号', 2, 1, '测试小区1', NULL, '杨浦区',1);
-INSERT INTO "public"."tb_region"("address", "level", "parentid", "reginame", "remarks", "parentname","available") VALUES ('宁国路77号', 2, 1, '测试小区2', NULL, '杨浦区',1);
-INSERT INTO "public"."tb_region"("address", "level", "parentid", "reginame", "remarks", "parentname","available") VALUES ('四川北路20号', 2, 2, '虹口小区1', NULL, '虹口区',1);
-INSERT INTO "public"."tb_region"("address", "level", "parentid", "reginame", "remarks", "parentname","available") VALUES ('测试小区1一号楼', 3, 3, '一号楼', NULL, '测试小区1',1);
-INSERT INTO "public"."tb_region"("address", "level", "parentid", "reginame", "remarks", "parentname","available") VALUES ('测试小区1二号楼', 3, 3, '二号楼', NULL, '测试小区1',0);
+INSERT INTO "public"."tb_region"("address", "level", "parentid", "areaname", "remarks", "parentname","available") VALUES (NULL, 1, 0, '杨浦区', NULL, '无',1);
+INSERT INTO "public"."tb_region"("address", "level", "parentid", "areaname", "remarks", "parentname","available") VALUES (NULL, 1, 0, '虹口区', NULL, '无',1);
+INSERT INTO "public"."tb_region"("address", "level", "parentid", "areaname", "remarks", "parentname","available") VALUES ('隆昌路18号', 2, 1, '测试小区1', NULL, '杨浦区',1);
+INSERT INTO "public"."tb_region"("address", "level", "parentid", "areaname", "remarks", "parentname","available") VALUES ('宁国路77号', 2, 1, '测试小区2', NULL, '杨浦区',1);
+INSERT INTO "public"."tb_region"("address", "level", "parentid", "areaname", "remarks", "parentname","available") VALUES ('四川北路20号', 2, 2, '虹口小区1', NULL, '虹口区',1);
+INSERT INTO "public"."tb_region"("address", "level", "parentid", "areaname", "remarks", "parentname","available") VALUES ('测试小区1一号楼', 3, 3, '一号楼', NULL, '测试小区1',1);
+INSERT INTO "public"."tb_region"("address", "level", "parentid", "areaname", "remarks", "parentname","available") VALUES ('测试小区1二号楼', 3, 3, '二号楼', NULL, '测试小区1',0);
CREATE TABLE "public"."tb_device" (
- "devino" int4 NOT NULL,
- "deviname" varchar(200) COLLATE "pg_catalog"."default",
- "devistatus" varchar(100) COLLATE "pg_catalog"."default",
- "regino" int4,
- "reginame" varchar(200) COLLATE "pg_catalog"."default",
- CONSTRAINT "tb_device_pkey" PRIMARY KEY ("devino")
+ "deviceno" int4 NOT NULL,
+ "devicename" varchar(200) COLLATE "pg_catalog"."default",
+ "deviceStatus" varchar(100) COLLATE "pg_catalog"."default",
+ "areano" int4,
+ "areaname" varchar(200) COLLATE "pg_catalog"."default",
+ CONSTRAINT "tb_device_pkey" PRIMARY KEY ("deviceno")
);
ALTER TABLE "public"."tb_device" OWNER TO "watermanager";
-COMMENT ON COLUMN "public"."tb_device"."devino" IS '设备编号';
-COMMENT ON COLUMN "public"."tb_device"."deviname" IS '设备名称';
-COMMENT ON COLUMN "public"."tb_device"."devistatus" IS '设备状态';
-COMMENT ON COLUMN "public"."tb_device"."regino" IS '所属区域编号';
-COMMENT ON COLUMN "public"."tb_device"."reginame" IS '所属区域名';
-INSERT INTO "public"."tb_device"("devino","deviname", "devistatus", "regino", "reginame") VALUES (10000001,'食堂POS01', '正常', 10, '三号楼');
+COMMENT ON COLUMN "public"."tb_device"."deviceno" IS '设备编号';
+COMMENT ON COLUMN "public"."tb_device"."devicename" IS '设备名称';
+COMMENT ON COLUMN "public"."tb_device"."deviceStatus" IS '设备状态';
+COMMENT ON COLUMN "public"."tb_device"."areano" IS '所属区域编号';
+COMMENT ON COLUMN "public"."tb_device"."areaname" IS '所属区域名';
+INSERT INTO "public"."tb_device"("deviceno","devicename", "deviceStatus", "areano", "areaname") VALUES (10000001,'食堂POS01', '正常', 10, '三号楼');
diff --git a/src/main/resources/templates/system/device/form.html b/src/main/resources/templates/system/device/form.html
index a58ebe4..fc2dc0a 100644
--- a/src/main/resources/templates/system/device/form.html
+++ b/src/main/resources/templates/system/device/form.html
@@ -3,21 +3,21 @@
<div class="layui-form-item">
<label class="layui-form-label">设备名称</label>
<div class="layui-input-block">
- <input name="deviname" placeholder="不能重复" type="text" class="layui-input" maxlength="20"
+ <input name="devicename" placeholder="不能重复" type="text" class="layui-input" maxlength="20"
lay-verify="required" required/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">设备编号</label>
<div class="layui-input-block">
- <input name="devino" id="input-devino" placeholder="请输入8位数字" type="text" class="layui-input" maxlength="8"
- lay-verify="required|devino" required/>
+ <input name="deviceno" id="input-deviceno" placeholder="请输入8位数字" type="text" class="layui-input" maxlength="8"
+ lay-verify="required|deviceno" required/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">所属区域</label>
<div class="layui-input-block">
- <select name="regino" id="selectCity" lay-verify="required" lay-search>
+ <select name="areano" id="selectCity" lay-verify="required" lay-search>
</select>
</div>
@@ -40,17 +40,17 @@
admin.putTempData('t_func', '');
if (func) {
form.val('form', func);
- $("#input-devino").attr('readonly', 'readonly');
+ $("#input-deviceno").attr('readonly', 'readonly');
$.ajax({
url: "/region/all",
type: "GET",
success: function (data) {
if (data.retcode == '0') {
- var html = '<option value="' + func.regino + '">' + func.reginame + '</option>'
+ var html = '<option value="' + func.areano + '">' + func.areaname + '</option>'
var regions = data.regions
for (var i = 0; i < regions.length; i++) {
- if (regions[i].regino != func.regino) {
- html += '<option value="' + regions[i].regino + '">' + regions[i].regiName + '</option>';
+ if (regions[i].areano != func.areano) {
+ html += '<option value="' + regions[i].areano + '">' + regions[i].areaName + '</option>';
}
}
$("#selectCity").html(html);
@@ -71,7 +71,7 @@
var html = '<option value="">请选择一个区域</option>'
var regions = data.regions
for (var i = 0; i < regions.length; i++) {
- html += '<option value="' + regions[i].regino + '">' + regions[i].regiName + '</option>'
+ html += '<option value="' + regions[i].areano + '">' + regions[i].areaName + '</option>'
}
$("#selectCity").html(html);
form.render('select', 'form')
@@ -83,14 +83,14 @@
});
}
form.verify({
- devino: function (value, item) {
+ deviceno: function (value, item) {
if (!item.readOnly) {
if (!new RegExp("^\\d{8}$").test(value)) {
return '设备编号必须为8位数字';
}
var msg = '';
$.ajax({
- url: "device/devino/" + value,
+ url: "device/deviceno/" + value,
type: "GET",
async: false,
success: function (data) {
diff --git a/src/main/resources/templates/system/device/index.html b/src/main/resources/templates/system/device/index.html
index 7ef64d6..fbbd77f 100644
--- a/src/main/resources/templates/system/device/index.html
+++ b/src/main/resources/templates/system/device/index.html
@@ -12,11 +12,11 @@
<div class="layui-row">
<div class="layui-col-md3">
设备名称
- <input id="deviname-search-value" class="layui-input search-input" type="text"/>
+ <input id="devicename-search-value" class="layui-input search-input" type="text"/>
</div>
<div class="layui-col-md4">
终端编号
- <input id="devino-search-value" class="layui-input search-input" type="text"/>
+ <input id="deviceno-search-value" class="layui-input search-input" type="text"/>
</div>
<div class="layui-col-md3">
所在小区
@@ -76,7 +76,7 @@
var html = '<option value="">请选择一个区域</option>'
var regions = data.regions
for (var i = 0; i < regions.length; i++) {
- html += '<option value="' + regions[i].regino + '">' + regions[i].regiName + '</option>'
+ html += '<option value="' + regions[i].areano + '">' + regions[i].areaName + '</option>'
}
$("#select-region").html(html);
form.render('select')
@@ -113,10 +113,10 @@
page: true,
cols: [
[
- {field: 'deviname', align: 'center', title: '设备名称'},
- {field: 'devino', align: 'center', title: '设备编号', unresize: true},
- {field: 'devistatus', align: 'center', title: '状态', unresize: true},
- {field: 'reginame', align: 'center', title: '所在区域'},
+ {field: 'devicename', align: 'center', title: '设备名称'},
+ {field: 'deviceno', align: 'center', title: '设备编号', unresize: true},
+ {field: 'deviceStatus', align: 'center', title: '状态', unresize: true},
+ {field: 'areaname', align: 'center', title: '所在区域'},
{
field: 'deviceId', align: 'center', title: '操作', unresize: true, templet: function (item) {
let html = ' <a class="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>修改</a> ' +
@@ -134,18 +134,18 @@
// 搜索按钮点击事件
$('#btn-search-device').click(function () {
- var deviname = $('#deviname-search-value').val();
- var devino = $('#devino-search-value').val();
- var regino = $('#select-region').val();
+ var devicename = $('#devicename-search-value').val();
+ var deviceno = $('#deviceno-search-value').val();
+ var areano = $('#select-region').val();
var status = $('#select-status').val();
- devino == '' ? 'null' : devino;
- console.log(devino)
- regino == "" ? 'null' : regino;
+ deviceno == '' ? 'null' : deviceno;
+ console.log(deviceno)
+ areano == "" ? 'null' : areano;
table.reload('devicetable', {
where: {
- deviname: deviname,
- devino: devino,
- regino: regino,
+ devicename: devicename,
+ deviceno: deviceno,
+ areano: areano,
devistatus: status
},
url: "/device/search"
@@ -194,7 +194,7 @@
layer.load(2);
let token = $("meta[name='_csrf_token']").attr("value");
admin.go('/device/del', {
- devino: data.devino,
+ deviceno: data.deviceno,
_csrf: token
}, function (data) {
console.log(data.code);
diff --git a/src/main/resources/templates/system/region/form.html b/src/main/resources/templates/system/region/form.html
index 1679c76..fad5de3 100644
--- a/src/main/resources/templates/system/region/form.html
+++ b/src/main/resources/templates/system/region/form.html
@@ -1,10 +1,10 @@
<!-- operator表单弹窗 -->
<form id="form" lay-filter="form" class="layui-form model-form">
- <input name="regino" id="regino" type="hidden"/>
+ <input name="areano" id="areano" type="hidden"/>
<div class="layui-form-item">
<label class="layui-form-label">区域名称</label>
<div class="layui-input-block">
- <input name="regiName" placeholder="不能重复" type="text" class="layui-input" maxlength="20"
+ <input name="areaName" placeholder="不能重复" type="text" class="layui-input" maxlength="20"
lay-verify="required" required/>
</div>
</div>
@@ -46,7 +46,7 @@
// 清除admin域中的数据
admin.putTempData('t_func', '');
if (func) {
- $('input[name="regino"]').attr('readonly', 'readonly');
+ $('input[name="areano"]').attr('readonly', 'readonly');
var html='<option value="'+func.parentId+'">'+func.parentName+'</option>'
$("#selectCity").html(html);
form.val('form', func);
@@ -63,7 +63,7 @@
// var html='<option value="0">根区域</option>'
// var regions = data.regions
// for (var i = 0; i < regions.length; i++) {
- // html+='<option value="'+regions[i].regino+'">'+regions[i].regiName+'</option>'
+ // html+='<option value="'+regions[i].areano+'">'+regions[i].areaName+'</option>'
// }
// $("#selectCity").html(html);
// form.render('select','form')
diff --git a/src/main/resources/templates/system/region/index.html b/src/main/resources/templates/system/region/index.html
index 6a2cc96..ab23c76 100644
--- a/src/main/resources/templates/system/region/index.html
+++ b/src/main/resources/templates/system/region/index.html
@@ -51,8 +51,8 @@
toolbar: true,
cols: [
[
- {field: 'regino', align: 'center', title: '区域号', unresize: true, width: "9%"},
- {field: 'regiName', align: 'center', title: '区域名称'},
+ {field: 'areano', align: 'center', title: '区域号', unresize: true, width: "9%"},
+ {field: 'areaName', align: 'center', title: '区域名称'},
{field: 'level', align: 'center', title: '区域级别', unresize: true, width: "10%"},
{field: 'parentName', align: 'center', title: '父区域'},
{field: 'address', align: 'center', title: '详细地址'},
@@ -147,7 +147,7 @@
layer.load(2);
let token = $("meta[name='_csrf_token']").attr("value");
admin.go('/region/del', {
- regino: data.regino,
+ areano: data.areano,
_csrf: token
}, function (data) {
console.log(data.code);
diff --git a/src/test/kotlin/com/supwisdom/dlpay/controller/UserControllerTest.kt b/src/test/kotlin/com/supwisdom/dlpay/controller/UserControllerTest.kt
index c76eb14..5dc498e 100644
--- a/src/test/kotlin/com/supwisdom/dlpay/controller/UserControllerTest.kt
+++ b/src/test/kotlin/com/supwisdom/dlpay/controller/UserControllerTest.kt
@@ -5,7 +5,7 @@
import com.supwisdom.dlpay.api.bean.OpenUserParam
import com.supwisdom.dlpay.api.bean.QueryUserParam
import com.supwisdom.dlpay.api.domain.TAccount
-import com.supwisdom.dlpay.api.domain.TPerson
+import com.supwisdom.dlpay.framework.domain.TPerson
import org.junit.Assert
import org.junit.Test
import org.springframework.http.MediaType