Quellcode durchsuchen

1. fix 角色设置查询、期货账户查询参数错误
2. 查现货商品接口 按业务类型排除已配置商品

zou.yingbin vor 4 Jahren
Ursprung
Commit
2d36ec45f8

+ 6 - 2
controllers/ermcp/qryAccMgr.go

@@ -48,7 +48,9 @@ func QueryAccMgrLoginUser(c *gin.Context) {
 // @Tags 企业风险管理(app)
 func QueryAccMgrTaaccount(c *gin.Context) {
 	a := app.GinUtils{Gin: app.Gin{C: c}}
-	req := QryLoginUserReq{}
+	req := struct {
+		UserId int64 `form:"userid" binding:"required"` // 用户id
+	}{}
 	a.DoBindReq(&req)
 	m := models.ErmcpTaAccount{USERID: req.UserId}
 	a.DoGetDataI(&m)
@@ -89,7 +91,9 @@ func QueryAccMgrMainAccountInfo(c *gin.Context) {
 // @Tags 企业风险管理(app)
 func QueryAccMgrRole(c *gin.Context) {
 	a := app.GinUtils{Gin: app.Gin{C: c}}
-	req := QryLoginUserReq{}
+	req := struct {
+		UserId int64 `form:"userid" binding:"required"` // 用户id
+	}{}
 	a.DoBindReq(&req)
 	m := models.ErmcpRole{AREAUSERID: req.UserId}
 	a.DoGetDataI(&m)

+ 1 - 1
controllers/ermcp3/qryErmcp3.go

@@ -29,7 +29,7 @@ func QueryDeliveryGoods(c *gin.Context) {
 	a := app.GinUtils{Gin: app.Gin{C: c}}
 	req := struct {
 		AreaUserId int64 `form:"areauserid" binding:"required"` // 所属机构id
-		ExcludeCfg int32 `form:"excludecfg"`                    // 排除已配置的商品
+		ExcludeCfg int32 `form:"excludecfg"`                    // 排除已配置的业务类型商品 1-套保 2-套利
 	}{}
 	a.DoBindReq(&req)
 	m := models.ErmcpDeliveryGoods{AREAUSERID: req.AreaUserId, ExcludeCfg: req.ExcludeCfg}

+ 4 - 0
docs/docs.go

@@ -17091,6 +17091,10 @@ var doc = `{
                     "description": "登录id(LOGINID)",
                     "type": "integer"
                 },
+                "loginname": {
+                    "description": "登录名称(loginaccount表中的accountname字段)",
+                    "type": "string"
+                },
                 "loginstatus": {
                     "description": "登录账户状态 - 1:正常 2:冻结 3:无效",
                     "type": "integer"

+ 4 - 0
docs/swagger.json

@@ -17075,6 +17075,10 @@
                     "description": "登录id(LOGINID)",
                     "type": "integer"
                 },
+                "loginname": {
+                    "description": "登录名称(loginaccount表中的accountname字段)",
+                    "type": "string"
+                },
                 "loginstatus": {
                     "description": "登录账户状态 - 1:正常 2:冻结 3:无效",
                     "type": "integer"

+ 3 - 0
docs/swagger.yaml

@@ -5756,6 +5756,9 @@ definitions:
       loginid:
         description: 登录id(LOGINID)
         type: integer
+      loginname:
+        description: 登录名称(loginaccount表中的accountname字段)
+        type: string
       loginstatus:
         description: 登录账户状态 - 1:正常 2:冻结 3:无效
         type: integer

+ 3 - 3
models/ermcp3.go

@@ -33,7 +33,7 @@ type ErmcpDeliveryGoods struct {
 	REMARK            string `json:"remark"  xorm:"'REMARK'"`                       // 备注
 
 	EnumdicName string `json:"enumdicname"` // 现货品种单位名称
-	ExcludeCfg  int32  `json:"-"`           // 排除已配置项 1-排除
+	ExcludeCfg  int32  `json:"-"`           // 排除已配置的业务类型商品 1-套保 2-套利
 }
 
 func (r *ErmcpDeliveryGoods) calc() {
@@ -61,8 +61,8 @@ func (r *ErmcpDeliveryGoods) buildSql() string {
 		" WHERE 1 = 1"
 	sqlId.AndEx("t.AREAUSERID", r.AREAUSERID, r.AREAUSERID > 0)
 	sqlId.AndEx("t.DELIVERYGOODSID", r.DELIVERYGOODSID, r.DELIVERYGOODSID > 0)
-	if r.ExcludeCfg == 1 {
-		sqlId.Join(" and t.deliverygoodsid not in(select distinct deliverygoodsid from ermcp_bizgroupspotgoods)")
+	if r.ExcludeCfg > 0 {
+		sqlId.Join(fmt.Sprintf(" and t.deliverygoodsid not in(select distinct deliverygoodsid from ermcp_bizgroupspotgoods where biztype = %v)", r.ExcludeCfg))
 	}
 	return sqlId.String()
 }

+ 1 - 1
utils/sqlUtils.go

@@ -36,7 +36,7 @@ func (r *SQLVal) And(fieldName string, val interface{}) {
 // 如果没有bAdd参数,外层就得写if r.areauserid > 0 {...}
 func (r *SQLVal) AndEx(fieldName string, val interface{}, bAdd bool) {
 	if bAdd {
-		*r = *r + SQLVal(fmt.Sprintf(" and %v = %v", fieldName, val))
+		r.And(fieldName, val)
 	}
 }