Explorar el Código

QueryTHJPurchaseTransferOrderDetail: 变更参数为 transferid
Thjpurchasetransfer: 添加返回字段

deng.yinping hace 3 años
padre
commit
5916ec3b69
Se han modificado 4 ficheros con 122 adiciones y 39 borrados
  1. 29 5
      docs/docs.go
  2. 29 5
      docs/swagger.json
  3. 23 5
      docs/swagger.yaml
  4. 41 24
      models/ferroalloy.go

+ 29 - 5
docs/docs.go

@@ -44502,6 +44502,10 @@ const docTemplate = `{
                     "description": "贸易合同地址(卖家)",
                     "type": "string"
                 },
+                "createtime": {
+                    "description": "预售挂牌时间",
+                    "type": "string"
+                },
                 "deliverygoodsid": {
                     "description": "现货品种ID",
                     "type": "integer"
@@ -44519,7 +44523,7 @@ const docTemplate = `{
                     "type": "number"
                 },
                 "enddate": {
-                    "description": "到期日期",
+                    "description": "到期日期(交收日期)",
                     "type": "string"
                 },
                 "enddatemonth": {
@@ -44551,7 +44555,7 @@ const docTemplate = `{
                     "type": "integer"
                 },
                 "payeddeposit": {
-                    "description": "[定金]买方已付定金",
+                    "description": "[定金]买方已付定金(预付款)",
                     "type": "number"
                 },
                 "payedtradedate": {
@@ -44631,7 +44635,7 @@ const docTemplate = `{
                     "type": "integer"
                 },
                 "tradetime": {
-                    "description": "摘牌时间",
+                    "description": "摘牌时间(委托时间)",
                     "type": "string"
                 },
                 "transferprice": {
@@ -44686,10 +44690,22 @@ const docTemplate = `{
                     "description": "协议转让合同地址",
                     "type": "string"
                 },
+                "createtime": {
+                    "description": "转让挂牌时间",
+                    "type": "string"
+                },
                 "deliverygoodsid": {
                     "description": "现货品种ID",
                     "type": "integer"
                 },
+                "enddate": {
+                    "description": "交收日期",
+                    "type": "string"
+                },
+                "enddatemonth": {
+                    "description": "交收月份",
+                    "type": "string"
+                },
                 "handlestatus": {
                     "description": "处理状态",
                     "type": "integer"
@@ -44703,13 +44719,17 @@ const docTemplate = `{
                     "type": "integer"
                 },
                 "payeddeposit": {
-                    "description": "买方已付定金",
+                    "description": "买方已付定金(预付款)",
                     "type": "number"
                 },
                 "presaleapplyid": {
                     "description": "预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)",
                     "type": "string"
                 },
+                "presalestatus": {
+                    "description": "预留状态 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成",
+                    "type": "integer"
+                },
                 "remark": {
                     "description": "备注",
                     "type": "string"
@@ -44739,7 +44759,7 @@ const docTemplate = `{
                     "type": "string"
                 },
                 "tradeprice": {
-                    "description": "预售价格",
+                    "description": "参考价",
                     "type": "number"
                 },
                 "transferamount": {
@@ -44766,6 +44786,10 @@ const docTemplate = `{
                     "description": "转让交易日",
                     "type": "string"
                 },
+                "transfertradetime": {
+                    "description": "转让成交时间",
+                    "type": "string"
+                },
                 "unitid": {
                     "description": "现货商品单位ID",
                     "type": "integer"

+ 29 - 5
docs/swagger.json

@@ -44493,6 +44493,10 @@
                     "description": "贸易合同地址(卖家)",
                     "type": "string"
                 },
+                "createtime": {
+                    "description": "预售挂牌时间",
+                    "type": "string"
+                },
                 "deliverygoodsid": {
                     "description": "现货品种ID",
                     "type": "integer"
@@ -44510,7 +44514,7 @@
                     "type": "number"
                 },
                 "enddate": {
-                    "description": "到期日期",
+                    "description": "到期日期(交收日期)",
                     "type": "string"
                 },
                 "enddatemonth": {
@@ -44542,7 +44546,7 @@
                     "type": "integer"
                 },
                 "payeddeposit": {
-                    "description": "[定金]买方已付定金",
+                    "description": "[定金]买方已付定金(预付款)",
                     "type": "number"
                 },
                 "payedtradedate": {
@@ -44622,7 +44626,7 @@
                     "type": "integer"
                 },
                 "tradetime": {
-                    "description": "摘牌时间",
+                    "description": "摘牌时间(委托时间)",
                     "type": "string"
                 },
                 "transferprice": {
@@ -44677,10 +44681,22 @@
                     "description": "协议转让合同地址",
                     "type": "string"
                 },
+                "createtime": {
+                    "description": "转让挂牌时间",
+                    "type": "string"
+                },
                 "deliverygoodsid": {
                     "description": "现货品种ID",
                     "type": "integer"
                 },
+                "enddate": {
+                    "description": "交收日期",
+                    "type": "string"
+                },
+                "enddatemonth": {
+                    "description": "交收月份",
+                    "type": "string"
+                },
                 "handlestatus": {
                     "description": "处理状态",
                     "type": "integer"
@@ -44694,13 +44710,17 @@
                     "type": "integer"
                 },
                 "payeddeposit": {
-                    "description": "买方已付定金",
+                    "description": "买方已付定金(预付款)",
                     "type": "number"
                 },
                 "presaleapplyid": {
                     "description": "预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)",
                     "type": "string"
                 },
+                "presalestatus": {
+                    "description": "预留状态 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成",
+                    "type": "integer"
+                },
                 "remark": {
                     "description": "备注",
                     "type": "string"
@@ -44730,7 +44750,7 @@
                     "type": "string"
                 },
                 "tradeprice": {
-                    "description": "预售价格",
+                    "description": "参考价",
                     "type": "number"
                 },
                 "transferamount": {
@@ -44757,6 +44777,10 @@
                     "description": "转让交易日",
                     "type": "string"
                 },
+                "transfertradetime": {
+                    "description": "转让成交时间",
+                    "type": "string"
+                },
                 "unitid": {
                     "description": "现货商品单位ID",
                     "type": "integer"

+ 23 - 5
docs/swagger.yaml

@@ -18874,6 +18874,9 @@ definitions:
       contractaddrsell:
         description: 贸易合同地址(卖家)
         type: string
+      createtime:
+        description: 预售挂牌时间
+        type: string
       deliverygoodsid:
         description: 现货品种ID
         type: integer
@@ -18887,7 +18890,7 @@ definitions:
         description: 优惠总金额(优惠金额*TradeQty)
         type: number
       enddate:
-        description: 到期日期
+        description: 到期日期(交收日期)
         type: string
       enddatemonth:
         description: 到期月份
@@ -18912,7 +18915,7 @@ definitions:
           (枚举:THJOrderStatus)
         type: integer
       payeddeposit:
-        description: '[定金]买方已付定金'
+        description: '[定金]买方已付定金(预付款)'
         type: number
       payedtradedate:
         description: 支付尾款成功交易日
@@ -18972,7 +18975,7 @@ definitions:
         description: '[预售价]摘牌数量'
         type: integer
       tradetime:
-        description: 摘牌时间
+        description: 摘牌时间(委托时间)
         type: string
       transferprice:
         description: 转让价格 - 购买价
@@ -19012,9 +19015,18 @@ definitions:
       contractaddr:
         description: 协议转让合同地址
         type: string
+      createtime:
+        description: 转让挂牌时间
+        type: string
       deliverygoodsid:
         description: 现货品种ID
         type: integer
+      enddate:
+        description: 交收日期
+        type: string
+      enddatemonth:
+        description: 交收月份
+        type: string
       handlestatus:
         description: 处理状态
         type: integer
@@ -19025,11 +19037,14 @@ definitions:
         description: 类型 - 1:转让委托 - 挂牌中(卖方) 2:转让成交(卖方) 3:转让委托 - 已完成(卖方)
         type: integer
       payeddeposit:
-        description: 买方已付定金
+        description: 买方已付定金(预付款)
         type: number
       presaleapplyid:
         description: 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
         type: string
+      presalestatus:
+        description: 预留状态 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成
+        type: integer
       remark:
         description: 备注
         type: string
@@ -19052,7 +19067,7 @@ definitions:
         description: 交易日(yyyyMMdd)
         type: string
       tradeprice:
-        description: 预售价格
+        description: 参考价
         type: number
       transferamount:
         description: 转让金额
@@ -19072,6 +19087,9 @@ definitions:
       transfertradedate:
         description: 转让交易日
         type: string
+      transfertradetime:
+        description: 转让成交时间
+        type: string
       unitid:
         description: 现货商品单位ID
         type: integer

+ 41 - 24
models/ferroalloy.go

@@ -663,13 +663,13 @@ type Thjpurchasetradedetail struct {
 	BUYACCOUNTID         int64     `json:"buyaccountid" xorm:"BUYACCOUNTID"`                            // 买方账号ID
 	SELLUSERID           int64     `json:"selluserid" xorm:"SELLUSERID"`                                // 卖方用户ID
 	SELLACCOUNTID        int64     `json:"sellaccountid" xorm:"SELLACCOUNTID"`                          // 卖方账号ID
-	TRADETIME            time.Time `json:"tradetime" xorm:"TRADETIME"`                                  // 摘牌时间
+	TRADETIME            time.Time `json:"tradetime" xorm:"TRADETIME"`                                  // 摘牌时间(委托时间)
 	TRADEPRICE           float64   `json:"tradeprice" xorm:"TRADEPRICE"`                                // 摘牌价格 - 参考价
 	TRADEQTY             int64     `json:"tradeqty" xorm:"TRADEQTY"`                                    // [预售价]摘牌数量
 	TRADEAMOUNT          float64   `json:"tradeamount" xorm:"TRADEAMOUNT"`                              // 摘牌总货款
 	DEPOSITRATE          float64   `json:"depositrate" xorm:"DEPOSITRATE"`                              // 定金比例
 	DISCOUNTAMOUNT       float64   `json:"discountamount" xorm:"DISCOUNTAMOUNT"`                        // 优惠总金额(优惠金额*TradeQty)
-	PAYEDDEPOSIT         float64   `json:"payeddeposit" xorm:"PAYEDDEPOSIT"`                            // [定金]买方已付定金
+	PAYEDDEPOSIT         float64   `json:"payeddeposit" xorm:"PAYEDDEPOSIT"`                            // [定金]买方已付定金(预付款)
 	THJDELIVERYMODE      int32     `json:"thjdeliverymode" xorm:"THJDELIVERYMODE"`                      // 交割方式 - 1:平台仓储 2:自提 3:代办运输 (枚举:THJDeliveryMode)
 	CONTACTNAME          string    `json:"contactname" xorm:"CONTACTNAME"`                              // 联系人姓名
 	CONTACTINFO          string    `json:"contactinfo" xorm:"CONTACTINFO"`                              // 联系方式
@@ -701,9 +701,10 @@ type Thjpurchasetradedetail struct {
 	THJORDERSTATUSDISPLAY  string `json:"thjorderstatusdisplay" xorm:"THJORDERSTATUSDISPLAY"`   // 状态
 
 	ENDDATEMONTH  string  `json:"enddatemonth" xorm:"ENDDATEMONTH"`   // 到期月份
-	ENDDATE       string  `json:"enddate" xorm:"ENDDATE"`             // 到期日期
+	ENDDATE       string  `json:"enddate" xorm:"ENDDATE"`             // 到期日期(交收日期)
 	UNITID        int32   `json:"unitid" xorm:"UNITID"`               // 商品单位
 	TRANSFERPRICE float64 `json:"transferprice" xorm:"TRANSFERPRICE"` // 转让价格 - 购买价
+	CREATETIME    string  `json:"createtime" xorm:"CREATETIME"`       // 预售挂牌时间
 
 	PRESALESTATUS int32 `json:"presalestatus" xorm:"PRESALESTATUS"` // 预留状态 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成
 
@@ -769,7 +770,8 @@ func (r *Thjpurchasetradedetail) buildSql() string {
         to_char(pi.enddate, 'yyyy-MM-dd') ENDDATE,
 		wr.UNITID,
 		t.TRANSFERPRICE,
-		pi.PRESALESTATUS
+		pi.PRESALESTATUS,
+		to_char(pi.CREATETIME, 'yyyy-MM-dd') CREATETIME,
 	from THJ_PurchaseTradeDetail t
 	inner join WR_PresaleInfo pi 
 		on t.presaleapplyid = pi.presaleapplyid
@@ -852,7 +854,9 @@ func (r *Thjpurchasetradedetail) buildSql2() string {
 		to_char(pi.enddate, 'yyyy-MM') ENDDATEMONTH,
         to_char(pi.enddate, 'yyyy-MM-dd') ENDDATE,
 		wr.UNITID,
-		t.TRANSFERPRICE
+		t.TRANSFERPRICE,
+		pi.PRESALESTATUS,
+		to_char(pi.CREATETIME, 'yyyy-MM-dd') CREATETIME,
 	from THJ_PurchaseTradeDetail t
 	inner join WR_PresaleInfo pi 
 		on t.presaleapplyid = pi.presaleapplyid
@@ -1280,8 +1284,8 @@ type Thjpurchasetransfer struct {
 	TRANSFERSTATUS           int32   `json:"transferstatus" xorm:"TRANSFERSTATUS"`                     // 转让状态 - 1:挂牌中 2:已撤销 3:处理中 4:已转让
 	HANDLESTATUS             int32   `json:"handlestatus" xorm:"HANDLESTATUS"`                         // 处理状态
 
-	TRADEPRICE   float64 `json:"tradeprice" xorm:"TRADEPRICE"`     // 预售价格
-	PAYEDDEPOSIT float64 `json:"payeddeposit" xorm:"PAYEDDEPOSIT"` // 买方已付定金
+	TRADEPRICE   float64 `json:"tradeprice" xorm:"TRADEPRICE"`     // 参考价
+	PAYEDDEPOSIT float64 `json:"payeddeposit" xorm:"PAYEDDEPOSIT"` // 买方已付定金(预付款)
 
 	WRSTANDARDNAME string `json:"wrstandardname" xorm:"WRSTANDARDNAME"` // 现货商品名称
 
@@ -1290,6 +1294,13 @@ type Thjpurchasetransfer struct {
 
 	UNITID int32 `json:"unitid" xorm:"UNITID"` // 现货商品单位ID
 
+	ENDDATEMONTH      string `json:"enddatemonth" xorm:"ENDDATEMONTH"`           // 交收月份
+	ENDDATE           string `json:"enddate" xorm:"ENDDATE"`                     // 交收日期
+	CREATETIME        string `json:"createtime" xorm:"CREATETIME"`               // 转让挂牌时间
+	TRANSFERTRADETIME string `json:"transfertradetime" xorm:"TRANSFERTRADETIME"` // 转让成交时间
+
+	PRESALESTATUS int32 `json:"presalestatus" xorm:"PRESALESTATUS"` // 预留状态 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成
+
 	PageEx `xorm:"extends"` // 页码信息
 }
 
@@ -1328,9 +1339,15 @@ func (r *Thjpurchasetransfer) buildSql() string {
 		t.TRANSFERSTATUS,
 		t.HANDLESTATUS,
 		wr.UNITID,
+		to_char(pi.ENDDATE, 'yyyy-MM') ENDDATEMONTH,
+        to_char(pi.ENDDATE, 'yyyy-MM-dd') ENDDATE,
+		pi.PRESALESTATUS,
+		to_char(t.CREATETIME, 'yyyy-MM-dd') CREATETIME,
+		to_char(t.TRANSFERTRADETIME, 'yyyy-MM-dd') TRANSFERTRADETIME,
 		%v ORDERTYPE
 	from THJ_PurchaseTransfer t
 	inner join THJ_PurchaseTradeDetail p on t.wrtradedetailid = p.wrtradedetailid
+	inner join wr_presaleinfo pi on pi.presaleapplyid = t.presaleapplyid
 	inner join wrstandard wr on t.wrstandardid = wr.wrstandardid
 	where %v and 1=1
 `
@@ -1361,21 +1378,21 @@ func (r *Thjpurchasetransfer) GetDataByPage() (interface{}, error, int, int, int
 }
 
 type ThjpurchasetransferDetail struct {
-	WRTRADEDETAILID  int64   `json:"-" xorm:"WRTRADEDETAILID" form:"wrtradedetailid"` // 采购成交单ID(321+Unix秒时间戳(10位)+xxxxxx)
-	TRANSFERID       string  `json:"transferid" xorm:"TRANSFERID"`                    // 转让单号
-	WRSTANDARDID     int32   `json:"wrstandardid" xorm:"WRSTANDARDID"`                // 现货商品ID
-	TRANSFERPRICE    float64 `json:"transferprice" xorm:"TRANSFERPRICE"`              // 转让价格
-	TRANSFERAMOUNT   float64 `json:"transferamount" xorm:"TRANSFERAMOUNT"`            // 转让金额
-	TRANSFERSTATUS   int32   `json:"transferstatus" xorm:"TRANSFERSTATUS"`            // 转让状态 - 1:挂牌中 2:已撤销 3:处理中 4:已转让
-	TRADEPRICE       float64 `json:"tradeprice" xorm:"TRADEPRICE"`                    // 预售价格
-	PAYEDDEPOSIT     float64 `json:"payeddeposit" xorm:"PAYEDDEPOSIT"`                // 买方已付定金
-	CONTRACTADDRBUY  string  `json:"contractaddrbuy" xorm:"CONTRACTADDRBUY"`          // 贸易合同地址(买家)
-	CONTRACTADDRSELL string  `json:"contractaddrsell" xorm:"CONTRACTADDRSELL"`        // 贸易合同地址(卖家)
-	WRSTANDARDCODE   string  `json:"wrstandardcode" xorm:"WRSTANDARDCODE"`            // 现货商品代码
-	WRSTANDARDNAME   string  `json:"wrstandardname" xorm:"WRSTANDARDNAME"`            // 现货商品名称
-	WAREHOUSENAME    string  `json:"warehousename" xorm:"WAREHOUSENAME"`              // 仓库名称
-	BUYUSERNAME      string  `json:"buyusername" xorm:"BUYUSERNAME"`                  // 受让人
-	SELLUSERNAME     string  `json:"sellusername" xorm:"SELLUSERNAME"`                // 转让人
+	WRTRADEDETAILID  int64   `json:"-" xorm:"WRTRADEDETAILID"`                       // 采购成交单ID(321+Unix秒时间戳(10位)+xxxxxx)
+	TRANSFERID       string  `json:"transferid" xorm:"TRANSFERID" form:"transferid"` // 转让单号
+	WRSTANDARDID     int32   `json:"wrstandardid" xorm:"WRSTANDARDID"`               // 现货商品ID
+	TRANSFERPRICE    float64 `json:"transferprice" xorm:"TRANSFERPRICE"`             // 转让价格
+	TRANSFERAMOUNT   float64 `json:"transferamount" xorm:"TRANSFERAMOUNT"`           // 转让金额
+	TRANSFERSTATUS   int32   `json:"transferstatus" xorm:"TRANSFERSTATUS"`           // 转让状态 - 1:挂牌中 2:已撤销 3:处理中 4:已转让
+	TRADEPRICE       float64 `json:"tradeprice" xorm:"TRADEPRICE"`                   // 预售价格
+	PAYEDDEPOSIT     float64 `json:"payeddeposit" xorm:"PAYEDDEPOSIT"`               // 买方已付定金
+	CONTRACTADDRBUY  string  `json:"contractaddrbuy" xorm:"CONTRACTADDRBUY"`         // 贸易合同地址(买家)
+	CONTRACTADDRSELL string  `json:"contractaddrsell" xorm:"CONTRACTADDRSELL"`       // 贸易合同地址(卖家)
+	WRSTANDARDCODE   string  `json:"wrstandardcode" xorm:"WRSTANDARDCODE"`           // 现货商品代码
+	WRSTANDARDNAME   string  `json:"wrstandardname" xorm:"WRSTANDARDNAME"`           // 现货商品名称
+	WAREHOUSENAME    string  `json:"warehousename" xorm:"WAREHOUSENAME"`             // 仓库名称
+	BUYUSERNAME      string  `json:"buyusername" xorm:"BUYUSERNAME"`                 // 受让人
+	SELLUSERNAME     string  `json:"sellusername" xorm:"SELLUSERNAME"`               // 转让人
 
 	TRANSFERQTY int32 `json:"transferqty" xorm:"TRANSFERQTY"` // 转让数量
 
@@ -1409,9 +1426,9 @@ func (r *ThjpurchasetransferDetail) buildSql() string {
 	left join WAREHOUSEINFO wh on wh.autoid = t.warehouseid
 	left join useraccount u1 on u1.userid = t.buyuserid
 	left join useraccount u2 on u2.userid = t.selluserid
-	where t.WRTRADEDETAILID = %v
+	where t.TRANSFERID = %v
 	`
-	sqlId.FormatParam(r.WRTRADEDETAILID)
+	sqlId.FormatParam(r.TRANSFERID)
 
 	return sqlId.String()
 }