|
@@ -26,6 +26,8 @@ type ErmcpSpotContractModel struct {
|
|
|
SELLUSERNAME string `json:"sellusername" xorm:"'SELLUSERNAME'"` // 销售方名称
|
|
SELLUSERNAME string `json:"sellusername" xorm:"'SELLUSERNAME'"` // 销售方名称
|
|
|
DELIVERYGOODSID int32 `json:"deliverygoodsid" xorm:"'DELIVERYGOODSID'"` // 现货品种ID
|
|
DELIVERYGOODSID int32 `json:"deliverygoodsid" xorm:"'DELIVERYGOODSID'"` // 现货品种ID
|
|
|
WRSTANDARDID int32 `json:"wrstandardid" xorm:"'wrstandardid'"` // 现货商品ID
|
|
WRSTANDARDID int32 `json:"wrstandardid" xorm:"'wrstandardid'"` // 现货商品ID
|
|
|
|
|
+ WRSTANDARDNAME string `json:"wrstandardname" xorm:"'WRSTANDARDNAME'"` // 现货商品名称
|
|
|
|
|
+ WRSTANDARDCODE string `json:"wrstandardcode" xorm:"'WRSTANDARDCODE'"` // 现货商品代码
|
|
|
DELIVERYGOODSCODE string `json:"deliverygoodscode" xorm:"'DELIVERYGOODSCODE'"` // 现货品种代码
|
|
DELIVERYGOODSCODE string `json:"deliverygoodscode" xorm:"'DELIVERYGOODSCODE'"` // 现货品种代码
|
|
|
DELIVERYGOODSNAME string `json:"deliverygoodsname" xorm:"'DELIVERYGOODSNAME'"` // 现货品种名称
|
|
DELIVERYGOODSNAME string `json:"deliverygoodsname" xorm:"'DELIVERYGOODSNAME'"` // 现货品种名称
|
|
|
PRODUCTTYPE int32 `json:"producttype" xorm:"'PRODUCTTYPE'"` // 产品类型 - 1:标准仓单 2:等标 3:非标
|
|
PRODUCTTYPE int32 `json:"producttype" xorm:"'PRODUCTTYPE'"` // 产品类型 - 1:标准仓单 2:等标 3:非标
|
|
@@ -100,7 +102,9 @@ func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
|
|
|
" g2.goodsname," +
|
|
" g2.goodsname," +
|
|
|
" gb.brandname," +
|
|
" gb.brandname," +
|
|
|
" gm.modelname," +
|
|
" gm.modelname," +
|
|
|
- " e.Enumdicname" +
|
|
|
|
|
|
|
+ " e.Enumdicname," +
|
|
|
|
|
+ " w.wrstandardname," +
|
|
|
|
|
+ " w.wrstandardcode" +
|
|
|
" FROM ERMCP_SPOTCONTRACT t" +
|
|
" FROM ERMCP_SPOTCONTRACT t" +
|
|
|
" left join useraccount u1" +
|
|
" left join useraccount u1" +
|
|
|
" on t.buyuserid = u1.userid" +
|
|
" on t.buyuserid = u1.userid" +
|
|
@@ -112,8 +116,10 @@ func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
|
|
|
" on t.goodsid = g2.goodsid" +
|
|
" on t.goodsid = g2.goodsid" +
|
|
|
" left join spotgoodsbrand gb on t.spotgoodsbrandid=gb.brandid" +
|
|
" left join spotgoodsbrand gb on t.spotgoodsbrandid=gb.brandid" +
|
|
|
" left join spotgoodsmodel gm on t.spotgoodsmodelid=gm.modelid" +
|
|
" left join spotgoodsmodel gm on t.spotgoodsmodelid=gm.modelid" +
|
|
|
|
|
+ " left join wrstandard w" +
|
|
|
|
|
+ " on t.wrstandardid = w.wrstandardid" +
|
|
|
" left join enumdicitem e" +
|
|
" left join enumdicitem e" +
|
|
|
- " on g.goodsunitid = e.enumitemname" +
|
|
|
|
|
|
|
+ " on w.unitid = e.enumitemname" +
|
|
|
" and e.enumdiccode = 'goodsunit'" +
|
|
" and e.enumdiccode = 'goodsunit'" +
|
|
|
" where t.contractstatus in (%v)" +
|
|
" where t.contractstatus in (%v)" +
|
|
|
" and t.userid = %v"
|
|
" and t.userid = %v"
|
|
@@ -157,8 +163,8 @@ type ErmcpModel struct {
|
|
|
SpotContractId string `json:"spotcontractid" xorm:"'SPOTCONTRACTID'"` // 合同ID
|
|
SpotContractId string `json:"spotcontractid" xorm:"'SPOTCONTRACTID'"` // 合同ID
|
|
|
AccountName string `json:"accountname" xorm:"'ACCOUNTNAME'"` // 账户名称
|
|
AccountName string `json:"accountname" xorm:"'ACCOUNTNAME'"` // 账户名称
|
|
|
DeliveryGoodsId int `json:"deliverygoodsid" xorm:"'DELIVERYGOODSID'"` // 现货商品ID
|
|
DeliveryGoodsId int `json:"deliverygoodsid" xorm:"'DELIVERYGOODSID'"` // 现货商品ID
|
|
|
- DeliveryGoodsCode string `json:"deliverygoodscode" xorm:"'DELIVERYGOODSCODE'"` // 现货商品代码
|
|
|
|
|
- DeliveryGoodsName string `json:"deliverygoodsname" xorm:"'DELIVERYGOODSNAME'"` // 现货商品名称
|
|
|
|
|
|
|
+ DeliveryGoodsCode string `json:"deliverygoodscode" xorm:"'DELIVERYGOODSCODE'"` // 现货品种代码
|
|
|
|
|
+ DeliveryGoodsName string `json:"deliverygoodsname" xorm:"'DELIVERYGOODSNAME'"` // 现货品种名称
|
|
|
SpotGoodsdesc string `json:"spotgoodsdesc" xorm:"'SPOTGOODSDESC'"` // 商品型号(商品规格)
|
|
SpotGoodsdesc string `json:"spotgoodsdesc" xorm:"'SPOTGOODSDESC'"` // 商品型号(商品规格)
|
|
|
GoodsId int `json:"goodsid" xorm:"'GOODSID'"` // 点价商品ID
|
|
GoodsId int `json:"goodsid" xorm:"'GOODSID'"` // 点价商品ID
|
|
|
GOODSNAME string `json:"goodsname" xorm:"'GOODSNAME'"` // 点价商品名称
|
|
GOODSNAME string `json:"goodsname" xorm:"'GOODSNAME'"` // 点价商品名称
|
|
@@ -204,6 +210,9 @@ type ErmcpModel struct {
|
|
|
SPOTGOODSBRANDID int32 `json:"spotgoodsbrandid" xorm:"'SPOTGOODSBRANDID'"` // 现货品牌ID
|
|
SPOTGOODSBRANDID int32 `json:"spotgoodsbrandid" xorm:"'SPOTGOODSBRANDID'"` // 现货品牌ID
|
|
|
BRANDNAME string `json:"brandname" xorm:"'brandname'"` // 品牌名称
|
|
BRANDNAME string `json:"brandname" xorm:"'brandname'"` // 品牌名称
|
|
|
MODELNAME string `json:"modelname" xorm:"'modelname'"` // 型号名称
|
|
MODELNAME string `json:"modelname" xorm:"'modelname'"` // 型号名称
|
|
|
|
|
+ WRSTANDARDID int64 `json:"wrstandardid" xorm:"'WRSTANDARDID'"` // 现货商品ID
|
|
|
|
|
+ WRSTANDARDNAME string `json:"wrstandardname" xorm:"'WRSTANDARDNAME'"` // 现货商品名称
|
|
|
|
|
+ WRSTANDARDCODE string `json:"wrstandardcode" xorm:"'WRSTANDARDCODE'"` // 现货商品代码
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (r *ErmcpModel) calc() {
|
|
func (r *ErmcpModel) calc() {
|
|
@@ -260,6 +269,9 @@ func (r *ErmcpModel) buildSql(nContractType, nQueryType int32) string {
|
|
|
" u.accountname," +
|
|
" u.accountname," +
|
|
|
" g.deliverygoodscode," +
|
|
" g.deliverygoodscode," +
|
|
|
" g.deliverygoodsname," +
|
|
" g.deliverygoodsname," +
|
|
|
|
|
+ " wr.wrstandardid," +
|
|
|
|
|
+ " wr.wrstandardname," +
|
|
|
|
|
+ " wr.wrstandardcode," +
|
|
|
" g2.goodscode," +
|
|
" g2.goodscode," +
|
|
|
" g2.goodsname," +
|
|
" g2.goodsname," +
|
|
|
" gb.brandname," +
|
|
" gb.brandname," +
|