Browse Source

'优化巡查自检-巡检计划-列表查询接口,解决编辑时巡检日程未带入的问题;优化监控电视墙实时数据接口,增加产品属性最大值和最小值;'

james 1 year ago
parent
commit
266b7ac79d

+ 10 - 0
service-backend/service-backend-api/src/main/java/com/usky/backend/domain/DeviceAttributeVO.java

@@ -16,4 +16,14 @@ public class DeviceAttributeVO implements Serializable {
     private String unit;
     //上报时间
     private String time;
+
+    /**
+     * 最大值
+     */
+    private float maximum;
+
+    /**
+     * 最小值
+     */
+    private float minimum;
 }

+ 10 - 0
service-backend/service-backend-api/src/main/java/com/usky/backend/domain/ProductTVAttributeVO.java

@@ -26,6 +26,16 @@ public class ProductTVAttributeVO implements Serializable {
      */
     private String attributeUnit;
 
+    /**
+     * 最大值
+     */
+    private float maximum;
+
+    /**
+     * 最小值
+     */
+    private float minimum;
+
     /**
      * 产品编码
      */

+ 4 - 4
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanServiceImpl.java

@@ -111,7 +111,7 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
                 patrolInspectionAreaVo.setSiteCount(0);
                 patrolInspectionAreaVo.setPlanCount(0);
                 for (int j = 0; j < dataCountVoList.size(); j++) {
-                    if (patrolInspectionAreaList.get(i).getId() == dataCountVoList.get(j).getId()) {
+                    if (patrolInspectionAreaList.get(i).getId().equals(dataCountVoList.get(j).getId())) {
                         patrolInspectionAreaVo.setPlanCount(dataCountVoList.get(j).getListCount());
                     }
                 }
@@ -663,7 +663,7 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
             planScheduleVo.setPersonnelId(planScheduleList.get(i).getPersonnelId());
             planScheduleVo.setPlanId(planScheduleList.get(i).getPlanId());
             for (int j = 0; j < personnelList.size(); j++) {
-                if (planScheduleList.get(i).getPersonnelId() == personnelList.get(j).getId()) {
+                if (planScheduleList.get(i).getPersonnelId().equals(personnelList.get(j).getId())) {
                     planScheduleVo.setPersonnelName(personnelList.get(j).getName());
                 }
             }
@@ -693,7 +693,7 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
             if (planType == 1) {
                 List<PlanScheduleVo> list2 = new ArrayList<>();
                 for (int j = 0; j < list.size(); j++) {
-                    if (patrolInspectionPlanSonList.get(i).getId() == list.get(j).getPlanId()) {
+                    if (patrolInspectionPlanSonList.get(i).getId().equals(list.get(j).getPlanId())) {
                         list.get(j).setWeekOne(patrolInspectionPlanSonList.get(i).getRestDay().contains("星期一") ? true : false);
                         list.get(j).setWeekTwo(patrolInspectionPlanSonList.get(i).getRestDay().contains("星期二") ? true : false);
                         list.get(j).setWeekThree(patrolInspectionPlanSonList.get(i).getRestDay().contains("星期三") ? true : false);
@@ -707,7 +707,7 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
                 patrolInspectionPlanDataVo.setChildrenList(list2);
             } else if (planType == 2) {
                 for (int j = 0; j < list.size(); j++) {
-                    if (patrolInspectionPlanSonList.get(i).getId() == list.get(j).getPlanId()) {
+                    if (patrolInspectionPlanSonList.get(i).getId().equals(list.get(j).getPlanId())) {
                         patrolInspectionPlanDataVo.setPersonneName(list.get(j).getPersonnelName());
                         patrolInspectionPlanDataVo.setPersonneId(list.get(j).getPersonnelId());
                     }

+ 7 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpDeviceInfoServiceImpl.java

@@ -43,6 +43,7 @@ import sun.net.dns.ResolverConfiguration;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.text.DecimalFormat;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
@@ -659,6 +660,12 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
                                             if(Objects.nonNull(attributeVOList.get(k).getAttributeUnit())){
                                                 attributeVO.setUnit(attributeVOList.get(k).getAttributeUnit());
                                             }
+                                            if(Objects.nonNull(attributeVOList.get(k).getMaximum())){
+                                                attributeVO.setMaximum(Math.round(attributeVOList.get(k).getMaximum()*100)/100f);
+                                            }
+                                            if(Objects.nonNull(attributeVOList.get(k).getMinimum())){
+                                                attributeVO.setMinimum(Math.round(attributeVOList.get(k).getMinimum()*100)/100f);
+                                            }
                                             break;
                                         }
                                     }

+ 1 - 1
service-iot/service-iot-biz/src/main/resources/mapper/iot/DmpDeviceInfoMapper.xml

@@ -58,7 +58,7 @@
     </select>
 
     <select id="attributeList" resultType="com.usky.backend.domain.ProductTVAttributeVO">
-        select dpa.product_id as productId,dpa.attribute_code as attributeCode,dpa.attribute_name as attributeName,dpa.attribute_unit as attributeUnit,dpt.product_code as productCode
+        select dpa.product_id as productId,dpa.attribute_code as attributeCode,dpa.attribute_name as attributeName,dpa.attribute_unit as attributeUnit,dpa.maximum as maximum,dpa.minimum as minimum,dpt.product_code as productCode
         from dmp_product_attribute dpa
         left join dmp_product dpt
         on dpa.product_id = dpt.id