|
|
@@ -136,25 +136,25 @@ func (m *Erms3Biztradedetail) TableName() string {
|
|
|
|
|
|
// Erms2asapply 期现套利业务申请表
|
|
|
type Erms2asapply struct {
|
|
|
- Asapplyid int64 `json:"asapplyid" xorm:"'ASAPPLYID'" binding:"required"` // 策略申请ID(342+Unix秒时间戳(10位)+xxxxxx)
|
|
|
- Asno string `json:"asno" xorm:"'ASNO'"` // 策略编号
|
|
|
- Asname string `json:"asname" xorm:"'ASNAME'"` // 策略名称
|
|
|
- Biztype int32 `json:"biztype" xorm:"'BIZTYPE'"` // 业务类型 - 1:正向套利 2:反向套利
|
|
|
- Userid int64 `json:"userid" xorm:"'USERID'"` // 所属机构
|
|
|
- Deliverygoodsid int64 `json:"deliverygoodsid" xorm:"'DELIVERYGOODSID'"` // 现货品种ID
|
|
|
- Goodsgroupid int64 `json:"goodsgroupid" xorm:"'GOODSGROUPID'"` // 期货品种ID
|
|
|
- Spotquota float64 `json:"spotquota" xorm:"'SPOTQUOTA'"` // 现货额度
|
|
|
- Futurequote float64 `json:"futurequote" xorm:"'FUTUREQUOTE'"` // 期货额度
|
|
|
- Applybasis float64 `json:"applybasis" xorm:"'APPLYBASIS'"` // 申请基差
|
|
|
- Applystatus int32 `json:"applystatus" xorm:"'APPLYSTATUS'"` // 申请状态 - 0:待审核 1:审核通过 2:审核中 3:审核失败 4已撤销 5:审核拒绝
|
|
|
- Remark string `json:"remark" xorm:"'REMARK'"` // 备注
|
|
|
- Marketid int64 `json:"marketid" xorm:"'MARKETID'"` // 市场ID
|
|
|
- Tradedate string `json:"tradedate" xorm:"'TRADEDATE'"` // 交易日(yyyyMMdd)
|
|
|
- Creatorid int64 `json:"creatorid" xorm:"'CREATORID'"` // 创建人
|
|
|
- Createtime time.Time `json:"createtime" xorm:"'CREATETIME'"` // 创建时间
|
|
|
- Auditid int64 `json:"auditid" xorm:"'AUDITID'"` // 审核人
|
|
|
- Audittime time.Time `json:"audittime" xorm:"'AUDITTIME'"` // 审核时间
|
|
|
- Auditremark string `json:"auditremark" xorm:"'AUDITREMARK'"` // 审核备注
|
|
|
+ Asapplyid int64 `json:"asapplyid" xorm:"'ASAPPLYID'" binding:"required"` // 策略申请ID(342+Unix秒时间戳(10位)+xxxxxx)
|
|
|
+ Asno string `json:"asno" xorm:"'ASNO'"` // 策略编号
|
|
|
+ Asname string `json:"asname" xorm:"'ASNAME'"` // 策略名称
|
|
|
+ Biztype int32 `json:"biztype" xorm:"'BIZTYPE'"` // 业务类型 - 1:正向套利 2:反向套利
|
|
|
+ Userid int64 `json:"userid" xorm:"'USERID'"` // 所属机构
|
|
|
+ Deliverygoodsid int64 `json:"deliverygoodsid" xorm:"'DELIVERYGOODSID'"` // 现货品种ID
|
|
|
+ Goodsgroupid int64 `json:"goodsgroupid" xorm:"'GOODSGROUPID'"` // 期货品种ID
|
|
|
+ Spotquota float64 `json:"spotquota" xorm:"'SPOTQUOTA'"` // 现货额度
|
|
|
+ Futurequote float64 `json:"futurequote" xorm:"'FUTUREQUOTE'"` // 期货额度
|
|
|
+ Applybasis float64 `json:"applybasis" xorm:"'APPLYBASIS'"` // 申请基差
|
|
|
+ Applystatus int32 `json:"applystatus" xorm:"'APPLYSTATUS'"` // 申请状态 - 0:待审核 1:审核通过 2:审核中 3:审核失败 4已撤销 5:审核拒绝
|
|
|
+ Remark string `json:"remark" xorm:"'REMARK'"` // 备注
|
|
|
+ Marketid int64 `json:"marketid" xorm:"'MARKETID'"` // 市场ID
|
|
|
+ Tradedate string `json:"tradedate" xorm:"'TRADEDATE'"` // 交易日(yyyyMMdd)
|
|
|
+ Creatorid int64 `json:"creatorid" xorm:"'CREATORID'"` // 创建人
|
|
|
+ Createtime string `json:"createtime" xorm:"'CREATETIME'"` // 创建时间
|
|
|
+ Auditid int64 `json:"auditid" xorm:"'AUDITID'"` // 审核人
|
|
|
+ Audittime string `json:"audittime" xorm:"'AUDITTIME'"` // 审核时间
|
|
|
+ Auditremark string `json:"auditremark" xorm:"'AUDITREMARK'"` // 审核备注
|
|
|
}
|
|
|
|
|
|
// TableName is ERMS2_ASAPPLY
|
|
|
@@ -241,3 +241,53 @@ to_char(ERMS3_BIZTRADEDETAIL.RELATEDBIZID) RELATEDBIZID, ENUMDICITEM.ENUMDICNAME
|
|
|
err := s.Find(&datas)
|
|
|
return datas, err
|
|
|
}
|
|
|
+
|
|
|
+// InsertErms2AsApply 新增期现套利业务申请
|
|
|
+func InsertErms2AsApply(apply Erms2asapply) error {
|
|
|
+ engine := db.GetEngine()
|
|
|
+
|
|
|
+ // 生成ID
|
|
|
+ var err error
|
|
|
+ if apply.Asapplyid, err = GetSerialNumber("342"); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
+ sql := `insert into ERMS2_ASApply (
|
|
|
+ Asapplyid ,
|
|
|
+ Asno ,
|
|
|
+ Asname ,
|
|
|
+ Biztype ,
|
|
|
+ Userid ,
|
|
|
+ Deliverygoodsid,
|
|
|
+ Goodsgroupid ,
|
|
|
+ Spotquota ,
|
|
|
+ Futurequote ,
|
|
|
+ Applybasis ,
|
|
|
+ Applystatus ,
|
|
|
+ Remark ,
|
|
|
+ Marketid ,
|
|
|
+ Tradedate ,
|
|
|
+ Creatorid ,
|
|
|
+ Createtime
|
|
|
+ ) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,to_date(?, 'YYYY-MM-DD HH24:MI:SS'))`
|
|
|
+ _, err = engine.Exec(sql,
|
|
|
+ apply.Asapplyid,
|
|
|
+ apply.Asno,
|
|
|
+ apply.Asname,
|
|
|
+ apply.Biztype,
|
|
|
+ apply.Userid,
|
|
|
+ apply.Deliverygoodsid,
|
|
|
+ apply.Goodsgroupid,
|
|
|
+ apply.Spotquota,
|
|
|
+ apply.Futurequote,
|
|
|
+ apply.Applybasis,
|
|
|
+ apply.Applystatus,
|
|
|
+ apply.Remark,
|
|
|
+ apply.Marketid,
|
|
|
+ apply.Tradedate,
|
|
|
+ apply.Creatorid,
|
|
|
+ time.Now().Format("2006-01-02 15:04:05"),
|
|
|
+ )
|
|
|
+
|
|
|
+ return err
|
|
|
+}
|