5c551cb5 sonin

运营月报 优化

1 个父辈 799381f9
...@@ -83,7 +83,7 @@ public class OperationReportController { ...@@ -83,7 +83,7 @@ public class OperationReportController {
83 List<Map<String, Object>> resMapList = new ArrayList<>(); 83 List<Map<String, Object>> resMapList = new ArrayList<>();
84 for (String tmpDepartId : departIdArray) { 84 for (String tmpDepartId : departIdArray) {
85 String childDepartId = departService.getChildDepartId(tmpDepartId); 85 String childDepartId = departService.getChildDepartId(tmpDepartId);
86 SysDepart tmpSysDepart = departService.getById(departId); 86 SysDepart tmpSysDepart = departService.getById(tmpDepartId);
87 // 获取机构子集 87 // 获取机构子集
88 Map<String, Object> paramMap = new HashMap<>(); 88 Map<String, Object> paramMap = new HashMap<>();
89 paramMap.put("startTime", startTime); 89 paramMap.put("startTime", startTime);
...@@ -92,7 +92,7 @@ public class OperationReportController { ...@@ -92,7 +92,7 @@ public class OperationReportController {
92 Map<String, Object> resMap = operationReportService.dataAnalysisOfMonth(paramMap); 92 Map<String, Object> resMap = operationReportService.dataAnalysisOfMonth(paramMap);
93 resMap.put("departId", tmpDepartId); 93 resMap.put("departId", tmpDepartId);
94 resMap.put("departName", sysDepartDictMap.get(tmpDepartId)); 94 resMap.put("departName", sysDepartDictMap.get(tmpDepartId));
95 resMap.put("departType", tmpSysDepart.getDepartType()); 95 resMap.put("departType", tmpSysDepart != null ? tmpSysDepart.getDepartType() : "");
96 resMapList.add(resMap); 96 resMapList.add(resMap);
97 } 97 }
98 return Result.ok(resMapList); 98 return Result.ok(resMapList);
......
...@@ -165,4 +165,6 @@ public class ReportTargetConfig { ...@@ -165,4 +165,6 @@ public class ReportTargetConfig {
165 private Integer delFlag; 165 private Integer delFlag;
166 166
167 private String targetPowerCost; 167 private String targetPowerCost;
168
169 private String targetWaterCostIn;
168 } 170 }
......
...@@ -228,11 +228,12 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -228,11 +228,12 @@ public class OperationReportServiceImpl implements IOperationReportService {
228 List<String> timeList = DateUtils.intervalByDay(startTime, endTime, BusinessConstant.dateFormat.substring(0, 10)); 228 List<String> timeList = DateUtils.intervalByDay(startTime, endTime, BusinessConstant.dateFormat.substring(0, 10));
229 // 同比时间 229 // 同比时间
230 String[] timeArray = DateUtils.tbTime(startTime, endTime); 230 String[] timeArray = DateUtils.tbTime(startTime, endTime);
231 List<String> timeListTb = DateUtils.intervalByDay(timeArray[0], timeArray[1], BusinessConstant.dateFormat.substring(0, 10)); 231 List<String> tbTimeList = DateUtils.intervalByDay(timeArray[0], timeArray[1], BusinessConstant.dateFormat.substring(0, 10));
232 String departId = ConvertUtils.getString(paramMap.get("departId")); 232 String departId = ConvertUtils.getString(paramMap.get("departId"));
233 List<String> departIdList = Arrays.asList(departId.split(",")); 233 List<String> departIdList = Arrays.asList(departId.split(","));
234 // 翻译 234 // 翻译
235 Map<String, String> sysDepartDictMap = businessService.dictMap("sys_depart", departIdList); 235 Map<String, String> sysDepartDictMap = businessService.dictMap("sys_depart", departIdList);
236 // 数据信息
236 // reitId => 展示字段名称 + dataTime时间长度 + dataValue数据转换 237 // reitId => 展示字段名称 + dataTime时间长度 + dataValue数据转换
237 Map<String, String[]> dictMap0 = new LinkedHashMap<String, String[]>(){{ 238 Map<String, String[]> dictMap0 = new LinkedHashMap<String, String[]>(){{
238 // 污水水量(吨 => 万吨) 239 // 污水水量(吨 => 万吨)
...@@ -243,8 +244,10 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -243,8 +244,10 @@ public class OperationReportServiceImpl implements IOperationReportService {
243 put("1818218432697643010", new String[]{"scgsl", "10", "/10000"}); 244 put("1818218432697643010", new String[]{"scgsl", "10", "/10000"});
244 // 污泥处置量(吨 => 万吨) 245 // 污泥处置量(吨 => 万吨)
245 put("1910571063704104961", new String[]{"wnczl", "7", "/10000"}); 246 put("1910571063704104961", new String[]{"wnczl", "7", "/10000"});
247 // 水费收入
248 put("1912415992428384257", new String[]{"sfsr", "7", ""});
246 // 实际水费 249 // 实际水费
247 put("1912415992428384257", new String[]{"sjsf", "7", ""}); 250 put("1902657099079598082", new String[]{"sjsf", "7", ""});
248 // 实际水量 251 // 实际水量
249 put("1818936221372633089", new String[]{"sjsl", "7", ""}); 252 put("1818936221372633089", new String[]{"sjsl", "7", ""});
250 // 实际药费(元=>万元) 253 // 实际药费(元=>万元)
...@@ -266,13 +269,28 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -266,13 +269,28 @@ public class OperationReportServiceImpl implements IOperationReportService {
266 queryWrapper0.in("reit_id", dictMap0.keySet()) 269 queryWrapper0.in("reit_id", dictMap0.keySet())
267 .in("depart_id", departIdList); 270 .in("depart_id", departIdList);
268 Map<String, Object> queryMap0 = baseService.queryForMap("select " + caseWhen0.print() + " from f_report_itemv", queryWrapper0); 271 Map<String, Object> queryMap0 = baseService.queryForMap("select " + caseWhen0.print() + " from f_report_itemv", queryWrapper0);
272 // 实际电费信息(元=>万元)
273 Map<String, String> dictMap0_1 = new LinkedHashMap<String, String>(){{
274 // 实际电费
275 put("cost/10000", "sjdf");
276 }};
277 QueryWrapper<?> queryWrapper0_1 = new QueryWrapper<>();
278 queryWrapper0_1.in("depart_id", departIdList);
279 CaseWhen caseWhen0_1 = new CaseWhen();
280 for (Map.Entry<String, String> entry: dictMap0_1.entrySet()) {
281 caseWhen0_1.selectCaseWhen("month >= '" + startTime.substring(0, 7) + "' and month <= '" + endTime.substring(0, 7) + "'", entry.getKey(), "0", entry.getValue());
282 caseWhen0_1.selectCaseWhen("month >= '" + timeArray[0].substring(0, 7) + "' and month <= '" + timeArray[1].substring(0, 7) + "'", entry.getKey(), "0", "tb_" + entry.getValue());
283 }
284 Map<String, Object> queryMap0_1 = baseService.queryForMap("select " + caseWhen0_1.print() + " from report_electric_cost", queryWrapper0_1);
269 // 年度目标 285 // 年度目标
270 // 数据库字段 => 展示字段名称 + 对比数据展示字段名称 286 // 数据库字段 => 展示字段名称 + 对比数据展示字段名称
271 Map<String, String[]> dictMap1 = new LinkedHashMap<String, String[]>(){{ 287 Map<String, String[]> dictMap1 = new LinkedHashMap<String, String[]>(){{
272 // 目标水量 288 // 目标实际水量
273 put("target_water", new String[]{"mbsl", "sjsl"}); 289 put("target_water", new String[]{"mbsl", "sjsl"});
274 // 目标水费 290 // 目标实际水费
275 put("target_cost", new String[]{"mbsf", "sjsf"}); 291 put("target_cost", new String[]{"mbsf", "sjsf"});
292 // 目标水费收入
293 put("target_water_cost_in", new String[]{"mbsfsr", "sfsr"});
276 // 目标电费 294 // 目标电费
277 put("target_power_cost", new String[]{"mbdf", "sjdf"}); 295 put("target_power_cost", new String[]{"mbdf", "sjdf"});
278 // 目标药费(万元) 296 // 目标药费(万元)
...@@ -287,34 +305,34 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -287,34 +305,34 @@ public class OperationReportServiceImpl implements IOperationReportService {
287 CaseWhen caseWhen1 = new CaseWhen(); 305 CaseWhen caseWhen1 = new CaseWhen();
288 for (Map.Entry<String, String[]> entry: dictMap1.entrySet()) { 306 for (Map.Entry<String, String[]> entry: dictMap1.entrySet()) {
289 caseWhen1.selectCaseWhen("target_year = '" + endTime.substring(0, 4) + "'", entry.getKey(), "0", entry.getValue()[0]); 307 caseWhen1.selectCaseWhen("target_year = '" + endTime.substring(0, 4) + "'", entry.getKey(), "0", entry.getValue()[0]);
290 caseWhen1.selectCaseWhen("target_year = '" + timeArray[1].substring(0, 4) + "'", entry.getKey(), "0", "tb_" + entry.getValue()[0]);
291 } 308 }
292 Map<String, Object> queryMap1 = baseService.queryForMap("select " + caseWhen1.print() + " from report_target_config", queryWrapper1); 309 Map<String, Object> queryMap1 = baseService.queryForMap("select " + caseWhen1.print() + " from report_target_config", queryWrapper1);
293 // 实际电费信息(元=>万元) 310 // 年度目标 序时情况
294 Map<String, String> dictMap2 = new LinkedHashMap<String, String>(){{ 311 Map<String, String[]> dictMap1_1 = new LinkedHashMap<String, String[]>(){{
295 // 实际电费 312 put("sl", new String[]{"xssl", "sjsl"});
296 put("cost/10000", "sjdf"); 313 put("fy", new String[]{"xssf", "sjsf"});
314 put("sf", new String[]{"xssfsr", "sfsr"});
297 }}; 315 }};
298 QueryWrapper<?> queryWrapper2 = new QueryWrapper<>(); 316 QueryWrapper<?> queryWrapper1_1 = new QueryWrapper<>();
299 queryWrapper2.in("depart_id", departIdList); 317 queryWrapper1_1.in("depart_id", departIdList);
300 CaseWhen caseWhen2 = new CaseWhen(); 318 CaseWhen caseWhen1_1 = new CaseWhen();
301 for (Map.Entry<String, String> entry: dictMap2.entrySet()) { 319 for (Map.Entry<String, String[]> entry: dictMap1_1.entrySet()) {
302 caseWhen2.selectCaseWhen("month >= '" + startTime.substring(0, 7) + "' and month <= '" + endTime.substring(0, 7) + "'", entry.getKey(), "0", entry.getValue()); 320 caseWhen1_1.selectCaseWhen("target_time >= '" + startTime.substring(0, 7) + "' and target_time <= '" + endTime.substring(0, 7) + "' and target_type = '" + entry.getKey() + "'", "target_value", "0", entry.getValue()[0]);
303 caseWhen2.selectCaseWhen("month >= '" + timeArray[0].substring(0, 7) + "' and month <= '" + timeArray[1].substring(0, 7) + "'", entry.getKey(), "0", "tb_" + entry.getValue());
304 } 321 }
305 Map<String, Object> queryMap2 = baseService.queryForMap("select " + caseWhen2.print() + " from report_electric_cost", queryWrapper2); 322 Map<String, Object> queryMap1_1 = baseService.queryForMap("select " + caseWhen1_1.print() + " from report_target_config_sub", queryWrapper1_1);
306 // 详情信息 323 // 详情信息
307 QueryWrapper<?> queryWrapper3 = new QueryWrapper<>(); 324 QueryWrapper<?> queryWrapper3 = new QueryWrapper<>();
308 queryWrapper3.in("aaa.depart_id", departIdList); 325 queryWrapper3.in("aaa.depart_id", departIdList);
309 String reitIdStr = dictMap0.keySet().stream().map(key -> "'" + key + "'").collect(Collectors.joining(",")); 326 String reitIdStr = dictMap0.keySet().stream().map(key -> "'" + key + "'").collect(Collectors.joining(","));
310 String departIdStr = departIdList.stream().map(key -> "'" + key + "'").collect(Collectors.joining(",")); 327 String departIdStr = departIdList.stream().map(key -> "'" + key + "'").collect(Collectors.joining(","));
311 String sql0 = "(select depart_id, " + caseWhen0.print() + " from f_report_itemv where reit_id in (" + reitIdStr + ") and depart_id in (" + departIdStr + ") group by depart_id) as aaa"; 328 String sql0 = "(select depart_id, " + caseWhen0.print() + " from f_report_itemv where reit_id in (" + reitIdStr + ") and depart_id in (" + departIdStr + ") group by depart_id) as aaa";
312 String sq1 = "(select depart_id, " + caseWhen1.print() + " from report_target_config where depart_id in (" + departIdStr + ") group by depart_id) as bbb"; 329 String sql0_1 = "(select depart_id, " + caseWhen0_1.print() + " from report_electric_cost where depart_id in (" + departIdStr + ") group by depart_id) as bbb";
313 String sql2 = "(select depart_id, " + caseWhen2.print() + " from report_electric_cost where depart_id in (" + departIdStr + ") group by depart_id) as ccc"; 330 String sql1 = "(select depart_id, " + caseWhen1.print() + " from report_target_config where depart_id in (" + departIdStr + ") group by depart_id) as ccc";
314 List<Map<String, Object>> queryMapList3 = baseService.queryForList("select aaa.*, bbb.*, ccc.* from " + sql0 + " left join " + sq1 + " on aaa.depart_id = bbb.depart_id left join " + sql2 + " on bbb.depart_id = ccc.depart_id", queryWrapper3); 331 String sql1_1 = "(select depart_id, " + caseWhen1_1.print() + " from report_target_config_sub where depart_id in (" + departIdStr + ") group by depart_id) as ddd";
332 List<Map<String, Object>> queryMapList3 = baseService.queryForList("select aaa.*, bbb.*, ccc.*, ddd.* from " + sql0 + " left join " + sql0_1 + " on aaa.depart_id = bbb.depart_id left join " + sql1 + " on bbb.depart_id = ccc.depart_id left join " + sql1_1 + " on ccc.depart_id = ddd.depart_id", queryWrapper3);
315 // 详情-水费 333 // 详情-水费
316 List<Map<String, Object>> sfwwcList = new ArrayList<>(); 334 List<Map<String, Object>> sfsrwwcList = new ArrayList<>();
317 List<Map<String, Object>> sfywcList = new ArrayList<>(); 335 List<Map<String, Object>> sjsfywcList = new ArrayList<>();
318 List<Map<String, Object>> sjslxjList = new ArrayList<>(); 336 List<Map<String, Object>> sjslxjList = new ArrayList<>();
319 List<Map<String, Object>> dfcbList = new ArrayList<>(); 337 List<Map<String, Object>> dfcbList = new ArrayList<>();
320 List<Map<String, Object>> yfcbList = new ArrayList<>(); 338 List<Map<String, Object>> yfcbList = new ArrayList<>();
...@@ -324,55 +342,63 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -324,55 +342,63 @@ public class OperationReportServiceImpl implements IOperationReportService {
324 String tmpDepartId = ConvertUtils.getString(item.get("depart_id")); 342 String tmpDepartId = ConvertUtils.getString(item.get("depart_id"));
325 String tmpDepartName = sysDepartDictMap.get(tmpDepartId); 343 String tmpDepartName = sysDepartDictMap.get(tmpDepartId);
326 // 水费收入 未完成 344 // 水费收入 未完成
327 if (ConvertUtils.getDouble(item.get("sjsf"), 0D) / ConvertUtils.getDouble(item.get("mbsf"), 0D) < 0.25) { 345 if (ConvertUtils.getDouble(item.get("sfsr"), 0D) < ConvertUtils.getDouble(item.get("xssfsr"), 0D)) {
328 sfwwcList.add(new LinkedHashMap<String, Object>(){{ 346 Double value = ConvertUtils.getDouble(item.get("sfsr"), 0D) / ConvertUtils.getDouble(item.get("xssfsr"), 0D) * 100;
347 sfsrwwcList.add(new LinkedHashMap<String, Object>(){{
329 put("departId", tmpDepartId); 348 put("departId", tmpDepartId);
330 put("departName", tmpDepartName); 349 put("departName", tmpDepartName);
331 put("sjsf", item.get("sjsf")); 350 put("sfsr", item.get("sfsr"));
332 put("mbsf", item.get("mbsf")); 351 put("xssfsr", item.get("xssfsr"));
352 put("sfsr_xsPercentage", (Double.isInfinite(value) || Double.isNaN(value)) ? null : value);
333 put("reason", ""); 353 put("reason", "");
334 }}); 354 }});
335 } 355 }
336 // 水费已完成 356 // 实际水费 已完成
337 if (ConvertUtils.getDouble(item.get("sjsf"), 0D) >= ConvertUtils.getDouble(item.get("mbsf"), 0D)) { 357 if (ConvertUtils.getDouble(item.get("sjsf"), 0D) >= ConvertUtils.getDouble(item.get("xssf"), 0D)) {
338 sfywcList.add(new LinkedHashMap<String, Object>(){{ 358 sjsfywcList.add(new LinkedHashMap<String, Object>(){{
339 put("departId", tmpDepartId); 359 put("departId", tmpDepartId);
340 put("departName", tmpDepartName); 360 put("departName", tmpDepartName);
341 put("sjsf", item.get("sjsf")); 361 put("sjsf", item.get("sjsf"));
342 put("mbsf", item.get("mbsf")); 362 put("xssf", item.get("mbsf"));
343 }}); 363 }});
344 } 364 }
345 // 实际水量同比下降 365 // 实际水量 同比下降
346 if (ConvertUtils.getDouble(item.get("sjsl"), 0D) < ConvertUtils.getDouble(item.get("tb_sjsl"), 0D)) { 366 if (ConvertUtils.getDouble(item.get("sjsl"), 0D) < ConvertUtils.getDouble(item.get("tb_sjsl"), 0D)) {
367 Double value = (ConvertUtils.getDouble(item.get("sjsl"), 0D) - ConvertUtils.getDouble(item.get("tb_sjsl"), 0D)) / ConvertUtils.getDouble(item.get("tb_sjsl"), 0D) * 100;
347 sjslxjList.add(new LinkedHashMap<String, Object>(){{ 368 sjslxjList.add(new LinkedHashMap<String, Object>(){{
348 put("departId", tmpDepartId); 369 put("departId", tmpDepartId);
349 put("departName", tmpDepartName); 370 put("departName", tmpDepartName);
350 put("sjsl", item.get("sjsl")); 371 put("sjsl", item.get("sjsl"));
351 put("tb_sjsl", item.get("tb_sjsl")); 372 put("tb_sjsl", item.get("tb_sjsl"));
373 put("sjsl_tbPercentage", (Double.isInfinite(value) || Double.isNaN(value)) ? null : value);
352 put("reason", ""); 374 put("reason", "");
353 }}); 375 }});
354 } 376 }
355 // 电费超标 377 // 电费 超标
356 if (ConvertUtils.getDouble(item.get("sjdf"), 0D) > ConvertUtils.getDouble(item.get("mbdf"), 0D)) { 378 if (ConvertUtils.getDouble(item.get("sjdf"), 0D) > ConvertUtils.getDouble(item.get("mbdf"), 0D) * timeList.size() / 12) {
379 Double value = ConvertUtils.getDouble(item.get("sjdf"), 0D) / ConvertUtils.getDouble(item.get("mbdf"), 0D) * 100;
357 dfcbList.add(new LinkedHashMap<String, Object>(){{ 380 dfcbList.add(new LinkedHashMap<String, Object>(){{
358 put("departId", tmpDepartId); 381 put("departId", tmpDepartId);
359 put("departName", tmpDepartName); 382 put("departName", tmpDepartName);
360 put("sjdf", item.get("sjdf")); 383 put("sjdf", item.get("sjdf"));
361 put("mbdf", item.get("mbdf")); 384 put("mbdf", item.get("mbdf"));
385 put("sjdf_xsPercentage", (Double.isInfinite(value) || Double.isNaN(value)) ? null : value);
362 put("reason", ""); 386 put("reason", "");
363 }}); 387 }});
364 } 388 }
365 // 药费超标 389 // 药费 超标
366 if (ConvertUtils.getDouble(item.get("sjyf"), 0D) > ConvertUtils.getDouble(item.get("mbyf"), 0D)) { 390 if (ConvertUtils.getDouble(item.get("sjyf"), 0D) > ConvertUtils.getDouble(item.get("mbyf"), 0D) * timeList.size() / 12) {
391 Double value = ConvertUtils.getDouble(item.get("sjyf"), 0D) / (ConvertUtils.getDouble(item.get("mbyf"), 0D) * timeList.size() * 12) * 100;
367 yfcbList.add(new LinkedHashMap<String, Object>(){{ 392 yfcbList.add(new LinkedHashMap<String, Object>(){{
368 put("departId", tmpDepartId); 393 put("departId", tmpDepartId);
369 put("departName", tmpDepartName); 394 put("departName", tmpDepartName);
370 put("sjyf", item.get("sjyf")); 395 put("sjyf", item.get("sjyf"));
371 put("mbyf", item.get("mbyf")); 396 put("mbyf", item.get("mbyf"));
397 put("sjyf_xsPercentage", (Double.isInfinite(value) || Double.isNaN(value)) ? null : value);
372 put("reason", ""); 398 put("reason", "");
373 }}); 399 }});
374 } 400 }
375 // 电耗超标 401 // 电耗 超标
376 if (ConvertUtils.getDouble(item.get("sjdh"), 0D) > ConvertUtils.getDouble(item.get("mbdh"), 0D)) { 402 if (ConvertUtils.getDouble(item.get("sjdh"), 0D) > ConvertUtils.getDouble(item.get("mbdh"), 0D)) {
377 dhcbList.add(new LinkedHashMap<String, Object>(){{ 403 dhcbList.add(new LinkedHashMap<String, Object>(){{
378 put("departId", tmpDepartId); 404 put("departId", tmpDepartId);
...@@ -382,7 +408,7 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -382,7 +408,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
382 put("reason", ""); 408 put("reason", "");
383 }}); 409 }});
384 } 410 }
385 // 药耗超标 411 // 药耗 超标
386 if (ConvertUtils.getDouble(item.get("sjyh"), 0D) > ConvertUtils.getDouble(item.get("mbyh"), 0D)) { 412 if (ConvertUtils.getDouble(item.get("sjyh"), 0D) > ConvertUtils.getDouble(item.get("mbyh"), 0D)) {
387 yhcbList.add(new LinkedHashMap<String, Object>(){{ 413 yhcbList.add(new LinkedHashMap<String, Object>(){{
388 put("departId", tmpDepartId); 414 put("departId", tmpDepartId);
...@@ -418,26 +444,31 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -418,26 +444,31 @@ public class OperationReportServiceImpl implements IOperationReportService {
418 // 合并 电费信息 444 // 合并 电费信息
419 Map<String, Object> queryMap0_2 = new LinkedHashMap<String, Object>() {{ 445 Map<String, Object> queryMap0_2 = new LinkedHashMap<String, Object>() {{
420 putAll(queryMap0); 446 putAll(queryMap0);
421 putAll(queryMap2); 447 putAll(queryMap0_1);
422 }}; 448 }};
423 for (String key: queryMap0_2.keySet()) { 449 for (String key: queryMap0_2.keySet()) {
424 resMap.put(key, queryMap0_2.get(key)); 450 resMap.put(key, queryMap0_2.get(key));
425 if (key.startsWith("tb_")) { 451 if (key.startsWith("tb_")) {
426 // 补充平均值信息 452 // 补充平均值信息
427 resMap.put(key + "_avg", ConvertUtils.getDouble(queryMap0_2.get(key), 0) / timeListTb.size()); 453 resMap.put(key + "_avg", ConvertUtils.getDouble(queryMap0_2.get(key), 0) / tbTimeList.size());
428 // 计算同比百分比 454 // 计算同比百分比
429 String srcKey = key.replaceAll("tb_", ""); 455 String srcKey = key.replaceAll("tb_", "");
430 double tbPercentage = (ConvertUtils.getDouble(queryMap0_2.get(srcKey), 0D) - ConvertUtils.getDouble(queryMap0_2.get(key), 0D)) / ConvertUtils.getDouble(queryMap0_2.get(key), 0D) * 100; 456 Double tbPercentage = (ConvertUtils.getDouble(queryMap0_2.get(srcKey), 0D) - ConvertUtils.getDouble(queryMap0_2.get(key), 0D)) / ConvertUtils.getDouble(queryMap0_2.get(key), 0D) * 100;
431 resMap.put(srcKey + "_tbPercentage", tbPercentage); 457 resMap.put(srcKey + "_tbPercentage", (Double.isInfinite(tbPercentage) || Double.isNaN(tbPercentage)) ? null : tbPercentage);
432 } else { 458 } else {
433 resMap.put(key + "_avg", ConvertUtils.getDouble(queryMap0_2.get(key), 0) / timeList.size()); 459 resMap.put(key + "_avg", ConvertUtils.getDouble(queryMap0_2.get(key), 0) / timeList.size());
434 } 460 }
435 } 461 }
436 resMap.putAll(queryMap1); 462 resMap.putAll(queryMap1);
463 resMap.putAll(queryMap1_1);
437 // 计算完成年度目标情况 464 // 计算完成年度目标情况
438 for (String[] valueArray: dictMap1.values()) { 465 for (String[] valueArray: dictMap1.values()) {
439 double percentage = ConvertUtils.getDouble(resMap.get(valueArray[1]), 0D) / ConvertUtils.getDouble(resMap.get(valueArray[0]), 0D) * 100; 466 Double targetPercentage = ConvertUtils.getDouble(resMap.get(valueArray[1]), 0D) / ConvertUtils.getDouble(resMap.get(valueArray[0]), 0D) * 100;
440 resMap.put(valueArray[1] + "_targetPercentage", percentage); 467 resMap.put(valueArray[1] + "_targetPercentage", (Double.isInfinite(targetPercentage) || Double.isNaN(targetPercentage)) ? null : targetPercentage);
468 }
469 for (String[] valueArray: dictMap1_1.values()) {
470 Double xsPercentage = ConvertUtils.getDouble(resMap.get(valueArray[1]), 0D) / ConvertUtils.getDouble(resMap.get(valueArray[0]), 0D) * 100;
471 resMap.put(valueArray[1] + "_xsPercentage", (Double.isInfinite(xsPercentage) || Double.isNaN(xsPercentage)) ? null : xsPercentage);
441 } 472 }
442 // 统一保留2位小数 473 // 统一保留2位小数
443 for (String key: resMap.keySet()) { 474 for (String key: resMap.keySet()) {
...@@ -445,8 +476,8 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -445,8 +476,8 @@ public class OperationReportServiceImpl implements IOperationReportService {
445 resMap.put(key, DigitalUtils.nPoint(resMap.get(key), 2)); 476 resMap.put(key, DigitalUtils.nPoint(resMap.get(key), 2));
446 } 477 }
447 } 478 }
448 resMap.put("sfwwcList", sfwwcList); 479 resMap.put("sfsrwwcList", sfsrwwcList);
449 resMap.put("sfywcList", sfywcList); 480 resMap.put("sjsfywcList", sjsfywcList);
450 resMap.put("sjslxjList", sjslxjList); 481 resMap.put("sjslxjList", sjslxjList);
451 resMap.put("dfcbList", dfcbList); 482 resMap.put("dfcbList", dfcbList);
452 resMap.put("yfcbList", yfcbList); 483 resMap.put("yfcbList", yfcbList);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!