15928045575 2 лет назад
Родитель
Сommit
b81d6663f9

+ 1 - 7
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/DeviceController.java

@@ -100,11 +100,5 @@ public class DeviceController {
         return deviceService.update(deviceAdd, request);
     }
 
-    /*@Log(description = "获取设备基准信息")
-    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
-    @RequestMapping(name = "获取设备基准信息", value = "/getSet", method = RequestMethod.GET)
-    public HttpResult getSet(@Valid @RequestBody DeviceAdd deviceAdd, HttpServletRequest request) {
-        log.info("获取设备基准信息 getSet param:{}", JSONObject.toJSONString(deviceAdd));
-        return deviceService.getSet(deviceAdd, request);
-    }*/
+
 }

+ 2 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceIntegrationMapper.java

@@ -32,4 +32,6 @@ public interface KwsDeviceIntegrationMapper extends BaseMapper<KwsDeviceIntegrat
                                                    );
 
     List<KwsDeviceIntegration> selectListByParms(@Param("vo") DeviceVo vo);
+
+    List<KwsDeviceIntegration> selectListByParmsAndInterName(@Param("vo") DeviceVo vo);
 }

+ 1 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceModelPartMapper.java

@@ -25,6 +25,7 @@ public interface KwsDeviceModelPartMapper extends BaseMapper<KwsDeviceModelPart>
     List<DevicePartModelVo> selectByModelId(Long deviceModelId);
 
 
+
     int updateByPrimaryKeySelective(KwsDeviceModelPart record);
 
     int updateByPrimaryKey(KwsDeviceModelPart record);

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceIntegration.java

@@ -62,6 +62,11 @@ public class KwsDeviceIntegration implements Serializable {
     @TableLogic(value = "0")
     private int delFlag;
 
+    /**
+     *
+     */
+    private String integrationName;
+
     private static final long serialVersionUID = 1L;
 
 }

+ 1 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/DeviceQuery.java

@@ -34,7 +34,7 @@ public class DeviceQuery {
     /**
      * 设备名称
      */
-    private String name;
+    private String deviceName;
 
     /**
      * 设备类型

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/DevicePartModelVo.java

@@ -29,6 +29,11 @@ public class DevicePartModelVo implements Serializable {
      */
     private String partName;
 
+    /**
+     * 要素名-中文
+     */
+    private String partNameDesc;
+
     /**
      * 状态
      */

+ 6 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/DeviceVo.java

@@ -164,7 +164,12 @@ public class DeviceVo implements Serializable {
     /**
      * 检测时间
      */
-    private LocalDateTime check_time;
+    private LocalDateTime checkTime;
+
+    /**
+     * 基础要素
+     */
+    private List<DevicePartModelVo> part;
 
 
 

+ 27 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceService.java

@@ -27,6 +27,7 @@ import com.sckw.slope.detection.model.dto.*;
 import com.sckw.slope.detection.model.param.DeviceAdd;
 import com.sckw.slope.detection.model.param.DeviceQuery;
 import com.sckw.slope.detection.model.vo.DeviceOutputValueVO;
+import com.sckw.slope.detection.model.vo.DevicePartModelVo;
 import com.sckw.slope.detection.model.vo.DeviceVo;
 import com.sckw.slope.detection.model.vo.ProjectDeviceVO;
 import jakarta.servlet.http.HttpServletRequest;
@@ -204,11 +205,34 @@ public class DeviceService {
             vo.setManufacturer_contacts(deviceModel.getManufacturerContacts());
             vo.setManufacturer_phone(deviceModel.getManufacturerPhone());
         }
+        //获取字典
+        Map<String, SystemDict> dictList = commonService.getDictList(null, new HashMap<>() {{
+            put("code", DictEnum.MODEL_PART.getCodeType());
+            put("type", "1");
+        }});
+        //获取集成要素
         List<KwsDeviceIntegration> intergData = new ArrayList<>();
-        intergData = deviceIntegrationMapper.selectListByParms(vo);
+        intergData = deviceIntegrationMapper.selectListByParmsAndInterName(vo);
         if(!Objects.isNull(intergData)){
             vo.setIntegration(intergData);
         }
+        //获取基础要数
+        List<DevicePartModelVo> partData = new ArrayList<>();
+        partData = deviceModelPartMapper.selectByModelId(deviceModel.getId());
+        if(!Objects.isNull(partData)){//首先在kws_device_model_part获取数据,然后到字典中查询
+
+            for (DevicePartModelVo part : partData) {
+                for (SystemDict value : dictList.values()) {
+                    if (part.getPartName().equals(value.getValue())) {
+                        part.setPartNameDesc(value.getLabel());
+                    }
+                }
+            }
+            vo.setPart(partData);
+            //vo.setIntegration(intergData);
+        }
+        //获取设备基准信息
+
 
         return HttpResult.ok(vo);
     }
@@ -494,4 +518,6 @@ public class DeviceService {
         }
         return HttpResult.ok(mapList);
     }
+
+
 }

+ 13 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceIntegrationMapper.xml

@@ -194,7 +194,19 @@
         select
         <include refid="Base_Column_List"/>
         from kws_device_integration
-        where del_flag = 0
+        where d.del_flag = 0
+        <if test="vo.id != null and vo.id != ''">
+            and device_id = #{vo.id}
+        </if>
+    </select>
+
+    <select id="selectListByParmsAndInterName" resultType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
+        <!--@mbg.generated-->
+        select
+        d.id,d.integration_id,integration_name,part_names
+        from kws_device_integration as d
+        inner join kws_integration as i on d.integration_id=i.id
+        where d.del_flag = 0 and i.del_flag = 0
         <if test="vo.id != null and vo.id != ''">
             and device_id = #{vo.id}
         </if>