zou.yingbin 4 vuotta sitten
vanhempi
commit
02e679dc0a

+ 4 - 2
controllers/ermcp/qryWarehouse.go

@@ -10,6 +10,7 @@ import (
 	"github.com/gin-gonic/gin"
 	"mtp2_if/global/app"
 	"mtp2_if/models"
+	"mtp2_if/mtpcache"
 )
 
 // QryWarehouseReq 仓库查询请求参数
@@ -35,6 +36,7 @@ func QueryWarehouseInfo(c *gin.Context) {
 	a := app.NewGinUtils(c)
 	req := QryWarehouseReq{}
 	a.DoBindReq(&req)
-	m := models.ErmcpWareHouseInfo{AREAUSERID: req.UserId, FilterStatus: req.Status}
-	a.DoGetDataEx(&m)
+	m := models.ErmcpWareHouseInfo{AREAUSERID: mtpcache.GetAreaUserId(req.UserId, 0),
+		FilterStatus: req.Status}
+	a.DoGetDataI(&m)
 }

+ 3 - 2
controllers/ermcp3/qryErmcp3Report.go

@@ -403,7 +403,7 @@ func QryAreaStockReport(c *gin.Context) {
 		DELIVERYGOODSID  int32  `form:"deliverygoodsid"`  // 现货品种id
 		WRSTANDARDID     int32  `form:"wrstandardid"`     // 品类ID
 		SPOTGOODSBRANDID int32  `form:"spotgoodsbrandid"` // 品牌id
-		WAREHOUSEINFOID  int32  `form:"warehouseinfoid"`  // 仓库id
+		WAREHOUSEINFOID  string `form:"warehouseinfoid"`  // 仓库id
 	}{}
 	a.DoBindReq(&req)
 	a.CheckParam(&req)
@@ -424,7 +424,8 @@ func QryAreaStockReport(c *gin.Context) {
 	req.CovertRequest()
 	m := models.Ermcp3AreaStockReportEx{USERID: req.USERID, RECKONDATE: req.TRADEDATE,
 		CYCLETYPE: req.CYCLETYPE, CYCLETIME: req.CYCLETIME, BeginDate: req.BEGINDATE, EndDate: req.ENDDATE,
-		DELIVERYGOODSID: req2.DELIVERYGOODSID, WRSTANDARDID: req2.WRSTANDARDID, SPOTGOODSBRANDID: req2.SPOTGOODSBRANDID, SumFields: req2.SUMFIELDS}
+		DELIVERYGOODSID: req2.DELIVERYGOODSID, WRSTANDARDID: req2.WRSTANDARDID,
+		SPOTGOODSBRANDID: req2.SPOTGOODSBRANDID, WAREHOUSEINFOID: req2.WAREHOUSEINFOID, SumFields: req2.SUMFIELDS}
 	a.DoGetDataI(&m)
 }
 

+ 6 - 4
models/ermcp3Report.go

@@ -562,7 +562,9 @@ func (r *Ermcp3ExpourseReport) buildSqlDay() string {
 		"       t.NEEDARBITRAGEQTY," +
 		"       g.middlegoodsname," +
 		"       g.middlegoodscode," +
-		"       g.goodsunitid unitid" +
+		"       g.goodsunitid unitid," +
+		"       g.needhedgeratio MGNEEDHEDGERATIO," +
+		"       g.needarbitrageratio" +
 		"  FROM RECKON_ERMCP_AREAEXPOSURE t" +
 		"  LEFT JOIN ERMS_MIDDLEGOODS g" +
 		"    on t.middlegoodsid = g.middlegoodsid" +
@@ -1570,7 +1572,7 @@ func (r *Ermcp3AreaStockReportEx) buildSqlReckonSum(fields []string) string {
 	// 品牌id
 	sqlParam.AndEx("t.SPOTGOODSBRANDID", r.SPOTGOODSBRANDID, r.SPOTGOODSBRANDID > 0)
 	// 仓库id
-	sqlId.AndEx("t.WAREHOUSEINFOID", r.WAREHOUSEINFOID, len(r.WAREHOUSEINFOID) > 0)
+	sqlParam.AndEx("t.WAREHOUSEINFOID", r.WAREHOUSEINFOID, len(r.WAREHOUSEINFOID) > 0)
 	var strFileds string
 	for _, v := range fields {
 		if len(strFileds) > 0 {
@@ -1610,7 +1612,7 @@ func (r *Ermcp3AreaStockReportEx) buildSqlReport() string {
 		"       g.deliverygoodscode," +
 		"       g.deliverygoodsname," +
 		"       g.goodsunitid" +
-		"  FROM RECKON_ERMCP_AREASTOCK t" +
+		"  FROM REPORT_ERMCP_AREASTOCK t" +
 		"  LEFT JOIN WRSTANDARD w" +
 		"    on t.wrstandardid = w.wrstandardid" +
 		"  LEFT JOIN dgfactoryitem gb" +
@@ -1659,7 +1661,7 @@ func (r *Ermcp3AreaStockReportEx) buildSqlReportSum(fields []string) string {
 	// 品牌id
 	sqlParam.AndEx("t.SPOTGOODSBRANDID", r.SPOTGOODSBRANDID, r.SPOTGOODSBRANDID > 0)
 	// 仓库id
-	sqlId.AndEx("t.WAREHOUSEINFOID", r.WAREHOUSEINFOID, len(r.WAREHOUSEINFOID) > 0)
+	sqlParam.AndEx("t.WAREHOUSEINFOID", r.WAREHOUSEINFOID, len(r.WAREHOUSEINFOID) > 0)
 	var strFileds string
 	for _, v := range fields {
 		if len(strFileds) > 0 {