|
@@ -732,10 +732,16 @@ public class ReportServiceImpl implements IReportService {
|
|
|
param.put("endDay", endTime);
|
|
param.put("endDay", endTime);
|
|
|
param.put("countNum", "2");
|
|
param.put("countNum", "2");
|
|
|
|
|
|
|
|
|
|
+ // 停电次数最多的台区
|
|
|
|
|
+ String mostAddressNumDesc = "";
|
|
|
|
|
+ // 停电最多的次数
|
|
|
|
|
+ String mostAddressNum = "";
|
|
|
String totalChongfu = "0";
|
|
String totalChongfu = "0";
|
|
|
List<Map<String, String>> twiceCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
List<Map<String, String>> twiceCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
for (Map<String, String> map : twiceCountList) {
|
|
for (Map<String, String> map : twiceCountList) {
|
|
|
String area = map.get("area");
|
|
String area = map.get("area");
|
|
|
|
|
+ String num = map.get("num");
|
|
|
|
|
+ String addressName = map.get("addressName");
|
|
|
if ("新泰".equals(area)) {
|
|
if ("新泰".equals(area)) {
|
|
|
if (xintai.size() >= 6) {
|
|
if (xintai.size() >= 6) {
|
|
|
xintai.set(5, CommonUtil.add(xintai.get(5), "1"));
|
|
xintai.set(5, CommonUtil.add(xintai.get(5), "1"));
|
|
@@ -788,7 +794,16 @@ public class ReportServiceImpl implements IReportService {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
totalChongfu = CommonUtil.add(totalChongfu, "1");
|
|
totalChongfu = CommonUtil.add(totalChongfu, "1");
|
|
|
|
|
+
|
|
|
|
|
+ if (CommonUtil.isEmpty(mostAddressNum)) {
|
|
|
|
|
+ mostAddressNum = num;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (mostAddressNum.equals(num)) {
|
|
|
|
|
+ mostAddressNumDesc += addressName + "、";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ // 去除最后一个符号
|
|
|
|
|
+ mostAddressNumDesc = mostAddressNumDesc.substring(0, mostAddressNumDesc.length() - 1);
|
|
|
heji.add(totalChongfu);
|
|
heji.add(totalChongfu);
|
|
|
// 没有数据的区域数值为0
|
|
// 没有数据的区域数值为0
|
|
|
for (List<String> list : resList) {
|
|
for (List<String> list : resList) {
|
|
@@ -797,6 +812,15 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 最长时长
|
|
|
|
|
+ List<Map<String, String>> zuichangTaiquList = db.getMybatisMapper(ReportServiceMapper.class).selectReportType00ZuichangTaiqu(param);
|
|
|
|
|
+ String zuichangTaiqu = "";
|
|
|
|
|
+ String zuichangSj = "";
|
|
|
|
|
+ if (zuichangTaiquList.size() > 1) {
|
|
|
|
|
+ zuichangTaiqu = zuichangTaiquList.get(0).get("addressName");
|
|
|
|
|
+ zuichangSj = CommonUtil.divide(zuichangTaiquList.get(0).get("timeMinute"), "60", 2);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
String totalMonthChongfuTaici = "0";
|
|
String totalMonthChongfuTaici = "0";
|
|
|
String totalMonthChongfuTaishu = "0";
|
|
String totalMonthChongfuTaishu = "0";
|
|
|
beginTime = DateUtil.dateAddDay(DateUtil.dateAddMonth(rangeArray[1], -2), 1);
|
|
beginTime = DateUtil.dateAddDay(DateUtil.dateAddMonth(rangeArray[1], -2), 1);
|
|
@@ -807,12 +831,18 @@ public class ReportServiceImpl implements IReportService {
|
|
|
param.put("beginDay", DateUtil.dateAddDay(DateUtil.dateAddMonth(rangeArray[1], -2), 1) + timeRangeArray[0]);
|
|
param.put("beginDay", DateUtil.dateAddDay(DateUtil.dateAddMonth(rangeArray[1], -2), 1) + timeRangeArray[0]);
|
|
|
}
|
|
}
|
|
|
param.put("endDay", endTime);
|
|
param.put("endDay", endTime);
|
|
|
- param.put("countNum", "2");
|
|
|
|
|
|
|
+ param.put("countNum", "3");
|
|
|
List<Map<String, String>> twiceMonthCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
List<Map<String, String>> twiceMonthCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
|
|
|
|
|
|
|
+ // 停电次数最多的台区
|
|
|
|
|
+ String liangyueMostAddressNumDesc = "";
|
|
|
|
|
+ // 停电最多的次数
|
|
|
|
|
+ String liangyueMostAddressNum = "";
|
|
|
|
|
+
|
|
|
// 本周督办频繁停电台次/本周督办频繁停电台区数
|
|
// 本周督办频繁停电台次/本周督办频繁停电台区数
|
|
|
for (Map<String, String> map : twiceMonthCountList) {
|
|
for (Map<String, String> map : twiceMonthCountList) {
|
|
|
String area = map.get("area");
|
|
String area = map.get("area");
|
|
|
|
|
+ String addressName = map.get("addressName");
|
|
|
String num = map.get("num");
|
|
String num = map.get("num");
|
|
|
if ("新泰".equals(area)) {
|
|
if ("新泰".equals(area)) {
|
|
|
if (xintai.size() >= 7) {
|
|
if (xintai.size() >= 7) {
|
|
@@ -907,7 +937,16 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
}
|
|
|
totalMonthChongfuTaici= CommonUtil.add(totalMonthChongfuTaici, num);
|
|
totalMonthChongfuTaici= CommonUtil.add(totalMonthChongfuTaici, num);
|
|
|
totalMonthChongfuTaishu = CommonUtil.add(totalMonthChongfuTaishu, "1");
|
|
totalMonthChongfuTaishu = CommonUtil.add(totalMonthChongfuTaishu, "1");
|
|
|
|
|
+
|
|
|
|
|
+ if (CommonUtil.isEmpty(liangyueMostAddressNum)) {
|
|
|
|
|
+ liangyueMostAddressNum = num;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (liangyueMostAddressNum.equals(num)) {
|
|
|
|
|
+ liangyueMostAddressNumDesc += addressName + "、";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ // 去除最后一个符号
|
|
|
|
|
+ liangyueMostAddressNumDesc = liangyueMostAddressNumDesc.substring(0, liangyueMostAddressNumDesc.length() - 1);
|
|
|
heji.add(totalMonthChongfuTaici);
|
|
heji.add(totalMonthChongfuTaici);
|
|
|
heji.add(totalMonthChongfuTaishu);
|
|
heji.add(totalMonthChongfuTaishu);
|
|
|
|
|
|
|
@@ -960,7 +999,35 @@ public class ReportServiceImpl implements IReportService {
|
|
|
dataMap.put("totalCount", totalCount);
|
|
dataMap.put("totalCount", totalCount);
|
|
|
dataMap.put("pingjun", CommonUtil.divide(totalHour, totalCount, 2));
|
|
dataMap.put("pingjun", CommonUtil.divide(totalHour, totalCount, 2));
|
|
|
dataMap.put("twiceCount", totalChongfu);
|
|
dataMap.put("twiceCount", totalChongfu);
|
|
|
|
|
+ dataMap.put("mostAddressNumDesc", mostAddressNumDesc);
|
|
|
|
|
+ dataMap.put("mostAddressNum", mostAddressNum);
|
|
|
dataMap.put("dubanCount", totalMonthChongfuTaici);
|
|
dataMap.put("dubanCount", totalMonthChongfuTaici);
|
|
|
|
|
+ dataMap.put("zuichangTaiqu", zuichangTaiqu);
|
|
|
|
|
+ dataMap.put("zuichangSj", zuichangSj);
|
|
|
|
|
+ dataMap.put("liangyueMostAddressNumDesc", liangyueMostAddressNumDesc);
|
|
|
|
|
+ dataMap.put("liangyueMostAddressNum", liangyueMostAddressNum);
|
|
|
|
|
+ // 停电两次描述
|
|
|
|
|
+ String twiceCountDesc = "";
|
|
|
|
|
+ // 督办台次
|
|
|
|
|
+ String dubantaiciDesc = "";
|
|
|
|
|
+ // 重复停电台区描述
|
|
|
|
|
+ for (int i = 1; i < resList.size(); i ++) {
|
|
|
|
|
+ List<String> childList = resList.get(i);
|
|
|
|
|
+ String area = childList.get(0);
|
|
|
|
|
+ String num = childList.get(5);
|
|
|
|
|
+ if (CommonUtil.compare(num, "0") != 0) {
|
|
|
|
|
+ twiceCountDesc += area + num + "个,";
|
|
|
|
|
+ }
|
|
|
|
|
+ num = childList.get(6);
|
|
|
|
|
+ if (CommonUtil.compare(num, "0") != 0) {
|
|
|
|
|
+ dubantaiciDesc += area + num + "次,";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ dataMap.put("twiceCountDesc", twiceCountDesc);
|
|
|
|
|
+ dataMap.put("dubantaiciDesc", dubantaiciDesc);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// 环比
|
|
// 环比
|
|
|
if (CommonUtil.compare(huanbi, "0") != 0) {
|
|
if (CommonUtil.compare(huanbi, "0") != 0) {
|
|
|
if (CommonUtil.compare(totalMonthChongfuTaici, huanbi) == 1) {
|
|
if (CommonUtil.compare(totalMonthChongfuTaici, huanbi) == 1) {
|
|
@@ -978,10 +1045,10 @@ public class ReportServiceImpl implements IReportService {
|
|
|
if (CommonUtil.compare(tongbi, "0") == 0) {
|
|
if (CommonUtil.compare(tongbi, "0") == 0) {
|
|
|
dataMap.put("tongbi", "");
|
|
dataMap.put("tongbi", "");
|
|
|
} else {
|
|
} else {
|
|
|
- dataMap.put("tongbi", "同比增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(totalMonthChongfuTaici, tongbi), tongbi, 4), "100", 2) + "%");
|
|
|
|
|
|
|
+ dataMap.put("tongbi", "同比增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(totalMonthChongfuTaici, tongbi), tongbi, 4), "100", 2) + "%。");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- dataMap.put("tongbi", "同比减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tongbi, totalMonthChongfuTaici), tongbi, 4), "100", 2) + "%");
|
|
|
|
|
|
|
+ dataMap.put("tongbi", "同比减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tongbi, totalMonthChongfuTaici), tongbi, 4), "100", 2) + "%。");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
dataMap.put("tongbi", "");
|
|
dataMap.put("tongbi", "");
|
|
@@ -989,8 +1056,8 @@ public class ReportServiceImpl implements IReportService {
|
|
|
|
|
|
|
|
resMap.put("dataMap", dataMap);
|
|
resMap.put("dataMap", dataMap);
|
|
|
|
|
|
|
|
- String descStr = "<p>上周,台区累计停电${totalCount}台次,平均停电时长${pingjun}小时/台。停电两次及以上台区${twiceCount}个。</p>"
|
|
|
|
|
- +"上周,督办频繁停电(两个月内三次及以上)共计${dubanCount}台次,${huanbi},${tongbi}。";
|
|
|
|
|
|
|
+ String descStr = "<p>上周,台区累计停电${totalCount}台次,平均停电时长${pingjun}小时/台。停电两次及以上台区${twiceCount}个,${twiceCountDesc}${mostAddressNumDesc}重复停电次数最多为${mostAddressNum}次。${zuichangTaiqu}停电时长最长为${zuichangSj}小时。</p>"
|
|
|
|
|
+ +"上周,督办频繁停电(两个月内三次及以上)共计${dubanCount}台次,${huanbi},${tongbi}${dubantaiciDesc}${liangyueMostAddressNumDesc}两个月内频繁停电次数最多为${liangyueMostAddressNum}次。";
|
|
|
resMap.put("descStr", descStr);
|
|
resMap.put("descStr", descStr);
|
|
|
|
|
|
|
|
return resMap;
|
|
return resMap;
|