移除无用代码
diff --git a/src/main/java/com/supwisdom/dlpay/ServletInitializer.kt b/src/main/java/com/supwisdom/dlpay/ServletInitializer.kt
index 44be3ce..5f848d4 100644
--- a/src/main/java/com/supwisdom/dlpay/ServletInitializer.kt
+++ b/src/main/java/com/supwisdom/dlpay/ServletInitializer.kt
@@ -6,7 +6,7 @@
class ServletInitializer : SpringBootServletInitializer() {
override fun configure(application: SpringApplicationBuilder): SpringApplicationBuilder {
- return application.sources(WaterManagerApplication::class.java)
+ return application.sources(DoorApplication::class.java)
}
}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TAccount.java b/src/main/java/com/supwisdom/dlpay/api/domain/TAccount.java
deleted file mode 100644
index dc97643..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TAccount.java
+++ /dev/null
@@ -1,292 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import com.supwisdom.dlpay.framework.util.MD5;
-import com.supwisdom.dlpay.framework.util.MoneyUtil;
-import org.hibernate.annotations.GenericGenerator;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_ACCOUNT",
- indexes = {@Index(name = "acc_userid_idx", columnList = "userid"),
- @Index(name = "acc_status_idx", columnList = "status"),
- @Index(name = "acc_subjno_uk", unique = true, columnList = "subjno,userid")})
-public class TAccount {
- @Id
- @GenericGenerator(name = "idGenerator", strategy = "uuid")
- @GeneratedValue(generator = "idGenerator")
- @Column(name = "ACCNO", nullable = false, length = 32)
- private String accno; //账号
-
- @Column(name = "ACCNAME", length = 100)
- private String accname; //账户名
-
- @Column(name = "SUBJNO", length = 10)
- private String subjno; //科目号
-
- @Column(name = "USERID", nullable = false, length = 32)
- private String userid; //用户ID
-
- @Column(name = "STATUS", nullable = false, length = 20)
- private String status; //状态:normal-正常;closed-注销;locked-冻结
-
- @Column(name = "BALANCE", nullable = false, precision = 15, scale = 2)
- private Double balance; //总余额
-
- @Column(name = "AVAILBAL", nullable = false, precision = 15, scale = 2)
- private Double availbal; //可用余额
-
- @Column(name = "FROZEBAL", nullable = false, precision = 15, scale = 2)
- private Double frozebal; //冻结金额
-
- @Column(name = "LOWFREE_FLAG", nullable = false, precision = 1, scale = 0)
- private Boolean lowfreeFlag; //低额免密开关
-
- @Column(name = "LOWFREE_LIMIT", precision = 9, scale = 2)
- private Double lowfreeLimit; //免密额度
-
- @Column(name = "DAY_LIMIT", precision = 9, scale = 2)
- private Double daylimit; // 日累计消费额度
-
- @Column(name = "MAX_BAL", precision = 15, scale = 2)
- private Double maxbal; // 最大余额限制
-
- @Column(name = "LAST_TRANSDATE", length = 8)
- private String lasttransdate; //最后交易日期
-
- @Column(name = "LASTDAY_TRANSAMT", precision = 9, scale = 2)
- private Double lastdayTransamt; //最后一天消费金额
-
- @Column(name = "LASTDAY_DPSAMT", precision = 9, scale = 2)
- private Double lastdayDpsamt; //最后一天充值金额
-
- @Column(name = "TAC", length = 32)
- private String tac; //校验
-
- @Column(name = "OPENDATE", nullable = false, length = 8)
- private String opendate;
-
- @Column(name = "CLOSEDATE", length = 8)
- private String closedate;
-
- @OneToOne
- @JoinColumn(name = "USERID",insertable = false,updatable = false)
- private TPerson person;
-
- public TAccount() {
- }
-
- public TAccount(String accname, String subjno, String userid, String status, Double balance, Double availbal, Double frozebal, Boolean lowfreeFlag, Double lowfreeLimit, Double daylimit, Double maxbal, String lasttransdate, Double lastdayTransamt, Double lastdayDpsamt, String tac, String opendate, String closedate) {
- this.accname = accname;
- this.subjno = subjno;
- this.userid = userid;
- this.status = status;
- this.balance = balance;
- this.availbal = availbal;
- this.frozebal = frozebal;
- this.lowfreeFlag = lowfreeFlag;
- this.lowfreeLimit = lowfreeLimit;
- this.daylimit = daylimit;
- this.maxbal = maxbal;
- this.lasttransdate = lasttransdate;
- this.lastdayTransamt = lastdayTransamt;
- this.lastdayDpsamt = lastdayDpsamt;
- this.tac = tac;
- this.opendate = opendate;
- this.closedate = closedate;
- }
-
- public String getAccno() {
- return accno;
- }
-
- public void setAccno(String accno) {
- this.accno = accno;
- }
-
- public String getAccname() {
- return accname;
- }
-
- public void setAccname(String accname) {
- this.accname = accname;
- }
-
- public String getSubjno() {
- return subjno;
- }
-
- public void setSubjno(String subjno) {
- this.subjno = subjno;
- }
-
- public String getUserid() {
- return userid;
- }
-
- public void setUserid(String userid) {
- this.userid = userid;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public Double getBalance() {
- return balance;
- }
-
- public void setBalance(Double balance) {
- this.balance = balance;
- }
-
- public Double getAvailbal() {
- return availbal;
- }
-
- public void setAvailbal(Double availbal) {
- this.availbal = availbal;
- }
-
- public Double getFrozebal() {
- return frozebal;
- }
-
- public void setFrozebal(Double frozebal) {
- this.frozebal = frozebal;
- }
-
- public Boolean getLowfreeFlag() {
- return lowfreeFlag;
- }
-
- public void setLowfreeFlag(Boolean lowfreeFlag) {
- this.lowfreeFlag = lowfreeFlag;
- }
-
- public Double getLowfreeLimit() {
- return lowfreeLimit;
- }
-
- public void setLowfreeLimit(Double lowfreeLimit) {
- this.lowfreeLimit = lowfreeLimit;
- }
-
- public Double getDaylimit() {
- return daylimit;
- }
-
- public void setDaylimit(Double daylimit) {
- this.daylimit = daylimit;
- }
-
- public Double getMaxbal() {
- return maxbal;
- }
-
- public void setMaxbal(Double maxbal) {
- this.maxbal = maxbal;
- }
-
- public String getLasttransdate() {
- return lasttransdate;
- }
-
- public void setLasttransdate(String lasttransdate) {
- this.lasttransdate = lasttransdate;
- }
-
- public Double getLastdayTransamt() {
- return lastdayTransamt;
- }
-
- public void setLastdayTransamt(Double lastdayTransamt) {
- this.lastdayTransamt = lastdayTransamt;
- }
-
- public Double getLastdayDpsamt() {
- return lastdayDpsamt;
- }
-
- public void setLastdayDpsamt(Double lastdayDpsamt) {
- this.lastdayDpsamt = lastdayDpsamt;
- }
-
- public String getTac() {
- return tac;
- }
-
- public void setTac(String tac) {
- this.tac = tac;
- }
-
- 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 String generateTac() {
- String data = this.accno + MoneyUtil.YuanToFen(this.availbal) + MoneyUtil.YuanToFen(this.balance) + MoneyUtil.YuanToFen(this.frozebal);
- return MD5.generatePassword(data, this.accno);
- }
-
- public boolean tacCheck() {
- String tac_c = generateTac();
- if (tac_c.equalsIgnoreCase(this.tac) || this.tac == null) {
- return true;
- }
- return false;
- }
-
- public void addAmount(double amount) {
- this.balance = this.balance + amount;
- this.availbal = this.availbal + amount;
- this.tac = this.generateTac();
- }
-
- public boolean checkOverflow() {
- if (null != this.maxbal && this.maxbal > 0) {
- if (MoneyUtil.moneyCompare(this.balance, this.maxbal) > 0) {
- return true; //超出账户最大值
- }
- }
- return false;
- }
-
- public boolean checkOverdraft() {
- if (MoneyUtil.moneyCompare(this.balance, 0) < 0) {
- return true; //欠费透支
- }
- return false;
- }
-
- public boolean checkOverdraft(double limit) {
- if (MoneyUtil.moneyCompare(this.balance, limit) < 0) {
- return true; //余额低于某阀值
- }
- return false;
- }
-
- public TPerson getPerson() {
- return person;
- }
-
- public void setPerson(TPerson person) {
- this.person = person;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TDebitCreditDtl.java b/src/main/java/com/supwisdom/dlpay/api/domain/TDebitCreditDtl.java
deleted file mode 100644
index 940a895..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TDebitCreditDtl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_USERDTL_DEBITCREDIT")
-@IdClass(TDebitCreditDtlPK.class)
-public class TDebitCreditDtl {
-
- @Id
- @Column(name = "REFNO", nullable = false, length = 32)
- private String refno;
-
- @Id
- @Column(name = "SEQNO", nullable = false, precision = 2)
- private Integer seqno;
-
- @Column(name = "settledate", length = 8)
- private String settleDate;
-
- @Column(name = "DRSUBJNO", length = 10)
- private String drsubjno; //借方科目
-
- @Column(name = "DRACCNO", length = 32)
- private String draccno; //借方账号
-
- @Column(name = "AMOUNT", precision = 9, scale = 2)
- private Double amount; //金额
-
- @Column(name = "CRSUBJNO", length = 10)
- private String crsubjno; //贷方科目
-
- @Column(name = "CRACCNO", length = 32)
- private String craccno; //贷方账号
-
- @Column(name = "SUMMARY", length = 240)
- private String summary; //摘要
-
-
- public String getRefno() {
- return refno;
- }
-
- public void setRefno(String refno) {
- this.refno = refno;
- }
-
- public Integer getSeqno() {
- return seqno;
- }
-
- public void setSeqno(Integer seqno) {
- this.seqno = seqno;
- }
-
- public String getDrsubjno() {
- return drsubjno;
- }
-
- public void setDrsubjno(String drsubjno) {
- this.drsubjno = drsubjno;
- }
-
- public String getDraccno() {
- return draccno;
- }
-
- public void setDraccno(String draccno) {
- this.draccno = draccno;
- }
-
- public Double getAmount() {
- return amount;
- }
-
- public void setAmount(Double amount) {
- this.amount = amount;
- }
-
- public String getCrsubjno() {
- return crsubjno;
- }
-
- public void setCrsubjno(String crsubjno) {
- this.crsubjno = crsubjno;
- }
-
- public String getCraccno() {
- return craccno;
- }
-
- public void setCraccno(String craccno) {
- this.craccno = craccno;
- }
-
- public String getSummary() {
- return summary;
- }
-
- public void setSummary(String summary) {
- this.summary = summary;
- }
-
- public String getSettleDate() {
- return settleDate;
- }
-
- public void setSettleDate(String settleDate) {
- this.settleDate = settleDate;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TDebitCreditDtlPK.java b/src/main/java/com/supwisdom/dlpay/api/domain/TDebitCreditDtlPK.java
deleted file mode 100644
index b8d7973..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TDebitCreditDtlPK.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class TDebitCreditDtlPK implements Serializable {
- @Id
- @Column(name = "REFNO", nullable = false, length = 32)
- private String refno;
-
- @Id
- @Column(name = "SEQNO", nullable = false, precision = 1)
- private Integer seqno;
-
- public String getRefno() {
- return refno;
- }
-
- public void setRefno(String refno) {
- this.refno = refno;
- }
-
- public Integer getSeqno() {
- return seqno;
- }
-
- public void setSeqno(Integer seqno) {
- this.seqno = seqno;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- TDebitCreditDtlPK tDebitCreditDtlPK = (TDebitCreditDtlPK) o;
- if (refno != null ? !refno.equals(tDebitCreditDtlPK.getRefno()) : refno != null)
- return false;
- if (seqno != null ? !seqno.equals(tDebitCreditDtlPK.getSeqno()) : seqno != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = refno != null ? refno.hashCode() : 0;
- result = 31 * result + (seqno != null ? seqno.hashCode() : 0);
- return result;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfig.java b/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfig.java
deleted file mode 100644
index 020cad6..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfig.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.*;
-
-/**
- * Created by shuwei on 2019/4/9.
- */
-@Entity
-@Table(name = "TB_PAYTYPE_CONFIG")
-@IdClass(TPaytypeConfigPK.class)
-public class TPaytypeConfig {
- @Id
- @Column(name = "PAYTYPE", nullable = false, length = 20)
- private String paytype;
- @Id
- @Column(name = "CONFIGID", nullable = false, length = 40)
- private String configid;
-
- @Column(name = "CONFIG_VALUE", length = 2000)
- private String configValue;
-
- @Column(name = "CONFIG_NAME", length = 200)
- private String configName;
-
- public String getPaytype() {
- return paytype;
- }
-
- public void setPaytype(String paytype) {
- this.paytype = paytype;
- }
-
- public String getConfigid() {
- return configid;
- }
-
- public void setConfigid(String configid) {
- this.configid = configid;
- }
-
- public String getConfigValue() {
- return configValue;
- }
-
- public void setConfigValue(String configValue) {
- this.configValue = configValue;
- }
-
- public String getConfigName() {
- return configName;
- }
-
- public void setConfigName(String configName) {
- this.configName = configName;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfigPK.java b/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfigPK.java
deleted file mode 100644
index 8f7e46f..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPaytypeConfigPK.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-/**
- * Created by shuwei on 2019/4/9.
- */
-@Embeddable
-public class TPaytypeConfigPK implements Serializable {
- @Id
- @Column(name = "PAYTYPE", nullable = false, length = 20)
- private String paytype;
- @Id
- @Column(name = "CONFIGID", nullable = false, length = 40)
- private String configid;
-
- public String getPaytype() {
- return paytype;
- }
-
- public void setPaytype(String paytype) {
- this.paytype = paytype;
- }
-
- public String getConfigid() {
- return configid;
- }
-
- public void setConfigid(String configid) {
- this.configid = configid;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- TPaytypeConfigPK that = (TPaytypeConfigPK) o;
-
- if (!paytype.equals(that.paytype)) return false;
- return configid.equals(that.configid);
- }
-
- @Override
- public int hashCode() {
- int result = paytype.hashCode();
- result = 31 * result + configid.hashCode();
- return result;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TPersondtl.java b/src/main/java/com/supwisdom/dlpay/api/domain/TPersondtl.java
deleted file mode 100644
index d132e79..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPersondtl.java
+++ /dev/null
@@ -1,255 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_PERSONDTL",
- indexes = {@Index(name = "prsndtl_transdate_idx", columnList = "transdate"),
- @Index(name = "prsndtl_accdate_idx", columnList = "accdate"),
- @Index(name = "prsndtl_status_idx", columnList = "status"),
- @Index(name = "prsndtl_reverse_idx", columnList = "REVERSE_FLAG")})
-public class TPersondtl {
-
- @Id
- @Column(name = "REFNO", nullable = false, length = 32)
- private String refno; //流水号
-
- @Column(name = "ACCDATE", length = 8, nullable = false)
- private String accdate; //记账日期
-
- @Column(name = "USERID", length = 32, nullable = false)
- private String userid; //用户ID,或账号
-
- @Column(name = "ACCNO", length = 32)
- private String accountNo;
-
- @Column(name = "USERNAME", length = 200)
- private String userName;
-
- @Column(name = "TRANSDATE", length = 8, nullable = false)
- private String transdate;
-
- @Column(name = "TRANSTIME", length = 6, nullable = false)
- private String transtime;
-
- @Column(name = "STATUS", length = 20, nullable = false)
- private String status;
-
- @Column(name = "BEFBAL", precision = 9, scale = 2)
- private Double befbal;
-
- @Column(name = "amount", precision = 9, scale = 2, nullable = false)
- private Double amount; //实际付款金额
-
- @Column(name = "SOURCETYPE", length = 20)
- private String sourceType; //支付方式 balance,wechat,alipay
-
- @Column(name = "PAYINFO", length = 200)
- private String payinfo; //记录支付信息备用字段
-
- @Column(name = "TRANSCODE", precision = 4, nullable = false)
- private Integer transcode;
-
- @Column(name = "TRANSDESC", length = 240)
- private String transdesc; //交易描述
-
- @Column(name = "OUTTRADENO", length = 60)
- private String outtradeno; //第三方流水号
-
- @Column(name = "OPPOSITEACCNO", length = 20)
- private String oppositeAccNo;
-
- @Column(name = "OPPOSITEACCNAME", length = 200)
- private String oppositeAccName;
-
- @Column(name = "OPERID", precision = 9)
- private Integer operid; //操作员ID
-
- @Column(name = "REVERSE_FLAG", nullable = false, length = 10)
- private String reverseFlag = "none"; //none, cancel, reversed
-
- @Column(name = "REVERSE_AMOUNT", precision = 9, scale = 2)
- private Double reverseAmount = 0D; //撤销金额填写
-
- @Column(name = "TRADEFLAG", nullable = false, length = 10)
- private String tradeflag; // out - 支出,in - 收入
-
- @Column(name = "REMARK", length = 240)
- private String remark;
-
- public String getRefno() {
- return refno;
- }
-
- public void setRefno(String refno) {
- this.refno = refno;
- }
-
- public String getAccdate() {
- return accdate;
- }
-
- public void setAccdate(String accdate) {
- this.accdate = accdate;
- }
-
- public String getUserid() {
- return userid;
- }
-
- public void setUserid(String userid) {
- this.userid = userid;
- }
-
- 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 getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public Double getBefbal() {
- return befbal;
- }
-
- public void setBefbal(Double befbal) {
- this.befbal = befbal;
- }
-
- public Double getAmount() {
- return amount;
- }
-
- public void setAmount(Double amount) {
- this.amount = amount;
- }
-
- public String getSourceType() {
- return sourceType;
- }
-
- public void setSourceType(String sourceType) {
- this.sourceType = sourceType;
- }
-
- public String getPayinfo() {
- return payinfo;
- }
-
- public void setPayinfo(String payinfo) {
- this.payinfo = payinfo;
- }
-
- public Integer getTranscode() {
- return transcode;
- }
-
- public void setTranscode(Integer transcode) {
- this.transcode = transcode;
- }
-
- public String getTransdesc() {
- return transdesc;
- }
-
- public void setTransdesc(String transdesc) {
- this.transdesc = transdesc;
- }
-
- public String getOuttradeno() {
- return outtradeno;
- }
-
- public void setOuttradeno(String outtradeno) {
- this.outtradeno = outtradeno;
- }
-
- public String getOppositeAccNo() {
- return oppositeAccNo;
- }
-
- public void setOppositeAccNo(String oppositeAccNo) {
- this.oppositeAccNo = oppositeAccNo;
- }
-
- public Integer getOperid() {
- return operid;
- }
-
- public void setOperid(Integer operid) {
- this.operid = operid;
- }
-
- public String getReverseFlag() {
- return reverseFlag;
- }
-
- public void setReverseFlag(String reverseFlag) {
- this.reverseFlag = reverseFlag;
- }
-
- public Double getReverseAmount() {
- return reverseAmount;
- }
-
- public void setReverseAmount(Double reverseAmount) {
- this.reverseAmount = reverseAmount;
- }
-
- public String getTradeflag() {
- return tradeflag;
- }
-
- public void setTradeflag(String tradeflag) {
- this.tradeflag = tradeflag;
- }
-
- public String getRemark() {
- return remark;
- }
-
- public void setRemark(String remark) {
- this.remark = remark;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getOppositeAccName() {
- return oppositeAccName;
- }
-
- public void setOppositeAccName(String oppositeAccName) {
- this.oppositeAccName = oppositeAccName;
- }
-
- public String getAccountNo() {
- return accountNo;
- }
-
- public void setAccountNo(String accountNo) {
- this.accountNo = accountNo;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TPointsAccount.java b/src/main/java/com/supwisdom/dlpay/api/domain/TPointsAccount.java
deleted file mode 100644
index d19e905..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPointsAccount.java
+++ /dev/null
@@ -1,143 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import com.supwisdom.dlpay.framework.util.MD5;
-
-import javax.persistence.*;
-
-/**
- * 积分账户表
- */
-@Entity
-@Table(name = "TB_POINTS_ACCOUNT")
-public class TPointsAccount {
- @Id
- @Column(name = "USERID", nullable = false, length = 32)
- private String userid;
-
- @Column(name = "POINTS", nullable = false, precision = 15)
- private Long points; //积分
-
- @Column(name = "ACCUMPOINTS", precision = 15)
- private Long accumPoints; //历史累计获取的积分
-
- @Column(name = "SUMPAYPOINTS", precision = 15)
- private Long sumpayPoints; //历史累计消费的积分
-
- @Column(name = "TAC", precision = 15)
- private String tac;
-
- @Column(name = "LASTSAVED", precision = 15)
- private String lastsaved;
-
- @OneToOne
- @JoinColumn(name = "USERID",insertable = false,updatable = false)
- private TPerson person;
-
- public TPerson getPerson() {
- return person;
- }
-
- public void setPerson(TPerson person) {
- this.person = person;
- }
-
- public TPointsAccount() {
- }
-
- public TPointsAccount(String userid, Long points, Long accumPoints, Long sumpayPoints, String tac, String lastsaved) {
- this.userid = userid;
- this.points = points;
- this.accumPoints = accumPoints;
- this.sumpayPoints = sumpayPoints;
- this.tac = tac;
- this.lastsaved = lastsaved;
- }
-
- public String getUserid() {
- return userid;
- }
-
- public void setUserid(String userid) {
- this.userid = userid;
- }
-
- public Long getPoints() {
- return points;
- }
-
- public void setPoints(Long points) {
- this.points = points;
- }
-
- public Long getAccumPoints() {
- return accumPoints;
- }
-
- public void setAccumPoints(Long accumPoints) {
- this.accumPoints = accumPoints;
- }
-
- public Long getSumpayPoints() {
- return sumpayPoints;
- }
-
- public void setSumpayPoints(Long sumpayPoints) {
- this.sumpayPoints = sumpayPoints;
- }
-
- public String getTac() {
- return tac;
- }
-
- public void setTac(String tac) {
- this.tac = tac;
- }
-
- public String getLastsaved() {
- return lastsaved;
- }
-
- public void setLastsaved(String lastsaved) {
- this.lastsaved = lastsaved;
- }
-
- public String generateTac() {
- String data = this.userid + this.points;
- return MD5.generatePassword(data, this.userid);
- }
-
- public boolean tacCheck() {
- String tac_c = generateTac();
- if (tac_c.equalsIgnoreCase(this.tac) || this.tac == null) {
- return true;
- }
- return false;
- }
-
- public void addPoints(int points) {
- this.points = this.points + points;
- if (points > 0) {
- this.accumPoints = ((this.accumPoints == null ? 0 : this.accumPoints) + Math.abs(points)); //获得积分累加
- } else {
- this.sumpayPoints = ((this.sumpayPoints == null ? 0 : this.sumpayPoints) + Math.abs(points)); //消费积分累加
- }
- this.tac = this.generateTac();
- }
-
- public void addPoints(int points, boolean revflag) {
- if (revflag) {
- //冲正返回积分
- this.points = this.points + points;
- if (points > 0) {
- this.sumpayPoints = ((this.sumpayPoints == null ? 0 : this.sumpayPoints) - Math.abs(points)); //消费积分累计冲正
- } else {
- this.accumPoints = ((this.accumPoints == null ? 0 : this.accumPoints) - Math.abs(points)); //获得积分累计冲正
- }
- this.tac = this.generateTac();
- } else {
- this.addPoints(points);
- }
- }
-
-
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TPointsTransdtl.java b/src/main/java/com/supwisdom/dlpay/api/domain/TPointsTransdtl.java
deleted file mode 100644
index dba4514..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPointsTransdtl.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.*;
-
-/**
- * 积分流水表
- */
-@Entity
-@Table(name = "TB_POINTS_TRANSDTL",
- indexes = {@Index(name = "points_transdtl_idx", columnList = "billno")})
-public class TPointsTransdtl {
- @Id
- @Column(name="REFNO", nullable = false, length = 32)
- private String refno;
-
- @Column(name="USERID", nullable = false, length = 32)
- private String userid;
-
- @Column(name="ACCDATE", length = 8)
- private String accdate;
-
- @Column(name="POINTS", nullable = false, length = 15)
- private Long points;
-
- @Column(name="BEFPOINTS", length = 15)
- private Long befpoints;
-
- @Column(name="AFTPOINTS", length = 15)
- private Long aftpoints;
-
- @Column(name="STATUS", length = 15)
- private String status;
-
- @Column(name="BILLNO", length = 32)
- private String billno; //关联的消费流水号
-
- @Column(name="TRANSDATE", length = 8)
- private String transdate;
-
- @Column(name="TRANSTIME", length = 9)
- private String transtime;
-
- public TPointsTransdtl() {
- }
-
- public TPointsTransdtl(String refno, String userid, String accdate, Long points, Long befpoints, Long aftpoints, String status, String billno, String transdate, String transtime) {
- this.refno = refno;
- this.userid = userid;
- this.accdate = accdate;
- this.points = points;
- this.befpoints = befpoints;
- this.aftpoints = aftpoints;
- this.status = status;
- this.billno = billno;
- this.transdate = transdate;
- this.transtime = transtime;
- }
-
- public String getRefno() {
- return refno;
- }
-
- public void setRefno(String refno) {
- this.refno = refno;
- }
-
- public String getUserid() {
- return userid;
- }
-
- public void setUserid(String userid) {
- this.userid = userid;
- }
-
- public String getAccdate() {
- return accdate;
- }
-
- public void setAccdate(String accdate) {
- this.accdate = accdate;
- }
-
- public Long getPoints() {
- return points;
- }
-
- public void setPoints(Long points) {
- this.points = points;
- }
-
- public Long getBefpoints() {
- return befpoints;
- }
-
- public void setBefpoints(Long befpoints) {
- this.befpoints = befpoints;
- }
-
- public Long getAftpoints() {
- return aftpoints;
- }
-
- public void setAftpoints(Long aftpoints) {
- this.aftpoints = aftpoints;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getBillno() {
- return billno;
- }
-
- public void setBillno(String billno) {
- this.billno = billno;
- }
-
- 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;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytype.java b/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytype.java
deleted file mode 100644
index c358b6c..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytype.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_SHOP_PAYTYPE")
-@IdClass(TShopPaytypePK.class)
-public class TShopPaytype {
- @Id
- @Column(name = "SHOPACCNO", nullable = false, length = 10)
- private String shopaccno;
-
- @Id
- @Column(name = "PAYTYPE", nullable = false, length = 20)
- private String paytype;
-
- @Column(name = "CONSUME_ENABLE", nullable = false, length = 10)
- private boolean consumeEnable; //该商户下,此支付方式能否消费
-
- @Column(name = "ANONYMOUS_ENABLE", nullable = false, length = 10)
- private boolean anonymousEnable; //该商户下,此支付方式能否匿名消费
-
- @Column(name = "REVERSE_ENABLE", nullable = false, length = 10)
- private boolean reverseEnable; //该商户下,此支付方式能否冲正
-
- @Column(name = "CREATETIME", length = 14)
- private String createtime;
-
- public String getShopaccno() {
- return shopaccno;
- }
-
- public void setShopaccno(String shopaccno) {
- this.shopaccno = shopaccno;
- }
-
- public String getPaytype() {
- return paytype;
- }
-
- public void setPaytype(String paytype) {
- this.paytype = paytype;
- }
-
- public boolean getConsumeEnable() {
- return consumeEnable;
- }
-
- public void setConsumeEnable(boolean consumeEnable) {
- this.consumeEnable = consumeEnable;
- }
-
- public boolean getAnonymousEnable() {
- return anonymousEnable;
- }
-
- public void setAnonymousEnable(boolean anonymousEnable) {
- this.anonymousEnable = anonymousEnable;
- }
-
- public boolean getReverseEnable() {
- return reverseEnable;
- }
-
- public void setReverseEnable(boolean reverseEnable) {
- this.reverseEnable = reverseEnable;
- }
-
- public String getCreatetime() {
- return createtime;
- }
-
- public void setCreatetime(String createtime) {
- this.createtime = createtime;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypeConfig.java b/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypeConfig.java
deleted file mode 100644
index acea209..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypeConfig.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import org.hibernate.annotations.GenericGenerator;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_SHOP_PAYTYPE_CONFIG", indexes = {@Index(name = "shop_paytype_config_uk", unique = true, columnList = "shopaccno,paytype,configid")})
-public class TShopPaytypeConfig {
- @Id
- @GenericGenerator(name = "idGenerator", strategy = "uuid")
- @GeneratedValue(generator = "idGenerator")
- @Column(name = "CFGID", nullable = false, length = 32)
- private String cfgid;
-
- @Column(name = "SHOPACCNO", nullable = false, length = 10)
- private String shopaccno;
-
- @Column(name = "PAYTYPE", nullable = false, length = 20)
- private String paytype;
-
- @Column(name = "CONFIGID", nullable = false, length = 40)
- private String configid;
-
- @Column(name = "CONFIG_VALUE", length = 2000)
- private String configValue;
-
- @Column(name = "CONFIG_NAME", length = 200)
- private String configName;
-
- public TShopPaytypeConfig() {
- }
-
- public TShopPaytypeConfig(String shopaccno, String paytype, String configid, String configValue, String configName) {
- this.shopaccno = shopaccno;
- this.paytype = paytype;
- this.configid = configid;
- this.configValue = configValue;
- this.configName = configName;
- }
-
- public String getCfgid() {
- return cfgid;
- }
-
- public void setCfgid(String cfgid) {
- this.cfgid = cfgid;
- }
-
- public String getShopaccno() {
- return shopaccno;
- }
-
- public void setShopaccno(String shopaccno) {
- this.shopaccno = shopaccno;
- }
-
- public String getPaytype() {
- return paytype;
- }
-
- public void setPaytype(String paytype) {
- this.paytype = paytype;
- }
-
- public String getConfigid() {
- return configid;
- }
-
- public void setConfigid(String configid) {
- this.configid = configid;
- }
-
- public String getConfigValue() {
- return configValue;
- }
-
- public void setConfigValue(String configValue) {
- this.configValue = configValue;
- }
-
- public String getConfigName() {
- return configName;
- }
-
- public void setConfigName(String configName) {
- this.configName = configName;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypePK.java b/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypePK.java
deleted file mode 100644
index 4196b55..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TShopPaytypePK.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-@Embeddable
-public class TShopPaytypePK implements Serializable {
- @Id
- @Column(name = "SHOPACCNO", nullable = false, length = 10)
- private String shopaccno;
-
- @Id
- @Column(name = "PAYTYPE", nullable = false, length = 20)
- private String paytype;
-
- public TShopPaytypePK() {
- }
-
- public TShopPaytypePK(String shopaccno, String paytype) {
- this.shopaccno = shopaccno;
- this.paytype = paytype;
- }
-
- public String getShopaccno() {
- return shopaccno;
- }
-
- public void setShopaccno(String shopaccno) {
- this.shopaccno = shopaccno;
- }
-
- public String getPaytype() {
- return paytype;
- }
-
- public void setPaytype(String paytype) {
- this.paytype = paytype;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- TShopPaytypePK tShopPaytypePK = (TShopPaytypePK) o;
- if (shopaccno != null ? !shopaccno.equals(tShopPaytypePK.getShopaccno()) : shopaccno != null)
- return false;
- if (paytype != null ? !paytype.equals(tShopPaytypePK.getPaytype()) : paytype != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = shopaccno != null ? shopaccno.hashCode() : 0;
- result = 31 * result + (paytype != null ? paytype.hashCode() : 0);
- return result;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TShopdtl.java b/src/main/java/com/supwisdom/dlpay/api/domain/TShopdtl.java
deleted file mode 100644
index 76f97a4..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TShopdtl.java
+++ /dev/null
@@ -1,198 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_SHOPDTL",
- indexes = {@Index(name = "shopdtl_accdate", columnList = "accdate"),
- @Index(name = "shopdtl_shopaccno", columnList = "shopaccno"),
- @Index(name = "shopdtl_transdate", columnList = "transdate")})
-public class TShopdtl {
- @Id
- @Column(name = "REFNO", length = 32, nullable = false)
- private String refno;
-
- @Column(name = "ACCDATE", length = 8, nullable = false)
- private String accdate;
-
- @Column(name = "SHOPACCNO", length = 10, nullable = false)
- private String shopaccno;
-
- @Column(name = "SHOPNAME", length = 200)
- private String shopname;
-
- @Column(name = "AMOUNT", scale = 2, precision = 15, nullable = false)
- private Double amount;
-
- @Column(name = "TRANSDATE", length = 8, nullable = false)
- private String transdate;
-
- @Column(name = "TRANSTIME", length = 6, nullable = false)
- private String transtime;
-
- @Column(name = "TRANSCODE", precision = 8)
- private Integer transcode;
-
- @Column(name = "SOURCETYPE", length = 20)
- private String sourceType;
-
- @Column(name = "PAYINFO", length = 200)
- private String payInfo;
-
- @Column(name = "TRADEFLAG", length = 6, nullable = false)
- private String tradeflag; // out - 支出 , in - 收入
-
- @Column(name = "TRANSDESC", length = 240)
- private String transdesc; //交易描述
-
- @Column(name = "REVERSEFLAG", length = 10)
- private String reverseFlag;
-
- @Column(name = "STATUS", length = 20)
- private String status;
-
- @Column(name = "OPPOSITEACCNO", length = 64)
- private String oppositeAccNo;
-
- @Column(name = "OPPOSITEACCNAME", length = 200)
- private String oppositeAccName;
-
- @Column(name = "REMARK", length = 240)
- private String remark;
-
- public String getRefno() {
- return refno;
- }
-
- public void setRefno(String refno) {
- this.refno = refno;
- }
-
- 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 String getShopname() {
- return shopname;
- }
-
- public void setShopname(String shopname) {
- this.shopname = shopname;
- }
-
- public Double getAmount() {
- return amount;
- }
-
- public void setAmount(Double amount) {
- this.amount = amount;
- }
-
- 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 Integer getTranscode() {
- return transcode;
- }
-
- public void setTranscode(Integer transcode) {
- this.transcode = transcode;
- }
-
- public String getSourceType() {
- return sourceType;
- }
-
- public void setSourceType(String sourceType) {
- this.sourceType = sourceType;
- }
-
- public String getPayInfo() {
- return payInfo;
- }
-
- public void setPayInfo(String payInfo) {
- this.payInfo = payInfo;
- }
-
- public String getTradeflag() {
- return tradeflag;
- }
-
- public void setTradeflag(String tradeflag) {
- this.tradeflag = tradeflag;
- }
-
- public String getTransdesc() {
- return transdesc;
- }
-
- public void setTransdesc(String transdesc) {
- this.transdesc = transdesc;
- }
-
- public String getReverseFlag() {
- return reverseFlag;
- }
-
- public void setReverseFlag(String reverseFlag) {
- this.reverseFlag = reverseFlag;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getOppositeAccNo() {
- return oppositeAccNo;
- }
-
- public void setOppositeAccNo(String oppositeAccNo) {
- this.oppositeAccNo = oppositeAccNo;
- }
-
- public String getOppositeAccName() {
- return oppositeAccName;
- }
-
- public void setOppositeAccName(String oppositeAccName) {
- this.oppositeAccName = oppositeAccName;
- }
-
- public String getRemark() {
- return remark;
- }
-
- public void setRemark(String remark) {
- this.remark = remark;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TSourceType.java b/src/main/java/com/supwisdom/dlpay/api/domain/TSourceType.java
deleted file mode 100644
index c751316..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TSourceType.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.*;
-
-/**
- * Created by shuwei on 2019/4/9.
- */
-@Entity
-@Table(name = "TB_SOURCETYPE")
-public class TSourceType {
- @Id
- @Column(name = "SOURCETYPE", nullable = false, length = 20)
- private String sourceType;
-
- @Column(name = "ENABLE", nullable = false, length = 20)
- private Boolean enable;
-
- @Column(name = "CHARGE_ENABLE", nullable = false, length = 10)
- private Boolean chargeEnable; //充值总开关
-
- @Column(name = "CONSUME_ENABLE", nullable = false, length = 10)
- private Boolean consumeEnable; //消费总开关
-
- @Column(name = "ANONYMOUS_ENABLE", nullable = false, length = 10)
- private Boolean anonymousEnable; //匿名消费总开关
-
- @Column(name = "reversable")
- private Boolean reversable;
-
- @Column(name = "dps_enable")
- private Boolean depositEnable;
-
- @Column(name = "checkable")
- private Boolean checkable; // 是否需要清算
-
- @Column(name = "PAYDESC", length = 200)
- private String paydesc;
-
- public String getSourceType() {
- return sourceType;
- }
-
- public void setSourceType(String sourceType) {
- this.sourceType = sourceType;
- }
-
- public Boolean getEnable() {
- return enable;
- }
-
- public void setEnable(Boolean enable) {
- this.enable = enable;
- }
-
- public boolean isChargeEnable() {
- return chargeEnable;
- }
-
- public void setChargeEnable(Boolean chargeEnable) {
- this.chargeEnable = chargeEnable;
- }
-
- public Boolean getConsumeEnable() {
- return consumeEnable;
- }
-
- public void setConsumeEnable(Boolean consumeEnable) {
- this.consumeEnable = consumeEnable;
- }
-
- public Boolean getAnonymousEnable() {
- return anonymousEnable;
- }
-
- public void setAnonymousEnable(Boolean anonymousEnable) {
- this.anonymousEnable = anonymousEnable;
- }
-
- public String getPaydesc() {
- return paydesc;
- }
-
- public void setPaydesc(String paydesc) {
- this.paydesc = paydesc;
- }
-
- public Boolean getCheckable() {
- return checkable;
- }
-
- public void setCheckable(Boolean checkable) {
- this.checkable = checkable;
- }
-
- public Boolean getReversable() {
- return reversable;
- }
-
- public void setReversable(Boolean reversable) {
- this.reversable = reversable;
- }
-
- public Boolean getDepositEnable() {
- return depositEnable;
- }
-
- public void setDepositEnable(Boolean depositEnable) {
- this.depositEnable = depositEnable;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TSubjectdtl.java b/src/main/java/com/supwisdom/dlpay/api/domain/TSubjectdtl.java
deleted file mode 100644
index 3fd3be2..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TSubjectdtl.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "TB_SUBJECTDTL",
- indexes = {@Index(name = "subjdtl_accdate", columnList = "accdate"),
- @Index(name = "subjdtl_subjno", columnList = "subjno")})
-public class TSubjectdtl {
- @Id
- @Column(name = "refno", length = 32, nullable = false)
- private String refno;
-
- @Column(name = "accdate", length = 8, nullable = false)
- private String accdate;
-
- @Column(name = "subjno", length = 10, nullable = false)
- private String subjectno;
-
- @Column(name = "subjname", length = 200)
- private String subjectName;
-
- @Column(name = "amount", scale = 2, precision = 15)
- private Double amount;
-
- @Column(name = "tradecode", precision = 8)
- private Integer tradeCode;
-
- @Column(name = "transdate", length = 8)
- private String transDate;
-
- @Column(name = "transtime", length = 6)
- private String transTime;
-
- @Column(name = "paytype", length = 20)
- private String payType;
-
- @Column(name = "payinfo", length = 200)
- private String payInfo;
-
- @Column(name = "OPPOSITEACCNO", length = 20)
- private String oppositeAccNo;
-
- @Column(name = "OPPOSITEACCNAME", length = 200)
- private String oppositeAccName;
-
- @Column(name = "status", length = 20)
- private String status;
-
- public String getRefno() {
- return refno;
- }
-
- public void setRefno(String refno) {
- this.refno = refno;
- }
-
- public String getAccdate() {
- return accdate;
- }
-
- public void setAccdate(String accdate) {
- this.accdate = accdate;
- }
-
- public String getSubjectno() {
- return subjectno;
- }
-
- public void setSubjectno(String subjectno) {
- this.subjectno = subjectno;
- }
-
- public String getSubjectName() {
- return subjectName;
- }
-
- public void setSubjectName(String subjectName) {
- this.subjectName = subjectName;
- }
-
- public Double getAmount() {
- return amount;
- }
-
- public void setAmount(Double amount) {
- this.amount = amount;
- }
-
- 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 getPayType() {
- return payType;
- }
-
- public void setPayType(String payType) {
- this.payType = payType;
- }
-
- public String getPayInfo() {
- return payInfo;
- }
-
- public void setPayInfo(String payInfo) {
- this.payInfo = payInfo;
- }
-
- public String getOppositeAccNo() {
- return oppositeAccNo;
- }
-
- public void setOppositeAccNo(String oppositeAccNo) {
- this.oppositeAccNo = oppositeAccNo;
- }
-
- public String getOppositeAccName() {
- return oppositeAccName;
- }
-
- public void setOppositeAccName(String oppositeAccName) {
- this.oppositeAccName = oppositeAccName;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public Integer getTradeCode() {
- return tradeCode;
- }
-
- public void setTradeCode(Integer tradeCode) {
- this.tradeCode = tradeCode;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TTransactionMain.java b/src/main/java/com/supwisdom/dlpay/api/domain/TTransactionMain.java
deleted file mode 100644
index bd4a00f..0000000
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TTransactionMain.java
+++ /dev/null
@@ -1,285 +0,0 @@
-package com.supwisdom.dlpay.api.domain;
-
-import javax.persistence.*;
-
-import java.sql.Timestamp;
-import java.util.List;
-
-import static javax.persistence.FetchType.LAZY;
-
-@Entity
-@Table(name = "TB_TRANSACTIONMAIN",
- indexes = {@Index(name = "transmain_accdate", columnList = "accdate"),
- @Index(name = "transmain_status", columnList = "status"),
- @Index(name = "transmain_outtrade", unique = true, columnList = "outid, outtradeno")})
-public class TTransactionMain {
- @Id
- @Column(name = "refno", nullable = false, length = 32)
- private String refno;
-
- @Column(name = "accdate", nullable = false, length = 8)
- private String accdate;
-
- @Column(name = "checkable")
- private Boolean checkable; // 是否需要清算的交易
-
- @Column(name = "checkdate", length = 8)
- private String checkDate;
-
- @Column(name = "person")
- private Boolean person = false;
-
- @Column(name = "shop")
- private Boolean shop = false;
-
- @Column(name = "subject")
- private Boolean subject = false;
-
- @Column(name = "status", length = 20)
- private String status = "none";
-
- @Column(name = "sourcetype", length = 20)
- private String sourceType = "";
-
- @Column(name = "outtradeno", length = 60)
- private String outTradeNo = "";
-
- @Column(name = "outid", length = 60)
- private String outId;
-
- @Column(name = "OPERID", precision = 9)
- private String operid; //操作员ID
-
- @Column(name = "OPERTYPE", length = 10)
- private String opertype; // person - 个人, shop - 商户, operator - 操作员
-
- @Column(name = "settledate", length = 8)
- private String settleDate;
-
- @Column(name = "create_time")
- private Timestamp createTime;
-
- @Column(name = "end_time")
- private Timestamp endTime;
-
- @Column(name = "reverse_flag", nullable = false, length = 10)
- private String reverseFlag = "none"; // 冲正标识, none - 未冲正, reverse - 被撤销, cancel - 被冲正
-
- @OneToOne(targetEntity = TPersondtl.class, fetch = LAZY, cascade = CascadeType.ALL)
- @JoinColumn(name = "refno", referencedColumnName = "refno")
- private TPersondtl personDtl;
-
- @OneToOne(targetEntity = TShopdtl.class, fetch = LAZY, cascade = CascadeType.ALL)
- @JoinColumn(name = "refno", referencedColumnName = "refno")
- private TShopdtl shopDtl;
-
- @OneToOne(targetEntity = TSubjectdtl.class, fetch = LAZY, cascade = CascadeType.ALL)
- @JoinColumn(name = "refno", referencedColumnName = "refno")
- private TSubjectdtl subjectDtl;
-
- @OneToMany(targetEntity = TDebitCreditDtl.class, fetch = LAZY, cascade = CascadeType.ALL)
- @JoinColumn(name = "refno", referencedColumnName = "refno")
- private List<TDebitCreditDtl> details;
-
- public String getRefno() {
- return refno;
- }
-
- public void setRefno(String refno) {
- this.refno = refno;
- }
-
- public String getAccdate() {
- return accdate;
- }
-
- public void setAccdate(String accdate) {
- this.accdate = accdate;
- }
-
-
- public Boolean getPerson() {
- return person;
- }
-
- public void setPerson(Boolean person) {
- this.person = person;
- }
-
- public Boolean getShop() {
- return shop;
- }
-
- public void setShop(Boolean shop) {
- this.shop = shop;
- }
-
- public Boolean getSubject() {
- return subject;
- }
-
- public void setSubject(Boolean subject) {
- this.subject = subject;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getOutTradeNo() {
- return outTradeNo;
- }
-
- public void setOutTradeNo(String outTradeNo) {
- this.outTradeNo = outTradeNo;
- }
-
- public String getOutId() {
- return outId;
- }
-
- public void setOutId(String outId) {
- this.outId = outId;
- }
-
- public String getReverseFlag() {
- return reverseFlag;
- }
-
- public void setReverseFlag(String reverseFlag) {
- this.reverseFlag = reverseFlag;
- }
-
- public TPersondtl getPersonDtl() {
- return personDtl;
- }
-
- public TShopdtl getShopDtl() {
- return shopDtl;
- }
-
- public TSubjectdtl getSubjectDtl() {
- return subjectDtl;
- }
-
- public List<TDebitCreditDtl> getDetails() {
- return details;
- }
-
- public void setPersonDtl(TPersondtl personDtl) {
- this.personDtl = personDtl;
- }
-
- public void setShopDtl(TShopdtl shopDtl) {
- this.shopDtl = shopDtl;
- }
-
- public void setSubjectDtl(TSubjectdtl subjectDtl) {
- this.subjectDtl = subjectDtl;
- }
-
- public void setDetails(List<TDebitCreditDtl> details) {
- this.details = details;
- }
-
- public Timestamp getCreateTime() {
- return createTime;
- }
-
- public void setCreateTime(Timestamp createTime) {
- this.createTime = createTime;
- }
-
- public Timestamp getEndTime() {
- return endTime;
- }
-
- public void setEndTime(Timestamp endTime) {
- this.endTime = endTime;
- }
-
- public String getOperid() {
- return operid;
- }
-
- public void setOperid(String operid) {
- this.operid = operid;
- }
-
- public String getOpertype() {
- return opertype;
- }
-
- public void setOpertype(String opertype) {
- this.opertype = opertype;
- }
-
- public String getCheckDate() {
- return checkDate;
- }
-
- public void setCheckDate(String checkDate) {
- this.checkDate = checkDate;
- }
-
- public Boolean getCheckable() {
- return checkable;
- }
-
- public void setCheckable(Boolean checkable) {
- this.checkable = checkable;
- }
-
- public String getSettleDate() {
- return settleDate;
- }
-
- public void setSettleDate(String settleDate) {
- this.settleDate = settleDate;
- }
-
- public String getSourceType() {
- return sourceType;
- }
-
- public void setSourceType(String sourceType) {
- this.sourceType = sourceType;
- }
-
- public Double sumAmountByAccno(String accno, String subjno,
- int balanceFlag, String debitOrCredit) {
- Double debitSum = 0.0;
- Double creditSum = 0.0;
- for (TDebitCreditDtl dtl : getDetails()) {
- if (dtl.getDraccno().equals(accno) && dtl.getDrsubjno().equals(subjno)) {
- debitSum += dtl.getAmount();
- }
- if (dtl.getCraccno().equals(accno) && dtl.getCrsubjno().equals(subjno)) {
- creditSum += dtl.getAmount();
- }
- }
- if ("debit".equals(debitOrCredit)) {
- if (balanceFlag == 2) {
- return -debitSum;
- } else {
- return debitSum;
- }
- } else if ("credit".equals(debitOrCredit)) {
- if (balanceFlag == 1) {
- return -creditSum;
- } else {
- return creditSum;
- }
- } else {
- if (balanceFlag == 2) {
- return -(debitSum - creditSum);
- } else {
- return debitSum - creditSum;
- }
- }
- }
-}
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/TTranscode.java b/src/main/java/com/supwisdom/dlpay/framework/domain/TTranscode.java
deleted file mode 100644
index f4bb2f0..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/domain/TTranscode.java
+++ /dev/null
@@ -1,33 +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_TRANSCODE")
-public class TTranscode {
- @Id
- @Column(name="TRANSCODE", nullable = false, precision = 4)
- private Integer transcode;
-
- @Column(name="TRANSNAME", nullable = false, length = 100)
- private String transname;
-
- public Integer getTranscode() {
- return transcode;
- }
-
- public void setTranscode(Integer transcode) {
- this.transcode = transcode;
- }
-
- public String getTransname() {
- return transname;
- }
-
- public void setTransname(String transname) {
- this.transname = transname;
- }
-}
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/service/DayendSettleService.java b/src/main/java/com/supwisdom/dlpay/framework/service/DayendSettleService.java
deleted file mode 100644
index d3318f0..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/service/DayendSettleService.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.supwisdom.dlpay.framework.service;
-
-import com.supwisdom.dlpay.framework.domain.TSettleLog;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * 日终结算
- * */
-public interface DayendSettleService {
- TSettleLog doCreateSettleLog();
- TSettleLog doUpdateSettleLog(TSettleLog log);
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
- boolean doDayendSettle() throws Exception; //日结
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
- boolean doVoucherSettle(String voucherid) throws Exception; //指定凭证入账
-}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/service/DayendStatisticsService.java b/src/main/java/com/supwisdom/dlpay/framework/service/DayendStatisticsService.java
deleted file mode 100644
index 110f0e2..0000000
--- a/src/main/java/com/supwisdom/dlpay/framework/service/DayendStatisticsService.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.supwisdom.dlpay.framework.service;
-
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * 日终统计
- * */
-public interface DayendStatisticsService {
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
- boolean doDayendStatistics() throws Exception; //日结后统计
-}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/WaterManagerApplication.kt b/src/main/kotlin/com/supwisdom/dlpay/DoorApplication.kt
similarity index 96%
rename from src/main/kotlin/com/supwisdom/dlpay/WaterManagerApplication.kt
rename to src/main/kotlin/com/supwisdom/dlpay/DoorApplication.kt
index 73c71d8..0a65a26 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/WaterManagerApplication.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/DoorApplication.kt
@@ -67,8 +67,8 @@
@SpringBootApplication
@EnableScheduling
-class WaterManagerApplication
+class DoorApplication
fun main(args: Array<String>) {
- runApplication<WaterManagerApplication>(*args)
+ runApplication<DoorApplication>(*args)
}
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
deleted file mode 100644
index d7f333b..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/controller/shop_api_controller.kt
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.supwisdom.dlpay.api.controller
-
-import com.supwisdom.dlpay.api.bean.OpenShopParam
-import com.supwisdom.dlpay.api.bean.QueryShopParam
-import com.supwisdom.dlpay.framework.ResponseBodyBuilder
-import com.supwisdom.dlpay.api.service.ShopService
-import com.supwisdom.dlpay.exception.RequestParamCheckException
-import com.supwisdom.dlpay.exception.TransactionException
-import com.supwisdom.dlpay.framework.service.CommonService
-import com.supwisdom.dlpay.framework.util.TradeErrorCode
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.http.ResponseEntity
-import org.springframework.web.bind.annotation.*
-import java.net.URLDecoder
-import javax.servlet.http.HttpServletRequest
-import javax.servlet.http.HttpServletResponse
-
-@RestController
-@RequestMapping("/api/shop")
-class ShopAPIController {
- @Autowired
- private lateinit var shopService: ShopService
- @Autowired
- private lateinit var commonService: CommonService
-
- @PostMapping("/open")
- fun openAccount(@RequestBody param: OpenShopParam, 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, "参数签名错误"))
- }
- shopService.findByThirdUniqueId(param.shopUniqueId)?.let {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.BUSINESS_SHOP_EXISTS, "该商户唯一号[${param.shopUniqueId}]已经存在"))
- }
-
- param.shopname = param.shopname.let { URLDecoder.decode(param.shopname, Charsets.UTF_8.toString()) } //解码
- param.contactman = param.contactman?.let { URLDecoder.decode(param.contactman, Charsets.UTF_8.toString()) } //解码
- param.address = param.address?.let { URLDecoder.decode(param.address, Charsets.UTF_8.toString()) } //解码
- shopService.registerShop(param).let {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .data("shopid", it.shopid)
- .data("shopaccno", it.shopaccno ?: "")
- .success("注册成功"))
- }
-
- 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("/query")
- fun queryShop(@RequestBody param: QueryShopParam, 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, "参数签名错误"))
- }
-
- shopService.findByShopBySearch(param.shopid, param.shopaccno, param.shopUniqueId)?.let {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .data("shop", it)
- .success())
- }
-
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .fail(TradeErrorCode.SHOP_NOT_EXISTS, "商户不存在"))
- } catch (ex: RequestParamCheckException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .requestException(ex, "请求参数错误"))
- } catch (et: TransactionException) {
- return ResponseEntity.ok(ResponseBodyBuilder.create()
- .transException(et, "业务处理错误"))
- }
- }
-}
\ No newline at end of file
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/shop_service_impl.kt b/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/shop_service_impl.kt
deleted file mode 100644
index 07c6c40..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/shop_service_impl.kt
+++ /dev/null
@@ -1,94 +0,0 @@
-package com.supwisdom.dlpay.api.service.impl
-
-import com.supwisdom.dlpay.api.bean.OpenShopParam
-import com.supwisdom.dlpay.framework.dao.ShopDao
-import com.supwisdom.dlpay.framework.dao.ShopaccDao
-import com.supwisdom.dlpay.framework.domain.TShop
-import com.supwisdom.dlpay.framework.domain.TShopacc
-import com.supwisdom.dlpay.framework.service.SystemUtilService
-import com.supwisdom.dlpay.framework.util.Subject
-import com.supwisdom.dlpay.api.service.ShopService
-import com.supwisdom.dlpay.exception.TransactionProcessException
-import com.supwisdom.dlpay.framework.util.StringUtil
-import com.supwisdom.dlpay.framework.util.TradeDict
-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
-
-/**
- * Created by shuwei on 2019/4/15.
- */
-@Service
-class ShopServiceImpl : ShopService {
- @Autowired
- private lateinit var shopDao: ShopDao
- @Autowired
- private lateinit var shopaccDao: ShopaccDao
- @Autowired
- private lateinit var systemUtilService: SystemUtilService
-
- override fun findByThirdUniqueId(uniqueId: String): TShop? {
- return shopDao.getByThirdUniqueIdenty(uniqueId)
- }
-
- override fun registerShop(param: OpenShopParam): TShop {
- val systemdatetime = systemUtilService.sysdatetime
- var shop = shopDao.getByThirdUniqueIdentyForUpdate(param.shopUniqueId)
- if (null != shop) {
- throw TransactionProcessException(TradeErrorCode.BUSINESS_SHOP_EXISTS, "该商户唯一号[${param.shopUniqueId}]已经存在")
- }
- if (null != param.fshopid) {
- shopDao.getTShopByShopid(param.fshopid).let {
- if (null == it) {
- throw TransactionProcessException(TradeErrorCode.SHOP_NOT_EXISTS, "上级商户不存在已经存在")
- }
- }
- }
- shop = shopDao.save(TShop().apply {
- fshopid = param.fshopid
- shopname = param.shopname
- shoptype = param.shoptype
- status = TradeDict.STATUS_NORMAL
- contactman = param.contactman
- idtype = param.idtype
- idno = param.idno
- mobile = param.mobile
- email = param.email
- addr = param.address
- zipcode = param.zipcode
- opendate = systemdatetime.hostdate
- thirdUniqueIdenty = param.shopUniqueId
- })
- if (ConstantUtil.SHOPTYPE_GROUP != shop.shoptype) {
- //非商户组要创建账号
- val shopaccno = String.format("2%09d", shop.shopid)
- shopaccDao.save(TShopacc().apply {
- this.shopaccno = shopaccno
- this.shopid = shop.shopid
- this.shopname = shop.shopname
- this.subjno = Subject.SUBJNO_MACHANT_INCOME
- this.status = TradeDict.STATUS_NORMAL
- this.opendate = shop.opendate
- })
- shop.shopaccno = shopaccno
- shopDao.save(shop) //更新账号
- }
- return shop
- }
-
- override fun findByShopId(shopid: Int): TShop {
- return shopDao.getTShopByShopid(shopid)
- ?: throw TransactionProcessException(TradeErrorCode.SHOP_NOT_EXISTS, "商户[ID=$shopid]不存在")
- }
-
- override fun findByShopBySearch(shopid: Int?, shopaccno: String?, shopUniqueId: String?): TShop? {
- return if (null != shopid) {
- shopDao.getTShopByShopid(shopid)
- } else if (!StringUtil.isEmpty(shopaccno)) {
- shopDao.getTShopByShopaccno(shopaccno)
- } else {
- shopDao.getByThirdUniqueIdenty(shopUniqueId)
- }
- }
-}
\ No newline at end of file
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/pay_service.kt b/src/main/kotlin/com/supwisdom/dlpay/api/service/pay_service.kt
deleted file mode 100644
index f10c1a3..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/service/pay_service.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.supwisdom.dlpay.api.service
-
-import com.supwisdom.dlpay.api.domain.TAccount
-import com.supwisdom.dlpay.framework.domain.TFeetypeConfig
-import com.supwisdom.dlpay.framework.domain.TShopacc
-import com.supwisdom.dlpay.framework.domain.TSubject
-import org.springframework.transaction.annotation.Propagation
-import org.springframework.transaction.annotation.Transactional
-
-interface AccountUtilServcie {
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = arrayOf(Exception::class))
- fun readAccountForUpdateNowait(userid: String): TAccount
-
-
- fun readAccount(userid: String): TAccount
-
- fun readShopAcc(shopId: Int): TShopacc
-
- fun readShopbyShopaccno(shopaccno: String): TShopacc
-
- fun readSubject(subjno: String): TSubject
-
- fun readFeetype(feetype: String, paytype: String): TFeetypeConfig
-}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/api/service/shop_service.kt b/src/main/kotlin/com/supwisdom/dlpay/api/service/shop_service.kt
deleted file mode 100644
index 697bc11..0000000
--- a/src/main/kotlin/com/supwisdom/dlpay/api/service/shop_service.kt
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.supwisdom.dlpay.api.service
-
-import com.supwisdom.dlpay.api.bean.OpenShopParam
-import com.supwisdom.dlpay.framework.domain.TShop
-import org.springframework.transaction.annotation.Propagation
-import org.springframework.transaction.annotation.Transactional
-
-/**
- * Created by shuwei on 2019/4/15.
- */
-interface ShopService {
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = arrayOf(Exception::class))
- fun registerShop(param: OpenShopParam): TShop
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = arrayOf(Exception::class), readOnly = true)
- fun findByThirdUniqueId(uniqueId: String): TShop?
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = arrayOf(Exception::class), readOnly = true)
- fun findByShopId(shopid: Int): TShop
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = arrayOf(Exception::class), readOnly = true)
- fun findByShopBySearch(shopid: Int?, shopaccno: String?, shopUniqueId: String?): TShop?
-}
\ No newline at end of file
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/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/framework/controller/framework_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/framework/controller/framework_controller.kt
index b385f9b..139f37b 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/framework/controller/framework_controller.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/framework/controller/framework_controller.kt
@@ -19,7 +19,7 @@
.data("version", it)
.success())
}
- } catch (e: IllegalArgumentException) {
+ } catch (e: Throwable) {
ResponseEntity.ok(ResponseBodyBuilder.create()
.data("version", "unknown")
.success())