|
|
@@ -53,14 +53,18 @@ public class TQTDReportAction implements IMINAction {
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
|
* @throws ParseException
|
|
|
- * @throws NumberFormatException
|
|
|
+ * @throws InvocationTargetException
|
|
|
+ * @throws IllegalArgumentException
|
|
|
+ * @throws IllegalAccessException
|
|
|
+ * @throws SecurityException
|
|
|
+ * @throws NoSuchMethodException
|
|
|
*/
|
|
|
@MINAction(value = REPORT_INF_CHUANTOU)
|
|
|
public MINActionResult reportInfChuantou(
|
|
|
@MINParam(key = "reportId") String reportId,
|
|
|
@MINParam(key = "chuantouType") String chuantouType,
|
|
|
MINSession session
|
|
|
- ) throws MINBusinessException, NumberFormatException, ParseException {
|
|
|
+ ) throws MINBusinessException, ParseException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
db = Service.lookup(IMINDataBaseService.class);
|
|
|
//分页
|
|
|
@@ -96,7 +100,14 @@ public class TQTDReportAction implements IMINAction {
|
|
|
param.put("endDay", dayIntervalArray[1]);
|
|
|
param.put("countNum", countNum);
|
|
|
List<Map<String, String>> mountCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
- res.set(IMINBusinessConstant.F_PAGING_LAY, mountCountList);
|
|
|
+ List<String> addressNumList = CommonUtil.getIdFromList(mountCountList, "addressNum");
|
|
|
+ DwFileDetail00Example example = new DwFileDetail00Example();
|
|
|
+ example.createCriteria().andAddressNumIn(addressNumList).andStartTimeGreaterThanOrEqualTo(beginDay).andEndTimeLessThanOrEqualTo(dayIntervalArray[1]);
|
|
|
+ example.setOrderByClause("DFD0_ADDRESS_NUM");
|
|
|
+ List<DwFileDetail00> selectByExample = db.selectByExample(DwFileDetail00Mapper.class, example);
|
|
|
+ selectByExample = Service.lookup(IFormatService.class).formatDate(selectByExample, "date");
|
|
|
+ selectByExample = Service.lookup(IFormatService.class).formatDateTime(selectByExample, "startTime", "endTime");
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, selectByExample);
|
|
|
// month个月停电count次及以上台区且昨日停电穿透
|
|
|
} else if ("TQTD03".equals(chuantouType)) {
|
|
|
String monthNum = reportInf.getTqtdMonth();
|
|
|
@@ -113,7 +124,15 @@ public class TQTDReportAction implements IMINAction {
|
|
|
param.put("yesterdayDetail", yesterdayList);
|
|
|
|
|
|
List<Map<String, String>> mountCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
- res.set(IMINBusinessConstant.F_PAGING_LAY, mountCountList);
|
|
|
+
|
|
|
+ List<String> addressNumList = CommonUtil.getIdFromList(mountCountList, "addressNum");
|
|
|
+ DwFileDetail00Example example = new DwFileDetail00Example();
|
|
|
+ example.createCriteria().andAddressNumIn(addressNumList).andStartTimeGreaterThanOrEqualTo(beginDay).andEndTimeLessThanOrEqualTo(dayIntervalArray[1]);
|
|
|
+ example.setOrderByClause("DFD0_ADDRESS_NUM");
|
|
|
+ List<DwFileDetail00> selectByExample = db.selectByExample(DwFileDetail00Mapper.class, example);
|
|
|
+ selectByExample = Service.lookup(IFormatService.class).formatDate(selectByExample, "date");
|
|
|
+ selectByExample = Service.lookup(IFormatService.class).formatDateTime(selectByExample, "startTime", "endTime");
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, selectByExample);
|
|
|
// 2个月停电1次及以上台区且昨日停电穿透
|
|
|
} else if ("TQTD04".equals(chuantouType)) {
|
|
|
String monthNum = "2";
|
|
|
@@ -130,7 +149,15 @@ public class TQTDReportAction implements IMINAction {
|
|
|
param.put("yesterdayDetail", yesterdayList);
|
|
|
|
|
|
List<Map<String, String>> mountCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
- res.set(IMINBusinessConstant.F_PAGING_LAY, mountCountList);
|
|
|
+
|
|
|
+ List<String> addressNumList = CommonUtil.getIdFromList(mountCountList, "addressNum");
|
|
|
+ DwFileDetail00Example example = new DwFileDetail00Example();
|
|
|
+ example.createCriteria().andAddressNumIn(addressNumList).andStartTimeGreaterThanOrEqualTo(beginDay).andEndTimeLessThanOrEqualTo(dayIntervalArray[1]);
|
|
|
+ example.setOrderByClause("DFD0_ADDRESS_NUM");
|
|
|
+ List<DwFileDetail00> selectByExample = db.selectByExample(DwFileDetail00Mapper.class, example);
|
|
|
+ selectByExample = Service.lookup(IFormatService.class).formatDate(selectByExample, "date");
|
|
|
+ selectByExample = Service.lookup(IFormatService.class).formatDateTime(selectByExample, "startTime", "endTime");
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, selectByExample);
|
|
|
// 台区停电时户数
|
|
|
} else if ("TQTD05".equals(chuantouType)) {
|
|
|
List<Map<String, String>> fileList00 = db.getMybatisMapper(ReportServiceMapper.class).selectReportType00(param);
|
|
|
@@ -203,12 +230,17 @@ public class TQTDReportAction implements IMINAction {
|
|
|
int i = 0;
|
|
|
String addressNumFlag = null;
|
|
|
List<Map<String, String>> excelList = new ArrayList<Map<String,String>>();
|
|
|
- for (DwFileDetail00 dwFileDetail00 : fileDetail00List) {
|
|
|
+ for (int j = 0; j < fileDetail00List.size(); j ++) {
|
|
|
+ DwFileDetail00 dwFileDetail00 = fileDetail00List.get(j);
|
|
|
// 与上一条数据是否相同
|
|
|
if (!dwFileDetail00.getAddressNum().equals(addressNumFlag) && addressNumFlag != null) {
|
|
|
- Map<String, String> excelMap = new HashMap<String, String>();
|
|
|
+ /*Map<String, String> excelMap = new HashMap<String, String>();
|
|
|
excelMap.put("shichang", String.valueOf(i));
|
|
|
- excelList.add(excelMap);
|
|
|
+ excelList.add(excelMap);*/
|
|
|
+ for (int k = 0; k < i; k ++) {
|
|
|
+ Map<String, String> map = excelList.get(j - 1 - k);
|
|
|
+ map.put("cishu", String.valueOf(i));
|
|
|
+ }
|
|
|
i = 0;
|
|
|
}
|
|
|
Map<String, String> excelMap = new HashMap<String, String>();
|
|
|
@@ -241,7 +273,7 @@ public class TQTDReportAction implements IMINAction {
|
|
|
|
|
|
OutputStream out=null;
|
|
|
try {
|
|
|
- String[] excelHeader = {"台区名称#addressName","数据日期#date","台区编号#addressNum","单位#area","单位名称#comonpanyName","终端名称#terminalName","终端编号#terminalNum","终端地址码#terminalAddress","停电时间#startTime","来电时间#endTime","时长#shichang"};
|
|
|
+ String[] excelHeader = {"台区名称#addressName","数据日期#date","台区编号#addressNum","单位#area","单位名称#comonpanyName","终端名称#terminalName","终端编号#terminalNum","终端地址码#terminalAddress","停电时间#startTime","来电时间#endTime","时长#shichang","停电次数#cishu"};
|
|
|
out = response.getOutputStream();
|
|
|
HSSFWorkbook wb = ExportExcelUtil.export(response, reportInf.getFileName(), excelHeader, excelList);
|
|
|
if(wb != null){
|