|
|
@@ -402,6 +402,8 @@ type ErmcpReportDaySpot struct {
|
|
|
WRSTANDARDNAME string `json:"wrstandardname" xorm:"'WRSTANDARDNAME'"` // 现货商品名称
|
|
|
WRSTANDARDCODE string `json:"wrstandardcode" xorm:"'WRSTANDARDCODE'"` // 现货商品代码
|
|
|
UNITID int32 `json:"-" xorm:"'UNITID'"` // 现货商品单位id
|
|
|
+ BUYINQTY float64 `json:"buyinqty" xorm:"'BUYINQTY'"` // 采购入库量
|
|
|
+ SELLOUTQTY float64 `json:"selloutqty" xorm:"'SELLOUTQTY'"` // 销售出库量
|
|
|
|
|
|
ENUMDICNAME string `json:"enumdicname"` // 现货商品单位名称
|
|
|
TOTALBUYPRICEDQTY float64 `json:"totalbuypricedqty"` // 采购定价量 = 期末 - 期初
|
|
|
@@ -418,7 +420,8 @@ func (r *ErmcpReportDaySpot) Calc() {
|
|
|
}
|
|
|
|
|
|
func (r *ErmcpReportDaySpot) buildSql() string {
|
|
|
- var sqlId utils.SQLVal = "select t.BUYPRICEDQTY," +
|
|
|
+ var sqlId utils.SQLVal = "select t.reckondate," +
|
|
|
+ " t.BUYPRICEDQTY," +
|
|
|
" t.SELLPRICEDQTY," +
|
|
|
" t.Oribuypricedqty," +
|
|
|
" t.Orisellpricedqty," +
|
|
|
@@ -429,8 +432,12 @@ func (r *ErmcpReportDaySpot) buildSql() string {
|
|
|
" t.AREAUSERID," +
|
|
|
" w.wrstandardname," +
|
|
|
" w.wrstandardcode," +
|
|
|
- " w.unitid" +
|
|
|
+ " w.unitid," +
|
|
|
+ " s.todaybuyinqty buyinqty," +
|
|
|
+ " s.todayselloutqty selloutqty" +
|
|
|
" from RECKON_ERMCP_AREASPOT t" +
|
|
|
+ " left join Reckon_ERMCP_AreaStock s" +
|
|
|
+ " on t.reckondate = s.reckondate" +
|
|
|
" left join wrstandard w" +
|
|
|
" on t.wrstandardid = w.wrstandardid" +
|
|
|
" where 1 = 1"
|
|
|
@@ -479,6 +486,8 @@ type ErmcpReportMonSpot struct {
|
|
|
WRSTANDARDNAME string `json:"wrstandardname" xorm:"'WRSTANDARDNAME'"` // 现货商品名称
|
|
|
WRSTANDARDCODE string `json:"wrstandardcode" xorm:"'WRSTANDARDCODE'"` // 现货商品代码
|
|
|
UNITID int32 `json:"-" xorm:"'UNITID'"` // 现货商品单位id
|
|
|
+ BUYINQTY float64 `json:"buyinqty" xorm:"'BUYINQTY'"` // 采购入库量
|
|
|
+ SELLOUTQTY float64 `json:"selloutqty" xorm:"'SELLOUTQTY'"` // 销售出库量
|
|
|
|
|
|
ENUMDICNAME string `json:"enumdicname"` // 现货商品单位名称
|
|
|
TOTALBUYPRICEDQTY float64 `json:"totalbuypricedqty"` // 采购定价量 = 期末 - 期初
|
|
|
@@ -505,8 +514,13 @@ func (r *ErmcpReportMonSpot) buildSql() string {
|
|
|
" t.AREAUSERID," +
|
|
|
" w.wrstandardname," +
|
|
|
" w.wrstandardcode," +
|
|
|
- " w.unitid" +
|
|
|
+ " w.unitid," +
|
|
|
+ " s.todaybuyinqty buyinqty," +
|
|
|
+ " s.todayselloutqty selloutqty" +
|
|
|
" from Report_ERMCP_AreaSpot t" +
|
|
|
+ " left join Report_ERMCP_AreaStock s" +
|
|
|
+ " on t.cycletime = s.cycletime" +
|
|
|
+ " and t.cycletype = s.cycletype" +
|
|
|
" left join wrstandard w" +
|
|
|
" on t.wrstandardid = w.wrstandardid" +
|
|
|
" where t.cycletype = 1"
|