Selaa lähdekoodia

查询现货商品详情接口修改

zou.yingbin 4 vuotta sitten
vanhempi
commit
a57c93c84a
5 muutettua tiedostoa jossa 33 lisäystä ja 8 poistoa
  1. 1 1
      controllers/ermcp/qryGoods.go
  2. 8 0
      docs/docs.go
  3. 8 0
      docs/swagger.json
  4. 6 0
      docs/swagger.yaml
  5. 10 7
      models/ermcp3.go

+ 1 - 1
controllers/ermcp/qryGoods.go

@@ -45,7 +45,7 @@ func GetErmcpGoods(c *gin.Context) {
 	}
 
 	// 查询成功返回
-	logger.GetLogger().Debugln("GetErmcpGoods successed: %v", goodses)
+	//logger.GetLogger().Debugln("GetErmcpGoods successed: %v", goodses)
 	appG.Response(http.StatusOK, e.SUCCESS, goodses)
 }
 

+ 8 - 0
docs/docs.go

@@ -19998,6 +19998,10 @@ var doc = `{
                 "deliverygoodsid": {
                     "description": "品种ID",
                     "type": "integer"
+                },
+                "isvalid": {
+                    "description": "是否有效",
+                    "type": "integer"
                 }
             }
         },
@@ -36341,6 +36345,10 @@ var doc = `{
                 "brandname": {
                     "description": "品牌名称",
                     "type": "string"
+                },
+                "isvalid": {
+                    "description": "是否有效",
+                    "type": "integer"
                 }
             }
         },

+ 8 - 0
docs/swagger.json

@@ -19982,6 +19982,10 @@
                 "deliverygoodsid": {
                     "description": "品种ID",
                     "type": "integer"
+                },
+                "isvalid": {
+                    "description": "是否有效",
+                    "type": "integer"
                 }
             }
         },
@@ -36325,6 +36329,10 @@
                 "brandname": {
                     "description": "品牌名称",
                     "type": "string"
+                },
+                "isvalid": {
+                    "description": "是否有效",
+                    "type": "integer"
                 }
             }
         },

+ 6 - 0
docs/swagger.yaml

@@ -4573,6 +4573,9 @@ definitions:
       deliverygoodsid:
         description: 品种ID
         type: integer
+      isvalid:
+        description: 是否有效
+        type: integer
     type: object
   models.Ermcp3Contract:
     properties:
@@ -16696,6 +16699,9 @@ definitions:
       brandname:
         description: 品牌名称
         type: string
+      isvalid:
+        description: 是否有效
+        type: integer
     type: object
   models.XHDeliveryGoods:
     properties:

+ 10 - 7
models/ermcp3.go

@@ -132,10 +132,11 @@ func (r *ErmcpDGFactoryItem) GetData() (interface{}, error) {
 
 // Ermcp3Brand 品牌(从品种选择项定义表中查)
 type Ermcp3Brand struct {
-	BRANDID         int64  `json:"brandid"`         // 品牌id
-	BRANDNAME       string `json:"brandname"`       // 品牌名称
-	DELIVERYGOODSID int64  `json:"deliverygoodsid"` // 品种ID
-	AREAUSERID      int64  `json:"areauserid"`      // 用户id
+	BRANDID         int64  `json:"brandid"`                   // 品牌id
+	BRANDNAME       string `json:"brandname"`                 // 品牌名称
+	DELIVERYGOODSID int64  `json:"deliverygoodsid"`           // 品种ID
+	AREAUSERID      int64  `json:"areauserid"`                // 用户id
+	ISVALID         int32  `json:"isvalid"  xorm:"'ISVALID'"` // 是否有效
 }
 
 // GetDataEx
@@ -155,7 +156,7 @@ func (r *Ermcp3Brand) GetData() ([]Ermcp3Brand, error) {
 		if dgLst, ok := d.([]ErmcpDGFactoryItem); ok {
 			for _, val := range dgLst {
 				sData = append(sData, Ermcp3Brand{BRANDID: val.DGFACTORYITEMID, AREAUSERID: val.AREAUSERID,
-					BRANDNAME: val.DGFACTORYITEMVALUE, DELIVERYGOODSID: int64(val.DELIVERYGOODSID)})
+					BRANDNAME: val.DGFACTORYITEMVALUE, DELIVERYGOODSID: int64(val.DELIVERYGOODSID), ISVALID: val.ISVALID})
 			}
 		}
 	}
@@ -2466,6 +2467,7 @@ type XHBRAND struct {
 	BRANDNAME       string `json:"brandname"` // 品牌名称
 	DELIVERYGOODSID int64  `json:"-"`         // 品种ID
 	AREAUSERID      int64  `json:"-"`         // 用户id
+	ISVALID         int32  `json:"isvalid"`   // 是否有效
 }
 
 // GetDataEx 获取现货品种/品牌
@@ -2475,7 +2477,8 @@ func (r *XHBRAND) GetDataEx() (interface{}, error) {
 	d, err := m.GetData()
 	if err == nil {
 		for _, v := range d {
-			sData = append(sData, XHBRAND{DELIVERYGOODSID: v.DELIVERYGOODSID, BRANDID: v.BRANDID, BRANDNAME: v.BRANDNAME})
+			sData = append(sData, XHBRAND{DELIVERYGOODSID: v.DELIVERYGOODSID,
+				BRANDID: v.BRANDID, BRANDNAME: v.BRANDNAME, ISVALID: v.ISVALID})
 		}
 	}
 	return sData, err
@@ -3075,7 +3078,7 @@ select s.userid,
   left join useraccount u1
     on s.customeruserid = u1.userid
   left join enumdicitem e on w.unitid=e.enumitemname and e.enumdiccode='goodsunit'
- where 1 = 1 and t.middlegoodspricedqty3 > t.pricedqty
+ where 1 = 1 and t.middlegoodspricedqty > t.middlegoodspricedqty3
    and t.middlegoodsid in
        (select middlegoodsid from tmp where tmp.srcgoodsgroupid = %v)
 `