|
|
@@ -431,8 +431,9 @@ type WrPosition struct {
|
|
|
SELLEXCUTEQTY float64 `json:"sellexcuteqty"` // 销售履约中数量
|
|
|
WRPOSITIONNO string `json:"wrpositionno"` // 仓单编号
|
|
|
|
|
|
- QueryType int32 `json:"querytype" form:"querytype"` // 查询类型 1-现货汇总 2-库存汇总(订单汇总)
|
|
|
- HASWR int32 `json:"haswr" form:"haswr"` // 是否有仓单-卖方 - 0:无仓单 1:有仓单
|
|
|
+ QueryType int32 `json:"querytype" form:"querytype"` // 查询类型 1-现货汇总 2-库存汇总(订单汇总)
|
|
|
+ HASWR int32 `json:"haswr" form:"haswr"` // 是否有仓单-卖方 - 0:无仓单 1:有仓单
|
|
|
+ DGITEMNAME string `json:"-" form:"dgitemname"` // 筛选项
|
|
|
}
|
|
|
|
|
|
func (r *WrPosition) calc() {
|
|
|
@@ -511,6 +512,12 @@ func (r *WrPosition) buildSql1() string {
|
|
|
" and e.enumdiccode = 'goodsunit'"
|
|
|
var param utils.SQLVal
|
|
|
param.And("t.wruserid", r.WRUSERID)
|
|
|
+ param.AndEx("w.wrstandardid", r.WRSTANDARDID, r.WRSTANDARDID > 0)
|
|
|
+ param.AndEx("w.warehouseid", r.WAREHOUSEID, r.WAREHOUSEID > 0)
|
|
|
+ param.AndEx("w.deliverygoodsid", r.DELIVERYGOODSID, r.DELIVERYGOODSID > 0)
|
|
|
+ if d, ok := FtItemName(r.DGITEMNAME); ok {
|
|
|
+ param.AndLikes("w.wrfactortypename", d...)
|
|
|
+ }
|
|
|
if r.HASWR == 0 {
|
|
|
param.Join(" and t.CREDITTOTALQTY > 0")
|
|
|
} else {
|
|
|
@@ -573,6 +580,12 @@ func (r *WrPosition) buildSql3() string {
|
|
|
} else {
|
|
|
sqlId.Join(" and t.TOTALQTY > 0")
|
|
|
}
|
|
|
+ sqlId.AndEx("w.wrstandardid", r.WRSTANDARDID, r.WRSTANDARDID > 0)
|
|
|
+ sqlId.AndEx("w.warehouseid", r.WAREHOUSEID, r.WAREHOUSEID > 0)
|
|
|
+ sqlId.AndEx("w.deliverygoodsid", r.DELIVERYGOODSID, r.DELIVERYGOODSID > 0)
|
|
|
+ if d, ok := FtItemName(r.DGITEMNAME); ok {
|
|
|
+ sqlId.AndLikes("w.wrfactortypename", d...)
|
|
|
+ }
|
|
|
return sqlId.String()
|
|
|
}
|
|
|
|
|
|
@@ -2131,7 +2144,7 @@ type WrScfContract struct {
|
|
|
ISAUTOLOAN int32 `json:"isautoloan" xorm:"ISAUTOLOAN"` // 是否自动放款 - 0:手动 1:自动 - [仓单质押]
|
|
|
REMAINAMOUNT float64 `json:"remainamount" xorm:"REMAINAMOUNT"` // 合同剩余金额 -> 剩余金额
|
|
|
INITMARGIN float64 `json:"initmargin" xorm:"INITMARGIN"` // 保证金 - [仓单回购]
|
|
|
- REMAINWRPOSITIONQTY float64 `json:"remainwrpositionqty" xorm:"REMAINWRPOSITIONQTY"` // 剩余仓单头寸数量 - [仓单回购\仓单质押] -> 剩余数量
|
|
|
+ REMAINWRPOSITIONQTY float64 `json:"remainwrpositionqty" xorm:"REMAINWRPOSITIONQTY"` // 剩余仓单头寸数量 - [仓单回购\仓单质押] -> 剩余数量(待回购数量)
|
|
|
BUYBACKWRPOSITIONQTY float64 `json:"buybackwrpositionqty" xorm:"BUYBACKWRPOSITIONQTY"` // 已回购仓单头寸数量 - [仓单回购\仓单质押] -> 已回购数量
|
|
|
INTERESTAMOUNT float64 `json:"interestamount" xorm:"INTERESTAMOUNT"` // 计息金额=合同剩余金额 - 初始保证金 - 追缴保证金 \ 合同剩余金额
|
|
|
TOTALINTEREST float64 `json:"totalinterest" xorm:"TOTALINTEREST"` // 已计利息 -> 已计费用
|