|
@@ -44,17 +44,17 @@ public class TQTDReportAction implements IMINAction {
|
|
|
private IMINDataBaseService db;
|
|
|
/** 台区停电日报穿透数据 */
|
|
|
public final static String REPORT_INF_CHUANTOU = "reportInfChuantou";
|
|
|
-
|
|
|
+
|
|
|
/** 台区停电月报附件 */
|
|
|
public final static String REPORT_INF_FUJIAN = "reportInfFujian";
|
|
|
-
|
|
|
+
|
|
|
/** 台区数量管理 */
|
|
|
public final static String AREA_NUM_MANAGE = "areaNumManage";
|
|
|
-
|
|
|
+
|
|
|
/** 台区数量编辑 */
|
|
|
public final static String AREA_NUM_UPDATE = "areaNumUpdate";
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 台区停电穿透数据
|
|
|
* @param reportId 报表id
|
|
@@ -62,12 +62,12 @@ public class TQTDReportAction implements IMINAction {
|
|
|
* @param session
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
|
- * @throws ParseException
|
|
|
- * @throws InvocationTargetException
|
|
|
- * @throws IllegalArgumentException
|
|
|
- * @throws IllegalAccessException
|
|
|
- * @throws SecurityException
|
|
|
- * @throws NoSuchMethodException
|
|
|
+ * @throws ParseException
|
|
|
+ * @throws InvocationTargetException
|
|
|
+ * @throws IllegalArgumentException
|
|
|
+ * @throws IllegalAccessException
|
|
|
+ * @throws SecurityException
|
|
|
+ * @throws NoSuchMethodException
|
|
|
*/
|
|
|
@MINAction(value = REPORT_INF_CHUANTOU)
|
|
|
public MINActionResult reportInfChuantou(
|
|
@@ -90,10 +90,10 @@ public class TQTDReportAction implements IMINAction {
|
|
|
String[] timeIntervalArray = timeInterval.split("-");
|
|
|
String beginTime = dayIntervalArray[0] + timeIntervalArray[0];
|
|
|
String endTime = dayIntervalArray[1] + timeIntervalArray[1];
|
|
|
-
|
|
|
+
|
|
|
param.put("beginTime", beginTime);
|
|
|
param.put("endTime", endTime);
|
|
|
-
|
|
|
+
|
|
|
// 台区次数穿透数据
|
|
|
if ("TQTD01".equals(chuantouType)) {
|
|
|
List<Map<String, String>> fileList00 = db.getMybatisMapper(ReportServiceMapper.class).selectReportType00(param);
|
|
@@ -130,19 +130,24 @@ public class TQTDReportAction implements IMINAction {
|
|
|
param.put("beginDay", beginDay + timeIntervalArray[0]);
|
|
|
param.put("endDay", dayIntervalArray[1] + timeIntervalArray[1]);
|
|
|
param.put("countNum", countNum);
|
|
|
-
|
|
|
+
|
|
|
// 查询当日停电的数据
|
|
|
param.put("yesterday", dayIntervalArray[1]);
|
|
|
List<Map<String, String>> yesterdayList = db.getMybatisMapper(ReportServiceMapper.class).queryYesterdayDetail(param);
|
|
|
param.put("yesterdayDetail", yesterdayList);
|
|
|
-
|
|
|
+
|
|
|
List<Map<String, String>> mountCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
if (mountCountList.size() == 0) {
|
|
|
return res;
|
|
|
}
|
|
|
List<String> addressNumList = CommonUtil.getIdFromList(mountCountList, "addressNum");
|
|
|
DwFileDetail00Example example = new DwFileDetail00Example();
|
|
|
- example.createCriteria().andAddressNumIn(addressNumList).andStartTimeGreaterThanOrEqualTo(beginDay + timeIntervalArray[0]).andEndTimeLessThanOrEqualTo(dayIntervalArray[1] + timeIntervalArray[1]);
|
|
|
+ example.createCriteria().andAddressNumIn(addressNumList)
|
|
|
+ //TODO 暂时改为只查当天的
|
|
|
+// .andStartTimeGreaterThanOrEqualTo(beginDay + timeIntervalArray[0])
|
|
|
+ .andStartTimeGreaterThanOrEqualTo(dayIntervalArray[1] + timeIntervalArray[0])
|
|
|
+ .andEndTimeLessThanOrEqualTo(dayIntervalArray[1] + timeIntervalArray[1])
|
|
|
+ ;
|
|
|
example.setOrderByClause("DFD0_ADDRESS_NUM");
|
|
|
List<DwFileDetail00> selectByExample = db.selectByExample(DwFileDetail00Mapper.class, example);
|
|
|
selectByExample = Service.lookup(IFormatService.class).formatDate(selectByExample, "date");
|
|
@@ -157,15 +162,15 @@ public class TQTDReportAction implements IMINAction {
|
|
|
param.put("beginDay", beginDay + timeIntervalArray[0]);
|
|
|
param.put("endDay", dayIntervalArray[1] + timeIntervalArray[1]);
|
|
|
param.put("countNum", countNum);
|
|
|
-
|
|
|
+
|
|
|
// 查询当日停电的数据
|
|
|
param.put("yesterday", dayIntervalArray[1]);
|
|
|
List<Map<String, String>> yesterdayList = db.getMybatisMapper(ReportServiceMapper.class).queryYesterdayDetail(param);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
param.put("yesterdayDetail", yesterdayList);
|
|
|
-
|
|
|
+
|
|
|
List<Map<String, String>> mountCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount01(param);
|
|
|
if (mountCountList.size() == 0) {
|
|
|
return res;
|
|
@@ -184,7 +189,7 @@ public class TQTDReportAction implements IMINAction {
|
|
|
fileList00 = Service.lookup(IFormatService.class).formatDate(fileList00, "date");
|
|
|
fileList00 = Service.lookup(IFormatService.class).formatDateTime(fileList00, "startTime", "endTime");
|
|
|
res.set(IMINBusinessConstant.F_PAGING_LAY, fileList00);
|
|
|
- // 2个月停电1次台区且当日停电穿透
|
|
|
+ // 2个月停电1次台区且当日停电穿透
|
|
|
}else if ("TQTD06".equals(chuantouType)) {
|
|
|
String monthNum = "2";
|
|
|
String countNum = "1";
|
|
@@ -193,7 +198,7 @@ public class TQTDReportAction implements IMINAction {
|
|
|
param.put("beginDay", beginDay + timeIntervalArray[0]);
|
|
|
param.put("endDay", dayIntervalArray[1] + timeIntervalArray[1]);
|
|
|
param.put("countNum", countNum);
|
|
|
-
|
|
|
+
|
|
|
// 查询当日停电的数据
|
|
|
param.put("yesterday", dayIntervalArray[1]);
|
|
|
List<Map<String, String>> yesterdayList = db.getMybatisMapper(ReportServiceMapper.class).queryYesterdayDetail(param);
|
|
@@ -201,9 +206,9 @@ public class TQTDReportAction implements IMINAction {
|
|
|
return res;
|
|
|
}
|
|
|
param.put("yesterdayDetail", yesterdayList);
|
|
|
-
|
|
|
+
|
|
|
// List<Map<String, String>> mountCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount01(param);
|
|
|
-
|
|
|
+
|
|
|
List<String> addressNumList = CommonUtil.getIdFromList(yesterdayList, "addressNum");
|
|
|
DwFileDetail00Example example = new DwFileDetail00Example();
|
|
|
example.createCriteria().andAddressNumIn(addressNumList).andStartTimeGreaterThanOrEqualTo(beginDay + timeIntervalArray[0]).andEndTimeLessThanOrEqualTo(dayIntervalArray[1] + timeIntervalArray[1]);
|
|
@@ -213,10 +218,10 @@ public class TQTDReportAction implements IMINAction {
|
|
|
selectByExample = Service.lookup(IFormatService.class).formatDateTime(selectByExample, "startTime", "endTime");
|
|
|
res.set(IMINBusinessConstant.F_PAGING_LAY, selectByExample);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 台区停电附件导出
|
|
|
* @param reportId
|
|
@@ -258,17 +263,17 @@ public class TQTDReportAction implements IMINAction {
|
|
|
beginTime = rangeArray[0] + timeRangeArray[0];
|
|
|
endTime = rangeArray[1] + timeRangeArray[1];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Map<String, Object> param = new HashMap<String, Object>();
|
|
|
param.put("beginTime", beginTime);
|
|
|
param.put("endTime", endTime);
|
|
|
-
|
|
|
+
|
|
|
String beginDay = DateUtil.dateAddMonth(rangeArray[1], Integer.parseInt("-2"));
|
|
|
param.put("beginDay", beginDay);
|
|
|
param.put("endDay", rangeArray[1]);
|
|
|
param.put("countNum", "3");
|
|
|
List<Map<String, String>> mountCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
|
|
|
-
|
|
|
+
|
|
|
List<String> addressNumList = CommonUtil.getIdFromList(mountCountList, "addressNum");
|
|
|
DwFileDetail00Example fileDetail00Example = new DwFileDetail00Example();
|
|
|
fileDetail00Example.createCriteria().andAddressNumIn(addressNumList)
|
|
@@ -311,14 +316,14 @@ public class TQTDReportAction implements IMINAction {
|
|
|
addressNumFlag = dwFileDetail00.getAddressNum();
|
|
|
i ++;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Map<String, String> excelMap = new HashMap<String, String>();
|
|
|
excelMap.put("shichang", String.valueOf(i));
|
|
|
excelList.add(excelMap);
|
|
|
-
|
|
|
+
|
|
|
// 格式化时间
|
|
|
excelList = Service.lookup(IFormatService.class).formatDateTime(excelList, "startTime", "endTime");
|
|
|
-
|
|
|
+
|
|
|
OutputStream out=null;
|
|
|
try {
|
|
|
String[] excelHeader = {"台区名称#addressName","数据日期#date","台区编号#addressNum","单位#area","单位名称#comonpanyName","终端名称#terminalName","终端编号#terminalNum","终端地址码#terminalAddress","停电时间#startTime","来电时间#endTime","时长#shichang","停电次数#cishu"};
|
|
@@ -332,10 +337,10 @@ public class TQTDReportAction implements IMINAction {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return response;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 台区数量管理
|
|
|
* @param session
|
|
@@ -356,12 +361,12 @@ public class TQTDReportAction implements IMINAction {
|
|
|
Map<String, String> resMap = new HashMap<String, String>();
|
|
|
resList.add(resMap);
|
|
|
String hejiNum = "0";
|
|
|
-
|
|
|
+
|
|
|
List<Map<String, Object>> col = new ArrayList<Map<String, Object>>();
|
|
|
for (PubApppar pub : appparList) {
|
|
|
resMap.put(pub.getValue(), pub.getShowmsg());
|
|
|
hejiNum = CommonUtil.add(hejiNum, pub.getShowmsg());
|
|
|
-
|
|
|
+
|
|
|
Map<String, Object> colMap = new HashMap<String, Object>();
|
|
|
colMap.put("field", pub.getValue());
|
|
|
colMap.put("title", pub.getValue());
|
|
@@ -377,7 +382,7 @@ public class TQTDReportAction implements IMINAction {
|
|
|
res.set("col", col);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@MINAction(value = AREA_NUM_UPDATE)
|
|
|
public MINActionResult areaNumUpdate(
|
|
|
@MINParam(key = "field") String field,
|
|
@@ -385,7 +390,7 @@ public class TQTDReportAction implements IMINAction {
|
|
|
MINSession session
|
|
|
) throws MINBusinessException {
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
-
|
|
|
+
|
|
|
String systemCode = Service.lookup(IReportService.class).getSystemCode();
|
|
|
// 修改数据库数据
|
|
|
db = Service.lookup(IMINDataBaseService.class);
|
|
@@ -394,10 +399,10 @@ public class TQTDReportAction implements IMINAction {
|
|
|
apppar.setValue(field);
|
|
|
apppar.setShowmsg(value);
|
|
|
db.updateByPrimaryKeySelective(PubAppparMapper.class, apppar);
|
|
|
-
|
|
|
+
|
|
|
// 更新值
|
|
|
Service.lookup(IReportService.class).reflush();
|
|
|
-
|
|
|
+
|
|
|
return res;
|
|
|
}
|
|
|
}
|