sgj
6 小时以前 9dcc346205e2c96b28f2f561f439a29bc6c2a6dc
fzzy-igdss-web/src/main/java/com/fzzy/common/manager/CommonManager.java
@@ -61,6 +61,9 @@
    @Resource
    private GatewaySerService gatewaySerService;
    @Resource
    private FoodPriceService foodPriceService;
    /**
     * 根据库区编码获取库区网关信息
     *
@@ -306,6 +309,27 @@
        }
        //近七天玉米出库价格统计
        //1.默认从粮食单价中获取
        IgdsBaseParam paramOfFoodPrice = new IgdsBaseParam();
        //粮食品种玉米
        paramOfFoodPrice.setKey("1120000");
        paramOfFoodPrice.setStart(DateUtil.getNewByDay(new Date(), -6));
        paramOfFoodPrice.setEnd(new Date());
        List<FoodPrice> foodPrices = foodPriceService.listData(paramOfFoodPrice);
        if (null != foodPrices && !foodPrices.isEmpty()) {
            for (FoodPrice record : foodPrices) {
                key = DateFormatUtils.format(record.getCreateTime(), "MM-dd");
                if (null != mapWeekMaizeNum.get(key)) {
                    Double nowPrice = mapWeekMaizeNum.get(key);
                    Double newPrice = record.getPrice();
                    if (nowPrice > newPrice || nowPrice == 0) {
                        nowPrice = newPrice;
                    }
                    mapWeekMaizeNum.put(key, nowPrice);
                }
            }
        }
        //2.查询出入库的单价,有出库的话,用出库单价替换粮食单价
        InoutParam inoutParamOfMaize = new InoutParam();
        inoutParamOfMaize.setDeptId(user.getDeptId() + "");
        //粮食品种玉米
@@ -324,7 +348,6 @@
                        nowPrice = newPrice;
                    }
                    mapWeekMaizeNum.put(key, nowPrice);
                }
            }
        }