对账单增加记录号
authorXia Kaixiang <kaixiang.xia@supwisdom.com>
Tue, 6 Aug 2019 03:38:23 +0000 (11:38 +0800)
committerXia Kaixiang <kaixiang.xia@supwisdom.com>
Tue, 6 Aug 2019 03:38:23 +0000 (11:38 +0800)
payapi-common/src/main/java/com/supwisdom/dlpay/api/agent/Constant.java
payapi/src/main/java/com/supwisdom/dlpay/api/bean/YnrccChkfileBean.java
payapi/src/main/java/com/supwisdom/dlpay/api/dao/TransactionChkdtlDao.java
payapi/src/main/java/com/supwisdom/dlpay/api/domain/TTransactionChkdtl.java
payapi/src/main/java/com/supwisdom/dlpay/api/domain/TTransactionChkfile.java
payapi/src/main/kotlin/com/supwisdom/dlpay/api/scheduler_ynrccchk_task.kt
payapi/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/transaction_reconciliation_service_impl.kt
payapi/src/main/kotlin/com/supwisdom/dlpay/api/service/transaction_reconciliation_service.kt
ynrcc-agent/src/main/java/com/supwisdom/agent/api/controller/YnrccApiController.java

index c135d58..7f572da 100644 (file)
@@ -19,4 +19,5 @@ public class Constant {
   public static final String COL_AGENT_DATE = "agentdate";
   public static final String COL_STATUS = "status";
   public static final String COL_FLAG = "flag";
+  public static final String COL_RECORDNO = "recordno"; //记录号
 }
index bdfc228..125c4bb 100644 (file)
@@ -3,13 +3,14 @@ package com.supwisdom.dlpay.api.bean;
 public class YnrccChkfileBean {
   private String refno; //本地流水号
   private String agentrefno; //银行流水号
-  private String agentdate; //yin
+  private String agentdate; //银行记账日期
   private Integer amount;
   private String payerid;
   private String payeeid;
   private String summary;
   private String status;
   private String flag;
+  private Integer recordno; //记录号
 
   public String getRefno() {
     return refno;
@@ -82,4 +83,12 @@ public class YnrccChkfileBean {
   public void setFlag(String flag) {
     this.flag = flag;
   }
+
+  public Integer getRecordno() {
+    return recordno;
+  }
+
+  public void setRecordno(Integer recordno) {
+    this.recordno = recordno;
+  }
 }
index 88a6f56..1896786 100644 (file)
@@ -11,8 +11,8 @@ import org.springframework.stereotype.Repository;
 public interface TransactionChkdtlDao extends JpaRepository<TTransactionChkdtl, String> {
 
   @Modifying
-  @Query("delete from TTransactionChkdtl t where t.accdate=?1 and t.sourcetype=?2 ")
-  void deleteByAccdateAndSorucetype(String accdate, String sourcetype);
+  @Query("delete from TTransactionChkdtl t where t.chkfileId=?1 ")
+  void deleteByChkfileid(String chkfileId);
 
   @Query("select count(t.id) as totalcnt,sum(t.amount) as totalamt from TTransactionChkdtl t where t.accdate=?1 and t.sourcetype=?2 ")
   CountAmountBean getTransactionSumInfo(String accdate, String sourcetype);
index bc8d7ea..422d766 100644 (file)
@@ -7,7 +7,7 @@ import java.sql.Timestamp;
 
 @Entity
 @Table(name = "TB_TRANSACTION_CHKDTL",
-    indexes = {@Index(name = "UK_TRANSACTION_CHKDTL", unique = true, columnList = "ACCDATE,SOURCETYPE,THIRD_REFNO,LOCAL_REFNO")})
+    indexes = {@Index(name = "UK_TRANSACTION_CHKDTL", unique = true, columnList = "ACCDATE,SOURCETYPE,OTHER_REFNO,LOCAL_REFNO")})
 public class TTransactionChkdtl {
   @Id
   @GenericGenerator(name = "idGenerator", strategy = "uuid")
@@ -15,29 +15,35 @@ public class TTransactionChkdtl {
   @Column(name = "ID", nullable = false, length = 32)
   private String id;
 
+  @Column(name = "CHKFILE_ID", nullable = false, length = 32)
+  private String chkfileId;
+
   @Column(name = "ACCDATE", nullable = false, length = 8)
   private String accdate;
 
   @Column(name = "SOURCETYPE", nullable = false, length = 20)
   private String sourcetype;
 
+  @Column(name = "RECORDNO", precision = 9)
+  private Integer recordno;
+
   @Column(name = "AMOUNT", nullable = false, precision = 9, scale = 2)
   private Double amount;
 
-  @Column(name = "THIRD_REFNO", nullable = false, length = 32)
-  private String thirdRefno; //第三方流水号
+  @Column(name = "OTHER_REFNO", nullable = false, length = 32)
+  private String otherRefno; //第三方流水号
 
   @Column(name = "LOCAL_REFNO", nullable = false, length = 32)
   private String localRefno; //本地流水号
 
-  @Column(name = "THIRD_ACCDATE", nullable = false, length = 8)
-  private String thirdAccdate; //第三方记账日期
+  @Column(name = "OTHER_ACCDATE", nullable = false, length = 8)
+  private String otherAccdate; //第三方记账日期
 
   @Column(name = "TRANSTYPE", length = 20)
   private String transtype; // pay-支付|refund-退款|cancel-撤销
 
-  @Column(name = "THIRD_STATUS", length = 20)
-  private String thirdStatus; //第三方流水状态
+  @Column(name = "OTHER_STATUS", length = 20)
+  private String otherStatus; //第三方流水状态
 
   @Column(name = "REMARK", length = 200)
   private String remark;
@@ -65,6 +71,14 @@ public class TTransactionChkdtl {
     this.id = id;
   }
 
+  public String getChkfileId() {
+    return chkfileId;
+  }
+
+  public void setChkfileId(String chkfileId) {
+    this.chkfileId = chkfileId;
+  }
+
   public String getAccdate() {
     return accdate;
   }
@@ -81,6 +95,14 @@ public class TTransactionChkdtl {
     this.sourcetype = sourcetype;
   }
 
+  public Integer getRecordno() {
+    return recordno;
+  }
+
+  public void setRecordno(Integer recordno) {
+    this.recordno = recordno;
+  }
+
   public Double getAmount() {
     return amount;
   }
@@ -89,12 +111,12 @@ public class TTransactionChkdtl {
     this.amount = amount;
   }
 
-  public String getThirdRefno() {
-    return thirdRefno;
+  public String getOtherRefno() {
+    return otherRefno;
   }
 
-  public void setThirdRefno(String thirdRefno) {
-    this.thirdRefno = thirdRefno;
+  public void setOtherRefno(String otherRefno) {
+    this.otherRefno = otherRefno;
   }
 
   public String getLocalRefno() {
@@ -105,12 +127,12 @@ public class TTransactionChkdtl {
     this.localRefno = localRefno;
   }
 
-  public String getThirdAccdate() {
-    return thirdAccdate;
+  public String getOtherAccdate() {
+    return otherAccdate;
   }
 
-  public void setThirdAccdate(String thirdAccdate) {
-    this.thirdAccdate = thirdAccdate;
+  public void setOtherAccdate(String otherAccdate) {
+    this.otherAccdate = otherAccdate;
   }
 
   public String getTranstype() {
@@ -121,12 +143,12 @@ public class TTransactionChkdtl {
     this.transtype = transtype;
   }
 
-  public String getThirdStatus() {
-    return thirdStatus;
+  public String getOtherStatus() {
+    return otherStatus;
   }
 
-  public void setThirdStatus(String thirdStatus) {
-    this.thirdStatus = thirdStatus;
+  public void setOtherStatus(String otherStatus) {
+    this.otherStatus = otherStatus;
   }
 
   public String getRemark() {
index 6517f21..f6f3df6 100644 (file)
@@ -30,11 +30,11 @@ public class TTransactionChkfile {
   @Column(name = "REMARK", length = 600)
   private String remark;
 
-  @Column(name = "THIRDCNT", nullable = false, precision = 9)
-  private Integer thirdcnt;
+  @Column(name = "OTHERCNT", nullable = false, precision = 9)
+  private Integer othercnt;
 
-  @Column(name = "THIRDAMT", nullable = false, precision = 15, scale = 2)
-  private Double thirdamt;
+  @Column(name = "OTHERAMT", nullable = false, precision = 15, scale = 2)
+  private Double otheramt;
 
   @Column(name = "LOCALCNT", nullable = false, precision = 9)
   private Integer localcnt;
@@ -97,20 +97,20 @@ public class TTransactionChkfile {
     this.remark = remark;
   }
 
-  public Integer getThirdcnt() {
-    return thirdcnt;
+  public Integer getOthercnt() {
+    return othercnt;
   }
 
-  public void setThirdcnt(Integer thirdcnt) {
-    this.thirdcnt = thirdcnt;
+  public void setOthercnt(Integer othercnt) {
+    this.othercnt = othercnt;
   }
 
-  public Double getThirdamt() {
-    return thirdamt;
+  public Double getOtheramt() {
+    return otheramt;
   }
 
-  public void setThirdamt(Double thirdamt) {
-    this.thirdamt = thirdamt;
+  public void setOtheramt(Double otheramt) {
+    this.otheramt = otheramt;
   }
 
   public Integer getLocalcnt() {
index e2fbcda..067f1ef 100644 (file)
@@ -70,7 +70,7 @@ class DownloadYnrccChkfileTask {
                     val agentConfig = sourceTypeService.getChargePaytypeConfig(TradeDict.PAYTYPE_CITIZEN_CARD, true)
                     val agentUrl = agentConfig[YnrccUtil.YNRCC_ANGENT_URL] + "/download?filename=" + resp.filename
                     //根据filename 取文件数据
-                    downloadYnrccBills(billDate, agentUrl, chkfile)
+                    downloadYnrccBills(chkfile, agentUrl)
 
                 } else if (YnrccUtil.NO_RECORDS_TODAY == resp.code) {
                     //当日无交易明细,也创建空记录
@@ -91,7 +91,7 @@ class DownloadYnrccChkfileTask {
         }
     }
 
-    private fun downloadYnrccBills(accdate: String, agentUrl: String, chkfile: TTransactionChkfile) {
+    private fun downloadYnrccBills(chkfile: TTransactionChkfile, agentUrl: String) {
         val client = Client.create()
         client.setConnectTimeout(30000)
         val respClient = client.resource(agentUrl).type(MediaType.APPLICATION_OCTET_STREAM_TYPE).get(ClientResponse::class.java)
@@ -101,7 +101,6 @@ class DownloadYnrccChkfileTask {
                 val header = reader.readLine()
                 val fields = header.split(",").mapNotNull { if (it.isNotEmpty()) it else null }
                 val batchSize = 10000 //每次保存的数目
-                var totalcnt = 0
                 var failcnt = 0
 
                 val datalist = ArrayList<YnrccChkfileBean>()
@@ -112,26 +111,22 @@ class DownloadYnrccChkfileTask {
                     val bean = YnrccChkfileBean()
                     StringUtil.transforToBean(fields, columns, bean)
                     datalist.add(bean)
-                    totalcnt++
                     if (datalist.size >= batchSize) {
-                        val fcnt = doBatchSaveYnrccCheckDetails(accdate, datalist) //保存
+                        val fcnt = doBatchSaveYnrccCheckDetails(chkfile, datalist) //保存
                         failcnt += fcnt
                         datalist.clear()
-                        if (failcnt > 0) break
                     }
-
                 }
                 //保存最后的不足batchSize的记录
                 if (datalist.size > 0) {
-                    val fcnt = doBatchSaveYnrccCheckDetails(accdate, datalist) //保存
+                    val fcnt = doBatchSaveYnrccCheckDetails(chkfile, datalist) //保存
                     failcnt += fcnt
                 }
 
                 if (failcnt > 0) {
                     //该天对账单保存错误
-                    transactionReconciliationService.deleteTransactionChkDtlByAccdateAndSourcetype(accdate, TradeDict.PAYTYPE_CITIZEN_CARD) //删除已存明细
Content-type: text/html Supwisdom Source - epayment/food_payapi.git/commitdiff


500 - Internal Server Error

Unknown encoding 'gb18030' at /usr/local/share/gitweb/gitweb.cgi line 1539