| | |
| | | */ |
| | | @GetMapping("/getFarmPlantStatisticsCountx") |
| | | public R getFarmPlantStatisticsCountx(FarmPlantVO farmPlant, Query query) { |
| | | Double num = 0.0; |
| | | // Double num = 0.0; |
| | | IPage<FarmPlantVO> pages = farmplantService.getFarmPlantStatisticsCountz(Condition.getPage(query), farmPlant); |
| | | for (int i = 0; i < pages.getRecords().size(); i++) { |
| | | String area = pages.getRecords().get(i).getArea(); |
| | | Double a = Double.parseDouble(area); |
| | | DecimalFormat df = new DecimalFormat("#.00"); |
| | | String format = df.format(a); |
| | | pages.getRecords().get(i).setArea(format); |
| | | num += a; |
| | | } |
| | | Map map = new HashMap(); |
| | | List list = new ArrayList(); |
| | | DecimalFormat df = new DecimalFormat("#.00"); |
| | | String format = df.format(num); |
| | | map.put("znum", format); |
| | | list.add(map); |
| | | list.add(pages); |
| | | return R.data(list); |
| | | // for (int i = 0; i < pages.getRecords().size(); i++) { |
| | | // String area = pages.getRecords().get(i).getArea(); |
| | | // Double a = Double.parseDouble(area); |
| | | // DecimalFormat df = new DecimalFormat("#.00"); |
| | | // String format = df.format(a); |
| | | // pages.getRecords().get(i).setArea(format); |
| | | // num += a; |
| | | // } |
| | | // Map map = new HashMap(); |
| | | // List list = new ArrayList(); |
| | | // DecimalFormat df = new DecimalFormat("#.00"); |
| | | // String format = df.format(num); |
| | | // map.put("znum", format); |
| | | // list.add(map); |
| | | // list.add(pages); |
| | | // return R.data(list); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | |