|
|
@@ -1538,7 +1538,7 @@ type WrPerformancePlan struct {
|
|
|
EXPRESSFEE float64 `json:"expressfee" xorm:"EXPRESSFEE" form:"expressfee"` // 运费
|
|
|
CONTRACTID int64 `json:"contractid" xorm:"CONTRACTID" form:"contractid"` // 合同ID
|
|
|
CURSTEPDEADLINE string `json:"curstepdeadline" xorm:"CURSTEPDEADLINE" form:"curstepdeadline"` // 当前步骤到期时间
|
|
|
- STARTTIME string `json:"starttime" xorm:"'STARTTIME'"` // 开始时间
|
|
|
+ STARTTIME string `json:"starttime" xorm:"'STARTTIME'"` // 当前步骤开始时间
|
|
|
QTY float64 `json:"qty" xorm:"QTY" form:"qty"` // 履约数量
|
|
|
STEPTYPEID int32 `json:"steptypeid" xorm:"STEPTYPEID" form:"steptypeid"` // 履约步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移 9:释放卖方冻结 10:货款溢短 11:生成合同[中江] 12:运费 90:确认支付 91. 确认放行 92买方支付(直接扣款) 用于-1模板“
|
|
|
ACTIVATEMONTH string `json:"activatemonth" xorm:"'ACTIVATEMONTH'"` // 履约激活月 [无仓单的交易收月](yyyy-MM)
|
|
|
@@ -1550,12 +1550,12 @@ type WrPerformancePlan struct {
|
|
|
SELLUSERNAME string `json:"sellusername" xorm:"'SELLUSERNAME'"` // 卖方名字
|
|
|
TYPENAME string `json:"typename" xorm:"'TYPENAME'"` // 履约类型 名称
|
|
|
|
|
|
- USERID int64 `json:"userid" form:"userid" binding:"required"` // 用户id
|
|
|
- BUYORSELL int32 `json:"buyorsell" form:"buyorsell"` // 买卖方向 0-买 1-卖
|
|
|
- STATUS string `json:"-" form:"status"` // 状态筛选
|
|
|
- UNPAIDAMOUNT SFLOAT64 `json:"unpaidamount" xorm:"'UNPAIDAMOUNT'"` // 剩余款(待支付金额)
|
|
|
- BEGINDATE string `json:"begindate" form:"begindate"` // 开始交易日(yyyymmdd)
|
|
|
- ENDDATE string `json:"enddate" form:"enddate"` // 结束交易日(yyyymmdd)
|
|
|
+ USERID int64 `json:"userid" form:"userid" binding:"required"` // 用户id
|
|
|
+ BUYORSELL int32 `json:"buyorsell" form:"buyorsell" xorm:"BUYORSELL"` // 买卖方向 0-买 1-卖
|
|
|
+ STATUS string `json:"-" form:"status"` // 状态筛选
|
|
|
+ UNPAIDAMOUNT SFLOAT64 `json:"unpaidamount" xorm:"'UNPAIDAMOUNT'"` // 剩余款(待支付金额)
|
|
|
+ BEGINDATE string `json:"begindate" form:"begindate"` // 开始交易日(yyyymmdd)
|
|
|
+ ENDDATE string `json:"enddate" form:"enddate"` // 结束交易日(yyyymmdd)
|
|
|
}
|
|
|
|
|
|
func (r *WrPerformancePlan) calc() {
|
|
|
@@ -1568,7 +1568,9 @@ func (r *WrPerformancePlan) calc() {
|
|
|
func (r *WrPerformancePlan) buildSql() string {
|
|
|
var sqlId utils.SQLVal = `
|
|
|
with tmp as
|
|
|
- (select to_char(t.wrfactortypeid) wrfactortypeid,
|
|
|
+ (select
|
|
|
+ %v BUYORSELL,
|
|
|
+ to_char(t.wrfactortypeid) wrfactortypeid,
|
|
|
t.wrfactortypename,
|
|
|
t.wrstandardid,
|
|
|
t.deliverygoodsid,
|
|
|
@@ -1657,6 +1659,7 @@ select to_char(t.PERFORMANCEPLANID) PERFORMANCEPLANID,
|
|
|
left join market m on t.marketid=m.marketid
|
|
|
where 1 = 1
|
|
|
`
|
|
|
+ sqlId.FormatParam(r.BUYORSELL)
|
|
|
if r.BUYORSELL == 0 {
|
|
|
sqlId.And("u1.userid", r.USERID)
|
|
|
} else {
|
|
|
@@ -1670,7 +1673,9 @@ select to_char(t.PERFORMANCEPLANID) PERFORMANCEPLANID,
|
|
|
func (r *WrPerformancePlan) buildSqlHis() string {
|
|
|
var sqlId utils.SQLVal = `
|
|
|
with tmp as
|
|
|
- (select to_char(t.wrfactortypeid) wrfactortypeid,
|
|
|
+ (select
|
|
|
+ %v BUYORSELL,
|
|
|
+ to_char(t.wrfactortypeid) wrfactortypeid,
|
|
|
t.wrfactortypename,
|
|
|
t.wrstandardid,
|
|
|
t.deliverygoodsid,
|
|
|
@@ -1759,6 +1764,7 @@ select to_char(t.PERFORMANCEPLANID) PERFORMANCEPLANID,
|
|
|
left join market m on t.marketid=m.marketid
|
|
|
where 1 = 1 and t.isvaliddata=1
|
|
|
`
|
|
|
+ sqlId.FormatParam(r.BUYORSELL)
|
|
|
if r.BUYORSELL == 0 {
|
|
|
sqlId.And("u1.userid", r.USERID)
|
|
|
} else {
|