Ver código fonte

增加接口 /Bank/QueryHybridReceiverOnboards 查询混合支付出金接收者信息

zhouxnsz 9 meses atrás
pai
commit
b736d7d5ff

+ 28 - 28
config/cfg.json

@@ -1,31 +1,31 @@
 {
-    "dev_104": {
-        "quoteUrl": "ws://192.168.31.104:18891",
-        "tradeUrl": "ws://192.168.31.104:18892",
-        "quoteWS": "ws://192.168.31.204:8888/api/Quote/WS",
-        "tradeWS": "ws://192.168.31.204:8888/api/Trade/WS",
-        "uploadUrl": "http://192.168.31.104:5015/mtp2-onlineopen/upload",
-        "commSearchUrl": "http://192.168.31.104:5019/mtp2-search",
-        "goCommonSearchUrl": "http://192.168.31.104:8080/api",
-        "openApiUrl": "http://192.168.31.104:5015/mtp2-onlineopen",
-        "mobileOpenUrl": "http://192.168.31.104:5055",
-        "mobileAuthUrl": "http://192.168.31.104:5056",
-        "quoteHost": "192.168.31.104",
-        "quotePort": "5002",
-        "tradeHost": "192.168.31.104",
-        "tradePort": "5001",
-        "newsUrl": "http://www.baidu.com",
-        "pcNewsUrl": "https://www.hndnews.com/17/1.html",
-        "iOS": "https://apps.apple.com/cn/app/%E6%97%85%E6%B8%B8%E4%BF%9D/id1554804296",
-        "android": "http://sapp.lvyoubao.net:8013/app/旅游保.apk",
-        "otherPayUrl": "http://103.40.249.123:9400/bank_alipay",
-        "oem": "qhj",
-        "pcMangerUrl": "http://192.168.31.176:5019/mtp2-pcweb",
-        "alipay": "http://218.17.158.45:25021/bank_alipay",
-        "wxpay": "http://218.17.158.45:25020/bank_wxpay",
-        "goAccess": "http://192.168.31.201:8888/api",
-        "androidUpdateUrl": "",
-        "shareUrl": "",
-        "pcUpdateUrl": ""
+    "test_136": {
+       "quoteUrl": "ws://192.168.31.136:18891",
+       "tradeUrl": "ws://192.168.31.136:18892",
+       "quoteWS": "ws://192.168.31.136:8888/api/Quote/WS",
+       "tradeWS": "ws://192.168.31.136:8888/api/Trade/WS",
+       "uploadUrl": "http://192.168.31.136:5015/mtp2-onlineopen/upload",
+       "commSearchUrl": "http://192.168.31.136:5019/mtp2-onlineopen/onlineopen",
+       "openApiUrl": "http://192.168.31.136:5015/mtp2-onlineopen",
+       "goCommonSearchUrl": "http://192.168.31.136:8080/api",
+       "goAccess": "http://192.168.31.136:8888/api",
+       "mobileOpenUrl":"http://192.168.31.136:5035/mobilekh",
+       "mobileAuthUrl":"http://192.168.31.136:5056",
+       "quoteHost":"192.168.31.136",
+       "quotePort":"5002",
+       "tradeHost":"192.168.31.136",
+       "tradePort":"5001",
+       "newsUrl":"https://h5.hndnews.com/web/",
+       "pcNewsUrl":"https://www.hndnews.com/17/1.html",
+       "iOS":"https://apps.apple.com/cn/app/%E6%97%85%E6%B8%B8%E4%BF%9D/id1554804296",
+       "android":"http://sapp.lvyoubao.net:8013/app/lyb.apk",
+       "otherPayUrl":"192.168.31.136:5029/manual_bank",
+       "oem":"jyzx",
+       "pcMangerUrl":"http://192.168.31.136:5035/mtp2-pcweb",
+       "alipay": "http://192.168.31.136:9400/bank_alipay",
+       "wxpay": "http://192.168.31.136:9401/bank_wxpay",
+       "androidUpdateUrl": "",
+       "pcUpdateUrl": "http://192.168.31.136:5035/update",
+       "shareUrl": ""
     }
 }

+ 20 - 1
controllers/bank/bank.go

@@ -6,6 +6,7 @@ import (
 	"mtp2_if/logger"
 	"mtp2_if/models"
 	"net/http"
+	"strconv"
 
 	"github.com/gin-gonic/gin"
 )
@@ -17,7 +18,7 @@ import (
 // @Param    cusbankid     query    string true  "托管银行编号"
 // @Param    extendbiztype query    int    false "扩展业务类型 - 1:签约 2:入金 3:出金 4:签约信息修改"
 // @Success  200           {array}  models.Bankcusbankextendconfig
-// @Failure  500           {object} app.Response
+// @Failure  500 {object} app.Response
 // @Router   /Bank/QueryBankCusBankExtendConfigs [get]
 // @Tags     银行
 func QueryBankCusBankExtendConfigs(c *gin.Context) {
@@ -136,3 +137,21 @@ func GetHybridConfigs(c *gin.Context) {
 	// 查询成功返回
 	appG.Response(http.StatusOK, e.SUCCESS, rec)
 }
+
+// QueryHybridReceiverOnboards
+// @Summary  查询混合支付出金接收者信息
+// @Produce  json
+// @Security ApiKeyAuth
+// @Success  200 {array}  models.Hybridreceiveronboard
+// @Failure  500           {object} app.Response
+// @Router   /Bank/QueryHybridReceiverOnboards [get]
+// @Tags     银行
+func QueryHybridReceiverOnboards(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+
+	requserid, _ := a.C.Get("requserid")
+	i, _ := strconv.Atoi(requserid.(string))
+	m := models.Hybridreceiveronboard{USERID: int64(i)}
+	a.DoBindReq(&m)
+	a.DoGetDataEx(&m)
+}

+ 4 - 4
controllers/guangzuan/tradeService.go

@@ -18,8 +18,8 @@ import (
 // @Security Group
 // @Param    userid   query    int    true  "用户ID"
 // @Param    executestatus query    int false "执行状态 - 1:未生效 2:进行中 3:已结束"
-// @Param    page          query    int false "页码"
-// @Param    pagesize      query    int false "每页条数"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
 // @Success  200           {array}  models.GzcjjcorderM
 // @Failure  500     {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrder [get]
@@ -39,8 +39,8 @@ func QueryGZCJJCOrder(c *gin.Context) {
 // @Security Group
 // @Param    userid        query    int true  "用户ID"
 // @Param    orderid  query    string false "单据ID"
-// @Param    page     query    int    false "页码"
-// @Param    pagesize query    int    false "每页条数"
+// @Param    page          query    int false "页码"
+// @Param    pagesize      query    int false "每页条数"
 // @Success  200      {array}  models.GzcjjcorderdetailM
 // @Failure  500           {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrderDetail [get]

+ 74 - 0
docs/docs.go

@@ -927,6 +927,39 @@ const docTemplate = `{
                 }
             }
         },
+        "/Bank/QueryHybridReceiverOnboards": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "银行"
+                ],
+                "summary": "查询混合支付出金接收者信息",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Hybridreceiveronboard"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/CPTrade/QueryCPTradeMyBidInfos": {
             "get": {
                 "security": [
@@ -43170,6 +43203,47 @@ const docTemplate = `{
                 }
             }
         },
+        "models.Hybridreceiveronboard": {
+            "type": "object",
+            "properties": {
+                "accountid": {
+                    "description": "资金账户ID",
+                    "type": "integer"
+                },
+                "bank_account": {
+                    "description": "银行卡号",
+                    "type": "string"
+                },
+                "bank_code": {
+                    "description": "银行代码",
+                    "type": "string"
+                },
+                "bank_name": {
+                    "description": "银行名称",
+                    "type": "string"
+                },
+                "cert_no": {
+                    "description": "证件号码",
+                    "type": "string"
+                },
+                "channel_code": {
+                    "description": "渠道代码",
+                    "type": "string"
+                },
+                "name": {
+                    "description": "名称 / 企业名称",
+                    "type": "string"
+                },
+                "phone_number": {
+                    "description": "电话号码",
+                    "type": "string"
+                },
+                "receiver_type": {
+                    "description": "接收者类型 // 个人-Individual 企业-Organization",
+                    "type": "string"
+                }
+            }
+        },
         "models.HybsMyBuyOrderDetail": {
             "type": "object",
             "required": [

+ 74 - 0
docs/swagger.json

@@ -918,6 +918,39 @@
                 }
             }
         },
+        "/Bank/QueryHybridReceiverOnboards": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "银行"
+                ],
+                "summary": "查询混合支付出金接收者信息",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Hybridreceiveronboard"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/CPTrade/QueryCPTradeMyBidInfos": {
             "get": {
                 "security": [
@@ -43161,6 +43194,47 @@
                 }
             }
         },
+        "models.Hybridreceiveronboard": {
+            "type": "object",
+            "properties": {
+                "accountid": {
+                    "description": "资金账户ID",
+                    "type": "integer"
+                },
+                "bank_account": {
+                    "description": "银行卡号",
+                    "type": "string"
+                },
+                "bank_code": {
+                    "description": "银行代码",
+                    "type": "string"
+                },
+                "bank_name": {
+                    "description": "银行名称",
+                    "type": "string"
+                },
+                "cert_no": {
+                    "description": "证件号码",
+                    "type": "string"
+                },
+                "channel_code": {
+                    "description": "渠道代码",
+                    "type": "string"
+                },
+                "name": {
+                    "description": "名称 / 企业名称",
+                    "type": "string"
+                },
+                "phone_number": {
+                    "description": "电话号码",
+                    "type": "string"
+                },
+                "receiver_type": {
+                    "description": "接收者类型 // 个人-Individual 企业-Organization",
+                    "type": "string"
+                }
+            }
+        },
         "models.HybsMyBuyOrderDetail": {
             "type": "object",
             "required": [

+ 50 - 0
docs/swagger.yaml

@@ -14121,6 +14121,36 @@ definitions:
         description: 备注
         type: string
     type: object
+  models.Hybridreceiveronboard:
+    properties:
+      accountid:
+        description: 资金账户ID
+        type: integer
+      bank_account:
+        description: 银行卡号
+        type: string
+      bank_code:
+        description: 银行代码
+        type: string
+      bank_name:
+        description: 银行名称
+        type: string
+      cert_no:
+        description: 证件号码
+        type: string
+      channel_code:
+        description: 渠道代码
+        type: string
+      name:
+        description: 名称 / 企业名称
+        type: string
+      phone_number:
+        description: 电话号码
+        type: string
+      receiver_type:
+        description: 接收者类型 // 个人-Individual 企业-Organization
+        type: string
+    type: object
   models.HybsMyBuyOrderDetail:
     properties:
       accountid:
@@ -32528,6 +32558,26 @@ paths:
       summary: 查询托管银行扩展配置信息
       tags:
       - 银行
+  /Bank/QueryHybridReceiverOnboards:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.Hybridreceiveronboard'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询混合支付出金接收者信息
+      tags:
+      - 银行
   /CPTrade/QueryCPTradeMyBidInfos:
     get:
       parameters:

+ 43 - 1
models/bank.go

@@ -197,7 +197,7 @@ func GetPaymentCenterHybridConfig() (paymentCenterHybridConfigs []PaymentCenterH
 		}
 
 		hybridbankinfos := make([]Hybridbankinfo, 0)
-		if err = engine.Where("CHANNEL = ? AND IS_ENABLED = 1", item.CHANNEL_CODE).Find(&hybridbankinfos); err != nil {
+		if err = engine.Where("CHANNEL_CODE = ? AND IS_ENABLED = 1", item.CHANNEL_CODE).Find(&hybridbankinfos); err != nil {
 			return
 		}
 		paymentCenterHybridConfig.BankInfos = hybridbankinfos
@@ -219,4 +219,46 @@ type Hybridreceiveronboard struct {
 	BANK         string `json:"bank_code" xorm:"BANK"`             // 银行代码
 	BANKACCOUNT  string `json:"bank_account" xorm:"BANKACCOUNT"`   // 银行卡号
 
+	BANK_NAME string `json:"bank_name" xorm:"BANK_NAME"` // 银行名称
+
+	USERID int64 `json:"-" xorm:"-"` // 用户ID
+}
+
+func (r *Hybridreceiveronboard) calc() {}
+
+func (r *Hybridreceiveronboard) buildSql() string {
+	var sqlId utils.SQLVal = `
+select 
+  t.channel_code,
+  t.accountid,
+  t.id,
+  t.receivertype,
+  t.name,
+  t.taxid,
+  t.telnumber,
+  t.bank,
+  t.bankaccount,
+  t.email,
+  t.datecreated,
+  t.datemodified,
+  t.relationship,
+  t.status, 
+  b.bank_name
+from HYBRID_RECEIVERONBOARD t
+inner join HYBRID_BANKINFO b on b.channel_code = t.channel_code
+inner join taaccount ta on ta.accountid = t.accountid
+inner join useraccount u on u.userid = ta.userid
+	`
+	sqlId.And("u.userid", r.USERID)
+
+	return sqlId.String()
+}
+
+func (r *Hybridreceiveronboard) GetDataEx() (interface{}, error) {
+	sData := make([]Hybridreceiveronboard, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
 }

+ 7 - 7
models/ori.go

@@ -1333,13 +1333,13 @@ func (r *Hybridchannelconfig) TableName() string {
 
 // Hybridbankinfo 混合支付银行信息表
 type Hybridbankinfo struct {
-	BANK_CODE    string `json:"bank_code" xorm:"BANK_CODE"`     // 银行代码
-	BANK_NAME    string `json:"bank_name" xorm:"BANK_NAME"`     // 银行名称
-	CHANNEL_CODE string `json:"channel_code" xorm:"CHANNEL"`    // 渠道代码
-	OUT_IN_FLAG  int32  `json:"out_in_flag" xorm:"OUT_IN_FLAG"` // 出入金标志 0-出金 1-入金
-	METHOD_TYPE  string `json:"method_type" xorm:"METHOD_TYPE"` // 方式类型
-	IS_ENABLED   int32  `json:"is_enabled" xorm:"IS_ENABLED"`   // 是否可用 0-未可用 1-可用
-	REMARK       string `json:"remark" xorm:"REMARK"`           // 备注
+	BANK_CODE    string `json:"bank_code" xorm:"BANK_CODE"`       // 银行代码
+	BANK_NAME    string `json:"bank_name" xorm:"BANK_NAME"`       // 银行名称
+	CHANNEL_CODE string `json:"channel_code" xorm:"CHANNEL_CODE"` // 渠道代码
+	OUT_IN_FLAG  int32  `json:"out_in_flag" xorm:"OUT_IN_FLAG"`   // 出入金标志 0-出金 1-入金
+	METHOD_TYPE  string `json:"method_type" xorm:"METHOD_TYPE"`   // 方式类型
+	IS_ENABLED   int32  `json:"is_enabled" xorm:"IS_ENABLED"`     // 是否可用 0-未可用 1-可用
+	REMARK       string `json:"remark" xorm:"REMARK"`             // 备注
 }
 
 // TableName is HYBRID_BANKINFO

+ 1 - 0
routers/router.go

@@ -850,6 +850,7 @@ func InitRouter() *gin.Engine {
 		bankR.Use(token.Auth()).GET("GetAmtInByPaidUrl", bank.GetAmtInByPaidUrl)
 		bankR.Use(token.Auth()).GET("GetCusBankInfos", bank.GetCusBankInfos)
 		bankR.Use(token.Auth()).GET("GetHybridConfigs", bank.GetHybridConfigs)
+		bankR.Use(token.Auth()).GET("QueryHybridReceiverOnboards", bank.QueryHybridReceiverOnboards)
 	}
 
 	// ************************* 报表 *************************