|
@@ -289,6 +289,9 @@ public class KprAimTapWaterBizFun {
|
|
String startDate = newStartDateTime.format(formater);
|
|
String startDate = newStartDateTime.format(formater);
|
|
String endDate = today.withMinute(1).withSecond(0).format(formater);
|
|
String endDate = today.withMinute(1).withSecond(0).format(formater);
|
|
final CountDownLatch latch = new CountDownLatch(selfconfess.keySet().size());
|
|
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()) {
|
|
for (String orgName:selfconfess.keySet()) {
|
|
try {
|
|
try {
|
|
ThreadTaskMgr.runTask(new TraceRunnable(TraceLogMgr.getTraceId()) {
|
|
ThreadTaskMgr.runTask(new TraceRunnable(TraceLogMgr.getTraceId()) {
|
|
@@ -313,9 +316,9 @@ public class KprAimTapWaterBizFun {
|
|
Double supplyInValue = null;
|
|
Double supplyInValue = null;
|
|
Double confessValue = null;
|
|
Double confessValue = null;
|
|
try {
|
|
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) {
|
|
} catch (Exception ex) {
|
|
|
|
|
|
}
|
|
}
|
|
@@ -332,7 +335,7 @@ public class KprAimTapWaterBizFun {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
recordAllEntity.put("value", value);
|
|
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,
|
|
List<Map<String, Object>> queryWaterRecord = getWaterTapWaterApi().getWaterCollectionRecordAllListNew(1, 0,
|
|
" WHERE org_name = '" + recordAllEntity.get("org_name")
|
|
" WHERE org_name = '" + recordAllEntity.get("org_name")
|
|
+ "' AND time = '" + recordAllEntity.get("time") + "' AND value_tag = '" + recordAllEntity.get("value_tag") + "'");
|
|
+ "' AND time = '" + recordAllEntity.get("time") + "' AND value_tag = '" + recordAllEntity.get("value_tag") + "'");
|
|
@@ -416,6 +419,9 @@ public class KprAimTapWaterBizFun {
|
|
LocalDateTime newStartDateTime = startDateTime;
|
|
LocalDateTime newStartDateTime = startDateTime;
|
|
String startDate = newStartDateTime.format(formater);
|
|
String startDate = newStartDateTime.format(formater);
|
|
String endDate = today.withMinute(1).withSecond(0).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());
|
|
final CountDownLatch latch = new CountDownLatch(selfconfess.keySet().size());
|
|
for (String orgName:selfconfess.keySet()) {
|
|
for (String orgName:selfconfess.keySet()) {
|
|
try {
|
|
try {
|
|
@@ -441,9 +447,9 @@ public class KprAimTapWaterBizFun {
|
|
Double supplyInValue = null;
|
|
Double supplyInValue = null;
|
|
Double confessValue = null;
|
|
Double confessValue = null;
|
|
try {
|
|
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) {
|
|
} catch (Exception ex) {
|
|
|
|
|
|
}
|
|
}
|
|
@@ -520,7 +526,7 @@ public class KprAimTapWaterBizFun {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//TODO 计算总值
|
|
//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;
|
|
Double value = null;
|
|
if (tagTags==null){
|
|
if (tagTags==null){
|
|
return value;
|
|
return value;
|
|
@@ -530,6 +536,12 @@ public class KprAimTapWaterBizFun {
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
// 解析字符串以创建 LocalDateTime 实例
|
|
// 解析字符串以创建 LocalDateTime 实例
|
|
LocalDateTime dateTime = LocalDateTime.parse(endTime, formatter);
|
|
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) ||
|
|
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.LJLL2.F_CV".equals(tagTag) ||
|
|
"OPC_SC.HSS.HSS1.AI.LJLL3.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;
|
|
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 {
|
|
}else {
|
|
Integer itemCount = getWaterTapWaterApi().getTabWaterHistoryCount(
|
|
Integer itemCount = getWaterTapWaterApi().getTabWaterHistoryCount(
|
|
" WHERE TAG_CODE = '" + tagTag + "' " +
|
|
" WHERE TAG_CODE = '" + tagTag + "' " +
|
|
@@ -573,9 +586,11 @@ public class KprAimTapWaterBizFun {
|
|
value += Math.abs(lastValue - firstValue);
|
|
value += Math.abs(lastValue - firstValue);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ System.out.println("设施名:"+desc+";时间范围:"+startTime+"--"+endTime+";设备标签:"+tagTag+";用水量:"+value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+// System.out.println("设施名:"+desc+";时间范围:"+startTime+"--"+endTime+";用水量:"+value+";总值:"+value);
|
|
return value;
|
|
return value;
|
|
}
|
|
}
|
|
|
|
|