| | |
| | | |
| | | @Override |
| | | public List<CountEntity> countVariousDataByPrj(String code) { |
| | | code = StringHelper.getRightLike(code); |
| | | code = StringUtils.isEmpty(code) || "ALL".equals(code) ? null : StringHelper.getRightLike(code); |
| | | return reportMapper.countVariousDataByPrj(code); |
| | | } |
| | | |
| | |
| | | Map<String, String> textMap = new HashMap<>(); |
| | | if (!StringHelper.isEmpty(code)) { |
| | | textMap.put("title", dirService.selectNameByCode(code)); |
| | | list.remove(list.size() - 1); |
| | | } |
| | | |
| | | List<String[]> tableList = new ArrayList<>(); |
| | |
| | | tableList.add(new String[]{"" + ce.getNo(), ce.getM1(), "" + ce.getLen()}); |
| | | break; |
| | | case "countVariousDataByPrj": |
| | | String str = "count".equals(ce.getM2()) ? "" + ce.getCount() : ("area".equals(ce.getM2()) ? "" + ce.getArea() : "" + ce.getLen()); |
| | | String str = "count".equals(ce.getM2()) ? ce.getCount() + "个" : ("area".equals(ce.getM2()) ? ce.getM3() : ce.getLen() + "千米"); |
| | | tableList.add(new String[]{"" + ce.getNo(), ce.getM1(), str}); |
| | | break; |
| | | default: |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (!StringHelper.isEmpty(code)) { |
| | | map.put("title", dirService.selectNameByCode(code)); |
| | | list.remove(list.size() - 1); |
| | | for (CountEntity ce : list) { |
| | | ce.setM2("count".equals(ce.getM2()) ? ce.getCount() + "个" : ("area".equals(ce.getM2()) ? ce.getM3() : ce.getLen() + "千米")); |
| | | } |
| | | } |
| | | |
| | | Map<String, List<CountEntity>> listMap = new HashMap<>(1); |
| | |
| | | private List<CountEntity> selectListByMethodName(ReportEntity re, String code) { |
| | | List<CountEntity> list = null; |
| | | try { |
| | | Method method = ReportService.class.getDeclaredMethod(re.getCode()); |
| | | Object obj = "countVariousDataByPrj".equals(re.getCode()) ? method.invoke(this, code) : method.invoke(this); |
| | | Object obj; |
| | | if (null != code) { |
| | | Method method = ReportService.class.getDeclaredMethod(re.getCode(), String.class); |
| | | obj = method.invoke(this, code); |
| | | } else { |
| | | Method method = ReportService.class.getDeclaredMethod(re.getCode()); |
| | | obj = method.invoke(this); |
| | | } |
| | | if (obj instanceof List<?>) { |
| | | list = (List<CountEntity>) obj; |
| | | } |