Explorar o código

查品种品类筛选框只显示可交易的品类

zou.yingbin %!s(int64=4) %!d(string=hai) anos
pai
achega
c75ec54cbf
Modificáronse 5 ficheiros con 33 adicións e 19 borrados
  1. 4 0
      docs/docs.go
  2. 4 0
      docs/swagger.json
  3. 3 0
      docs/swagger.yaml
  4. 21 18
      models/ermcp3.go
  5. 1 1
      models/wrTrade2.go

+ 4 - 0
docs/docs.go

@@ -19513,6 +19513,10 @@ var doc = `{
                     "description": "所属机构",
                     "type": "integer"
                 },
+                "cantrade": {
+                    "description": "是否允许交易 - 0:不允许 1:允许 -1:未配置(数据库里没有记录)",
+                    "type": "integer"
+                },
                 "convertfactor": {
                     "description": "标仓系数",
                     "type": "number"

+ 4 - 0
docs/swagger.json

@@ -19497,6 +19497,10 @@
                     "description": "所属机构",
                     "type": "integer"
                 },
+                "cantrade": {
+                    "description": "是否允许交易 - 0:不允许 1:允许 -1:未配置(数据库里没有记录)",
+                    "type": "integer"
+                },
                 "convertfactor": {
                     "description": "标仓系数",
                     "type": "number"

+ 3 - 0
docs/swagger.yaml

@@ -5451,6 +5451,9 @@ definitions:
       areauserid:
         description: 所属机构
         type: integer
+      cantrade:
+        description: 是否允许交易 - 0:不允许 1:允许 -1:未配置(数据库里没有记录)
+        type: integer
       convertfactor:
         description: 标仓系数
         type: number

+ 21 - 18
models/ermcp3.go

@@ -1305,6 +1305,7 @@ type Ermcp3Wrstandard struct {
 	UPDATETIME      string  `json:"updatetime"  xorm:"'UPDATETIME'"`           // 更新时间
 	REMARK          string  `json:"remark"  xorm:"'REMARK'"`                   // 备注
 	CONVERTFACTOR   float64 `json:"convertfactor"  xorm:"'CONVERTFACTOR'"`     // 标仓系数
+	CANTRADE        int32   `json:"cantrade"  xorm:"'CANTRADE'"`               // 是否允许交易 - 0:不允许 1:允许 -1:未配置(数据库里没有记录)
 }
 
 func (r *Ermcp3Wrstandard) calc() {
@@ -1312,29 +1313,31 @@ func (r *Ermcp3Wrstandard) calc() {
 }
 
 func (r *Ermcp3Wrstandard) buildSql() string {
-	sqlId := "select WRSTANDARDID," +
-		"       WRSTANDARDCODE," +
-		"       DELIVERYGOODSID," +
-		"       UNITID," +
-		"       MINIVALUE," +
-		"       MINIVALUEDP," +
-		"       REALMINIVALUE," +
-		"       REALMINIVALUEDP," +
-		"       CREATORID," +
-		"       to_char(CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME," +
-		"       WRSTANDARDNAME," +
-		"       ISVALID," +
-		"       to_char(UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
-		"       REMARK," +
-		"       CONVERTFACTOR," +
-		"       AREAUSERID" +
+	sqlId := "select t.WRSTANDARDID," +
+		"       t.WRSTANDARDCODE," +
+		"       t.DELIVERYGOODSID," +
+		"       t.UNITID," +
+		"       t.MINIVALUE," +
+		"       t.MINIVALUEDP," +
+		"       t.REALMINIVALUE," +
+		"       t.REALMINIVALUEDP," +
+		"       t.CREATORID," +
+		"       to_char(t.CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME," +
+		"       t.WRSTANDARDNAME," +
+		"       t.ISVALID," +
+		"       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
+		"       t.REMARK," +
+		"       t.CONVERTFACTOR," +
+		"       t.AREAUSERID," +
+		"       nvl(m.cantrade,-1) cantrade" +
 		"  from wrstandard t" +
-		" where 1=1"
+		"  left join marketspotgoodsconfig m on t.wrstandardid = m.wrstandardid" +
+		" where 1 = 1"
 	if r.AREAUSERID > 0 {
 		sqlId += fmt.Sprintf(" and t.AREAUSERID=%v", r.AREAUSERID)
 	}
 	if r.DELIVERYGOODSID > 0 {
-		sqlId = sqlId + fmt.Sprintf(" and DELIVERYGOODSID=%v", r.DELIVERYGOODSID)
+		sqlId = sqlId + fmt.Sprintf(" and t.DELIVERYGOODSID=%v", r.DELIVERYGOODSID)
 	}
 	sqlId += " order by createtime desc"
 	return sqlId

+ 1 - 1
models/wrTrade2.go

@@ -1786,7 +1786,7 @@ func (r *WrFtDeliveryGoods) GetDataEx() (interface{}, error) {
 						WDLST:             make([]WrFtWrstandard, 0),
 					}
 					for _, a := range sMd {
-						if a.DELIVERYGOODSID == item.DELIVERYGOODSID {
+						if a.DELIVERYGOODSID == item.DELIVERYGOODSID && a.CANTRADE == 1 {
 							val := WrFtWrstandard{
 								WRSTANDARDID:   a.WRSTANDARDID,
 								WRSTANDARDNAME: a.WRSTANDARDNAME,