Commit 3718bf8a authored by 张森's avatar 张森

中心大屏水池相关信息一一对应 bug修改

parent fe422318
...@@ -2209,27 +2209,32 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -2209,27 +2209,32 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 未开展 // 未开展
List<HashMap<String, Object>> queryMaps = planTaskMapper.selectPatrolRecordPage(bizOrgCode, date); List<HashMap<String, Object>> queryMaps = planTaskMapper.selectPatrolRecordPage(bizOrgCode, date);
Map<String, HashMap<String, Object>> hasDataMapInfo = queryMaps.stream().collect(Collectors.toMap(t -> t.get("bizOrgCode").toString(), t -> t)); Map<String, List<HashMap<String, Object>>> hasDataMapInfo = queryMaps.stream()
.collect(Collectors.groupingBy(
map -> map.get("bizOrgCode").toString()
));
for (Map<String, Object> station : stations) { for (Map<String, Object> station : stations) {
if (hasDataMapInfo.containsKey(station.get("bizOrgCode").toString())) { if (hasDataMapInfo.containsKey(station.get("bizOrgCode").toString())) {
HashMap<String, Object> queryMap = hasDataMapInfo.get(station.get("bizOrgCode").toString()); List<HashMap<String, Object>> queryMapList = hasDataMapInfo.get(station.get("bizOrgCode").toString());
if (Integer.parseInt(queryMap.get("finishPointCount").toString()) > 0) { for (HashMap<String, Object> queryMap : queryMapList) {
queryMap.put("patrolStatus", "已开展"); if (Integer.parseInt(queryMap.get("finishPointCount").toString()) > 0) {
} else { queryMap.put("patrolStatus", "已开展");
queryMap.put("patrolStatus", "未开展"); } else {
queryMap.put("patrolStatus", "未开展");
}
int totalValue = Integer.parseInt(queryMap.getOrDefault("allCount", "0").toString());
int missPointCount = Integer.parseInt(queryMap.getOrDefault("missPointCount", "0").toString());
int finishPointCount = Integer.parseInt(queryMap.getOrDefault("finishPointCount", "0").toString());
// 获取漏检率:missPointCount / totalValue
queryMap.put("missPointRate", getPercent((float) missPointCount, (float) totalValue));
// 执行进度:finishCount / totalValue
queryMap.put("finishRate", getPercent((float) finishPointCount, (float) totalValue));
String realStartTime = queryMap.getOrDefault("realStartTime", cn.hutool.core.date.DateUtil.now()).toString();
String realEndTime = queryMap.getOrDefault("realEndTime", cn.hutool.core.date.DateUtil.now()).toString();
long minutesBetween = this.getMinutesBetween(realStartTime, realEndTime);
queryMap.put("totalTime", minutesBetween);
records.add(queryMap);
} }
int totalValue = Integer.parseInt(queryMap.getOrDefault("allCount", "0").toString());
int missPointCount = Integer.parseInt(queryMap.getOrDefault("missPointCount", "0").toString());
int finishPointCount = Integer.parseInt(queryMap.getOrDefault("finishPointCount", "0").toString());
// 获取漏检率:missPointCount / totalValue
queryMap.put("missPointRate", getPercent((float) missPointCount, (float) totalValue));
// 执行进度:finishCount / totalValue
queryMap.put("finishRate", getPercent((float) finishPointCount, (float) totalValue));
String realStartTime = queryMap.getOrDefault("realStartTime", cn.hutool.core.date.DateUtil.now()).toString();
String realEndTime = queryMap.getOrDefault("realEndTime", cn.hutool.core.date.DateUtil.now()).toString();
long minutesBetween = this.getMinutesBetween(realStartTime, realEndTime);
queryMap.put("totalTime", minutesBetween);
records.add(queryMap);
} else { } else {
HashMap<String, Object> record = new HashMap<>(); HashMap<String, Object> record = new HashMap<>();
record.put("bizOrgCode", station.get("bizOrgCode")); record.put("bizOrgCode", station.get("bizOrgCode"));
......
...@@ -1787,6 +1787,7 @@ ...@@ -1787,6 +1787,7 @@
SELECT LEFT SELECT LEFT
( t.org_code, 18 ) AS bizOrgCode, ( t.org_code, 18 ) AS bizOrgCode,
t.id,
u.biz_org_name AS bizOrgName, u.biz_org_name AS bizOrgName,
DATE_FORMAT( t.check_date, '%Y-%m-%d' ) AS time, DATE_FORMAT( t.check_date, '%Y-%m-%d' ) AS time,
DATE_FORMAT( t.begin_time, '%Y-%m-%d %H:%i' ) AS beginTime, DATE_FORMAT( t.begin_time, '%Y-%m-%d %H:%i' ) AS beginTime,
......
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