| | |
| | | @Override |
| | | public IPage<FarmPlantVO> getFarmPlantStatisticsCountz(IPage<FarmPlantVO> page, FarmPlantVO farm) { |
| | | List<FarmPlantVO> farmPlantVOS = baseMapper.getFarmPlantStatisticsCountz(page, farm); |
| | | //遍历 |
| | | farmPlantVOS.forEach(farmPlantVO -> { |
| | | if (farmPlantVO.getLandUnit().equals("1")) { |
| | | farmPlantVO.setArea(String.format("%.2f", Double.parseDouble(farmPlantVO.getArea()) * 0.1)); |
| | | } |
| | | if (farmPlantVO.getLandUnit().equals("2")) { |
| | | farmPlantVO.setArea(String.format("%.2f", Double.parseDouble(farmPlantVO.getArea()) * 0.0015)); |
| | | } |
| | | }); |
| | | // //遍历 |
| | | // farmPlantVOS.forEach(farmPlantVO -> { |
| | | // if (farmPlantVO.getLandUnit().equals("1")) { |
| | | // farmPlantVO.setArea(String.format("%.2f", Double.parseDouble(farmPlantVO.getArea()) * 0.1)); |
| | | // } |
| | | // if (farmPlantVO.getLandUnit().equals("2")) { |
| | | // farmPlantVO.setArea(String.format("%.2f", Double.parseDouble(farmPlantVO.getArea()) * 0.0015)); |
| | | // } |
| | | // }); |
| | | return page.setRecords(farmPlantVOS); |
| | | } |
| | | |
| | |
| | | public IPage<FarmPlantVO> getFarmPlantStatistics(IPage<FarmPlantVO> page, FarmPlantVO farm) { |
| | | List<FarmPlantVO> farmPlantVOS = baseMapper.getFarmPlantStatistics(page, farm); |
| | | //遍历 |
| | | farmPlantVOS.forEach(farmPlantVO -> { |
| | | if (farmPlantVO.getLandUnit().equals("1")) { |
| | | BigDecimal bg = new BigDecimal(farmPlantVO.getAreas() * 0.1); |
| | | farmPlantVO.setAreas(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
| | | } |
| | | if (farmPlantVO.getLandUnit().equals("2")) { |
| | | BigDecimal bg = new BigDecimal(farmPlantVO.getAreas() * 0.0015); |
| | | farmPlantVO.setAreas(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
| | | } |
| | | }); |
| | | // farmPlantVOS.forEach(farmPlantVO -> { |
| | | // if (farmPlantVO.getLandUnit().equals("1")) { |
| | | // BigDecimal bg = new BigDecimal(farmPlantVO.getAreas() * 0.1); |
| | | // farmPlantVO.setAreas(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
| | | // } |
| | | // if (farmPlantVO.getLandUnit().equals("2")) { |
| | | // BigDecimal bg = new BigDecimal(farmPlantVO.getAreas() * 0.0015); |
| | | // farmPlantVO.setAreas(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); |
| | | // } |
| | | // }); |
| | | return page.setRecords(farmPlantVOS); |
| | | } |
| | | |