浏览代码

查询托管银行附带签到信息

zou.yingbin 4 年之前
父节点
当前提交
2cdef1324b
共有 4 个文件被更改,包括 129 次插入2 次删除
  1. 36 0
      docs/docs.go
  2. 36 0
      docs/swagger.json
  3. 27 0
      docs/swagger.yaml
  4. 30 2
      models/qhj.go

+ 36 - 0
docs/docs.go

@@ -22198,9 +22198,45 @@ var doc = `{
                     "description": "是否需要清算 - 0:不需要 1:需要",
                     "type": "integer"
                 },
+                "lastcheckstatus": {
+                    "description": "最后对账状态 -  对账状态 - 1:未对账 2:对账成功 3:对账失败",
+                    "type": "integer"
+                },
+                "lastchecktime": {
+                    "description": "最后对账时间",
+                    "type": "string"
+                },
+                "lastclearstatus": {
+                    "description": "最后清算状态 - 1:未清算 2:清算成功 3:清算失败 4:清算部分成功",
+                    "type": "integer"
+                },
+                "lastcleartime": {
+                    "description": "最后清算时间",
+                    "type": "string"
+                },
+                "lastsignintime": {
+                    "description": "最后签到时间",
+                    "type": "string"
+                },
+                "lastsignouttime": {
+                    "description": "最后签退时间",
+                    "type": "string"
+                },
                 "riskinfo": {
                     "description": "签约风险提示书",
                     "type": "string"
+                },
+                "signstatus": {
+                    "description": "当前签到/签退状态 - 1:签到 2:签退",
+                    "type": "integer"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "当前签到/签退更新时间",
+                    "type": "string"
                 }
             }
         },

+ 36 - 0
docs/swagger.json

@@ -22182,9 +22182,45 @@
                     "description": "是否需要清算 - 0:不需要 1:需要",
                     "type": "integer"
                 },
+                "lastcheckstatus": {
+                    "description": "最后对账状态 -  对账状态 - 1:未对账 2:对账成功 3:对账失败",
+                    "type": "integer"
+                },
+                "lastchecktime": {
+                    "description": "最后对账时间",
+                    "type": "string"
+                },
+                "lastclearstatus": {
+                    "description": "最后清算状态 - 1:未清算 2:清算成功 3:清算失败 4:清算部分成功",
+                    "type": "integer"
+                },
+                "lastcleartime": {
+                    "description": "最后清算时间",
+                    "type": "string"
+                },
+                "lastsignintime": {
+                    "description": "最后签到时间",
+                    "type": "string"
+                },
+                "lastsignouttime": {
+                    "description": "最后签退时间",
+                    "type": "string"
+                },
                 "riskinfo": {
                     "description": "签约风险提示书",
                     "type": "string"
+                },
+                "signstatus": {
+                    "description": "当前签到/签退状态 - 1:签到 2:签退",
+                    "type": "integer"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "当前签到/签退更新时间",
+                    "type": "string"
                 }
             }
         },

+ 27 - 0
docs/swagger.yaml

@@ -9677,9 +9677,36 @@ definitions:
       isneedclear:
         description: 是否需要清算 - 0:不需要 1:需要
         type: integer
+      lastcheckstatus:
+        description: 最后对账状态 -  对账状态 - 1:未对账 2:对账成功 3:对账失败
+        type: integer
+      lastchecktime:
+        description: 最后对账时间
+        type: string
+      lastclearstatus:
+        description: 最后清算状态 - 1:未清算 2:清算成功 3:清算失败 4:清算部分成功
+        type: integer
+      lastcleartime:
+        description: 最后清算时间
+        type: string
+      lastsignintime:
+        description: 最后签到时间
+        type: string
+      lastsignouttime:
+        description: 最后签退时间
+        type: string
       riskinfo:
         description: 签约风险提示书
         type: string
+      signstatus:
+        description: 当前签到/签退状态 - 1:签到 2:签退
+        type: integer
+      tradedate:
+        description: 交易日(yyyyMMdd)
+        type: string
+      updatetime:
+        description: 当前签到/签退更新时间
+        type: string
     type: object
   models.QhjCustomer:
     properties:

+ 30 - 2
models/qhj.go

@@ -1077,6 +1077,16 @@ type QhjCusBankInfo struct {
 	CANMODIFYBANKCARD  int32  `json:"canmodifybankcard"  xorm:"CANMODIFYBANKCARD"`   // 是否可修改银行卡号 - 0:不可 1:可以
 	CANALLOT           int32  `json:"canallot"  xorm:"CANALLOT"`                     // 是否支持跨行调拨 - 0:不支持 1:支持
 	CANALLOTQUERY      int32  `json:"canallotquery"  xorm:"CANALLOTQUERY"`           // 是否支持跨行调拨查询 - 0:不支持 1:支持
+
+	TRADEDATE       string `json:"tradedate"  xorm:"TRADEDATE"`             // 交易日(yyyyMMdd)
+	SIGNSTATUS      int32  `json:"signstatus"  xorm:"SIGNSTATUS"`           // 当前签到/签退状态 - 1:签到 2:签退
+	UPDATETIME      string `json:"updatetime"  xorm:"UPDATETIME"`           // 当前签到/签退更新时间
+	LASTSIGNINTIME  string `json:"lastsignintime"  xorm:"LASTSIGNINTIME"`   // 最后签到时间
+	LASTSIGNOUTTIME string `json:"lastsignouttime"  xorm:"LASTSIGNOUTTIME"` // 最后签退时间
+	LASTCHECKTIME   string `json:"lastchecktime"  xorm:"LASTCHECKTIME"`     // 最后对账时间
+	LASTCHECKSTATUS int32  `json:"lastcheckstatus"  xorm:"LASTCHECKSTATUS"` // 最后对账状态 -  对账状态 - 1:未对账 2:对账成功 3:对账失败
+	LASTCLEARTIME   string `json:"lastcleartime"  xorm:"LASTCLEARTIME"`     // 最后清算时间
+	LASTCLEARSTATUS int32  `json:"lastclearstatus"  xorm:"LASTCLEARSTATUS"` // 最后清算状态 - 1:未清算 2:清算成功 3:清算失败 4:清算部分成功
 }
 
 func (r *QhjCusBankInfo) calc() {
@@ -1084,7 +1094,22 @@ func (r *QhjCusBankInfo) calc() {
 }
 
 func (r *QhjCusBankInfo) buildSql() string {
-	var sqlId utils.SQLVal = "SELECT t.CUSBANKID," +
+	var sqlId utils.SQLVal = "with tmp as" +
+		" (select *" +
+		"    from (select row_number() over(partition by t.cusbankid order by t.tradedate desc) cn," +
+		"                 t.CUSBANKID id2," +
+		"                 t.TRADEDATE," +
+		"                 t.SIGNSTATUS," +
+		"                 to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
+		"                 to_char(t.LASTSIGNINTIME, 'yyyy-mm-dd hh24:mi:ss') LASTSIGNINTIME," +
+		"                 to_char(t.LASTSIGNOUTTIME, 'yyyy-mm-dd hh24:mi:ss') LASTSIGNOUTTIME," +
+		"                 to_char(t.LASTCHECKTIME, 'yyyy-mm-dd hh24:mi:ss') LASTCHECKTIME," +
+		"                 t.LASTCHECKSTATUS," +
+		"                 to_char(t.LASTCLEARTIME, 'yyyy-mm-dd hh24:mi:ss') LASTCLEARTIME," +
+		"                 t.LASTCLEARSTATUS" +
+		"            from bank_cusbankstatus t)" +
+		"   where cn = 1)" +
+		"SELECT t.CUSBANKID," +
 		"       t.CUSBANKNAME," +
 		"       t.CUSBANKSHORTNAME," +
 		"       t.EXCHBANKID," +
@@ -1107,8 +1132,11 @@ func (r *QhjCusBankInfo) buildSql() string {
 		"       t.ISNEEDCHECK," +
 		"       t.CANMODIFYBANKCARD," +
 		"       t.CANALLOT," +
-		"       t.CANALLOTQUERY" +
+		"       t.CANALLOTQUERY," +
+		"       tmp.*" +
 		"  FROM BANK_CUSBANKINFO t" +
+		"  LEFT JOIN tmp" +
+		"    on t.cusbankid = tmp.id2" +
 		" WHERE 1 = 1"
 	return sqlId.String()
 }