|
@@ -96,45 +96,45 @@ public class HealthOperationService {
|
|
|
List<ProBasicPowerstation> wpList = CacheContext.wpls;
|
|
|
for (int i = 0; i < wpList.size(); i++) {
|
|
|
|
|
|
- List<String> idls=new ArrayList<>();
|
|
|
-
|
|
|
- ProBasicPowerstationPoint point = proBasicPowerstationPointService.getPowerstationPoint(wpList.get(i).getId(), ContantXk.JKSLHG001);
|
|
|
- idls.add(point.getNemCode());// 合格(正常)
|
|
|
- // System.out.println("测点编号" +point.getNemCode());
|
|
|
- point = proBasicPowerstationPointService.getPowerstationPoint(wpList.get(i).getId(), ContantXk.JKSLLH001);
|
|
|
- idls.add(point.getNemCode());// 良好
|
|
|
- // System.out.println("测点编号" +point.getNemCode());
|
|
|
- point = proBasicPowerstationPointService.getPowerstationPoint(wpList.get(i).getId(), ContantXk.JKSLZY001);
|
|
|
- idls.add(point.getNemCode());// 注意
|
|
|
- // System.out.println("测点编号" +point.getNemCode());
|
|
|
- point = proBasicPowerstationPointService.getPowerstationPoint(wpList.get(i).getId(), ContantXk.JKSLYZ001);
|
|
|
- idls.add(point.getNemCode());// 严重
|
|
|
+ List<String> idls=new ArrayList<>();
|
|
|
+
|
|
|
+ ProBasicPowerstationPoint point = proBasicPowerstationPointService.getPowerstationPoint(wpList.get(i).getId(), ContantXk.JKSLHG001);
|
|
|
+ idls.add(point.getNemCode());// 合格(正常)
|
|
|
+ // System.out.println("测点编号" +point.getNemCode());
|
|
|
+ point = proBasicPowerstationPointService.getPowerstationPoint(wpList.get(i).getId(), ContantXk.JKSLLH001);
|
|
|
+ idls.add(point.getNemCode());// 良好
|
|
|
+ // System.out.println("测点编号" +point.getNemCode());
|
|
|
+ point = proBasicPowerstationPointService.getPowerstationPoint(wpList.get(i).getId(), ContantXk.JKSLZY001);
|
|
|
+ idls.add(point.getNemCode());// 注意
|
|
|
+ // System.out.println("测点编号" +point.getNemCode());
|
|
|
+ point = proBasicPowerstationPointService.getPowerstationPoint(wpList.get(i).getId(), ContantXk.JKSLYZ001);
|
|
|
+ idls.add(point.getNemCode());// 严重
|
|
|
|
|
|
//System.out.println("测点编号" +point.getNemCode());
|
|
|
- List<PointData> pols=realApiUtil.getRealData(idls);
|
|
|
+ List<PointData> pols=realApiUtil.getRealData(idls);
|
|
|
|
|
|
- if(!pols.isEmpty() && pols.size()==idls.size())
|
|
|
- {
|
|
|
- // System.out.println("取实时数据");
|
|
|
- Integer zc = ((Double) pols.get(0).getPointValueInDouble()).intValue();
|
|
|
+ if(!pols.isEmpty() && pols.size()==idls.size())
|
|
|
+ {
|
|
|
+ // System.out.println("取实时数据");
|
|
|
+ Integer zc = ((Double) pols.get(0).getPointValueInDouble()).intValue();
|
|
|
// System.out.println("ZC---"+zc);
|
|
|
- Integer lh = ((Double) pols.get(1).getPointValueInDouble()).intValue();
|
|
|
- // System.out.println("lh---"+lh);
|
|
|
- Integer zy = ((Double) pols.get(2).getPointValueInDouble()).intValue();
|
|
|
- // System.out.println("zy---"+zy);
|
|
|
- Integer yz = ((Double) pols.get(3).getPointValueInDouble()).intValue();
|
|
|
- // System.out.println("yz---"+yz);
|
|
|
-
|
|
|
- hgList.add(zc);
|
|
|
- lhList.add(lh);
|
|
|
- zyList.add(zy);
|
|
|
- yzList.add(yz);
|
|
|
-
|
|
|
- }
|
|
|
+ Integer lh = ((Double) pols.get(1).getPointValueInDouble()).intValue();
|
|
|
+ // System.out.println("lh---"+lh);
|
|
|
+ Integer zy = ((Double) pols.get(2).getPointValueInDouble()).intValue();
|
|
|
+ // System.out.println("zy---"+zy);
|
|
|
+ Integer yz = ((Double) pols.get(3).getPointValueInDouble()).intValue();
|
|
|
+ // System.out.println("yz---"+yz);
|
|
|
+
|
|
|
+ hgList.add(zc);
|
|
|
+ lhList.add(lh);
|
|
|
+ zyList.add(zy);
|
|
|
+ yzList.add(yz);
|
|
|
|
|
|
- name.add(wpList.get(i).getName());
|
|
|
}
|
|
|
|
|
|
+ name.add(wpList.get(i).getName());
|
|
|
+ }
|
|
|
+
|
|
|
mapstatus.put("hgList", hgList);
|
|
|
mapstatus.put("lhList", lhList);
|
|
|
mapstatus.put("zyList", zyList);
|
|
@@ -145,34 +145,34 @@ public class HealthOperationService {
|
|
|
List<ProBasicProject> pList = CacheContext.pjls;
|
|
|
for (int i = 0; i < pList.size(); i++) {
|
|
|
|
|
|
- List<String> idls=new ArrayList<>();
|
|
|
+ List<String> idls=new ArrayList<>();
|
|
|
|
|
|
- ProBasicPowerstationPoint point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLHG001);
|
|
|
- idls.add(point.getNemCode());// 合格(正常)
|
|
|
- point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLLH001);
|
|
|
- idls.add(point.getNemCode());// 良好
|
|
|
- point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLZY001);
|
|
|
- idls.add(point.getNemCode());// 注意
|
|
|
- point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLYZ001);
|
|
|
- idls.add(point.getNemCode());// 严重
|
|
|
+ ProBasicPowerstationPoint point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLHG001);
|
|
|
+ idls.add(point.getNemCode());// 合格(正常)
|
|
|
+ point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLLH001);
|
|
|
+ idls.add(point.getNemCode());// 良好
|
|
|
+ point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLZY001);
|
|
|
+ idls.add(point.getNemCode());// 注意
|
|
|
+ point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLYZ001);
|
|
|
+ idls.add(point.getNemCode());// 严重
|
|
|
|
|
|
- List<PointData> pols=realApiUtil.getRealData(idls);
|
|
|
+ List<PointData> pols=realApiUtil.getRealData(idls);
|
|
|
|
|
|
- if(!pols.isEmpty() && pols.size()==idls.size())
|
|
|
- {
|
|
|
- Integer zc = ((Double) pols.get(0).getPointValueInDouble()).intValue();
|
|
|
- Integer lh = ((Double) pols.get(1).getPointValueInDouble()).intValue();
|
|
|
- Integer zy = ((Double) pols.get(2).getPointValueInDouble()).intValue();
|
|
|
- Integer yz = ((Double) pols.get(3).getPointValueInDouble()).intValue();
|
|
|
+ if(!pols.isEmpty() && pols.size()==idls.size())
|
|
|
+ {
|
|
|
+ Integer zc = ((Double) pols.get(0).getPointValueInDouble()).intValue();
|
|
|
+ Integer lh = ((Double) pols.get(1).getPointValueInDouble()).intValue();
|
|
|
+ Integer zy = ((Double) pols.get(2).getPointValueInDouble()).intValue();
|
|
|
+ Integer yz = ((Double) pols.get(3).getPointValueInDouble()).intValue();
|
|
|
|
|
|
- hgList.add(zc);
|
|
|
- lhList.add(lh);
|
|
|
- zyList.add(zy);
|
|
|
- yzList.add(yz);
|
|
|
+ hgList.add(zc);
|
|
|
+ lhList.add(lh);
|
|
|
+ zyList.add(zy);
|
|
|
+ yzList.add(yz);
|
|
|
|
|
|
- }
|
|
|
- name.add(pList.get(i).getName());
|
|
|
}
|
|
|
+ name.add(pList.get(i).getName());
|
|
|
+ }
|
|
|
|
|
|
mapstatus.put("hgList", hgList);
|
|
|
mapstatus.put("lhList", lhList);
|
|
@@ -189,50 +189,40 @@ public class HealthOperationService {
|
|
|
Map<String, Object> mapstatus = new HashMap<String, Object>();
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
- List<Integer> lhList = new ArrayList<Integer>();
|
|
|
- List<Integer> zyList = new ArrayList<Integer>();
|
|
|
- List<Integer> yzList = new ArrayList<Integer>();
|
|
|
+
|
|
|
Calendar cl = Calendar.getInstance();
|
|
|
cl.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
cl.set(Calendar.MINUTE, 0);
|
|
|
cl.set(Calendar.SECOND, 0);
|
|
|
Long start = cl.getTimeInMillis();
|
|
|
Long end = new Date().getTime();
|
|
|
- List<Map<String,String>> nameList = new ArrayList<Map<String,String>>();
|
|
|
+ List<Map<String,String>> nameList = new ArrayList<>();
|
|
|
if ("1".equals(type)) {
|
|
|
List<ProBasicPowerstation> wpList = CacheContext.wpls;
|
|
|
Map<String,String> map=new HashMap<>();
|
|
|
for (int i = 0; i < wpList.size(); i++) {
|
|
|
- List<Integer> hgList = new ArrayList<Integer>();
|
|
|
- List<String> tList = new ArrayList<String>();
|
|
|
+ List<Integer> hgList = new ArrayList<>();
|
|
|
+ List<String> tList = new ArrayList<>();
|
|
|
|
|
|
if ("1".equals(status)) {
|
|
|
ProBasicPowerstationPoint point = proBasicPowerstationPointService.getPowerstationPoint(wpList.get(i).getId(), ContantXk.JKSLHG001);
|
|
|
String hgCode = point.getNemCode();// 合格(正常)
|
|
|
point = proBasicPowerstationPointService.getPowerstationPoint(wpList.get(i).getId(), ContantXk.JKSLLH001);
|
|
|
String lhCode = point.getNemCode();// 良好
|
|
|
- List<PointData> phgList = realApiUtil.getHistoryDatasSnap(hgCode, start / 1000, end / 1000, 1L,
|
|
|
- 15 * 60L);
|
|
|
- List<PointData> plhList = realApiUtil.getHistoryDatasSnap(lhCode, start / 1000, end / 1000, 1L,
|
|
|
- 15 * 60L);
|
|
|
+ List<PointData> phgList = realApiUtil.getHistoryDatasSnap(hgCode, start / 1000, end / 1000, null,
|
|
|
+ 60 * 60L);
|
|
|
+ List<PointData> plhList = realApiUtil.getHistoryDatasSnap(lhCode, start / 1000, end / 1000, null,
|
|
|
+ 60 * 60L);
|
|
|
|
|
|
- if (!phgList.isEmpty() && !plhList.isEmpty() && phgList.size() >= plhList.size()) {
|
|
|
+ if (!phgList.isEmpty() && !plhList.isEmpty() && phgList.size() == plhList.size()) {
|
|
|
for (int ii = 0; ii < phgList.size(); ii++) {
|
|
|
- if (plhList.get(ii) == null) {
|
|
|
- Integer total = ((Double) phgList.get(ii).getPointValueInDouble()).intValue();
|
|
|
- String time = sdf.format(new Date(phgList.get(ii).getPointTime() * 1000));
|
|
|
- time = time.substring(time.length() - 5);
|
|
|
- hgList.add(total);
|
|
|
- tList.add(time);
|
|
|
- } else {
|
|
|
- Integer total = ((Double) phgList.get(ii).getPointValueInDouble()).intValue()
|
|
|
- + ((Double) plhList.get(ii).getPointValueInDouble()).intValue();
|
|
|
- String time = sdf.format(new Date(phgList.get(ii).getPointTime() * 1000));
|
|
|
- time = time.substring(time.length() - 5);
|
|
|
- hgList.add(total);
|
|
|
- tList.add(time);
|
|
|
- }
|
|
|
|
|
|
+ Integer total = ((Double) phgList.get(ii).getPointValueInDouble()).intValue()
|
|
|
+ + ((Double) plhList.get(ii).getPointValueInDouble()).intValue();
|
|
|
+ String time = sdf.format(new Date(phgList.get(ii).getPointTime() ));
|
|
|
+ time = time.substring(time.length() - 5);
|
|
|
+ hgList.add(total);
|
|
|
+ tList.add(time);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -247,27 +237,20 @@ public class HealthOperationService {
|
|
|
String zyCode = point.getNemCode();// 注意
|
|
|
point = proBasicPowerstationPointService.getPowerstationPoint(wpList.get(i).getId(), ContantXk.JKSLYZ001);
|
|
|
String yzCode = point.getNemCode();// 严重
|
|
|
- List<PointData> pzyList = realApiUtil.getHistoryDatasSnap(zyCode, start / 1000, end / 1000, 0L,
|
|
|
- 15 * 60L);
|
|
|
- List<PointData> pyzList = realApiUtil.getHistoryDatasSnap(yzCode, start / 1000, end / 1000, 0L,
|
|
|
- 15 * 60L);
|
|
|
+ List<PointData> pzyList = realApiUtil.getHistoryDatasSnap(zyCode, start / 1000, end / 1000, null,
|
|
|
+ 60 * 60L);
|
|
|
+ List<PointData> pyzList = realApiUtil.getHistoryDatasSnap(yzCode, start / 1000, end / 1000, null,
|
|
|
+ 60 * 60L);
|
|
|
|
|
|
- if (!pzyList.isEmpty() && !pyzList.isEmpty() && pzyList.size() >= pyzList.size()) {
|
|
|
+ if (!pzyList.isEmpty() && !pyzList.isEmpty() && pzyList.size() == pyzList.size()) {
|
|
|
for (int ii = 0; ii < pzyList.size(); ii++) {
|
|
|
- if (pyzList.get(ii) == null) {
|
|
|
- Integer total = ((Double) pzyList.get(ii).getPointValueInDouble()).intValue();
|
|
|
- String time = sdf.format(new Date(pzyList.get(ii).getPointTime() * 1000));
|
|
|
- time = time.substring(time.length() - 5);
|
|
|
- hgList.add(total);
|
|
|
- tList.add(time);
|
|
|
- } else {
|
|
|
- Integer total = ((Double) pzyList.get(ii).getPointValueInDouble()).intValue()
|
|
|
- + ((Double) pyzList.get(ii).getPointValueInDouble()).intValue();
|
|
|
- String time = sdf.format(new Date(pzyList.get(ii).getPointTime() * 1000));
|
|
|
- time = time.substring(time.length() - 5);
|
|
|
- hgList.add(total);
|
|
|
- tList.add(time);
|
|
|
- }
|
|
|
+
|
|
|
+ Integer total = ((Double) pzyList.get(ii).getPointValueInDouble()).intValue()
|
|
|
+ + ((Double) pyzList.get(ii).getPointValueInDouble()).intValue();
|
|
|
+ String time = sdf.format(new Date(pzyList.get(ii).getPointTime() ));
|
|
|
+ time = time.substring(time.length() - 5);
|
|
|
+ hgList.add(total);
|
|
|
+ tList.add(time);
|
|
|
|
|
|
mapstatus.put(wpList.get(i).getId(), hgList);
|
|
|
mapstatus.put("time", tList);
|
|
@@ -291,79 +274,59 @@ public class HealthOperationService {
|
|
|
List<String> tList = new ArrayList<String>();
|
|
|
|
|
|
|
|
|
- if ("1".equals(status)) {
|
|
|
- ProBasicPowerstationPoint point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLHG001);
|
|
|
- String hgCode = point.getNemCode();// 合格(正常)
|
|
|
- point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLLH001);
|
|
|
- String lhCode = point.getNemCode();// 良好
|
|
|
- List<PointData> phgList = realApiUtil.getHistoryDatasSnap(hgCode, start / 1000, end / 1000, 0L,
|
|
|
- 15 * 60L);
|
|
|
- List<PointData> plhList = realApiUtil.getHistoryDatasSnap(lhCode, start / 1000, end / 1000, 0L,
|
|
|
- 15 * 60L);
|
|
|
-
|
|
|
- if (!phgList.isEmpty() && !plhList.isEmpty() && phgList.size() >= plhList.size()) {
|
|
|
- for (int ii = 0; ii < phgList.size(); ii++) {
|
|
|
- if (plhList.get(ii) == null) {
|
|
|
- Integer total = ((Double) phgList.get(ii).getPointValueInDouble()).intValue();
|
|
|
- String time = sdf.format(new Date(phgList.get(ii).getPointTime() * 1000));
|
|
|
- time = time.substring(time.length() - 5);
|
|
|
- hgList.add(total);
|
|
|
- tList.add(time);
|
|
|
- } else {
|
|
|
- Integer total = ((Double) phgList.get(ii).getPointValueInDouble()).intValue()
|
|
|
- + ((Double) plhList.get(ii).getPointValueInDouble()).intValue();
|
|
|
- String time = sdf.format(new Date(phgList.get(ii).getPointTime() * 1000));
|
|
|
- time = time.substring(time.length() - 5);
|
|
|
- hgList.add(total);
|
|
|
- tList.add(time);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- mapstatus.put(pList.get(i).getNemCode(), hgList);
|
|
|
- mapstatus.put("time", tList);
|
|
|
+ if ("1".equals(status)) {
|
|
|
+ ProBasicPowerstationPoint point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLHG001);
|
|
|
+ String hgCode = point.getNemCode();// 合格(正常)
|
|
|
+ point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLLH001);
|
|
|
+ String lhCode = point.getNemCode();// 良好
|
|
|
+ List<PointData> phgList = realApiUtil.getHistoryDatasSnap(hgCode, start / 1000, end / 1000, null,
|
|
|
+ 60 * 60L);
|
|
|
+ List<PointData> plhList = realApiUtil.getHistoryDatasSnap(lhCode, start / 1000, end / 1000, null,
|
|
|
+ 60 * 60L);
|
|
|
+
|
|
|
+ if (!phgList.isEmpty() && !plhList.isEmpty() && phgList.size() == plhList.size()) {
|
|
|
+ for (int ii = 0; ii < phgList.size(); ii++) {
|
|
|
|
|
|
+ Integer total = ((Double) phgList.get(ii).getPointValueInDouble()).intValue()
|
|
|
+ + ((Double) plhList.get(ii).getPointValueInDouble()).intValue();
|
|
|
+ String time = sdf.format(new Date(phgList.get(ii).getPointTime() ));
|
|
|
+ time = time.substring(time.length() - 5);
|
|
|
+ hgList.add(total);
|
|
|
+ tList.add(time);
|
|
|
}
|
|
|
|
|
|
- } else {
|
|
|
- ProBasicPowerstationPoint point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLZY001);
|
|
|
- String zyCode = point.getNemCode();// 注意
|
|
|
- point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLYZ001);
|
|
|
- String yzCode = point.getNemCode();// 严重
|
|
|
- List<PointData> pzyList = realApiUtil.getHistoryDatasSnap(zyCode, start / 1000, end / 1000, 0L,
|
|
|
- 15 * 60L);
|
|
|
- List<PointData> pyzList = realApiUtil.getHistoryDatasSnap(yzCode, start / 1000, end / 1000, 0L,
|
|
|
- 15 * 60L);
|
|
|
-
|
|
|
- if (!pzyList.isEmpty() && !pyzList.isEmpty() && pzyList.size() >= pyzList.size()) {
|
|
|
- for (int ii = 0; ii < pzyList.size(); ii++) {
|
|
|
- if (pyzList.get(ii) == null) {
|
|
|
- Integer total = ((Double) pzyList.get(ii).getPointValueInDouble()).intValue();
|
|
|
- String time = sdf.format(new Date(pzyList.get(ii).getPointTime() * 1000));
|
|
|
- time = time.substring(time.length() - 5);
|
|
|
- hgList.add(total);
|
|
|
- tList.add(time);
|
|
|
- } else {
|
|
|
- Integer total = ((Double) pzyList.get(ii).getPointValueInDouble()).intValue()
|
|
|
- + ((Double) pyzList.get(ii).getPointValueInDouble()).intValue();
|
|
|
- String time = sdf.format(new Date(pzyList.get(ii).getPointTime() * 1000));
|
|
|
- time = time.substring(time.length() - 5);
|
|
|
- hgList.add(total);
|
|
|
- tList.add(time);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- mapstatus.put(pList.get(i).getNemCode(), hgList);
|
|
|
- mapstatus.put("time", tList);
|
|
|
+ mapstatus.put(pList.get(i).getNemCode(), hgList);
|
|
|
+ mapstatus.put("time", tList);
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ ProBasicPowerstationPoint point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLZY001);
|
|
|
+ String zyCode = point.getNemCode();// 注意
|
|
|
+ point = proBasicPowerstationPointService.getPowerstationPoint(pList.get(i).getId(), ContantXk.JKSLYZ001);
|
|
|
+ String yzCode = point.getNemCode();// 严重
|
|
|
+ List<PointData> pzyList = realApiUtil.getHistoryDatasSnap(zyCode, start / 1000, end / 1000, 0L,
|
|
|
+ 60 * 60L);
|
|
|
+ List<PointData> pyzList = realApiUtil.getHistoryDatasSnap(yzCode, start / 1000, end / 1000, 0L,
|
|
|
+ 60 * 60L);
|
|
|
+
|
|
|
+ if (!pzyList.isEmpty() && !pyzList.isEmpty() && pzyList.size() == pyzList.size()) {
|
|
|
+ for (int ii = 0; ii < pzyList.size(); ii++) {
|
|
|
+ Integer total = ((Double) pzyList.get(ii).getPointValueInDouble()).intValue()
|
|
|
+ + ((Double) pyzList.get(ii).getPointValueInDouble()).intValue();
|
|
|
+ String time = sdf.format(new Date(pzyList.get(ii).getPointTime() ));
|
|
|
+ time = time.substring(time.length() - 5);
|
|
|
+ hgList.add(total);
|
|
|
+ tList.add(time);
|
|
|
}
|
|
|
|
|
|
+ mapstatus.put(pList.get(i).getNemCode(), hgList);
|
|
|
+ mapstatus.put("time", tList);
|
|
|
}
|
|
|
-
|
|
|
+ }
|
|
|
|
|
|
map.put(pList.get(i).getId(),pList.get(i).getName());
|
|
|
|
|
|
-
|
|
|
}
|
|
|
nameList.add(map);
|
|
|
mapstatus.put("name", nameList);
|