Procházet zdrojové kódy

1.查询期货账户按userid查
2.查期货商品组加单位名称字段

zou.yingbin před 4 roky
rodič
revize
a88463663c

+ 1 - 1
controllers/ermcp/qryAccMgr.go

@@ -48,7 +48,7 @@ func QueryAccMgrTaaccount(c *gin.Context) {
 	a := app.GinUtils{Gin: app.Gin{C: c}}
 	req := QryLoginUserReq{}
 	a.DoBindReq(&req)
-	m := models.ErmcpTaAccount{RELATEDUSERID: req.UserId}
+	m := models.ErmcpTaAccount{USERID: req.UserId}
 	a.DoGetDataI(&m)
 }
 

+ 2 - 2
controllers/ermcp3/qryErmcp3.go

@@ -140,8 +140,8 @@ func QuerySpotContractBS(c *gin.Context) {
 // @Summary 查询敞口现货明细
 // @Produce json
 // @Security ApiKeyAuth
-// @Param areaUserId query int true "所属机构ID"
-// @Param middleGoodsId query int true "套保商品"
+// @Param areauserid query int true "所属机构ID"
+// @Param middlegoodsid query int true "套保商品"
 // @Success 200 {array} models.Ermcp3ExposureDetail
 // @Failure 500 {object} app.Response
 // @Router /Ermcp3/QueryExposureDetail [get]

+ 10 - 2
docs/docs.go

@@ -4950,14 +4950,14 @@ var doc = `{
                     {
                         "type": "integer",
                         "description": "所属机构ID",
-                        "name": "areaUserId",
+                        "name": "areauserid",
                         "in": "query",
                         "required": true
                     },
                     {
                         "type": "integer",
                         "description": "套保商品",
-                        "name": "middleGoodsId",
+                        "name": "middlegoodsid",
                         "in": "query",
                         "required": true
                     }
@@ -14223,6 +14223,10 @@ var doc = `{
                     "description": "报价小数位",
                     "type": "integer"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "excludecfg": {
                     "description": "排除套保品已配置期货分类下的商品组(但显示已配置商品组) 1-排除",
                     "type": "integer"
@@ -18334,6 +18338,10 @@ var doc = `{
                 "tradestatus": {
                     "description": "交易状态 - 1:正常 2:受限 3:冻结 4:禁止建仓(人工受限) 5:禁止交易(人工冻结) 6:待激活 7:已注销",
                     "type": "integer"
+                },
+                "userid": {
+                    "description": "用户id",
+                    "type": "integer"
                 }
             }
         },

+ 10 - 2
docs/swagger.json

@@ -4934,14 +4934,14 @@
                     {
                         "type": "integer",
                         "description": "所属机构ID",
-                        "name": "areaUserId",
+                        "name": "areauserid",
                         "in": "query",
                         "required": true
                     },
                     {
                         "type": "integer",
                         "description": "套保商品",
-                        "name": "middleGoodsId",
+                        "name": "middlegoodsid",
                         "in": "query",
                         "required": true
                     }
@@ -14207,6 +14207,10 @@
                     "description": "报价小数位",
                     "type": "integer"
                 },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
                 "excludecfg": {
                     "description": "排除套保品已配置期货分类下的商品组(但显示已配置商品组) 1-排除",
                     "type": "integer"
@@ -18318,6 +18322,10 @@
                 "tradestatus": {
                     "description": "交易状态 - 1:正常 2:受限 3:冻结 4:禁止建仓(人工受限) 5:禁止交易(人工冻结) 6:待激活 7:已注销",
                     "type": "integer"
+                },
+                "userid": {
+                    "description": "用户id",
+                    "type": "integer"
                 }
             }
         },

+ 8 - 2
docs/swagger.yaml

@@ -3721,6 +3721,9 @@ definitions:
       decimalplace:
         description: 报价小数位
         type: integer
+      enumdicname:
+        description: 单位名称
+        type: string
       excludecfg:
         description: 排除套保品已配置期货分类下的商品组(但显示已配置商品组) 1-排除
         type: integer
@@ -6760,6 +6763,9 @@ definitions:
       tradestatus:
         description: 交易状态 - 1:正常 2:受限 3:冻结 4:禁止建仓(人工受限) 5:禁止交易(人工冻结) 6:待激活 7:已注销
         type: integer
+      userid:
+        description: 用户id
+        type: integer
     type: object
   models.ErmcpTaAccountEx:
     properties:
@@ -15309,12 +15315,12 @@ paths:
       parameters:
       - description: 所属机构ID
         in: query
-        name: areaUserId
+        name: areauserid
         required: true
         type: integer
       - description: 套保商品
         in: query
-        name: middleGoodsId
+        name: middlegoodsid
         required: true
         type: integer
       produces:

+ 4 - 2
models/ermcp3.go

@@ -1922,11 +1922,13 @@ type Ermcp3GoodsGroup struct {
 	CLOSEPRICEMODE     int32   `json:"closepricemode"  xorm:"'CLOSEPRICEMODE'"`         // 强平价格方式 - 1:市价 2:最新价 3:涨跌停(未实现)
 	GROUPCATEGROYID    int32   `json:"groupcategroyid"  xorm:"'GROUPCATEGROYID'"`       // 品种分类ID
 
-	AreaUserId int64 `json:"areauserid" form:"areauserid" binding:"required"` // 所属机构id(套保品是有areauserid的,当要排除已配置商品组时需要areauserid过滤)
-	ExcludeCfg int32 `json:"excludecfg" form:"excludecfg"`                    // 排除套保品已配置期货分类下的商品组(但显示已配置商品组) 1-排除
+	ENUMDICNAME string `json:"enumdicname"`                                     // 单位名称
+	AreaUserId  int64  `json:"areauserid" form:"areauserid" binding:"required"` // 所属机构id(套保品是有areauserid的,当要排除已配置商品组时需要areauserid过滤)
+	ExcludeCfg  int32  `json:"excludecfg" form:"excludecfg"`                    // 排除套保品已配置期货分类下的商品组(但显示已配置商品组) 1-排除
 }
 
 func (r *Ermcp3GoodsGroup) calc() {
+	r.ENUMDICNAME = mtpcache.GetEnumDicitemName(r.GOODUNITID)
 }
 
 func (r *Ermcp3GoodsGroup) buildSql() string {

+ 3 - 1
models/ermcpAccMgr.go

@@ -182,6 +182,7 @@ type ErmcpTaAccount struct {
 	CURRENCYID      int32  `json:"currencyid"  xorm:"'CURRENCYID'"`           // 币种id
 	TRADESTATUS     int32  `json:"tradestatus"  xorm:"'TRADESTATUS'"`         // 交易状态 - 1:正常 2:受限 3:冻结 4:禁止建仓(人工受限) 5:禁止交易(人工冻结) 6:待激活 7:已注销
 	ISMAIN          int32  `json:"ismain"  xorm:"'ISMAIN'"`                   // 是否主账户 0-否 1-是
+	USERID          int64  `json:"userid"  xorm:"'USERID'"`                   // 用户id
 	RELATEDUSERID   int64  `json:"relateduserid"  xorm:"'RELATEDUSERID'"`     // 关联userid
 	ACCOUNTNAME     string `json:"accountname"  xorm:"'ACCOUNTNAME'"`         // 账户名称
 	PARENTACCOUNTID int64  `json:"parentaccountid"  xorm:"'PARENTACCOUNTID'"` // 父账户id
@@ -198,6 +199,7 @@ func (r *ErmcpTaAccount) buildSql() string {
 		"       t.currencyid," +
 		"       t.tradestatus," +
 		"       t.ismain," +
+		"       t.userid," +
 		"       t.relateduserid," +
 		"       t.accountname," +
 		"       t.parentaccountid," +
@@ -207,7 +209,7 @@ func (r *ErmcpTaAccount) buildSql() string {
 		"    on t.accountid = l.accountid" +
 		"   and t.ismain = 1" +
 		" where 1 = 1"
-	sqlId.And("t.relateduserid", r.RELATEDUSERID)
+	sqlId.And("t.userid", r.USERID)
 	return sqlId.String()
 }