Ver Fonte

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

zhou.xiaoning há 4 anos atrás
pai
commit
0026923c00
5 ficheiros alterados com 44 adições e 12 exclusões
  1. 2 1
      controllers/ermcp3/qryErmcp3.go
  2. 12 3
      docs/docs.go
  3. 12 3
      docs/swagger.json
  4. 8 2
      docs/swagger.yaml
  5. 10 3
      models/ermcp3.go

+ 2 - 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 "商品名称(模糊匹配)"
@@ -564,6 +564,7 @@ func QueryPaTradeLink(c *gin.Context) {
 // @Param userid query int true "用户ID(填登录用户的userid)"
 // @Param buyorsell query int true "买卖方向 0-买 1-卖"
 // @Param goodsgroupid query int true "商品组id"
+// @Param biztype query int false "业务类型  1:套保 2:套利"
 // @Param contractno query string false "现货编号(模糊匹配)"
 // @Param customername query string false "对手方(模糊匹配)"
 // @Param wrstandardname query string false "现货商品名称(模糊匹配)"

+ 12 - 3
docs/docs.go

@@ -5081,6 +5081,12 @@ var doc = `{
                         "required": true
                     },
                     {
+                        "type": "integer",
+                        "description": "业务类型  1:套保 2:套利",
+                        "name": "biztype",
+                        "in": "query"
+                    },
+                    {
                         "type": "string",
                         "description": "现货编号(模糊匹配)",
                         "name": "contractno",
@@ -5154,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",
@@ -22072,6 +22077,10 @@ var doc = `{
         "models.Ermcp3SCMiddleGoods": {
             "type": "object",
             "properties": {
+                "biztype": {
+                    "description": "业务类型 1:套保 2:套利",
+                    "type": "integer"
+                },
                 "contractno": {
                     "description": "合同编号",
                     "type": "string"

+ 12 - 3
docs/swagger.json

@@ -5065,6 +5065,12 @@
                         "required": true
                     },
                     {
+                        "type": "integer",
+                        "description": "业务类型  1:套保 2:套利",
+                        "name": "biztype",
+                        "in": "query"
+                    },
+                    {
                         "type": "string",
                         "description": "现货编号(模糊匹配)",
                         "name": "contractno",
@@ -5138,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",
@@ -22056,6 +22061,10 @@
         "models.Ermcp3SCMiddleGoods": {
             "type": "object",
             "properties": {
+                "biztype": {
+                    "description": "业务类型 1:套保 2:套利",
+                    "type": "integer"
+                },
                 "contractno": {
                     "description": "合同编号",
                     "type": "string"

+ 8 - 2
docs/swagger.yaml

@@ -6105,6 +6105,9 @@ definitions:
     type: object
   models.Ermcp3SCMiddleGoods:
     properties:
+      biztype:
+        description: 业务类型 1:套保 2:套利
+        type: integer
       contractno:
         description: 合同编号
         type: string
@@ -21974,6 +21977,10 @@ paths:
         name: goodsgroupid
         required: true
         type: integer
+      - description: 业务类型  1:套保 2:套利
+        in: query
+        name: biztype
+        type: integer
       - description: 现货编号(模糊匹配)
         in: query
         name: contractno
@@ -22020,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

+ 10 - 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 != "" {
@@ -3045,6 +3049,7 @@ type Ermcp3SCMiddleGoods struct {
 	DELIVERYGOODSCODE     string  `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"`                 // 现货品种代码
 	DELIVERYGOODSNAME     string  `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"`                 //	现货品种名称
 	ENUMDICNAME           string  `json:"enumdicname"  xorm:"'ENUMDICNAME'"`                             // 现货单位名称
+	BIZTYPE               int     `json:"biztype"  xorm:"'BIZTYPE'" form:"biztype"`                      // 业务类型 1:套保 2:套利
 
 	BUYORSELL    int32 `json:"-" form:"buyorsell"`    // 买卖方向, 用作筛选
 	GOODSGROUPID int32 `json:"-" form:"goodsgroupid"` // 期货商品组id, 用作筛选
@@ -3070,6 +3075,7 @@ select s.userid,
        u1.accountname customername,
        s.contractno,
        s.contracttype,
+       s.biztype,
        to_char(s.spotcontractid) spotcontractid,
        w.wrstandardid,
        w.wrstandardcode,
@@ -3107,6 +3113,7 @@ select s.userid,
 		r.CONTRACTTYPE = 1
 	}
 	sqlId.And("s.CONTRACTTYPE", r.CONTRACTTYPE)
+	sqlId.AndEx("s.biztype", r.BIZTYPE, r.BIZTYPE > 0)
 	sqlId.JoinFormat(" and %v in(s.userid, s.tradeuserid, s.saleuserid, s.tradeuserid)", r.USERID)
 	sqlId.AndLike("s.contractno", r.CONTRACTNO)
 	sqlId.AndLike("u1.accountname", r.CUSTOMERNAME)