소스 검색

线路重过载日报

zmy18710171902 4 년 전
부모
커밋
530e79d1c3
1개의 변경된 파일90개의 추가작업 그리고 1개의 파일을 삭제
  1. 90 1
      src/main/java/com/minpay/common/service/impl/ReportServiceImpl.java

+ 90 - 1
src/main/java/com/minpay/common/service/impl/ReportServiceImpl.java

@@ -385,6 +385,10 @@ public class ReportServiceImpl implements IReportService {
 						}else{
 							jo3 = JSONObject.fromObject(temp);
 							pbTemp.put(key,"1");
+							Map<String,String> str = this.getXlPbgzzTjByParam(pbgzzList,key,"1");
+							jo3.put("sum",str.get("sc"));
+							jo3.put("avg",ArithUtils.div(str.get("pjfzl"),str.get("xlts")));
+							ja3.add(jo3);
 						}
 					}else{//重载
 						if(pbTemp2.containsKey(key)){
@@ -392,11 +396,15 @@ public class ReportServiceImpl implements IReportService {
 						}else{
 							jo4 = JSONObject.fromObject(temp);
 							pbTemp2.put(key,"1");
+							Map<String,String> str = this.getXlPbgzzTjByParam(pbgzzList,key,"2");
+							jo4.put("sum",str.get("sc"));
+							jo4.put("avg",ArithUtils.div(str.get("pjfzl"),str.get("xlts")));
+							ja4.add(jo4);
 						}
 					}
 				}
-
 			}
+
 			rstMap.put("result2",ja2);
 			rstMap.put("result",ja);
 			Map<String,Object> param = new HashMap<String,Object>();
@@ -404,13 +412,94 @@ public class ReportServiceImpl implements IReportService {
 			param.put("maxXlName",maxXlName);
 			param.put("maxZzsc2",maxZzsc2);
 			param.put("maxXlName2",maxXlName2);
+			//获取配变过载数据最大值
+			this.getMaxPbByParam(ja,ja2,param);
+			//获取配变重载数据最大值
 			rstMap.put("descStr",this.getXlgzzDesc(ja,ja2,param));
+//			rstMap.put("descStr2",this.getXlPbgzzDesc(ja3,ja4,param2));
+
 
 		}
 		return rstMap;
 	}
 
 	/**
+	 *
+	 * @param ja
+	 * @param ja2
+	 * @param param
+	 */
+	private void getMaxPbByParam(JSONArray ja, JSONArray ja2, Map<String, Object> param) {
+		//获取配变数据最大值
+		float maxPb1 = 0;
+		String gbmc = "";
+		String reason = "";
+		String cs = "";
+		if(ja != null && !ja.isEmpty()){
+			int size = ja.size();
+			for (int i = 0; i < size; i++) {
+				JSONObject jo = ja.getJSONObject(i);
+				float fzl = StringUtil.ObjToFloat(jo.getString("DFD10_GZSC"));
+				if(maxPb1 < fzl){
+					maxPb1 = fzl;
+					gbmc = jo.getString("DFD9_GBMC");
+					reason =  jo.getString("DFD9_JTYY");
+					cs = jo.getString("DFD9_JTJJCS");
+
+				}
+			}
+		}else{
+
+		}
+
+	}
+
+	/**
+	 * 获取线路配变重过载数据
+	 * @param pbgzzList
+	 * @param key
+	 * @return
+	 */
+	private Map<String, String> getXlPbgzzTjByParam(List<Map<String, String>> pbgzzList, String key,String type) {
+		Map<String,String> rstMap = new HashMap<String,String>();
+		rstMap.put("sc","");
+		rstMap.put("pjfzl","");
+		rstMap.put("xlts","");
+		if(pbgzzList == null || pbgzzList.isEmpty()){
+			return rstMap;
+		}else{
+			int size = pbgzzList.size();
+			float sum = 0f;
+			float avg = 0f;
+			int index = 0;
+			for (int i = 0; i < size; i++) {
+				Map<String,String> temp = pbgzzList.get(i);
+				String fzl = temp.get("DFD10_FZL");
+				if("1".equals(type) && StringUtil.ObjToFloat(fzl) > 100){//过载
+					String tempkey = temp.get("KEYSS");//单位
+					if(tempkey.equals(key)){
+						sum =  ArithUtils.add(String.valueOf(sum),String.valueOf(temp.get("DFD10_GZSC")));
+						avg = ArithUtils.add(String.valueOf(avg),String.valueOf(temp.get("DFD10_FZL")));
+						index ++;
+					}
+				}else if("2".equals(type) && StringUtil.ObjToFloat(fzl) <= 100 && StringUtil.ObjToFloat(fzl) >= 80) {//重载
+					String tempkey = temp.get("KEYSS");//单位
+					if(tempkey.equals(key)){
+						sum =  ArithUtils.add(String.valueOf(sum),String.valueOf(temp.get("DFD10_GZSC")));
+						avg = ArithUtils.add(String.valueOf(avg),String.valueOf(temp.get("DFD10_FZL")));
+						index ++;
+					}
+				}
+
+			}
+			rstMap.put("sc",StringUtil.ObjectToString(sum));
+			rstMap.put("pjfzl",StringUtil.ObjectToString(avg));
+			rstMap.put("xlts",StringUtil.ObjectToString(index));
+		}
+		return rstMap;
+	}
+
+	/**
 	 * 获取线路描述信息
 	 * @param ja 重载
 	 * @param ja2 过载