|
@@ -12,12 +12,10 @@ import com.minpay.common.constant.Constant;
|
|
|
import com.minpay.common.service.IReportService;
|
|
|
import com.minpay.common.util.CommonUtil;
|
|
|
import com.minpay.common.util.DateUtil;
|
|
|
-import com.minpay.db.table.mapper.DwBranchFileTypeMapper;
|
|
|
import com.minpay.db.table.mapper.DwFileDetail01Mapper;
|
|
|
import com.minpay.db.table.mapper.DwFileDetail03Mapper;
|
|
|
import com.minpay.db.table.mapper.DwFileDetail04Mapper;
|
|
|
import com.minpay.db.table.mapper.PubAppparMapper;
|
|
|
-import com.minpay.db.table.model.DwBranchReportTypeExample;
|
|
|
import com.minpay.db.table.model.DwFileDetail01;
|
|
|
import com.minpay.db.table.model.DwFileDetail01Example;
|
|
|
import com.minpay.db.table.model.DwFileDetail03;
|
|
@@ -117,8 +115,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
resMap.put("resList", resList);
|
|
|
// 台区停电周报
|
|
|
} else if (Constant.REPORT_TYPE_01.equals(reportTypeId)) {
|
|
|
- List<List<String>> resList = reportTypeTQTDZB(range, timeRange);
|
|
|
- resMap.put("resList", resList);
|
|
|
+ return reportTypeTQTDZB(range, timeRange);
|
|
|
// 台区停电月报
|
|
|
} else if (Constant.REPORT_TYPE_02.equals(reportTypeId)) {
|
|
|
return reportTypeTQTDYB(range, timeRange);
|
|
@@ -471,7 +468,9 @@ public class ReportServiceImpl implements IReportService {
|
|
|
* @throws MINBusinessException
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
- public List<List<String>> reportTypeTQTDZB(String range, String timeRange) throws MINBusinessException, ParseException {
|
|
|
+ public Map<String, Object> reportTypeTQTDZB(String range, String timeRange) throws MINBusinessException, ParseException {
|
|
|
+ Map<String, Object> resMap = new HashMap<String, Object>();
|
|
|
+
|
|
|
IMINDataBaseService db = Service.lookup(IMINDataBaseService.class);
|
|
|
Map<String, Object> param = new HashMap<String, Object>();
|
|
|
String beginTime = null;
|
|
@@ -490,18 +489,15 @@ public class ReportServiceImpl implements IReportService {
|
|
|
param.put("beginTime", beginTime);
|
|
|
param.put("endTime", endTime);
|
|
|
|
|
|
-
|
|
|
List<List<String>> resList = new ArrayList<List<String>>();
|
|
|
List<String> title = new ArrayList<String>();
|
|
|
title.add("单位\\分类");
|
|
|
title.add("管理台区总数");
|
|
|
- title.add("1个月内累计停电台次");
|
|
|
- title.add("上月累计停电台次");
|
|
|
- title.add("去年同期累计停电台次");
|
|
|
- title.add("1个月内平均停电频次");
|
|
|
- title.add("平均停电频次排名");
|
|
|
- title.add("1个月内平均停电时长");
|
|
|
- title.add("平均停电时长排名");
|
|
|
+ title.add("本周累计停电台次");
|
|
|
+ title.add("本周平均停电时长(小时)");
|
|
|
+ title.add("本周重复停电台区数");
|
|
|
+ title.add("本周督办频繁停电台次");
|
|
|
+ title.add("本周督办频繁停电台区数");
|
|
|
resList.add(title);
|
|
|
List<String> xintai = new ArrayList<String>();
|
|
|
xintai.add("新泰");
|
|
@@ -530,7 +526,6 @@ public class ReportServiceImpl implements IReportService {
|
|
|
List<String> heji = new ArrayList<String>();
|
|
|
heji.add("合计");
|
|
|
heji.add(totalMap.get("heji"));
|
|
|
-
|
|
|
|
|
|
resList.add(xintai);
|
|
|
resList.add(daiyue);
|
|
@@ -542,7 +537,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
resList.add(gaoxin);
|
|
|
resList.add(heji);
|
|
|
|
|
|
- //本月停电次数
|
|
|
+ //累计停电台次
|
|
|
List<Map<String, String>> areaCountList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByArea(param);
|
|
|
String totalCount = "0";
|
|
|
for (Map<String, String> map : areaCountList) {
|
|
@@ -574,88 +569,105 @@ public class ReportServiceImpl implements IReportService {
|
|
|
list.add("0");
|
|
|
}
|
|
|
}
|
|
|
- //上个与月停电次数
|
|
|
- beginTime = DateUtil.dateAddMonth(rangeArray[0], -1);
|
|
|
- endTime = DateUtil.dateAddMonth(rangeArray[1], -1);
|
|
|
- if (CommonUtil.isEmpty(timeRange)) {
|
|
|
- beginTime = beginTime + "000000";
|
|
|
- endTime = endTime + "235959";
|
|
|
- } else {
|
|
|
- String[] timeRangeArray = timeRange.split("-");
|
|
|
- beginTime = beginTime + timeRangeArray[0];
|
|
|
- endTime = endTime + timeRangeArray[1];
|
|
|
- }
|
|
|
- param.put("beginTime", beginTime);
|
|
|
- param.put("endTime", endTime);
|
|
|
- List<Map<String, String>> lastMonthAreaCountList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByArea(param);
|
|
|
- String lastMonthtotalCount = "0";
|
|
|
- for (Map<String, String> map : lastMonthAreaCountList) {
|
|
|
+
|
|
|
+ // 平均停电时长
|
|
|
+ String totalHour = "0";
|
|
|
+ List<Map<String, String>> areaTimeList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByArea(param);
|
|
|
+ for (Map<String, String> map : areaTimeList) {
|
|
|
String area = map.get("area");
|
|
|
+ String timeMinute = map.get("timeMinute");
|
|
|
String count = map.get("count");
|
|
|
+ // 平均停电小时
|
|
|
+ String hour = CommonUtil.divide(CommonUtil.divide(timeMinute, count, 2), "60", 2);
|
|
|
if ("新泰".equals(area)) {
|
|
|
- xintai.add(count);
|
|
|
+ xintai.add(hour);
|
|
|
} else if ("岱岳".equals(area)) {
|
|
|
- daiyue.add(count);
|
|
|
+ daiyue.add(hour);
|
|
|
} else if ("宁阳".equals(area)) {
|
|
|
- ningyang.add(count);
|
|
|
+ ningyang.add(hour);
|
|
|
} else if ("泰山".equals(area)) {
|
|
|
- taishan.add(count);
|
|
|
+ taishan.add(hour);
|
|
|
} else if ("东平".equals(area)) {
|
|
|
- dongping.add(count);
|
|
|
+ dongping.add(hour);
|
|
|
} else if ("肥城".equals(area)) {
|
|
|
- feicheng.add(count);
|
|
|
+ feicheng.add(hour);
|
|
|
} else if ("泰山景区".equals(area)) {
|
|
|
- taishanjingqu.add(count);
|
|
|
+ taishanjingqu.add(hour);
|
|
|
} else if ("高新".equals(area)) {
|
|
|
- gaoxin.add(count);
|
|
|
+ gaoxin.add(hour);
|
|
|
}
|
|
|
- lastMonthtotalCount = CommonUtil.add(lastMonthtotalCount, count);
|
|
|
+ totalHour = CommonUtil.add(totalHour, hour);
|
|
|
}
|
|
|
- heji.add(lastMonthtotalCount);
|
|
|
+ heji.add(CommonUtil.divide(totalHour, totalCount, 2));
|
|
|
+
|
|
|
// 没有数据的区域数值为0
|
|
|
for (List<String> list : resList) {
|
|
|
if (list.size() == 3) {
|
|
|
list.add("0");
|
|
|
}
|
|
|
}
|
|
|
- //去年同期停电次数
|
|
|
- beginTime = DateUtil.dateAddYear(rangeArray[0], -1);
|
|
|
- endTime = DateUtil.dateAddYear(rangeArray[1], -1);
|
|
|
- if (CommonUtil.isEmpty(timeRange)) {
|
|
|
- beginTime = beginTime + "000000";
|
|
|
- endTime = endTime + "235959";
|
|
|
- } else {
|
|
|
- String[] timeRangeArray = timeRange.split("-");
|
|
|
- beginTime = beginTime + timeRangeArray[0];
|
|
|
- endTime = endTime + timeRangeArray[1];
|
|
|
- }
|
|
|
- param.put("beginTime", beginTime);
|
|
|
- param.put("endTime", endTime);
|
|
|
- List<Map<String, String>> lastYearAreaCountList = db.getMybatisMapper(ReportServiceMapper.class).selectDetail00ByArea(param);
|
|
|
- String lastYeartotalCount = "0";
|
|
|
- for (Map<String, String> map : lastYearAreaCountList) {
|
|
|
+
|
|
|
+ // 本周重复停电台区数
|
|
|
+ param.put("beginDay", beginTime);
|
|
|
+ param.put("endDay", endTime);
|
|
|
+ param.put("countNum", "2");
|
|
|
+
|
|
|
+ String totalChongfu = "0";
|
|
|
+ List<Map<String, String>> twiceCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
+ for (Map<String, String> map : twiceCountList) {
|
|
|
String area = map.get("area");
|
|
|
- String count = map.get("count");
|
|
|
if ("新泰".equals(area)) {
|
|
|
- xintai.add(count);
|
|
|
+ if (xintai.size() >= 5) {
|
|
|
+ xintai.set(4, CommonUtil.add(xintai.get(4), "1"));
|
|
|
+ } else {
|
|
|
+ xintai.add(4, "1");
|
|
|
+ }
|
|
|
} else if ("岱岳".equals(area)) {
|
|
|
- daiyue.add(count);
|
|
|
+ if (daiyue.size() >= 5) {
|
|
|
+ daiyue.set(4, CommonUtil.add(daiyue.get(4), "1"));
|
|
|
+ } else {
|
|
|
+ daiyue.add(4, "1");
|
|
|
+ }
|
|
|
} else if ("宁阳".equals(area)) {
|
|
|
- ningyang.add(count);
|
|
|
+ if (ningyang.size() >= 5) {
|
|
|
+ ningyang.set(4, CommonUtil.add(ningyang.get(4), "1"));
|
|
|
+ } else {
|
|
|
+ ningyang.add(4, "1");
|
|
|
+ }
|
|
|
} else if ("泰山".equals(area)) {
|
|
|
- taishan.add(count);
|
|
|
+ if (taishan.size() >= 5) {
|
|
|
+ taishan.set(4, CommonUtil.add(taishan.get(4), "1"));
|
|
|
+ } else {
|
|
|
+ taishan.add(4, "1");
|
|
|
+ }
|
|
|
} else if ("东平".equals(area)) {
|
|
|
- dongping.add(count);
|
|
|
+ if (dongping.size() >= 5) {
|
|
|
+ dongping.set(4, CommonUtil.add(dongping.get(4), "1"));
|
|
|
+ } else {
|
|
|
+ dongping.add(4, "1");
|
|
|
+ }
|
|
|
} else if ("肥城".equals(area)) {
|
|
|
- feicheng.add(count);
|
|
|
+ if (feicheng.size() >= 5) {
|
|
|
+ feicheng.set(4, CommonUtil.add(feicheng.get(4), "1"));
|
|
|
+ } else {
|
|
|
+ feicheng.add(4, "1");
|
|
|
+ }
|
|
|
} else if ("泰山景区".equals(area)) {
|
|
|
- taishanjingqu.add(count);
|
|
|
+ if (taishanjingqu.size() >= 5) {
|
|
|
+ taishanjingqu.set(4, CommonUtil.add(taishanjingqu.get(4), "1"));
|
|
|
+ } else {
|
|
|
+ taishanjingqu.add(4, "1");
|
|
|
+ }
|
|
|
} else if ("高新".equals(area)) {
|
|
|
- gaoxin.add(count);
|
|
|
+ if (gaoxin.size() >= 5) {
|
|
|
+ gaoxin.set(4, CommonUtil.add(gaoxin.get(4), "1"));
|
|
|
+ } else {
|
|
|
+ gaoxin.add(4, "1");
|
|
|
+ }
|
|
|
}
|
|
|
- lastYeartotalCount = CommonUtil.add(lastYeartotalCount, count);
|
|
|
+ totalChongfu = CommonUtil.add(totalChongfu, "1");
|
|
|
}
|
|
|
- heji.add(lastYeartotalCount);
|
|
|
+ heji.add(totalChongfu);
|
|
|
// 没有数据的区域数值为0
|
|
|
for (List<String> list : resList) {
|
|
|
if (list.size() == 4) {
|
|
@@ -663,103 +675,187 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 1个月内平均停电频次
|
|
|
- for (int i = 1; i < resList.size(); i ++) {
|
|
|
- List<String> list = resList.get(i);
|
|
|
- String totalNum = list.get(1);
|
|
|
- String tingdianNum = list.get(2);
|
|
|
- String pinci = "0";
|
|
|
- if (!(CommonUtil.compare(totalNum, "0") == 0)) {
|
|
|
- pinci = CommonUtil.divide(tingdianNum, totalNum, 2);
|
|
|
- }
|
|
|
- list.add(pinci);
|
|
|
- }
|
|
|
-
|
|
|
- List<Integer> pinciPaiming = new ArrayList<Integer>();
|
|
|
- // 平均停电频次排名,合计不参与排名
|
|
|
- for (int i = 1; i < resList.size() - 1; i ++) {
|
|
|
- String pinci = resList.get(i).get(5);
|
|
|
- // 排名
|
|
|
- int num = 1;
|
|
|
- for (int j = 1; j < resList.size() - 1; j ++) {
|
|
|
- // 不和本次作对比
|
|
|
- if (i != j) {
|
|
|
- String comparePinci = resList.get(j).get(5);
|
|
|
- // 不比对比频次大
|
|
|
- if (CommonUtil.compare(comparePinci, pinci) == -1) {
|
|
|
- num ++;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 相同次数的往后排
|
|
|
- while (pinciPaiming.contains(num)) {
|
|
|
- num ++;
|
|
|
- }
|
|
|
- pinciPaiming.add(num);
|
|
|
- resList.get(i).add(String.valueOf(num));
|
|
|
+ String totalMonthChongfuTaici = "0";
|
|
|
+ String totalMonthChongfuTaishu = "0";
|
|
|
+ beginTime = DateUtil.dateAddDay(DateUtil.dateAddMonth(rangeArray[1], -2), 1);
|
|
|
+ if (CommonUtil.isEmpty(timeRange)) {
|
|
|
+ param.put("beginDay", beginTime = DateUtil.dateAddDay(DateUtil.dateAddMonth(rangeArray[1], -2), 1) + "000000");
|
|
|
+ } else {
|
|
|
+ String[] timeRangeArray = timeRange.split("-");
|
|
|
+ param.put("beginDay", DateUtil.dateAddDay(DateUtil.dateAddMonth(rangeArray[1], -2), 1) + timeRangeArray[0]);
|
|
|
}
|
|
|
- heji.add("");
|
|
|
+ param.put("endDay", endTime);
|
|
|
+ param.put("countNum", "2");
|
|
|
+ List<Map<String, String>> twiceMonthCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
|
|
|
- String totalTimeMinute = "0";
|
|
|
- for (Map<String, String> map : areaCountList) {
|
|
|
+ // 本周督办频繁停电台次/本周督办频繁停电台区数
|
|
|
+ for (Map<String, String> map : twiceMonthCountList) {
|
|
|
String area = map.get("area");
|
|
|
- String timeMinute = map.get("timeMinute");
|
|
|
- String count = map.get("count");
|
|
|
+ String num = map.get("num");
|
|
|
if ("新泰".equals(area)) {
|
|
|
- xintai.add(CommonUtil.divide(CommonUtil.divide(timeMinute, "60", 4), count, 2));
|
|
|
+ if (xintai.size() >= 6) {
|
|
|
+ xintai.set(5, CommonUtil.add(xintai.get(5), num));
|
|
|
+ } else {
|
|
|
+ xintai.add(5, num);
|
|
|
+ }
|
|
|
+ if (xintai.size() >= 7) {
|
|
|
+ xintai.set(6, CommonUtil.add(xintai.get(6), "1"));
|
|
|
+ } else {
|
|
|
+ xintai.add(6, "1");
|
|
|
+ }
|
|
|
} else if ("岱岳".equals(area)) {
|
|
|
- daiyue.add(CommonUtil.divide(CommonUtil.divide(timeMinute, "60", 4), count, 2));
|
|
|
+ if (daiyue.size() >= 6) {
|
|
|
+ daiyue.set(5, CommonUtil.add(daiyue.get(5), num));
|
|
|
+ } else {
|
|
|
+ daiyue.add(5, num);
|
|
|
+ }
|
|
|
+ if (daiyue.size() >= 7) {
|
|
|
+ daiyue.set(6, CommonUtil.add(daiyue.get(6), "1"));
|
|
|
+ } else {
|
|
|
+ daiyue.add(6, "1");
|
|
|
+ }
|
|
|
} else if ("宁阳".equals(area)) {
|
|
|
- ningyang.add(CommonUtil.divide(CommonUtil.divide(timeMinute, "60", 4), count, 2));
|
|
|
+ if (ningyang.size() >= 6) {
|
|
|
+ ningyang.set(5, CommonUtil.add(ningyang.get(5), num));
|
|
|
+ } else {
|
|
|
+ ningyang.add(5, num);
|
|
|
+ }
|
|
|
+ if (ningyang.size() >= 7) {
|
|
|
+ ningyang.set(6, CommonUtil.add(ningyang.get(6), "1"));
|
|
|
+ } else {
|
|
|
+ ningyang.add(6, "1");
|
|
|
+ }
|
|
|
} else if ("泰山".equals(area)) {
|
|
|
- taishan.add(CommonUtil.divide(CommonUtil.divide(timeMinute, "60", 4), count, 2));
|
|
|
+ if (taishan.size() >= 6) {
|
|
|
+ taishan.set(5, CommonUtil.add(taishan.get(5), num));
|
|
|
+ } else {
|
|
|
+ taishan.add(5, num);
|
|
|
+ }
|
|
|
+ if (taishan.size() >= 7) {
|
|
|
+ taishan.set(6, CommonUtil.add(taishan.get(6), "1"));
|
|
|
+ } else {
|
|
|
+ taishan.add(6, "1");
|
|
|
+ }
|
|
|
} else if ("东平".equals(area)) {
|
|
|
- dongping.add(CommonUtil.divide(CommonUtil.divide(timeMinute, "60", 4), count, 2));
|
|
|
+ if (dongping.size() >= 6) {
|
|
|
+ dongping.set(5, CommonUtil.add(dongping.get(5), num));
|
|
|
+ } else {
|
|
|
+ dongping.add(5, num);
|
|
|
+ }
|
|
|
+ if (dongping.size() >= 7) {
|
|
|
+ dongping.set(6, CommonUtil.add(dongping.get(6), "1"));
|
|
|
+ } else {
|
|
|
+ dongping.add(6, "1");
|
|
|
+ }
|
|
|
} else if ("肥城".equals(area)) {
|
|
|
- feicheng.add(CommonUtil.divide(CommonUtil.divide(timeMinute, "60", 4), count, 2));
|
|
|
+ if (feicheng.size() >= 6) {
|
|
|
+ feicheng.set(5, CommonUtil.add(feicheng.get(5), num));
|
|
|
+ } else {
|
|
|
+ feicheng.add(5, num);
|
|
|
+ }
|
|
|
+ if (feicheng.size() >= 7) {
|
|
|
+ feicheng.set(6, CommonUtil.add(feicheng.get(6), "1"));
|
|
|
+ } else {
|
|
|
+ feicheng.add(6, "1");
|
|
|
+ }
|
|
|
} else if ("泰山景区".equals(area)) {
|
|
|
- taishanjingqu.add(CommonUtil.divide(CommonUtil.divide(timeMinute, "60", 4), count, 2));
|
|
|
+ if (taishanjingqu.size() >= 6) {
|
|
|
+ taishanjingqu.set(5, CommonUtil.add(taishanjingqu.get(5), num));
|
|
|
+ } else {
|
|
|
+ taishanjingqu.add(5, num);
|
|
|
+ }
|
|
|
+ if (taishanjingqu.size() >= 7) {
|
|
|
+ taishanjingqu.set(6, CommonUtil.add(taishanjingqu.get(6), "1"));
|
|
|
+ } else {
|
|
|
+ taishanjingqu.add(6, "1");
|
|
|
+ }
|
|
|
} else if ("高新".equals(area)) {
|
|
|
- gaoxin.add(CommonUtil.divide(CommonUtil.divide(timeMinute, "60", 4), count, 2));
|
|
|
+ if (gaoxin.size() >= 6) {
|
|
|
+ gaoxin.set(5, CommonUtil.add(gaoxin.get(5), num));
|
|
|
+ } else {
|
|
|
+ gaoxin.add(5, num);
|
|
|
+ }
|
|
|
+ if (gaoxin.size() >= 7) {
|
|
|
+ gaoxin.set(6, CommonUtil.add(gaoxin.get(6), "1"));
|
|
|
+ } else {
|
|
|
+ gaoxin.add(6, "1");
|
|
|
+ }
|
|
|
}
|
|
|
- totalTimeMinute = CommonUtil.add(totalTimeMinute, timeMinute);
|
|
|
+ totalMonthChongfuTaici= CommonUtil.add(totalMonthChongfuTaici, num);
|
|
|
+ totalMonthChongfuTaishu = CommonUtil.add(totalMonthChongfuTaishu, "1");
|
|
|
}
|
|
|
- heji.add(CommonUtil.divide(CommonUtil.divide(totalTimeMinute, "60", 4), heji.get(2), 2));
|
|
|
+ heji.add(totalMonthChongfuTaici);
|
|
|
+ heji.add(totalMonthChongfuTaishu);
|
|
|
|
|
|
- // 没有数据的区域数值为0
|
|
|
- for (List<String> list : resList) {
|
|
|
- if (list.size() == 7) {
|
|
|
- list.add("0");
|
|
|
- }
|
|
|
+ // 环比
|
|
|
+ String huanbi = "0";
|
|
|
+ String huanbiBeginTime = DateUtil.dateAddMonth(rangeArray[1], -4); // 减四个月加一天
|
|
|
+ String huanbiEndTime = DateUtil.dateAddMonth(rangeArray[1], -2); // 减两个月
|
|
|
+ if (CommonUtil.isEmpty(timeRange)) {
|
|
|
+ huanbiBeginTime = huanbiBeginTime + "000000";
|
|
|
+ huanbiEndTime = huanbiEndTime + "235959";
|
|
|
+ } else {
|
|
|
+ String[] timeRangeArray = timeRange.split("-");
|
|
|
+ huanbiBeginTime = huanbiBeginTime + timeRangeArray[0];
|
|
|
+ huanbiEndTime = huanbiEndTime + timeRangeArray[1];
|
|
|
}
|
|
|
|
|
|
- List<Integer> shichangPaiming = new ArrayList<Integer>();
|
|
|
- // 平均停电频次排名,合计不参与排名
|
|
|
- for (int i = 1; i < resList.size() - 1; i ++) {
|
|
|
- String shichang = resList.get(i).get(7);
|
|
|
- // 排名
|
|
|
- int num = 1;
|
|
|
- for (int j = 1; j < resList.size() - 1; j ++) {
|
|
|
- // 不和本次作对比
|
|
|
- if (i != j) {
|
|
|
- String compareshichang = resList.get(j).get(7);
|
|
|
- // 不比对比频次大
|
|
|
- if (CommonUtil.compare(compareshichang, shichang) == -1) {
|
|
|
- num ++;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 相同次数的往后排
|
|
|
- while (shichangPaiming.contains(num)) {
|
|
|
- num ++;
|
|
|
- }
|
|
|
- shichangPaiming.add(num);
|
|
|
- resList.get(i).add(String.valueOf(num));
|
|
|
+ param.put("beginDay", huanbiBeginTime);
|
|
|
+ param.put("endDay", huanbiEndTime);
|
|
|
+ List<Map<String, String>> huanbiTwiceMonthCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
+ for (Map<String, String> map : huanbiTwiceMonthCountList) {
|
|
|
+ String num = map.get("num");
|
|
|
+ huanbi = CommonUtil.add(huanbi, num);
|
|
|
+ }
|
|
|
+ // 同比
|
|
|
+ String tongbi = "0";
|
|
|
+ String tongbiBeginTime = DateUtil.dateAddMonth(DateUtil.dateAddYear(rangeArray[1], -1), -2); // 减一年两个月
|
|
|
+ String tongbiEndTime = DateUtil.dateAddYear(rangeArray[1], -1); // 减一年
|
|
|
+ if (CommonUtil.isEmpty(timeRange)) {
|
|
|
+ tongbiBeginTime = tongbiBeginTime + "000000";
|
|
|
+ tongbiEndTime = tongbiEndTime + "235959";
|
|
|
+ } else {
|
|
|
+ String[] timeRangeArray = timeRange.split("-");
|
|
|
+ tongbiBeginTime = tongbiBeginTime + timeRangeArray[0];
|
|
|
+ tongbiEndTime = tongbiEndTime + timeRangeArray[1];
|
|
|
+ }
|
|
|
+
|
|
|
+ param.put("beginDay", tongbiBeginTime);
|
|
|
+ param.put("endDay", tongbiEndTime);
|
|
|
+ List<Map<String, String>> tongbiTwiceMonthCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
+ for (Map<String, String> map : tongbiTwiceMonthCountList) {
|
|
|
+ String num = map.get("num");
|
|
|
+ tongbi = CommonUtil.add(tongbi, num);
|
|
|
}
|
|
|
- heji.add("");
|
|
|
|
|
|
+ // 返回excel数据
|
|
|
+ resMap.put("excelList", resList);
|
|
|
|
|
|
- return resList;
|
|
|
+ // 描述数据
|
|
|
+ Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
+ dataMap.put("totalCount", totalCount);
|
|
|
+ dataMap.put("pingjun", CommonUtil.divide(totalHour, totalCount, 2));
|
|
|
+ dataMap.put("twiceCount", totalChongfu);
|
|
|
+ dataMap.put("dubanCount", totalMonthChongfuTaici);
|
|
|
+ // 环比
|
|
|
+ if (CommonUtil.compare(totalMonthChongfuTaici, huanbi) == 1) {
|
|
|
+ dataMap.put("huanbi", "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(totalMonthChongfuTaici, huanbi), huanbi, 4), "100", 2) + "%");
|
|
|
+ } else {
|
|
|
+ dataMap.put("huanbi", "减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(huanbi, totalMonthChongfuTaici), huanbi, 4), "100", 2) + "%");
|
|
|
+ }
|
|
|
+ // 同比
|
|
|
+ if (CommonUtil.compare(totalMonthChongfuTaici, tongbi) == 1) {
|
|
|
+ dataMap.put("tongbi", "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(totalMonthChongfuTaici, tongbi), tongbi, 4), "100", 2) + "%");
|
|
|
+ } else {
|
|
|
+ dataMap.put("tongbi", "减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tongbi, totalMonthChongfuTaici), tongbi, 4), "100", 2) + "%");
|
|
|
+ }
|
|
|
+ resMap.put("dataMap", dataMap);
|
|
|
+
|
|
|
+ String descStr = "<p>上周,台区累计停电${totalCount}台次,平均停电时长${pingjun}小时/台。停电两次及以上台区${twiceCount}个。</p>"
|
|
|
+ +"上周,督办频繁停电(两个月内三次及以上)共计${dubanCount}台次,环比${huanbi},同比${tongbi}。";
|
|
|
+ resMap.put("descStr", descStr);
|
|
|
+
|
|
|
+ return resMap;
|
|
|
}
|
|
|
|
|
|
|