|
|
@@ -4544,3 +4544,146 @@ func (r *GZMyTradingPresell) GetDataByPage() (interface{}, error, int, int, int)
|
|
|
}
|
|
|
return sData, err, r.Page, r.PageSize, total
|
|
|
}
|
|
|
+
|
|
|
+// Wrpresaleapply 仓单预售申请表
|
|
|
+type Wrpresaleapply struct {
|
|
|
+ PRESALEAPPLYID string `json:"presaleapplyid" xorm:"PRESALEAPPLYID"` // 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
|
|
|
+ SELLUSERID int64 `json:"selluserid" xorm:"SELLUSERID" form:"userid" binding:"required"` // 发行方用户ID
|
|
|
+ SELLACCOUNTID int64 `json:"sellaccountid" xorm:"SELLACCOUNTID"` // 发行方资金账户ID
|
|
|
+ DELIVERYGOODSID int32 `json:"deliverygoodsid" xorm:"DELIVERYGOODSID"` // 现货品种ID
|
|
|
+ WRSTANDARDNAME string `json:"wrstandardname" xorm:"WRSTANDARDNAME"` // 现货商品名称
|
|
|
+ UNITID int32 `json:"unitid" xorm:"UNITID"` // 单位ID
|
|
|
+ WAREHOUSEID int64 `json:"warehouseid" xorm:"WAREHOUSEID"` // 仓库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图(逗号分隔)
|
|
|
+ MARKETID int32 `json:"marketid" xorm:"MARKETID" form:"marketid" binding:"required"` // 市场ID
|
|
|
+ APPLYREMARK string `json:"applyremark" xorm:"APPLYREMARK"` // 备注
|
|
|
+ CLIENTTICKET string `json:"clientticket" xorm:"CLIENTTICKET"` // 客户端流水号
|
|
|
+ APPLYSRC int32 `json:"applysrc" xorm:"APPLYSRC"` // 申请来源 - 1:管理端 2:终端
|
|
|
+ APPLYID int64 `json:"applyid" xorm:"APPLYID"` // 申请人
|
|
|
+ APPLYTIME string `json:"applytime" xorm:"APPLYTIME"` // 申请时间
|
|
|
+ APPLYSTATUS int32 `json:"applystatus" xorm:"APPLYSTATUS"` // 申请状态(inoutapplystatus) - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
|
|
|
+ AUDITTRADEDATE string `json:"audittradedate" xorm:"AUDITTRADEDATE"` // 审核交易日(yyyyMMdd)
|
|
|
+ AUDITID int64 `json:"auditid" xorm:"AUDITID"` // 审核人
|
|
|
+ AUDITSRC int32 `json:"auditsrc" xorm:"AUDITSRC"` // 审核来源 - 1:管理端 2:终端
|
|
|
+ AUDITTIME time.Time `json:"audittime" xorm:"AUDITTIME"` // 审核时间
|
|
|
+ AUDITREMARK string `json:"auditremark" xorm:"AUDITREMARK"` // 审核备注
|
|
|
+ HANDLESTATUS int32 `json:"handlestatus" xorm:"HANDLESTATUS"` // 处理状态
|
|
|
+ WRSTANDARDID int64 `json:"wrstandardid" xorm:"WRSTANDARDID"` // 现货商品ID
|
|
|
+ WRFACTORTYPEID int64 `json:"wrfactortypeid" xorm:"WRFACTORTYPEID"` // 仓单要素类型ID - 根据现货商品\仓库生成
|
|
|
+ BUYMARGINALGORITHM int32 `json:"buymarginalgorithm" xorm:"BUYMARGINALGORITHM"` // 买方保证金方式 - 1:比率 2:固定
|
|
|
+ BUYMARGINVALUE float64 `json:"buymarginvalue" xorm:"BUYMARGINVALUE"` // 买方保证金设置值
|
|
|
+ PERFORMANCETEMPLATEID int64 `json:"performancetemplateid" xorm:"PERFORMANCETEMPLATEID"` // 履约计划模板ID(方式为1时填-1, 为2时选择模板)
|
|
|
+ MINBUYQTY int64 `json:"minbuyqty" xorm:"MINBUYQTY"` // 单人最小申购量
|
|
|
+ MINSUCCESSQTY int64 `json:"minsuccessqty" xorm:"MINSUCCESSQTY"` // 最低成团量
|
|
|
+
|
|
|
+ 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"` // 备注
|
|
|
+
|
|
|
+ PageEx `xorm:"extends"` // 页码信息
|
|
|
+}
|
|
|
+
|
|
|
+func (r *Wrpresaleapply) calc() {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func (r *Wrpresaleapply) buildSql() string {
|
|
|
+ var sqlId utils.SQLVal = `
|
|
|
+ select
|
|
|
+ to_char(pi.presaleapplyid) PRESALEAPPLYID,
|
|
|
+ pi.selluserid,
|
|
|
+ pi.sellaccountid,
|
|
|
+ pi.deliverygoodsid,
|
|
|
+ pi.wrstandardname,
|
|
|
+ pi.unitid,
|
|
|
+ pi.warehouseid,
|
|
|
+ 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.marketid,
|
|
|
+ pi.applyremark,
|
|
|
+ pi.clientticket,
|
|
|
+ pi.applysrc,
|
|
|
+ pi.applyid,
|
|
|
+ to_char(pi.applytime, 'yyyy-mm-dd hh24:mi:ss') APPLYTIME,
|
|
|
+ pi.applystatus,
|
|
|
+ pi.audittradedate,
|
|
|
+ pi.auditid,
|
|
|
+ pi.auditsrc,
|
|
|
+ pi.audittime,
|
|
|
+ pi.auditremark,
|
|
|
+ pi.handlestatus,
|
|
|
+ pi.wrstandardid,
|
|
|
+ pi.wrfactortypeid,
|
|
|
+ pi.buymarginalgorithm,
|
|
|
+ pi.buymarginvalue,
|
|
|
+ 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_Presaleapply pi
|
|
|
+ left join GZ_WR_PresaleApplyEx paex
|
|
|
+ on pi.presaleapplyid = paex.presaleapplyid
|
|
|
+ where 1=1
|
|
|
+ `
|
|
|
+
|
|
|
+ sqlId.And("pi.marketid", r.MARKETID)
|
|
|
+ sqlId.And("pi.selluserid", r.SELLUSERID)
|
|
|
+ sqlId.OrderBy("pi.presaleapplyid desc")
|
|
|
+
|
|
|
+ sqlId.Page(r.Page, r.PageSize)
|
|
|
+ return sqlId.String()
|
|
|
+}
|
|
|
+
|
|
|
+func (r *Wrpresaleapply) GetDataByPage() (interface{}, error, int, int, int) {
|
|
|
+ sData := make([]Wrpresaleapply, 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
|
|
|
+}
|