Преглед изворни кода

查询待审核合同增加品种ID字段

zou.yingbin пре 5 година
родитељ
комит
e62b2ffba6
4 измењених фајлова са 28 додато и 34 уклоњено
  1. 10 6
      controllers/erms3/qryContract.go
  2. 6 10
      docs/docs.go
  3. 6 10
      docs/swagger.json
  4. 6 8
      docs/swagger.yaml

+ 10 - 6
controllers/erms3/qryContract.go

@@ -112,20 +112,21 @@ type QryAuditContractRsp struct {
 	AccountId         string  `json:"accountid"  xorm:"'ACCOUNTID'"`                                    // 交易员ID
 	CustomerName      string  `json:"customername"  xorm:"'CUSTOMERNAME'"`                              // 采购方ID
 	WrstandardName    string  `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`                          // 商品名称
-	Wrstandardcode    string  `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`                          // 商品代码
+	Wrstandardcode    string  `json:"-"`                                                                // 商品代码
 	PricedQty         float64 `json:"pricedqty"  xorm:"'PRICEDQTY'"`                                    // 定价量
 	UnpricedQty       float64 `json:"unpricedqty"  xorm:"'UNPRICEDQTY'"`                                // 未定价量
 	TotaldQty         float64 `json:"totaldqty"  xorm:"'TOTALDQTY'"`                                    // 合同量
 	DeliveryQty       uint64  `json:"deliveryqty"  xorm:"'DELIVERYQTY'"`                                // 交收量
 	CurDeliveryQty    uint64  `json:"curdeliveryqty"  xorm:"'CURDELIVERYQTY'"`                          // 未交收量
-	DeliveryGoodsName string  `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"`                    // 品种名称
-	DeliveryGoodscode string  `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"`                    // 品种代码
+	DeliveryGoodsID   string  `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`                        // 品种ID
+	DeliveryGoodsName string  `json:"-"`                                                                // 品种名称
+	DeliveryGoodscode string  `json:"-"`                                                                // 品种代码
 	ApplyStatus       uint32  `json:"applystatus"  xorm:"'APPLYSTATUS'"`                                // 状态
 	EnumdicName       string  `json:"enumdicname"  xorm:"'ENUMDICNAME'"`                                // 单位名称
 	SignDate          string  `json:"signdate"  xorm:"'SIGNDATE'"`                                      // 签订日期
 
-	deliverGoods map[int32]models.Deliverygoods     // 不参与json编码,作为id转code缓存
-	wrStandards  map[int64]models.WRStandardInfo    // 不参与json编码,作为id转code缓存
+	deliverGoods map[int32]models.Deliverygoods  // 不参与json编码,作为id转code缓存
+	wrStandards  map[int64]models.WRStandardInfo // 不参与json编码,作为id转code缓存
 }
 
 // 转换交割商品ID为商品代码
@@ -212,6 +213,9 @@ func (r *QryAuditContractRsp) ParseFromModel(val models.AuditContractModel) erro
 	// 转换交割商品ID为商品代码
 	r.DeliveryGoodscode = r.DeliverGoodsId2Code(int32(detail.DeliveryGoodsID))
 
+	r.WrstandardName = r.WrstandardName + "/" + r.Wrstandardcode
+	r.DeliveryGoodsID = r.DeliveryGoodsName + "/" + r.DeliveryGoodscode
+
 	return nil
 }
 
@@ -222,7 +226,7 @@ func (r *QryAuditContractRsp) ParseFromHGModel(val models.AutditContractHGModel)
 	r.AccountId = val.AccountId
 	r.CustomerName = val.CustomerName
 	r.EnumdicName = val.EnumdicName
-	r.WrstandardName = val.WrstandardName
+	r.WrstandardName = val.WrstandardName + "/" + val.Wrstandardcode
 	r.Wrstandardcode = val.Wrstandardcode
 	r.ApplyStatus = val.ApplyStatus
 	r.SignDate = val.SignDate

+ 6 - 10
docs/docs.go

@@ -20,6 +20,7 @@ var doc = `{
         "title": "{{.Title}}",
         "termsOfService": "http://muchinfo.cn",
         "contact": {},
+        "license": {},
         "version": "{{.Version}}"
     },
     "host": "{{.Host}}",
@@ -3264,6 +3265,7 @@ var doc = `{
                 },
                 "province": {
                     "description": "省",
+                    "type": "object",
                     "$ref": "#/definitions/models.Division"
                 }
             }
@@ -5186,12 +5188,8 @@ var doc = `{
                     "description": "采购方ID",
                     "type": "string"
                 },
-                "deliverygoodscode": {
-                    "description": "品种代码",
-                    "type": "string"
-                },
-                "deliverygoodsname": {
-                    "description": "品种名称",
+                "deliverygoodsid": {
+                    "description": "品种ID",
                     "type": "string"
                 },
                 "deliveryqty": {
@@ -5230,10 +5228,6 @@ var doc = `{
                     "description": "未定价量",
                     "type": "number"
                 },
-                "wrstandardcode": {
-                    "description": "商品代码",
-                    "type": "string"
-                },
                 "wrstandardname": {
                     "description": "商品名称",
                     "type": "string"
@@ -5328,6 +5322,7 @@ var doc = `{
                 },
                 "ouruser": {
                     "description": "我方账号",
+                    "type": "object",
                     "$ref": "#/definitions/erms3.CustomerInfo"
                 },
                 "warehouseinfos": {
@@ -5655,6 +5650,7 @@ var doc = `{
                 },
                 "province": {
                     "description": "省",
+                    "type": "object",
                     "$ref": "#/definitions/models.Division"
                 }
             }

+ 6 - 10
docs/swagger.json

@@ -5,6 +5,7 @@
         "title": "MTP2.0 查询服务 API",
         "termsOfService": "http://muchinfo.cn",
         "contact": {},
+        "license": {},
         "version": "1.0"
     },
     "basePath": "/api",
@@ -3248,6 +3249,7 @@
                 },
                 "province": {
                     "description": "省",
+                    "type": "object",
                     "$ref": "#/definitions/models.Division"
                 }
             }
@@ -5170,12 +5172,8 @@
                     "description": "采购方ID",
                     "type": "string"
                 },
-                "deliverygoodscode": {
-                    "description": "品种代码",
-                    "type": "string"
-                },
-                "deliverygoodsname": {
-                    "description": "品种名称",
+                "deliverygoodsid": {
+                    "description": "品种ID",
                     "type": "string"
                 },
                 "deliveryqty": {
@@ -5214,10 +5212,6 @@
                     "description": "未定价量",
                     "type": "number"
                 },
-                "wrstandardcode": {
-                    "description": "商品代码",
-                    "type": "string"
-                },
                 "wrstandardname": {
                     "description": "商品名称",
                     "type": "string"
@@ -5312,6 +5306,7 @@
                 },
                 "ouruser": {
                     "description": "我方账号",
+                    "type": "object",
                     "$ref": "#/definitions/erms3.CustomerInfo"
                 },
                 "warehouseinfos": {
@@ -5639,6 +5634,7 @@
                 },
                 "province": {
                     "description": "省",
+                    "type": "object",
                     "$ref": "#/definitions/models.Division"
                 }
             }

+ 6 - 8
docs/swagger.yaml

@@ -87,6 +87,7 @@ definitions:
       province:
         $ref: '#/definitions/models.Division'
         description: 省
+        type: object
     type: object
   common.QueryTableDefineRsp:
     properties:
@@ -1523,11 +1524,8 @@ definitions:
       customername:
         description: 采购方ID
         type: string
-      deliverygoodscode:
-        description: 品种代码
-        type: string
-      deliverygoodsname:
-        description: 品种名称
+      deliverygoodsid:
+        description: 品种ID
         type: string
       deliveryqty:
         description: 交收量
@@ -1556,9 +1554,6 @@ definitions:
       unpricedqty:
         description: 未定价量
         type: number
-      wrstandardcode:
-        description: 商品代码
-        type: string
       wrstandardname:
         description: 商品名称
         type: string
@@ -1632,6 +1627,7 @@ definitions:
       ouruser:
         $ref: '#/definitions/erms3.CustomerInfo'
         description: 我方账号
+        type: object
       warehouseinfos:
         description: 仓库信息列表
         items:
@@ -1871,6 +1867,7 @@ definitions:
       province:
         $ref: '#/definitions/models.Division'
         description: 省
+        type: object
     type: object
   models.Division:
     properties:
@@ -4614,6 +4611,7 @@ definitions:
 info:
   contact: {}
   description: 新的查询服务,替代原通用查询服务。
+  license: {}
   termsOfService: http://muchinfo.cn
   title: MTP2.0 查询服务 API
   version: "1.0"