|
@@ -1795,6 +1795,7 @@ type WrStandardFactoryItem struct {
|
|
|
ITEMTYPENAME string `json:"-" xorm:"'ITEMTYPENAME'"` // 要素项类型名称
|
|
ITEMTYPENAME string `json:"-" xorm:"'ITEMTYPENAME'"` // 要素项类型名称
|
|
|
DGFACTORYITEMID int64 `json:"dgfactoryitemid" xorm:"'DGFACTORYITEMID'"` // 选择项id
|
|
DGFACTORYITEMID int64 `json:"dgfactoryitemid" xorm:"'DGFACTORYITEMID'"` // 选择项id
|
|
|
DGFACTORYITEMVALUE string `json:"dgfactoryitemvalue" xorm:"'DGFACTORYITEMVALUE'"` // 要素项值
|
|
DGFACTORYITEMVALUE string `json:"dgfactoryitemvalue" xorm:"'DGFACTORYITEMVALUE'"` // 要素项值
|
|
|
|
|
+ WAREHOUSEID int64 `json:"warehouseid" xorm:"'WAREHOUSEID'"` // 仓库id
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (r *WrStandardFactoryItem) calc() {
|
|
func (r *WrStandardFactoryItem) calc() {
|
|
@@ -1805,7 +1806,8 @@ func (r *WrStandardFactoryItem) buildSql() string {
|
|
|
var sqlId utils.SQLVal = "select t.wrstandardid," +
|
|
var sqlId utils.SQLVal = "select t.wrstandardid," +
|
|
|
" dp.dgfactoryitemtypeid," +
|
|
" dp.dgfactoryitemtypeid," +
|
|
|
" dp.itemtypename," +
|
|
" dp.itemtypename," +
|
|
|
- " decode(dp.dgfactoryitemtypeid,1,di.warehouseid,di.dgfactoryitemid) dgfactoryitemid," +
|
|
|
|
|
|
|
+ " di.dgfactoryitemid," +
|
|
|
|
|
+ " di.warehouseid," +
|
|
|
" di.dgfactoryitemvalue" +
|
|
" di.dgfactoryitemvalue" +
|
|
|
" from wrstandardfactoryitem t" +
|
|
" from wrstandardfactoryitem t" +
|
|
|
" inner join wrstandard w" +
|
|
" inner join wrstandard w" +
|
|
@@ -2242,3 +2244,98 @@ func (r *WrScfContract) GetDataEx() (interface{}, error) {
|
|
|
}
|
|
}
|
|
|
return sData, err
|
|
return sData, err
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// WrBuybackDetail 仓单回购明细
|
|
|
|
|
+type WrBuybackDetail struct {
|
|
|
|
|
+ SCFWRBUYBACKID int64 `json:"scfwrbuybackid" xorm:"SCFWRBUYBACKID" form:"scfwrbuybackid"` // SCF仓单回购明细ID(312+Unix秒时间戳(10位)+xxxxxx)
|
|
|
|
|
+ SCFCONTRACTID string `json:"scfcontractid" xorm:"SCFCONTRACTID" form:"scfcontractid"` // SCF合同ID
|
|
|
|
|
+ BUYBACKQTY float64 `json:"buybackqty" xorm:"BUYBACKQTY"` // 回购数量
|
|
|
|
|
+ BUYBACKAMOUNT float64 `json:"buybackamount" xorm:"BUYBACKAMOUNT"` // 回购金额
|
|
|
|
|
+ BUYBACKRELEASEMARGIN float64 `json:"buybackreleasemargin" xorm:"BUYBACKRELEASEMARGIN"` // 回购释放保证金
|
|
|
|
|
+ BUYBACKTIME string `json:"buybacktime" xorm:"BUYBACKTIME"` // 回购时间
|
|
|
|
|
+ TRADEDATE string `json:"tradedate" xorm:"TRADEDATE" form:"tradedate"` // 交易日(yyyyMMdd)
|
|
|
|
|
+ RELATEDWRID int64 `json:"relatedwrid" xorm:"RELATEDWRID" form:"relatedwrid"` // 关联仓单ID
|
|
|
|
|
+ HANDLESTATUS int32 `json:"handlestatus" xorm:"HANDLESTATUS"` // 处理 - 1:待处理 2:处理成功 3:处理失败
|
|
|
|
|
+ ERRORDESC string `json:"errordesc" xorm:"ERRORDESC"` // 错误描述
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (r *WrBuybackDetail) calc() {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (r *WrBuybackDetail) buildSql() string {
|
|
|
|
|
+ var sqlId utils.SQLVal = "SELECT t.SCFWRBUYBACKID," +
|
|
|
|
|
+ " t.SCFCONTRACTID," +
|
|
|
|
|
+ " t.BUYBACKQTY," +
|
|
|
|
|
+ " t.BUYBACKAMOUNT," +
|
|
|
|
|
+ " t.BUYBACKRELEASEMARGIN," +
|
|
|
|
|
+ " to_char(t.BUYBACKTIME, 'yyyy-mm-dd hh24:mi:ss') BUYBACKTIME," +
|
|
|
|
|
+ " t.TRADEDATE," +
|
|
|
|
|
+ " t.RELATEDWRID," +
|
|
|
|
|
+ " t.HANDLESTATUS," +
|
|
|
|
|
+ " t.ERRORDESC" +
|
|
|
|
|
+ " FROM SCF_WRBUYBACKDETAIL t" +
|
|
|
|
|
+ " WHERE 1 = 1" +
|
|
|
|
|
+ " AND t.handlestatus = 2"
|
|
|
|
|
+ sqlId.AndEx("scfcontractid", r.SCFCONTRACTID, r.SCFCONTRACTID != "")
|
|
|
|
|
+ return sqlId.String()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// GetDataEx 获取仓单回购明细
|
|
|
|
|
+func (r *WrBuybackDetail) GetDataEx() (interface{}, error) {
|
|
|
|
|
+ sData := make([]WrBuybackDetail, 0)
|
|
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
|
|
+ for i := range sData {
|
|
|
|
|
+ sData[i].calc()
|
|
|
|
|
+ }
|
|
|
|
|
+ return sData, err
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// WrScfContractInterest 合同计息表(费用明细)
|
|
|
|
|
+type WrScfContractInterest struct {
|
|
|
|
|
+ SCFCONTRACTINTERESTID int64 `json:"scfcontractinterestid" xorm:"SCFCONTRACTINTERESTID"` // SCF合同计息ID(313+Unix秒时间戳(10位)+xxxxxx)
|
|
|
|
|
+ SCFCONTRACTID string `json:"scfcontractid" xorm:"SCFCONTRACTID" form:"scfcontractid"` // SCF合同ID
|
|
|
|
|
+ INTERESTDAY string `json:"interestday" xorm:"INTERESTDAY"` // 计息日(yyyyMMdd)
|
|
|
|
|
+ INTEREST float64 `json:"interest" xorm:"INTEREST"` // 利息
|
|
|
|
|
+ CLOSEINTEREST float64 `json:"closeinterest" xorm:"CLOSEINTEREST"` // 已结利息
|
|
|
|
|
+ CLOSEINTERESTSTATUS int32 `json:"closeintereststatus" xorm:"CLOSEINTERESTSTATUS"` // 结息状态 - 1:未结 2:已结
|
|
|
|
|
+ UPDATETIME string `json:"updatetime" xorm:"UPDATETIME"` // 更新时间
|
|
|
|
|
+ CREATORID int64 `json:"creatorid" xorm:"CREATORID" form:"creatorid"` // 操作人ID
|
|
|
|
|
+ CLOSETIME string `json:"closetime" xorm:"CLOSETIME"` // 结息时间
|
|
|
|
|
+ CLOSETRADEDATE string `json:"closetradedate" xorm:"CLOSETRADEDATE" form:"closetradedate"` // 结息交易日
|
|
|
|
|
+ INTERESTAMOUNT float64 `json:"interestamount" xorm:"INTERESTAMOUNT"` // 计息金额
|
|
|
|
|
+ DAYRATE float64 `json:"dayrate" xorm:"DAYRATE"` // 日利率(根据利率配置计算出的日利率值,年利率则除以360,保留5位小数)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (r *WrScfContractInterest) calc() {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func (r *WrScfContractInterest) buildSql() string {
|
|
|
|
|
+ var sqlId utils.SQLVal = "SELECT t.SCFCONTRACTINTERESTID," +
|
|
|
|
|
+ " t.SCFCONTRACTID," +
|
|
|
|
|
+ " t.INTERESTDAY," +
|
|
|
|
|
+ " t.INTEREST," +
|
|
|
|
|
+ " t.CLOSEINTEREST," +
|
|
|
|
|
+ " t.CLOSEINTERESTSTATUS," +
|
|
|
|
|
+ " to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
|
|
|
|
|
+ " t.CREATORID," +
|
|
|
|
|
+ " to_char(t.CLOSETIME, 'yyyy-mm-dd hh24:mi:ss') CLOSETIME," +
|
|
|
|
|
+ " t.CLOSETRADEDATE," +
|
|
|
|
|
+ " t.INTERESTAMOUNT," +
|
|
|
|
|
+ " t.DAYRATE" +
|
|
|
|
|
+ " FROM SCF_CONTRACTINTEREST t" +
|
|
|
|
|
+ " WHERE 1 = 1"
|
|
|
|
|
+ sqlId.AndEx("scfcontractid", r.SCFCONTRACTID, r.SCFCONTRACTID != "")
|
|
|
|
|
+ return sqlId.String()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// GetDataEx 获取描述
|
|
|
|
|
+func (r *WrScfContractInterest) GetDataEx() (interface{}, error) {
|
|
|
|
|
+ sData := make([]WrScfContractInterest, 0)
|
|
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
|
|
+ for i := range sData {
|
|
|
|
|
+ sData[i].calc()
|
|
|
|
|
+ }
|
|
|
|
|
+ return sData, err
|
|
|
|
|
+}
|