Browse Source

生成日报

zmy18710171902 4 years ago
parent
commit
871e967fce

+ 37 - 2
src/main/java/com/minpay/common/service/impl/ReportServiceImpl.java

@@ -14,6 +14,7 @@ import java.util.Map;
 import com.minpay.common.util.*;
 import com.minpay.db.table.own.mapper.IReportBatchMapper;
 import net.sf.json.JSONObject;
+import net.sf.json.JsonConfig;
 import org.apache.commons.fileupload.FileItem;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 
@@ -361,6 +362,41 @@ public class ReportServiceImpl implements IReportService {
 				}
 			}
 			//配变
+			List<Map<String, String>>  pbgzzList = db.getMybatisMapper(IReportBatchMapper.class).selectPbgzzData(map);
+
+			Float maxPb = 0f;
+			String maxPbName = "";
+			Map<String,Object> pbTemp = new HashMap<String,Object>();
+			Map<String,Object> pbTemp2 = new HashMap<String,Object>();
+
+			JSONArray ja3 = new JSONArray();
+			JSONArray ja4 = new JSONArray();
+			JSONObject jo3 = new JSONObject();
+			JSONObject jo4 = new JSONObject();
+			if(pbgzzList != null && !pbgzzList.isEmpty()){
+				int size = pbgzzList.size();
+				for (int i = 0; i < pbgzzList.size(); i++) {
+					Map<String,String> temp = pbgzzList.get(i);
+					String fzl = temp.get("DFD9_FZL");
+					String key = temp.get("KEYSS");
+					if(StringUtil.ObjToFloat(fzl) > 100){//过载
+						if(pbTemp.containsKey(key)){
+							continue;
+						}else{
+							jo3 = JSONObject.fromObject(temp);
+							pbTemp.put(key,"1");
+						}
+					}else{//重载
+						if(pbTemp2.containsKey(key)){
+							continue;
+						}else{
+							jo4 = JSONObject.fromObject(temp);
+							pbTemp2.put(key,"1");
+						}
+					}
+				}
+
+			}
 			rstMap.put("result2",ja2);
 			rstMap.put("result",ja);
 			Map<String,Object> param = new HashMap<String,Object>();
@@ -375,7 +411,7 @@ public class ReportServiceImpl implements IReportService {
 	}
 
 	/**
-	 * 获取描述信息
+	 * 获取线路描述信息
 	 * @param ja 重载
 	 * @param ja2 过载
 	 * @param param 附加参数
@@ -458,7 +494,6 @@ public class ReportServiceImpl implements IReportService {
 			rst2.append("过载时长最长" + StringUtil.ObjToFloat(param.get("maxZzsc")) + "小时,平均负载率为" + maxXlName + "%。");
 			rst2.append("不涉及电采暖线路。");
 		}
-
 		list.add(rst.toString());
 		list.add(rst2.toString());
 		return list;

+ 7 - 0
src/main/java/com/minpay/db/table/own/mapper/IReportBatchMapper.java

@@ -27,4 +27,11 @@ public interface IReportBatchMapper  extends IMINMybatisMapper {
      * @return
      */
     List<Map<String, String>> selectXlgzzData(Map<String, Object> map);
+
+    /**
+     * 查询配变重过载数据
+     * @param map
+     * @return
+     */
+    List<Map<String, String>> selectPbgzzData(Map<String, Object> map);
 }

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

@@ -80,6 +80,7 @@
         </foreach>
         ) A
     </insert>
+    <!--线路重过载查询-->
     <select id="selectXlgzzData" resultType="map" parameterType="map">
         SELECT
             DFD10_XGSMC,
@@ -87,7 +88,11 @@
             DFD10_XLMC,
             CONCAT_WS( "-", DFD10_XGSMC, DFD10_BZMC, DFD10_XLMC ) KEYSS,
             DFD10_GZSC,
-            DFD10_FZL
+            DFD10_FZL,
+            DFD10_GZZYY,
+            DFD10_GZZJTYY,
+            DFD10_JJCSFL,
+            DFD10_JTJJCS
         FROM
             dw_file_detail_10
         WHERE
@@ -105,6 +110,27 @@
             DFD10_XGSMC,
             DFD10_BZMC,
             DFD10_XLMC
+    </select>
+    <!--配变重过载查询-->
+    <select id="selectPbgzzData" resultType="map" parameterMap="map">
+        SELECT
+            DFD9_UNIT,
+            DFD9_BZMC,
+            DFD9_GBMC,
+            CONCAT_WS( "-", DFD9_UNIT, DFD9_BZMC, DFD9_GBMC ) KEYSS,
+            DFD9_ZZSC,
+            DFD9_FZL,
+            DFD9_ZDFZL,
+            DFD9_GZZYYFL,
+            DFD9_JTYY,
+            DFD9_JJCSFL,
+            DFD9_JTJJCS,
+            DFD9_GZSC
+        FROM
+            DW_FILE_DETAIL_09
+            WHERE 1 = 1
+            AND DFD9_ZDFZLFSSK BETWEEN #{start} AND #{end}
 
+            ORDER BY   DFD9_UNIT,DFD9_BZMC,DFD9_GBMC
     </select>
 </mapper>

+ 58 - 34
src/main/webapp/admin/xlgzz/reportProduceXlgzz.html

@@ -87,20 +87,25 @@
 			<div class="layui-tab-content">
 				<div class="layui-tab-item layui-show">
 					<p id ="desc1" class="desc_label"></p>
-					<p id ="desc11" class="desc_label">未发生线路过载</p>
+					<br>
+					<p id ="desc11" class="desc_label"></p>
+					<br>
 					<p class="desc_label" style="color: #ff0000;">注:线路负载率持续1小时在70%-100%为重载,持续1小时在100%以上为过载。</p>
-
+					<br>
 					<table id="demo" lay-filter="test"></table>
 				</div>
 				<div class="layui-tab-item">
-					<p id ="desc2">&nbsp;&nbsp;&nbsp;&nbsp;
-						</p>
-					<p><br>注:配变负载率连续2小时在80%-100%之间为重载,连续2小时在100%以上为过载。</p>
+					<p id ="desc2"  class="desc_label"></p>
+					<br>
+					<p  class="desc_label"  style="color: #ff0000;">注:配变负载率连续2小时在80%-100%之间为重载,连续2小时在100%以上为过载。</p>
+					<br>
 					<table id="demo2" lay-filter="test"></table>
 				</div>
 				<div class="layui-tab-item">
-					<p  id ="desc3">&nbsp;&nbsp;&nbsp;&nbsp;受理抢修类工单47件,万户报修率0.181,全省排名第5,报修率较低的为东平,较高的为岱岳。抢修到达现场及时率100%;岱岳超70分钟工单2件。" +
-						"疑似虚假回单0件。无因报修引发的诉求升级工单。全年累计受理抢修类工单305件,万户报修率1.173,全省排名第3。不涉及电采暖用户</p>
+					<p  id ="desc3"  class="desc_label"></p>
+					<br>
+					<p  class="desc_label"  style="color: #ff0000;">注:台区停电数据来源于供服系统</p>
+					<br>
 					<table id="demo3" lay-filter="test"></table>
 				</div>
 
@@ -146,12 +151,14 @@
 	    	var $ = layui.$;
     	    $step = $("#step_demo").step();
 		})
+		var $element;
 		layui.use('element', function(){
-			var element = layui.element;
+			$element= layui.element;
 			//一些事件触发
-			element.on('tab(demo)', function(data){
+			$element.on('tab(demo)', function(data){
 				console.log(data);
 			});
+
 		});
 		layui.use('laydate', function(){
 			var laydate = layui.laydate;
@@ -338,28 +345,8 @@
 			for (var i =0;i<100;i++){
 				data.push({id:i,username:'2',sex:'3',city:'4',sign:'5'});
 			}
-			$table.render({
-				elem: '#demo2'
-				,limit:100
-				,cols: [[ //表头
-					{field: 'id', title: 'ID', width:80}
-					,{field: 'username', title: '用户名', width:80}
-					,{field: 'sex', title: '性别', width:80}
-					,{field: 'city', title: '城市', width:80}
-				]],
-				data:data
-			});
-			$table.render({
-				elem: '#demo3'
-				,limit:100
-				,cols: [[ //表头
-					{field: 'id', title: 'ID', width:80}
-					,{field: 'username', title: '用户名', width:80}
-					,{field: 'sex', title: '性别', width:80}
-					,{field: 'city', title: '城市', width:80}
-				]],
-				data:data
-			});
+
+
 			var reportInf = $("#reportTypeDiv").find("select option:selected").val();//所选报表类型
 			var dayRange = $("#dayRange").val();//日报-年月日
 			var dateRange = $("#dateRange").val();//周报-年月日-年月日
@@ -397,12 +384,13 @@
 					monthNum : monthNum,//无用
 					countNum : countNum//无用
 				},
-				success : function(data) {
+				success : function(data) {debugger
 					if (data.code == 0) {//查询结果集成功
 						// 日报
 						if (timeType == '00') {
 							$("#gongjubiao").hide();
 							$("#reportTable").show();
+							$element.tabDelete('demo', '22');
 							//渲染表格
 							$table.render({
 								elem: '#demo'
@@ -416,7 +404,7 @@
 								]],
 								data:data.data.resList.result
 							});
-							debugger
+
 							$("#desc1").html("&nbsp;&nbsp;&nbsp;"+data.data.resList.descStr[0]);
 
 							$("#desc11").html("&nbsp;&nbsp;&nbsp;"+data.data.resList.descStr[1]);
@@ -424,9 +412,45 @@
 							goStep(3);
 						// 月报 或 周报
 						} else if (timeType == '02' || timeType == '01') {
+							$table.render({
+								elem: '#demo2'
+								,limit:100
+								,cols: [[ //表头
+									{field: 'id', title: '单位', width:150}
+									,{field: 'username', title: '供电所', width:150}
+									,{field: 'sex', title: '公变名称', width:150}
+									,{field: 'city', title: '过载时长', width:150}
+									,{field: 'city', title: '平均负载率(%)', width:150}
+									,{field: 'city', title: '原因', width:150}
+									,{field: 'city', title: '解决措施', width:150}
 
+								]],
+								data:data
+							});
 						}
-						
+						$table.render({
+							elem: '#demo3'
+							,limit:100
+							,cols: [[ //表头
+								{field: 'id', title: '单位\\分类', width:150,rowspan:2}
+								,{field: 'username', title: '客户总量(户)', width:150,rowspan:2}
+								,{field: 'sex', title: '平均到达现场时间(分)', width:150,rowspan:2}
+								,{field: 'city', title: '工单处理平均时长(分)', width:150,rowspan:2}
+								,{field: 'city', title: '到达现场超时数', width:150,rowspan:2}
+								,{field: 'city', title: '工单时长超70分钟数', width:150,rowspan:2}
+								,{field: 'city', title: '故障类型', width:600,colspan:4}
+								,{field: 'city', title: '疑似虚假回单', width:150}
+								,{field: 'city', title: '工单总数', width:150}
+								,{field: 'city', title: '万户报修率', width:150}
+							],
+								[
+									{field: 'username', title: '客户内部故障', width:150}
+									,{field: 'username', title: '低压故障', width:150}
+									,{field: 'username', title: '非电力故障', width:150}
+									,{field: 'username', title: '电能质量等故障', width:150}
+								]],
+							data:data
+						});
 			    	} else {
 			    		$.ErrorAlert(res.MINErrorMessage);
 			    	}