|
@@ -1322,7 +1322,6 @@ public class ReportServiceImpl implements IReportService {
|
|
|
param.put("beginDay", beginTime);
|
|
|
param.put("endDay", endTime);
|
|
|
param.put("countNum", "1");
|
|
|
- List<Map<String, String>> taiquCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
/** 本月数据---- end ----*/
|
|
|
/** 去年同月数据---- start ----*/
|
|
|
if (CommonUtil.isEmpty(timeRange)) {
|
|
@@ -1356,10 +1355,6 @@ public class ReportServiceImpl implements IReportService {
|
|
|
/** 上月月数据---- end ----*/
|
|
|
|
|
|
/** 停电台区数 ----start----*/
|
|
|
- String totalCount = "0";
|
|
|
- for (int i = 0; i < taiquCountList.size(); i++) {
|
|
|
- totalCount = CommonUtil.add(taiquCountList.get(i).get("num"), totalCount);
|
|
|
- }
|
|
|
/** 停电台区数 ---- end ----*/
|
|
|
|
|
|
/**停电次数数据处理----start----*/
|
|
@@ -1503,6 +1498,9 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if (!CommonUtil.isEmpty(tbAreaPingjunDesc)) {
|
|
|
+ tbAreaPingjunDesc = "从同比情况看," + tbAreaPingjunDesc;
|
|
|
+ }
|
|
|
// 重新计算开始时间和结束时间
|
|
|
if (CommonUtil.isEmpty(timeRange)) {
|
|
|
beginTime = rangeArray[0] + "000000";
|
|
@@ -1520,7 +1518,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
shiduanMap.put("beginTime", beginTime);
|
|
|
shiduanMap.put("endTime", endTime);
|
|
|
String num = db.getMybatisMapper(ReportServiceMapper.class).selectReportType00FenDuan(shiduanMap);
|
|
|
- String zhanbi = CommonUtil.multiply(CommonUtil.divide(num, totalCount, 4), "100", 2);
|
|
|
+ String zhanbi = CommonUtil.multiply(CommonUtil.divide(num, shejiNum, 4), "100", 2);
|
|
|
if (i == fenduanList.size() - 1) {
|
|
|
fenduanDesc += shiduanMap.get("desc")+ "的" + num+ "台,占比"+zhanbi+"%。";
|
|
|
} else {
|
|
@@ -1582,12 +1580,59 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
}
|
|
|
String countMapTwiceDesc = "";
|
|
|
+ String max1 = "0";
|
|
|
+ String max1Value = "0";
|
|
|
+
|
|
|
+ param.put("beginTime", beginDay + beginTime.substring(8,14));
|
|
|
+ param.put("endTime", rangeArray[1] + endTime.substring(8,14));
|
|
|
for (Map.Entry<String, Integer> entry : countMapTwice.entrySet()) {
|
|
|
- countMapTwiceDesc += "停电" + entry.getKey() + "次的" + entry.getValue() + "台,占比" + CommonUtil.multiply(CommonUtil.divide(entry.getValue().toString(), totalCountTwice, 4), "100", 2)+"%;";
|
|
|
+ if (CommonUtil.compare(max1, entry.getKey()) == -1) {
|
|
|
+ max1 = entry.getKey();
|
|
|
+ max1Value = entry.getValue().toString();
|
|
|
+ }
|
|
|
+ countMapTwiceDesc += "停电" + entry.getKey() + "次的" + entry.getValue() + "台,占比" + CommonUtil.multiply(CommonUtil.divide(entry.getValue().toString(), totalCountTwice, 4), "100", 2)+"%,";
|
|
|
+ countMapTwiceDesc += "其中,";
|
|
|
+ // 各区域数量及占比
|
|
|
+ param.put("countNum", entry.getKey());
|
|
|
+ List<Map<String, String>> areaListDesc = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByAddress(param);
|
|
|
+ for (Map<String, String> areaMap : areaListDesc) {
|
|
|
+ countMapTwiceDesc += areaMap.get("area") + "区" + areaMap.get("num") + "台,占比" + CommonUtil.multiply(CommonUtil.divide(areaMap.get("num"), entry.getValue().toString(), 4), "100", 2)+"%、";
|
|
|
+ }
|
|
|
+ countMapTwiceDesc = countMapTwiceDesc.substring(0, countMapTwiceDesc.length() - 1) + ";";
|
|
|
}
|
|
|
+
|
|
|
if(!"".equals(countMapTwiceDesc)){
|
|
|
countMapTwiceDesc = countMapTwiceDesc.substring(0,countMapTwiceDesc.length() - 1) + "。";
|
|
|
}
|
|
|
+ // 最高停电台次描述
|
|
|
+ String max1Desc = "";
|
|
|
+ if (!"0".equals(max1)) {
|
|
|
+ max1Desc = "最高停电次数台区为"+ max1 + "次,";
|
|
|
+ param.put("countNum", max1);
|
|
|
+ List<Map<String, String>> maxList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount01(param);
|
|
|
+ String numTemp = "0";
|
|
|
+ String areaTemp = null;
|
|
|
+ for (Map<String, String> maxMap : maxList) {
|
|
|
+ if (areaTemp == null) {
|
|
|
+ areaTemp = maxMap.get("area");
|
|
|
+ numTemp = "1";
|
|
|
+ max1Desc += areaTemp + "区#num#台,为" + maxMap.get("addressName") + "、";
|
|
|
+ } else if (areaTemp.equals(maxMap.get("area"))) {
|
|
|
+ numTemp = CommonUtil.add(numTemp, "1");
|
|
|
+ max1Desc += maxMap.get("addressName") + "、";
|
|
|
+ } else {
|
|
|
+ max1Desc = max1Desc.substring(0, max1Desc.length()-1) + "台区,占比" + CommonUtil.multiply(CommonUtil.divide(numTemp, max1Value, 4), "100", 2) + "%;";
|
|
|
+ max1Desc = max1Desc.replace("#num#", numTemp);
|
|
|
+
|
|
|
+ numTemp = "1";
|
|
|
+ areaTemp = maxMap.get("area");
|
|
|
+ max1Desc += areaTemp + "区#num#台,为" + maxMap.get("addressName") + "、";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ max1Desc = max1Desc.substring(0, max1Desc.length()-1) + "台区,占比" + CommonUtil.multiply(CommonUtil.divide(numTemp, max1Value, 4), "100", 2) + "%。";
|
|
|
+ max1Desc = max1Desc.replace("#num#", numTemp);
|
|
|
+ }
|
|
|
+
|
|
|
// 两个月内停电3次以上的数据
|
|
|
param.put("countNum", "3");
|
|
|
List<Map<String, String>> thipleMountCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
@@ -1596,9 +1641,9 @@ public class ReportServiceImpl implements IReportService {
|
|
|
/**停电次数数据处理----end----*/
|
|
|
|
|
|
String descStr = "<p>(1)台区停电总体情况${month}月份,台区累计停电${benyueCount}台次,同比${tongbi},环比${huanbi},涉及${shejiNum}个台区,${shejiDesc}</p>"
|
|
|
- + "<p>(2)台区停电时长情况${shejiNum}个台区累计停电时间${benyueTime}小时,平均停电时长${pingjunHour}小时,同比${tongbiPingjunHour},环比${huanbiPingjunHour}。台区平均停电时间为${areaPingjunDesc}从同比情况看,${tbAreaPingjunDesc}</p>"
|
|
|
+ + "<p>(2)台区停电时长情况${shejiNum}个台区累计停电时间${benyueTime}小时,平均停电时长${pingjunHour}小时,同比${tongbiPingjunHour},环比${huanbiPingjunHour}。台区平均停电时间为${areaPingjunDesc}${tbAreaPingjunDesc}</p>"
|
|
|
+ "<p>台区停电时长在${fenduanDesc}停电时长最长的为${zuichangTaiQu},停电${zuichangTaiQuTime}小时,其次是${qiciTaiQu},停电时长${qiciTaiQuTime}小时。</p>"
|
|
|
- + "<p>(3)台区重复停电情况两个月内停电2次及以上的台变${totalCountTwice}个,其中${totalCountTwiceDesc}${totalCountTwice}个重复停电台变中,${countMapTwiceDesc}两个月内停电3次及以上的台变${totalCountthiple}个。</p>";
|
|
|
+ + "<p>(3)台区重复停电情况两个月内停电2次及以上的台变${totalCountTwice}个,其中${totalCountTwiceDesc}${totalCountTwice}个重复停电台变中,${countMapTwiceDesc}${max1Desc}两个月内停电3次及以上的台变${totalCountthiple}个。</p>";
|
|
|
|
|
|
Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
dataMap.put("month", month);
|
|
@@ -1607,7 +1652,6 @@ public class ReportServiceImpl implements IReportService {
|
|
|
dataMap.put("huanbi", huanbi);
|
|
|
dataMap.put("shejiNum", shejiNum);
|
|
|
dataMap.put("shejiDesc", shejiDesc);
|
|
|
- dataMap.put("totalCount", totalCount);
|
|
|
dataMap.put("benyueTime", benyueTime);
|
|
|
dataMap.put("pingjunHour", pingjunHour);
|
|
|
dataMap.put("tongbiPingjunHour", tongbiPingjunHour);
|
|
@@ -1622,6 +1666,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
dataMap.put("totalCountTwice", totalCountTwice);
|
|
|
dataMap.put("totalCountTwiceDesc", totalCountTwiceDesc);
|
|
|
dataMap.put("countMapTwiceDesc", countMapTwiceDesc);
|
|
|
+ dataMap.put("max1Desc", max1Desc);
|
|
|
dataMap.put("totalCountthiple", totalCountthiple);
|
|
|
|
|
|
Map<String, Object> resMap = new HashMap<String, Object>();
|