Просмотр исходного кода

1.查询企业风管合同增加类型条件
2.fix bug: 仓单贸易挂单不显示待冻结,报价牌不显示部成单

zou.yingbin 4 лет назад
Родитель
Сommit
81bb8227e4
6 измененных файлов с 24 добавлено и 6 удалено
  1. 2 1
      controllers/ermcp3/qryErmcp3.go
  2. 6 0
      docs/docs.go
  3. 6 0
      docs/swagger.json
  4. 4 0
      docs/swagger.yaml
  5. 1 0
      models/ermcp3.go
  6. 5 5
      models/wrTrade2.go

+ 2 - 1
controllers/ermcp3/qryErmcp3.go

@@ -105,6 +105,7 @@ type QryContractReq struct {
 // @Security ApiKeyAuth
 // @Param userid query int true "用户id"
 // @Param usertype query int false "用户类型 2-机构 7-企业成员"
+// @Param contracttype query int false "合同类型 1-采购, -1-销售"
 // @Param querytype query int true "查询类型 1-未提交 2-待审核 3-履约中 4-已完成"
 // @Param contractid query string false "合同ID(SpotContractId)"
 // @Success 200 {array} models.Ermcp3Contract
@@ -116,7 +117,7 @@ func QuerySpotContract(c *gin.Context) {
 	req := QryContractReq{}
 	a.DoBindReq(&req)
 	m := models.Ermcp3Contract{USERID: mtpcache.GetAreaUserId(req.USERID, req.USERTYPE),
-		QryType:   req.QUERYTYPE,
+		QryType: req.QUERYTYPE, CONTRACTTYPE: req.CONTRACTTYPE,
 		OwnUserId: req.USERID, UserType: req.USERTYPE, SPOTCONTRACTID: req.CONTRACTID}
 	a.DoGetDataI(&m)
 }

+ 6 - 0
docs/docs.go

@@ -4659,6 +4659,12 @@ var doc = `{
                     },
                     {
                         "type": "integer",
+                        "description": "合同类型 1-采购, -1-销售",
+                        "name": "contracttype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
                         "description": "查询类型 1-未提交 2-待审核 3-履约中 4-已完成",
                         "name": "querytype",
                         "in": "query",

+ 6 - 0
docs/swagger.json

@@ -4643,6 +4643,12 @@
                     },
                     {
                         "type": "integer",
+                        "description": "合同类型 1-采购, -1-销售",
+                        "name": "contracttype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
                         "description": "查询类型 1-未提交 2-待审核 3-履约中 4-已完成",
                         "name": "querytype",
                         "in": "query",

+ 4 - 0
docs/swagger.yaml

@@ -20988,6 +20988,10 @@ paths:
         in: query
         name: usertype
         type: integer
+      - description: 合同类型 1-采购, -1-销售
+        in: query
+        name: contracttype
+        type: integer
       - description: 查询类型 1-未提交 2-待审核 3-履约中 4-已完成
         in: query
         name: querytype

+ 1 - 0
models/ermcp3.go

@@ -757,6 +757,7 @@ SELECT to_char(t.SPOTCONTRACTID) SPOTCONTRACTID,
  where 1 = 1
 `
 	sqlId.AndEx("t.SPOTCONTRACTID", r.SPOTCONTRACTID, len(r.SPOTCONTRACTID) > 0)
+	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()

+ 5 - 5
models/wrTrade2.go

@@ -77,7 +77,7 @@ func (r *WrOrderQuote) buildSqlFixedPrice() string {
 		"                  nvl(t.deliverymonth,'0') deliverymonth," +
 		"                  rank() over(partition by t.wrfactortypeid, nvl(t.deliverymonth,'0') order by t.fixedprice desc) cnt" +
 		"             from wrtrade_orderdetail t" +
-		"            where t.wrtradetype = 1 and t.isspecified=0 and t.buyorsell = 0 and t.wrtradeorderstatus in(3,10) %v" +
+		"            where t.wrtradetype = 1 and t.isspecified=0 and t.buyorsell = 0 and t.wrtradeorderstatus in(3,7) %v" +
 		"          ) a" +
 		"   where a.cnt = 1" +
 		"   group by a.wrfactortypeid, a.fixedprice, a.deliverymonth)," +
@@ -92,7 +92,7 @@ func (r *WrOrderQuote) buildSqlFixedPrice() string {
 		"                  nvl(t.deliverymonth,'0') deliverymonth," +
 		"                  rank() over(partition by t.wrfactortypeid, nvl(t.deliverymonth,'0') order by t.fixedprice asc) cnt" +
 		"             from wrtrade_orderdetail t" +
-		"            where t.wrtradetype = 1 and t.isspecified=0 and t.buyorsell = 1 and t.wrtradeorderstatus in(3,10) %v " +
+		"            where t.wrtradetype = 1 and t.isspecified=0 and t.buyorsell = 1 and t.wrtradeorderstatus in(3,7) %v " +
 		"          ) a" +
 		"   where a.cnt = 1" +
 		"   group by a.wrfactortypeid, a.fixedprice, a.deliverymonth)," +
@@ -176,7 +176,7 @@ func (r *WrOrderQuote) buildSqlPriceMove() string {
 		"            from wrtrade_orderdetail t" +
 		"            left join WRTrade_GoodsConfig c" +
 		"              on t.wrtradeorderid = c.wrtradeorderid" +
-		"           where t.wrtradetype = 1 and t.isspecified=0 and t.wrtradeorderstatus in(3,10)" +
+		"           where t.wrtradetype = 1 and t.isspecified=0 and t.wrtradeorderstatus in(3, 7)" +
 		"             and t.buyorsell = 0 %v) a" +
 		"   where a.cnt = 1" +
 		"   group by a.wrfactortypeid, a.pricemove, a.goodsid, a.goodscode, a.deliverymonth)," +
@@ -199,7 +199,7 @@ func (r *WrOrderQuote) buildSqlPriceMove() string {
 		"            from wrtrade_orderdetail t" +
 		"            left join WRTrade_GoodsConfig c" +
 		"              on t.wrtradeorderid = c.wrtradeorderid" +
-		"           where t.wrtradetype = 1 and t.isspecified=0 and t.wrtradeorderstatus in(3,10)" +
+		"           where t.wrtradetype = 1 and t.isspecified=0 and t.wrtradeorderstatus in(3, 7)" +
 		"             and t.buyorsell = 1 %v) a" +
 		"   where a.cnt = 1" +
 		"   group by a.wrfactortypeid, a.pricemove, a.goodsid, a.goodscode, a.deliverymonth)," +
@@ -776,7 +776,7 @@ select t.HASWR,
     on t.wrtradeorderid = mr.wrtradeorderid
   left join taaccount ta
     on t.accountid = ta.accountid
- where t.WRTRADETYPE = 1
+ where t.WRTRADETYPE = 1 and t.WRTRADEORDERSTATUS not in(2)
 `
 	sqlId.And("t.USERID", r.USERID)
 	sqlId.And("t.haswr", r.HASWR)