Prechádzať zdrojové kódy

分析表添加文字描述
分析表添加根据低压时长更改背景颜色处理

郎学彬 4 rokov pred
rodič
commit
fc927384c9

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 4 - 6
src/main/java/com/minpay/common/service/impl/ReportServiceImpl.java


+ 18 - 1
src/main/java/com/minpay/common/util/CommonUtil.java

@@ -368,7 +368,24 @@ public class CommonUtil {
 		}
 		return systemTime;
 	}
-
+	/**
+	 * 格式化日期
+	 * @param time
+	 * @param format
+	 * @return
+	 */
+	public static String dateFormat(String time, String format) {
+		String systemTime = null;
+		try {
+			SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+			Date date = sdf.parse(time);
+			SimpleDateFormat todf = new SimpleDateFormat(format);// 设置日期格式
+			systemTime = todf.format(date);
+		} catch (Exception ex) {
+			return systemTime;
+		}
+		return systemTime;
+	}
 	/**
 	 * getting special format's date string
 	 * 

+ 0 - 1
src/main/webapp/admin/ddy/reportManageDdy.html

@@ -158,7 +158,6 @@
       }
       
       function showDetail(data){
-    	  debugger;
     	  var openPageId = pageId + "-02";
     	  openMainTabPage(openPageId, "详情查看", "ddy/reportManageDetailDdy.html?pageId="+openPageId+"&reportId="+data.id+"&type="+data.type+"&typeId="+data.typeId+"&fileName="+chineseUrlEncode(data.fileName), '', pageId, null);
       }

+ 17 - 15
src/main/webapp/admin/ddy/reportManageDetailDdy.html

@@ -15,7 +15,7 @@
 	var pageId = getQueryString("pageId");
 	var reportId = getQueryString("reportId");		//报告id
 	var fileName = chineseUrlDecodeURI(getQueryString("fileName"));	//报告名称
-	
+	var dayInterval = getQueryString("dayInterval");	//日区间
 	var type = getQueryString("type");		//报告类型00:excel 01:word
 	var typeId = getQueryString("typeId");	//报告类型id
 	
@@ -32,7 +32,7 @@
 			success : function(data) {
 				var reportDataJsonStr = data.data.data;
 				var excelList = eval('(' + reportDataJsonStr + ')');
-				reportTable(excelList, typeId);
+				reportTable(excelList, typeId,true);
 			},
 			error : function(data2) {
 				$.ErrorAlert(data2.MINErrorMessage);
@@ -43,28 +43,30 @@
 		
 	}
 	
-	function reportTable(excelList, typeId, isEdit) {
+	function reportTable(excelList, typeId,isType,isEdit) {
 		var html = '';
+		if(isType){
+			html = '<tr><td colspan = "'+excelList[1].length+'">'+excelList[0]+'</td></tr>';
+		}
 		for (var i = 0; i < excelList.length; i ++) {
+			if(i==0){
+				continue;
+			}
 			html += '<tr>';
 			var excelChildList = excelList[i];
 			for (var j = 0; j < excelChildList.length; j ++) {
 				// 合计列增加穿透
-				if ((j == excelChildList.length - 1)) {
+				if (j==6) {
 					// 台区停电次数
-					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 {
+					if(excelChildList[7]>=15&excelChildList[7]<48){
+						html += '<td style="background: #c74141">' + excelChildList[j] + '</td>';
+					}else if(excelChildList[7]>=48){
+						html += '<td style="background: #ff8204">' + excelChildList[j] + '</td>';
+					}else{
 						html += '<td>' + excelChildList[j] + '</td>';
 					}
+					
+					// 2个月停电3次及以上台区
 				} else {
 					html += '<td>' + excelChildList[j] + '</td>';
 				}

+ 3 - 2
src/main/webapp/admin/ddy/reportManageUpdateDdy.html

@@ -21,6 +21,7 @@
 	var pageId = getQueryString("pageId");
 	var reportId = getQueryString("reportId");		//报告id
 	var fileName = chineseUrlDecodeURI(getQueryString("fileName"));	//报告名称
+	var dayInterval = chineseUrlDecodeURI(getQueryString("dayInterval"));	//日区间
 	
 	var type = getQueryString("type");		//报告类型00:excel 01:word
 	var typeId = getQueryString("typeId");	//报告类型id
@@ -38,7 +39,7 @@
 			success : function(data) {
 				var reportDataJsonStr = data.data.data;
 				var excelList = eval('(' + reportDataJsonStr + ')');
-				reportTable(excelList, typeId, true);
+				reportTable(excelList, typeId,true,true);
 			},
 			error : function(data2) {
 				$.ErrorAlert(data2.MINErrorMessage);
@@ -48,7 +49,7 @@
 	} else {
 		
 	}
-	
+
 
 	function saveReport() {
 		// excel

+ 1 - 1
src/main/webapp/admin/ddy/reportProduceDdy.html

@@ -348,7 +348,7 @@
 				success : function(data) {
 					if (data.code == 0) {
 						excelList = data.data.resList;
-						initExcelData(excelList, "reportTable", false);
+						initExcelData(excelList, "reportTable", false,true);
 						goStep(3);
 			    	} else {
 			    		$.ErrorAlert(res.MINErrorMessage);

+ 21 - 4
src/main/webapp/js/report.js

@@ -3,10 +3,19 @@ var TQTDZB = "TQTDZB";	//台区停电周报
 
 
 // 拼接报表格式
-function reportTable(excelList, typeId, isEdit) {
-	var editHtml;
+function reportTable(excelList, typeId, isEdit,isType) {
 	var html = '';
+	if(isType){
+		html = '<tr><td colspan = "'+excelList[1].length+'">'+excelList[0]+'</td></tr>';
+	}
+	var editHtml;
+	
 	for (var i = 0; i < excelList.length; i ++) {
+		if(isType){
+			if(i == 0){
+				continue;
+			}
+		}
 		html += '<tr>';
 		var excelChildList = excelList[i];
 		for (var j = 0; j < excelChildList.length; j ++) {
@@ -139,14 +148,22 @@ function tableCountTQTDZB(t, typeId, rowIndex, colIndex) {
 
 
 // excel数据拼接table
-function initExcelData(excelList, tableId, isEdit) {
+function initExcelData(excelList, tableId, isEdit,isType) {
 	var html = '';
-	
+	if(isType){
+		html = '<tr><td colspan = "'+excelList[1].length+'">'+excelList[0]+'</td></tr>';
+	}
 	var tdHtml = '<td>';
 	if (isEdit) {
 		tdHtml = '<td contenteditable = "true">';
 	}
+	
 	for (var i = 0; i < excelList.length; i ++) {
+		if(isType){
+			if(i == 0){
+				continue;
+			}
+		}
 		html += '<tr>';
 		var excelChildList = excelList[i];
 		for (var j = 0; j < excelChildList.length; j ++) {