|
|
|
@ -203,49 +203,6 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
|
|
|
|
|
return R.data("success"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
HashMap<String, Object> map = new HashMap<>(); |
|
|
|
|
List<TicketChartVo> ticketList = new ArrayList<>(); |
|
|
|
|
TicketConstants.TicketTypeNameEnum[] values = TicketConstants.TicketTypeNameEnum.values(); |
|
|
|
|
TicketChartVo sum=new TicketChartVo(); |
|
|
|
|
List<TicketChartCell> sas = new ArrayList<>(); |
|
|
|
|
sum.setDeptName("总计"); |
|
|
|
|
for (TicketConstants.TicketTypeNameEnum value : values) { |
|
|
|
|
TicketChartCell ticketChartCell = new TicketChartCell(); |
|
|
|
|
ticketChartCell.setTicketType(value.getType()); |
|
|
|
|
ticketChartCell.setTicketName(value.getFileName()); |
|
|
|
|
Integer integer = Integer.valueOf(value.getType()); |
|
|
|
|
ticketChartCell.setTicketMon(30+ integer); |
|
|
|
|
BigDecimal d=BigDecimal.valueOf(integer).divide(BigDecimal.valueOf(100),2,BigDecimal.ROUND_UP); |
|
|
|
|
ticketChartCell.setTicketMonPerc(0.3+ d.doubleValue()); |
|
|
|
|
sas.add(ticketChartCell); |
|
|
|
|
} |
|
|
|
|
sum.setChartCells(sas); |
|
|
|
|
ticketList.add(sum); |
|
|
|
|
//两票柱状图数据
|
|
|
|
|
// 创建数据
|
|
|
|
|
DefaultCategoryDataset dataset = new DefaultCategoryDataset(); |
|
|
|
|
for (TicketChartVo chartVo : ticketList) { |
|
|
|
|
for (int i = 0; i < chartVo.getChartCells().size(); i++) { |
|
|
|
|
TicketChartCell ticketChartCell = chartVo.getChartCells().get(i); |
|
|
|
|
dataset.addValue(ticketChartCell.getTicketMon(), ticketChartCell.getTicketName(), ticketChartCell.getTicketName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
DefaultCategoryDataset datasetLine = new DefaultCategoryDataset(); |
|
|
|
|
for (TicketChartVo chartVo : ticketList) { |
|
|
|
|
for (int i = 0; i < chartVo.getChartCells().size(); i++) { |
|
|
|
|
TicketChartCell ticketChartCell = chartVo.getChartCells().get(i); |
|
|
|
|
datasetLine.addValue(ticketChartCell.getTicketMonPerc(), "合格率", ticketChartCell.getTicketName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
String title="水电运维项目两票统计表"; |
|
|
|
|
String domainAxis="数量"; |
|
|
|
|
String rangeAxis="票据类型"; |
|
|
|
|
ImageEntity ticketImage = JFreeUtil.iCreateBarLineChart(false, title, domainAxis, rangeAxis, dataset, datasetLine,662, 378); |
|
|
|
|
map.put("ticketImage", ticketImage); |
|
|
|
|
WordUtils.exportWord("template/waterMonV4.docx", "F:/", "888.docx", map); |
|
|
|
|
} |
|
|
|
|
@Override |
|
|
|
|
public R exportHydropowerStationMonthReport(HttpServletResponse response, HashMap<String, Object> map, Integer year, Integer month, Integer date, Long deptId) { |
|
|
|
|
R<String> deptNameR = sysClient.getDeptName(deptId); |
|
|
|
|