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

广钻增加接口:
/Guangzuan/QueryGZPreSell 预售大厅/我的预售/集采大厅/我的集采 列表查询
/Guangzuan/QueryGZMyPresell 我的预售认购列表查询
/Guangzuan/QueryGZMyTradingPreSell 我参与的预售(预售中\执行中)\我参与的集采(集采中\执行中) 列表查询

zhou.xiaoning пре 2 година
родитељ
комит
02bd8cf555

+ 6 - 6
config/config.xml

@@ -13,11 +13,11 @@
     <DbAddress value="192.168.31.88"/>
     <DbName value="orcl"/>
     <DbPort value="1521"/>
-    <DbUser value="mtp2_test167"/>
+    <DbUser value="mtp2_test104"/>
     <DbPwd value="muchinfo"/>
   </DbSetting>
   <RedisSetting>
-    <Address value="192.168.31.167"/>
+    <Address value="192.168.31.104"/>
     <Port value="5007"/>
     <Timeout value="3"/>
     <ConnNum value="1"/>
@@ -25,11 +25,11 @@
     <Pwd value=""/>
   </RedisSetting>
   <MqSetting>
-    <Url value="amqp://guest:guest@192.168.31.167:5020/test"/>
+    <Url value="amqp://guest:guest@192.168.31.104:5020/test"/>
     <Exchange value="entry"/>
   </MqSetting>
   <MongoDBSetting>
-    <HostName value="192.168.31.167"/>
+    <HostName value="192.168.31.104"/>
     <Port value="5025"/>
     <DBName value="HistoryQuote"/>
     <Username value="quote_test01"/>
@@ -38,8 +38,8 @@
   <MySQLSetting>
     <Host value="192.168.30.72"/>
     <Port value="3306"/>
-    <DBName value="historyquote_test167"/>
-    <Username value="quote_test167"/>
+    <DBName value="historyquote_test104"/>
+    <Username value="quote_test104"/>
     <Password value="123456"/>
   </MySQLSetting>
 </Configuration>

+ 6 - 6
controllers/ferroalloy/quote.go

@@ -14,8 +14,8 @@ import (
 // @Summary  获取现货行情
 // @Produce json
 // @Security ApiKeyAuth
-// @Param    page     query    int false "页码"
-// @Param    pagesize query    int false "每页条数"
+// @Param    page         query    int false "页码"
+// @Param    pagesize     query    int false "每页条数"
 // @Success  200      {array}  models.GErmcpspotgoodsprice
 // @Failure 500 {object} app.Response
 // @Router   /Ferroalloy/GetSpotGoodsPrice [get]
@@ -79,7 +79,7 @@ func QueryTHJGoodsDetail(c *gin.Context) {
 // @Param    page           query    int    false "页码"
 // @Param    pagesize       query    int    false "每页条数"
 // @Success  200            {array}  models.THJWrstandard
-// @Failure  500            {object} app.Response
+// @Failure  500          {object} app.Response
 // @Router   /Ferroalloy/QueryTHJWrstandard [get]
 // @Tags     铁合金
 func QueryTHJWrstandard(c *gin.Context) {
@@ -140,7 +140,7 @@ func QueryTHJWrstandardDetail(c *gin.Context) {
 // @Param    page     query    int false "页码"
 // @Param    pagesize query    int false "每页条数"
 // @Success  200            {array}  models.PurchaseTransfer
-// @Failure  500      {object} app.Response
+// @Failure  500            {object} app.Response
 // @Router   /Ferroalloy/QueryTHJPurchaseTransfer [get]
 // @Tags     铁合金
 func QueryTHJPurchaseTransfer(c *gin.Context) {
@@ -179,10 +179,10 @@ func QueryTHJPurchaseTransferDetail(c *gin.Context) {
 // @Summary  查询行情-现货列表
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    wrstandardid   query    int    false "现货商品ID"
+// @Param    wrstandardid query    int false "现货商品ID"
 // @Param    page           query    int    false "页码"
 // @Param    pagesize       query    int    false "每页条数"
-// @Success  200      {array}  models.Spotgoodsprice
+// @Success  200          {array}  models.Spotgoodsprice
 // @Failure  500            {object} app.Response
 // @Router   /Ferroalloy/QuerySpotgoodsPrice [get]
 // @Tags     铁合金

+ 74 - 14
controllers/guangzuan/trade.go

@@ -104,10 +104,10 @@ func QueryDiamond(c *gin.Context) {
 // @Param    ordertype query    int true  "单据类型 - 1:进仓 2:出仓(枚举:GZBSCOrderType)"
 // @Param    listtype  query    int false "列表类型 - 0.全部 1.待上传 2.进行中 3.已结束"
 // @Param    outtype   query    int false "出仓类型 - 1:转厂 2:出境(枚举:GZBSCOutType)"
-// @Param    page      query    int false "页码"
-// @Param    pagesize  query    int false "每页条数"
+// @Param    page           query    int    false "页码"
+// @Param    pagesize       query    int    false "每页条数"
 // @Success  200       {array}  models.GGzbscinoutorder
-// @Failure  500       {object} app.Response
+// @Failure  500        {object} app.Response
 // @Router   /Guangzuan/QueryGzbscinOutOrder [get]
 // @Tags     广钻
 func QueryGzbscinOutOrder(c *gin.Context) {
@@ -123,8 +123,8 @@ func QueryGzbscinOutOrder(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Param    userid     query    int    true  "用户ID"
 // @Param    orderid  query    string true  "申请ID"
-// @Param    page       query    int    false "页码"
-// @Param    pagesize   query    int    false "每页条数"
+// @Param    page           query    int false "页码"
+// @Param    pagesize       query    int false "每页条数"
 // @Success  200      {array}  models.BScinoutorderdetail
 // @Failure  500       {object} app.Response
 // @Router   /Guangzuan/QueryBScinOutOrderDetail [get]
@@ -145,7 +145,7 @@ func QueryBScinOutOrderDetail(c *gin.Context) {
 // @Param    page      query    int false "页码"
 // @Param    pagesize  query    int false "每页条数"
 // @Success  200      {array}  models.BScoutorderdetailatt
-// @Failure  500        {object} app.Response
+// @Failure  500            {object} app.Response
 // @Router   /Guangzuan/QueryBScOutOrderDetailatt [get]
 // @Tags     广钻
 func QueryBScOutOrderDetailatt(c *gin.Context) {
@@ -163,7 +163,7 @@ func QueryBScOutOrderDetailatt(c *gin.Context) {
 // @Param    page     query    int false "页码"
 // @Param    pagesize query    int false "每页条数"
 // @Success  200      {array}  models.GGzbscposition
-// @Failure  500      {object} app.Response
+// @Failure  500            {object} app.Response
 // @Router   /Guangzuan/QueryGzbscPosition [get]
 // @Tags     广钻
 func QueryGzbscPosition(c *gin.Context) {
@@ -179,10 +179,10 @@ func QueryGzbscPosition(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Param    userid   query    int    true  "用户ID"
 // @Param    paystatus query    int false "支付状态 - 1:待确认 2:待支付 3:已支付(枚举:GZBSCPayStatus)"
-// @Param    page     query    int    false "页码"
-// @Param    pagesize query    int    false "每页条数"
+// @Param    page      query    int false "页码"
+// @Param    pagesize  query    int false "每页条数"
 // @Success  200       {array}  models.GGzbscusermonthpay
-// @Failure  500      {object} app.Response
+// @Failure  500       {object} app.Response
 // @Router   /Guangzuan/QueryGzbscusermonthpay [get]
 // @Tags     广钻
 func QueryGzbscusermonthpay(c *gin.Context) {
@@ -198,8 +198,8 @@ func QueryGzbscusermonthpay(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Param    userid   query    int    true  "用户ID"
 // @Param    trademonth query    string true  "月份(yyyMM)"
-// @Param    page     query    int    false "页码"
-// @Param    pagesize query    int    false "每页条数"
+// @Param    page       query    int    false "页码"
+// @Param    pagesize   query    int    false "每页条数"
 // @Success  200        {array}  models.GGzbscuserpowerfee
 // @Failure  500      {object} app.Response
 // @Router   /Guangzuan/QueryGzbscuserpowerfee [get]
@@ -217,8 +217,8 @@ func QueryGzbscuserpowerfee(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Param    userid   query    int    true  "用户ID"
 // @Param    jckdate  query    string true  "进出口月份(yyyMM)"
-// @Param    page     query    int    false "页码"
-// @Param    pagesize query    int    false "每页条数"
+// @Param    page     query    int false "页码"
+// @Param    pagesize query    int false "每页条数"
 // @Success  200      {array}  models.Bscinoutorder
 // @Failure  500      {object} app.Response
 // @Router   /Guangzuan/QueryBscinoutorder [get]
@@ -229,3 +229,63 @@ func QueryBscinoutorder(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataByPage(&m)
 }
+
+// QueryGZPreSell
+// @Summary  预售大厅/我的预售/集采大厅/我的集采 列表查询
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param    presalestatus  query    int    true  "预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成"
+// @Param    marketid       query    int    true  "市场ID"
+// @Param    wrstandardname query    string false "现货商品名称"
+// @Param    customername   query    string false "预售方"
+// @Param    selluserid     query    int    false "发行方用户ID"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
+// @Success  200            {array}  models.GZPresell
+// @Failure  500      {object} app.Response
+// @Router   /Guangzuan/QueryGZPreSell [get]
+// @Tags     广钻
+func QueryGZPreSell(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.GZPresell{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}
+
+// QueryGZMyPresell
+// @Summary  我的预售认购列表查询
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param    presaleapplyid query    int true  "预售申请ID"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
+// @Success  200            {array}  models.GZMyPresell
+// @Failure  500      {object} app.Response
+// @Router   /Guangzuan/QueryGZMyPresell [get]
+// @Tags     广钻
+func QueryGZMyPresell(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.GZMyPresell{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}
+
+// QueryGZMyTradingPreSell
+// @Summary  我参与的预售(预售中\执行中)\我参与的集采(集采中\执行中) 列表查询
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param    userid   query    int true  "用户ID"
+// @Param    marketid query    int true  "市场ID"
+// @Param    status   query    int false "状态 1:预售中\集采中 2:执行中 3:已完成"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
+// @Success  200      {array}  models.GZMyTradingPresell
+// @Failure  500      {object} app.Response
+// @Router   /Guangzuan/QueryGZMyTradingPreSell [get]
+// @Tags     广钻
+func QueryGZMyTradingPreSell(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.GZMyTradingPresell{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}

+ 4 - 4
controllers/guangzuan/tradeService.go

@@ -18,8 +18,8 @@ import (
 // @Security Group
 // @Param    userid   query    int    true  "用户ID"
 // @Param    executestatus query    int false "执行状态 - 1:未生效 2:进行中 3:已结束"
-// @Param    page     query    int    false "页码"
-// @Param    pagesize query    int    false "每页条数"
+// @Param    page          query    int false "页码"
+// @Param    pagesize      query    int false "每页条数"
 // @Success  200           {array}  models.GzcjjcorderM
 // @Failure  500     {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrder [get]
@@ -39,8 +39,8 @@ func QueryGZCJJCOrder(c *gin.Context) {
 // @Security Group
 // @Param    userid        query    int true  "用户ID"
 // @Param    orderid  query    string false "单据ID"
-// @Param    page          query    int false "页码"
-// @Param    pagesize      query    int false "每页条数"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
 // @Success  200      {array}  models.GzcjjcorderdetailM
 // @Failure  500           {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrderDetail [get]

Разлика између датотеке није приказан због своје велике величине
+ 369 - 185
docs/docs.go


Разлика између датотеке није приказан због своје велике величине
+ 369 - 185
docs/swagger.json


+ 456 - 93
docs/swagger.yaml

@@ -226,8 +226,7 @@ definitions:
           $ref: '#/definitions/models.Division'
         type: array
       province:
-        allOf:
-        - $ref: '#/definitions/models.Division'
+        $ref: '#/definitions/models.Division'
         description: 省
     type: object
   common.QueryTableDefineRsp:
@@ -1275,7 +1274,7 @@ definitions:
   ermcp.QryBusinessDjRsp:
     properties:
       amount:
-        description: 点价金额=(点价价格+升贴水)*点价数量
+        description: 期初均价
         type: number
       applyid:
         description: 申请人
@@ -1710,7 +1709,7 @@ definitions:
         description: 现货合同类型 - 1:采购 -1:销售
         type: integer
       deductamount:
-        description: 退款(非必填)
+        description: 期初均价
         type: number
       deliverygoodscode:
         description: 现货品种代码
@@ -1740,7 +1739,7 @@ definitions:
         description: 操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
         type: integer
       payamount:
-        description: 收付款(非必填)
+        description: 期初均价
         type: number
       pricemove:
         description: 升贴水
@@ -1862,8 +1861,7 @@ definitions:
           $ref: '#/definitions/models.ErmcpGGConvertCfg'
         type: array
       mg:
-        allOf:
-        - $ref: '#/definitions/models.ErmcpMiddleGoodsModel'
+        $ref: '#/definitions/models.ErmcpMiddleGoodsModel'
         description: 套保品种基本信息
       wrcList:
         description: 现货品种列表(现货商品折算配置)
@@ -2308,25 +2306,25 @@ definitions:
         description: 套利量
         type: number
       diffArbitrageQty:
-        description: 套利变动量
+        description: 期初均价
         type: number
       diffExposoureQty:
-        description: 变动量(套保敞口)
+        description: 期初均价
         type: number
       diffFutuQty:
-        description: 变动量(期货总量) 平安:保值净持仓量今日变动
+        description: 期初均价
         type: number
       diffHedgeQty:
-        description: 套保变动量
+        description: 期初均价
         type: number
       diffQty:
-        description: 变动量(总敞口) 平安:净敞口今日变动
+        description: 期初均价
         type: number
       diffSpotHedgeQty:
-        description: 变动量(现货应套保总量) 平安:应套保量今日变动
+        description: 期初均价
         type: number
       diffSpotQty:
-        description: 变动量(现货总量) = 现货数量 - 期初现货数量 平安:采销定价净值今日变动
+        description: 期初均价
         type: number
       enumdicname:
         description: 单位名称
@@ -3528,8 +3526,7 @@ definitions:
           $ref: '#/definitions/erms3.CustomerInfo'
         type: array
       ouruser:
-        allOf:
-        - $ref: '#/definitions/erms3.CustomerInfo'
+        $ref: '#/definitions/erms3.CustomerInfo'
         description: 我方账号
       warehouseinfos:
         description: 仓库信息列表
@@ -3774,8 +3771,7 @@ definitions:
           $ref: '#/definitions/models.Division'
         type: array
       province:
-        allOf:
-        - $ref: '#/definitions/models.Division'
+        $ref: '#/definitions/models.Division'
         description: 省
     type: object
   models.Arearole:
@@ -5135,7 +5131,7 @@ definitions:
         description: 期末额
         type: number
       curaverageprice:
-        description: 期均价
+        description: 期均价
         type: number
       curbuyamount:
         description: 期末采购总额
@@ -5144,7 +5140,7 @@ definitions:
         description: 期末采购总量
         type: number
       curmarketvalue:
-        description: 参考市值(期末市值)
+        description: 期初均价
         type: number
       curqty:
         description: 期末量
@@ -5162,7 +5158,7 @@ definitions:
         description: 期末销售总量
         type: number
       curspotprice:
-        description: 参考市价(最新价)
+        description: 期初均价
         type: number
       cycletime:
         description: 周期时间 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
@@ -5186,7 +5182,7 @@ definitions:
         description: 现货品种单位名称(作废)
         type: string
       floatpl:
-        description: 浮动损益
+        description: 期初均价
         type: number
       goodsunitid:
         description: 现货品种单位id(作废)
@@ -5222,7 +5218,7 @@ definitions:
         description: 今日采购额(今采购额)
         type: number
       todaybuyaverageprice:
-        description: 今日采购均价
+        description: 期初均价
         type: number
       todaybuyqty:
         description: 今日采购量(今采购量)
@@ -5237,7 +5233,7 @@ definitions:
         description: 今日销售额(今销售额)
         type: number
       todaysellaverageprice:
-        description: 今日销售均价
+        description: 期初均价
         type: number
       todaysellqty:
         description: 今日销售量(今销售量)
@@ -7417,7 +7413,7 @@ definitions:
         description: 合同类型 1:采购 -1:销售
         type: integer
       convertratio:
-        description: 折算系数
+        description: 期初均价
         type: number
       cycletime:
         description: 周期时间 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
@@ -7435,16 +7431,16 @@ definitions:
         description: 品种名称
         type: string
       diffprice:
-        description: 现期价格差 = 今日点价登记均价(基价) - 今日期货成交均价
+        description: 期初均价
         type: number
       diffqty:
-        description: 期现数量差 = 套保计划量 - 今日期货关联成交量
+        description: 期初均价
         type: number
       enddate:
         description: 结束交易日
         type: string
       hedgeplanqty:
-        description: 套保计划量 = TodayPricedQty * 折算系数 * (1/(1+增值税率)) * 套保比例
+        description: 期初均价
         type: number
       matchname:
         description: 交易对手方(个人:用户名称 企业:简称)
@@ -7462,64 +7458,64 @@ definitions:
         description: 套保品种名称
         type: string
       middlegoodspricedqty:
-        description: 已定价量(套保品种 - 税前) = PricedQty * 折算系数
+        description: 期初均价
         type: number
       middlegoodspricedqty2:
-        description: 已定价量(套保品种- 税后) = MiddleGoodsPricedQty * (1/(1+增值税率))
+        description: 期初均价
         type: number
       middlegoodspricedqty3:
-        description: 已定价量(套保品种应套保量) = MiddleGoodsPricedQty2 *  套保比率
+        description: 期初均价
         type: number
       needhedgeratio:
-        description: 套保系数
+        description: 期初均价
         type: number
       pricedamount:
-        description: 已定价额(现货)
+        description: 期初均价
         type: number
       pricedamount2:
-        description: 已定价额(现货-基价额)
+        description: 期初均价
         type: number
       pricedqty:
-        description: 已定价量(现货)
+        description: 期初均价
         type: number
       reckondate:
         description: 日照时期(yyyyMMdd)
         type: string
       relatedmiddlegoodsamount:
-        description: 已关联额(期货)
+        description: 期初均价
         type: number
       relatedmiddlegoodsqty:
-        description: 已关联量(套保品种)(期货)
+        description: 期初均价
         type: number
       spotcontractid:
         description: 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
         type: string
       todayavgfutuprice:
-        description: 今日期货成交均价 = TodayRelatedMiddleGoodsAmount /todayrelatedfutureqty
+        description: 期初均价
         type: number
       todayavgprice:
-        description: 今日定价均价 = TodayPricedAmount / TodayPricedQty
+        description: 期初均价
         type: number
       todayavgprice2:
-        description: 今日点价登记均价(基价) = TodayPricedAmount2 / TodayPricedQty
+        description: 期初均价
         type: number
       todaypricedamount:
-        description: 今日定价额(现货)
+        description: 期初均价
         type: number
       todaypricedamount2:
-        description: 今日定价额(现货-基价额)
+        description: 期初均价
         type: number
       todaypricedqty:
-        description: 今日定价量(现货)
+        description: 期初均价
         type: number
       todayrelatedfutureqty:
-        description: 今日关联量(期货)
+        description: 期初均价
         type: number
       todayrelatedmiddlegoodsamount:
-        description: 今日关联额(期货)
+        description: 期初均价
         type: number
       todayrelatedmiddlegoodsqty:
-        description: 今日关联量(套保品-期货)
+        description: 期初均价
         type: number
       updatetime:
         description: 更新时间
@@ -7528,7 +7524,7 @@ definitions:
         description: 合同所属用户id
         type: integer
       vatrate:
-        description: 增值税率
+        description: 期初均价
         type: number
       wrstandardcode:
         description: 商品(品类) 代码
@@ -7936,7 +7932,7 @@ definitions:
         description: 手续费
         type: number
       closeavgprice:
-        description: 平仓均价
+        description: 期初均价
         type: number
       closepl:
         description: 平仓损益
@@ -7987,7 +7983,7 @@ definitions:
         description: 期末持仓额
         type: number
       holdqty:
-        description: 期末持仓量
+        description: 期初均价
         type: number
       lastholdamount:
         description: 当前持仓额
@@ -8011,13 +8007,13 @@ definitions:
         description: 期末开仓额
         type: number
       openavgprice:
-        description: 开仓均价
+        description: 期初均价
         type: number
       oriholdamount:
         description: 期初持仓额
         type: number
       oriholdqty:
-        description: 期初持仓量
+        description: 期初均价
         type: number
       oriopenamount:
         description: 期初开仓额
@@ -8050,7 +8046,7 @@ definitions:
         description: 今平仓额
         type: number
       todaycloseqty:
-        description: 今平仓量
+        description: 期初均价
         type: number
       todaygoodsgroupspotqty:
         description: 交易品种变化量 (=(期末持仓量 - 期初持仓量)* 合约乘数)
@@ -8062,7 +8058,7 @@ definitions:
         description: 今开仓额
         type: number
       todayopenqty:
-        description: 今开仓量
+        description: 期初均价
         type: number
       userid:
         description: 账户所属用户ID
@@ -9294,8 +9290,7 @@ definitions:
   models.ErmcpRoleMenuEx:
     properties:
       menu:
-        allOf:
-        - $ref: '#/definitions/models.ErmcpRoleMenu'
+        $ref: '#/definitions/models.ErmcpRoleMenu'
         description: 父级菜单
       subMenu:
         description: 子级菜单
@@ -9522,8 +9517,7 @@ definitions:
   models.ErmcpTaAccountEx:
     properties:
       mainAcc:
-        allOf:
-        - $ref: '#/definitions/models.ErmcpTaAccountM'
+        $ref: '#/definitions/models.ErmcpTaAccountM'
         description: 主账号
       subacclist:
         description: 子账号列表
@@ -10682,6 +10676,254 @@ definitions:
         description: 未处理消息
         type: integer
     type: object
+  models.GZMyPresell:
+    properties:
+      customername:
+        description: 企业名称(认购方)
+        type: string
+      freezemargin:
+        description: 冻结保证金
+        type: number
+      orderqty:
+        description: 委托数量
+        type: integer
+      ordertime:
+        description: 委托时间(认购时间)
+        type: string
+      tradeprice:
+        description: 成交价格 - [摘牌] (浮动价  ((商品1价格*商品1价格系数+升贴水)* 商品1重量系数 + 商品2价格*商品2价格系数+商品2升贴水)*
+          商品2重量系数 ...)* 委托单价格系数 + 委托单升贴水)
+        type: number
+    type: object
+  models.GZMyTradingPresell:
+    properties:
+      customername:
+        description: 企业名称(预售方)
+        type: string
+      freezemargin:
+        description: 冻结保证金
+        type: number
+      marginalgorithm:
+        description: 保证金方式 - 1:比率  2:固定
+        type: integer
+      marginvalue:
+        description: 保证金设置值
+        type: number
+      orderqty:
+        description: 委托数量
+        type: integer
+      ordertime:
+        description: 委托时间(认购时间)
+        type: string
+      performanceplanid:
+        description: 履约计划ID/合同ID
+        type: integer
+      performancetemplateid:
+        description: 履约计划模板ID
+        type: integer
+      presaleapplyid:
+        description: 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      qtydesc:
+        description: 数量描述 [2:毛坯钻石]
+        type: string
+      remark:
+        description: 备注
+        type: string
+      sizestr:
+        description: 尺寸 [1:成品裸钻 \ 2:毛坯钻石]
+        type: string
+      status:
+        description: 状态 1:预售中\集采中 2:执行中 3:已完成
+        type: integer
+      tradeamount:
+        description: 货款
+        type: number
+      tradeprice:
+        description: 成交价格 - [摘牌] (浮动价  ((商品1价格*商品1价格系数+升贴水)* 商品1重量系数 + 商品2价格*商品2价格系数+商品2升贴水)*
+          商品2重量系数 ...)* 委托单价格系数 + 委托单升贴水)
+        type: number
+      weightdesc:
+        description: 重量描述 [2:毛坯钻石]
+        type: string
+      wrtradeorderid:
+        description: 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        type: integer
+      yieldrate:
+        description: 成品率 [2:毛坯钻石]
+        type: string
+      ysproductionmode:
+        description: 生产方式  - 枚举”YSProductionMode“  [2:毛坯钻石] 1:HPHT 2:CVD
+        type: integer
+      yszscategory:
+        description: 钻石分类 - 枚举”YSZSCategory“ 1:成品裸钻 2:毛坯钻石
+        type: integer
+      zsclaritytypestr:
+        description: 净度 [1:成品裸钻 \ 2:毛坯钻石]
+        type: string
+      zscolortypestr:
+        description: 颜色 [1:成品裸钻 \ 2:毛坯钻石]
+        type: string
+      zscuttypestr:
+        description: 切工 [1:成品裸钻]
+        type: string
+      zsfluorescencetypestr:
+        description: 荧光 [1:成品裸钻]
+        type: string
+      zspolishtypestr:
+        description: 抛光 [1:成品裸钻]
+        type: string
+      zsshapetypestr:
+        description: 形状 [1:成品裸钻]
+        type: string
+      zssymmetrytypestr:
+        description: 对称 [1:成品裸钻]
+        type: string
+    type: object
+  models.GZPresell:
+    properties:
+      bannerpicurl:
+        description: Banner图(逗号分隔)
+        type: string
+      baseqty:
+        description: 中签基数
+        type: integer
+      customername:
+        description: 企业名称(预售方)
+        type: string
+      deliverygoodsid:
+        description: 现货品种ID
+        type: integer
+      enddate:
+        description: 预售结束日期
+        type: string
+      endhandletime:
+        description: 到期处理时间
+        type: string
+      lastprice:
+        description: 实际价格(64)
+        type: number
+      lotteryflag:
+        description: 摇号标识 - 0:未摇号 1:已摇号 2:摇号中 3:摇号失败
+        type: integer
+      lotteryqty:
+        description: 摇号总量
+        type: integer
+      luckynums:
+        description: 中签号码(按顺序逗号分隔)
+        type: string
+      luckyqty:
+        description: 已中签量\成交量
+        type: integer
+      marketid:
+        description: 市场ID
+        type: integer
+      maxbuyqty:
+        description: 单人最大申购量
+        type: integer
+      maxluckyqty:
+        description: 单人最大中签量 - 作废
+        type: integer
+      pictureurls:
+        description: 详情图片(逗号分隔)
+        type: string
+      placeqty:
+        description: 已配售量
+        type: integer
+      presaleapplyid:
+        description: 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      presaleqty:
+        description: 预售总量
+        type: integer
+      presalestatus:
+        description: 预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成
+        type: integer
+      qtydesc:
+        description: 数量描述 [2:毛坯钻石]
+        type: string
+      remark:
+        description: 备注
+        type: string
+      sellaccountid:
+        description: 发行方资金账户ID
+        type: integer
+      selluserid:
+        description: 发行方用户ID
+        type: integer
+      sellwrtradeorderid:
+        description: 发行方卖委托单ID
+        type: integer
+      sizestr:
+        description: 尺寸 [1:成品裸钻 \ 2:毛坯钻石]
+        type: string
+      startdate:
+        description: 预售开始日期
+        type: string
+      takestartdate:
+        description: 提货开始日期
+        type: string
+      thumurls:
+        description: 缩略图片(1:1)(逗号分隔)
+        type: string
+      tradedate:
+        description: 交易日
+        type: string
+      unitid:
+        description: 单位ID
+        type: integer
+      unitprice:
+        description: 商品单价
+        type: number
+      warehouseid:
+        description: 仓库ID
+        type: integer
+      weightdesc:
+        description: 重量描述 [2:毛坯钻石]
+        type: string
+      wrfactortypeid:
+        description: 仓单要素类型ID - 根据现货商品\仓库生成
+        type: integer
+      wrstandardid:
+        description: 现货商品ID
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
+      yieldrate:
+        description: 成品率 [2:毛坯钻石]
+        type: string
+      ysproductionmode:
+        description: 生产方式  - 枚举”YSProductionMode“  [2:毛坯钻石] 1:HPHT 2:CVD
+        type: integer
+      yszscategory:
+        description: 钻石分类 - 枚举”YSZSCategory“ 1:成品裸钻 2:毛坯钻石
+        type: integer
+      zsclaritytypestr:
+        description: 净度 [1:成品裸钻 \ 2:毛坯钻石]
+        type: string
+      zscolortypestr:
+        description: 颜色 [1:成品裸钻 \ 2:毛坯钻石]
+        type: string
+      zscuttypestr:
+        description: 切工 [1:成品裸钻]
+        type: string
+      zsfluorescencetypestr:
+        description: 荧光 [1:成品裸钻]
+        type: string
+      zspolishtypestr:
+        description: 抛光 [1:成品裸钻]
+        type: string
+      zsshapetypestr:
+        description: 形状 [1:成品裸钻]
+        type: string
+      zssymmetrytypestr:
+        description: 对称 [1:成品裸钻]
+        type: string
+    required:
+    - marketid
+    - presalestatus
+    type: object
   models.GZWarehouseinfo:
     properties:
       address:
@@ -19401,8 +19643,7 @@ definitions:
   models.THJGoodsDetailRsp:
     properties:
       goodsinfo:
-        allOf:
-        - $ref: '#/definitions/models.THJWrstandardDetail_GoodsInfo'
+        $ref: '#/definitions/models.THJWrstandardDetail_GoodsInfo'
         description: 商品信息
       spotgoodspricelogs:
         description: 历史价格走势
@@ -19559,8 +19800,7 @@ definitions:
           $ref: '#/definitions/models.THJPurchaseTradeDetail_Date'
         type: array
       goodsinfo:
-        allOf:
-        - $ref: '#/definitions/models.THJPurchaseTradeDetail_Goodsinfo'
+        $ref: '#/definitions/models.THJPurchaseTradeDetail_Goodsinfo'
         description: 商品信息
       spotgoodspricelogs:
         description: 历史价格走势
@@ -19739,8 +19979,7 @@ definitions:
           $ref: '#/definitions/models.THJDeliveryMonth'
         type: array
       goodsinfo:
-        allOf:
-        - $ref: '#/definitions/models.THJWrstandardDetail_GoodsInfo'
+        $ref: '#/definitions/models.THJWrstandardDetail_GoodsInfo'
         description: 商品信息
       presaleapplydeposits:
         description: 支付方式
@@ -20763,8 +21002,7 @@ definitions:
         description: 商品ID
         type: integer
       infoc:
-        allOf:
-        - $ref: '#/definitions/pb.GoodsMarginCfgStruct'
+        $ref: '#/definitions/pb.GoodsMarginCfgStruct'
         description: 配置参数
       marketid:
         description: 市场ID
@@ -20785,7 +21023,7 @@ definitions:
         description: 委托单号
         type: string
       orderprice:
-        description: 委托价格
+        description: 期初均价
         type: number
       orderqty:
         description: 委托数量
@@ -20836,7 +21074,7 @@ definitions:
         description: 市场ID
         type: integer
       qty:
-        description: 转让数量(数量)
+        description: 期初均价
         type: number
       tradeid:
         description: 成交单号(关联持仓)
@@ -20881,7 +21119,7 @@ definitions:
         description: 行权日类型 - 1:滚动行权 2:固定日行权
         type: integer
       freezeqty:
-        description: 冻结数量
+        description: 期初均价
         type: number
       goodscode:
         description: 商品代码
@@ -20908,7 +21146,7 @@ definitions:
         description: 持仓价格
         type: number
       holderqty:
-        description: 持仓数量
+        description: 期初均价
         type: number
       isconfirmexercise:
         description: 是否确认行权- 0:否 1:是
@@ -20926,7 +21164,7 @@ definitions:
         description: 建仓价格
         type: number
       openqty:
-        description: 建仓数量
+        description: 期初均价
         type: number
       optiontype:
         description: 期权类型 - 1:认购(看涨) 2:认沽(看跌)
@@ -21733,13 +21971,13 @@ definitions:
         description: 单位名称
         type: string
       fixedprice:
-        description: 挂牌价格
+        description: 期初均价
         type: number
       handlestatus:
         description: 处理状态
         type: integer
       marginvalue:
-        description: 履约保证金比例
+        description: 期初均价
         type: number
       marketid:
         description: 市场ID
@@ -21874,7 +22112,7 @@ definitions:
   models.WrAverageTradePrice:
     properties:
       averageprice:
-        description: 成交均价
+        description: 期初均价
         type: number
       tradedate:
         description: 交易日yyyymm
@@ -22062,7 +22300,7 @@ definitions:
         description: 账号ID
         type: integer
       averageprice:
-        description: 交割均价 = 交割金额 / 交割数量
+        description: 期初均价
         type: number
       begindate:
         description: 开始交易日(yyyymmdd)
@@ -22149,7 +22387,7 @@ definitions:
         description: 合约数量
         type: number
       xgoodsamount:
-        description: 合约金额 = 货款金额(DELIVERYAMOUNT) - 点价货款(P1GOODSREMAINAMOUNT)
+        description: 期初均价
         type: number
       xgoodscode:
         description: 商品代码
@@ -22802,7 +23040,7 @@ definitions:
         description: 步骤名称
         type: string
       stepvalue:
-        description: 步骤值
+        description: 期初均价
         type: number
       templateid:
         description: 履约计划模板ID
@@ -23037,7 +23275,7 @@ definitions:
         description: 是否全好友可见 - 0:否 1:是
         type: integer
       amount:
-        description: 挂牌金额 = 委托数量 * 固定价或升贴水
+        description: 期初均价
         type: number
       bannerpicurl:
         description: Banner图
@@ -23082,10 +23320,10 @@ definitions:
         description: 固定价格    -   [挂牌]
         type: number
       freezecharge:
-        description: 冻结手续费
+        description: 期初均价
         type: number
       freezemargin:
-        description: 冻结保证金(保证金)
+        description: 期初均价
         type: number
       futupricemove:
         description: 期货升贴水
@@ -23112,7 +23350,7 @@ definitions:
         description: 提单ID(208+Unix秒时间戳(10位)+xxxxxx)
         type: string
       marginvalue:
-        description: 保证金设置值(履约保证金)
+        description: 期初均价
         type: number
       marketid:
         description: 市场ID
@@ -23293,7 +23531,7 @@ definitions:
         description: 买卖 - 0:买 1:卖
         type: integer
       delistminqty:
-        description: 起摘数量
+        description: 期初均价
         type: number
       deliverymonth:
         description: 交收月
@@ -23573,7 +23811,7 @@ definitions:
         description: 履约类型 名称
         type: string
       unpaidamount:
-        description: 剩余款(待支付金额)
+        description: 期初均价
         type: number
       userid:
         description: 用户id
@@ -23985,7 +24223,7 @@ definitions:
         description: 是否允许部份摘牌 - 0:不允许 1:允许
         type: integer
       delistminqty:
-        description: 起摘数量
+        description: 期初均价
         type: number
       deliverygoodscode:
         description: 品种代码
@@ -24087,10 +24325,10 @@ definitions:
         description: 日期 格式 yyyymmdd
         type: string
       tradeamount:
-        description: 日成交金额(当日单方向成交金额)
+        description: 期初均价
         type: number
       tradeqty:
-        description: 日成交数量(当日单方向成交数量)
+        description: 期初均价
         type: number
       wrstandardid:
         description: 现货商品ID
@@ -24217,7 +24455,7 @@ definitions:
         description: 已计利息 -> 已计费用
         type: number
       unpaidinterest:
-        description: 未结费用
+        description: 期初均价
         type: number
       updatetime:
         description: 更新时间
@@ -24653,7 +24891,7 @@ definitions:
         description: 委托单号
         type: string
       orderprice:
-        description: 委托价格
+        description: 期初均价
         type: number
       orderqty:
         description: 委托数量
@@ -26980,8 +27218,7 @@ definitions:
           $ref: '#/definitions/models.Goodsgroup'
         type: array
       loginAccount:
-        allOf:
-        - $ref: '#/definitions/models.Loginaccount'
+        $ref: '#/definitions/models.Loginaccount'
         description: 登录账号
       markets:
         description: 市场
@@ -26994,12 +27231,10 @@ definitions:
           $ref: '#/definitions/models.Systemparam'
         type: array
       userAccount:
-        allOf:
-        - $ref: '#/definitions/models.Useraccount'
+        $ref: '#/definitions/models.Useraccount'
         description: 用户账号
       userInfo:
-        allOf:
-        - $ref: '#/definitions/models.Userinfo'
+        $ref: '#/definitions/models.Userinfo'
         description: 用户信息
       username:
         description: 用户姓名
@@ -33399,6 +33634,134 @@ paths:
       summary: 查询出境检测单据明细(批次信息)
       tags:
       - 广钻
+  /Guangzuan/QueryGZMyPresell:
+    get:
+      parameters:
+      - description: 预售申请ID
+        in: query
+        name: presaleapplyid
+        required: true
+        type: integer
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.GZMyPresell'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 我的预售列表查询
+      tags:
+      - 广钻
+  /Guangzuan/QueryGZMyTradingPreSell:
+    get:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: userid
+        required: true
+        type: integer
+      - description: 市场ID
+        in: query
+        name: marketid
+        required: true
+        type: integer
+      - description: 状态 1:预售中\集采中 2:执行中 3:已完成
+        in: query
+        name: status
+        type: integer
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.GZMyTradingPresell'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 我参与的预售(预售中\执行中)\我参与的集采(集采中\执行中) 列表查询
+      tags:
+      - 广钻
+  /Guangzuan/QueryGZPreSell:
+    get:
+      parameters:
+      - description: 预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成
+        in: query
+        name: presalestatus
+        required: true
+        type: integer
+      - description: 市场ID
+        in: query
+        name: marketid
+        required: true
+        type: integer
+      - description: 现货商品名称
+        in: query
+        name: wrstandardname
+        type: string
+      - description: 预售方
+        in: query
+        name: customername
+        type: string
+      - description: 发行方用户ID
+        in: query
+        name: selluserid
+        type: integer
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.GZPresell'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 预售大厅/我的预售/集采大厅/我的集采 列表查询
+      tags:
+      - 广钻
   /Guangzuan/QueryGzbscPosition:
     get:
       parameters:

+ 355 - 0
models/guangzuan.go

@@ -4170,3 +4170,358 @@ func (r *Gzmemberinfo) GetAll() (rsp []Gzmemberinfo, err error) {
 	err = db.GetEngine().OrderBy("ORDERINDEX").Find(&rsp)
 	return
 }
+
+type GZPresell struct {
+	PRESALEAPPLYID     string    `json:"presaleapplyid" xorm:"PRESALEAPPLYID"`                                       // 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
+	SELLUSERID         int64     `json:"selluserid" xorm:"SELLUSERID" form:"selluserid"`                             // 发行方用户ID
+	SELLACCOUNTID      int64     `json:"sellaccountid" xorm:"SELLACCOUNTID"`                                         // 发行方资金账户ID
+	DELIVERYGOODSID    int32     `json:"deliverygoodsid" xorm:"DELIVERYGOODSID"`                                     // 现货品种ID
+	WAREHOUSEID        int64     `json:"warehouseid" xorm:"WAREHOUSEID"`                                             // 仓库ID
+	WRSTANDARDID       int64     `json:"wrstandardid" xorm:"WRSTANDARDID"`                                           // 现货商品ID
+	WRFACTORTYPEID     int64     `json:"wrfactortypeid" xorm:"WRFACTORTYPEID"`                                       // 仓单要素类型ID - 根据现货商品\仓库生成
+	WRSTANDARDNAME     string    `json:"wrstandardname" xorm:"WRSTANDARDNAME" form:"wrstandardname"`                 // 现货商品名称
+	UNITID             int32     `json:"unitid" xorm:"UNITID"`                                                       // 单位ID
+	UNITPRICE          float64   `json:"unitprice" xorm:"UNITPRICE"`                                                 // 商品单价
+	PRESALEQTY         int64     `json:"presaleqty" xorm:"PRESALEQTY"`                                               // 预售总量
+	BASEQTY            int64     `json:"baseqty" xorm:"BASEQTY"`                                                     // 中签基数
+	MAXBUYQTY          int64     `json:"maxbuyqty" xorm:"MAXBUYQTY"`                                                 // 单人最大申购量
+	MAXLUCKYQTY        int64     `json:"maxluckyqty" xorm:"MAXLUCKYQTY"`                                             // 单人最大中签量 - 作废
+	STARTDATE          string    `json:"startdate" xorm:"STARTDATE"`                                                 // 预售开始日期
+	ENDDATE            string    `json:"enddate" xorm:"ENDDATE"`                                                     // 预售结束日期
+	TAKESTARTDATE      time.Time `json:"takestartdate" xorm:"TAKESTARTDATE"`                                         // 提货开始日期
+	THUMURLS           string    `json:"thumurls" xorm:"THUMURLS"`                                                   // 缩略图片(1:1)(逗号分隔)
+	PICTUREURLS        string    `json:"pictureurls" xorm:"PICTUREURLS"`                                             // 详情图片(逗号分隔)
+	BANNERPICURL       string    `json:"bannerpicurl" xorm:"BANNERPICURL"`                                           // Banner图(逗号分隔)
+	PRESALESTATUS      int32     `json:"presalestatus" xorm:"PRESALESTATUS" form:"presalestatus" binding:"required"` // 预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭 5:处理中 6::处理失败 7:已完成
+	LOTTERYFLAG        int32     `json:"lotteryflag" xorm:"LOTTERYFLAG"`                                             // 摇号标识 - 0:未摇号 1:已摇号 2:摇号中 3:摇号失败
+	LOTTERYQTY         int64     `json:"lotteryqty" xorm:"LOTTERYQTY"`                                               // 摇号总量
+	LUCKYQTY           int64     `json:"luckyqty" xorm:"LUCKYQTY"`                                                   // 已中签量\成交量
+	PLACEQTY           int64     `json:"placeqty" xorm:"PLACEQTY"`                                                   // 已配售量
+	MARKETID           int32     `json:"marketid" xorm:"MARKETID" form:"marketid" binding:"required"`                // 市场ID
+	SELLWRTRADEORDERID int64     `json:"sellwrtradeorderid" xorm:"SELLWRTRADEORDERID"`                               // 发行方卖委托单ID
+	CREATETIME         time.Time `json:"-" xorm:"CREATETIME"`                                                        // 创建时间
+	TRADEDATE          string    `json:"tradedate" xorm:"TRADEDATE"`                                                 // 交易日
+	LUCKYNUMS          string    `json:"luckynums" xorm:"LUCKYNUMS"`                                                 // 中签号码(按顺序逗号分隔)
+	LASTPRICE          float64   `json:"lastprice" xorm:"LASTPRICE"`                                                 // 实际价格(64)
+	ENDHANDLETIME      time.Time `json:"endhandletime" xorm:"ENDHANDLETIME"`                                         // 到期处理时间
+
+	YSZSCATEGORY          int32  `json:"yszscategory" xorm:"YSZSCATEGORY"`                   // 钻石分类 - 枚举”YSZSCategory“ 1:成品裸钻 2:毛坯钻石
+	ZSSHAPETYPESTR        string `json:"zsshapetypestr" xorm:"ZSSHAPETYPESTR"`               // 形状 [1:成品裸钻]
+	ZSCOLORTYPESTR        string `json:"zscolortypestr" xorm:"ZSCOLORTYPESTR"`               // 颜色 [1:成品裸钻 \ 2:毛坯钻石]
+	ZSCLARITYTYPESTR      string `json:"zsclaritytypestr" xorm:"ZSCLARITYTYPESTR"`           // 净度 [1:成品裸钻 \ 2:毛坯钻石]
+	ZSCUTTYPESTR          string `json:"zscuttypestr" xorm:"ZSCUTTYPESTR"`                   // 切工 [1:成品裸钻]
+	ZSSYMMETRYTYPESTR     string `json:"zssymmetrytypestr" xorm:"ZSSYMMETRYTYPESTR"`         // 对称 [1:成品裸钻]
+	ZSPOLISHTYPESTR       string `json:"zspolishtypestr" xorm:"ZSPOLISHTYPESTR"`             // 抛光 [1:成品裸钻]
+	ZSFLUORESCENCETYPESTR string `json:"zsfluorescencetypestr" xorm:"ZSFLUORESCENCETYPESTR"` // 荧光 [1:成品裸钻]
+	SIZESTR               string `json:"sizestr" xorm:"SIZESTR"`                             // 尺寸 [1:成品裸钻 \ 2:毛坯钻石]
+	YIELDRATE             string `json:"yieldrate" xorm:"YIELDRATE"`                         // 成品率 [2:毛坯钻石]
+	QTYDESC               string `json:"qtydesc" xorm:"QTYDESC"`                             // 数量描述 [2:毛坯钻石]
+	WEIGHTDESC            string `json:"weightdesc" xorm:"WEIGHTDESC"`                       // 重量描述 [2:毛坯钻石]
+	YSPRODUCTIONMODE      int32  `json:"ysproductionmode" xorm:"YSPRODUCTIONMODE"`           // 生产方式  - 枚举”YSProductionMode“  [2:毛坯钻石] 1:HPHT 2:CVD
+	REMARK                string `json:"remark" xorm:"REMARK"`                               // 备注
+
+	Customername string `json:"customername"  xorm:"'CUSTOMERNAME'" form:"customername"` // 企业名称(预售方)
+	TRADEQTY     int64  `json:"-" xorm:"TRADEQTY"`                                       // 成交数量(预售数量)
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *GZPresell) calc() {
+
+}
+
+func (r *GZPresell) buildSql() string {
+	var sqlId utils.SQLVal = `
+	select 
+		ui.CUSTOMERNAME, 
+		ot.TRADEQTY, 
+		to_char(pi.PRESALEAPPLYID) PRESALEAPPLYID,
+		pi.SELLUSERID,
+		pi.SELLACCOUNTID,
+		pi.DELIVERYGOODSID,
+		pi.WAREHOUSEID,
+		pi.WRSTANDARDID,
+		pi.WRFACTORTYPEID,
+		pi.WRSTANDARDNAME,
+		pi.UNITID,
+		pi.UNITPRICE,
+		pi.PRESALEQTY,
+		pi.BASEQTY,
+		pi.MAXBUYQTY,
+		pi.MAXLUCKYQTY,
+		to_char(pi.STARTDATE,'yyyy-mm-dd') STARTDATE,
+		to_char(pi.ENDDATE,'yyyy-mm-dd') ENDDATE,
+		pi.TAKESTARTDATE,
+		pi.THUMURLS,
+		pi.PICTUREURLS,
+		pi.BANNERPICURL,
+		pi.PRESALESTATUS,
+		pi.LOTTERYFLAG,
+		pi.LOTTERYQTY,
+		pi.LUCKYQTY,
+		pi.PLACEQTY,
+		pi.MARKETID,
+		pi.SELLWRTRADEORDERID,
+		pi.CREATETIME,
+		pi.TRADEDATE,
+		pi.LUCKYNUMS,
+		pi.LASTPRICE,
+		pi.ENDHANDLETIME,
+		pi.BUYMARGINALGORITHM,
+		pi.BUYMARGINVALUE,
+		pi.SELLMARGINALGORITHM,
+		pi.SELLMARGINVALUE,
+		pi.PERFORMANCETEMPLATEID,
+		pi.MINBUYQTY,
+		pi.MINSUCCESSQTY, 
+		paex.YSZSCATEGORY,
+		paex.ZSSHAPETYPESTR,
+		paex.ZSCOLORTYPESTR,
+		paex.ZSCLARITYTYPESTR,
+		paex.ZSCUTTYPESTR,
+		paex.ZSSYMMETRYTYPESTR,
+		paex.ZSPOLISHTYPESTR,
+		paex.ZSFLUORESCENCETYPESTR,
+		paex.SIZESTR,
+		paex.YIELDRATE,
+		paex.QTYDESC,
+		paex.WEIGHTDESC,
+		paex.YSPRODUCTIONMODE,
+		paex.REMARK 
+	from WR_PresaleInfo pi
+	left join userinfo ui on pi.selluserid = ui.userid
+	left join wrtrade_orderdetail ot on pi.sellwrtradeorderid = ot.wrtradeorderid
+	left join GZ_WR_PresaleApplyEx paex on pi.presaleapplyid = paex.presaleapplyid
+	where 1=1
+	`
+
+	sqlId.And("pi.PRESALESTATUS", r.PRESALESTATUS)
+	sqlId.And("pi.MARKETID ", r.MARKETID)
+	sqlId.AndLike("ui.CUSTOMERNAME", r.Customername)
+	sqlId.AndLike("pi.wrstandardname", r.WRSTANDARDNAME)
+	sqlId.AndEx("pi.selluserid", r.SELLUSERID, r.SELLUSERID != 0)
+	sqlId.OrderBy("pi.createtime DESC, pi.wrstandardname")
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *GZPresell) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]GZPresell, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	total := 0
+	for i := range sData {
+		sData[i].calc()
+		total = sData[i].Total
+	}
+	return sData, err, r.Page, r.PageSize, total
+}
+
+type GZMyPresell struct {
+	ORDERQTY     int64   `json:"orderqty" xorm:"ORDERQTY"`         // 委托数量
+	TRADEPRICE   float64 `json:"tradeprice" xorm:"TRADEPRICE"`     // 成交价格 - [摘牌] (浮动价  ((商品1价格*商品1价格系数+升贴水)* 商品1重量系数 + 商品2价格*商品2价格系数+商品2升贴水)* 商品2重量系数 ...)* 委托单价格系数 + 委托单升贴水)
+	FREEZEMARGIN float64 `json:"freezemargin" xorm:"FREEZEMARGIN"` // 冻结保证金
+	ORDERTIME    string  `json:"ordertime" xorm:"ORDERTIME"`       // 委托时间(认购时间)
+
+	Customername string `json:"customername"  xorm:"'CUSTOMERNAME'" form:"customername"` // 企业名称(认购方)
+
+	PRESALEAPPLYID string `json:"-" xorm:"-" form:"presaleapplyid" binding:"required"` // 预售申请ID
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *GZMyPresell) calc() {
+
+}
+
+func (r *GZMyPresell) buildSql() string {
+	var sqlId utils.SQLVal = `
+	select 
+		ui.CUSTOMERNAME,
+		od.ORDERQTY,
+		od.TRADEPRICE,
+		od.FREEZEMARGIN,
+		to_char(od.ORDERTIME, 'yyyy-mm-dd hh24:mi:ss') ORDERTIME
+	from WRTrade_OrderDetail od
+	left join userinfo ui on od.userid = ui.userid
+	where od.wrtradetype = 2 and od.buyorsell = 0 and od.wrtradeorderstatus = 3
+	`
+
+	sqlId.And("od.presaleapplyid", r.PRESALEAPPLYID)
+	sqlId.OrderBy("od.wrtradeorderid desc")
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *GZMyPresell) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]GZMyPresell, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	total := 0
+	for i := range sData {
+		sData[i].calc()
+		total = sData[i].Total
+	}
+	return sData, err, r.Page, r.PageSize, total
+}
+
+type GZMyTradingPresell struct {
+	PRESALEAPPLYID        string `json:"presaleapplyid" xorm:"PRESALEAPPLYID"`               // 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
+	YSZSCATEGORY          int32  `json:"yszscategory" xorm:"YSZSCATEGORY"`                   // 钻石分类 - 枚举”YSZSCategory“ 1:成品裸钻 2:毛坯钻石
+	ZSSHAPETYPESTR        string `json:"zsshapetypestr" xorm:"ZSSHAPETYPESTR"`               // 形状 [1:成品裸钻]
+	ZSCOLORTYPESTR        string `json:"zscolortypestr" xorm:"ZSCOLORTYPESTR"`               // 颜色 [1:成品裸钻 \ 2:毛坯钻石]
+	ZSCLARITYTYPESTR      string `json:"zsclaritytypestr" xorm:"ZSCLARITYTYPESTR"`           // 净度 [1:成品裸钻 \ 2:毛坯钻石]
+	ZSCUTTYPESTR          string `json:"zscuttypestr" xorm:"ZSCUTTYPESTR"`                   // 切工 [1:成品裸钻]
+	ZSSYMMETRYTYPESTR     string `json:"zssymmetrytypestr" xorm:"ZSSYMMETRYTYPESTR"`         // 对称 [1:成品裸钻]
+	ZSPOLISHTYPESTR       string `json:"zspolishtypestr" xorm:"ZSPOLISHTYPESTR"`             // 抛光 [1:成品裸钻]
+	ZSFLUORESCENCETYPESTR string `json:"zsfluorescencetypestr" xorm:"ZSFLUORESCENCETYPESTR"` // 荧光 [1:成品裸钻]
+	SIZESTR               string `json:"sizestr" xorm:"SIZESTR"`                             // 尺寸 [1:成品裸钻 \ 2:毛坯钻石]
+	YIELDRATE             string `json:"yieldrate" xorm:"YIELDRATE"`                         // 成品率 [2:毛坯钻石]
+	QTYDESC               string `json:"qtydesc" xorm:"QTYDESC"`                             // 数量描述 [2:毛坯钻石]
+	WEIGHTDESC            string `json:"weightdesc" xorm:"WEIGHTDESC"`                       // 重量描述 [2:毛坯钻石]
+	YSPRODUCTIONMODE      int32  `json:"ysproductionmode" xorm:"YSPRODUCTIONMODE"`           // 生产方式  - 枚举”YSProductionMode“  [2:毛坯钻石] 1:HPHT 2:CVD
+	REMARK                string `json:"remark" xorm:"REMARK"`                               // 备注
+
+	Customername          string  `json:"customername"  xorm:"'CUSTOMERNAME'" form:"customername"` // 企业名称(预售方)
+	ORDERQTY              int64   `json:"orderqty" xorm:"ORDERQTY"`                                // 委托数量
+	TRADEPRICE            float64 `json:"tradeprice" xorm:"TRADEPRICE"`                            // 成交价格 - [摘牌] (浮动价  ((商品1价格*商品1价格系数+升贴水)* 商品1重量系数 + 商品2价格*商品2价格系数+商品2升贴水)* 商品2重量系数 ...)* 委托单价格系数 + 委托单升贴水)
+	Tradeamount           float64 `json:"tradeamount" xorm:"TRADEAMOUNT"`                          // 货款
+	MARGINALGORITHM       int32   `json:"marginalgorithm" xorm:"MARGINALGORITHM"`                  // 保证金方式 - 1:比率  2:固定
+	MARGINVALUE           float64 `json:"marginvalue" xorm:"MARGINVALUE"`                          // 保证金设置值
+	FREEZEMARGIN          float64 `json:"freezemargin" xorm:"FREEZEMARGIN"`                        // 冻结保证金
+	ORDERTIME             string  `json:"ordertime" xorm:"ORDERTIME"`                              // 委托时间(认购时间)
+	WRTRADEORDERID        int64   `json:"wrtradeorderid" xorm:"WRTRADEORDERID"`                    // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+	PERFORMANCETEMPLATEID int64   `json:"performancetemplateid" xorm:"PERFORMANCETEMPLATEID"`      // 履约计划模板ID
+	PERFORMANCEPLANID     int64   `json:"performanceplanid" xorm:"PERFORMANCEPLANID"`              // 履约计划ID/合同ID
+
+	STATUS   int   `json:"status" xorm:"STATUS" form:"status"`            // 状态 1:预售中\集采中 2:执行中 3:已完成
+	USERID   int64 `json:"-" xorm:"-" form:"userid" binding:"required"`   // 申请用户ID
+	MARKETID int   `json:"-" xorm:"-" form:"marketid" binding:"required"` // 市场ID
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *GZMyTradingPresell) calc() {
+
+}
+
+func (r *GZMyTradingPresell) buildSql() string {
+	var sqlId utils.SQLVal = `
+	select 
+	   ui.CUSTOMERNAME,
+       od.ORDERQTY,
+       od.TRADEPRICE,
+       (od.orderqty * od.tradeprice) TRADEAMOUNT,
+       od.MARGINALGORITHM,
+       od.MARGINVALUE,
+       od.FREEZEMARGIN,
+       to_char(od.ORDERTIME, 'yyyy-mm-dd hh24:mi:ss') ORDERTIME,
+       od.WRTRADEORDERID,
+       od.PERFORMANCETEMPLATEID,
+       td.PERFORMANCEPLANID,
+       pi.PRESALESTATUS,
+       to_char(paex.PRESALEAPPLYID) PRESALEAPPLYID,
+       paex.YSZSCATEGORY,
+       paex.ZSSHAPETYPESTR,
+       paex.ZSCOLORTYPESTR,
+       paex.ZSCLARITYTYPESTR,
+       paex.ZSCUTTYPESTR,
+       paex.ZSSYMMETRYTYPESTR,
+       paex.ZSPOLISHTYPESTR,
+       paex.ZSFLUORESCENCETYPESTR,
+       paex.SIZESTR,
+       paex.YIELDRATE,
+       paex.QTYDESC,
+       paex.WEIGHTDESC,
+       paex.YSPRODUCTIONMODE,
+       paex.REMARK,
+	   %v STATUS 
+  from WRTrade_OrderDetail od
+  left join WRTrade_TradeDetail td
+    on od.wrtradeorderid = td.WRTradeOrderID
+  left join WR_PresaleInfo pi
+    on od.presaleapplyid = pi.presaleapplyid
+  left join userinfo ui
+    on pi.selluserid = ui.userid
+  left join GZ_WR_PresaleApplyEx paex
+    on pi.presaleapplyid = paex.presaleapplyid
+	where od.buyorsell = 0 
+	`
+
+	sqlId.FormatParam(r.STATUS)
+	sqlId.And("od.marketid", r.MARKETID)
+	sqlId.And("pi.presalestatus", r.STATUS)
+	sqlId.And("od.userid", r.USERID)
+	sqlId.OrderByDesc("od.wrtradeorderid")
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *GZMyTradingPresell) buildSql2() string {
+	var sqlId utils.SQLVal = `
+	select 
+		ui.CUSTOMERNAME,
+		hod.ORDERQTY,
+		hod.TRADEPRICE,
+		htd.TRADEAMOUNT,
+		hod.MARGINALGORITHM,
+		hod.MARGINVALUE,
+		hod.FREEZEMARGIN,
+		to_char(htd.tradetime, 'yyyy-mm-dd hh24:mi:ss') ORDERTIME,
+		hod.WRTRADEORDERID,
+		hod.PERFORMANCETEMPLATEID,
+		htd.PERFORMANCEPLANID,
+		paex.PRESALEAPPLYID,
+		paex.YSZSCATEGORY,
+		paex.ZSSHAPETYPESTR,
+		paex.ZSCOLORTYPESTR,
+		paex.ZSCLARITYTYPESTR,
+		paex.ZSCUTTYPESTR,
+		paex.ZSSYMMETRYTYPESTR,
+		paex.ZSPOLISHTYPESTR,
+		paex.ZSFLUORESCENCETYPESTR,
+		paex.SIZESTR,
+		paex.YIELDRATE,
+		paex.QTYDESC,
+		paex.WEIGHTDESC,
+		paex.YSPRODUCTIONMODE,
+		paex.REMARK
+	from his_wrtrade_tradedetail htd
+		left join his_wrtrade_orderdetail hod
+		on hod.isvaliddata = 1
+		and htd.wrtradeorderid = hod.wrtradeorderid
+	left join WR_PresaleInfo pi
+		on hod.presaleapplyid = pi.presaleapplyid
+	left join userinfo ui
+		on pi.selluserid = ui.userid
+	left join GZ_WR_PresaleApplyEx paex
+		on pi.presaleapplyid = paex.presaleapplyid
+	where htd.isvaliddata = 1
+		and htd.HandleStatus = 4
+		and htd.buyorsell = 0
+	`
+
+	sqlId.And("htd.marketid", r.MARKETID)
+	sqlId.And("hod.userid", r.USERID)
+	sqlId.OrderByDesc("hod.wrtradeorderid")
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *GZMyTradingPresell) GetDataByPage() (interface{}, error, int, int, int) {
+	sql := r.buildSql()
+	if r.STATUS == 3 {
+		sql = r.buildSql2()
+	}
+
+	sData := make([]GZMyTradingPresell, 0)
+	err := db.GetEngine().SQL(sql).Find(&sData)
+	total := 0
+	for i := range sData {
+		sData[i].calc()
+		total = sData[i].Total
+	}
+	return sData, err, r.Page, r.PageSize, total
+}

+ 3 - 0
routers/router.go

@@ -704,6 +704,9 @@ func InitRouter() *gin.Engine {
 		guangzuanR.GET("QueryBscinoutorder", guangzuan.QueryBscinoutorder)
 		guangzuanR.GET("GetGZBSCGoods", guangzuan.GetGZBSCGoods)
 		guangzuanR.GET("GetGZMemberInfo", guangzuan.GetGZMemberInfo)
+		guangzuanR.GET("QueryGZPreSell", guangzuan.QueryGZPreSell)
+		guangzuanR.GET("QueryGZMyPresell", guangzuan.QueryGZMyPresell)
+		guangzuanR.GET("QueryGZMyTradingPreSell", guangzuan.QueryGZMyTradingPreSell)
 	}
 
 	// **************************上海铁合金*************************

Неке датотеке нису приказане због велике количине промена