Переглянути джерело

查现货合同接口修改查询条件

zou.yingbin 4 роки тому
батько
коміт
8247a7a5a3
5 змінених файлів з 13 додано та 12 видалено
  1. 1 1
      controllers/ermcp3/qryErmcp3.go
  2. 2 3
      docs/docs.go
  3. 2 3
      docs/swagger.json
  4. 1 2
      docs/swagger.yaml
  5. 7 3
      models/ermcp3.go

+ 1 - 1
controllers/ermcp3/qryErmcp3.go

@@ -108,7 +108,7 @@ type QryContractReq struct {
 // @Param userid query int true "用户id(当指定contractid, userid可不填)"
 // @Param usertype query int false "用户类型 2-机构 7-企业成员"
 // @Param contracttype query int false "合同类型 1-采购, -1-销售"
-// @Param querytype query int true "查询类型 1-未提交 2-待审核 3-履约中 4-已完成 (当指定contractid, querytype可不填)"
+// @Param querytype query int false "查询类型 1-未提交 2-待审核 3-履约中 4-已完成"
 // @Param contractid query string false "合同ID(SpotContractId)"
 // @Param contractno query string false "合同编号(模糊匹配)"
 // @Param wrstandardname query string false "商品名称(模糊匹配)"

+ 2 - 3
docs/docs.go

@@ -5160,10 +5160,9 @@ var doc = `{
                     },
                     {
                         "type": "integer",
-                        "description": "查询类型 1-未提交 2-待审核 3-履约中 4-已完成 (当指定contractid, querytype可不填)",
+                        "description": "查询类型 1-未提交 2-待审核 3-履约中 4-已完成",
                         "name": "querytype",
-                        "in": "query",
-                        "required": true
+                        "in": "query"
                     },
                     {
                         "type": "string",

+ 2 - 3
docs/swagger.json

@@ -5144,10 +5144,9 @@
                     },
                     {
                         "type": "integer",
-                        "description": "查询类型 1-未提交 2-待审核 3-履约中 4-已完成 (当指定contractid, querytype可不填)",
+                        "description": "查询类型 1-未提交 2-待审核 3-履约中 4-已完成",
                         "name": "querytype",
-                        "in": "query",
-                        "required": true
+                        "in": "query"
                     },
                     {
                         "type": "string",

+ 1 - 2
docs/swagger.yaml

@@ -22027,10 +22027,9 @@ paths:
         in: query
         name: contracttype
         type: integer
-      - description: 查询类型 1-未提交 2-待审核 3-履约中 4-已完成 (当指定contractid, querytype可不填)
+      - description: 查询类型 1-未提交 2-待审核 3-履约中 4-已完成
         in: query
         name: querytype
-        required: true
         type: integer
       - description: 合同ID(SpotContractId)
         in: query

+ 7 - 3
models/ermcp3.go

@@ -678,6 +678,8 @@ func (r *Ermcp3Contract) getQryTypeStatus() string {
 		status = "2"
 	case 4: // 已完成
 		status = "3,5"
+	default:
+		status = "0,1,2,3,4,5,6"
 	}
 	return status
 }
@@ -766,9 +768,11 @@ SELECT to_char(t.SPOTCONTRACTID) SPOTCONTRACTID,
 		sqlId.AndEx("t.CONTRACTTYPE", r.CONTRACTTYPE, r.CONTRACTTYPE != 0)
 		// 用户条件
 		sqlId.Join(fmt.Sprintf(" and %v in(t.userid, t.saleuserid, t.tradeuserid, t.meruserid, l.userid)", r.OwnUserId))
-		status := r.getQryTypeStatus()
-		if len(status) > 0 {
-			sqlId.Join(fmt.Sprintf(" and t.contractstatus in (%v)", status))
+		if r.QryType > 0 {
+			status := r.getQryTypeStatus()
+			if len(status) > 0 {
+				sqlId.Join(fmt.Sprintf(" and t.contractstatus in (%v)", status))
+			}
 		}
 	}
 	if r.CONTRACTNO != "" {