zhou.xiaoning 2 năm trước cách đây
mục cha
commit
933e812a5e

+ 14 - 14
config/config.xml

@@ -13,11 +13,11 @@
     <DbAddress value="192.168.31.88"/>
     <DbName value="orcl"/>
     <DbPort value="1521"/>
-    <DbUser value="mtp2_test204"/>
+    <DbUser value="mtp2_test132"/>
     <DbPwd value="muchinfo"/>
   </DbSetting>
   <RedisSetting>
-    <Address value="192.168.31.204"/>
+    <Address value="192.168.31.132"/>
     <Port value="5007"/>
     <Timeout value="3"/>
     <ConnNum value="1"/>
@@ -25,11 +25,11 @@
     <Pwd value=""/>
   </RedisSetting>
   <MqSetting>
-    <Url value="amqp://guest:guest@192.168.31.204:5020/test"/>
+    <Url value="amqp://guest:guest@192.168.31.132:5020/test"/>
     <Exchange value="entry"/>
   </MqSetting>
   <MongoDBSetting>
-    <HostName value="192.168.31.204"/>
+    <HostName value="192.168.31.132"/>
     <Port value="5025"/>
     <DBName value="HistoryQuote"/>
     <Username value="quote_test01"/>
@@ -38,20 +38,20 @@
   <MySQLSetting>
     <Host value="192.168.30.72"/>
     <Port value="3306"/>
-    <DBName value="historyquote_test204"/>
-    <Username value="quote_test204"/>
+    <DBName value="historyquote_test132"/>
+    <Username value="quote_test132"/>
     <Password value="123456"/>
   </MySQLSetting>
   <Tencent>
     <Enabled value="1"/>
-    <SecretId value="AKyDwiyUUckpkct4igUy8lsS7SEqR6c7yR"/>
-    <SecretKey value="SKwvG74cbV3OrAiJdjU5k4507vZwNYDbwT"/>
-    <EndPoint value="essbasic.test.ess.tencent.cn"/>
-    <AppId value="yDwiuUUckpogfoa4UxhigrYChFMdSJQV"/>
-    <ProxyOrganizationName value="天津麦顿"/>
+    <SecretId value="AKIDPktwvneP2WqxvmWFsMclmfLLKDyrbAXp"/>
+    <SecretKey value="GNH9tX8c6Wls02vhNzUvdLuGMYfeVErM"/>
+    <EndPoint value="essbasic.tencentcloudapi.com"/>
+    <AppId value="yDSLpUUghqyijhUTQQ1W1DzMZVs3S2s8"/>
+    <ProxyOrganizationName value="海南掉期市场管理有限责任公司"/>
     <ProxyOrganizationOpenId value="TJMD"/>
-    <ProxyOperatorOpenId value="TJMD01"/>
-    <SignToken value="D586D270A51448179277A11729F37D3E"/>
-    <SignKey value="8774F484EA294C1E829EA6E2D7F99123"/>
+    <ProxyOperatorOpenId value="TJMD_LEGAL"/>
+    <SignToken value="42F95163F767407C858FB58D519A054A"/>
+    <SignKey value="34FD7C4496794788B569E84729601276"/>
   </Tencent>
 </Configuration>

+ 4 - 4
config/readme.md

@@ -22,9 +22,9 @@ cfg.json 用于配置Web交易端所需要的相关服务地址:
     <AppId value="yDSLpUUghqyijhUTQQ1W1DzMZVs3S2s8"/>
     <ProxyOrganizationName value="海南掉期市场管理有限责任公司"/>
     <ProxyOrganizationOpenId value="TJMD"/>
-    <ProxyOperatorOpenId value="TJMD_ADMIN"/>
-    <SignToken value="42F95163F767407C858FB58D519A054A"/>
-    <SignKey value="34FD7C4496794788B569E84729601276"/>
+    <ProxyOperatorOpenId value="TJMD_LEGAL"/>
+    <SignToken value="34FD7C4496794788B569E84729601276"/>
+    <SignKey value="42F95163F767407C858FB58D519A054A"/>
 </Tencent>
 
 Enabled="1" 表示启用腾讯电子签功能,如不需要则改为"0"
@@ -33,6 +33,6 @@ EndPoint 腾讯电子签API接入地址,测试环境填 "essbasic.test.ess.ten
 AppId 子客第三方应用ID,使用公司账号登录 https://qian.tencent.com/console/ 设置和获取
 ProxyOrganizationName 子客企业名称,生产环境应填写子客企业全名
 ProxyOrganizationOpenId 子客企业ID,与子客企业名称一一对应,由我方设置
-ProxyOperatorOpenId 子客企业管理员ID,生产环境应要求客户使用对方身份进行认证
+ProxyOperatorOpenId 子客企业管理员ID,生产环境应要求客户使用对方身份进行认证,TJMD_ADMIN TJMD_LEGAL
 SignToken 腾讯电子签密回调通知Token,用于验签,使用公司账号登录 https://qian.tencent.com/console/ 设置和获取
 SignKey 腾讯电子签密回调通知密钥,用于解密,使用公司账号登录 https://qian.tencent.com/console/ 设置和获取

+ 18 - 0
controllers/bank/bank.go

@@ -23,3 +23,21 @@ func QueryBankCusBankExtendConfigs(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataEx(&m)
 }
+
+// QueryBankBranChnumInfo
+// @Summary  查询银行支行联行号信息表
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param    branchname query    string true  "支行名称(模糊查询)"
+// @Param    page       query    int    false "页码"
+// @Param    pagesize   query    int    false "每页条数"
+// @Success  200        {array}  models.Bankbranchnuminfo
+// @Failure  500        {object} app.Response
+// @Router   /Bank/QueryBankBranChnumInfo [get]
+// @Tags     银行
+func QueryBankBranChnumInfo(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.Bankbranchnuminfo{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&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]

+ 16 - 3
controllers/tencent/qian.go

@@ -3,6 +3,7 @@ package tencent
 import (
 	"fmt"
 	"io"
+	SysConfig "mtp2_if/config"
 	"mtp2_if/global/app"
 	"mtp2_if/global/e"
 	"mtp2_if/logger"
@@ -76,6 +77,7 @@ func QianNotice(c *gin.Context) {
 
 	// 验签
 	if payload != "" {
+		logger.GetLogger().Infof("QianNotice payload:%s", payload)
 		signFromHeader := appG.C.Request.Header.Get("Content-Signature")
 		if signFromHeader != "" {
 			if tencent.VerifySign(payload, signFromHeader) {
@@ -85,12 +87,23 @@ func QianNotice(c *gin.Context) {
 				if err == nil {
 					// 解密成功
 					tencent.ProcessNotice(content)
+				} else {
+					logger.GetLogger().Errorf("QianNotice failed: 解密失败 %v", err)
+					appG.Response(http.StatusBadRequest, e.ERROR, "fail")
+					return
 				}
+			} else {
+				logger.GetLogger().Errorf("QianNotice failed: 验签失败")
+				appG.Response(http.StatusBadRequest, e.ERROR, "fail")
+				return
 			}
+
+			appG.Response(http.StatusOK, e.SUCCESS, "ok")
 		}
+	} else {
+		logger.GetLogger().Errorf("QianNotice failed: 获取推送内容为空")
+		appG.Response(http.StatusBadRequest, e.ERROR, "fail")
 	}
-
-	appG.Response(http.StatusOK, e.SUCCESS, "ok")
 }
 
 // CreateConsoleLoginUrl 创建电子签控制台登录链接
@@ -106,7 +119,7 @@ func CreateConsoleLoginUrl(c *gin.Context) {
 	appG := app.Gin{C: c}
 
 	agent := utils.SetAgent()
-	proxyOrganizationName := "天津麦顿"
+	proxyOrganizationName := SysConfig.SerCfg.TencentCfg.ProxyOrganizationName
 	response, _ := tencent.CreateConsoleLoginUrl(agent, proxyOrganizationName)
 
 	appG.Response(http.StatusOK, e.SUCCESS, response.ToJsonString())

+ 82 - 0
docs/docs.go

@@ -17,6 +17,60 @@ const docTemplate = `{
     "host": "{{.Host}}",
     "basePath": "{{.BasePath}}",
     "paths": {
+        "/Bank/QueryBankBranChnumInfo": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "银行"
+                ],
+                "summary": "查询银行支行联行号信息表",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "支行名称(模糊查询)",
+                        "name": "branchname",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Bankbranchnuminfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Bank/QueryBankCusBankExtendConfigs": {
             "get": {
                 "security": [
@@ -27881,6 +27935,34 @@ const docTemplate = `{
                 }
             }
         },
+        "models.Bankbranchnuminfo": {
+            "type": "object",
+            "required": [
+                "branchname"
+            ],
+            "properties": {
+                "branchcity": {
+                    "description": "市县",
+                    "type": "string"
+                },
+                "branchname": {
+                    "description": "支行名称",
+                    "type": "string"
+                },
+                "branchnum": {
+                    "description": "支行行号",
+                    "type": "string"
+                },
+                "branchprovince": {
+                    "description": "省份",
+                    "type": "string"
+                },
+                "isexpired": {
+                    "description": "是否过期",
+                    "type": "string"
+                }
+            }
+        },
         "models.Bankcusbankextendconfig": {
             "type": "object",
             "required": [

+ 82 - 0
docs/swagger.json

@@ -8,6 +8,60 @@
         "version": "1.0"
     },
     "paths": {
+        "/Bank/QueryBankBranChnumInfo": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "银行"
+                ],
+                "summary": "查询银行支行联行号信息表",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "支行名称(模糊查询)",
+                        "name": "branchname",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Bankbranchnuminfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Bank/QueryBankCusBankExtendConfigs": {
             "get": {
                 "security": [
@@ -27872,6 +27926,34 @@
                 }
             }
         },
+        "models.Bankbranchnuminfo": {
+            "type": "object",
+            "required": [
+                "branchname"
+            ],
+            "properties": {
+                "branchcity": {
+                    "description": "市县",
+                    "type": "string"
+                },
+                "branchname": {
+                    "description": "支行名称",
+                    "type": "string"
+                },
+                "branchnum": {
+                    "description": "支行行号",
+                    "type": "string"
+                },
+                "branchprovince": {
+                    "description": "省份",
+                    "type": "string"
+                },
+                "isexpired": {
+                    "description": "是否过期",
+                    "type": "string"
+                }
+            }
+        },
         "models.Bankcusbankextendconfig": {
             "type": "object",
             "required": [

+ 54 - 0
docs/swagger.yaml

@@ -4007,6 +4007,26 @@ definitions:
     - orderid
     - userid
     type: object
+  models.Bankbranchnuminfo:
+    properties:
+      branchcity:
+        description: 市县
+        type: string
+      branchname:
+        description: 支行名称
+        type: string
+      branchnum:
+        description: 支行行号
+        type: string
+      branchprovince:
+        description: 省份
+        type: string
+      isexpired:
+        description: 是否过期
+        type: string
+    required:
+    - branchname
+    type: object
   models.Bankcusbankextendconfig:
     properties:
       cusbankid:
@@ -30365,6 +30385,40 @@ info:
   title: MTP2.0 查询服务 API
   version: "1.0"
 paths:
+  /Bank/QueryBankBranChnumInfo:
+    get:
+      parameters:
+      - description: 支行名称(模糊查询)
+        in: query
+        name: branchname
+        required: true
+        type: string
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.Bankbranchnuminfo'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询银行支行联行号信息表
+      tags:
+      - 银行
   /Bank/QueryBankCusBankExtendConfigs:
     get:
       parameters:

+ 41 - 0
models/bank.go

@@ -53,3 +53,44 @@ func (r *Bankcusbankextendconfig) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// Bankbranchnuminfo 银行支行联行号信息表
+type Bankbranchnuminfo struct {
+	BRANCHNUM      string `json:"branchnum" xorm:"BRANCHNUM"`                                        // 支行行号
+	BRANCHNAME     string `json:"branchname" xorm:"BRANCHNAME" form:"branchname" binding:"required"` // 支行名称
+	BRANCHPROVINCE string `json:"branchprovince" xorm:"BRANCHPROVINCE"`                              // 省份
+	BRANCHCITY     string `json:"branchcity" xorm:"BRANCHCITY"`                                      // 市县
+	ISEXPIRED      string `json:"isexpired" xorm:"ISEXPIRED"`                                        // 是否过期
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *Bankbranchnuminfo) calc() {
+
+}
+
+func (r *Bankbranchnuminfo) buildSql() string {
+	var sqlId utils.SQLVal = `
+	select t.branchnum,
+		t.branchname,
+		t.branchprovince,
+		t.branchcity
+	from  BANK_BRANCHNUMINFO t
+	where t.branchname like '%%%v%%'
+	`
+	sqlId.FormatParam(r.BRANCHNAME)
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *Bankbranchnuminfo) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]Bankbranchnuminfo, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	total := 0
+	for i := range sData {
+		sData[i].calc()
+		total = sData[i].Total
+	}
+	return sData, err, r.Page, r.PageSize, total
+}

+ 1 - 1
models/tjmd.go

@@ -129,7 +129,7 @@ select to_char(t.orderid) orderid,
 	sqlId.JoinEx(r.FtMarketIds != "", fmt.Sprintf(" and g.marketid in(%v)", r.FtMarketIds))
 	sqlId.Join(" order by ")
 	if r.MEMBERUSERID != 0 {
-		sqlId.JoinFormat(" (CASE WHEN u.memberuserid = %v THEN 1 ELSE 2 END), u.memberuserid, ", r.MEMBERUSERID)
+		sqlId.JoinFormat(" (CASE WHEN u.memberuserid = %v THEN 1 ELSE 2 END), ", r.MEMBERUSERID)
 	}
 	if r.BUYORSELL == 0 {
 		sqlId.Join(" t.orderprice desc, t.ordertime desc")

+ 1 - 0
routers/router.go

@@ -802,6 +802,7 @@ func InitRouter() *gin.Engine {
 	bankR.Use()
 	{
 		bankR.Use(token.Auth()).GET("QueryBankCusBankExtendConfigs", bank.QueryBankCusBankExtendConfigs)
+		bankR.Use(token.Auth()).GET("QueryBankBranChnumInfo", bank.QueryBankBranChnumInfo)
 	}
 
 	// ************************* 报表 *************************