Przeglądaj źródła

查现货合同增加字段:型号名称,品牌名称,
审核意见,创建时间,现货商品id

zou.yingbin 4 lat temu
rodzic
commit
2af2abfcc7
4 zmienionych plików z 108 dodań i 38 usunięć
  1. 20 0
      docs/docs.go
  2. 20 0
      docs/swagger.json
  3. 15 0
      docs/swagger.yaml
  4. 53 38
      models/ermcp.go

+ 20 - 0
docs/docs.go

@@ -9533,10 +9533,18 @@ var doc = `{
                     "description": "金额 [1:一口价、3:暂定价]",
                     "type": "number"
                 },
+                "auditremark": {
+                    "description": "审核意见",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
                 },
+                "brandname": {
+                    "description": "品牌名称",
+                    "type": "string"
+                },
                 "buyuserid": {
                     "description": "采购方ID",
                     "type": "integer"
@@ -9565,6 +9573,10 @@ var doc = `{
                     "description": "标仓系数",
                     "type": "number"
                 },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
                 "deliveryenddate": {
                     "description": "交收期(结束)",
                     "type": "string"
@@ -9605,6 +9617,10 @@ var doc = `{
                     "description": "当前保证金",
                     "type": "number"
                 },
+                "modelname": {
+                    "description": "型号名称",
+                    "type": "string"
+                },
                 "price": {
                     "description": "价格\\暂定价 [1:一口价、3:暂定价]",
                     "type": "number"
@@ -9660,6 +9676,10 @@ var doc = `{
                 "userid": {
                     "description": "机构ID",
                     "type": "integer"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
                 }
             }
         },

+ 20 - 0
docs/swagger.json

@@ -9517,10 +9517,18 @@
                     "description": "金额 [1:一口价、3:暂定价]",
                     "type": "number"
                 },
+                "auditremark": {
+                    "description": "审核意见",
+                    "type": "string"
+                },
                 "audittime": {
                     "description": "审核时间",
                     "type": "string"
                 },
+                "brandname": {
+                    "description": "品牌名称",
+                    "type": "string"
+                },
                 "buyuserid": {
                     "description": "采购方ID",
                     "type": "integer"
@@ -9549,6 +9557,10 @@
                     "description": "标仓系数",
                     "type": "number"
                 },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
                 "deliveryenddate": {
                     "description": "交收期(结束)",
                     "type": "string"
@@ -9589,6 +9601,10 @@
                     "description": "当前保证金",
                     "type": "number"
                 },
+                "modelname": {
+                    "description": "型号名称",
+                    "type": "string"
+                },
                 "price": {
                     "description": "价格\\暂定价 [1:一口价、3:暂定价]",
                     "type": "number"
@@ -9644,6 +9660,10 @@
                 "userid": {
                     "description": "机构ID",
                     "type": "integer"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
                 }
             }
         },

+ 15 - 0
docs/swagger.yaml

@@ -3197,9 +3197,15 @@ definitions:
       amount:
         description: 金额 [1:一口价、3:暂定价]
         type: number
+      auditremark:
+        description: 审核意见
+        type: string
       audittime:
         description: 审核时间
         type: string
+      brandname:
+        description: 品牌名称
+        type: string
       buyuserid:
         description: 采购方ID
         type: integer
@@ -3221,6 +3227,9 @@ definitions:
       convertfactor:
         description: 标仓系数
         type: number
+      createtime:
+        description: 创建时间
+        type: string
       deliveryenddate:
         description: 交收期(结束)
         type: string
@@ -3251,6 +3260,9 @@ definitions:
       margin:
         description: 当前保证金
         type: number
+      modelname:
+        description: 型号名称
+        type: string
       price:
         description: 价格\暂定价 [1:一口价、3:暂定价]
         type: number
@@ -3293,6 +3305,9 @@ definitions:
       userid:
         description: 机构ID
         type: integer
+      wrstandardid:
+        description: 现货商品ID
+        type: integer
     type: object
   models.ErmcpUserModel:
     properties:

+ 53 - 38
models/ermcp.go

@@ -16,39 +16,44 @@ import (
 
 // 现货合同结构(对应现货合同菜单)
 type ErmcpSpotContractModel struct {
-	SPOTCONTRACTID    string  `json:"spotcontractid"  xorm:"'SPOTCONTRACTID'"`       //现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
-	CONTRACTNO        string  `json:"contractno"  xorm:"'CONTRACTNO'"`               //现货合同编号
-	CONTRACTTYPE      int32   `json:"contracttype"  xorm:"'CONTRACTTYPE'"`           //现货合同类型 - 1:采购 -1:销售
-	USERID            int64   `json:"userid"  xorm:"'USERID'"`                       //机构ID
-	BUYUSERID         int64   `json:"buyuserid"  xorm:"'BUYUSERID'"`                 //采购方ID
-	BUYUSERName       string  `json:"buyusername"  xorm:"'BUYUSERName'"`             //采购方名称
-	SELLUSERID        int64   `json:"selluserid"  xorm:"'SELLUSERID'"`               //销售方ID
-	SELLUSERNAME      string  `json:"sellusername"  xorm:"'SELLUSERNAME'"`           //销售方名称
-	DELIVERYGOODSID   int32   `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`     //现货品种ID
-	DELIVERYGOODSCODE string  `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"` //现货品种代码
-	DELIVERYGOODSNAME string  `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"` //现货品种名称
-	PRODUCTTYPE       int32   `json:"producttype"  xorm:"'PRODUCTTYPE'"`             //产品类型 - 1:标准仓单 2:等标 3:非标
-	CONVERTFACTOR     float64 `json:"convertfactor"  xorm:"'CONVERTFACTOR'"`         //标仓系数
-	SPOTGOODSDESC     string  `json:"spotgoodsdesc"  xorm:"'SPOTGOODSDESC'"`         //商品型号
-	PRICETYPE         int32   `json:"pricetype"  xorm:"'PRICETYPE'"`                 //定价类型 - 1:一口价 2:点价 3:暂定价
-	QTY               float64 `json:"qty"  xorm:"'QTY'"`                             //数量
-	PRICE             float64 `json:"price"  xorm:"'PRICE'"`                         //价格\暂定价 [1:一口价、3:暂定价]
-	AMOUNT            float64 `json:"amount"  xorm:"'AMOUNT'"`                       //金额 [1:一口价、3:暂定价]
-	DELIVERYSTARTDATE string  `json:"deliverystartdate"  xorm:"'DELIVERYSTARTDATE'"` //交收期(开始)
-	DELIVERYENDDATE   string  `json:"deliveryenddate"  xorm:"'DELIVERYENDDATE'"`     //交收期(结束)
-	GOODSID           int32   `json:"goodsid"  xorm:"'GOODSID'"`                     //点价合约ID - 0:为现货,其它为期货商品合约ID [2:点价 3:暂定价]
-	GOODSCODE         string  `json:"goodscode"  xorm:"'GOODSCODE'"`                 //点价合约代码
-	PRICEMOVE         float64 `json:"pricemove"  xorm:"'PRICEMOVE'"`                 //升贴水 [2:点价 3:暂定价]
-	STARTDATE         string  `json:"startdate"  xorm:"'STARTDATE'"`                 //点价开始日期 [2:点价 3:暂定价]
-	ENDDATE           string  `json:"enddate"  xorm:"'ENDDATE'"`                     //点价结束日期 [2:点价 3:暂定价]
-	MARGIN            float64 `json:"margin"  xorm:"'MARGIN'"`                       //当前保证金
-	CONTRACTMARGIN    float64 `json:"contractmargin"  xorm:"'CONTRACTMARGIN'"`       //合同保证金
-	EnumdicName       string  `json:"enumdicname"  xorm:"'ENUMDICNAME'"`             //单位名称
-	CONTRACCTSTATUS   int32   `json:"contracctstatus"  xorm:"'CONTRACTSTATUS'"`      //合同状态 - 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
-	Remark            string  `json:"remark"  xorm:"'Remark'"`                       //备注
-	AUDITTIME         string  `json:"audittime"  xorm:"'AUDITTIME'"`                 //审核时间
+	SPOTCONTRACTID    string  `json:"spotcontractid"  xorm:"'SPOTCONTRACTID'"`       // 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
+	CONTRACTNO        string  `json:"contractno"  xorm:"'CONTRACTNO'"`               // 现货合同编号
+	CONTRACTTYPE      int32   `json:"contracttype"  xorm:"'CONTRACTTYPE'"`           // 现货合同类型 - 1:采购 -1:销售
+	USERID            int64   `json:"userid"  xorm:"'USERID'"`                       // 机构ID
+	BUYUSERID         int64   `json:"buyuserid"  xorm:"'BUYUSERID'"`                 // 采购方ID
+	BUYUSERName       string  `json:"buyusername"  xorm:"'BUYUSERName'"`             // 采购方名称
+	SELLUSERID        int64   `json:"selluserid"  xorm:"'SELLUSERID'"`               // 销售方ID
+	SELLUSERNAME      string  `json:"sellusername"  xorm:"'SELLUSERNAME'"`           // 销售方名称
+	DELIVERYGOODSID   int32   `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`     // 现货品种ID
+	WRSTANDARDID      int32   `json:"wrstandardid"  xorm:"'wrstandardid'"`           // 现货商品ID
+	DELIVERYGOODSCODE string  `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"` // 现货品种代码
+	DELIVERYGOODSNAME string  `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"` // 现货品种名称
+	PRODUCTTYPE       int32   `json:"producttype"  xorm:"'PRODUCTTYPE'"`             // 产品类型 - 1:标准仓单 2:等标 3:非标
+	CONVERTFACTOR     float64 `json:"convertfactor"  xorm:"'CONVERTFACTOR'"`         // 标仓系数
+	SPOTGOODSDESC     string  `json:"spotgoodsdesc"  xorm:"'SPOTGOODSDESC'"`         // 商品型号
+	PRICETYPE         int32   `json:"pricetype"  xorm:"'PRICETYPE'"`                 // 定价类型 - 1:一口价 2:点价 3:暂定价
+	QTY               float64 `json:"qty"  xorm:"'QTY'"`                             // 数量
+	PRICE             float64 `json:"price"  xorm:"'PRICE'"`                         // 价格\暂定价 [1:一口价、3:暂定价]
+	AMOUNT            float64 `json:"amount"  xorm:"'AMOUNT'"`                       // 金额 [1:一口价、3:暂定价]
+	DELIVERYSTARTDATE string  `json:"deliverystartdate"  xorm:"'DELIVERYSTARTDATE'"` // 交收期(开始)
+	DELIVERYENDDATE   string  `json:"deliveryenddate"  xorm:"'DELIVERYENDDATE'"`     // 交收期(结束)
+	GOODSID           int32   `json:"goodsid"  xorm:"'GOODSID'"`                     // 点价合约ID - 0:为现货,其它为期货商品合约ID [2:点价 3:暂定价]
+	GOODSCODE         string  `json:"goodscode"  xorm:"'GOODSCODE'"`                 // 点价合约代码
+	PRICEMOVE         float64 `json:"pricemove"  xorm:"'PRICEMOVE'"`                 // 升贴水 [2:点价 3:暂定价]
+	STARTDATE         string  `json:"startdate"  xorm:"'STARTDATE'"`                 // 点价开始日期 [2:点价 3:暂定价]
+	ENDDATE           string  `json:"enddate"  xorm:"'ENDDATE'"`                     // 点价结束日期 [2:点价 3:暂定价]
+	MARGIN            float64 `json:"margin"  xorm:"'MARGIN'"`                       // 当前保证金
+	CONTRACTMARGIN    float64 `json:"contractmargin"  xorm:"'CONTRACTMARGIN'"`       // 合同保证金
+	EnumdicName       string  `json:"enumdicname"  xorm:"'ENUMDICNAME'"`             // 单位名称
+	CONTRACCTSTATUS   int32   `json:"contracctstatus"  xorm:"'CONTRACTSTATUS'"`      // 合同状态 - 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+	Remark            string  `json:"remark"  xorm:"'Remark'"`                       // 备注
+	AUDITREMARK       string  `json:"auditremark"  xorm:"'AUDITREMARK'"`             // 审核意见
+	AUDITTIME         string  `json:"audittime"  xorm:"'AUDITTIME'"`                 // 审核时间
+	CREATETIME        string  `json:"createtime"  xorm:"'CREATETIME'"`               // 创建时间
 	SPOTGOODSMODELID  int32   `json:"spotgoodsmodelid"  xorm:"'SPOTGOODSMODELID'"`   // 现货型号ID
 	SPOTGOODSBRANDID  int32   `json:"spotgoodsbrandid"  xorm:"'SPOTGOODSBRANDID'"`   // 现货品牌ID
+	BRANDNAME         string  `json:"brandname"  xorm:"'brandname'"`                 // 品牌名称
+	MODELNAME         string  `json:"modelname"  xorm:"'modelname'"`                 // 型号名称
 }
 
 func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
@@ -59,6 +64,7 @@ func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
 		"       t.BUYUSERID," +
 		"       t.SELLUSERID," +
 		"       t.DELIVERYGOODSID," +
+		"       t.wrstandardid," +
 		"       t.PRODUCTTYPE," +
 		"       t.CONVERTFACTOR," +
 		"       t.SPOTGOODSDESC," +
@@ -67,23 +73,27 @@ func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
 		"       t.PRICE," +
 		"       t.AMOUNT," +
 		"       to_char(t.DELIVERYSTARTDATE, 'yyyy-mm-dd hh24:mi:ss') DELIVERYSTARTDATE," +
-		"       to_char(t.DELIVERYENDDATE,'yyyy-mm-dd hh24:mi:ss') DELIVERYENDDATE," +
+		"       to_char(t.DELIVERYENDDATE, 'yyyy-mm-dd hh24:mi:ss') DELIVERYENDDATE," +
 		"       t.GOODSID," +
 		"       t.PRICEMOVE," +
 		"       to_char(t.STARTDATE, 'yyyy-mm-dd hh24:mi:ss') STARTDATE," +
-		"       to_char(t.ENDDATE,'yyyy-mm-dd hh24:mi:ss') ENDDATE," +
+		"       to_char(t.ENDDATE, 'yyyy-mm-dd hh24:mi:ss') ENDDATE," +
 		"       t.MARGIN," +
 		"       t.contractmargin," +
 		"       t.remark," +
+		"       t.auditremark," +
 		"       t.contractstatus," +
 		"       t.SPOTGOODSMODELID," +
 		"       t.SPOTGOODSBRANDID," +
-		"       to_char(t.audittime,'yyyy-mm-dd hh24:mi:ss') audittime," +
-		"       u1.accountname      BuyUserName," +
-		"       u2.accountname      SellUserName," +
+		"       to_char(t.audittime, 'yyyy-mm-dd hh24:mi:ss') audittime," +
+		"       to_char(t.createtime, 'yyyy-mm-dd hh24:mi:ss') createtime," +
+		"       u1.accountname BuyUserName," +
+		"       u2.accountname SellUserName," +
 		"       g.deliverygoodscode," +
 		"       g.deliverygoodsname," +
 		"       g2.goodscode," +
+		"       gb.brandname," +
+		"       gm.modelname," +
 		"       e.Enumdicname" +
 		"  FROM ERMCP_SPOTCONTRACT t" +
 		"  left join useraccount u1" +
@@ -94,8 +104,13 @@ func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
 		"    on t.deliverygoodsid = g.deliverygoodsid" +
 		"  left join goods g2" +
 		"    on t.goodsid = g2.goodsid" +
-		"  left join enumdicitem e on g.goodsunitid = e.enumitemname and e.enumdiccode = 'goodsunit'" +
-		"  where t.contractstatus in (%v) and t.userid=%v"
+		"    left join spotgoodsbrand gb on t.spotgoodsbrandid=gb.brandid" +
+		"    left join spotgoodsmodel gm on t.spotgoodsmodelid=gm.modelid" +
+		"  left join enumdicitem e" +
+		"    on g.goodsunitid = e.enumitemname" +
+		"   and e.enumdiccode = 'goodsunit'" +
+		" where t.contractstatus in (%v)" +
+		"   and t.userid = %v"
 
 	// 查询类型 1-未提交 2-待审核 3-履约中 4-已完成
 	// 合同状态 - 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回