| | |
| | | @Resource |
| | | private GatewaySerService gatewaySerService; |
| | | |
| | | @Resource |
| | | private FoodPriceService foodPriceService; |
| | | |
| | | /** |
| | | * 根据库区编码获取库区网关信息 |
| | | * |
| | |
| | | } |
| | | //近七天玉米出库价格统计 |
| | | |
| | | //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() + ""); |
| | | //粮食品种玉米 |
| | |
| | | nowPrice = newPrice; |
| | | } |
| | | mapWeekMaizeNum.put(key, nowPrice); |
| | | |
| | | } |
| | | } |
| | | } |