Bladeren bron

查合同操作增加状态过淲条件

zou.yingbin 4 jaren geleden
bovenliggende
commit
d3da1d1152
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

@@ -1792,6 +1792,12 @@ var doc = `{
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1840,6 +1846,12 @@ var doc = `{
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1894,6 +1906,12 @@ var doc = `{
                         "description": "操作申请id",
                         "name": "operateapplyid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1942,6 +1960,12 @@ var doc = `{
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1990,6 +2014,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

@@ -1776,6 +1776,12 @@
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1824,6 +1830,12 @@
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1878,6 +1890,12 @@
                         "description": "操作申请id",
                         "name": "operateapplyid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1926,6 +1944,12 @@
                         "description": "现货合同ID, 不填则查所有",
                         "name": "relatedid",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "applystatus",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -1974,6 +1998,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

@@ -10878,6 +10878,10 @@ paths:
         in: query
         name: relatedid
         type: string
+      - description: 申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        in: query
+        name: applystatus
+        type: string
       produces:
       - application/json
       responses:
@@ -10908,6 +10912,10 @@ paths:
         in: query
         name: relatedid
         type: string
+      - description: 申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        in: query
+        name: applystatus
+        type: string
       produces:
       - application/json
       responses:
@@ -10942,6 +10950,10 @@ paths:
         in: query
         name: operateapplyid
         type: string
+      - description: 申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        in: query
+        name: applystatus
+        type: string
       produces:
       - application/json
       responses:
@@ -10972,6 +10984,10 @@ paths:
         in: query
         name: relatedid
         type: string
+      - description: 申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        in: query
+        name: applystatus
+        type: string
       produces:
       - application/json
       responses:
@@ -11002,6 +11018,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)
 }