|
|
@@ -94,30 +94,30 @@ public class ReportServiceImpl implements IReportService {
|
|
|
// 0-1小时
|
|
|
Map<String, String> map0To60 = new HashMap<String, String>();
|
|
|
map0To60.put("start", "0");
|
|
|
- map0To60.put("end", "60");
|
|
|
+ map0To60.put("end", "3600");
|
|
|
map0To60.put("desc", "0-1小时");
|
|
|
fenduanList.add(map0To60);
|
|
|
// 1-6小时
|
|
|
Map<String, String> map60To360 = new HashMap<String, String>();
|
|
|
- map60To360.put("start", "60");
|
|
|
- map60To360.put("end", "360");
|
|
|
+ map60To360.put("start", "3600");
|
|
|
+ map60To360.put("end", "21600");
|
|
|
map60To360.put("desc", "1-6小时");
|
|
|
fenduanList.add(map60To360);
|
|
|
// 6-12小时
|
|
|
Map<String, String> map360To720 = new HashMap<String, String>();
|
|
|
- map360To720.put("start", "360");
|
|
|
- map360To720.put("end", "720");
|
|
|
+ map360To720.put("start", "21600");
|
|
|
+ map360To720.put("end", "43200");
|
|
|
map360To720.put("desc", "6-12小时");
|
|
|
fenduanList.add(map360To720);
|
|
|
// 12-24小时
|
|
|
Map<String, String> map720To1440 = new HashMap<String, String>();
|
|
|
- map720To1440.put("start", "720");
|
|
|
- map720To1440.put("end", "1440");
|
|
|
+ map720To1440.put("start", "43200");
|
|
|
+ map720To1440.put("end", "86400");
|
|
|
map720To1440.put("desc", "12-24小时");
|
|
|
fenduanList.add(map720To1440);
|
|
|
// 24小时以上
|
|
|
Map<String, String> mapGT1440 = new HashMap<String, String>();
|
|
|
- mapGT1440.put("start", "1440");
|
|
|
+ mapGT1440.put("start", "86400");
|
|
|
mapGT1440.put("desc", "24小时以上");
|
|
|
fenduanList.add(mapGT1440);
|
|
|
}
|
|
|
@@ -279,26 +279,26 @@ public class ReportServiceImpl implements IReportService {
|
|
|
List<Map<String, String>> fileList00 = db.getMybatisMapper(ReportServiceMapper.class).selectReportType00(param);
|
|
|
|
|
|
Map<String, String> countMap = new HashMap<String, String>();
|
|
|
- countMap.put("xintai", "0");
|
|
|
+ countMap.put("taishan", "0");
|
|
|
countMap.put("daiyue", "0");
|
|
|
+ countMap.put("gaoxin", "0");
|
|
|
+ countMap.put("taishanjingqu", "0");
|
|
|
+ countMap.put("xintai", "0");
|
|
|
+ countMap.put("feicheng", "0");
|
|
|
countMap.put("ningyang", "0");
|
|
|
- countMap.put("taishan", "0");
|
|
|
countMap.put("dongping", "0");
|
|
|
- countMap.put("feicheng", "0");
|
|
|
- countMap.put("taishanjingqu", "0");
|
|
|
- countMap.put("gaoxin", "0");
|
|
|
countMap.put("heji", "0");
|
|
|
|
|
|
|
|
|
Map<String, String> shihuMap = new HashMap<String, String>();
|
|
|
- shihuMap.put("xintai", "0");
|
|
|
+ shihuMap.put("taishan", "0");
|
|
|
shihuMap.put("daiyue", "0");
|
|
|
+ shihuMap.put("gaoxin", "0");
|
|
|
+ shihuMap.put("taishanjingqu", "0");
|
|
|
+ shihuMap.put("xintai", "0");
|
|
|
+ shihuMap.put("feicheng", "0");
|
|
|
shihuMap.put("ningyang", "0");
|
|
|
- shihuMap.put("taishan", "0");
|
|
|
shihuMap.put("dongping", "0");
|
|
|
- shihuMap.put("feicheng", "0");
|
|
|
- shihuMap.put("taishanjingqu", "0");
|
|
|
- shihuMap.put("gaoxin", "0");
|
|
|
shihuMap.put("heji", "0");
|
|
|
|
|
|
for (Map<String, String> map : fileList00) {
|
|
|
@@ -336,66 +336,66 @@ public class ReportServiceImpl implements IReportService {
|
|
|
|
|
|
List<String> childList0 = new ArrayList<String>();
|
|
|
childList0.add("分类\\单位");
|
|
|
- childList0.add("新泰");
|
|
|
+ childList0.add("泰山");
|
|
|
childList0.add("岱岳");
|
|
|
+ childList0.add("高新");
|
|
|
+ childList0.add("泰山景区");
|
|
|
+ childList0.add("新泰");
|
|
|
+ childList0.add("肥城");
|
|
|
childList0.add("宁阳");
|
|
|
- childList0.add("泰山");
|
|
|
childList0.add("东平");
|
|
|
- childList0.add("肥城");
|
|
|
- childList0.add("泰山景区");
|
|
|
- childList0.add("高新");
|
|
|
childList0.add("合计");
|
|
|
resList.add(childList0);
|
|
|
|
|
|
List<String> childList1 = new ArrayList<String>();
|
|
|
childList1.add("管辖台区数量");
|
|
|
- childList1.add(totalMap.get("xintai"));
|
|
|
+ childList1.add(totalMap.get("taishan"));
|
|
|
childList1.add(totalMap.get("daiyue"));
|
|
|
+ childList1.add(totalMap.get("gaoxin"));
|
|
|
+ childList1.add(totalMap.get("taishanjingqu"));
|
|
|
+ childList1.add(totalMap.get("xintai"));
|
|
|
+ childList1.add(totalMap.get("feicheng"));
|
|
|
childList1.add(totalMap.get("ningyang"));
|
|
|
- childList1.add(totalMap.get("taishan"));
|
|
|
childList1.add(totalMap.get("dongping"));
|
|
|
- childList1.add(totalMap.get("feicheng"));
|
|
|
- childList1.add(totalMap.get("taishanjingqu"));
|
|
|
- childList1.add(totalMap.get("gaoxin"));
|
|
|
childList1.add(totalMap.get("heji"));
|
|
|
resList.add(childList1);
|
|
|
|
|
|
List<String> childList2 = new ArrayList<String>();
|
|
|
childList2.add("台区停电次数");
|
|
|
- childList2.add(countMap.get("xintai"));
|
|
|
+ childList2.add(countMap.get("taishan"));
|
|
|
childList2.add(countMap.get("daiyue"));
|
|
|
+ childList2.add(countMap.get("gaoxin"));
|
|
|
+ childList2.add(countMap.get("taishanjingqu"));
|
|
|
+ childList2.add(countMap.get("xintai"));
|
|
|
+ childList2.add(countMap.get("feicheng"));
|
|
|
childList2.add(countMap.get("ningyang"));
|
|
|
- childList2.add(countMap.get("taishan"));
|
|
|
childList2.add(countMap.get("dongping"));
|
|
|
- childList2.add(countMap.get("feicheng"));
|
|
|
- childList2.add(countMap.get("taishanjingqu"));
|
|
|
- childList2.add(countMap.get("gaoxin"));
|
|
|
childList2.add(countMap.get("heji"));
|
|
|
resList.add(childList2);
|
|
|
|
|
|
List<String> childList9 = new ArrayList<String>();
|
|
|
childList9.add("台区停电时户数");
|
|
|
- childList9.add(CommonUtil.divide(shihuMap.get("xintai"), "60", 2));
|
|
|
+ childList9.add(CommonUtil.divide(shihuMap.get("taishan"), "60", 2));
|
|
|
childList9.add(CommonUtil.divide(shihuMap.get("daiyue"), "60", 2));
|
|
|
+ childList9.add(CommonUtil.divide(shihuMap.get("gaoxin"), "60", 2));
|
|
|
+ childList9.add(CommonUtil.divide(shihuMap.get("taishanjingqu"), "60", 2));
|
|
|
+ childList9.add(CommonUtil.divide(shihuMap.get("xintai"), "60", 2));
|
|
|
+ childList9.add(CommonUtil.divide(shihuMap.get("feicheng"), "60", 2));
|
|
|
childList9.add(CommonUtil.divide(shihuMap.get("ningyang"), "60", 2));
|
|
|
- childList9.add(CommonUtil.divide(shihuMap.get("taishan"), "60", 2));
|
|
|
childList9.add(CommonUtil.divide(shihuMap.get("dongping"), "60", 2));
|
|
|
- childList9.add(CommonUtil.divide(shihuMap.get("feicheng"), "60", 2));
|
|
|
- childList9.add(CommonUtil.divide(shihuMap.get("taishanjingqu"), "60", 2));
|
|
|
- childList9.add(CommonUtil.divide(shihuMap.get("gaoxin"), "60", 2));
|
|
|
childList9.add(CommonUtil.divide(shihuMap.get("heji"), "60", 2));
|
|
|
resList.add(childList9);
|
|
|
|
|
|
List<String> childList3 = new ArrayList<String>();
|
|
|
childList3.add("台区停运率");
|
|
|
- childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("xintai"), totalMap.get("xintai"), 4), "100", 2) + "%");
|
|
|
+ childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("taishan"), totalMap.get("xintai"), 4), "100", 2) + "%");
|
|
|
childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("daiyue"), totalMap.get("daiyue"), 4), "100", 2) + "%");
|
|
|
- childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("ningyang"), totalMap.get("ningyang"), 4), "100", 2) + "%");
|
|
|
- childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("taishan"), totalMap.get("taishan"), 4), "100", 2) + "%");
|
|
|
- childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("dongping"), totalMap.get("dongping"), 4), "100", 2) + "%");
|
|
|
+ childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("gaoxin"), totalMap.get("ningyang"), 4), "100", 2) + "%");
|
|
|
+ childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("taishanjingqu"), totalMap.get("taishan"), 4), "100", 2) + "%");
|
|
|
+ childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("xintai"), totalMap.get("dongping"), 4), "100", 2) + "%");
|
|
|
childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("feicheng"), totalMap.get("feicheng"), 4), "100", 2) + "%");
|
|
|
- childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("taishanjingqu"), totalMap.get("taishanjingqu"), 4), "100", 2) + "%");
|
|
|
- childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("gaoxin"), totalMap.get("gaoxin"), 4), "100", 2) + "%");
|
|
|
+ childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("ningyang"), totalMap.get("taishanjingqu"), 4), "100", 2) + "%");
|
|
|
+ childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("dongping"), totalMap.get("gaoxin"), 4), "100", 2) + "%");
|
|
|
childList3.add(CommonUtil.multiply(CommonUtil.divide(countMap.get("heji"), totalMap.get("heji"), 4), "100", 2) + "%");
|
|
|
resList.add(childList3);
|
|
|
|
|
|
@@ -434,14 +434,14 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
List<String> childList4 = new ArrayList<String>();
|
|
|
childList4.add("台区停电个数");
|
|
|
- childList4.add(tqtdGsMap.get("xintai"));
|
|
|
+ childList4.add(tqtdGsMap.get("taishan"));
|
|
|
childList4.add(tqtdGsMap.get("daiyue"));
|
|
|
+ childList4.add(tqtdGsMap.get("gaoxin"));
|
|
|
+ childList4.add(tqtdGsMap.get("taishanjingqu"));
|
|
|
+ childList4.add(tqtdGsMap.get("xintai"));
|
|
|
+ childList4.add(tqtdGsMap.get("feicheng"));
|
|
|
childList4.add(tqtdGsMap.get("ningyang"));
|
|
|
- childList4.add(tqtdGsMap.get("taishan"));
|
|
|
childList4.add(tqtdGsMap.get("dongping"));
|
|
|
- childList4.add(tqtdGsMap.get("feicheng"));
|
|
|
- childList4.add(tqtdGsMap.get("taishanjingqu"));
|
|
|
- childList4.add(tqtdGsMap.get("gaoxin"));
|
|
|
childList4.add(tqtdGsMap.get("heji"));
|
|
|
resList.add(childList4);
|
|
|
|
|
|
@@ -483,14 +483,14 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
List<String> childList6 = new ArrayList<String>();
|
|
|
childList6.add(monthNum+"个月停电" + countNum + "次及以上台区");
|
|
|
- childList6.add(taiQuMap.get("xintai").toString());
|
|
|
+ childList6.add(taiQuMap.get("taishan").toString());
|
|
|
childList6.add(taiQuMap.get("daiyue").toString());
|
|
|
+ childList6.add(taiQuMap.get("gaoxin").toString());
|
|
|
+ childList6.add(taiQuMap.get("taishanjingqu").toString());
|
|
|
+ childList6.add(taiQuMap.get("xintai").toString());
|
|
|
+ childList6.add(taiQuMap.get("feicheng").toString());
|
|
|
childList6.add(taiQuMap.get("ningyang").toString());
|
|
|
- childList6.add(taiQuMap.get("taishan").toString());
|
|
|
childList6.add(taiQuMap.get("dongping").toString());
|
|
|
- childList6.add(taiQuMap.get("feicheng").toString());
|
|
|
- childList6.add(taiQuMap.get("taishanjingqu").toString());
|
|
|
- childList6.add(taiQuMap.get("gaoxin").toString());
|
|
|
childList6.add(taiQuMap.get("heji").toString());
|
|
|
resList.add(childList6);
|
|
|
|
|
|
@@ -507,14 +507,14 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
|
|
|
Map<String, Integer> yesterdayTaiQuMap = new HashMap<String, Integer>();
|
|
|
- yesterdayTaiQuMap.put("xintai", 0);
|
|
|
+ yesterdayTaiQuMap.put("taishan", 0);
|
|
|
yesterdayTaiQuMap.put("daiyue", 0);
|
|
|
+ yesterdayTaiQuMap.put("gaoxin", 0);
|
|
|
+ yesterdayTaiQuMap.put("taishanjingqu", 0);
|
|
|
+ yesterdayTaiQuMap.put("xintai", 0);
|
|
|
+ yesterdayTaiQuMap.put("feicheng", 0);
|
|
|
yesterdayTaiQuMap.put("ningyang", 0);
|
|
|
- yesterdayTaiQuMap.put("taishan", 0);
|
|
|
yesterdayTaiQuMap.put("dongping", 0);
|
|
|
- yesterdayTaiQuMap.put("feicheng", 0);
|
|
|
- yesterdayTaiQuMap.put("taishanjingqu", 0);
|
|
|
- yesterdayTaiQuMap.put("gaoxin", 0);
|
|
|
yesterdayTaiQuMap.put("heji", 0);
|
|
|
for (Map<String, String> map : yesterdayAndTDData) {
|
|
|
if ("新泰".equals(map.get("area"))) {
|
|
|
@@ -538,14 +538,14 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
List<String> childList7 = new ArrayList<String>();
|
|
|
childList7.add(monthNum+"个月停电" + countNum + "次及以上台区且当日停电");
|
|
|
- childList7.add(yesterdayTaiQuMap.get("xintai").toString());
|
|
|
+ childList7.add(yesterdayTaiQuMap.get("taishan").toString());
|
|
|
childList7.add(yesterdayTaiQuMap.get("daiyue").toString());
|
|
|
+ childList7.add(yesterdayTaiQuMap.get("gaoxin").toString());
|
|
|
+ childList7.add(yesterdayTaiQuMap.get("taishanjingqu").toString());
|
|
|
+ childList7.add(yesterdayTaiQuMap.get("xintai").toString());
|
|
|
+ childList7.add(yesterdayTaiQuMap.get("feicheng").toString());
|
|
|
childList7.add(yesterdayTaiQuMap.get("ningyang").toString());
|
|
|
- childList7.add(yesterdayTaiQuMap.get("taishan").toString());
|
|
|
childList7.add(yesterdayTaiQuMap.get("dongping").toString());
|
|
|
- childList7.add(yesterdayTaiQuMap.get("feicheng").toString());
|
|
|
- childList7.add(yesterdayTaiQuMap.get("taishanjingqu").toString());
|
|
|
- childList7.add(yesterdayTaiQuMap.get("gaoxin").toString());
|
|
|
childList7.add(yesterdayTaiQuMap.get("heji").toString());
|
|
|
resList.add(childList7);
|
|
|
|
|
|
@@ -587,14 +587,14 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
List<String> childList8 = new ArrayList<String>();
|
|
|
childList8.add("2个月停电1次及以上台区且当日停电");
|
|
|
- childList8.add(yiciMap.get("xintai").toString());
|
|
|
+ childList8.add(yiciMap.get("taishan").toString());
|
|
|
childList8.add(yiciMap.get("daiyue").toString());
|
|
|
+ childList8.add(yiciMap.get("gaoxin").toString());
|
|
|
+ childList8.add(yiciMap.get("taishanjingqu").toString());
|
|
|
+ childList8.add(yiciMap.get("xintai").toString());
|
|
|
+ childList8.add(yiciMap.get("feicheng").toString());
|
|
|
childList8.add(yiciMap.get("ningyang").toString());
|
|
|
- childList8.add(yiciMap.get("taishan").toString());
|
|
|
childList8.add(yiciMap.get("dongping").toString());
|
|
|
- childList8.add(yiciMap.get("feicheng").toString());
|
|
|
- childList8.add(yiciMap.get("taishanjingqu").toString());
|
|
|
- childList8.add(yiciMap.get("gaoxin").toString());
|
|
|
childList8.add(yiciMap.get("heji").toString());
|
|
|
resList.add(childList8);
|
|
|
|
|
|
@@ -790,6 +790,8 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
|
|
|
// 平均停电时长
|
|
|
+ String shihuArea = ""; // 时户最大区域
|
|
|
+ String shihuNum = "0"; // 时户最大数
|
|
|
String totalHour = "0"; //总时长
|
|
|
String totalCountSC = "0";
|
|
|
List<Map<String, String>> areaTimeList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByArea(param);
|
|
|
@@ -798,8 +800,8 @@ public class ReportServiceImpl implements IReportService {
|
|
|
String timeMinute = map.get("timeMinute");
|
|
|
String count = map.get("count");
|
|
|
// 平均停电小时
|
|
|
- String hour = CommonUtil.divide(timeMinute, "60", 2);
|
|
|
- String hourPJ = CommonUtil.divide(hour, count, 2);
|
|
|
+ String hour = CommonUtil.divide(timeMinute, "60", 2); // 时户
|
|
|
+ String hourPJ = CommonUtil.divide(hour, count, 2); // 平均时长
|
|
|
if ("新泰".equals(area)) {
|
|
|
xintai.add(hour);
|
|
|
xintai.add(hourPJ);
|
|
|
@@ -827,6 +829,10 @@ public class ReportServiceImpl implements IReportService {
|
|
|
} else {
|
|
|
continue;
|
|
|
}
|
|
|
+ if (CommonUtil.compare(shihuNum, hour) == -1) {
|
|
|
+ shihuNum = hour;
|
|
|
+ shihuArea = area;
|
|
|
+ }
|
|
|
totalHour = CommonUtil.add(totalHour, hour);
|
|
|
totalCountSC = CommonUtil.add(totalCountSC, count);
|
|
|
}
|
|
|
@@ -1111,6 +1117,9 @@ public class ReportServiceImpl implements IReportService {
|
|
|
// 描述数据
|
|
|
Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
dataMap.put("totalCount", totalCount);
|
|
|
+ dataMap.put("totalHour", totalHour);
|
|
|
+ dataMap.put("shihuArea", shihuArea);
|
|
|
+ dataMap.put("shihuNum", shihuNum);
|
|
|
dataMap.put("pingjun", CommonUtil.divide(totalHour, totalCount, 2));
|
|
|
dataMap.put("twiceCount", totalChongfu);
|
|
|
dataMap.put("mostAddressNumDesc", mostAddressNumDesc);
|
|
|
@@ -1170,7 +1179,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
|
|
|
resMap.put("dataMap", dataMap);
|
|
|
|
|
|
- String descStr = "<p>上周,台区累计停电${totalCount}台次,平均停电时长${pingjun}小时/台。停电两次及以上台区${twiceCount}个,${twiceCountDesc}${mostAddressNumDesc}重复停电次数最多为${mostAddressNum}次。${zuichangTaiqu}停电时长最长为${zuichangSj}小时。</p>"
|
|
|
+ String descStr = "<p>上周,台区累计停电${totalCount}台次(${totalHour}时户),平均停电时长${pingjun}小时/台,${shihuArea}停电时户数最多为${shihuNum}时户。停电两次及以上台区${twiceCount}个,${twiceCountDesc}${mostAddressNumDesc}重复停电次数最多为${mostAddressNum}次。${zuichangTaiqu}停电时长最长为${zuichangSj}小时。</p>"
|
|
|
+"上周,督办频繁停电(两个月内三次及以上)共计${dubanCount}台次,${huanbi},${tongbi}${dubantaiciDesc}${liangyueMostAddressNumDesc}两个月内频繁停电次数最多为${liangyueMostAddressNum}次。";
|
|
|
resMap.put("descStr", descStr);
|
|
|
|
|
|
@@ -1211,6 +1220,8 @@ public class ReportServiceImpl implements IReportService {
|
|
|
List<Map<String, String>> areaCountList = db.getMybatisMapper(ReportServiceMapper.class).selectReportType00TqtdGS(param);
|
|
|
//停电时长
|
|
|
List<Map<String, String>> areaTimeList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByArea(param);
|
|
|
+ // 台次数
|
|
|
+ List<Map<String, String>> tcList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByAddress(param);
|
|
|
//停电台区数
|
|
|
param.put("beginDay", beginTime);
|
|
|
param.put("endDay", endTime);
|
|
|
@@ -1230,6 +1241,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
param.put("endTime", endTime);
|
|
|
List<Map<String, String>> tbAreaCountList = db.getMybatisMapper(ReportServiceMapper.class).selectReportType00TqtdGS(param);
|
|
|
List<Map<String, String>> tbAreaTimeList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByArea(param);
|
|
|
+ List<Map<String, String>> tbTcList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByAddress(param); // 台次
|
|
|
/** 去年同月数据---- end ----*/
|
|
|
/** 上月月数据---- start ----*/
|
|
|
if (CommonUtil.isEmpty(timeRange)) {
|
|
|
@@ -1244,6 +1256,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
param.put("endTime", endTime);
|
|
|
List<Map<String, String>> hbAreaCountList = db.getMybatisMapper(ReportServiceMapper.class).selectReportType00TqtdGS(param);
|
|
|
List<Map<String, String>> hbAreaTimeList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByArea(param);
|
|
|
+ List<Map<String, String>> hbTcList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByAddress(param); // 台次
|
|
|
/** 上月月数据---- end ----*/
|
|
|
|
|
|
/** 停电台区数 ----start----*/
|
|
|
@@ -1289,7 +1302,23 @@ public class ReportServiceImpl implements IReportService {
|
|
|
huanbi = "减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(hbCount, benyueCount), hbCount,4), "100", 2) + "%";
|
|
|
}
|
|
|
}
|
|
|
- int shejiNum = areaCountList.size();
|
|
|
+
|
|
|
+ // 台次数
|
|
|
+ String shejiNum = "0";
|
|
|
+ for (Map<String, String> map : tcList) {
|
|
|
+ shejiNum = CommonUtil.add(shejiNum, map.get("num"));
|
|
|
+ }
|
|
|
+ // 去年数据台次数
|
|
|
+ String tbShejiNum = "0";
|
|
|
+ for (Map<String, String> map : tbTcList) {
|
|
|
+ tbShejiNum = CommonUtil.add(tbShejiNum, map.get("num"));
|
|
|
+ }
|
|
|
+ // 上月数据台次数
|
|
|
+ String hbShejiNum = "0";
|
|
|
+ for (Map<String, String> map : hbTcList) {
|
|
|
+ hbShejiNum = CommonUtil.add(hbShejiNum, map.get("num"));
|
|
|
+ }
|
|
|
+
|
|
|
String shejiDesc = "";
|
|
|
for (int i = 0; i < areaCountList.size(); i++) {
|
|
|
if (i == areaCountList.size() - 1) {
|
|
|
@@ -1320,56 +1349,58 @@ public class ReportServiceImpl implements IReportService {
|
|
|
// 平均时长
|
|
|
|
|
|
String pingjunHour = "0";
|
|
|
- if (CommonUtil.compare(totalCount, "0") != 0) {
|
|
|
- pingjunHour = CommonUtil.divide(benyueTime, totalCount, 2);
|
|
|
+ if (CommonUtil.compare(shejiNum, "0") != 0) {
|
|
|
+ pingjunHour = CommonUtil.divide(benyueTime, shejiNum, 2);
|
|
|
}
|
|
|
// 同比数据
|
|
|
String tongbiPingjunHour = "";
|
|
|
if (CommonUtil.compare(tbTime, "0") != 0) {
|
|
|
- if (CommonUtil.compare(benyueTime, tbTime) == 1) {
|
|
|
- tongbiPingjunHour = "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(benyueTime, tbTime), tbTime, 4), "100", 2)+"%";
|
|
|
+ tongbiPingjunHour = CommonUtil.divide(tbTime, tbShejiNum, 2);
|
|
|
+ if (CommonUtil.compare(pingjunHour, tongbiPingjunHour) == 1) {
|
|
|
+ tongbiPingjunHour = "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(pingjunHour, tongbiPingjunHour), tongbiPingjunHour, 4), "100", 2)+"%";
|
|
|
} else {
|
|
|
- tongbiPingjunHour = "下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tbTime, benyueTime), tbTime, 4), "100", 2)+"%";
|
|
|
+ tongbiPingjunHour = "下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tongbiPingjunHour, pingjunHour), tongbiPingjunHour, 4), "100", 2)+"%";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 环比数据
|
|
|
String huanbiPingjunHour = "";
|
|
|
if (CommonUtil.compare(hbTime, "0") != 0) {
|
|
|
- if (CommonUtil.compare(benyueTime, hbTime) == 1) {
|
|
|
- huanbiPingjunHour = "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(benyueTime, hbTime), hbTime, 4), "100", 2)+"%";
|
|
|
+ huanbiPingjunHour = CommonUtil.divide(hbTime, hbShejiNum, 2);
|
|
|
+ if (CommonUtil.compare(pingjunHour, huanbiPingjunHour) == 1) {
|
|
|
+ huanbiPingjunHour = "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(pingjunHour, huanbiPingjunHour), huanbiPingjunHour, 4), "100", 2)+"%";
|
|
|
} else {
|
|
|
- huanbiPingjunHour = "下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(hbTime, benyueTime), hbTime, 4), "100", 2)+"%";
|
|
|
+ huanbiPingjunHour = "下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(huanbiPingjunHour, pingjunHour), huanbiPingjunHour, 4), "100", 2)+"%";
|
|
|
}
|
|
|
}
|
|
|
// 台区平均停电时长描述
|
|
|
String areaPingjunDesc = "";
|
|
|
- for (int i = 0; i < areaTimeList.size(); i++) {
|
|
|
- String pingjunTime = CommonUtil.divide(CommonUtil.divide(areaTimeList.get(i).get("timeMinute"), areaTimeList.get(i).get("count"), 2),"60", 2);
|
|
|
- if (areaTimeList.size() - 1 == i) {
|
|
|
- areaPingjunDesc += areaTimeList.get(i).get("area")+pingjunTime+"小时;";
|
|
|
+ for (int i = 0; i < tcList.size(); i++) {
|
|
|
+ String pingjunTime = CommonUtil.divide(CommonUtil.divide(tcList.get(i).get("time"), tcList.get(i).get("num"), 2),"60", 2);
|
|
|
+ if (tcList.size() - 1 == i) {
|
|
|
+ areaPingjunDesc += tcList.get(i).get("area")+pingjunTime+"小时;";
|
|
|
} else {
|
|
|
- areaPingjunDesc += areaTimeList.get(i).get("area")+pingjunTime+"小时、";
|
|
|
+ areaPingjunDesc += tcList.get(i).get("area")+pingjunTime+"小时、";
|
|
|
}
|
|
|
}
|
|
|
// 区域平均时长同比
|
|
|
String tbAreaPingjunDesc = "";
|
|
|
- for (int i = 0; i < areaTimeList.size(); i++) {
|
|
|
- String pingjunTime = CommonUtil.divide(CommonUtil.divide(areaTimeList.get(i).get("timeMinute"), areaTimeList.get(i).get("count"), 2),"60", 2);
|
|
|
- for (int j = 0; j < tbAreaTimeList.size(); j++) {
|
|
|
- if (areaTimeList.get(i).get("area").equals(tbAreaTimeList.get(j).get("area"))) {
|
|
|
- String tbPingjunTime = CommonUtil.divide(CommonUtil.divide(tbAreaTimeList.get(j).get("timeMinute"), tbAreaTimeList.get(j).get("count"), 2),"60", 2);
|
|
|
+ for (int i = 0; i < tcList.size(); i++) {
|
|
|
+ String pingjunTime = CommonUtil.divide(CommonUtil.divide(tcList.get(i).get("time"), tcList.get(i).get("num"), 2),"60", 2);
|
|
|
+ for (int j = 0; j < tbTcList.size(); j++) {
|
|
|
+ if (tcList.get(i).get("area").equals(tbTcList.get(j).get("area"))) {
|
|
|
+ String tbPingjunTime = CommonUtil.divide(CommonUtil.divide(tbTcList.get(j).get("time"), tbTcList.get(j).get("num"), 2),"60", 2);
|
|
|
if (CommonUtil.compare(pingjunTime, tbPingjunTime) == 1) {
|
|
|
- if (i == areaTimeList.size() - 1) {
|
|
|
- tbAreaPingjunDesc += areaTimeList.get(i).get("area") + "同比上升" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(pingjunTime, tbPingjunTime), tbPingjunTime, 4), "100", 2)+"%。";
|
|
|
+ if (i == tcList.size() - 1) {
|
|
|
+ tbAreaPingjunDesc += tcList.get(i).get("area") + "同比上升" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(pingjunTime, tbPingjunTime), tbPingjunTime, 4), "100", 2)+"%。";
|
|
|
} else {
|
|
|
- tbAreaPingjunDesc += areaTimeList.get(i).get("area") + "同比上升" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(pingjunTime, tbPingjunTime), tbPingjunTime, 4), "100", 2)+"%、";
|
|
|
+ tbAreaPingjunDesc += tcList.get(i).get("area") + "同比上升" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(pingjunTime, tbPingjunTime), tbPingjunTime, 4), "100", 2)+"%、";
|
|
|
}
|
|
|
} else {
|
|
|
- if (i == areaTimeList.size() - 1) {
|
|
|
- tbAreaPingjunDesc += areaTimeList.get(i).get("area") + "同比下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tbPingjunTime, pingjunTime), tbPingjunTime, 4), "100", 2)+"%。";
|
|
|
+ if (i == tcList.size() - 1) {
|
|
|
+ tbAreaPingjunDesc += tcList.get(i).get("area") + "同比下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tbPingjunTime, pingjunTime), tbPingjunTime, 4), "100", 2)+"%。";
|
|
|
} else {
|
|
|
- tbAreaPingjunDesc += areaTimeList.get(i).get("area") + "同比下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tbPingjunTime, pingjunTime), tbPingjunTime, 4), "100", 2)+"%、";
|
|
|
+ tbAreaPingjunDesc += tcList.get(i).get("area") + "同比下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tbPingjunTime, pingjunTime), tbPingjunTime, 4), "100", 2)+"%、";
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
@@ -1419,9 +1450,9 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
|
|
|
// 两个月内停电2次以上的数据
|
|
|
- String beginDay = DateUtil.dateAddMonth(rangeArray[1], Integer.parseInt("-2"));
|
|
|
- param.put("beginDay", beginDay);
|
|
|
- param.put("endDay", rangeArray[1]);
|
|
|
+ String beginDay = DateUtil.dateAddDay(DateUtil.dateAddMonth(rangeArray[1], Integer.parseInt("-2")), 1);
|
|
|
+ param.put("beginDay", beginDay + beginTime.substring(8,14));
|
|
|
+ param.put("endDay", rangeArray[1] + endTime.substring(8,14));
|
|
|
param.put("countNum", "2");
|
|
|
List<Map<String, String>> twiceMountCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
Map<String, Integer> taiQuMapTwice = new HashMap<String, Integer>();//区域统计
|
|
|
@@ -1467,7 +1498,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
/**停电次数数据处理----end----*/
|
|
|
|
|
|
String descStr = "<p>(1)台区停电总体情况${month}月份,台区累计停电${benyueCount}台次,同比${tongbi},环比${huanbi},涉及${shejiNum}个台区,${shejiDesc}</p>"
|
|
|
- + "<p>(2)台区停电时长情况${totalCount}个台区累计停电时间${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>";
|
|
|
|