瀏覽代碼

市自来水更新:
1.更改泵组优化接口调用预测时间增加未来一天
2.增加营业片区小时实际用水量数据定时任务
3.更改预测的组织机构条件范围查新
4.更改营业片区预测插值bug和原始数据采集bug
5.更改小时水量预测查询接口,支持查询营业所数据
6.优化数据库链接回收机制
7.15分钟预测值查询接口支持营业所查询
8.15分钟实际值查询接口支持营业所查询
9.江津版本优化
10.自来水15分钟预测数据采集bug修复
11.自来水重启服务数据检查机制优化

1037015548@qq.com 3 周之前
父節點
當前提交
b5388242b6

+ 23 - 8
src/main/java/com/shkpr/service/aimodelpower/bizmgr/KprAimTapWaterBizFun.java

@@ -289,6 +289,9 @@ public class KprAimTapWaterBizFun {
             String startDate = newStartDateTime.format(formater);
             String endDate = today.withMinute(1).withSecond(0).format(formater);
             final CountDownLatch latch = new CountDownLatch(selfconfess.keySet().size());
+            List<String> closeTag = new ArrayList<>();
+            closeTag.add("FSBSC_MAS.MAS.TOTALFLOWD");
+            closeTag.add("fsbsc_mas.mas.totalflowg");
             for (String orgName:selfconfess.keySet()) {
                 try {
                     ThreadTaskMgr.runTask(new TraceRunnable(TraceLogMgr.getTraceId()) {
@@ -313,9 +316,9 @@ public class KprAimTapWaterBizFun {
                                 Double supplyInValue = null;
                                 Double confessValue = null;
                                 try {
-                                    selfValue = selfconfess(tagTags, startDate, endDate, startTime, endTime);//自供
-                                    supplyInValue = selfconfess(tagTags2, startDate, endDate, startTime, endTime);//供入
-                                    confessValue = selfconfess(tagTags3, startDate, endDate, startTime, endTime);//供出
+                                    selfValue = selfconfess(tagTags, startDate, endDate, startTime, endTime,orgName+"(自供)",closeTag);//自供
+                                    supplyInValue = selfconfess(tagTags2, startDate, endDate, startTime, endTime,orgName+"(供入)",null);//供入
+                                    confessValue = selfconfess(tagTags3, startDate, endDate, startTime, endTime,orgName+"(供出)",null);//供出
                                 } catch (Exception ex) {
 
                                 }
@@ -332,7 +335,7 @@ public class KprAimTapWaterBizFun {
                                     }
                                 }
                                 recordAllEntity.put("value", value);
-                                System.out.println("营业所片区" + orgName + "值:" + value + ",采集时间:" + newStartDateTime.minusMinutes(-((i + 1) * 15)).format(formater));
+//                                System.out.println("营业所片区" + orgName + "值:" + value + ",采集时间:" + newStartDateTime.minusMinutes(-((i + 1) * 15)).format(formater));
                                 List<Map<String, Object>> queryWaterRecord = getWaterTapWaterApi().getWaterCollectionRecordAllListNew(1, 0,
                                         " WHERE org_name = '" + recordAllEntity.get("org_name")
                                                 + "' AND time = '" + recordAllEntity.get("time") + "' AND value_tag = '" + recordAllEntity.get("value_tag") + "'");
@@ -416,6 +419,9 @@ public class KprAimTapWaterBizFun {
             LocalDateTime newStartDateTime = startDateTime;
             String startDate = newStartDateTime.format(formater);
             String endDate = today.withMinute(1).withSecond(0).format(formater);
+            List<String> closeTag = new ArrayList<>();
+            closeTag.add("FSBSC_MAS.MAS.TOTALFLOWD");
+            closeTag.add("fsbsc_mas.mas.totalflowg");
             final CountDownLatch latch = new CountDownLatch(selfconfess.keySet().size());
             for (String orgName:selfconfess.keySet()) {
                 try {
@@ -441,9 +447,9 @@ public class KprAimTapWaterBizFun {
                                 Double supplyInValue = null;
                                 Double confessValue = null;
                                 try {
-                                    selfValue = selfconfess(tagTags, startDate, endDate, startTime, endTime);//自供
-                                    supplyInValue = selfconfess(tagTags2, startDate, endDate, startTime, endTime);//供入
-                                    confessValue = selfconfess(tagTags3, startDate, endDate, startTime, endTime);//供出
+                                    selfValue = selfconfess(tagTags, startDate, endDate, startTime, endTime,orgName+"(自供)",closeTag);//自供
+                                    supplyInValue = selfconfess(tagTags2, startDate, endDate, startTime, endTime,orgName+"(供入)",null);//供入
+                                    confessValue = selfconfess(tagTags3, startDate, endDate, startTime, endTime,orgName+"(供出)",null);//供出
                                 } catch (Exception ex) {
 
                                 }
@@ -520,7 +526,7 @@ public class KprAimTapWaterBizFun {
         }
     }
     //TODO 计算总值
-    private static Double selfconfess(List<String> tagTags,String startDate,String endDate,String startTime,String endTime) throws Exception{
+    private static Double selfconfess(List<String> tagTags,String startDate,String endDate,String startTime,String endTime,String desc,List<String> closeTag) throws Exception{
         Double value = null;
         if (tagTags==null){
             return value;
@@ -530,6 +536,12 @@ public class KprAimTapWaterBizFun {
             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
             // 解析字符串以创建 LocalDateTime 实例
             LocalDateTime dateTime = LocalDateTime.parse(endTime, formatter);
+            if(closeTag!=null&&closeTag.size()>0){
+                if(closeTag.contains(tagTag)){
+                    //如果存在就过滤 结束当前 循环
+                    continue;
+                }
+            }
             if (dateTime.getHour()==0&&dateTime.getMinute()==16&&("OPC_SC.HSS.HSS1.AI.LJLL1.F_CV".equals(tagTag) ||
                     "OPC_SC.HSS.HSS1.AI.LJLL2.F_CV".equals(tagTag) ||
                     "OPC_SC.HSS.HSS1.AI.LJLL3.F_CV".equals(tagTag))) {
@@ -550,6 +562,7 @@ public class KprAimTapWaterBizFun {
                         value += tapWaterHistoryList.get((tapWaterHistoryList.size() - 1)).get("VAL") != null ? Double.valueOf(tapWaterHistoryList.get((tapWaterHistoryList.size() - 1)).get("val").toString()) : null;
                     }
                 }
+                System.out.println("设施名:"+desc+";时间范围:"+startTime+"--"+endTime+";设备标签:"+tagTag+";用水量:"+value);
             }else {
                 Integer itemCount = getWaterTapWaterApi().getTabWaterHistoryCount(
                         " WHERE TAG_CODE = '" + tagTag + "' " +
@@ -573,9 +586,11 @@ public class KprAimTapWaterBizFun {
                             value += Math.abs(lastValue - firstValue);
                         }
                     }
+                    System.out.println("设施名:"+desc+";时间范围:"+startTime+"--"+endTime+";设备标签:"+tagTag+";用水量:"+value);
                 }
             }
         }
+//        System.out.println("设施名:"+desc+";时间范围:"+startTime+"--"+endTime+";用水量:"+value+";总值:"+value);
         return value;
     }
 

文件差異過大導致無法顯示
+ 2 - 2
src/main/java/com/shkpr/service/aimodelpower/globalmgr/ScheduleTaskMgr.java