瀏覽代碼

增加“钻石搜索”接口

zhou.xiaoning 3 年之前
父節點
當前提交
d3d3ccb487
共有 11 個文件被更改,包括 1866 次插入263 次删除
  1. 43 2
      controllers/guangzuan/trade.go
  2. 594 72
      docs/docs.go
  3. 592 63
      docs/swagger.json
  4. 455 72
      docs/swagger.yaml
  5. 12 1
      global/app/ginUtils.go
  6. 7 8
      go.mod
  7. 18 43
      go.sum
  8. 6 0
      models/ermcpCommon.go
  9. 126 1
      models/guangzuan.go
  10. 3 1
      routers/router.go
  11. 10 0
      utils/sqlUtils.go

+ 43 - 2
controllers/guangzuan/trade.go

@@ -17,7 +17,7 @@ import (
 // @Param zscategory query int false "钻石分类枚举ID"
 // @Param wrtradeorderid query int false "委托单号"
 // @Param buyusername query string false "买方(查询字段-模糊查询)"
-// @Success 200 {array} models.GZWarehouseinfo
+// @Success 200 {array} models.BuyOrder
 // @Failure 500 {object} app.Response
 // @Router /Guangzuan/QueryBuyOrder [get]
 // @Tags 广钻
@@ -38,7 +38,7 @@ func QueryBuyOrder(c *gin.Context) {
 // @Param zscategory query int false "钻石分类枚举ID"
 // @Param wrtradeorderid query int false "委托单号"
 // @Param buyusername query string false "卖方(查询字段-模糊查询)"
-// @Success 200 {array} models.GZWarehouseinfo
+// @Success 200 {array} models.SellOrder
 // @Failure 500 {object} app.Response
 // @Router /Guangzuan/QuerySellOrder [get]
 // @Tags 广钻
@@ -48,3 +48,44 @@ func QuerySellOrder(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataByPage(&m)
 }
+
+// QueryDiamond
+// @Summary 钻石搜索
+// @Produce json
+// @Security ApiKeyAuth
+// @Param data body models.SellOrderQueryReq true "钻石搜索入参"
+// @Success 200 {array} models.SellOrder
+// @Failure 500 {object} app.Response
+// @Router /Guangzuan/QueryDiamond [post]
+// @Tags 广钻
+func QueryDiamond(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	req := models.SellOrderQueryReq{}
+	a.DoBindJsonReq(&req)
+
+	m := models.SellOrder{
+		IsQueryDiamond: true,
+
+		ZSCATEGORY:         req.ZSCATEGORY,
+		ZSCURRENCYTYPE_S:   req.ZSCURRENCYTYPE,
+		WAREHOUSEID:        req.WAREHOUSEID,
+		WEIGHT:             req.WEIGHT1,
+		WEIGHT_END:         req.WEIGHT2,
+		WEIGHTAVG:          req.WEIGHTAVG1,
+		WEIGHTAVG_END:      req.WEIGHTAVG2,
+		ZSSHAPETYPE:        req.ZSSHAPETYPE,
+		ZSCOLORTYPE:        req.ZSCOLORTYPE,
+		ZSCLARITYTYPE:      req.ZSCLARITYTYPE,
+		ZSCUTTYPE:          req.ZSCUTTYPE,
+		ZSSYMMETRYTYPE:     req.ZSSYMMETRYTYPE,
+		ZSPOLISHTYPE:       req.ZSPOLISHTYPE,
+		ZSFLUORESCENCETYPE: req.ZSFLUORESCENCETYPE,
+		ZSCERTTYPE:         req.ZSCERTTYPE,
+		ORIGIN:             req.ORIGIN,
+		ZSSTYLETYPE:        req.ZSSTYLETYPE,
+		ZSCZCOLOR1TYPE:     req.ZSCZCOLOR1TYPE,
+
+		PageEx: models.PageEx{Page: req.Page, PageSize: req.PageSize},
+	}
+	a.DoGetDataByPage(&m)
+}

File diff suppressed because it is too large
+ 594 - 72
docs/docs.go


File diff suppressed because it is too large
+ 592 - 63
docs/swagger.json


+ 455 - 72
docs/swagger.yaml

@@ -1,11 +1,9 @@
-basePath: /api
 definitions:
   app.Response:
     properties:
       code:
         type: integer
-      data:
-        type: object
+      data: {}
       msg:
         type: string
       page:
@@ -1276,7 +1274,7 @@ definitions:
   ermcp.QryBusinessDjRsp:
     properties:
       amount:
-        description: 点价金额=(点价价格+升贴水)*点价数量
+        description: 期初均价
         type: number
       applyid:
         description: 申请人
@@ -1711,7 +1709,7 @@ definitions:
         description: 现货合同类型 - 1:采购 -1:销售
         type: integer
       deductamount:
-        description: 退款(非必填)
+        description: 期初均价
         type: number
       deliverygoodscode:
         description: 现货品种代码
@@ -1741,7 +1739,7 @@ definitions:
         description: 操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
         type: integer
       payamount:
-        description: 收付款(非必填)
+        description: 期初均价
         type: number
       pricemove:
         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: 单位名称
@@ -3835,6 +3833,111 @@ definitions:
     - roletype
     - userid
     type: object
+  models.BuyOrder:
+    properties:
+      accountid:
+        description: 资金账户ID
+        type: integer
+      buyusername:
+        description: 买方
+        type: string
+      marketid:
+        description: 市场ID
+        type: integer
+      origin:
+        description: 原产地
+        type: string
+      remark:
+        description: 备注
+        type: string
+      userid:
+        description: 用户ID
+        type: integer
+      warehouseids:
+        description: 仓库ID - 多个, 逗号分隔
+        type: string
+      warehouseinfosdisplay:
+        type: string
+      wrtradeorderid:
+        description: '[委托单号]买委托单ID(320+Unix秒时间戳(10位)+xxxxxx)'
+        type: integer
+      zscategory:
+        description: 钻石分类 - 枚举”ZSCategory“
+        type: integer
+      zscategorydisplay:
+        type: string
+      zsclaritytype:
+        description: 净度 - 两个, 逗号分隔
+        type: string
+      zsclaritytypedisplay:
+        type: string
+      zscolortype:
+        description: 颜色 - 两个, 逗号分隔
+        type: string
+      zscolortypedisplay:
+        type: string
+      zscrystaltype:
+        description: 晶型 -  多个,逗号分隔
+        type: string
+      zscrystaltypedisplay:
+        type: string
+      zscurrencytype:
+        description: 货币类型 -   多个, 逗号分隔
+        type: string
+      zscurrencytypedisplay:
+        type: string
+      zscuttype:
+        description: 切工 - 两个, 逗号分隔
+        type: string
+      zscuttypedisplay:
+        type: string
+      zsczcolor1type:
+        description: 彩钻颜色1, 逗号分隔
+        type: string
+      zsczcolor1typedisplay:
+        type: string
+      zsczcolor2type:
+        description: 彩钻颜色2, 逗号分隔
+        type: string
+      zsczcolor2typedisplay:
+        type: string
+      zsczcolor3type:
+        description: 彩钻颜色3, 逗号分隔
+        type: string
+      zsczcolor3typedisplay:
+        type: string
+      zsfluorescencetype:
+        description: 荧光 - 多个, 逗号分隔
+        type: string
+      zsfluorescencetypedisplay:
+        type: string
+      zspolishtype:
+        description: 抛光度 - 两个, 逗号分隔
+        type: string
+      zspolishtypedisplay:
+        type: string
+      zsshapetype:
+        description: 形状 - 多个, 逗号分隔
+        type: string
+      zsshapetypedisplay:
+        type: string
+      zssize:
+        description: 尺寸 - 两个小数, 逗号分隔
+        type: string
+      zsstyletype:
+        description: 款式 -  多个, 逗号分隔
+        type: string
+      zsstyletypedisplay:
+        type: string
+      zssymmetrytype:
+        description: 对称度 - 两个, 逗号分隔
+        type: string
+      zssymmetrytypedisplay:
+        type: string
+      zstabledisplay:
+        description: 求购信息
+        type: string
+    type: object
   models.Clientfixedadconfig:
     properties:
       adsort:
@@ -4749,7 +4852,7 @@ definitions:
         description: 期末额
         type: number
       curaverageprice:
-        description: 期均价
+        description: 期均价
         type: number
       curbuyamount:
         description: 期末采购总额
@@ -4758,7 +4861,7 @@ definitions:
         description: 期末采购总量
         type: number
       curmarketvalue:
-        description: 参考市值(期末市值)
+        description: 期初均价
         type: number
       curqty:
         description: 期末量
@@ -4776,7 +4879,7 @@ definitions:
         description: 期末销售总量
         type: number
       curspotprice:
-        description: 参考市价(最新价)
+        description: 期初均价
         type: number
       cycletime:
         description: 周期时间 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
@@ -4800,7 +4903,7 @@ definitions:
         description: 现货品种单位名称(作废)
         type: string
       floatpl:
-        description: 浮动损益
+        description: 期初均价
         type: number
       goodsunitid:
         description: 现货品种单位id(作废)
@@ -4836,7 +4939,7 @@ definitions:
         description: 今日采购额(今采购额)
         type: number
       todaybuyaverageprice:
-        description: 今日采购均价
+        description: 期初均价
         type: number
       todaybuyqty:
         description: 今日采购量(今采购量)
@@ -4851,7 +4954,7 @@ definitions:
         description: 今日销售额(今销售额)
         type: number
       todaysellaverageprice:
-        description: 今日销售均价
+        description: 期初均价
         type: number
       todaysellqty:
         description: 今日销售量(今销售量)
@@ -7031,7 +7134,7 @@ definitions:
         description: 合同类型 1:采购 -1:销售
         type: integer
       convertratio:
-        description: 折算系数
+        description: 期初均价
         type: number
       cycletime:
         description: 周期时间 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
@@ -7049,16 +7152,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: 交易对手方(个人:用户名称 企业:简称)
@@ -7076,64 +7179,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: 更新时间
@@ -7142,7 +7245,7 @@ definitions:
         description: 合同所属用户id
         type: integer
       vatrate:
-        description: 增值税率
+        description: 期初均价
         type: number
       wrstandardcode:
         description: 商品(品类) 代码
@@ -7550,7 +7653,7 @@ definitions:
         description: 手续费
         type: number
       closeavgprice:
-        description: 平仓均价
+        description: 期初均价
         type: number
       closepl:
         description: 平仓损益
@@ -7601,7 +7704,7 @@ definitions:
         description: 期末持仓额
         type: number
       holdqty:
-        description: 期末持仓量
+        description: 期初均价
         type: number
       lastholdamount:
         description: 当前持仓额
@@ -7625,13 +7728,13 @@ definitions:
         description: 期末开仓额
         type: number
       openavgprice:
-        description: 开仓均价
+        description: 期初均价
         type: number
       oriholdamount:
         description: 期初持仓额
         type: number
       oriholdqty:
-        description: 期初持仓量
+        description: 期初均价
         type: number
       oriopenamount:
         description: 期初开仓额
@@ -7664,7 +7767,7 @@ definitions:
         description: 今平仓额
         type: number
       todaycloseqty:
-        description: 今平仓量
+        description: 期初均价
         type: number
       todaygoodsgroupspotqty:
         description: 交易品种变化量 (=(期末持仓量 - 期初持仓量)* 合约乘数)
@@ -7676,7 +7779,7 @@ definitions:
         description: 今开仓额
         type: number
       todayopenqty:
-        description: 今开仓量
+        description: 期初均价
         type: number
       userid:
         description: 账户所属用户ID
@@ -15134,6 +15237,259 @@ definitions:
     - marketid
     - trademode
     type: object
+  models.SellOrder:
+    properties:
+      accountid:
+        description: 资金账号
+        type: integer
+      applyid:
+        description: 申请单ID
+        type: integer
+      attachment1:
+        description: 附件1
+        type: string
+      attachment2:
+        description: 附件2
+        type: string
+      buyorsell:
+        description: 买卖 - 0:买 1:卖
+        type: integer
+      canbargain:
+        description: 是否可议价 - 0:不可 1:可
+        type: integer
+      cancelqty:
+        description: 撤销数量
+        type: integer
+      canceltime:
+        description: 撤销时间
+        type: string
+      chargealgorithm:
+        description: 手续费收取方式 1:比率  2:固定
+        type: integer
+      chargealgorithmvalue:
+        description: 手续费设置值(交易所部分)
+        type: number
+      chargealgorithmvalue2:
+        description: 手续费设置值(会员部分)
+        type: number
+      clientordertime:
+        description: 客户端委托时间
+        type: string
+      exchangerate:
+        description: 汇率[67]
+        type: number
+      firstratio:
+        description: 首付比率 - [挂牌时指定,摘牌时使用]
+        type: number
+      fixedprice:
+        description: 固定价格    -   [挂牌]
+        type: number
+      freezecharge:
+        description: 冻结手续费
+        type: number
+      freezefirstamount:
+        description: 冻结首付金额 - [摘牌]
+        type: number
+      freezemargin:
+        description: 冻结保证金
+        type: number
+      goodsno:
+        description: 商品编号
+        type: string
+      isQueryDiamond:
+        description: 是否钻石查询
+        type: boolean
+      isspecified:
+        description: 是否指定对手 - 0:不指定 1:指定好友(贸易圈) 2:指定对手    -   [挂牌]
+        type: integer
+      marginalgorithm:
+        description: 保证金方式 - 1:比率  2:固定
+        type: integer
+      marginvalue:
+        description: 保证金设置值
+        type: number
+      marketid:
+        description: 市场ID
+        type: integer
+      orderamount:
+        description: 挂牌金额[账户] [67]= OrderQty * FixedPrice * ExchangeRate /100
+        type: number
+      orderqty:
+        description: 委托数量
+        type: integer
+      ordertime:
+        description: 委托时间
+        type: string
+      performancetemplateid:
+        description: 履约计划模板ID
+        type: integer
+      pricefactor:
+        description: 价格系数(浮动价时填写)    -   [挂牌]
+        type: number
+      pricemove:
+        description: 升贴水(浮动价时填写)    -   [挂牌]
+        type: number
+      relatedwrtradeorderid:
+        description: 关联委托单号(摘牌委托关联挂牌委托单ID)
+        type: integer
+      retcode:
+        description: 错误代码
+        type: integer
+      sellusername:
+        description: 卖方(查询字段-模糊查询)
+        type: string
+      tradedate:
+        description: 交易日(yyyyMMdd)
+        type: string
+      tradeprice:
+        description: 成交价格 - [摘牌] (浮动价  ((商品1价格*商品1价格系数+升贴水)* 商品1重量系数 + 商品2价格*商品2价格系数+商品2升贴水)*
+          商品2重量系数 ...)* 委托单价格系数 + 委托单升贴水)
+        type: number
+      tradeqty:
+        description: 成交数量
+        type: integer
+      unfreezecharge:
+        description: 解冻手续费
+        type: number
+      unfreezefirstamount:
+        description: 解冻首付金额 - [摘牌]
+        type: number
+      unfreezemargin:
+        description: 解冻保证金
+        type: number
+      userid:
+        description: 用户ID
+        type: integer
+      uuid:
+        description: 发起端唯一id
+        type: string
+      validtime:
+        description: 有效期限
+        type: string
+      validtype:
+        description: 有效类型 - 1当日有效 2本周有效 3指定日期有效 4一直有效
+        type: integer
+      wrbargainid:
+        description: 议价申请单ID
+        type: integer
+      wrfactortypeid:
+        description: 仓单要素类型ID/商品ID(77)
+        type: integer
+      wrpricetype:
+        description: 价格方式 - 1:固定价 2-浮动价  -   [挂牌]
+        type: integer
+      wrstandardid:
+        description: 现货商品ID
+        type: integer
+      wrtradeorderid:
+        description: 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        type: integer
+      wrtradeorderstatus:
+        description: 委托状态 - 参考枚举'WRTradeOrderStatus' - 1:委托请求  2:待冻结  3:委托成功  4:委托失败  5:配对成功  6:已撤  7:部成  8:已成  9:部成部撤  10:成交失败  11:委托拒绝  12:经过摘牌(先摘后挂专用)  13:冻结成功(通道交易专用)  14:通道已撤  15:通道部成部撤  16:成交失败违约(荷兰式竞拍专用)  17:冻结PD成功  18:冻结PD失败  19:冻结能量成功  20:冻结能量失败  21:预约已报价  22:过期未付  23:优惠券处理中  24:仓单生成失败  25:首付扣款失败  26:履约失败  27:撤单解冻贷款失败
+        type: integer
+      wrtradetype:
+        description: 仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)
+        type: integer
+      wrtransferuserid:
+        description: 仓单受让用户 - [摘牌]
+        type: integer
+      zscategory:
+        description: 钻石分类 - 枚举”ZSCategory“
+        type: integer
+      zscurrencytype:
+        description: 货币类型 - 枚举“ZSCurrencyType”
+        type: integer
+    type: object
+  models.SellOrderQueryReq:
+    properties:
+      TOTAL:
+        description: 总条数
+        type: integer
+      origin:
+        description: 原产地
+        type: string
+      page:
+        description: 页码
+        type: integer
+      pagesize:
+        description: 每页大小
+        type: integer
+      warehouseid:
+        description: 仓库ID
+        type: integer
+      weight1:
+        description: 总重量(克拉重量)-从
+        type: number
+      weight2:
+        description: 总重量(克拉重量)-至
+        type: number
+      weightavg1:
+        description: 平均单颗重量-从
+        type: number
+      weightavg2:
+        description: 平均单颗重量-至
+        type: number
+      zscategory:
+        description: 钻石分类 - 枚举”ZSCategory“
+        type: integer
+      zscerttype:
+        description: 证书类型
+        items:
+          type: string
+        type: array
+      zsclaritytype:
+        description: 净度
+        items:
+          type: integer
+        type: array
+      zscolortype:
+        description: 颜色
+        items:
+          type: integer
+        type: array
+      zscurrencytype:
+        description: 货币类型 - 枚举“ZSCurrencyType”
+        items:
+          type: string
+        type: array
+      zscuttype:
+        description: 切工
+        items:
+          type: integer
+        type: array
+      zsczcolor1type:
+        description: 彩钻颜色1
+        items:
+          type: string
+        type: array
+      zsfluorescencetype:
+        description: 荧光
+        items:
+          type: integer
+        type: array
+      zspolishtype:
+        description: 抛光度
+        items:
+          type: integer
+        type: array
+      zsshapetype:
+        description: 形状 - 枚举”ZSShapeType“ - 类型:1,2,4,5 ;(1为多个,逗号分隔)
+        items:
+          type: string
+        type: array
+      zsstyletype:
+        description: 款式
+        items:
+          type: string
+        type: array
+      zssymmetrytype:
+        description: 对称度
+        items:
+          type: integer
+        type: array
+    required:
+    - zscategory
+    type: object
   models.Systemparam:
     properties:
       loginid:
@@ -15886,7 +16242,7 @@ definitions:
         description: 委托单号
         type: string
       orderprice:
-        description: 委托价格
+        description: 期初均价
         type: number
       orderqty:
         description: 委托数量
@@ -15937,7 +16293,7 @@ definitions:
         description: 市场ID
         type: integer
       qty:
-        description: 转让数量(数量)
+        description: 期初均价
         type: number
       tradeid:
         description: 成交单号(关联持仓)
@@ -15982,7 +16338,7 @@ definitions:
         description: 行权日类型 - 1:滚动行权 2:固定日行权
         type: integer
       freezeqty:
-        description: 冻结数量
+        description: 期初均价
         type: number
       goodscode:
         description: 商品代码
@@ -16009,7 +16365,7 @@ definitions:
         description: 持仓价格
         type: number
       holderqty:
-        description: 持仓数量
+        description: 期初均价
         type: number
       isconfirmexercise:
         description: 是否确认行权- 0:否 1:是
@@ -16027,7 +16383,7 @@ definitions:
         description: 建仓价格
         type: number
       openqty:
-        description: 建仓数量
+        description: 期初均价
         type: number
       optiontype:
         description: 期权类型 - 1:认购(看涨) 2:认沽(看跌)
@@ -16696,13 +17052,13 @@ definitions:
         description: 单位名称
         type: string
       fixedprice:
-        description: 挂牌价格
+        description: 期初均价
         type: number
       handlestatus:
         description: 处理状态
         type: integer
       marginvalue:
-        description: 履约保证金比例
+        description: 期初均价
         type: number
       marketid:
         description: 市场ID
@@ -16837,7 +17193,7 @@ definitions:
   models.WrAverageTradePrice:
     properties:
       averageprice:
-        description: 成交均价
+        description: 期初均价
         type: number
       tradedate:
         description: 交易日yyyymm
@@ -17025,7 +17381,7 @@ definitions:
         description: 账号ID
         type: integer
       averageprice:
-        description: 交割均价 = 交割金额 / 交割数量
+        description: 期初均价
         type: number
       begindate:
         description: 开始交易日(yyyymmdd)
@@ -17112,7 +17468,7 @@ definitions:
         description: 合约数量
         type: number
       xgoodsamount:
-        description: 合约金额 = 货款金额(DELIVERYAMOUNT) - 点价货款(P1GOODSREMAINAMOUNT)
+        description: 期初均价
         type: number
       xgoodscode:
         description: 商品代码
@@ -17765,7 +18121,7 @@ definitions:
         description: 步骤名称
         type: string
       stepvalue:
-        description: 步骤值
+        description: 期初均价
         type: number
       templateid:
         description: 履约计划模板ID
@@ -17997,7 +18353,7 @@ definitions:
         description: 是否全好友可见 - 0:否 1:是
         type: integer
       amount:
-        description: 挂牌金额 = 委托数量 * 固定价或升贴水
+        description: 期初均价
         type: number
       bannerpicurl:
         description: Banner图
@@ -18042,10 +18398,10 @@ definitions:
         description: 固定价格    -   [挂牌]
         type: number
       freezecharge:
-        description: 冻结手续费
+        description: 期初均价
         type: number
       freezemargin:
-        description: 冻结保证金(保证金)
+        description: 期初均价
         type: number
       futupricemove:
         description: 期货升贴水
@@ -18072,7 +18428,7 @@ definitions:
         description: 提单ID(208+Unix秒时间戳(10位)+xxxxxx)
         type: string
       marginvalue:
-        description: 保证金设置值(履约保证金)
+        description: 期初均价
         type: number
       marketid:
         description: 市场ID
@@ -18247,7 +18603,7 @@ definitions:
         description: 买卖 - 0:买 1:卖
         type: integer
       delistminqty:
-        description: 起摘数量
+        description: 期初均价
         type: number
       deliverymonth:
         description: 交收月
@@ -18509,7 +18865,7 @@ definitions:
         description: 履约类型 名称
         type: string
       unpaidamount:
-        description: 剩余款(待支付金额)
+        description: 期初均价
         type: number
       userid:
         description: 用户id
@@ -18921,7 +19277,7 @@ definitions:
         description: 是否允许部份摘牌 - 0:不允许 1:允许
         type: integer
       delistminqty:
-        description: 起摘数量
+        description: 期初均价
         type: number
       deliverygoodscode:
         description: 品种代码
@@ -19023,10 +19379,10 @@ definitions:
         description: 日期 格式 yyyymmdd
         type: string
       tradeamount:
-        description: 日成交金额(当日单方向成交金额)
+        description: 期初均价
         type: number
       tradeqty:
-        description: 日成交数量(当日单方向成交数量)
+        description: 期初均价
         type: number
       wrstandardid:
         description: 现货商品ID
@@ -19153,7 +19509,7 @@ definitions:
         description: 已计利息 -> 已计费用
         type: number
       unpaidinterest:
-        description: 未结费用
+        description: 期初均价
         type: number
       updatetime:
         description: 更新时间
@@ -19580,7 +19936,7 @@ definitions:
         description: 委托单号
         type: string
       orderprice:
-        description: 委托价格
+        description: 期初均价
         type: number
       orderqty:
         description: 委托数量
@@ -26695,7 +27051,7 @@ paths:
           description: OK
           schema:
             items:
-              $ref: '#/definitions/models.GZWarehouseinfo'
+              $ref: '#/definitions/models.BuyOrder'
             type: array
         "500":
           description: Internal Server Error
@@ -26706,6 +27062,33 @@ paths:
       summary: 查询求购大厅委托单
       tags:
       - 广钻
+  /Guangzuan/QueryDiamond:
+    post:
+      parameters:
+      - description: 钻石搜索入参
+        in: body
+        name: data
+        required: true
+        schema:
+          $ref: '#/definitions/models.SellOrderQueryReq'
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.SellOrder'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 钻石搜索
+      tags:
+      - 广钻
   /Guangzuan/QueryMyWRPosition:
     get:
       parameters:
@@ -26786,7 +27169,7 @@ paths:
           description: OK
           schema:
             items:
-              $ref: '#/definitions/models.GZWarehouseinfo'
+              $ref: '#/definitions/models.SellOrder'
             type: array
         "500":
           description: Internal Server Error

+ 12 - 1
global/app/ginUtils.go

@@ -8,10 +8,11 @@ package app
 
 import (
 	"fmt"
-	"github.com/gin-gonic/gin"
 	"mtp2_if/global/e"
 	"mtp2_if/logger"
 	"net/http"
+
+	"github.com/gin-gonic/gin"
 )
 
 // GetData 获取数据接口
@@ -56,6 +57,16 @@ func (r *GinUtils) DoBindReq(req interface{}) {
 	}
 }
 
+// DoBindJsonReq 处理Json Body参数绑定
+func (r *GinUtils) DoBindJsonReq(req interface{}) {
+	if r.err != nil {
+		return
+	}
+	if r.err = r.C.ShouldBindJSON(req); r.err != nil {
+		r.Gin.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+	}
+}
+
 // DoGetData 处理数据获取, 参数obj为models结构体
 // Deprecated
 func (r *GinUtils) DoGetData(obj interface{}) {

+ 7 - 8
go.mod

@@ -9,14 +9,13 @@ require (
 	github.com/DeanThompson/ginpprof v0.0.0-20190408063150-3be636683586
 	github.com/agrison/go-tablib v0.0.0-20160310143025-4930582c22ee // indirect
 	github.com/agrison/mxj v0.0.0-20160310142625-1269f8afb3b4 // indirect
-	github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
 	github.com/beevik/etree v1.1.0
 	github.com/bndr/gotabulate v1.1.2 // indirect
 	github.com/clbanning/mxj v1.8.4 // indirect
 	github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
 	github.com/fatih/structs v1.1.0 // indirect
 	github.com/gin-gonic/gin v1.7.2
-	github.com/go-openapi/spec v0.20.3 // indirect
+	github.com/go-openapi/spec v0.20.4 // indirect
 	github.com/go-openapi/swag v0.19.15 // indirect
 	github.com/go-playground/validator/v10 v10.6.1 // indirect
 	github.com/go-redis/redis v6.15.7+incompatible
@@ -42,7 +41,7 @@ require (
 	github.com/sirupsen/logrus v1.4.2
 	github.com/streadway/amqp v1.0.0
 	github.com/swaggo/gin-swagger v1.3.0
-	github.com/swaggo/swag v1.7.0
+	github.com/swaggo/swag v1.8.4
 	github.com/syndtr/goleveldb v1.0.0 // indirect
 	github.com/tealeg/xlsx v1.0.5 // indirect
 	github.com/tebeka/strftime v0.1.3 // indirect
@@ -50,9 +49,9 @@ require (
 	github.com/xormplus/core v0.0.0-20200308074340-f3bce19d5f31
 	github.com/xormplus/xorm v0.0.0-20200912034818-5d90dcd4e3d6
 	golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
-	golang.org/x/net v0.0.0-20210525063256-abc453219eb5 // indirect
-	golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea // indirect
-	golang.org/x/tools v0.1.2 // indirect
+	golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect
+	golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
+	golang.org/x/tools v0.1.10 // indirect
 	google.golang.org/protobuf v1.28.0
 	gopkg.in/flosch/pongo2.v3 v3.0.0-20141028000813-5e81b817a0c4 // indirect
 	gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
@@ -65,7 +64,7 @@ require (
 	github.com/fsnotify/fsnotify v1.4.7 // indirect
 	github.com/gin-contrib/sse v0.1.0 // indirect
 	github.com/go-openapi/jsonpointer v0.19.5 // indirect
-	github.com/go-openapi/jsonreference v0.19.5 // indirect
+	github.com/go-openapi/jsonreference v0.19.6 // indirect
 	github.com/go-playground/locales v0.13.0 // indirect
 	github.com/go-playground/universal-translator v0.17.0 // indirect
 	github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
@@ -75,6 +74,6 @@ require (
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.1 // indirect
 	github.com/ugorji/go/codec v1.2.6 // indirect
-	golang.org/x/text v0.3.6 // indirect
+	golang.org/x/text v0.3.7 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect
 )

+ 18 - 43
go.sum

@@ -1,6 +1,5 @@
 gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s=
 gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
 github.com/Chronokeeper/anyxml v0.0.0-20160530174208-54457d8e98c6 h1:Etfj2lhXyrYemgmWzEtEQQb1kezeEXc8jVjkQUyJnWI=
 github.com/Chronokeeper/anyxml v0.0.0-20160530174208-54457d8e98c6/go.mod h1:YzuYAe2hrrwKXkM9kqjbkTLlkbA+/xw2MA46f1+ENxc=
 github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c=
@@ -28,7 +27,6 @@ github.com/bndr/gotabulate v1.1.2 h1:yC9izuZEphojb9r+KYL4W9IJKO/ceIO8HDwxMA24U4c
 github.com/bndr/gotabulate v1.1.2/go.mod h1:0+8yUgaPTtLRTjf49E8oju7ojpU11YmXyvq1LbPAb3U=
 github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I=
 github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng=
-github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -56,17 +54,13 @@ github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUe
 github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
 github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
 github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
-github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg=
-github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM=
-github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg=
+github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs=
+github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns=
 github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
-github.com/go-openapi/spec v0.19.14/go.mod h1:gwrgJS15eCUgjLpMjBJmbZezCsw88LmgeEip0M63doA=
-github.com/go-openapi/spec v0.20.3 h1:uH9RQ6vdyPSs2pSy9fL8QPspDF2AMIMPtmK5coSSjtQ=
-github.com/go-openapi/spec v0.20.3/go.mod h1:gG4F8wdEDN+YPBMVnzE85Rbhf+Th2DTvA9nFPQ5AYEg=
+github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M=
+github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I=
 github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
 github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
-github.com/go-openapi/swag v0.19.11/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY=
-github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
 github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM=
 github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
 github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
@@ -164,10 +158,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnHyvtYjDeq0zlVHn9K/ZXoy17ylucdo=
 github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5HgEKCvEIIrSpFI3ozzG5xOKA2DVlEX/gGnewM=
-github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
 github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
-github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
 github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
 github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo=
@@ -177,14 +169,14 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
 github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E=
 github.com/swaggo/gin-swagger v1.3.0 h1:eOmp7r57oUgZPw2dJOjcGNMse9cvXcI4tTqBcnZtPsI=
 github.com/swaggo/gin-swagger v1.3.0/go.mod h1:oy1BRA6WvgtCp848lhxce7BnWH4C8Bxa0m5SkWx+cS0=
 github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+tv8Y=
-github.com/swaggo/swag v1.7.0 h1:5bCA/MTLQoIqDXXyHfOpMeDvL9j68OY/udlK4pQoo4E=
-github.com/swaggo/swag v1.7.0/go.mod h1:BdPIL73gvS9NBsdi7M1JOxLvlbfvNRaBP8m6WT6Aajo=
+github.com/swaggo/swag v1.8.4 h1:oGB351qH1JqUqK1tsMYEE5qTBbPk394BhsZxmUfebcI=
+github.com/swaggo/swag v1.8.4/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg=
 github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE=
 github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
 github.com/tealeg/xlsx v1.0.5 h1:+f8oFmvY8Gw1iUXzPk+kz+4GpbDZPK1FhPiQRd+ypgE=
@@ -201,21 +193,17 @@ github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCB
 github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ=
 github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw=
 github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
-github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
 github.com/xormplus/builder v0.0.0-20200331055651-240ff40009be h1:HTSana2sMSKVze3XXYrF89w2tw835Fh+7xX5KPvAkuo=
 github.com/xormplus/builder v0.0.0-20200331055651-240ff40009be/go.mod h1:PgBA7NoHtnttVkWModa/qpvIWkX6MpOKgyRCWsSKSB0=
 github.com/xormplus/core v0.0.0-20200308074340-f3bce19d5f31 h1:Xc/TNcIKyvLIp1Y9K+K7a/XQ2wtBLiF6FNmyCjgmb5E=
 github.com/xormplus/core v0.0.0-20200308074340-f3bce19d5f31/go.mod h1:V3p6iAR/MaICgU6GJqxGQxspfljTyfOTv4Czz0B5atU=
 github.com/xormplus/xorm v0.0.0-20200912034818-5d90dcd4e3d6 h1:8wMAe6KZ0YOG1RvjxyK5VhB29grvQbhb6MZTDIdpSd4=
 github.com/xormplus/xorm v0.0.0-20200912034818-5d90dcd4e3d6/go.mod h1:+v6b10b4x5IcQmp1/Cbo9IqaknxVeuhQng+fhya6bdI=
-github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
 golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
-golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
+golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -223,17 +211,12 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo=
-golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM=
+golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA=
+golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -243,30 +226,24 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea h1:+WiDlPBBaO+h9vPNZi8uJ3k4BkKQB7Iow3aqwHVA5hI=
-golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
+golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
-golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
 golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20201120155355-20be4ac4bd6e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA=
-golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20=
+golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
-golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
@@ -288,10 +265,8 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep
 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
 gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

+ 6 - 0
models/ermcpCommon.go

@@ -34,6 +34,12 @@ type PageEx struct {
 	Total    int `json:"-"  xorm:"'TOTAL'"` // 总条数
 }
 
+type PageJosn struct {
+	Page     int `json:"page"`     // 页码
+	PageSize int `json:"pagesize"` // 每页大小
+	Total    int `json:"TOTAL"`    // 总条数
+}
+
 // DecryptField 解密字段
 func DecryptField(oriStr string) string {
 	nLen := len(oriStr)

+ 126 - 1
models/guangzuan.go

@@ -3,6 +3,7 @@ package models
 import (
 	"mtp2_if/db"
 	"mtp2_if/utils"
+	"strings"
 	"time"
 )
 
@@ -291,6 +292,31 @@ func (r *BuyOrder) GetDataByPage() (interface{}, error, int, int, int) {
 	return sData, err, r.Page, r.PageSize, total
 }
 
+// SellOrderQueryReq 钻石搜索入参
+type SellOrderQueryReq struct {
+	ZSCATEGORY     int32    `json:"zscategory" binding:"required"` // 钻石分类 - 枚举”ZSCategory“
+	ZSCURRENCYTYPE []string `json:"zscurrencytype"`                // 货币类型 - 枚举“ZSCurrencyType”
+
+	WAREHOUSEID        int64    `json:"warehouseid"`        // 仓库ID
+	WEIGHT1            float64  `json:"weight1"`            // 总重量(克拉重量)-从
+	WEIGHT2            float64  `json:"weight2"`            // 总重量(克拉重量)-至
+	WEIGHTAVG1         float64  `json:"weightavg1"`         // 平均单颗重量-从
+	WEIGHTAVG2         float64  `json:"weightavg2"`         // 平均单颗重量-至
+	ZSSHAPETYPE        []string `json:"zsshapetype"`        // 形状 - 枚举”ZSShapeType“ - 类型:1,2,4,5 ;(1为多个,逗号分隔)
+	ZSCOLORTYPE        []int32  `json:"zscolortype"`        // 颜色
+	ZSCLARITYTYPE      []int32  `json:"zsclaritytype"`      // 净度
+	ZSCUTTYPE          []int32  `json:"zscuttype"`          // 切工
+	ZSSYMMETRYTYPE     []int32  `json:"zssymmetrytype"`     // 对称度
+	ZSPOLISHTYPE       []int32  `json:"zspolishtype"`       // 抛光度
+	ZSFLUORESCENCETYPE []int32  `json:"zsfluorescencetype"` // 荧光
+	ZSCERTTYPE         []string `json:"zscerttype"`         // 证书类型
+	ORIGIN             string   `json:"origin"`             // 原产地
+	ZSSTYLETYPE        []string `json:"zsstyletype"`        // 款式
+	ZSCZCOLOR1TYPE     []string `json:"zsczcolor1type"`     // 彩钻颜色1
+
+	PageJosn // 分页
+}
+
 // SellOrder 出售大厅委托单
 type SellOrder struct {
 	ZSALLPROPERTIES string `json:"-" xorm:"ZSALLPROPERTIES" form:"zsallproperties"`      // 商品(查询字段-模糊查询)
@@ -302,6 +328,38 @@ type SellOrder struct {
 	ZSCURRENCYTYPE int32  `json:"zscurrencytype" xorm:"ZSCURRENCYTYPE"`           // 货币类型 - 枚举“ZSCurrencyType”
 	GOODSNO        string `json:"goodsno" xorm:"GOODSNO"`                         // 商品编号
 
+	IsQueryDiamond bool // 是否钻石查询
+
+	ZSCURRENCYTYPE_S    []string `json:"-"`                       // 货币类型 - 枚举“ZSCurrencyType”
+	WAREHOUSEID         int64    `json:"-"`                       // 仓库ID
+	WEIGHT              float64  `json:"-"`                       // 总重量(克拉重量) - 类型:1,2,3,4,5
+	WEIGHT_END          float64  `json:"-"`                       // 总重量(克拉重量) - 类型:1,2,3,4,5
+	WEIGHTAVG           float64  `json:"-"`                       // 平均单颗重量 - 类型:1,3
+	WEIGHTAVG_END       float64  `json:"-"`                       // 平均单颗重量 - 类型:1,3
+	ZSSHAPETYPE         []string `json:"-"`                       // 形状 - 枚举”ZSShapeType“ - 类型:1,2,4,5 ;(1为多个,逗号分隔)
+	ZSCOLORTYPE1        int32    `json:"-"`                       // 颜色1 - 枚举”ZSColorType“ - 类型:1,2,3,4
+	ZSCOLORTYPE2        int32    `json:"-"`                       // 颜色2 - 枚举”ZSColorType“ -  类型:1,3
+	ZSCOLORTYPE         []int32  `json:"-"`                       // 颜色
+	ZSCLARITYTYPE1      int32    `json:"-"`                       // 净度1 - 枚举”ZSClarityType“ - 类型:1,2,3,4,5
+	ZSCLARITYTYPE2      int32    `json:"-"`                       // 净度2 - 枚举”ZSClarityType“ - 类型:1,3
+	ZSCLARITYTYPE       []int32  `json:"-"`                       // 净度
+	ZSCUTTYPE1          int32    `json:"-"`                       // 切工1 - 枚举”ZSCutType“ - 类型:1,2,4,5
+	ZSCUTTYPE2          int32    `json:"-"`                       // 切工2 - 枚举”ZSCutType“ - 类型:1
+	ZSCUTTYPE           []int32  `json:"-"`                       // 切工
+	ZSSYMMETRYTYPE1     int32    `json:"-"`                       // 对称度1 - 枚举”ZSSymmetryType“ - 类型:1,2,4,5
+	ZSSYMMETRYTYPE2     int32    `json:"-"`                       // 对称度2 - 枚举”ZSSymmetryType“ - 类型:1
+	ZSSYMMETRYTYPE      []int32  `json:"-"`                       // 对称度
+	ZSPOLISHTYPE1       int32    `json:"-"`                       // 抛光度1 - 枚举”ZSPolishType“ - 类型:1,2,4,5
+	ZSPOLISHTYPE2       int32    `json:"-"`                       // 抛光度2 - 枚举”ZSPolishType“ - 类型:1
+	ZSPOLISHTYPE        []int32  `json:"-"`                       // 抛光度
+	ZSFLUORESCENCETYPE1 int32    `json:"-"`                       // 荧光1 - 枚举”ZSFluorescenceType“ - 类型:1,2,3,4,5
+	ZSFLUORESCENCETYPE2 int32    `json:"-"`                       // 荧光2 - 枚举”ZSFluorescenceType” - 类型:1,3
+	ZSFLUORESCENCETYPE  []int32  `json:"-"`                       // 荧光
+	ZSCERTTYPE          []string `json:"-"`                       // 证书类型
+	ORIGIN              string   `json:"-"`                       // 原产地 - 类型:3
+	ZSSTYLETYPE         []string `json:"-"`                       // 款式 - 类型:4
+	ZSCZCOLOR1TYPE      []string `json:"-" xorm:"ZSCZCOLOR1TYPE"` // 彩钻颜色1 - 枚举”ZSCZColor1Type“ - 类型:5
+
 	WRTRADEORDERID        int64     `json:"wrtradeorderid" xorm:"WRTRADEORDERID" form:"wrtradeorderid"` // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
 	TRADEDATE             string    `json:"tradedate" xorm:"TRADEDATE"`                                 // 交易日(yyyyMMdd)
 	WRTRADETYPE           int32     `json:"wrtradetype" xorm:"WRTRADETYPE"`                             // 仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)
@@ -361,6 +419,7 @@ func (r *SellOrder) calc() {
 
 }
 
+// buildSql 出售大厅
 func (r *SellOrder) buildSql() string {
 	var sqlId utils.SQLVal = `
 	SELECT 
@@ -379,9 +438,75 @@ func (r *SellOrder) buildSql() string {
 	return sqlId.String()
 }
 
+// buildQueryDiamond 钻石搜索
+func (r *SellOrder) buildQueryDiamond() string {
+	var sqlId utils.SQLVal = `
+	SELECT 
+		q.*, 
+		t.* 
+	FROM WRTrade_OrderDetail t
+	INNER JOIN View_GZ_WRStandard_Ex_Query q ON t.wrstandardid = q.wrstandardid
+	WHERE t.marketid=67201 AND t.BuyOrSell = 1 AND t.WRTradeOrderStatus IN (3,7) 
+	`
+
+	sqlId.And("q.ZSCATEGORY", r.ZSCATEGORY)
+	if len(r.ZSCURRENCYTYPE_S) > 0 {
+		sqlId.JoinFormat(" AND q.ZSCURRENCYTYPE IN (%v)", strings.Join(r.ZSCURRENCYTYPE_S, ","))
+	}
+	sqlId.AndEx("q.WAREHOUSEID", r.WAREHOUSEID, r.WAREHOUSEID > 0)
+	utils.AndBetween(&sqlId, "q.WEIGHT", r.WEIGHT, r.WEIGHT_END)
+	utils.AndBetween(&sqlId, "q.WEIGHTAVG", r.WEIGHTAVG, r.WEIGHTAVG_END)
+	sqlId.AndLikes("q.ZSSHAPETYPE", r.ZSSHAPETYPE...)
+	for _, t := range r.ZSCOLORTYPE {
+		sqlId.LessOrEq("q.ZSCOLORTYPE1", t)
+		sqlId.BiggerOrEq("q.ZSCOLORTYPE2", t)
+	}
+	for _, t := range r.ZSCLARITYTYPE {
+		sqlId.LessOrEq("q.ZSCLARITYTYPE1", t)
+		sqlId.BiggerOrEq("q.ZSCLARITYTYPE2", t)
+	}
+	for _, t := range r.ZSCUTTYPE {
+		sqlId.LessOrEq("q.ZSCUTTYPE1", t)
+		sqlId.BiggerOrEq("q.ZSCUTTYPE2", t)
+	}
+	for _, t := range r.ZSSYMMETRYTYPE {
+		sqlId.LessOrEq("q.ZSSYMMETRYTYPE1", t)
+		sqlId.BiggerOrEq("q.ZSSYMMETRYTYPE2", t)
+	}
+	for _, t := range r.ZSPOLISHTYPE {
+		sqlId.LessOrEq("q.ZSPOLISHTYPE1", t)
+		sqlId.BiggerOrEq("q.ZSPOLISHTYPE2", t)
+	}
+	for _, t := range r.ZSFLUORESCENCETYPE {
+		sqlId.LessOrEq("q.ZSFLUORESCENCETYPE1", t)
+		sqlId.BiggerOrEq("q.ZSFLUORESCENCETYPE2", t)
+	}
+	if len(r.ZSCERTTYPE) > 0 {
+		sqlId.JoinFormat(" AND q.ZSCERTTYPE IN (%v)", strings.Join(r.ZSCERTTYPE, ","))
+	}
+	sqlId.AndLike("q.ORIGIN", r.ORIGIN)
+	if len(r.ZSSTYLETYPE) > 0 {
+		sqlId.JoinFormat(" AND q.ZSSTYLETYPE IN (%v)", strings.Join(r.ZSSTYLETYPE, ","))
+	}
+	if len(r.ZSCZCOLOR1TYPE) > 0 {
+		sqlId.JoinFormat(" AND q.ZSCZCOLOR1TYPE IN (%v)", strings.Join(r.ZSCZCOLOR1TYPE, ","))
+	}
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
 func (r *SellOrder) GetDataByPage() (interface{}, error, int, int, int) {
 	sData := make([]SellOrder, 0)
-	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	sql := ""
+	if !r.IsQueryDiamond {
+		// 出售大厅查询
+		sql = r.buildSql()
+	} else {
+		// 钻石搜索
+		sql = r.buildQueryDiamond()
+	}
+	err := db.GetEngine().SQL(sql).Find(&sData)
 	total := 0
 	for i := range sData {
 		sData[i].calc()

+ 3 - 1
routers/router.go

@@ -37,7 +37,7 @@ import (
 	"github.com/gin-gonic/gin"
 
 	// Swagger生成的文档
-	_ "mtp2_if/docs"
+	docs "mtp2_if/docs"
 
 	ginSwagger "github.com/swaggo/gin-swagger"
 	"github.com/swaggo/gin-swagger/swaggerFiles"
@@ -54,6 +54,7 @@ func InitRouter() *gin.Engine {
 	r.Use(CORSMiddleware())
 	// Swagger
 	if config.SerCfg.GetDebugMode() {
+		docs.SwaggerInfo.BasePath = "/api"
 		r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
 		r.GET("/debug/log", other.LogList)
 		r.GET("/debug/log/view", other.LogView)
@@ -657,6 +658,7 @@ func InitRouter() *gin.Engine {
 		guangzuanR.GET("QueryMyWRPosition", guangzuan.QueryMyWRPosition)
 		guangzuanR.GET("QueryBuyOrder", guangzuan.QueryBuyOrder)
 		guangzuanR.GET("QuerySellOrder", guangzuan.QuerySellOrder)
+		guangzuanR.POST("QueryDiamond", guangzuan.QueryDiamond)
 	}
 
 	return r

+ 10 - 0
utils/sqlUtils.go

@@ -42,6 +42,16 @@ func (r *SQLVal) AndEx(fieldName string, val interface{}, bAdd bool) {
 	}
 }
 
+func AndBetween[T int | float64](r *SQLVal, fieldName string, start T, end T) {
+	if start != 0 && end != 0 {
+		*r = *r + SQLVal(fmt.Sprintf(" AND %v BETWEEN %v AND %v", fieldName, start, end))
+	} else if start != 0 && end == 0 {
+		r.BiggerOrEq(fieldName, start)
+	} else if start == 0 && end != 0 {
+		r.LessOrEq(fieldName, end)
+	}
+}
+
 // 类似 AndEx, 但是不会为string类型加单引号
 func (r *SQLVal) AndInterEx(fieldName string, val interface{}, bAdd bool) {
 	if bAdd {

Some files were not shown because too many files changed in this diff