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

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

@@ -56,7 +56,7 @@ public interface KwsDeviceMapper extends BaseMapper<KwsDevice> {
 
     int selectDeviceOnlineRateCountByProject(@Param("projectId") String projectId);
 
-    List<Map<String, String>> selectListByModelType(@Param("modelType") String modelType);
+    List<Map<String, String>> selectListByModelType(@Param("modelType") String modelType,@Param("companyId") String companyId);
 
     KwsAlarmExportVO getDataByDeviceIdAndProjectId(@Param("deviceId") Long deviceId, @Param("projectId") String projectId);
 }

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

@@ -6,6 +6,7 @@ import java.util.Date;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.Size;
 import lombok.Data;
@@ -41,6 +42,11 @@ public class KwsCompany implements Serializable {
     */
     private String code;
 
+    /**
+     * 面积
+     */
+    private String area;
+
     /**
      * 矿山所属省市区all
      */
@@ -105,6 +111,7 @@ public class KwsCompany implements Serializable {
     /**
     * 创建时间
     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
     private LocalDateTime createTime;
 
     /**

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

@@ -38,6 +38,7 @@ public class KwsDeviceModel implements Serializable {
     /**
      * 量程
      */
+    @TableField(value = "`range`")
     private String range;
 
     /**

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

@@ -49,6 +49,11 @@ public class CompanyAdd {
     @Size(max = 255,message = "矿山所属具体省市区文字最大长度要小于 255")
     private String codeArea;
 
+
+    @NotBlank(message = "矿山面积不能为空")
+    @Size(max = 255,message = "矿山面积最大长度要小于 255")
+    private String area;
+
     /**
     * 矿山详细地址
     */
@@ -94,7 +99,7 @@ public class CompanyAdd {
     /**
     * 省级平台地址
     */
-    @NotBlank(message = "省级平台不能为空")
+    @NotBlank(message = "省级平台地址不能为空")
     @Size(max = 128,message = "省级平台地址最大长度要小于 128")
     private String platformAddress;
 

+ 2 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/CompanyQuery.java

@@ -25,4 +25,6 @@ public class CompanyQuery implements Serializable {
     private int page;
 
     private int pageSize;
+
+    private String name;
 }

+ 2 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/DeviceModelAdd.java

@@ -1,6 +1,7 @@
 package com.sckw.slope.detection.model.param;
 
 import cn.hutool.core.date.DateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Data;
 
 /**
@@ -36,6 +37,7 @@ public class DeviceModelAdd {
     /**
      * 量程
      */
+
     private String range;
 
     /**

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

@@ -65,6 +65,11 @@ public class DeviceModelVo implements Serializable {
      */
     private String remark;
 
+    /**
+     * 量程
+     */
+    private String range;
+
     /**
      * 状态
      */

+ 6 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CompanyService.java

@@ -51,11 +51,15 @@ public class CompanyService {
 
 
     public PageRes select(CompanyQuery query, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
         PageHelper.startPage(query.getPage(), query.getPageSize());
         List<KwsCompany> company = companyMapper.selectList(new LambdaQueryWrapper<KwsCompany>()
-                        .eq(KwsCompany::getDelFlag, NumberConstant.ZERO)
-                .orderByDesc(KwsCompany::getCreateTime)
+                .eq(KwsCompany::getCompanyId, headerData.getCompanyId())
+                .eq(KwsCompany::getCompanyId, NumberConstant.ZERO)
+                .like(StringUtils.isNotBlank(query.getName()), KwsCompany::getName, query.getName())
+                        .orderByDesc(KwsCompany::getCreateTime)
         );
+
         PageInfo<KwsCompany> info = new PageInfo<>(company);
         if (CollectionUtils.isEmpty(company)) {
             return PageRes.build(info, company);

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

@@ -893,7 +893,8 @@ public class DeviceService {
     }
 
     public HttpResult findDeviceListByModelType(String modelType, HttpServletRequest request) {
-        List<Map<String, String>> map = deviceMapper.selectListByModelType(modelType);
+        String companyId = commonService.getHeaderData(request).getCompanyId();
+        List<Map<String, String>> map = deviceMapper.selectListByModelType(modelType,companyId);
         return HttpResult.ok(map);
     }
 }

+ 7 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/LogService.java

@@ -11,8 +11,10 @@ import com.sckw.slope.detection.dao.mysql.KwsLogMapper;
 import com.sckw.slope.detection.dao.tdengine.DevicesMapper;
 import com.sckw.slope.detection.dao.tdengine.OriginalMapper;
 import com.sckw.slope.detection.dao.tdengine.SlopeDataMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsCompany;
 import com.sckw.slope.detection.model.dos.mysql.KwsDevice;
 import com.sckw.slope.detection.model.dos.mysql.KwsLog;
+import com.sckw.slope.detection.model.dto.HeaderData;
 import com.sckw.slope.detection.model.param.OriginalDeviceQuery;
 import com.sckw.slope.detection.model.param.ProjectLogQuery;
 import com.sckw.slope.detection.model.vo.LogSelectVO;
@@ -49,10 +51,15 @@ public class LogService {
     @Autowired
     SlopeDataMapper slopeDataMapper;
 
+    @Autowired
+    CommonService commonService;
+
     public PageRes select(ProjectLogQuery query, HttpServletRequest request) {
         PageHelper.startPage(query.getPage(), query.getPageSize());
+        HeaderData headerData = commonService.getHeaderData(request);
         List<KwsLog> kwsLogs = logMapper.selectList(new LambdaQueryWrapper<KwsLog>()
                 .eq(StringUtils.isNotBlank(query.getType()), KwsLog::getType, query.getType())
+                .eq(KwsLog::getCompanyId, headerData.getCompanyId())
                 .like(StringUtils.isNotBlank(query.getContent()), KwsLog::getContent, query.getContent())
                 .orderByDesc(KwsLog::getCreateTime)
         );

+ 2 - 2
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsCompanyMapper.xml

@@ -46,13 +46,13 @@
       fence, person, person_mobile, 
       platform_name, platform_address, `status`, 
       create_by, create_time, update_by,
-      update_time,company_id,code_area)
+      update_time,company_id,code_area,area)
     values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
       #{code,jdbcType=VARCHAR}, #{codeAll,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
       #{fence,jdbcType=VARCHAR}, #{person,jdbcType=VARCHAR}, #{personMobile,jdbcType=VARCHAR}, 
       #{platformName,jdbcType=VARCHAR}, #{platformAddress,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
       #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, 
-      #{updateTime,jdbcType=TIMESTAMP},#{companyId,jdbcType=BIGINT},#{codeArea,jdbcType=VARCHAR})
+      #{updateTime,jdbcType=TIMESTAMP},#{companyId,jdbcType=BIGINT},#{codeArea,jdbcType=VARCHAR},#{area,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsCompany">
     <!--@mbg.generated-->

+ 1 - 0
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceMapper.xml

@@ -403,6 +403,7 @@
                LEFT JOIN kws_device_model c ON b.model_id = c.id
       WHERE b.del_flag = 0
         and c.del_flag = 0
+      and b.mountain_id = #{companyId}
       <if test="modelType != null and modelType != ''">
           and c.device_type = #{modelType}
       </if>

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

@@ -73,7 +73,7 @@
                                       `name`, manufacturer, manufacturer_contacts,
                                       manufacturer_phone, remark, `status`,
                                       create_by, create_time, update_by,
-                                      update_time, del_flag, mountain_id,range)
+                                      update_time, del_flag, mountain_id,`range`)
         values (#{id,jdbcType=BIGINT}, #{identifyCode,jdbcType=VARCHAR}, #{deviceType,jdbcType=VARCHAR},
                 #{name,jdbcType=VARCHAR}, #{manufacturer,jdbcType=VARCHAR}, #{manufacturerContacts,jdbcType=VARCHAR},
                 #{manufacturerPhone,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},