소스 검색

查询合同接口增加现货商品字段

zou.yingbin 4 년 전
부모
커밋
14fa84f3cf
4개의 변경된 파일77개의 추가작업 그리고 10개의 파일을 삭제
  1. 22 2
      docs/docs.go
  2. 22 2
      docs/swagger.json
  3. 17 2
      docs/swagger.yaml
  4. 16 4
      models/ermcp.go

+ 22 - 2
docs/docs.go

@@ -11951,7 +11951,7 @@ var doc = `{
                     "type": "string"
                 },
                 "deliverygoodscode": {
-                    "description": "现货品代码",
+                    "description": "现货品代码",
                     "type": "string"
                 },
                 "deliverygoodsid": {
@@ -11959,7 +11959,7 @@ var doc = `{
                     "type": "integer"
                 },
                 "deliverygoodsname": {
-                    "description": "现货品名称",
+                    "description": "现货品名称",
                     "type": "string"
                 },
                 "deliverystartdate": {
@@ -12097,6 +12097,18 @@ var doc = `{
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },
@@ -12871,9 +12883,17 @@ var doc = `{
                     "description": "机构ID",
                     "type": "integer"
                 },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
                 "wrstandardid": {
                     "description": "现货商品ID",
                     "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },

+ 22 - 2
docs/swagger.json

@@ -11935,7 +11935,7 @@
                     "type": "string"
                 },
                 "deliverygoodscode": {
-                    "description": "现货品代码",
+                    "description": "现货品代码",
                     "type": "string"
                 },
                 "deliverygoodsid": {
@@ -11943,7 +11943,7 @@
                     "type": "integer"
                 },
                 "deliverygoodsname": {
-                    "description": "现货品名称",
+                    "description": "现货品名称",
                     "type": "string"
                 },
                 "deliverystartdate": {
@@ -12081,6 +12081,18 @@
                 "userid": {
                     "description": "用户ID",
                     "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },
@@ -12855,9 +12867,17 @@
                     "description": "机构ID",
                     "type": "integer"
                 },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
                 "wrstandardid": {
                     "description": "现货商品ID",
                     "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
                 }
             }
         },

+ 17 - 2
docs/swagger.yaml

@@ -3795,13 +3795,13 @@ definitions:
         description: 交割结束日
         type: string
       deliverygoodscode:
-        description: 现货品代码
+        description: 现货品代码
         type: string
       deliverygoodsid:
         description: 现货商品ID
         type: integer
       deliverygoodsname:
-        description: 现货品名称
+        description: 现货品名称
         type: string
       deliverystartdate:
         description: 交割开始日
@@ -3905,6 +3905,15 @@ definitions:
       userid:
         description: 用户ID
         type: integer
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
+      wrstandardid:
+        description: 现货商品ID
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
     type: object
   models.ErmcpOPLogModel:
     properties:
@@ -4477,9 +4486,15 @@ definitions:
       userid:
         description: 机构ID
         type: integer
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
       wrstandardid:
         description: 现货商品ID
         type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
     type: object
   models.ErmcpUserModel:
     properties:

+ 16 - 4
models/ermcp.go

@@ -26,6 +26,8 @@ type ErmcpSpotContractModel struct {
 	SELLUSERNAME      string  `json:"sellusername"  xorm:"'SELLUSERNAME'"`           // 销售方名称
 	DELIVERYGOODSID   int32   `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`     // 现货品种ID
 	WRSTANDARDID      int32   `json:"wrstandardid"  xorm:"'wrstandardid'"`           // 现货商品ID
+	WRSTANDARDNAME    string  `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`       // 现货商品名称
+	WRSTANDARDCODE    string  `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`       // 现货商品代码
 	DELIVERYGOODSCODE string  `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"` // 现货品种代码
 	DELIVERYGOODSNAME string  `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"` // 现货品种名称
 	PRODUCTTYPE       int32   `json:"producttype"  xorm:"'PRODUCTTYPE'"`             // 产品类型 - 1:标准仓单 2:等标 3:非标
@@ -100,7 +102,9 @@ func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
 		"       g2.goodsname," +
 		"       gb.brandname," +
 		"       gm.modelname," +
-		"       e.Enumdicname" +
+		"       e.Enumdicname," +
+		"       w.wrstandardname," +
+		"       w.wrstandardcode" +
 		"  FROM ERMCP_SPOTCONTRACT t" +
 		"  left join useraccount u1" +
 		"    on t.buyuserid = u1.userid" +
@@ -112,8 +116,10 @@ func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
 		"    on t.goodsid = g2.goodsid" +
 		"    left join spotgoodsbrand gb on t.spotgoodsbrandid=gb.brandid" +
 		"    left join spotgoodsmodel gm on t.spotgoodsmodelid=gm.modelid" +
+		"  left join wrstandard w" +
+		"    on t.wrstandardid = w.wrstandardid" +
 		"  left join enumdicitem e" +
-		"    on g.goodsunitid = e.enumitemname" +
+		"    on w.unitid = e.enumitemname" +
 		"   and e.enumdiccode = 'goodsunit'" +
 		" where t.contractstatus in (%v)" +
 		"   and t.userid = %v"
@@ -157,8 +163,8 @@ type ErmcpModel struct {
 	SpotContractId     string  `json:"spotcontractid"  xorm:"'SPOTCONTRACTID'"`         // 合同ID
 	AccountName        string  `json:"accountname"  xorm:"'ACCOUNTNAME'"`               // 账户名称
 	DeliveryGoodsId    int     `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`       // 现货商品ID
-	DeliveryGoodsCode  string  `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"`   // 现货品代码
-	DeliveryGoodsName  string  `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"`   // 现货品名称
+	DeliveryGoodsCode  string  `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"`   // 现货品代码
+	DeliveryGoodsName  string  `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"`   // 现货品名称
 	SpotGoodsdesc      string  `json:"spotgoodsdesc"  xorm:"'SPOTGOODSDESC'"`           // 商品型号(商品规格)
 	GoodsId            int     `json:"goodsid"  xorm:"'GOODSID'"`                       // 点价商品ID
 	GOODSNAME          string  `json:"goodsname"  xorm:"'GOODSNAME'"`                   // 点价商品名称
@@ -204,6 +210,9 @@ type ErmcpModel struct {
 	SPOTGOODSBRANDID   int32   `json:"spotgoodsbrandid"  xorm:"'SPOTGOODSBRANDID'"`     // 现货品牌ID
 	BRANDNAME          string  `json:"brandname"  xorm:"'brandname'"`                   // 品牌名称
 	MODELNAME          string  `json:"modelname"  xorm:"'modelname'"`                   // 型号名称
+	WRSTANDARDID       int64   `json:"wrstandardid"  xorm:"'WRSTANDARDID'"`             // 现货商品ID
+	WRSTANDARDNAME     string  `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`         // 现货商品名称
+	WRSTANDARDCODE     string  `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`         // 现货商品代码
 }
 
 func (r *ErmcpModel) calc() {
@@ -260,6 +269,9 @@ func (r *ErmcpModel) buildSql(nContractType, nQueryType int32) string {
 		"       u.accountname," +
 		"       g.deliverygoodscode," +
 		"       g.deliverygoodsname," +
+		"       wr.wrstandardid," +
+		"       wr.wrstandardname," +
+		"       wr.wrstandardcode," +
 		"       g2.goodscode," +
 		"       g2.goodsname," +
 		"       gb.brandname," +