| | |
| | | |
| | | @Override |
| | | public Integer selectCount(String name, String code) { |
| | | name = StringHelper.getLikeStr(name); |
| | | name = StringHelper.getLikeUpperStr(name); |
| | | |
| | | return reportMapper.selectCount(name, code); |
| | | } |
| | | |
| | | @Override |
| | | public List<ReportEntity> selectByPage(String name, String code, Integer limit, Integer offset) { |
| | | name = StringHelper.getLikeStr(name); |
| | | name = StringHelper.getLikeUpperStr(name); |
| | | |
| | | return reportMapper.selectByPage(name, code, limit, offset); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<CountEntity> countSizesByType() { |
| | | return reportMapper.countSizesByType(); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountEntity> countServices() { |
| | | return reportMapper.countServices(); |
| | | } |
| | |
| | | @Override |
| | | public List<CountEntity> countOperates() { |
| | | return reportMapper.countOperates(); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountEntity> countSizesByPrj() { |
| | | return reportMapper.countSizesByPrj(); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountEntity> countExplorationPoints() { |
| | | return reportMapper.countExplorationPoints(); |
| | | } |
| | | |
| | | /** |
| | |
| | | private void generateReport(String source, String target, ReportEntity re) { |
| | | if (StaticData.S1.equals(re.getType())) { |
| | | switch (re.getCode()) { |
| | | case "countOperates ": |
| | | case "countOperates": |
| | | createCountOperatesWord(source, target); |
| | | break; |
| | | case "countSizes": |
| | | createCountSizesWord(source, target); |
| | | break; |
| | | default: |
| | | case "countServices": |
| | | createCountServicesWord(source, target); |
| | | break; |
| | | case "countExplorationPoints": |
| | | createCountExplorationPointsWord(source, target); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } else { |
| | | switch (re.getCode()) { |
| | | case "countOperates ": |
| | | case "countOperates": |
| | | createCountOperatesExcel(source, target); |
| | | break; |
| | | case "countSizes": |
| | | createCountSizesExcel(source, target); |
| | | break; |
| | | default: |
| | | case "countServices": |
| | | createCountServicesExcel(source, target); |
| | | break; |
| | | case "countExplorationPoints": |
| | | createCountExplorationPointsExcel(source, target); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | int rows = 1; |
| | | int rows = 1, allCount = 0; |
| | | ArrayList<String[]> addList = new ArrayList<>(); |
| | | for (CountEntity ce : list) { |
| | | allCount += ce.getCount(); |
| | | String[] strs = new String[]{"" + rows++, ce.getM1(), ce.getM2(), ce.getCount().toString()}; |
| | | addList.add(strs); |
| | | } |
| | | if (addList.size() > 0) { |
| | | addList.add(new String[]{"" + rows, "总计", " ", "" + allCount}); |
| | | } |
| | | |
| | | WordHelper.generateWord(source, target, null, addList); |
| | |
| | | return; |
| | | } |
| | | |
| | | int rows = 1; |
| | | int rows = 1, allCount = 0; |
| | | ArrayList<String[]> addList = new ArrayList<>(); |
| | | for (CountEntity ce : list) { |
| | | allCount += ce.getCount(); |
| | | String[] strs = new String[]{"" + rows++, ce.getM1(), ce.getCount().toString()}; |
| | | addList.add(strs); |
| | | } |
| | | if (addList.size() > 0) { |
| | | addList.add(new String[]{"" + rows, "总计", "" + allCount}); |
| | | } |
| | | |
| | | WordHelper.generateWord(source, target, null, addList); |
| | |
| | | } |
| | | |
| | | int rows = 1; |
| | | Double allSize = 0d; |
| | | ArrayList<String[]> addList = new ArrayList<>(); |
| | | for (CountEntity ce : list) { |
| | | allSize += ce.getSizes(); |
| | | String[] strs = new String[]{"" + rows++, ce.getM1(), FileHelper.getSizes(ce.getSizes())}; |
| | | addList.add(strs); |
| | | } |
| | | if (addList.size() > 0) { |
| | | addList.add(new String[]{"" + rows, "总计", FileHelper.getSizes(allSize)}); |
| | | } |
| | | |
| | | WordHelper.generateWord(source, target, null, addList); |
| | | } |
| | | |
| | | /** |
| | | * 创建 钻孔数据统计 Word |
| | | */ |
| | | public void createCountExplorationPointsWord(String source, String target) { |
| | | List<CountEntity> list = countExplorationPoints(); |
| | | if (null == list || list.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | int rows = 1, allCount = 0; |
| | | Double allSize = 0d; |
| | | ArrayList<String[]> addList = new ArrayList<>(); |
| | | for (CountEntity ce : list) { |
| | | allSize += ce.getSizes(); |
| | | allCount += ce.getCount(); |
| | | String[] strs = new String[]{"" + rows++, ce.getM1(), "" + ce.getCount(), FileHelper.getSizes(ce.getSizes())}; |
| | | addList.add(strs); |
| | | } |
| | | if (addList.size() > 0) { |
| | | addList.add(new String[]{"" + rows, "总计", "" + allCount, FileHelper.getSizes(allSize)}); |
| | | } |
| | | |
| | | WordHelper.generateWord(source, target, null, addList); |
| | |
| | | return; |
| | | } |
| | | |
| | | int rows = 1; |
| | | int rows = 1, allCount = 0; |
| | | for (CountEntity ce : list) { |
| | | ce.setNo(rows++); |
| | | allCount += ce.getCount(); |
| | | } |
| | | if (list.size() > 0) { |
| | | CountEntity ce = new CountEntity(); |
| | | ce.setNo(rows); |
| | | ce.setM1("总计"); |
| | | ce.setCount((long) allCount); |
| | | list.add(ce); |
| | | } |
| | | |
| | | Map<String, List<CountEntity>> map = new HashMap<>(1); |
| | |
| | | return; |
| | | } |
| | | |
| | | int rows = 1; |
| | | int rows = 1, allCount = 0; |
| | | for (CountEntity ce : list) { |
| | | ce.setNo(rows++); |
| | | allCount += ce.getCount(); |
| | | } |
| | | if (list.size() > 0) { |
| | | CountEntity ce = new CountEntity(); |
| | | ce.setNo(rows); |
| | | ce.setM1("总计"); |
| | | ce.setCount((long) allCount); |
| | | list.add(ce); |
| | | } |
| | | |
| | | Map<String, List<CountEntity>> map = new HashMap<>(1); |
| | |
| | | } |
| | | |
| | | int rows = 1; |
| | | Double allSize = 0d; |
| | | for (CountEntity ce : list) { |
| | | ce.setNo(rows++); |
| | | ce.setM2(FileHelper.getSizes(ce.getSizes())); |
| | | allSize += ce.getSizes(); |
| | | } |
| | | if (list.size() > 0) { |
| | | CountEntity ce = new CountEntity(); |
| | | ce.setNo(rows); |
| | | ce.setM1("总计"); |
| | | ce.setM2(FileHelper.getSizes(allSize)); |
| | | list.add(ce); |
| | | } |
| | | |
| | | Map<String, List<CountEntity>> map = new HashMap<>(1); |
| | | map.put("data", list); |
| | | |
| | | ExcelHelper.writeToTemplate(source, target, map); |
| | | } |
| | | |
| | | /** |
| | | * 创建 钻孔数据统计 Excel |
| | | */ |
| | | public void createCountExplorationPointsExcel(String source, String target) { |
| | | List<CountEntity> list = countExplorationPoints(); |
| | | if (null == list || list.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | int rows = 1, allCount = 0; |
| | | Double allSize = 0d; |
| | | for (CountEntity ce : list) { |
| | | ce.setNo(rows++); |
| | | ce.setM2(FileHelper.getSizes(ce.getSizes())); |
| | | allCount += ce.getCount(); |
| | | allSize += ce.getSizes(); |
| | | } |
| | | if (list.size() > 0) { |
| | | CountEntity ce = new CountEntity(); |
| | | ce.setNo(rows); |
| | | ce.setM1("总计"); |
| | | ce.setCount((long) allCount); |
| | | ce.setM2(FileHelper.getSizes(allSize)); |
| | | list.add(ce); |
| | | } |
| | | |
| | | Map<String, List<CountEntity>> map = new HashMap<>(1); |
| | |
| | | private DownloadEntity getDownloadEntity(UserEntity ue, String file) { |
| | | DownloadEntity de = new DownloadEntity(); |
| | | de.setName(FileHelper.getFileName(file)); |
| | | // 1-Shp文件,2-专题图,3-源数据,4-业务数据,5-管道分析,6-统计报告 |
| | | // 1-Shp文件,2-专题图,3-元数据,4-业务数据,5-管道分析,6-统计报告,7-附件文件,8-瓦片文件 |
| | | de.setType(6); |
| | | de.setSizes(FileHelper.sizeToMb(new File(file).length())); |
| | | de.setDepid(ue.getDepid()); |