Pārlūkot izejas kodu

台区停电 增加停电一次穿透

郎学彬 4 gadi atpakaļ
vecāks
revīzija
4b969e209c

+ 31 - 3
src/main/java/com/minpay/common/service/impl/ReportServiceImpl.java

@@ -446,10 +446,10 @@ public class ReportServiceImpl implements IReportService {
 		childList7.add(yesterdayTaiQuMap.get("合计").toString());
 		resList.add(childList7);
 		
-		// 2个月停电1次及以上台区且昨日停电的台区数据  改为且当日停电
+		// 2个月停电2次台区且昨日停电的台区数据  改为且当日停电
 		beginDay = DateUtil.dateAddMonth(rangeArray[1], -2);
 		param.put("beginDay", beginDay + beginTime.substring(8, 14));
-		param.put("countNum", 1);
+		param.put("countNum", 2);
 		List<Map<String, String>> yiciData = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
 		
 		Map<String, Integer> yiciMap = new HashMap<String, Integer>();
@@ -467,13 +467,41 @@ public class ReportServiceImpl implements IReportService {
 			yiciMap.put("合计",yiciMap.get("合计") + 1);
 		}
 		List<String> childList8 = new ArrayList<String>();
-		childList8.add("2个月停电1次及以上台区且当日停电");
+		childList8.add("2个月停电2次台区且当日停电");
 		for (PubApppar apppar : appparList) {
 			childList8.add(yiciMap.get(apppar.getValue()).toString());
 		}
 		childList8.add(yiciMap.get("合计").toString());
 		resList.add(childList8);
+		// 2个月停电1次台区且昨日停电的台区数据  改为且当日停电
+		beginDay = DateUtil.dateAddMonth(rangeArray[1], -2);
+		param.put("beginDay", beginDay + beginTime.substring(8, 14));
+		param.put("countNum", 1);
+		List<Map<String, String>> yiciData00 = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
+		
+		Map<String, Integer> yici00Map = new HashMap<String, Integer>();
+		for (PubApppar apppar : appparList) {
+			yici00Map.put(apppar.getValue(), 0);
+		}
+		yici00Map.put("合计", 0);
+		for (Map<String, String> map : yiciData00) {
+			String area = map.get("area");
+			if (yici00Map.containsKey(area)) {
+				yici00Map.put(area,yici00Map.get(area) + 1);
+			} else {
+				continue;
+			}
+			yici00Map.put("合计",yici00Map.get("合计") + 1);
+		}
+		List<String> childList10 = new ArrayList<String>();
+		childList10.add("2个月停电1次台区且当日停电");
+		for (PubApppar apppar : appparList) {
+			childList10.add(yici00Map.get(apppar.getValue()).toString());
+		}
+		childList10.add(yici00Map.get("合计").toString());
+		resList.add(childList10);
 		
+		//合计
 		String tingdianNum = countMap.get("合计");
 		String tingdianNumDesc = "";
 		for (Map.Entry<String, String> entry : countMap.entrySet()) {

+ 2 - 0
src/main/java/com/minpay/db/table/own/mapper/ReportServiceMapper.java

@@ -12,6 +12,8 @@ public interface ReportServiceMapper extends IMINMybatisEntityMapper {
 	List<Map<String, String>> selectReportType00(Map<String, Object> param);
 
 	List<Map<String, String>> selectMountCount00(Map<String, Object> param);
+	
+	List<Map<String, String>> selectMountCount01(Map<String, Object> param);
 
 	List<Map<String, String>> queryYesterdayDetail(Map<String, Object> param);
 

+ 35 - 7
src/main/java/com/minpay/reportManage/action/TQTDReportAction.java

@@ -148,10 +148,10 @@ public class TQTDReportAction implements IMINAction {
 			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次及以上台区且当日停电穿透
+		// 2个月停电2次台区且当日停电穿透
 		} else if ("TQTD04".equals(chuantouType)) {
 			String monthNum = "2";
-			String countNum = "1";
+			String countNum = "2";
 			// monthNum个月内停电 countNum次以上的台区
 			String beginDay = DateUtil.dateAddMonth(dayIntervalArray[1], Integer.parseInt("-" + monthNum));
 			param.put("beginDay", beginDay + timeIntervalArray[0]);
@@ -162,14 +162,14 @@ public class TQTDReportAction implements IMINAction {
 			param.put("yesterday", dayIntervalArray[1]);
 			List<Map<String, String>> yesterdayList = db.getMybatisMapper(ReportServiceMapper.class).queryYesterdayDetail(param);
 			
-			if (yesterdayList.size() == 0) {
-				return res;
-			}
 			
-			param.put("yesterdayDetail", yesterdayList);
 			
-//			List<Map<String, String>> mountCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount00(param);
+			param.put("yesterdayDetail", yesterdayList);
 			
+			List<Map<String, String>> mountCountList = db.getMybatisMapper(ReportServiceMapper.class).selectMountCount01(param);
+			if (mountCountList.size() == 0) {
+				return res;
+			}
 			List<String> addressNumList = CommonUtil.getIdFromList(yesterdayList, "addressNum");
 			DwFileDetail00Example example = new DwFileDetail00Example();
 			example.createCriteria().andAddressNumIn(addressNumList).andStartTimeGreaterThanOrEqualTo(beginDay + timeIntervalArray[0]).andEndTimeLessThanOrEqualTo(dayIntervalArray[1] + timeIntervalArray[1]);
@@ -184,6 +184,34 @@ 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次台区且当日停电穿透	
+		}else if ("TQTD06".equals(chuantouType)) {
+			String monthNum = "2";
+			String countNum = "1";
+			// monthNum个月内停电 countNum次以上的台区
+			String beginDay = DateUtil.dateAddMonth(dayIntervalArray[1], Integer.parseInt("-" + monthNum));
+			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);
+			if (yesterdayList.size() == 0) {
+				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]);
+			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);
 		}
 		
 		return res;

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

@@ -71,6 +71,34 @@
 		having num &gt;= #{countNum,jdbcType=VARCHAR}
 		ORDER BY COUNT(1) DESC
 	</select>
+	<!-- 台区停电一次 两次  -->
+	<select id="selectMountCount01" resultType="hashmap" parameterType="java.util.Map">
+		select
+			a.DFD0_ADDRESS_NUM addressNum,
+			a.DFD0_AREA area,
+			a.DFD0_ADDRESS_NAME addressName,
+			cast(count(1) as char) num
+        from 
+        	dw_file_detail_00 a
+		where
+			1 = 1
+			<if test="beginDay != null  and beginDay != ''">
+		    	and DFD0_END_TIME &gt;= #{beginDay,jdbcType=VARCHAR}
+		   	</if>
+			<if test="endDay != null  and endDay != ''">
+		    	and DFD0_END_TIME &lt;= #{endDay,jdbcType=VARCHAR}
+		   	</if>
+			<if test="yesterdayDetail != null">
+		    	and DFD0_ADDRESS_NUM in
+		    	<foreach item="item" index="index" collection="yesterdayDetail" open="("
+					separator="," close=")">
+					#{item.addressNum}
+				</foreach>
+		   	</if>
+		group by a.DFD0_ADDRESS_NUM,a.DFD0_AREA
+		having num = #{countNum,jdbcType=VARCHAR}
+		ORDER BY COUNT(1) DESC
+	</select>
 	<select id="queryYesterdayDetail" resultType="hashmap" parameterType="java.util.Map">
 		select
 			a.DFD0_ADDRESS_NUM addressNum

+ 14 - 0
src/main/webapp/admin/tqtd/reportManageDetailChuantou.html

@@ -90,6 +90,20 @@
 							return accDivFun(d.time, "60", 2);
 						}}
 					]];
+		}else if (chuantouType == "TQTD06") {
+			cols = [[ //表头
+						{field:'num', title: '序号', width:'5%', type:'numbers'}
+						,{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%'}
+					]];
 		}
 		
 	    layui.use('table', function(){

+ 8 - 2
src/main/webapp/admin/tqtd/reportManageDetailTqtd.html

@@ -104,6 +104,8 @@
 						html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd2()" title = "查看详情">' + excelChildList[j] + '</td>';
 					} else if (i == 8) {
 						html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd3()" title = "查看详情">' + excelChildList[j] + '</td>';
+					} else if (i == 9) {
+						html += '<td style="cursor: pointer;background-color: #f8d61a;" onclick="tqtd5()" title = "查看详情">' + excelChildList[j] + '</td>';
 					} else {
 						html += '<td>' + excelChildList[j] + '</td>';
 					}
@@ -132,7 +134,7 @@
 		var openPageId = pageId + "-03";
 		openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD03", '', pageId, null);
 	}
-	// 2个月停电1次及以上台区且昨日停电穿透
+	// 2个月停电2次台区且昨日停电穿透
 	function tqtd3(){
 		var openPageId = pageId + "-04";
 		openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD04", '', pageId, null);
@@ -141,7 +143,11 @@
 		var openPageId = pageId + "-05";
 		openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD05", '', pageId, null);
 	}
-	
+	// 2个月停电1次台区且昨日停电穿透
+	function tqtd5(){
+		var openPageId = pageId + "-06";
+		openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD06", '', pageId, null);
+	}
 	function downLoadFujian() {
 		var data = {reportId : reportId};
 		exportExcel("../../TQTDReportAction/reportInfFujian",data);