tudc 4 anni fa
parent
commit
3c84185792

+ 51 - 0
src/main/webapp/admin/FA/reportManageDetailFA.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>报告详情</title>
+    <script src="../../js/min-loader-next.js"></script>
+    <script src="../../js/report.js"></script>
+</head>
+<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>
+	</div>
+    <script>
+	var pageId = getQueryString("pageId");
+	var reportId = getQueryString("reportId");		//报告id
+	var fileName = chineseUrlDecodeURI(getQueryString("fileName"));	//报告名称
+	
+	var type = getQueryString("type");		//报告类型00:excel 01:word
+	var typeId = getQueryString("typeId");	//报告类型id
+	
+	var cols = null;
+	
+	// excel
+	if ("00" == type) {
+		$("#reportTitle").html(fileName);
+		$.request({
+			action : 'ReportManageAction/reportInfDetail',
+			data : {
+				reportId : reportId
+			},
+			success : function(data) {
+				var reportDataJsonStr = data.data.data;
+				var excelList = eval('(' + reportDataJsonStr + ')');
+				reportTable(excelList, typeId);
+			},
+			error : function(data2) {
+				$.ErrorAlert(data2.MINErrorMessage);
+			}
+	  	});
+	// word
+	} else {
+		
+	}
+	
+
+    </script>
+</body>
+
+</html>

+ 238 - 0
src/main/webapp/admin/FA/reportManageFA.html

@@ -0,0 +1,238 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>报表管理</title>
+    <script src="../../js/min-loader-next.js"></script>
+</head>
+<body class="content">
+	<div class="order-body">
+		<div class="order-tiaojian back-gray">
+			<div class="tiaojian-part1" id = "conditions">
+				<div class="fl f12-gray4-op">所选条件:</div>
+			</div>
+			<div class="tiaojian-part2 fr  demoTable">
+				<button class="order-bnt1 layui-btn" onclick="reloadSearch()" >查询</button>
+				<button class="layui-btn order-bnt2" onclick="reset()">重置</button>
+				<button class="order-bnt2 layui-btn" onclick="uploadExcel()">报表生成</button>
+				<a href="#" id="toggle" class="top">收起</a>
+			</div>
+		</div>
+		<form class="layui-form" action="" id = "formRole">
+			<div class="order-select back-border" id="content">
+				<div class="d-dashed" style="margin: 10px 0;"></div>
+				<div class="layui-inline">
+					<label class="f12-gray4">生成日期:</label>
+					<div class="layui-input-inline" style="position: relative;">
+						<input type="text" class="layui-input" id="date" placeholder="请选择日期" readOnly/>
+					</div>
+				</div>
+				<div class="layui-inline">
+					<label class="f12-gray4">文件名称:</label>
+					<input name="fileName"  id ="fileName" autocomplete="off" placeholder="请输入文件名称" class="search-select" onchange = "changeSelectCon(1,this,'inp')">
+				</div>
+			</div>
+		</form>
+	</div>
+	<div class="shadow-content" style="margin:1.5rem;">
+    	<table id="tableTest" lay-filter="tableFilter"></table>
+	</div>
+	<script type="text/html" id="barDemo">
+		<a class="layui-btn layui-btn-xs" lay-event="detail">详情查看</a>
+     	<a class="layui-btn layui-btn-xs" lay-event="downLoad">下载</a>
+		<a class="layui-btn layui-btn-xs" lay-event="delete">删除</a>
+   	</script>
+	<script type="text/html" id="algorithmBar">
+		<a class="layui-btn layui-btn-xs" lay-event="algorithmDetail">查看</a>
+   	</script>
+    <script>
+    
+    
+	$("#toggle").click(function() {
+		$(this).html($("#content").is(":hidden") ? "收起" + "<i class='iconfont up iconSelect_drop-down'/></i>" : "展开" +
+			"<i class='iconfont up iconSelect_drop-down'/></i>");
+		$("#content").slideToggle();
+	});
+	var pageId = "240000";
+	// 终端投托运报表
+	var reportType = "FADZBB";
+	
+     var table;
+     var form;
+     layui.use(['table','laydate','form'], function(){
+    	  var laydate = layui.laydate;
+    	  laydate.render({ 
+    		  elem: '#date'
+    		  ,type: 'date'
+    		  ,range: true
+    		  ,done: function(value, date, endDate){
+    			  changeSelectCon(0,"date",'date',value)
+  			  }
+		  });
+    	  
+		  table = layui.table;
+		  
+		  // 加载数据
+		  table.render({
+			id: 'tableTest'
+		    ,elem: '#tableTest'
+		    ,limit:10
+		    ,url: 'ReportManageAction/reportInfQuery' //数据接口
+		    ,method: 'post'
+		    ,where:{MINView:"JSON", reportType : reportType}
+		    ,page: true //开启分页
+		    ,cols: [[ //表头
+		      {field:'num', title: '序号',width:'5%', type:'numbers', align: 'center'}
+		      ,{field: 'uploadDate', title: '生成时间', width:'15%', sort: true}
+		      ,{field: 'fileName', title: '报表名称', width:'30%'}
+		      ,{field: 'algorith', title: '算法', width: '10%', toolbar: '#algorithmBar'}
+		      ,{field: 'operate', title: '操作', width: '40%', toolbar: '#barDemo', fixed : 'right'}
+		    ]]
+		    ,done: function(res, curr, count){
+		    }
+		    ,even: true //开启隔行背景
+		  });
+		  
+		 // 监听工具条(操作)
+		  table.on('tool(tableFilter)', function(obj){ //注:tool是工具条事件名,tableFilter是table原始容器的属性 lay-filter="对应的值"
+		    var data = obj.data; //获得当前行数据
+		    var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
+		    var tr = obj.tr; //获得当前行 tr 的DOM对象
+		    if (layEvent === 'detail'){ //查看
+		    	showDetail(data);
+		    } else if(layEvent === 'downLoad'){
+		    	window.open("../../ReportManageAction/reportDownLoad?reportId=" + data.id);
+		    } else if(layEvent === 'delete'){
+		    	layer.confirm('确认删除?', function(index){
+	        		layer.close(index);
+			    	$.request({
+						action : 'ReportManageAction/reportInfDelete',
+						data : {
+							reportId : data.id
+						},
+						success : function(data1) {
+							$.SuccAlert("操作成功!");
+							reloadSearch();
+						},
+						error : function(data2) {
+							$.ErrorAlert(data2.MINErrorMessage);
+						}
+		    	  	});
+	      		});
+		    } else if (layEvent === 'algorithmDetail'){ // 算法查看
+		    	algorithmDetail(data);
+		    }
+		  });
+	 });
+      
+      function reloadSearch (t) {
+	    	var fileName = $("#fileName").val();
+	    	var date = $("#date").val();
+	        //执行重载
+ 		    table.reload('tableTest', {
+ 		        page: {
+ 		        	curr: 1 //重新从第 1 页开始
+ 		        }
+ 		        ,where: {
+ 		        	date : date,
+ 		        	fileName : fileName
+ 		        }
+ 		     });
+ 		 if (t == 1) {
+     		  $.Alert("修改成功"); 
+     	 }
+      }
+      
+      function reset(){
+    	  $('#formRole')[0].reset();
+    	  $("#conditions").html('<div class="fl f12-gray4-op">所选条件:</div>');
+      }
+      
+      function uploadExcel(){
+    	  var openPageId = pageId + "-01";
+    	  openMainTabPage(openPageId, "报表生成", "FA/reportProduceFA.html?pageId="+openPageId+"&reportType="+reportType, '', pageId, reloadSearch);
+      }
+      
+      function showDetail(data){
+    	  var openPageId = pageId + "-02";
+    	  openMainTabPage(openPageId, "详情查看", "FA/reportManageDetailFA.html?pageId="+openPageId+"&reportId="+data.id+"&type="+data.type+"&typeId="+data.typeId+"&fileName="+chineseUrlEncode(data.fileName), '', pageId, null);
+      }
+      function algorithmDetail(data){
+   	  	var openPageId = pageId + "-04";
+		openMainTabPage(openPageId, "算法详情", "reprotManage/reportAlgorithm.html?pageId="+openPageId+"&reportTypeId="+data.typeId, '', pageId, null);
+      }
+      
+   	function changeSelectCon(index, t, type, dateValue){
+   		if (type == "date") {
+   			if (isEmpty(dateValue)) {
+   				$("#search" + index).remove();
+   			} else {
+   				$("#search" + index).remove();
+   				if (isEmpty($("#search" + index).attr("name"))) {
+   					$("#conditions").append(getSelectConHtml(index, t, type,dateValue));
+   				}
+   			}
+   		} else if (type == 'inp') {
+   			if (isEmpty($(t).val())) {
+   				$("#search" + index).remove();
+   			} else {
+   				$("#search" + index).remove();
+   				if (isEmpty($("#search" + index).attr("name"))) {
+   					$("#conditions").append(getSelectConHtml(index, t, type));
+   				}
+   			}
+   		} else {
+   			if (isEmpty($(t).val())) {
+   				$("#search" + index).remove();
+   			} else {
+   				$("#search" + index).remove();
+   				if (isEmpty($("#search" + index).attr("name"))) {
+   					$(t).attr("id","subjects");
+   					$("#conditions").append(getSelectConHtml(index, t, type));
+   				}
+   			}
+   		}
+   	}
+    	
+	var array = new Array('生成日期','文件名称');
+	function getSelectConHtml(index, t, type,dateValue){
+		var name;
+		if (type == "date") {
+			name = $("#"+t).attr("id");
+		} else {
+			name = $(t).attr("id");
+		}
+		var value;
+		if(type == "inp"){
+			value = t.value.substr(0,5)+"..";
+		}
+		if (type == "date") {
+			value = dateValue;
+		}
+		if(type == "sel"){
+			value = $("#stateDiv").find("option:selected").text();
+		}
+		var html = '<div class="fl xuanzhong-active" id = "search' + index + '" name = "' + name + '" onclick = "removeSearch(this)">' +
+						'<div class="fl">' + array[index] + '</div>' +
+						':<span>'+value+'</span>' +
+						'<svg class="icon" aria-hidden="true">' +
+						  '<use xlink:href="#iconicon_close1"></use>' +
+						'</svg>' +
+					'</div>';
+		return html;
+	}
+	function removeSearch(t) {
+		if ($(t).attr("name") == 'subjects') {
+			initSelect('stateDiv', "COMPANY_STATE", "state", '', true); 
+			form.render();
+			$(t).remove();
+		} else {
+			$("#"+$(t).attr("name")).val('');
+			$(t).remove();
+		}
+	}
+    </script>
+</body>
+
+</html>

+ 322 - 0
src/main/webapp/admin/FA/reportProduceFA.html

@@ -0,0 +1,322 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>导入</title>
+    <script src="../../js/min-loader-next.js"></script>
+    <script src="../../js/report.js"></script>
+    <link rel="stylesheet" href="../../plugins/layui/lay/modules/steps/style.css"></link>
+    <style>
+    	.layui-input {
+    		width : 200px;
+    	}
+    	.layui-upload-drag .layui-icon {
+    		font-size: 18px;
+		    color: #fff;
+		}
+		.layui-btn-sm {
+		    height: 22px;
+		    line-height: 22px;
+		    padding: 0 10px;
+		    font-size: 12px;
+		}
+    </style>
+</head>
+<body class="content">
+	<div id="step_demo" class="step-body" style = "margin-top : 20px; margin-left: 10%;">
+	    <div class="step-header" style="width:80%;overflow: hidden;">
+	        <ul>
+	            <li>
+	                <span class="step-name">选择报告/报表</span>
+	            </li>
+	            <li>
+	                <span class="step-name">选择文件</span>
+	            </li>
+	            <li>
+	                <span class="step-name">数据预览</span>
+	            </li>
+	            <li>
+	                <span class="step-name">生成报告/报表</span>
+	            </li>
+	        </ul>
+	    </div>
+	</div>
+	<div class="order-body" style = "width: 80%; margin-left : 10%;height : 450px" name = "step">
+		<form class="layui-form" style = "text-align : center;">
+			<div class="order-select" id="content" style = "background: #FFFFFF;border-radius: 8px;padding: 16px 1.4rem;">
+				<div class="layui-inline" style="margin-top: 150px;">
+					<label class="f12-gray4">请选择文件类型:</label>
+					<div id = "reportTypeDiv" class="layui-inline">
+					</div>
+				</div>
+				<div style="margin-top : 200px;">
+			      <button type="button" class="layui-btn" style = "width : 214px" onclick = "goStep(2)">下一步</button>
+			    </div>
+			</div>
+		</form>
+	</div>
+	<div name = "step" style = "width: 80%; margin-left : 10%;height : 300px; display : none; text-align : center;">
+		<form class="layui-form" style = "text-align : center;">
+			<div style = "width: 80%; margin-left : 0px; height : 200px" class = "layui-upload-drag" >
+				<input type="text" class="layui-input" id="yearChoose" placeholder="yyyy" style = "display: inline-block;">
+				<div id = "FADateRange" class="layui-inline">
+				</div>
+			</div>
+			<div style="margin-top : 50px;">
+		      <button type="button" class="layui-btn" style = "width : 214px" onclick = "tableYulan()">下一步</button>
+		    </div>
+	    </form>
+	</div>
+	<div name = "step" style = "width: 80%; margin-left : 10%; height : 300px; display : none; text-align : center;">
+		<div style = "width: 80%; margin-left : 0px;" class = "layui-upload-drag" >
+		  <p id = "fileName" contenteditable="true">国网泰安供电公司2020年8月份配网运行分析月报</p>
+		  <table id = "reportTable" class="layui-table">
+		  </table>
+		  <p id = "content"></p>
+		  <p>报表关联的工具表为《<a id = "utilName" onclick = "goUtilDetail(this)">2020年6月底低电压月报工具表</a>》  关联的报表算法为《<a id = "algorithmName" onclick = "goAlgorithmDetail(this)">国网泰安供电公司2020年8月份配网运行分析月报</a>》    的算法</p>
+		</div>
+		<div style="margin-top : 50px;">
+	      <button type="button" class="layui-btn" style = "width : 214px" onclick = "goStep(4)">下一步</button>
+	    </div>
+	</div>
+	<div name = "step" style = "width: 80%; margin-left : 10%;height : 300px; display : none; text-align : center; margin-top : 50px;">
+		<i class="layui-icon layui-icon-ok-circle" style="font-size: 100px; color: #009688;"></i>
+		<p style = "font-weight: 700;font-size: 25px;">报表生成成功!</p>
+		<p style = " color: #b2bbc2;">可在数据仓库-报表管理进行查看</p>
+		<div style="margin-top : 100px;">
+	      <button type="button" class="layui-btn" style = "width : 214px" onclick = "finish()">完成</button>
+	    </div>
+	</div>
+	
+    <script>
+		var pageId = getQueryString("pageId");
+		var reportType = getQueryString("reportType"); //报告类型
+		var $step;
+		layui.config({
+	        base: '../../plugins/layui/lay/modules/steps/'
+	    }).use(['steps','jquery'],function(){
+	    	var $ = layui.$;
+    	    $step = $("#step_demo").step();
+		})
+		layui.use('laydate', function(){
+			var laydate = layui.laydate;
+			laydate.render({
+				elem: '#yearChoose'
+				,type: 'year'
+				,value: new Date()
+			});
+		})
+		// 范围类型
+		layui.use('form', function(){
+			var form = layui.form;
+			initSelect("FADateRange", "FADateRange", "FADateRange", "", false);
+			
+			$.request({
+				action : 'BranchReportTypeAction/branchReportTypeQuery',
+				data : {
+					reportType : reportType
+				},
+				success : function(data) {
+					var html = '<select id = "reportType" lay-filter="reportTypeFilter"><option value = "">请选择</option>';
+					var fileTypeList = data.data;
+					for (var i = 0; i < fileTypeList.length; i ++) {
+						var fileTypeInf = fileTypeList[i];
+						html += '<option value = "' + fileTypeInf.id + '_' + fileTypeInf.type + '_' + fileTypeInf.timeType + '">' + fileTypeInf.name + '</option>';
+					}
+					html += '</select>';
+					$("#reportTypeDiv").html(html);
+					form.render();
+				},
+				error : function(data2) {
+					$.ErrorAlert(data2.MINErrorMessage);
+				}
+    	  	});
+			
+			form.on('select(reportTypeFilter)', function(data){
+				var value = data.value;
+				if (!isEmpty(value)) {
+					var reportTypeId = value.split("_")[0];
+					
+					$("#fileName").html(data.elem.selectedOptions[0].text);
+					
+					if (!isEmpty(reportTypeId)) {
+						  $.request({
+								action : 'BranchReportTypeAction/fileTypeOfReportType',
+								data : {
+									reportTypeId : reportTypeId
+								},
+								success : function(data) {
+									fileType = data.data;
+									setTempVal("fileType", fileType);
+									
+									var utilDataInf = data.utilDataInf;
+									if (!isEmpty(utilDataInf)) {
+										$("#utilName").html(utilDataInf.fileName);
+										$("#utilName").attr("fileName", utilDataInf.fileName);
+										setTempVal("utilExcelDataDetail", utilDataInf.excelData);
+										var algorithmInf = data.algorithmInf;
+										if (!isEmpty(algorithmInf)) {
+											$("#algorithmName").html(utilDataInf.fileName+"算法");
+											$("#algorithmName").attr("reportTypeId", reportTypeId);
+										}
+									}
+									
+								},
+								error : function(data2) {
+									$.ErrorAlert(data2.MINErrorMessage);
+								}
+				    	  });
+					  }
+				}
+			});      
+		})
+		
+		function goStep (step) {
+			var reportInf = $("#reportTypeDiv").find("select option:selected").val();
+			
+			if (step == 2) {
+				if (isEmpty(reportInf)) {
+					$.ErrorAlert("请选择上传文件类型!");
+					return;
+				}
+				var reportType = reportInf.split("_")[0];
+				// 台区停电日报
+				if ("TQTDRB" == reportType) {
+					$("body").find("[name='TQTDRB']").show();
+				}
+			}
+			
+			if (step == 4) {
+				var fileName = $("#fileName").html();
+				var FADateRange = $("#FADateRange").find("select option:selected").val();
+				var yearChoose = $("#yearChoose").val();
+				if (isEmpty(FADateRange)) {
+					$.ErrorAlert("请选择日期范围!");
+					return;
+				}
+				if (isEmpty(yearChoose)) {
+					$.ErrorAlert("请选择年份!");
+					return;
+				}
+				var beginTime = yearChoose + FADateRange.substring(0, 4);
+				var endTime = yearChoose + FADateRange.substring(4, 8);
+				if (beginTime.substring(0, 2) == "12") {
+					endTime = accAdd(FADateRange, "1") + FADateRange.substring(4, 8);
+				}
+				$.request({
+					action : 'ReportManageAction/fileInfReportSubmit',
+					data : {
+						reportData : JSON.stringify(excelList),
+						reportInf : reportInf,
+						fileName : fileName,
+						range : beginTime + '-' + endTime
+					},
+					success : function(data) {
+						if (data.code == 0) {
+							$step.goStep(step);
+							var stepDiv = $("div[name = 'step']");
+							for (var i = 0; i < stepDiv.length; i ++) {
+								if (step == (i + 1)) {
+									$(stepDiv[i]).show();
+								} else {
+									$(stepDiv[i]).hide();
+								}
+							}
+				    	} else {
+				    		$.ErrorAlert(res.MINErrorMessage);
+				    	}
+					},
+					error : function(data2) {
+						$.ErrorAlert(data2.MINErrorMessage);
+					}
+	    	  	});
+				return;
+			}
+			
+			$step.goStep(step);
+			var stepDiv = $("div[name = 'step']");
+			for (var i = 0; i < stepDiv.length; i ++) {
+				if (step == (i + 1)) {
+					$(stepDiv[i]).show();
+				} else {
+					$(stepDiv[i]).hide();
+				}
+			}
+		}
+		
+		function finish() {
+			deleteTabPageParent(pageId); 
+		}
+		
+		// 查看工具表详情
+		function goUtilDetail(t) {
+			var fileName = $(t).attr("fileName");
+			var openPageId = pageId + "-01";
+			openMainTabPage(openPageId, "详情查看", "reprotManage/utilExcelDetail.html?pageId="+openPageId+"&fileName="+chineseUrlEncode(fileName), '', pageId, null);
+		}
+		// 查看算法详情
+		function goAlgorithmDetail(t) {
+			var reportTypeId = $(t).attr("reportTypeId");
+			var openPageId = pageId + "-02";
+			openMainTabPage(openPageId, "详情查看", "reprotManage/reportAlgorithm.html?pageId="+openPageId+"&reportTypeId="+reportTypeId, '', pageId, null);
+		}
+		
+		// 报表excel
+		var excelList = null;
+		// 预览
+		function tableYulan() {
+			var reportInf = $("#reportTypeDiv").find("select option:selected").val();
+			var FADateRange = $("#FADateRange").find("select option:selected").val();
+			var yearChoose = $("#yearChoose").val();
+			
+			if (isEmpty(FADateRange)) {
+				$.ErrorAlert("请选择日期范围!");
+				return;
+			}
+			if (isEmpty(yearChoose)) {
+				$.ErrorAlert("请选择年份!");
+				return;
+			}
+			
+			// 查询符合条件的明细数据,生成预览数据
+			$.request({
+				action : 'ReportManageAction/reportNeedDataDetail',
+				data : {
+					reportInf : reportInf,
+					FADateRange : FADateRange,
+					yearChoose : yearChoose
+				},
+				success : function(data) {
+					if (data.code == 0) {
+						excelList = data.data.resList;
+						initExcelData(excelList, "reportTable", false);
+						goStep(3);
+			    	} else {
+			    		$.ErrorAlert(res.MINErrorMessage);
+			    	}
+				},
+				error : function(data2) {
+					$.ErrorAlert(data2.MINErrorMessage);
+				}
+    	  	});
+		}
+		
+		function changeHtml(t) {
+			var initValue = $(t).html();
+			layer.prompt({
+					formType: 2,
+					value: initValue,
+					title: '请输入',
+					area: ['200px', '33px'] //自定义文本域宽高
+				}, 
+				function(value, index, elem){
+					$(t).html(value);
+					layer.close(index);
+				}
+			);
+		}
+    </script>
+</body>
+
+</html>

+ 14 - 0
src/main/webapp/admin/reprotManage/dataWareDetail.html

@@ -45,6 +45,20 @@
 			      ,{field: 'excelYxstatus', title: 'yxstatus'}
 			      ,{field: 'excelTytime', title: 'tytime'}
 			    ]];
+	} else if ("1000003" == fileType) {
+		cols = [[ 
+			      {field: 'no', title: '序号'}
+			      ,{field: 'beginTime', title: '故障停电开始时间'}
+			      ,{field: 'endTime', title: '故障停电结束时间'}
+			      ,{field: 'gdlx', title: '供电类型'}
+			      ,{field: 'cxbdz', title: '出线变电站'}
+			      ,{field: 'xlmc', title: '线路名称'}
+			      ,{field: 'xllx', title: '线路类型'}
+			      ,{field: 'qdfa', title: '启动FA'}
+			      ,{field: 'gzqjpd', title: '故障区间判断'}
+			      ,{field: 'gzqhdhf', title: '故障前后段恢复'}
+			      ,{field: 'gzgl', title: '故障隔离'}
+			    ]];
 	}
 	
      var table;

+ 63 - 3
src/main/webapp/admin/reprotManage/dataWareUpload.html

@@ -149,6 +149,52 @@
 			</tr>
 		</table>
 	</div>
+	<div id = "tableDemo1000003" name = "tableDiv" style = "display : none; margin: 10px;">
+		<p style = "font-weight: 700;">表格示例</p>
+		<p>1、请上传有标准行列的一组数据</p>
+		<p>2、日期字段需包含年月日(如:2020/08/08)或年月日时分(如:2020/08/08 00:00:00)</p>
+		<table class="layui-table">
+			<tr>
+				<td>序号</td>
+				<td>故障停电开始时间</td>
+				<td>故障停电结束时间</td>
+				<td>供电类型</td>
+				<td>出线变电站</td>
+				<td>线路名称</td>
+				<td>线路类型</td>
+				<td>启动FA</td>
+				<td>故障区间判断</td>
+				<td>故障前后段恢复</td>
+				<td>故障隔离</td>
+			</tr>
+			<tr>
+				<td>1</td>
+				<td>2012-03-13 16:59:07</td>
+				<td>2012-03-13 17:59:07</td>
+				<td>市公司</td>
+				<td>110KV东关变电站</td>
+				<td>青年路线</td>
+				<td>电流型</td>
+				<td>是</td>
+				<td>正确</td>
+				<td>正确</td>
+				<td>成功</td>
+			</tr>
+			<tr>
+				<td>2</td>
+				<td>2012-03-13 16:59:07</td>
+				<td>2012-03-13 17:59:07</td>
+				<td>市公司</td>
+				<td>110KV南湖变电站</td>
+				<td>满庄线</td>
+				<td>电流型</td>
+				<td>是</td>
+				<td>定位错误</td>
+				<td>恢复失败</td>
+				<td>隔离失败</td>
+			</tr>
+		</table>
+	</div>
 
 	
     <script>
@@ -173,7 +219,7 @@
 					var fileTypeList = data.data;
 					for (var i = 0; i < fileTypeList.length; i ++) {
 						var fileTypeInf = fileTypeList[i];
-						html += '<option value = "' + fileTypeInf.id +' ">' + fileTypeInf.name + '</option>';
+						html += '<option value = "' + fileTypeInf.id +'">' + fileTypeInf.name + '</option>';
 					}
 					html += '</select>';
 					$("#fileTypeDiv").html(html);
@@ -211,6 +257,7 @@
 				}
 			}
 		}
+		var chongfuFlag = false;
 		layui.use('upload', function(){
 			var $ = layui.jquery
 			,upload = layui.upload;
@@ -227,12 +274,25 @@
 				,before: function(obj){ 
 					var fileType = $("#fileTypeDiv").find("select option:selected").val();
    	    		    layer.load(); //上传loading
-   	    		    this.data = {fileType : fileType};
+   	    		    this.data = {fileType : fileType, chongfuFlag : chongfuFlag};
    	    		}
 			    ,done: function(res){
 			    	layer.closeAll('loading'); //关闭loading
 			    	if (res.code == 0) {
-			    		goStep(3);
+			    		if (isEmpty(res.chongfu)) {
+			    			goStep(3);
+			    		// 有重复数据
+			    		} else {
+			    			var fileType = $("#fileTypeDiv").find("select option:selected").val();
+			    			// 台区停电
+			    			if (fileType == "1000001") {
+			    				layer.confirm("台区编号:【"+res.chongfu[0].addressNum+"】 台区名称:【"+res.chongfu[0].addressName+"】 数据日期:【"+res.chongfu[0].date+"】数据重复,是否继续上传?", {icon: 3, title:'提示'}, function(index){
+			    					chongfuFlag = true;
+									layer.close(index);
+									$('#uploadBtn').click();
+			    				});
+			    			}
+			    		}
 			    	} else {
 			    		$.ErrorAlert(res.MINErrorMessage);
 			    	}

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

@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>报告详情</title>
+    <script src="../../js/min-loader-next.js"></script>
+</head>
+<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>
+	</div>
+    <script>
+		var pageId = getQueryString("pageId");
+		var reportId = getQueryString("reportId");				//报告id
+		var chuantouType = getQueryString("chuantouType");		//穿透数据
+		
+		var cols = null;
+		if (chuantouType == "TQTD01") {
+			cols = [[ //表头
+						{field:'num', title: '序号',width:'5%', type:'numbers', align: 'center'}
+						,{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 == "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%'}
+					]];
+		} 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%'}
+					]];
+		} 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%'}
+					]];
+		}
+		
+	    layui.use('table', function(){
+	    	var table = layui.table;
+			  // 加载数据
+			table.render({
+				id: 'reportTable'
+				,elem: '#reportTable'
+				,url: 'TQTDReportAction/reportInfChuantou' //数据接口
+				,method: 'post'
+				,where:{MINView:"JSON", reportId : reportId, chuantouType : chuantouType}
+				,page: false
+				,cols: cols
+				,done: function(res, curr, count){
+				}
+				,even: true //开启隔行背景
+			});
+	    })
+    </script>
+</body>
+
+</html>

+ 52 - 1
src/main/webapp/admin/tqtd/reportManageDetailTqtd.html

@@ -5,7 +5,6 @@
     <meta charset="utf-8">
     <title>报告详情</title>
     <script src="../../js/min-loader-next.js"></script>
-    <script src="../../js/report.js"></script>
 </head>
 <body class="content">
 	<div class="shadow-content" style="margin:1.5rem; text-align: center;">
@@ -44,6 +43,58 @@
 		
 	}
 	
+	function reportTable(excelList, typeId, isEdit) {
+		var html = '';
+		for (var i = 0; i < excelList.length; i ++) {
+			html += '<tr>';
+			var excelChildList = excelList[i];
+			for (var j = 0; j < excelChildList.length; j ++) {
+				// 合计列增加穿透
+				if ((j == excelChildList.length - 1)) {
+					// 台区停电次数
+					if (i == 2) {
+						html += '<td style="cursor: pointer" onclick="tqtd0()">' + excelChildList[j] + '</td>';
+					// 2个月停电3次及以上台区
+					} else if (i == 5) {
+						html += '<td style="cursor: pointer" onclick="tqtd1()">' + excelChildList[j] + '</td>';
+					// 2个月停电3次及以上台区且昨日停电
+					} else if (i == 6) {
+						html += '<td style="cursor: pointer" onclick="tqtd2()">' + excelChildList[j] + '</td>';
+					} else if (i == 7) {
+						html += '<td style="cursor: pointer" onclick="tqtd3()">' + excelChildList[j] + '</td>';
+					} else {
+						html += '<td>' + excelChildList[j] + '</td>';
+					}
+				} else {
+					html += '<td>' + excelChildList[j] + '</td>';
+				}
+			}
+			html += '</tr>';
+		}
+		$("#reportTable").html(html);
+	}
+	
+	// 台区次数穿透
+	function tqtd0(){
+		var openPageId = pageId + "-01";
+		openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD01", '', pageId, null);
+	}
+	// 2个月停电3次及以上台区穿透
+	function tqtd1(){
+		var openPageId = pageId + "-02";
+		openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD02", '', pageId, null);
+	}
+	// month个月停电count次及以上台区且昨日停电穿透
+	function tqtd2(){
+		var openPageId = pageId + "-03";
+		openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD03", '', pageId, null);
+	}
+	// 2个月停电1次及以上台区且昨日停电穿透
+	function tqtd3(){
+		var openPageId = pageId + "-04";
+		openMainTabPage(openPageId, "详情", "tqtd/reportManageDetailChuantou.html?pageId="+openPageId+"&reportId="+reportId+"&chuantouType=TQTD04", '', pageId, null);
+	}
+	
 
     </script>
 </body>

+ 1 - 1
src/main/webapp/admin/tqtd/reportManageTqtd.html

@@ -154,7 +154,7 @@
       
       function uploadExcel(){
     	  var openPageId = pageId + "-01";
-    	  openMainTabPage(openPageId, "报表生成", "tqtd/reportProduceTqtd.html?pageId="+openPageId+"&timeType="+timeType, '', pageId, reloadSearch);
+    	  openMainTabPage(openPageId, "报表生成", "tqtd/reportProduceTqtd.html?pageId="+openPageId+"&timeType="+timeType+"&reportType="+reportType, '', pageId, reloadSearch);
       }
       
       function showDetail(data){

+ 5 - 1
src/main/webapp/admin/tqtd/reportProduceTqtd.html

@@ -240,6 +240,8 @@
 				} else {
 					range = dateRange;
 				}
+				var monthNum = $("#monthNum").html();
+				var countNum = $("#countNum").html();
 				$.request({
 					action : 'ReportManageAction/fileInfReportSubmit',
 					data : {
@@ -247,7 +249,9 @@
 						reportInf : reportInf,
 						fileName : fileName,
 						range : range,
-						timeRange : timeRange
+						timeRange : timeRange,
+						monthNum : monthNum,
+						countNum : countNum
 					},
 					success : function(data) {
 						if (data.code == 0) {