tudc 5 年之前
父节点
当前提交
447fa67f78

+ 41 - 9
src/main/java/com/minpay/reportManage/action/TQTDReportAction.java

@@ -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){

+ 1 - 1
src/main/resources/com/minpay/db/table/own/mapper/ReportServiceMapper.xml

@@ -24,7 +24,7 @@
 		    	and DFD0_START_TIME &gt; #{beginTime,jdbcType=VARCHAR}
 		   	</if>
 			<if test="endTime != null  and endTime != ''">
-		    	and DFD0_START_TIME &lt; #{endTime,jdbcType=VARCHAR}
+		    	and DFD0_END_TIME &lt; #{endTime,jdbcType=VARCHAR}
 		   	</if>
 		order by area
 	</select>

+ 30 - 12
src/main/webapp/admin/tqtd/reportManageDetailChuantou.html

@@ -34,26 +34,44 @@
 		} else if (chuantouType == "TQTD02") {
 			cols = [[ //表头
 						{field:'num', title: '序号', width:'5%', type:'numbers'}
-						,{field: 'area', title: '单位', width:'20%'}
-						,{field: 'addressNum', title: '台区编号', width:'20%'}
-						,{field: 'addressName', title: '台区名称', width:'20%'}
-						,{field: 'num', title: '停电次数', width: '20%'}
+						,{field: 'addressNum', title: '台区编号', width:'8%'}
+						,{field: 'addressName', title: '台区名称', width:'10%'}
+						,{field: 'date', title: '数据日期', width: '8%'}
+						,{field: 'area', title: '单位', width: '8%'}
+						,{field: 'comonpanyName', title: '供电所名称', width: '10%'}
+						,{field: 'terminalName', title: '终端名称', width: '10%'}
+						,{field: 'terminalNum', title: '终端编号', width: '8%'}
+						,{field: 'terminalAddress', title: '终端地址码', width: '10%'}
+						,{field: 'startTime', title: '停电时间', width: '10%'}
+						,{field: 'endTime', title: '来电时间', width: '10%'}
 					]];
 		} else if (chuantouType == "TQTD03") {
 			cols = [[ //表头
 						{field:'num', title: '序号', width:'5%', type:'numbers'}
-						,{field: 'area', title: '单位', width:'20%'}
-						,{field: 'addressNum', title: '台区编号', width:'20%'}
-						,{field: 'addressName', title: '台区名称', width:'20%'}
-						,{field: 'num', title: '停电次数', width: '20%'}
+						,{field: 'addressNum', title: '台区编号', width:'8%'}
+						,{field: 'addressName', title: '台区名称', width:'10%'}
+						,{field: 'date', title: '数据日期', width: '8%'}
+						,{field: 'area', title: '单位', width: '8%'}
+						,{field: 'comonpanyName', title: '供电所名称', width: '10%'}
+						,{field: 'terminalName', title: '终端名称', width: '10%'}
+						,{field: 'terminalNum', title: '终端编号', width: '8%'}
+						,{field: 'terminalAddress', title: '终端地址码', width: '10%'}
+						,{field: 'startTime', title: '停电时间', width: '10%'}
+						,{field: 'endTime', title: '来电时间', width: '10%'}
 					]];
 		} else if (chuantouType == "TQTD04") {
 			cols = [[ //表头
 						{field:'num', title: '序号', width:'5%', type:'numbers'}
-						,{field: 'area', title: '单位', width:'20%'}
-						,{field: 'addressNum', title: '台区编号', width:'20%'}
-						,{field: 'addressName', title: '台区名称', width:'20%'}
-						,{field: 'num', title: '停电次数', width: '20%'}
+						,{field: 'addressNum', title: '台区编号', width:'8%'}
+						,{field: 'addressName', title: '台区名称', width:'10%'}
+						,{field: 'date', title: '数据日期', width: '8%'}
+						,{field: 'area', title: '单位', width: '8%'}
+						,{field: 'comonpanyName', title: '供电所名称', width: '10%'}
+						,{field: 'terminalName', title: '终端名称', width: '10%'}
+						,{field: 'terminalNum', title: '终端编号', width: '8%'}
+						,{field: 'terminalAddress', title: '终端地址码', width: '10%'}
+						,{field: 'startTime', title: '停电时间', width: '10%'}
+						,{field: 'endTime', title: '来电时间', width: '10%'}
 					]];
 		} else if (chuantouType == "TQTD05") {
 			cols = [[ //表头

+ 5 - 5
src/main/webapp/admin/tqtd/reportManageDetailTqtd.html

@@ -104,17 +104,17 @@
 				if ((j == excelChildList.length - 1)) {
 					// 台区停电次数
 					if (i == 2) {
-						html += '<td style="cursor: pointer" onclick="tqtd0()">' + excelChildList[j] + '</td>';
+						html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd0()" title = "查看详情">' + excelChildList[j] + '</td>';
 					} else if (i == 3) {
-						html += '<td style="cursor: pointer" onclick="tqtd4()">' + excelChildList[j] + '</td>';
+						html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd4()" title = "查看详情">' + excelChildList[j] + '</td>';
 					// 2个月停电3次及以上台区
 					} else if (i == 6) {
-						html += '<td style="cursor: pointer" onclick="tqtd1()">' + excelChildList[j] + '</td>';
+						html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd1()" title = "查看详情">' + excelChildList[j] + '</td>';
 					// 2个月停电3次及以上台区且昨日停电
 					} else if (i == 7) {
-						html += '<td style="cursor: pointer" onclick="tqtd2()">' + excelChildList[j] + '</td>';
+						html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd2()" title = "查看详情">' + excelChildList[j] + '</td>';
 					} else if (i == 8) {
-						html += '<td style="cursor: pointer" onclick="tqtd3()">' + excelChildList[j] + '</td>';
+						html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd3()" title = "查看详情">' + excelChildList[j] + '</td>';
 					} else {
 						html += '<td>' + excelChildList[j] + '</td>';
 					}