Commit 664b47df authored by KeYong's avatar KeYong

提交报表相关bug

parent fb648675
...@@ -42,6 +42,7 @@ import java.time.LocalDateTime; ...@@ -42,6 +42,7 @@ import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
...@@ -126,7 +127,7 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService { ...@@ -126,7 +127,7 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
complete_task_percent = 0.0; complete_task_percent = 0.0;
log.error("-----------------------------当天巡检计划总数是 0,请检查同步服务!-----------------------------"); log.error("-----------------------------当天巡检计划总数是 0,请检查同步服务!-----------------------------");
} else { } else {
complete_task_percent = (complete_task_count/task_count)*100; complete_task_percent = (Double.valueOf(complete_task_count) / Double.valueOf(task_count)) * 100;
} }
// 任务完成率 // 任务完成率
map.put("complete_task_percent", nf.format(complete_task_percent)+"%"); map.put("complete_task_percent", nf.format(complete_task_percent)+"%");
...@@ -160,7 +161,7 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService { ...@@ -160,7 +161,7 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
certified_percent = 0.0; certified_percent = 0.0;
log.error("-----------------------------人员总数是 0,请检查同步服务!-----------------------------"); log.error("-----------------------------人员总数是 0,请检查同步服务!-----------------------------");
} else { } else {
certified_percent = (certified_person_count/person_count)*100; certified_percent = (Double.valueOf(certified_person_count) / Double.valueOf(person_count)) * 100;
} }
// 持证率 // 持证率
map.put("certified_percent", nf.format(certified_percent)+"%"); map.put("certified_percent", nf.format(certified_percent)+"%");
...@@ -202,13 +203,13 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService { ...@@ -202,13 +203,13 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
} }
// 发现问题总数 // 发现问题总数
int problem_count = ((BigDecimal) report.get("problem_count")).intValue(); int problem_count = ((BigDecimal) report.get("problem_count")).intValue();
map.put("problem_count", problem_count); // map.put("problem_count", problem_count);
// 修复问题总数 // 修复问题总数
int fixed_problem_count = ((BigDecimal) report.get("fixed_problem_count")).intValue(); int fixed_problem_count = ((BigDecimal) report.get("fixed_problem_count")).intValue();
map.put("fixed_problem_count", fixed_problem_count); // map.put("fixed_problem_count", fixed_problem_count);
// 未修复问题总数 // 未修复问题总数
int unfixed_problem_count = problem_count-fixed_problem_count; // int unfixed_problem_count = problem_count-fixed_problem_count;
map.put("unfixed_problem_count", unfixed_problem_count); // map.put("unfixed_problem_count", unfixed_problem_count);
// 巡查点位数 // 巡查点位数
int checked_point_count = ((BigDecimal) report.get("checked_point_count")).intValue(); int checked_point_count = ((BigDecimal) report.get("checked_point_count")).intValue();
map.put("checked_point_count", checked_point_count); map.put("checked_point_count", checked_point_count);
...@@ -232,6 +233,14 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService { ...@@ -232,6 +233,14 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
List<Map<String, Object>> defect_list = analysisReportLogMapper.getDefect(analysisReportLog); List<Map<String, Object>> defect_list = analysisReportLogMapper.getDefect(analysisReportLog);
// 缺陷总数 // 缺陷总数
map.put("defect_count", defect_list.size()); map.put("defect_count", defect_list.size());
// 解决问题数量问题,相关需求链接http://36.46.149.14:5080/zentao/task-view-7059.html
map.put("problem_count", defect_list.size());
List<Map<String, Object>> list = new ArrayList<>();
if (0 < defect_list.size()) {
list = defect_list.stream().filter(x -> "治理完毕".equals(String.valueOf(x.get("danger_state")))).collect(Collectors.toList());
}
map.put("fixed_problem_count", list.size());
map.put("unfixed_problem_count", defect_list.size() - list.size());
defect_list.forEach(i->{ defect_list.forEach(i->{
i.put("defect_location", i.get("danger_position")); i.put("defect_location", i.get("danger_position"));
i.put("defect_description", i.get("problem_description")); i.put("defect_description", i.get("problem_description"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment