|
@@ -1,6 +1,7 @@
|
|
|
package com.minpay.common.service.impl;
|
|
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
import java.text.ParseException;
|
|
|
import java.util.ArrayList;
|
|
@@ -10,16 +11,21 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import org.apache.commons.fileupload.FileItem;
|
|
|
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
|
+
|
|
|
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.common.util.FilesUtil;
|
|
|
import com.minpay.db.table.mapper.DwDdyFxbDetailMapper;
|
|
|
import com.minpay.db.table.mapper.DwDdyFxbMapper;
|
|
|
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.DwFileDetail07Mapper;
|
|
|
+import com.minpay.db.table.mapper.DwReportDataMapper;
|
|
|
import com.minpay.db.table.mapper.DwReportInfMapper;
|
|
|
import com.minpay.db.table.mapper.PubAppparMapper;
|
|
|
import com.minpay.db.table.model.DwDdyFxb;
|
|
@@ -34,16 +40,20 @@ import com.minpay.db.table.model.DwFileDetail04;
|
|
|
import com.minpay.db.table.model.DwFileDetail04Example;
|
|
|
import com.minpay.db.table.model.DwFileDetail07;
|
|
|
import com.minpay.db.table.model.DwFileDetail07Example;
|
|
|
+import com.minpay.db.table.model.DwReportData;
|
|
|
import com.minpay.db.table.model.DwReportInf;
|
|
|
import com.minpay.db.table.model.PubApppar;
|
|
|
import com.minpay.db.table.model.PubAppparExample;
|
|
|
import com.minpay.db.table.own.mapper.ReportServiceMapper;
|
|
|
+import com.startup.minpay.frame.business.MINHttpServletRequestContext;
|
|
|
import com.startup.minpay.frame.exception.MINBusinessException;
|
|
|
import com.startup.minpay.frame.jdbc.MINRowBounds;
|
|
|
import com.startup.minpay.frame.service.base.IMINDataBaseService;
|
|
|
import com.startup.minpay.frame.service.base.Service;
|
|
|
import com.startup.minpay.frame.target.MINComponent;
|
|
|
|
|
|
+import net.sf.json.JSONArray;
|
|
|
+
|
|
|
|
|
|
@MINComponent
|
|
|
public class ReportServiceImpl implements IReportService {
|
|
@@ -121,23 +131,24 @@ public class ReportServiceImpl implements IReportService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> reportNeedDetail(Map<String, String> param)
|
|
|
- throws MINBusinessException, ParseException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
|
|
|
- String range = param.get("range");
|
|
|
- String timeRange = param.get("timeRange");
|
|
|
- String reportTypeId = param.get("reportTypeId");
|
|
|
- String firstFileId = param.get("firstFileId");
|
|
|
- String secondFileId = param.get("secondFileId");
|
|
|
- String FADateRange = param.get("FADateRange");
|
|
|
- String yearChoose = param.get("yearChoose");
|
|
|
- String DdyDateRange = param.get("DdyDateRange");
|
|
|
- String ddyFxbId = param.get("ddyFxbId");
|
|
|
+ public Map<String, Object> reportNeedDetail(Map<String, Object> param)
|
|
|
+ throws MINBusinessException, ParseException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InvalidFormatException, IOException {
|
|
|
+ String range = (String)param.get("range");
|
|
|
+ String timeRange = (String)param.get("timeRange");
|
|
|
+ String reportTypeId = (String)param.get("reportTypeId");
|
|
|
+ String firstFileId = (String)param.get("firstFileId");
|
|
|
+ String secondFileId = (String)param.get("secondFileId");
|
|
|
+ String FADateRange = (String)param.get("FADateRange");
|
|
|
+ String yearChoose = (String)param.get("yearChoose");
|
|
|
+ String DdyDateRange = (String)param.get("DdyDateRange");
|
|
|
+ String ddyFxbId = (String)param.get("ddyFxbId");
|
|
|
+ MINHttpServletRequestContext request = (MINHttpServletRequestContext)param.get("request");
|
|
|
|
|
|
Map<String, Object> resMap = new HashMap<String, Object>();
|
|
|
// 台区停电日报
|
|
|
if (Constant.REPORT_TYPE_00.equals(reportTypeId)) {
|
|
|
- String monthNum = param.get("monthNum");
|
|
|
- String countNum = param.get("countNum");
|
|
|
+ String monthNum = (String)param.get("monthNum");
|
|
|
+ String countNum = (String)param.get("countNum");
|
|
|
|
|
|
List<List<String>> resList = reportTypeTQTDRB(range, timeRange, monthNum, countNum);
|
|
|
resMap.put("resList", resList);
|
|
@@ -187,8 +198,13 @@ public class ReportServiceImpl implements IReportService {
|
|
|
// 低电压月报
|
|
|
} else if (Constant.REPORT_TYPE_13.equals(reportTypeId)) {
|
|
|
return reportTypeDDYYB(ddyFxbId);
|
|
|
- }else if (Constant.REPORT_TYPE_14.equals(reportTypeId)) {
|
|
|
+ // 计停非计停周报
|
|
|
+ } else if (Constant.REPORT_TYPE_14.equals(reportTypeId)) {
|
|
|
return reportTypeJTFJTRB(range,timeRange);
|
|
|
+ // 终端投退运报表II
|
|
|
+ } else if (Constant.REPORT_TYPE_15.equals(reportTypeId)) {
|
|
|
+ List<List<String>> resList = reportTypeZDDTYBBII(firstFileId, request);
|
|
|
+ resMap.put("resList", resList);
|
|
|
}
|
|
|
return resMap;
|
|
|
}
|
|
@@ -705,7 +721,7 @@ public class ReportServiceImpl implements IReportService {
|
|
|
|
|
|
// 没有数据的区域数值为0
|
|
|
for (List<String> list : resList) {
|
|
|
- if (list.size() == 4) {
|
|
|
+ if (list.size() == 3) {
|
|
|
list.add("0");
|
|
|
list.add("0");
|
|
|
}
|
|
@@ -946,21 +962,31 @@ public class ReportServiceImpl implements IReportService {
|
|
|
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) + "%");
|
|
|
+ if (CommonUtil.compare(huanbi, "0") != 0) {
|
|
|
+ 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) + "%");
|
|
|
+ }
|
|
|
} else {
|
|
|
- dataMap.put("huanbi", "环比减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(huanbi, totalMonthChongfuTaici), huanbi, 4), "100", 2) + "%");
|
|
|
+ dataMap.put("huanbi", "");
|
|
|
}
|
|
|
+
|
|
|
// 同比
|
|
|
- if (CommonUtil.compare(totalMonthChongfuTaici, tongbi) == 1) {
|
|
|
- if (CommonUtil.compare(tongbi, "0") == 0) {
|
|
|
- dataMap.put("tongbi", "");
|
|
|
+ if (CommonUtil.compare(tongbi, "0") != 0) {
|
|
|
+ if (CommonUtil.compare(totalMonthChongfuTaici, tongbi) == 1) {
|
|
|
+ if (CommonUtil.compare(tongbi, "0") == 0) {
|
|
|
+ dataMap.put("tongbi", "");
|
|
|
+ } else {
|
|
|
+ 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(totalMonthChongfuTaici, tongbi), tongbi, 4), "100", 2) + "%");
|
|
|
+ dataMap.put("tongbi", "同比减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tongbi, totalMonthChongfuTaici), tongbi, 4), "100", 2) + "%");
|
|
|
}
|
|
|
} else {
|
|
|
- dataMap.put("tongbi", "同比减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tongbi, totalMonthChongfuTaici), tongbi, 4), "100", 2) + "%");
|
|
|
+ dataMap.put("tongbi", "");
|
|
|
}
|
|
|
+
|
|
|
resMap.put("dataMap", dataMap);
|
|
|
|
|
|
String descStr = "<p>上周,台区累计停电${totalCount}台次,平均停电时长${pingjun}小时/台。停电两次及以上台区${twiceCount}个。</p>"
|
|
@@ -1064,20 +1090,24 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
|
|
|
// 同比描述
|
|
|
- String tongbi = null;
|
|
|
- if (CommonUtil.compare(benyueCount, tbCount) == 1) {
|
|
|
- tongbi = "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(benyueCount, tbCount), tbCount,4), "100", 2) + "%";
|
|
|
- } else {
|
|
|
- tongbi = "减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tbCount, benyueCount), tbCount,4), "100", 2) + "%";
|
|
|
+ String tongbi = "";
|
|
|
+ if (CommonUtil.compare(tbCount, "0") != 0) {
|
|
|
+ if (CommonUtil.compare(benyueCount, tbCount) == 1) {
|
|
|
+ tongbi = "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(benyueCount, tbCount), tbCount,4), "100", 2) + "%";
|
|
|
+ } else {
|
|
|
+ tongbi = "减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tbCount, benyueCount), tbCount,4), "100", 2) + "%";
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
// 环比描述
|
|
|
- String huanbi = null;
|
|
|
- if (CommonUtil.compare(benyueCount, hbCount) == 1) {
|
|
|
- huanbi = "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(benyueCount, hbCount), hbCount,4), "100", 2) + "%";
|
|
|
- } else {
|
|
|
- huanbi = "减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(hbCount, benyueCount), hbCount,4), "100", 2) + "%";
|
|
|
+ String huanbi = "";
|
|
|
+ if (CommonUtil.compare(hbCount, "0") != 0) {
|
|
|
+ if (CommonUtil.compare(benyueCount, hbCount) == 1) {
|
|
|
+ huanbi = "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(benyueCount, hbCount), hbCount,4), "100", 2) + "%";
|
|
|
+ } else {
|
|
|
+ huanbi = "减少" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(hbCount, benyueCount), hbCount,4), "100", 2) + "%";
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
int shejiNum = areaCountList.size();
|
|
|
String shejiDesc = "";
|
|
|
for (int i = 0; i < areaCountList.size(); i++) {
|
|
@@ -1109,18 +1139,23 @@ public class ReportServiceImpl implements IReportService {
|
|
|
// 平均时长
|
|
|
String pingjunHour = CommonUtil.divide(benyueTime, totalCount, 2);
|
|
|
// 同比数据
|
|
|
- String tongbiPingjunHour = null;
|
|
|
- if (CommonUtil.compare(benyueTime, tbTime) == 1) {
|
|
|
- tongbiPingjunHour = "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(benyueTime, tbTime), tbTime, 4), "100", 2)+"%";
|
|
|
- } else {
|
|
|
- tongbiPingjunHour = "下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tbTime, benyueTime), tbTime, 4), "100", 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)+"%";
|
|
|
+ } else {
|
|
|
+ tongbiPingjunHour = "下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(tbTime, benyueTime), tbTime, 4), "100", 2)+"%";
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
// 环比数据
|
|
|
- String huanbiPingjunHour = null;
|
|
|
- if (CommonUtil.compare(benyueTime, hbTime) == 1) {
|
|
|
- huanbiPingjunHour = "增加" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(benyueTime, hbTime), hbTime, 4), "100", 2)+"%";
|
|
|
- } else {
|
|
|
- huanbiPingjunHour = "下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(hbTime, benyueTime), hbTime, 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)+"%";
|
|
|
+ } else {
|
|
|
+ huanbiPingjunHour = "下降" + CommonUtil.multiply(CommonUtil.divide(CommonUtil.subtract(hbTime, benyueTime), hbTime, 4), "100", 2)+"%";
|
|
|
+ }
|
|
|
}
|
|
|
// 台区平均停电时长描述
|
|
|
String areaPingjunDesc = "";
|
|
@@ -1288,13 +1323,6 @@ public class ReportServiceImpl implements IReportService {
|
|
|
List<String> titleList = new ArrayList<String>();
|
|
|
titleList.add("ID");
|
|
|
titleList.add("TNAME");
|
|
|
- titleList.add("CMODE");
|
|
|
- titleList.add("VALUE");
|
|
|
- titleList.add("facname");
|
|
|
- titleList.add("type");
|
|
|
- titleList.add("fdid");
|
|
|
- titleList.add("yxstatus");
|
|
|
- titleList.add("tytime");
|
|
|
titleList.add("SRC");
|
|
|
resList.add(titleList);
|
|
|
|
|
@@ -1321,13 +1349,6 @@ public class ReportServiceImpl implements IReportService {
|
|
|
List<String> resChildList = new ArrayList<String>();
|
|
|
resChildList.add(first.getExcelId());
|
|
|
resChildList.add(first.getExcelTname());
|
|
|
- resChildList.add(first.getExcelCmode());
|
|
|
- resChildList.add(first.getExcelValue());
|
|
|
- resChildList.add(first.getExcelFacname());
|
|
|
- resChildList.add(first.getExcelFdid());
|
|
|
- resChildList.add(first.getExcelType());
|
|
|
- resChildList.add(first.getExcelYxstatus());
|
|
|
- resChildList.add(first.getExcelTytime());
|
|
|
resChildList.add("退出");
|
|
|
resList.add(resChildList);
|
|
|
}
|
|
@@ -1346,13 +1367,6 @@ public class ReportServiceImpl implements IReportService {
|
|
|
List<String> resChildList = new ArrayList<String>();
|
|
|
resChildList.add(second.getExcelId());
|
|
|
resChildList.add(second.getExcelTname());
|
|
|
- resChildList.add(second.getExcelCmode());
|
|
|
- resChildList.add(second.getExcelValue());
|
|
|
- resChildList.add(second.getExcelFacname());
|
|
|
- resChildList.add(second.getExcelFdid());
|
|
|
- resChildList.add(second.getExcelType());
|
|
|
- resChildList.add(second.getExcelYxstatus());
|
|
|
- resChildList.add(second.getExcelTytime());
|
|
|
resChildList.add("投入");
|
|
|
resList.add(resChildList);
|
|
|
}
|
|
@@ -2477,6 +2491,8 @@ public class ReportServiceImpl implements IReportService {
|
|
|
|
|
|
// 全年累计考核数
|
|
|
Map<String, Object> param = new HashMap<String, Object>();
|
|
|
+ param.put("reportId", ddyFxbId);
|
|
|
+
|
|
|
param.put("beginTime", yearBegin);
|
|
|
param.put("endTime", weekEnd);
|
|
|
List<Map<String, String>> yearTotal = db.getMybatisMapper(ReportServiceMapper.class).selectDetail03ByDDYRB(param, new MINRowBounds());
|
|
@@ -2554,14 +2570,76 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 正在治理用户
|
|
|
+ // 正在治理用户数
|
|
|
+ String zzliNum = db.getMybatisMapper(ReportServiceMapper.class).selectDdyFxbZZZL(param).get("num");
|
|
|
+ // 治理后再次出现
|
|
|
+ List<Map<String, String>> zlhzccxList = db.getMybatisMapper(ReportServiceMapper.class).selectDdyFxbZlhzccx(param);
|
|
|
+ String zlhzccxNum = "0";
|
|
|
+ String zlhzccxDesc = "";
|
|
|
+ for (int i = 0; i < zlhzccxList.size(); i ++) {
|
|
|
+ Map<String, String> map = zlhzccxList.get(i);
|
|
|
+ String area = map.get("area").substring(0, 2);
|
|
|
+ String num = map.get("num");
|
|
|
+ if ("新泰".equals(area)) {
|
|
|
+ } else if ("高新".equals(area)) {
|
|
|
+ } else if ("岱岳".equals(area)) {
|
|
|
+ } else if ("泰山".equals(area)) {
|
|
|
+ } else if ("宁阳".equals(area)) {
|
|
|
+ } else if ("东平".equals(area)) {
|
|
|
+ } else if ("景区".equals(area)) {
|
|
|
+ } else if ("肥城".equals(area)) {
|
|
|
+ } else {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ zlhzccxNum = CommonUtil.add(zlhzccxNum, num);
|
|
|
+ // 最后一条数据
|
|
|
+ if (i == zlhzccxList.size() - 1) {
|
|
|
+ zlhzccxDesc += area + num + "户;";
|
|
|
+ } else {
|
|
|
+ zlhzccxDesc += area + num + "户,";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 未开始治理用户区域分组
|
|
|
+ List<Map<String, String>> wkszlList = db.getMybatisMapper(ReportServiceMapper.class).selectDdyFxbWKSZL(param);
|
|
|
+ String wkszlNum = "0";
|
|
|
+ String wkszlDesc = "";
|
|
|
+ for (int i = 0; i < wkszlList.size(); i ++) {
|
|
|
+ Map<String, String> map = wkszlList.get(i);
|
|
|
+ String area = map.get("area").substring(0, 2);
|
|
|
+ String num = map.get("num");
|
|
|
+ if ("新泰".equals(area)) {
|
|
|
+ } else if ("高新".equals(area)) {
|
|
|
+ } else if ("岱岳".equals(area)) {
|
|
|
+ } else if ("泰山".equals(area)) {
|
|
|
+ } else if ("宁阳".equals(area)) {
|
|
|
+ } else if ("东平".equals(area)) {
|
|
|
+ } else if ("景区".equals(area)) {
|
|
|
+ } else if ("肥城".equals(area)) {
|
|
|
+ } else {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ wkszlNum = CommonUtil.add(wkszlNum, num);
|
|
|
+ // 最后一条数据
|
|
|
+ if (i == wkszlList.size() - 1) {
|
|
|
+ wkszlDesc += area + num + "户。";
|
|
|
+ } else {
|
|
|
+ wkszlDesc += area + num + "户,";
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- String desc = "本月新增受考核低电压客户${benyueXZ}户,其中本周新增${benzhouXZ}户,按单位分${danweiDesc}截至目前未治理完成150户,141户正在治理;3户治理后再次出现,其中新泰、泰山、高新各1户;6户未开始治理,其中景区4户,高新2户。";
|
|
|
+ String wzlwcNum = CommonUtil.add(CommonUtil.add(zzliNum, zlhzccxNum), wkszlNum);
|
|
|
+ String desc = "本月新增受考核低电压客户${benyueXZ}户,其中本周新增${benzhouXZ}户,按单位分${danweiDesc}截至目前未治理完成${wzlwcNum}户,${zzliNum}户正在治理;${zlhzccxNum}户治理后再次出现,${zlhzccxDesc}${wkszlNum}户未开始治理,${wkszlDesc}";
|
|
|
|
|
|
Map<String, String> reportMap = new HashMap<String, String>();
|
|
|
reportMap.put("benyueXZ", String.valueOf(benyueXZ));
|
|
|
reportMap.put("benzhouXZ", String.valueOf(benzhouXZ));
|
|
|
reportMap.put("danweiDesc", danweiDesc);
|
|
|
+ reportMap.put("wzlwcNum", wzlwcNum);
|
|
|
+ reportMap.put("zzliNum", zzliNum);
|
|
|
+ reportMap.put("zlhzccxNum", zlhzccxNum);
|
|
|
+ reportMap.put("zlhzccxDesc", zlhzccxDesc);
|
|
|
+ reportMap.put("wkszlNum", wkszlNum);
|
|
|
+ reportMap.put("wkszlDesc", wkszlDesc);
|
|
|
resMap.put("reportMap", reportMap);
|
|
|
resMap.put("descStr", desc);
|
|
|
|
|
@@ -3014,7 +3092,12 @@ public class ReportServiceImpl implements IReportService {
|
|
|
}
|
|
|
kaoheZlNum = CommonUtil.add(kaoheZlNum, num);
|
|
|
}
|
|
|
- String kaoheZlNumLv = CommonUtil.multiply(CommonUtil.divide(kaoheZlNum, kaoheNum, 4), "100", 2);
|
|
|
+
|
|
|
+ String kaoheZlNumLv = "0";
|
|
|
+ if (CommonUtil.compare(kaoheNum, "0") != 0) {
|
|
|
+ kaoheZlNumLv = CommonUtil.multiply(CommonUtil.divide(kaoheZlNum, kaoheNum, 4), "100", 2);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
String desc1 = "<p>1.用户低电压情况</p>" +
|
|
|
"<p>(1)总体情况(说明:用户电压低于198伏且持续超过1小时为低电压)</p>" +
|
|
@@ -3755,4 +3838,51 @@ public class ReportServiceImpl implements IReportService {
|
|
|
resMap.put("descStr", descStr);
|
|
|
return resMap;
|
|
|
}
|
|
|
+
|
|
|
+ public List<List<String>> reportTypeZDDTYBBII(String firstFileId, MINHttpServletRequestContext request) throws MINBusinessException, InvalidFormatException, IOException{
|
|
|
+ IMINDataBaseService db = Service.lookup(IMINDataBaseService.class);
|
|
|
+ List<List<String>> resList = new ArrayList<List<String>>();
|
|
|
+
|
|
|
+ List<String> titleList = new ArrayList<String>();
|
|
|
+ titleList.add("ID");
|
|
|
+ titleList.add("TNAME");
|
|
|
+ titleList.add("SRC");
|
|
|
+ resList.add(titleList);
|
|
|
+
|
|
|
+ // 选择文件
|
|
|
+ DwReportData reportData = db.selectByPrimaryKey(DwReportDataMapper.class, firstFileId);
|
|
|
+ String jsonArrayStr = reportData.getData();
|
|
|
+ JSONArray array = JSONArray.fromObject(jsonArrayStr);
|
|
|
+ // 对比文件
|
|
|
+ // 获取文件
|
|
|
+ FileItem fileItem = request.getFile("file");
|
|
|
+ String fileName = fileItem.getName();
|
|
|
+ if (!fileName.endsWith(".xlsx") && !fileName.endsWith(".xls")) {
|
|
|
+ throw new MINBusinessException("文件格式错误!");
|
|
|
+ }
|
|
|
+ String[] titleKey = new String[]{"gdbh","gdlx","gdfqsj","hjmc", "bdzmc","xlmc","gddw","zrdw","zrbz","ywmc","zdsbscmc","jhtysj","xttysj"};
|
|
|
+ List<Map<String, String>> secondList = FilesUtil.readExecleasy(fileItem, titleKey, 1);
|
|
|
+
|
|
|
+ for (Object first : array) {
|
|
|
+ List<String> child = (List<String>)first;
|
|
|
+ String tname = child.get(0);
|
|
|
+ String id = child.get(1);
|
|
|
+ boolean flag = false;
|
|
|
+ for (Map<String, String> second : secondList) {
|
|
|
+ String zdsbscmc = second.get("zdsbscmc");
|
|
|
+ if (tname.equals(zdsbscmc)) {
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!flag) {
|
|
|
+ List<String> resChildList = new ArrayList<String>();
|
|
|
+ resChildList.add(id);
|
|
|
+ resChildList.add(tname);
|
|
|
+ resChildList.add("投运");
|
|
|
+ resList.add(resChildList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return resList;
|
|
|
+ }
|
|
|
}
|