浏览代码

日报描述

tudc 5 年之前
父节点
当前提交
5f617c9dd6

+ 86 - 4
src/main/java/com/minpay/common/service/impl/ReportServiceImpl.java

@@ -21,6 +21,7 @@ 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.DwFileDetail00Mapper;
 import com.minpay.db.table.mapper.DwFileDetail01Mapper;
 import com.minpay.db.table.mapper.DwFileDetail03Mapper;
 import com.minpay.db.table.mapper.DwFileDetail04Mapper;
@@ -32,6 +33,8 @@ import com.minpay.db.table.model.DwDdyFxb;
 import com.minpay.db.table.model.DwDdyFxbDetail;
 import com.minpay.db.table.model.DwDdyFxbDetailExample;
 import com.minpay.db.table.model.DwDdyFxbExample;
+import com.minpay.db.table.model.DwFileDetail00;
+import com.minpay.db.table.model.DwFileDetail00Example;
 import com.minpay.db.table.model.DwFileDetail01;
 import com.minpay.db.table.model.DwFileDetail01Example;
 import com.minpay.db.table.model.DwFileDetail03;
@@ -150,8 +153,7 @@ public class ReportServiceImpl implements IReportService {
     		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);
+    		return reportTypeTQTDRB(range, timeRange, monthNum, countNum);
     	// 台区停电周报
     	} else if (Constant.REPORT_TYPE_01.equals(reportTypeId)) {
     		return reportTypeTQTDZB(range, timeRange);
@@ -220,9 +222,12 @@ public class ReportServiceImpl implements IReportService {
 	 * @throws MINBusinessException
 	 * @throws ParseException 
 	 */
-	public List<List<String>> reportTypeTQTDRB(String range, String timeRange, String monthNum, String countNum) throws MINBusinessException, ParseException {
+	public Map<String, Object> reportTypeTQTDRB(String range, String timeRange, String monthNum, String countNum) throws MINBusinessException, ParseException {
 		IMINDataBaseService db = Service.lookup(IMINDataBaseService.class);
+		Map<String, Object> resMap = new HashMap<String, Object>();
 		List<List<String>> resList = new ArrayList<List<String>>();
+		resMap.put("excelList", resList);
+		
 		Map<String, Object> param = new HashMap<String, Object>();
 		String beginTime = null;
 		String endTime = null;
@@ -561,7 +566,84 @@ public class ReportServiceImpl implements IReportService {
 		childList8.add(yiciMap.get("heji").toString());
 		resList.add(childList8);
 		
-		return resList;
+		String tingdianNum = countMap.get("heji");
+		String tingdianNumDesc = "";
+		for (Map.Entry<String, String> entry : countMap.entrySet()) {
+			String mapKey = entry.getKey();
+		    String mapValue = entry.getValue();
+		    // 新泰
+		    if ("xintai".equals(mapKey)) {
+		    	tingdianNumDesc += "新泰" + mapValue + "个,";
+		    } else if ("daiyue".equals(mapKey)) {
+		    	tingdianNumDesc += "岱岳" + mapValue + "个,";
+		    } else if ("ningyang".equals(mapKey)) {
+		    	tingdianNumDesc += "宁阳" + mapValue + "个,";
+		    } else if ("taishan".equals(mapKey)) {
+		    	tingdianNumDesc += "泰山" + mapValue + "个,";
+		    } else if ("dongping".equals(mapKey)) {
+		    	tingdianNumDesc += "东平" + mapValue + "个,";
+		    } else if ("feicheng".equals(mapKey)) {
+		    	tingdianNumDesc += "肥城" + mapValue + "个,";
+		    } else if ("taishanjingqu".equals(mapKey)) {
+		    	tingdianNumDesc += "泰山景区" + mapValue + "个,";
+		    } else if ("gaoxin".equals(mapKey)) {
+		    	tingdianNumDesc += "高新" + mapValue + "个,";
+		    }
+		}
+		
+		String sanciyishangNum = String.valueOf(taiQuMap.get("heji"));
+		String sanciyishangNumDesc = "";
+		for (Map.Entry<String, Integer> entry : taiQuMap.entrySet()) {
+			String mapKey = entry.getKey();
+		    Integer mapValue = entry.getValue();
+		    // 新泰
+		    if ("xintai".equals(mapKey)) {
+		    	sanciyishangNumDesc += "新泰" + mapValue + "个,";
+		    } else if ("daiyue".equals(mapKey)) {
+		    	sanciyishangNumDesc += "岱岳" + mapValue + "个,";
+		    } else if ("ningyang".equals(mapKey)) {
+		    	sanciyishangNumDesc += "宁阳" + mapValue + "个,";
+		    } else if ("taishan".equals(mapKey)) {
+		    	sanciyishangNumDesc += "泰山" + mapValue + "个,";
+		    } else if ("dongping".equals(mapKey)) {
+		    	sanciyishangNumDesc += "东平" + mapValue + "个,";
+		    } else if ("feicheng".equals(mapKey)) {
+		    	sanciyishangNumDesc += "肥城" + mapValue + "个,";
+		    } else if ("taishanjingqu".equals(mapKey)) {
+		    	sanciyishangNumDesc += "泰山景区" + mapValue + "个,";
+		    } else if ("gaoxin".equals(mapKey)) {
+		    	sanciyishangNumDesc += "高新" + mapValue + "个,";
+		    }
+		}
+		
+		// 恢复供电时间
+		DwFileDetail00Example example = new DwFileDetail00Example();
+		example.createCriteria().andStartTimeGreaterThanOrEqualTo(beginTime).andEndTimeLessThanOrEqualTo(endTime);
+		List<DwFileDetail00> selectByExample = db.selectByExample(DwFileDetail00Mapper.class, example, new MINRowBounds(1, 1));
+		String huifu = "";
+		if (selectByExample.size() != 0) {
+			String hour = selectByExample.get(0).getEndTime().substring(8, 10);
+			String min = selectByExample.get(0).getEndTime().substring(10, 12);
+			if ("00".equals(min)) {
+				huifu = hour;
+			} else {
+				huifu = CommonUtil.add(hour, "1");
+			}
+		}
+		
+		Map<String, Object> dataMap = new HashMap<String, Object>();
+		dataMap.put("tingdianNum", tingdianNum);
+		dataMap.put("tingdianNumDesc", tingdianNumDesc);
+		dataMap.put("monthNum", monthNum);
+		dataMap.put("countNum", countNum);
+		dataMap.put("sanciyishangNum", sanciyishangNum);
+		dataMap.put("sanciyishangNumDesc", sanciyishangNumDesc);
+		dataMap.put("huifu", huifu);
+		String descStr = "监测发现台区停电${tingdianNum}个,按单位分:${tingdianNumDesc}其中${monthNum}个月内重复停电${countNum}次及以上的台区${sanciyishangNum},按单位分:${sanciyishangNumDesc}截止今日${huifu}时已全部恢复送电。";
+		resMap.put("dataMap", dataMap);
+		resMap.put("descStr", descStr);
+		
+		return resMap;
 	}
 	
 	/**

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

@@ -21,10 +21,10 @@
 		where
 			1 = 1
 			<if test="beginTime != null  and beginTime != ''">
-		    	and DFD0_START_TIME &gt; #{beginTime,jdbcType=VARCHAR}
+		    	and DFD0_START_TIME &gt;= #{beginTime,jdbcType=VARCHAR}
 		   	</if>
 			<if test="endTime != null  and endTime != ''">
-		    	and DFD0_END_TIME &lt; #{endTime,jdbcType=VARCHAR}
+		    	and DFD0_END_TIME &lt;= #{endTime,jdbcType=VARCHAR}
 		   	</if>
 		order by area
 	</select>
@@ -37,10 +37,10 @@
 		where
 			1 = 1
 			<if test="beginTime != null  and beginTime != ''">
-		    	and DFD0_START_TIME &gt; #{beginTime,jdbcType=VARCHAR}
+		    	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>
 		   	GROUP BY DFD0_AREA
 	</select>
@@ -55,10 +55,10 @@
 		where
 			1 = 1
 			<if test="beginDay != null  and beginDay != ''">
-		    	and DFD0_START_TIME &gt; #{beginDay,jdbcType=VARCHAR}
+		    	and DFD0_START_TIME &gt;= #{beginDay,jdbcType=VARCHAR}
 		   	</if>
 			<if test="endDay != null  and endDay != ''">
-		    	and DFD0_START_TIME &lt; #{endDay,jdbcType=VARCHAR}
+		    	and DFD0_END_TIME &lt;= #{endDay,jdbcType=VARCHAR}
 		   	</if>
 			<if test="yesterdayDetail != null">
 		    	and DFD0_ADDRESS_NUM in
@@ -93,10 +93,10 @@
 		where
 			1 = 1
 			<if test="beginTime != null  and beginTime != ''">
-		    	and DFD0_START_TIME &gt; #{beginTime,jdbcType=VARCHAR}
+		    	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>
 		group by a.DFD0_AREA
 	</select>
@@ -115,8 +115,8 @@
 		  FROM
 		    dw_file_detail_00 a 
 		  WHERE 
-		  	DFD0_START_TIME &gt; #{beginTime,jdbcType=VARCHAR}
-		    and DFD0_START_TIME &lt; #{endTime,jdbcType=VARCHAR}
+		  	DFD0_START_TIME &gt;= #{beginTime,jdbcType=VARCHAR}
+		    and DFD0_END_TIME &lt;= #{endTime,jdbcType=VARCHAR}
 		  GROUP BY a.DFD0_ADDRESS_NUM,
 		    a.DFD0_ADDRESS_NAME) b 
 		WHERE 1=1

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

@@ -9,7 +9,7 @@
 <body class="content">
 	<div class="shadow-content" style="margin:1.5rem; text-align: center;">
 		<p id = "reportTitle" style="margin:15px; font-size : 20px"></p>
-    	<table id="reportTable" class="layui-table"></table>
+<!--     	<table id="reportTable" class="layui-table"></table> -->
     	<div id = "reportDiv" style = "margin : 20px; text-align : left;"></div>
     	<div id = "reportFujian" style = "margin : 20px; text-align : right;">
     		<a style = "color : red;" onclick = "downLoadFujian()">附件下载</a>
@@ -27,7 +27,7 @@
 	var cols = null;
 	
 	// excel
-	if ("00" == type) {
+	/* if ("00" == type) {
 		$("#reportDiv").hide();
 		$("#reportFujian").hide();
 		$("#reportTitle").html(fileName);
@@ -46,7 +46,7 @@
 			}
 	  	});
 	// word
-	} else {
+	} else { */
 		$("#reportTable").hide();
 		$("#reportTitle").html(fileName);
 		$.request({
@@ -69,9 +69,9 @@
 				}
 				$("#reportDiv").html(reportDesc);
 				
-				// 周报下的excel
 				var excelList = resJSON.excelList;
-				if (!isEmpty(excelList)) {
+				// 周报
+				if (reportType == "TQTDZB") {
 					var tableHtml = '<table class="layui-table">';
 					for (var i = 0; i < excelList.length; i ++) {
 						tableHtml += '<tr>';
@@ -84,6 +84,11 @@
 					tableHtml += '</table>';
 					$("#reportDiv").append(tableHtml);
 				}
+				// 日报
+				if (reportType == "TQTDRB") {
+					reportTable(excelList, typeId);
+				}
+				// 不是月报
 				if (reportType != "TQTDYB") {
 					$("#reportFujian").hide();
 				}
@@ -92,10 +97,10 @@
 				$.ErrorAlert(data2.MINErrorMessage);
 			}
 	  	});
-	}
+// 	}
 	
 	function reportTable(excelList, typeId, isEdit) {
-		var html = '';
+		var html = '<table class="layui-table">';
 		for (var i = 0; i < excelList.length; i ++) {
 			html += '<tr>';
 			var excelChildList = excelList[i];
@@ -124,7 +129,8 @@
 			}
 			html += '</tr>';
 		}
-		$("#reportTable").html(html);
+		html += '</table>';
+		$("#reportDiv").append(html);
 	}
 	
 	// 台区次数穿透

+ 10 - 10
src/main/webapp/admin/tqtd/reportProduceTqtd.html

@@ -70,10 +70,10 @@
 	<div name = "step" style = "width: auto; height : 300px; display : none; text-align : center;">
 		<div style = "width: auto; margin-left : 0px;" class = "layui-upload-drag" >
 		  <p id = "fileName" contenteditable="true">国网泰安供电公司2020年8月份配网运行分析月报</p>
-		  <table id = "reportTable" class="layui-table" style = "display : none">
-		  </table>
+		  <!-- <table id = "reportTable" class="layui-table" style = "display : none">
+		  </table> -->
+		  <div id = "reportDiv" style = "text-align : left;"></div>
 		  <p id = "gongjubiao">报表关联的工具表为《<a id = "utilName" onclick = "goUtilDetail(this)">2020年6月底低电压月报工具表</a>》  关联的报表算法为《<a id = "algorithmName" onclick = "goAlgorithmDetail(this)">国网泰安供电公司2020年8月份配网运行分析月报</a>》    的算法</p>
-		  <div id = "reportDiv" style = "display : none;text-align : left;"></div>
 		</div>
 		<div style="margin-top : 50px;">
 	      <button type="button" class="layui-btn" style = "width : 214px" onclick = "goStep(4)">下一步</button>
@@ -347,7 +347,7 @@
 				success : function(data) {
 					if (data.code == 0) {
 						// 日报
-						if (timeType == '00') {
+						/* if (timeType == '00') {
 							resJsonStr = data.data.resList;
 							$("#reportDiv").hide();
 							$("#reportTable").show();
@@ -355,9 +355,9 @@
 							initExcelData(resJsonStr, "reportTable", false);
 							goStep(3);
 						// 月报 或 周报
-						} else if (timeType == '02' || timeType == '01') {
-							$("#reportTable").hide();
-							$("#gongjubiao").hide();
+						} else if (timeType == '02' || timeType == '01') { */
+// 							$("#reportTable").hide();
+// 							$("#gongjubiao").show();
 							$("#reportDiv").show();
 							resJsonStr = data.data;
 							var dataMap = data.data.dataMap;
@@ -377,8 +377,8 @@
 							$("#reportDiv").html(descStr);
 							
 							var tableHtml = '<table class="layui-table">';
-							// 周报
-							if (timeType == '01') {
+							// 周报或日报
+							if (timeType == '01' || timeType == '00' ) {
 								var excelList = data.data.excelList;
 								for (var i = 0; i < excelList.length; i ++) {
 									tableHtml += '<tr>';
@@ -392,7 +392,7 @@
 							tableHtml += '</table>';
 							$("#reportDiv").append(tableHtml);
 							goStep(3);
-						}
+// 						}
 						
 			    	} else {
 			    		$.ErrorAlert(res.MINErrorMessage);