|
|
@@ -99,7 +99,7 @@ func (r *WrOrderQuote) buildSqlFixedPrice() string {
|
|
|
" h.warehousecode," +
|
|
|
" wg.wrstandardname," +
|
|
|
" wg.wrstandardcode," +
|
|
|
- " wg.wrstandardname || w.wrfactortypename as wrgoodsname" +
|
|
|
+ " wg.wrstandardname || w.wrfactortypename2 as wrgoodsname" +
|
|
|
" from wrQuote k" +
|
|
|
" left join WRFactorType w" +
|
|
|
" on k.wrfactortypeid = w.wrfactortypeid" +
|
|
|
@@ -119,6 +119,7 @@ func (r *WrOrderQuote) buildSqlFixedPrice() string {
|
|
|
param2.AndLike("w.wrfactortypename", r.WRSTANDARDNAME)
|
|
|
param2.AndLike("w.wrfactortypename", r.BRANDNAME)
|
|
|
param2.AndEx("w.warehouseid", r.WAREHOUSEID, r.WAREHOUSEID > 0)
|
|
|
+ param2.AndEx("w.deliverygoodsid", r.DELIVERYGOODSID, r.DELIVERYGOODSID > 0)
|
|
|
sqlId.FormatParam(param.String(), param.String(), param2.String())
|
|
|
|
|
|
sqlId.Page(r.Page, r.PageSize)
|
|
|
@@ -197,7 +198,7 @@ func (r *WrOrderQuote) buildSqlPriceMove() string {
|
|
|
" h.warehousecode," +
|
|
|
" wg.wrstandardname," +
|
|
|
" wg.wrstandardcode," +
|
|
|
- " wg.wrstandardname || w.wrfactortypename as wrgoodsname" +
|
|
|
+ " wg.wrstandardname || w.wrfactortypename2 as wrgoodsname" +
|
|
|
" from wrQuote k" +
|
|
|
" left join WRFactorType w" +
|
|
|
" on k.wrfactortypeid = w.wrfactortypeid" +
|
|
|
@@ -341,7 +342,11 @@ type Wr2FactorType struct {
|
|
|
}
|
|
|
|
|
|
func (r *Wr2FactorType) Calc() {
|
|
|
- r.WRTYPENAME = r.WRSTANDARDNAME + "-" + r.WRFACTORTYPENAME
|
|
|
+ if len(r.WRFACTORTYPENAME) > 0 {
|
|
|
+ r.WRTYPENAME = r.WRSTANDARDNAME + "-" + r.WRFACTORTYPENAME
|
|
|
+ } else {
|
|
|
+ r.WRTYPENAME = r.WRSTANDARDNAME
|
|
|
+ }
|
|
|
r.WRTYPENAME = strings.ReplaceAll(r.WRTYPENAME, ",", "-")
|
|
|
}
|
|
|
|
|
|
@@ -400,7 +405,7 @@ func (r *WrPosition) buildSql1() string {
|
|
|
" w.wrstandardid," +
|
|
|
" w.warehouseid," +
|
|
|
" wd.wrstandardname," +
|
|
|
- " wd.wrstandardname || '-' ||w.wrfactortypename as wrtypename" +
|
|
|
+ " wd.wrstandardname || '-' ||w.wrfactortypename2 as wrtypename" +
|
|
|
" from WRPOSITION t" +
|
|
|
" left join WRFACTORTYPE w" +
|
|
|
" on t.wrfactortypeid = w.wrfactortypeid" +
|
|
|
@@ -455,7 +460,7 @@ func (r *WrPosition) buildSql3() string {
|
|
|
" t.CREDITFREEZEQTY," +
|
|
|
" t.CREDITTRADEQTY," +
|
|
|
" w.WRFACTORTYPEID," +
|
|
|
- " w.WRFACTORTYPENAME," +
|
|
|
+ " w.WRFACTORTYPENAME2 WRFACTORTYPENAME," +
|
|
|
" w.DELIVERYGOODSID," +
|
|
|
" w.WAREHOUSEID," +
|
|
|
" w.WRSTANDARDID," +
|
|
|
@@ -527,12 +532,13 @@ func (r *WrOrderDetail) calc() {
|
|
|
} else {
|
|
|
r.FUTUSHOW = fmt.Sprintf("%v//%.2f", r.GOODSCODE, r.FUTUPRICEMOVE)
|
|
|
}
|
|
|
+ r.Wr2FactorType.Calc()
|
|
|
}
|
|
|
|
|
|
func (r *WrOrderDetail) buildSql() string {
|
|
|
var sqlId utils.SQLVal = "with tmp as" +
|
|
|
" (select t.wrfactortypeid," +
|
|
|
- " t.wrfactortypename," +
|
|
|
+ " t.wrfactortypename2 wrfactortypename," +
|
|
|
" t.wrstandardid," +
|
|
|
" t.deliverygoodsid," +
|
|
|
" g.deliverygoodscode," +
|
|
|
@@ -542,7 +548,7 @@ func (r *WrOrderDetail) buildSql() string {
|
|
|
" h.warehousecode," +
|
|
|
" h.warehousename," +
|
|
|
" e.enumdicname," +
|
|
|
- " w.wrstandardname || '-' || t.wrfactortypename as wrtypename" +
|
|
|
+ " w.wrstandardname || '-' || t.wrfactortypename2 as wrtypename" +
|
|
|
" from wrfactortype t" +
|
|
|
" left join deliverygoods g" +
|
|
|
" on t.deliverygoodsid = g.deliverygoodsid" +
|
|
|
@@ -620,7 +626,7 @@ type WrTradeDetail struct {
|
|
|
}
|
|
|
|
|
|
func (r *WrTradeDetail) calc() {
|
|
|
-
|
|
|
+ r.Wr2FactorType.Calc()
|
|
|
}
|
|
|
|
|
|
func (r *WrTradeDetail) buildSql() string {
|
|
|
@@ -636,7 +642,7 @@ func (r *WrTradeDetail) buildSql() string {
|
|
|
" h.warehousecode," +
|
|
|
" h.warehousename," +
|
|
|
" e.enumdicname," +
|
|
|
- " w.wrstandardname || '-' || t.wrfactortypename as wrtypename" +
|
|
|
+ " w.wrstandardname || '-' || t.wrfactortypename2 as wrtypename" +
|
|
|
" from wrfactortype t" +
|
|
|
" left join deliverygoods g" +
|
|
|
" on t.deliverygoodsid = g.deliverygoodsid" +
|
|
|
@@ -715,12 +721,13 @@ type WrSpecialMatchOrder struct {
|
|
|
|
|
|
func (r *WrSpecialMatchOrder) calc() {
|
|
|
r.AMOUNT = r.FIXEDPRICE * r.ORDERQTY
|
|
|
+ r.Wr2FactorType.Calc()
|
|
|
}
|
|
|
|
|
|
func (r *WrSpecialMatchOrder) buildSql() string {
|
|
|
var sqlId utils.SQLVal = "with tmp as" +
|
|
|
" (select t.wrfactortypeid," +
|
|
|
- " t.wrfactortypename," +
|
|
|
+ " t.wrfactortypename2 wrfactortypename," +
|
|
|
" t.wrstandardid," +
|
|
|
" t.deliverygoodsid," +
|
|
|
" g.deliverygoodscode," +
|
|
|
@@ -730,7 +737,7 @@ func (r *WrSpecialMatchOrder) buildSql() string {
|
|
|
" h.warehousecode," +
|
|
|
" h.warehousename," +
|
|
|
" e.enumdicname," +
|
|
|
- " w.wrstandardname || '-' || t.wrfactortypename as wrtypename" +
|
|
|
+ " w.wrstandardname || '-' || t.wrfactortypename2 as wrtypename" +
|
|
|
" from wrfactortype t" +
|
|
|
" left join deliverygoods g" +
|
|
|
" on t.deliverygoodsid = g.deliverygoodsid" +
|
|
|
@@ -810,7 +817,7 @@ func (r *WrFactorTypeInfo) calc() {
|
|
|
}
|
|
|
|
|
|
func (r *WrFactorTypeInfo) buildSql() string {
|
|
|
- var sqlId utils.SQLVal = "select t.wrfactortypeid," +
|
|
|
+ var sqlId utils.SQLVal = "select to_char(t.wrfactortypeid) wrfactortypeid," +
|
|
|
" b.dgfactoryitemtypeid," +
|
|
|
" b.itemtypename," +
|
|
|
" c.dgfactoryitemvalue," +
|
|
|
@@ -1003,7 +1010,7 @@ type WrPerformancePlan struct {
|
|
|
}
|
|
|
|
|
|
func (r *WrPerformancePlan) calc() {
|
|
|
-
|
|
|
+ r.Wr2FactorType.Calc()
|
|
|
}
|
|
|
|
|
|
func (r *WrPerformancePlan) buildSql() string {
|
|
|
@@ -1019,7 +1026,7 @@ func (r *WrPerformancePlan) buildSql() string {
|
|
|
" h.warehousecode," +
|
|
|
" h.warehousename," +
|
|
|
" e.enumdicname," +
|
|
|
- " w.wrstandardname || '-' || t.wrfactortypename as wrtypename" +
|
|
|
+ " w.wrstandardname || '-' || t.wrfactortypename2 as wrtypename" +
|
|
|
" from wrfactortype t" +
|
|
|
" left join deliverygoods g" +
|
|
|
" on t.deliverygoodsid = g.deliverygoodsid" +
|
|
|
@@ -1119,6 +1126,7 @@ type WrHoldLB struct {
|
|
|
TRADEDATE string `json:"tradedate" xorm:"TRADEDATE" form:"tradedate"` // 交易日(yyyyMMdd)
|
|
|
WRID int64 `json:"wrid" xorm:"WRID" form:"wrid"` // 仓单变更ID
|
|
|
PARENTSUBNUM int32 `json:"parentsubnum" xorm:"PARENTSUBNUM" form:"parentsubnum"` // 拆分父子单号
|
|
|
+ PLEDGEQTY float64 `json:"pledgeqty" xorm:"'-'"` // 质押数量
|
|
|
Wr2FactorType `xorm:"extends"`
|
|
|
|
|
|
WRHOLDENO string `json:"wrholdeno"` // 仓单编号
|
|
|
@@ -1128,6 +1136,7 @@ type WrHoldLB struct {
|
|
|
func (r *WrHoldLB) calc() {
|
|
|
r.WRHOLDENO = fmt.Sprintf("%v_%v", r.LADINGBILLID, r.SUBNUM)
|
|
|
r.ENABLEQTY = r.QTY - r.FREEZERQTY
|
|
|
+ r.Wr2FactorType.Calc()
|
|
|
}
|
|
|
|
|
|
func (r *WrHoldLB) buildSql() string {
|
|
|
@@ -1143,7 +1152,7 @@ func (r *WrHoldLB) buildSql() string {
|
|
|
" h.warehousecode," +
|
|
|
" h.warehousename," +
|
|
|
" e.enumdicname," +
|
|
|
- " w.wrstandardname || '-' || t.wrfactortypename as wrtypename" +
|
|
|
+ " w.wrstandardname || '-' || t.wrfactortypename2 as wrtypename" +
|
|
|
" from wrfactortype t" +
|
|
|
" left join deliverygoods g" +
|
|
|
" on t.deliverygoodsid = g.deliverygoodsid" +
|
|
|
@@ -1155,9 +1164,9 @@ func (r *WrHoldLB) buildSql() string {
|
|
|
" on w.unitid = e.enumitemname" +
|
|
|
" and e.enumdiccode = 'goodsunit'" +
|
|
|
")" +
|
|
|
- "SELECT t.LADINGBILLID," +
|
|
|
+ "SELECT to_char(t.LADINGBILLID) LADINGBILLID," +
|
|
|
" t.SUBNUM," +
|
|
|
- " t.WRFACTORTYPEID," +
|
|
|
+ " to_char(t.WRFACTORTYPEID) WRFACTORTYPEID," +
|
|
|
" t.DELIVERYGOODSID," +
|
|
|
" t.QTY," +
|
|
|
" t.FREEZERQTY," +
|