Parcourir la source

增加查询现货商品接口、增加业务查询的审核人字段

zou.yingbin il y a 4 ans
Parent
commit
6528ee462c

+ 2 - 2
controllers/ermcp/qryOPApply.go

@@ -121,7 +121,7 @@ type QryBussinessKxRsp struct {
 }
 
 // QueryBusinessKx  企业风险管理合同操作查询
-// @Summary 查询业务管理(款项)(对应菜单:业务管理/款项)
+// @Summary 查询财务管理(款项)(对应菜单:财务管理/款项)
 // @Produce json
 // @Security ApiKeyAuth
 // @Success 200 {array} QryBussinessKxRsp
@@ -155,7 +155,7 @@ type QryBussinessFpRsp struct {
 }
 
 // QueryBusinessFp  企业风险管理合同操作查询
-// @Summary 查询业务管理(发票)(对应菜单:业务管理/发票)
+// @Summary 查询财务管理(发票)(对应菜单:财务管理/发票)
 // @Produce json
 // @Security ApiKeyAuth
 // @Success 200 {array} QryBussinessFpRsp

+ 44 - 0
controllers/ermcp/qryWrstandard.go

@@ -0,0 +1,44 @@
+/**
+* @Author: zou.yingbin
+* @Create  : 2021/1/13 11:15
+* @Modify  : 2021/1/13 11:15
+ */
+
+package ermcp
+
+import (
+	"github.com/gin-gonic/gin"
+	"mtp2_if/global/app"
+	"mtp2_if/global/e"
+	"mtp2_if/models"
+	"mtp2_if/mtpcache"
+	"net/http"
+)
+
+//查询现货商品请求
+type QryWrStandardReq struct {
+}
+
+//查询现货商品响应
+type QryWrStandardRsp models.ErmcpWrstandard
+
+// QueryWrStandard  企业风险管理查询现货商品
+// @Summary 查询现货商品
+// @Produce json
+// @Security ApiKeyAuth
+// @Success 200 {array} QryWrStandardRsp
+// @Failure 500 {object} app.Response
+// @Router /Ermcp/QueryWrStandard [get]
+// @Tags 企业风险管理(app)
+func QueryWrStandard(c *gin.Context)  {
+	appG := app.Gin{C: c}
+	var m models.ErmcpWrstandard
+	if d, err := m.GetData(); err == nil {
+		for i := range d {
+			d[i].EnumdicName = mtpcache.GetEnumDicitemName(d[i].UNITID)
+		}
+		appG.Response(http.StatusOK, e.SUCCESS, d)
+	} else {
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+	}
+}

+ 111 - 2
docs/docs.go

@@ -763,7 +763,7 @@ var doc = `{
                 "tags": [
                     "企业风险管理(app)"
                 ],
-                "summary": "查询业务管理(发票)(对应菜单:业务管理/发票)",
+                "summary": "查询财务管理(发票)(对应菜单:财务管理/发票)",
                 "responses": {
                     "200": {
                         "description": "OK",
@@ -829,7 +829,7 @@ var doc = `{
                 "tags": [
                     "企业风险管理(app)"
                 ],
-                "summary": "查询业务管理(款项)(对应菜单:业务管理/款项)",
+                "summary": "查询财务管理(款项)(对应菜单:财务管理/款项)",
                 "responses": {
                     "200": {
                         "description": "OK",
@@ -1024,6 +1024,39 @@ var doc = `{
                 }
             }
         },
+        "/Ermcp/QueryWrStandard": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "企业风险管理(app)"
+                ],
+                "summary": "查询现货商品",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/ermcp.QryWrStandardRsp"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Erms2/QueryArbitrageStrategy": {
             "get": {
                 "security": [
@@ -5313,6 +5346,10 @@ var doc = `{
                     "description": "申请时间",
                     "type": "string"
                 },
+                "auditname": {
+                    "description": "审核人名称",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
@@ -5394,6 +5431,10 @@ var doc = `{
                     "description": "申请时间",
                     "type": "string"
                 },
+                "auditname": {
+                    "description": "审核人名称",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
@@ -5475,6 +5516,10 @@ var doc = `{
                     "description": "申请时间",
                     "type": "string"
                 },
+                "auditname": {
+                    "description": "审核人名称",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
@@ -5568,6 +5613,10 @@ var doc = `{
                     "description": "申请时间",
                     "type": "string"
                 },
+                "auditname": {
+                    "description": "审核人名称",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
@@ -5642,6 +5691,9 @@ var doc = `{
         "ermcp.QryUserInfoRsp": {
             "$ref": "#/definitions/models.ErmcpUserModel"
         },
+        "ermcp.QryWrStandardRsp": {
+            "$ref": "#/definitions/models.ErmcpWrstandard"
+        },
         "erms2.QueryArbitrageStrategyRsp": {
             "type": "object",
             "required": [
@@ -7643,6 +7695,63 @@ var doc = `{
                 }
             }
         },
+        "models.ErmcpWrstandard": {
+            "type": "object",
+            "properties": {
+                "areauserid": {
+                    "description": "所属机构",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
+                "deliverygoodsid": {
+                    "description": "品种ID",
+                    "type": "integer"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "minivalue": {
+                    "description": "最小变动值",
+                    "type": "integer"
+                },
+                "minivaluedp": {
+                    "description": "最小变动值小数位",
+                    "type": "integer"
+                },
+                "realminivalue": {
+                    "description": "实际最小变动值",
+                    "type": "integer"
+                },
+                "realminivaluedp": {
+                    "description": "实际最小变动值小数位",
+                    "type": "integer"
+                },
+                "unitid": {
+                    "description": "单位ID",
+                    "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID(SEQ_WRSTANDARD)",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.GoodsIDAndName": {
             "type": "object",
             "required": [

+ 111 - 2
docs/swagger.json

@@ -747,7 +747,7 @@
                 "tags": [
                     "企业风险管理(app)"
                 ],
-                "summary": "查询业务管理(发票)(对应菜单:业务管理/发票)",
+                "summary": "查询财务管理(发票)(对应菜单:财务管理/发票)",
                 "responses": {
                     "200": {
                         "description": "OK",
@@ -813,7 +813,7 @@
                 "tags": [
                     "企业风险管理(app)"
                 ],
-                "summary": "查询业务管理(款项)(对应菜单:业务管理/款项)",
+                "summary": "查询财务管理(款项)(对应菜单:财务管理/款项)",
                 "responses": {
                     "200": {
                         "description": "OK",
@@ -1008,6 +1008,39 @@
                 }
             }
         },
+        "/Ermcp/QueryWrStandard": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "企业风险管理(app)"
+                ],
+                "summary": "查询现货商品",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/ermcp.QryWrStandardRsp"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Erms2/QueryArbitrageStrategy": {
             "get": {
                 "security": [
@@ -5297,6 +5330,10 @@
                     "description": "申请时间",
                     "type": "string"
                 },
+                "auditname": {
+                    "description": "审核人名称",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
@@ -5378,6 +5415,10 @@
                     "description": "申请时间",
                     "type": "string"
                 },
+                "auditname": {
+                    "description": "审核人名称",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
@@ -5459,6 +5500,10 @@
                     "description": "申请时间",
                     "type": "string"
                 },
+                "auditname": {
+                    "description": "审核人名称",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
@@ -5552,6 +5597,10 @@
                     "description": "申请时间",
                     "type": "string"
                 },
+                "auditname": {
+                    "description": "审核人名称",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
@@ -5626,6 +5675,9 @@
         "ermcp.QryUserInfoRsp": {
             "$ref": "#/definitions/models.ErmcpUserModel"
         },
+        "ermcp.QryWrStandardRsp": {
+            "$ref": "#/definitions/models.ErmcpWrstandard"
+        },
         "erms2.QueryArbitrageStrategyRsp": {
             "type": "object",
             "required": [
@@ -7627,6 +7679,63 @@
                 }
             }
         },
+        "models.ErmcpWrstandard": {
+            "type": "object",
+            "properties": {
+                "areauserid": {
+                    "description": "所属机构",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人",
+                    "type": "integer"
+                },
+                "deliverygoodsid": {
+                    "description": "品种ID",
+                    "type": "integer"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "minivalue": {
+                    "description": "最小变动值",
+                    "type": "integer"
+                },
+                "minivaluedp": {
+                    "description": "最小变动值小数位",
+                    "type": "integer"
+                },
+                "realminivalue": {
+                    "description": "实际最小变动值",
+                    "type": "integer"
+                },
+                "realminivaluedp": {
+                    "description": "实际最小变动值小数位",
+                    "type": "integer"
+                },
+                "unitid": {
+                    "description": "单位ID",
+                    "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID(SEQ_WRSTANDARD)",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.GoodsIDAndName": {
             "type": "object",
             "required": [

+ 78 - 2
docs/swagger.yaml

@@ -855,6 +855,9 @@ definitions:
       applytime:
         description: 申请时间
         type: string
+      auditname:
+        description: 审核人名称
+        type: string
       audittime:
         description: 审核时间
         type: string
@@ -915,6 +918,9 @@ definitions:
       applytime:
         description: 申请时间
         type: string
+      auditname:
+        description: 审核人名称
+        type: string
       audittime:
         description: 审核时间
         type: string
@@ -975,6 +981,9 @@ definitions:
       applytime:
         description: 申请时间
         type: string
+      auditname:
+        description: 审核人名称
+        type: string
       audittime:
         description: 审核时间
         type: string
@@ -1044,6 +1053,9 @@ definitions:
       applytime:
         description: 申请时间
         type: string
+      auditname:
+        description: 审核人名称
+        type: string
       audittime:
         description: 审核时间
         type: string
@@ -1098,6 +1110,8 @@ definitions:
     $ref: '#/definitions/models.ErmcpSpotContractModel'
   ermcp.QryUserInfoRsp:
     $ref: '#/definitions/models.ErmcpUserModel'
+  ermcp.QryWrStandardRsp:
+    $ref: '#/definitions/models.ErmcpWrstandard'
   erms2.QueryArbitrageStrategyRsp:
     properties:
       applybasis:
@@ -2581,6 +2595,48 @@ definitions:
         description: 客户类型
         type: string
     type: object
+  models.ErmcpWrstandard:
+    properties:
+      areauserid:
+        description: 所属机构
+        type: integer
+      createtime:
+        description: 创建时间
+        type: string
+      creatorid:
+        description: 创建人
+        type: integer
+      deliverygoodsid:
+        description: 品种ID
+        type: integer
+      enumdicname:
+        description: 单位名称
+        type: string
+      minivalue:
+        description: 最小变动值
+        type: integer
+      minivaluedp:
+        description: 最小变动值小数位
+        type: integer
+      realminivalue:
+        description: 实际最小变动值
+        type: integer
+      realminivaluedp:
+        description: 实际最小变动值小数位
+        type: integer
+      unitid:
+        description: 单位ID
+        type: integer
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
+      wrstandardid:
+        description: 现货商品ID(SEQ_WRSTANDARD)
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
+    type: object
   models.GoodsIDAndName:
     properties:
       goodscode:
@@ -6485,7 +6541,7 @@ paths:
             $ref: '#/definitions/app.Response'
       security:
       - ApiKeyAuth: []
-      summary: 查询业务管理(发票)(对应菜单:业务管理/发票)
+      summary: 查询财务管理(发票)(对应菜单:财务管理/发票)
       tags:
       - 企业风险管理(app)
   /Ermcp/QueryBusinessJs:
@@ -6525,7 +6581,7 @@ paths:
             $ref: '#/definitions/app.Response'
       security:
       - ApiKeyAuth: []
-      summary: 查询业务管理(款项)(对应菜单:业务管理/款项)
+      summary: 查询财务管理(款项)(对应菜单:财务管理/款项)
       tags:
       - 企业风险管理(app)
   /Ermcp/QueryContract:
@@ -6637,6 +6693,26 @@ paths:
       summary: 查询客户资料
       tags:
       - 企业风险管理(app)
+  /Ermcp/QueryWrStandard:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/ermcp.QryWrStandardRsp'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询现货商品
+      tags:
+      - 企业风险管理(app)
   /Erms2/QueryArbitrageStrategy:
     get:
       parameters:

+ 5 - 1
models/ermcpOPApply.go

@@ -32,6 +32,7 @@ type ErmcpOPApplyModel struct {
 	BUYUSERNAME      string `json:"buyusername"  xorm:"'BUYUSERNAME'"`           //采购方名称
 	SELLUSERNAME     string `json:"sellusername"  xorm:"'SELLUSERNAME'"`         //销售方名字
 	APPLYNAME        string `json:"applyname"  xorm:"'APPLYNAME'"`               //申请人名称
+	AUDITNAME        string `json:"auditname"  xorm:"'AUDITNAME'"`               //审核人名称
 }
 
 func (r *ErmcpOPApplyModel) buildSql(opType int32) string {
@@ -46,11 +47,12 @@ func (r *ErmcpOPApplyModel) buildSql(opType int32) string {
 		"       t.CONTRACTTYPE," +
 		"       s.CONTRACTNO," +
 		"       s.PRICETYPE," +
-		"       s.pricemove,"+
+		"       s.pricemove," +
 		"       g.GOODSNAME," +
 		"       g.GOODSCODE," +
 		"       e.EnumdicName," +
 		"       m.username APPLYName," +
+		"       m2.username auditName," +
 		"       u1.accountname buyuserName," +
 		"       u2.accountname selluserName" +
 		"  from ermcp_contractoperateapply t" +
@@ -60,6 +62,8 @@ func (r *ErmcpOPApplyModel) buildSql(opType int32) string {
 		"    on s.goodsid = g.goodsid" +
 		"  left join loginaccount l on t.applyid=l.loginid" +
 		"  left join systemmanager m on m.logincode=l.logincode" +
+		"  left join loginaccount l2 on t.auditid=l2.loginid" +
+		"  left join systemmanager m2 on m2.logincode=l2.logincode" +
 		"  left join useraccount u1 on s.buyuserid=u1.userid" +
 		"  left join useraccount u2 on s.selluserid=u2.userid" +
 		"  left join enumdicitem e" +

+ 54 - 0
models/ermcpWrstandard.go

@@ -0,0 +1,54 @@
+/**
+* @Author: zou.yingbin
+* @Create  : 2021/1/13 11:16
+* @Modify  : 2021/1/13 11:16
+ */
+
+package models
+
+import (
+	"mtp2_if/db"
+	"mtp2_if/logger"
+)
+
+// 现货商品表
+type ErmcpWrstandard struct {
+	WRSTANDARDID    int64  `json:"wrstandardid"  xorm:"'WRSTANDARDID'"`       //现货商品ID(SEQ_WRSTANDARD)
+	WRSTANDARDCODE  string `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`   //现货商品代码
+	DELIVERYGOODSID int32  `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"` //品种ID
+	UNITID          int32  `json:"unitid"  xorm:"'UNITID'"`                   //单位ID
+	MINIVALUE       int32  `json:"minivalue"  xorm:"'MINIVALUE'"`             //最小变动值
+	MINIVALUEDP     int32  `json:"minivaluedp"  xorm:"'MINIVALUEDP'"`         //最小变动值小数位
+	REALMINIVALUE   int32  `json:"realminivalue"  xorm:"'REALMINIVALUE'"`     //实际最小变动值
+	REALMINIVALUEDP int32  `json:"realminivaluedp"  xorm:"'REALMINIVALUEDP'"` //实际最小变动值小数位
+	CREATORID       int64  `json:"creatorid"  xorm:"'CREATORID'"`             //创建人
+	CREATETIME      string `json:"createtime"  xorm:"'CREATETIME'"`           //创建时间
+	WRSTANDARDNAME  string `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`   //现货商品名称
+	AREAUSERID      int32  `json:"areauserid"  xorm:"'AREAUSERID'"`           //所属机构
+	EnumdicName     string `json:"enumdicname"`                               //单位名称
+}
+
+// 查询现货商品
+func (r *ErmcpWrstandard) GetData() ([]ErmcpWrstandard, error) {
+	sqlId := "select WRSTANDARDID," +
+		"       WRSTANDARDCODE," +
+		"       DELIVERYGOODSID," +
+		"       UNITID," +
+		"       MINIVALUE," +
+		"       MINIVALUEDP," +
+		"       REALMINIVALUE," +
+		"       REALMINIVALUEDP," +
+		"       CREATORID," +
+		"       CREATETIME," +
+		"       WRSTANDARDNAME," +
+		"       AREAUSERID" +
+		"  from wrstandard t" +
+		" where t.isvalid = 1"
+	sData := make([]ErmcpWrstandard, 0)
+	e := db.GetEngine()
+	if err := e.SQL(sqlId).Find(&sData); err != nil {
+		logger.GetLogger().Errorf("query wrstardard fail, %v", err)
+		return sData, err
+	}
+	return sData, nil
+}

+ 89 - 0
mtpcache/enumdicitem.go

@@ -0,0 +1,89 @@
+/**
+* @Author: zou.yingbin
+* @Create  : 2021/1/13 9:15
+* @Modify  : 2021/1/13 9:15
+ */
+
+package mtpcache
+
+import (
+	"mtp2_if/db"
+	"mtp2_if/logger"
+	"sync"
+	"time"
+)
+
+var vDic enumdicitem
+
+// 商品单位名称缓存
+type enumdicitem struct {
+	mtx  sync.RWMutex     //锁
+	data map[int32]string //数据[enumitemname]enumdicname
+	last time.Time
+}
+
+type enumData struct {
+	ENUMITEMNAME int32  `json:"enumitemname"  xorm:"'enumitemname'"` //ID
+	ENUMDICNAME  string `json:"enumdicname"  xorm:"'enumdicname'"`   //名称
+}
+
+func init() {
+	vDic.data = make(map[int32]string, 0)
+}
+
+// 加载数据
+func (r *enumdicitem) load() {
+	now := time.Now()
+	// 间隔3秒以上才重新加载
+	if d := now.Sub(r.last); d.Seconds() < 3{
+		return
+	}
+
+	r.mtx.Lock()
+	defer r.mtx.Unlock()
+	e := db.GetEngine()
+	if e == nil{
+		return
+	}
+
+	sqlId := "select t.enumitemname, t.enumdicname" +
+		"  from enumdicitem t" +
+		" where t.enumdiccode = 'goodsunit'" +
+		"   and t.enumitemstatus = 1"
+	sData := make([]enumData, 0)
+	s := e.SQL(sqlId)
+	if err := s.Find(&sData); err != nil {
+		logger.GetLogger().Errorf("cache load enumdicitem, %v", err)
+	} else {
+		r.data = make(map[int32]string)
+		for i := range sData {
+			r.data[sData[i].ENUMITEMNAME] = sData[i].ENUMDICNAME
+		}
+		r.last = time.Now()
+	}
+}
+
+func (r *enumdicitem) get(id int32) string {
+	r.mtx.RLock()
+	defer r.mtx.RUnlock()
+
+	if r.data == nil{
+		return ""
+	}
+
+	if v, ok := r.data[id]; ok{
+		return v
+	}
+	return ""
+}
+
+// 获取商品单位枚举名称
+func GetEnumDicitemName(id int32) string {
+	if v := vDic.get(id); v !=""{
+		return v
+	}else{
+		vDic.load()
+	}
+
+	return vDic.get(id)
+}

+ 86 - 0
mtpcache/username.go

@@ -0,0 +1,86 @@
+/**
+* @Author: zou.yingbin
+* @Create  : 2021/1/13 10:51
+* @Modify  : 2021/1/13 10:51
+ */
+
+package mtpcache
+
+import (
+	"mtp2_if/db"
+	"mtp2_if/logger"
+	"sync"
+	"time"
+)
+
+var vUser userName
+
+type userName struct {
+	mtx  sync.RWMutex     //锁
+	data map[int64]string //数据[loginId]accountName
+	last time.Time
+}
+
+type userData struct {
+	LOGINID  int64  //登录ID
+	USERNAME string // 用户名字
+}
+
+// 加载数据
+func (r *userName) load() {
+	now := time.Now()
+	// 间隔3秒以上才重新加载
+	if d := now.Sub(r.last); d.Seconds() < 3 {
+		return
+	}
+
+	r.mtx.Lock()
+	defer r.mtx.Unlock()
+	e := db.GetEngine()
+	if e == nil {
+		return
+	}
+
+	sqlId := "select l.loginid, s.username" +
+		"  from loginaccount l" +
+		"  left join systemmanager s" +
+		"    on l.logincode = s.logincode" +
+		" where s.username is not null"
+
+	sData := make([]userData, 0)
+	s := e.SQL(sqlId)
+	if err := s.Find(&sData); err != nil {
+		logger.GetLogger().Errorf("cache load usrname, %v", err)
+	} else {
+		r.data = make(map[int64]string)
+		for i := range sData {
+			r.data[sData[i].LOGINID] = sData[i].USERNAME
+		}
+		r.last = time.Now()
+	}
+}
+
+func (r *userName) get(loginId int64) string {
+	r.mtx.RLock()
+	defer r.mtx.RUnlock()
+
+	if r.data == nil {
+		return ""
+	}
+
+	if v, ok := r.data[loginId]; ok {
+		return v
+	}
+	return ""
+}
+
+// 根据登录ID获取名称
+func GetUserName(loginId int64) string {
+	if v := vUser.get(loginId); v !=""{
+		return v
+	}else{
+		vUser.load()
+	}
+
+	return vUser.get(loginId)
+}

+ 1 - 0
routers/router.go

@@ -299,6 +299,7 @@ func InitRouter() *gin.Engine {
 	{
 		// 查询待点价、履约和全部合同
 		ermcpR.GET("/QueryUserInfo", ermcp.QueryUserInfo)
+		ermcpR.GET("/QueryWrStandard", ermcp.QueryWrStandard)
 		ermcpR.GET("/QuerySpotContract", ermcp.QuerySpotContract)
 		ermcpR.GET("/QueryContract", ermcp.QueryContract)
 		ermcpR.GET("/QueryHedgePlan", ermcp.QueryHedgePlan)