Browse Source

已核对28和27号,已核对遥测每个线路的设备数据,数据也已经核对
1: 电度每个线路累加是G01开头的总电度表
2: 母联数据在1,3,5展示即可
3: 首页显示各个设备的遥测数据:电流、电压、有功、温度(暂时没给数据)
点击进入详情,展示详情的数据
4: 1小时内发送了两次,导致数据重复了,确保一个小时内只发送一次
6: 遥测设备重复,只显示多功能表的机和泵一个图片、电容一个图片、主变一个图片、其他默认图片
5: 减法问题
7: 详情页面的低压设备先显示名字,不显示数据,主设备数据显示全部点位,加上单位

hfxc226 2 years ago
parent
commit
400bc8f719

+ 3 - 3
platform-dao/src/main/resources/mapper/remote/RemoteDegreeLogMapper.xml

@@ -68,9 +68,6 @@
         <if test="minute != null">
             and degree_log.minute = #{minute}
         </if>
-        <if test="sbName != null and sbName != ''">
-            and degree_log.sb_name = #{sbName}
-        </if>
         <if test="positionNum != null">
             and degree_log.position_num = #{positionNum}
         </if>
@@ -122,6 +119,9 @@
                 or degree_log.position_num like concat(concat('%',#{keyword}),'%')
             )
         </if>
+        <if test="sbName != null and sbName != ''">
+            and degree.sb_name like concat(concat('%',#{sbName}),'%')
+        </if>
         <if test="line != null">
             and degree.line = #{line}
         </if>

+ 9 - 2
platform-iec/src/main/java/com/ydl/iec/iec104/core/ScheduledTaskPool.java

@@ -51,6 +51,10 @@ public class ScheduledTaskPool {
      * 发送测试指令线程的状态-累计数量,超过十次没响应后,需要重启监听
      */
     private int sendTestNum = 0;
+    /**
+     * 记录每小时是否发送过电度总召唤-累计数量,超过十次没响应后,需要重启监听
+     */
+    private int sendDegreeCallNum = 0;
     /**
      * 发送总召唤指令状态
      */
@@ -184,9 +188,12 @@ public class ScheduledTaskPool {
                             Thread.sleep(1000 * 60 * 2);// 2分钟判断一次是否发送一次电度总召唤
                             // 判断是否需要发送电度
                             if (isNeedSendDegree()) {
-                                if (sendTestNum > 1) {
-                                    LOGGER.info("电度召唤指令");
+                                if ( sendDegreeCallNum==0) {
+                                    LOGGER.info("电度召唤指令,并累加1" + sendDegreeCallNum++);
                                     ctx.channel().writeAndFlush(BasicInstruction104.getGeneralCallRuleDetail104Degree());
+                                }else{
+                                    LOGGER.info("电度召唤指令该小时内,已经发送,开始清零" );
+                                    sendDegreeCallNum = 0;
                                 }
                             }
                         } catch (Exception e) {

+ 26 - 0
platform-service/pom.xml

@@ -15,6 +15,14 @@
 
     <properties>
     </properties>
+    <repositories>
+        <!--start 仓库,不可删-->
+        <repository>
+            <id>oss-sonatype</id>
+            <name>oss-sonatype</name>
+            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+        </repository>
+    </repositories>
 
     <dependencies>
         <dependency>
@@ -77,6 +85,24 @@
             <artifactId>spring-boot-starter-mail</artifactId>
         </dependency>
 
+        <!--start milo-->
+        <dependency>
+            <groupId>org.eclipse.milo</groupId>
+            <artifactId>sdk-client</artifactId>
+            <version>0.6.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcpkix-jdk15on</artifactId>
+            <version>1.57</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.milo</groupId>
+            <artifactId>sdk-server</artifactId>
+            <version>0.6.3</version>
+        </dependency>
+        <!--end milo-->
+
     </dependencies>
 
     <build>

+ 22 - 9
platform-service/src/main/java/com/platform/service/big/impl/BigScreenSbInfoServiceImpl.java

@@ -107,8 +107,10 @@ public class BigScreenSbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, Sb
     private final RemoteMeasureMapper remoteMeasureMapper;
     private final SysDictMapper sysDictMapper;
     private final RemoteDegreeLogMapper remoteDegreeLogMapper;
+
     /**
      * 按照线路汇总统计
+     *
      * @param lineNum
      * @return
      */
@@ -122,20 +124,30 @@ public class BigScreenSbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, Sb
             throw new BusinessException("请在数据字典配置设备电力线路,数据值:" + lineNum);
         }
 
-        // 查询所有的遥测点位
+        // 查询所有的遥测点位:包含威胜多功能表的
         Weekend<RemoteMeasure> remoteDegreeWeekend = new Weekend<>(RemoteMeasure.class);
         WeekendCriteria<RemoteMeasure, Object> remoteDegreeObjectWeekendCriteria = remoteDegreeWeekend.weekendCriteria();
-        remoteDegreeObjectWeekendCriteria.andEqualTo(RemoteMeasure::getLine, lineNum);
+        remoteDegreeObjectWeekendCriteria.andLike(RemoteMeasure::getSbName, "%威胜多功能%").andEqualTo(RemoteMeasure::getLine, lineNum);
         List<RemoteMeasure> remoteMeasureList = remoteMeasureMapper.selectByExample(remoteDegreeWeekend);
         JSONObject obj = new JSONObject();
-        if(CollectionUtil.isNotEmpty(remoteMeasureList)){
+        if (CollectionUtil.isNotEmpty(remoteMeasureList)) {
             obj.put("line", lineNum);
             obj.put("lineName", sysDict.getLabel());
             Map<String, List<RemoteMeasure>> map = remoteMeasureList.stream().collect(Collectors.groupingBy(RemoteMeasure::getSbName, Collectors.toList()));
+            map = map.entrySet().stream().sorted(Map.Entry.comparingByKey()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldVal, newVal) -> oldVal, LinkedHashMap::new));
             JSONArray lineArray = new JSONArray();
-            for(String key:map.keySet()){
+            for (String key : map.keySet()) {
                 JSONObject dictJsonObject = new JSONObject();
                 dictJsonObject.put("sbName", key);
+                if (key.contains("电容")) {
+                    dictJsonObject.put("imgType", 1);
+                } else if (key.contains("机") || key.contains("泵")) {
+                    dictJsonObject.put("imgType", 2);
+                } else if (key.contains("主变")) {
+                    dictJsonObject.put("imgType", 3);
+                } else {
+                    dictJsonObject.put("imgType", 4);
+                }
                 dictJsonObject.put("measureList", map.get(key));
                 lineArray.add(dictJsonObject);
             }
@@ -203,6 +215,7 @@ public class BigScreenSbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, Sb
             throw new BusinessException("请在数据字典配置设备电力线路");
         }
         sysDictList.sort(Comparator.comparing(SysDict::getSort));
+        record.setSbName("G01");
         List<RemoteDegreeLogVO> list = remoteDegreeLogMapper.selectList(record);
         JSONArray jSONArray = new JSONArray();
         if (isDay) {//
@@ -226,8 +239,8 @@ public class BigScreenSbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, Sb
                             }
                         }
                     }
-                    dictJsonObject.put("positive", positiveTotal.divide(BigDecimal.valueOf(100),2, RoundingMode.HALF_UP).doubleValue());
-                    dictJsonObject.put("negative", negativeTotal.divide(BigDecimal.valueOf(100),2, RoundingMode.HALF_UP).doubleValue());
+                    dictJsonObject.put("positive", positiveTotal.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP).doubleValue());
+                    dictJsonObject.put("negative", negativeTotal.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP).doubleValue());
                     lineArray.add(dictJsonObject);
                 }
                 jsonObject.put("lines", lineArray);
@@ -246,7 +259,7 @@ public class BigScreenSbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, Sb
                     BigDecimal positiveTotal = new BigDecimal(0.00);// 正向有功
                     BigDecimal negativeTotal = new BigDecimal(0.00);// 正向无功,不需要吗,后面可以删除,先保存
                     for (RemoteDegreeLogVO log : list) {
-                        if(log.getLine() == null){
+                        if (log.getLine() == null) {
                             throw new BusinessException("设备未设置电力线路, 设备名称:" + log.getSbName() + ", 设备编号:" + log.getSbNo());
                         }
                         if (log.getLine().toString().equals(dict.getValue())) {
@@ -259,8 +272,8 @@ public class BigScreenSbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, Sb
                             }
                         }
                     }
-                    dictJsonObject.put("positive", positiveTotal.divide(BigDecimal.valueOf(100),2, RoundingMode.HALF_UP).doubleValue());
-                    dictJsonObject.put("negative", negativeTotal.divide(BigDecimal.valueOf(100),2, RoundingMode.HALF_UP).doubleValue());
+                    dictJsonObject.put("positive", positiveTotal.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP).doubleValue());
+                    dictJsonObject.put("negative", negativeTotal.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP).doubleValue());
                     lineArray.add(dictJsonObject);
                 }
                 jsonObject.put("lines", lineArray);