| | |
| | | import java.io.File; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 报告模板 |
| | | * @author WWW |
| | | */ |
| | | @Service |
| | | @SuppressWarnings("ALL") |
| | | public class ReportService implements ReportMapper { |
| | | @Autowired |
| | | ReportMapper reportMapper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<CountEntity> countSizesByType() { |
| | | return reportMapper.countSizesByType(); |
| | | } |
| | | |
| | | @Override |
| | | public List<CountEntity> countServices() { |
| | | return reportMapper.countServices(); |
| | | } |
| | |
| | | return reportMapper.countOperates(); |
| | | } |
| | | |
| | | /** |
| | | * 创建报告 |
| | | */ |
| | | @Override |
| | | public List<CountEntity> countSizesByPrj() { |
| | | return reportMapper.countSizesByPrj(); |
| | | } |
| | | |
| | | public void createReport(UserEntity ue, ReportEntity re, HttpServletResponse res) throws Exception { |
| | | AttachEntity ae = attachService.selectByGuid(re.getGuid()); |
| | | if (null == ae) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成报告 |
| | | */ |
| | | private void generateReport(String source, String target, ReportEntity re) { |
| | | if (StaticData.S1.equals(re.getType())) { |
| | | switch (re.getCode()) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建 用户流量统计 Word |
| | | */ |
| | | public void createCountOperatesWord(String source, String target) { |
| | | List<CountEntity> list = countOperates(); |
| | | if (null == list || list.isEmpty()) { |
| | |
| | | WordHelper.generateWord(source, target, null, addList); |
| | | } |
| | | |
| | | /** |
| | | * 创建 服务调用量统计 Word |
| | | */ |
| | | public void createCountServicesWord(String source, String target) { |
| | | List<CountEntity> list = countServices(); |
| | | if (null == list || list.isEmpty()) { |
| | |
| | | WordHelper.generateWord(source, target, null, addList); |
| | | } |
| | | |
| | | /** |
| | | * 创建 数据量统计 Word |
| | | */ |
| | | public void createCountSizesWord(String source, String target) { |
| | | List<CountEntity> list = countSizes(); |
| | | if (null == list || list.isEmpty()) { |
| | |
| | | WordHelper.generateWord(source, target, null, addList); |
| | | } |
| | | |
| | | /** |
| | | * 创建 用户流量统计 Excel |
| | | */ |
| | | public void createCountOperatesExcel(String source, String target) { |
| | | List<CountEntity> list = countOperates(); |
| | | if (null == list || list.isEmpty()) { |
| | |
| | | ExcelHelper.writeToTemplate(source, target, map); |
| | | } |
| | | |
| | | /** |
| | | * 创建 服务调用量统计 Excel |
| | | */ |
| | | public void createCountServicesExcel(String source, String target) { |
| | | List<CountEntity> list = countServices(); |
| | | if (null == list || list.isEmpty()) { |
| | |
| | | ExcelHelper.writeToTemplate(source, target, map); |
| | | } |
| | | |
| | | /** |
| | | * 创建 数据量统计 Excel |
| | | */ |
| | | public void createCountSizesExcel(String source, String target) { |
| | | List<CountEntity> list = countSizes(); |
| | | if (null == list || list.isEmpty()) { |
| | |
| | | ExcelHelper.writeToTemplate(source, target, map); |
| | | } |
| | | |
| | | /** |
| | | * 获取下载实体类 |
| | | */ |
| | | private DownloadEntity getDownloadEntity(UserEntity ue, String file) { |
| | | DownloadEntity de = new DownloadEntity(); |
| | | de.setName(FileHelper.getFileName(file)); |