Bladeren bron

Merge branch 'master' of 192.168.30.132:MTP2.0/MTP20_IF

zhou.xiaoning 4 jaren geleden
bovenliggende
commit
fe31c0568b
5 gewijzigde bestanden met toevoegingen van 97 en 5 verwijderingen
  1. 11 5
      controllers/ermcp/qryOPApply.go
  2. 30 0
      docs/docs.go
  3. 30 0
      docs/swagger.json
  4. 20 0
      docs/swagger.yaml
  5. 6 0
      models/ermcpOPApply.go

+ 11 - 5
controllers/ermcp/qryOPApply.go

@@ -68,6 +68,7 @@ type QryOPApplyReq struct {
 	UserId         int64  `form:"UserId" binding:"required"`    //用户ID
 	RelatedId      string `form:"relatedid" binding:"required"` //现货合同ID, 不填则查所有
 	OperateapplyId string `form:"operateapplyid"`               //操作申请id
+	Applystatus    string `form:"applystatus"`                  // 申请状态 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
 }
 
 // 查询业务管理/点价应答
@@ -82,6 +83,7 @@ type QryBusinessDjRsp struct {
 // @Security ApiKeyAuth
 // @Param UserId query int true "用户ID"
 // @Param relatedid query string false "现货合同ID, 不填则查所有"
+// @Param applystatus query string false "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回"
 // @Success 200 {array} QryBusinessDjRsp
 // @Failure 500 {object} app.Response
 // @Router /Ermcp/QueryBusinessDj [get]
@@ -90,7 +92,7 @@ func QueryBusinessDj(c *gin.Context) {
 	appG := app.Gin{C: c}
 	var req QryOPApplyReq
 	_ = c.ShouldBind(&req)
-	m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId}
+	m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId, FilterAppStatus: req.Applystatus}
 	if d, err := m.GetData(1); err == nil {
 		//构建应答数据
 		sData := make([]QryBusinessDjRsp, 0)
@@ -123,6 +125,7 @@ type QryBussinessJsRsp struct {
 // @Param UserId query int true "用户ID"
 // @Param relatedid query string false "现货合同ID, 不填则查所有"
 // @Param operateapplyid query string false "操作申请id"
+// @Param applystatus query string false "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回"
 // @Success 200 {array} QryBussinessJsRsp
 // @Failure 500 {object} app.Response
 // @Router /Ermcp/QueryBusinessJs [get]
@@ -131,7 +134,7 @@ func QueryBusinessJs(c *gin.Context) {
 	appG := app.Gin{C: c}
 	var req QryOPApplyReq
 	_ = c.ShouldBind(&req)
-	m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId, OPERATEAPPLYID: req.OperateapplyId}
+	m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId, OPERATEAPPLYID: req.OperateapplyId, FilterAppStatus: req.Applystatus}
 	if d, err := m.GetData(2); err == nil {
 		//构建应答数据
 		sData := make([]QryBussinessJsRsp, 0)
@@ -161,6 +164,7 @@ type QryBussinessJsExRsp struct {
 // @Security ApiKeyAuth
 // @Param UserId query int true "用户ID"
 // @Param relatedid query string false "现货合同ID, 不填则查所有"
+// @Param applystatus query string false "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回"
 // @Success 200 {array} QryBussinessJsExRsp
 // @Failure 500 {object} app.Response
 // @Router /Ermcp/QueryBusinessJsEx [get]
@@ -169,7 +173,7 @@ func QueryBusinessJsEx(c *gin.Context) {
 	appG := app.Gin{C: c}
 	var req QryOPApplyReq
 	_ = c.ShouldBind(&req)
-	m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId}
+	m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId, FilterAppStatus: req.Applystatus}
 	if d, err := m.GetData(2); err == nil {
 		//构建应答数据
 		sData := make([]QryBussinessJsExRsp, 0)
@@ -230,6 +234,7 @@ type QryBussinessKxRsp struct {
 // @Security ApiKeyAuth
 // @Param UserId query int true "用户ID"
 // @Param relatedid query string false "现货合同ID, 不填则查所有"
+// @Param applystatus query string false "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回"
 // @Success 200 {array} QryBussinessKxRsp
 // @Failure 500 {object} app.Response
 // @Router /Ermcp/QueryBusinessKx [get]
@@ -238,7 +243,7 @@ func QueryBusinessKx(c *gin.Context) {
 	appG := app.Gin{C: c}
 	var req QryOPApplyReq
 	_ = c.ShouldBind(&req)
-	m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId}
+	m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId, FilterAppStatus: req.Applystatus}
 	if d, err := m.GetData(3); err == nil {
 		//构建应答数据
 		sData := make([]QryBussinessKxRsp, 0)
@@ -270,6 +275,7 @@ type QryBussinessFpRsp struct {
 // @Security ApiKeyAuth
 // @Param UserId query int true "用户ID"
 // @Param relatedid query string false "现货合同ID, 不填则查所有"
+// @Param applystatus query string false "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回"
 // @Success 200 {array} QryBussinessFpRsp
 // @Failure 500 {object} app.Response
 // @Router /Ermcp/QueryBusinessFp [get]
@@ -278,7 +284,7 @@ func QueryBusinessFp(c *gin.Context) {
 	appG := app.Gin{C: c}
 	var req QryOPApplyReq
 	_ = c.ShouldBind(&req)
-	m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId}
+	m := models.ErmcpOPApplyModel{RELATEDID: req.RelatedId, USERID: req.UserId, FilterAppStatus: req.Applystatus}
 	if d, err := m.GetData(4); err == nil {
 		//构建应答数据
 		sData := make([]QryBussinessFpRsp, 0)

+ 30 - 0
docs/docs.go

@@ -1805,6 +1805,12 @@ var doc = `{
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1853,6 +1859,12 @@ var doc = `{
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1907,6 +1919,12 @@ var doc = `{
                         "description": "操作申请id",
                         "name": "operateapplyid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1955,6 +1973,12 @@ var doc = `{
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -2003,6 +2027,12 @@ var doc = `{
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {

+ 30 - 0
docs/swagger.json

@@ -1789,6 +1789,12 @@
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1837,6 +1843,12 @@
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1891,6 +1903,12 @@
                         "description": "操作申请id",
                         "name": "operateapplyid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1939,6 +1957,12 @@
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1987,6 +2011,12 @@
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {

+ 20 - 0
docs/swagger.yaml

@@ -11169,6 +11169,10 @@ paths:
         in: query
         name: relatedid
         type: string
+      - description: 申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        in: query
+        name: applystatus
+        type: string
       produces:
       - application/json
       responses:
@@ -11199,6 +11203,10 @@ paths:
         in: query
         name: relatedid
         type: string
+      - description: 申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        in: query
+        name: applystatus
+        type: string
       produces:
       - application/json
       responses:
@@ -11233,6 +11241,10 @@ paths:
         in: query
         name: operateapplyid
         type: string
+      - description: 申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        in: query
+        name: applystatus
+        type: string
       produces:
       - application/json
       responses:
@@ -11263,6 +11275,10 @@ paths:
         in: query
         name: relatedid
         type: string
+      - description: 申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        in: query
+        name: applystatus
+        type: string
       produces:
       - application/json
       responses:
@@ -11293,6 +11309,10 @@ paths:
         in: query
         name: relatedid
         type: string
+      - description: 申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        in: query
+        name: applystatus
+        type: string
       produces:
       - application/json
       responses:

+ 6 - 0
models/ermcpOPApply.go

@@ -42,6 +42,8 @@ type ErmcpOPApplyModel struct {
 	WRSTANDARDNAME   string  `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`     // 现货商品名称
 	WRSTANDARDCODE   string  `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`     // 现货商品代码
 	WRSTANDARDID     int     `json:"wrstandardid"  xorm:"'WRSTANDARDID'"`         // 现货商品id
+
+	FilterAppStatus string `json:"-"` // 状态过滤条件
 }
 
 func (r *ErmcpOPApplyModel) calc() {
@@ -115,6 +117,10 @@ func (r *ErmcpOPApplyModel) buildSql(opType int32) string {
 		sqlId += " and t.operateapplyid =" + r.OPERATEAPPLYID
 	}
 
+	if len(r.FilterAppStatus) > 0 {
+		sqlId += fmt.Sprintf(" and t.applystatus in(%v)", r.FilterAppStatus)
+	}
+
 	return fmt.Sprintf(sqlId, opType, r.USERID)
 }