Explorar el Código

1.项目边坡详情,折线图接口编写
2.项目边坡详情,设备要素接口修改
3.项目日志,日志模板入库

lengfaqiang hace 2 años
padre
commit
9f526aee4b
Se han modificado 16 ficheros con 424 adiciones y 40 borrados
  1. 175 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/MessageLogEnum.java
  2. 9 3
      slope-common/slope-common-core/src/main/java/com/sckw/core/utils/StringUtils.java
  3. 0 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsLogMapper.java
  4. 4 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsLog.java
  5. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsReportTemplate.java
  6. 3 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/LocationDTO.java
  7. 4 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/ProjectChartLogParam.java
  8. 1 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectCatLogVO.java
  9. 28 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CommonService.java
  10. 25 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceService.java
  11. 87 23
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ProjectService.java
  12. 22 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ReportService.java
  13. 40 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ReportTemplateService.java
  14. 17 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ThresholdService.java
  15. 2 8
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsLogMapper.xml
  16. 2 0
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsReportTemplateMapper.xml

+ 175 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/MessageLogEnum.java

@@ -0,0 +1,175 @@
+package com.sckw.core.model.enums;
+
+import com.sckw.core.utils.CollectionUtils;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * @author lfdc
+ * @description 项目日志枚举
+ * @date 2023-11-09 09:30:07
+ */
+@Getter
+@AllArgsConstructor
+public enum MessageLogEnum {
+    /**
+     * 新增边坡项目
+     */
+    ADD_PROJECT("slope_manage", "PROJECT_LOG", "新增边坡项目",
+            "边坡【${projectName}】已新增,所属矿山:${mountainName}",  "新增边坡项目"),
+    /**
+     * 修改边坡项目
+     */
+    UPDATE_PROJECT("slope_manage", "PROJECT_LOG", "修改边坡项目",
+            "边坡【${projectName}】已修改,所属矿山:${mountainName}", "修改边坡项目"),
+    /**
+     * 删除边坡项目
+     */
+    DELETE_PROJECT("slope_manage", "PROJECT_LOG", "删除边坡项目",
+            "边坡【${projectName}】已删除,所属矿山:${mountainName}", "删除边坡项目"),
+
+    /**
+     * 新增组网设备
+     */
+    ADD_NETWORKING_DEVICE("slope_manage", "PROJECT_LOG", "新增组网设备",
+            "设备【${deviceName}】已关联组网,所属边坡【${projectName}】",  "新增组网设备"),
+    /**
+     * 删除组网设备
+     */
+    DELETE_NETWORKING_DEVICE("slope_manage", "PROJECT_LOG", "删除组网设备",
+            "设备【${deviceName}】已取消组网,所属边坡【${projectName}】",  "删除组网设备"),
+    /**
+     * 调整设备布设
+     */
+    UPDATE_DEVICE_LAY("slope_manage", "PROJECT_LOG", "调整设备布设",
+            "设备【${deviceName}】已调整项目位置,所属边坡【${projectName}】",  "调整设备布设"),
+    /**
+     * 新增报表模版
+     */
+    ADD_REPORT_TEMPLATE("slope_manage", "PROJECT_LOG", "新增报表模版",
+            "报表模版【${templateName}】已新增,所属边坡【${projectName}】",  "新增报表模版"),
+
+    /**
+     * 修改报表模版
+     */
+    UPDATE_REPORT_TEMPLATE("slope_manage", "PROJECT_LOG", "修改报表模版",
+                                "报表模版【${templateName}】已修改,所属边坡【${projectName}】",  "修改报表模版"),
+
+    /**
+     * 删除报表模版
+     */
+    DELETE_REPORT_TEMPLATE("slope_manage", "PROJECT_LOG", "删除报表模版",
+                                "报表模版【${templateName}】已删除,所属边坡【${projectName}】",  "删除报表模版"),
+
+    /**
+     * 禁用报表模版
+     */
+    FORBIDDEN_REPORT_TEMPLATE("slope_manage", "PROJECT_LOG", "禁用报表模版",
+            "报表模版【${templateName}】已禁用,所属边坡【${projectName}】",  "禁用报表模版"),
+
+    /**
+     * 启用报表模版
+     */
+    ENABLE_REPORT_TEMPLATE("slope_manage", "PROJECT_LOG", "启用报表模版",
+            "报表模版【${templateName}】已启用,所属边坡【${projectName}】",  "启用报表模版"),
+
+    /**
+     * 设置设备阈值
+     */
+    SETTINGS_DEVICE_THRESHOLD("slope_manage", "PROJECT_LOG", "设置设备阈值",
+            "设备【${deviceName}】已设置了【${element}】监测要素阈值,所属边坡【${projectName}】",  "设置设备阈值"),
+
+    /**
+     * 删除设备阈值
+     */
+    DELETE_DEVICE_THRESHOLD("slope_manage", "PROJECT_LOG", "删除设备阈值",
+            "设备【${deviceName}】已删除了【${element}】监测要素阈值,所属边坡【${projectName}】",  "删除设备阈值"),
+
+    ;
+
+
+    /**
+     * 消息分类:BUSINESS业务消息,SYSTEM系统消息
+     */
+    private final String category;
+
+    /**
+     * 消息类型
+     */
+    private final String type;
+
+    /**
+     * 消息标题
+     */
+    private final String title;
+
+    /**
+     * 消息内容
+     */
+    private final String content;
+
+    /**
+     * 字段含义解释
+     */
+    private final String desc;
+
+
+    public static String getCategoryByType(String type) {
+        for (MessageLogEnum entityEnum : MessageLogEnum.values()) {
+            if (entityEnum.getType().equals(type)) {
+                return entityEnum.getCategory();
+            }
+        }
+        return null;
+    }
+
+    public static String getTitleByType(String type) {
+        for (MessageLogEnum entityEnum : MessageLogEnum.values()) {
+            if (entityEnum.getType().equals(type)) {
+                return entityEnum.getTitle();
+            }
+        }
+        return null;
+    }
+
+    public static String getContentByType(String type) {
+        for (MessageLogEnum entityEnum : MessageLogEnum.values()) {
+            if (entityEnum.getType().equals(type)) {
+                return entityEnum.getContent();
+            }
+        }
+        return null;
+    }
+
+    public static String getDesc(MessageLogEnum messageEnum) {
+        for (MessageLogEnum entityEnum : MessageLogEnum.values()) {
+            if (entityEnum.equals(messageEnum)) {
+                return entityEnum.getDesc();
+            }
+        }
+        return null;
+    }
+
+    public static List<MessageLogEnum> getEnums(Boolean isMain, Integer length, Set<MessageLogEnum> excludeEnums) {
+        List<MessageLogEnum> list = Arrays.stream(MessageLogEnum.values())
+                .filter(e -> CollectionUtils.isEmpty(excludeEnums) || !excludeEnums.contains(e))
+                .filter(e -> Boolean.TRUE.equals(isMain) || "BUSINESS".equals(e.getCategory()))
+                .limit(length)
+                .collect(Collectors.toList());
+        return CollectionUtils.emptyIfNull(list);
+    }
+
+    public static MessageLogEnum getEnumByCategoryAndType(String category, String type) {
+        for (MessageLogEnum e : MessageLogEnum.values()) {
+            if (e.getCategory().equals(category) && e.getType().equals(type)) {
+                return e;
+            }
+        }
+        return null;
+    }
+}

+ 9 - 3
slope-common/slope-common-core/src/main/java/com/sckw/core/utils/StringUtils.java

@@ -2,6 +2,7 @@ package com.sckw.core.utils;
 
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.MessageLogEnum;
 
 import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
@@ -717,7 +718,7 @@ public class StringUtils {
             return str;
         }
         // cannot be longer than the char array
-        final int [] newCodePoints = new int[strLen];
+        final int[] newCodePoints = new int[strLen];
         int outOffset = 0;
         // copy the first codepoint
         newCodePoints[outOffset++] = newCodePoint;
@@ -817,8 +818,9 @@ public class StringUtils {
 
     /**
      * 去除字符串中 指定字符
-     * @param sourceString  "-154-15"
-     * @param chElemData "-"
+     *
+     * @param sourceString "-154-15"
+     * @param chElemData   "-"
      * @return "15415"
      */
     public static String deleteCharString(String sourceString, String chElemData) {
@@ -836,6 +838,10 @@ public class StringUtils {
     }
 
     public static void main(String[] args) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("projectName","项目名称");
+        map.put("mountainName","矿山名称");
+        String s = replaceTextVar(MessageLogEnum.ADD_PROJECT.getContent(), map);
         Map<String, Object> param = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         param.put("account", "17358629955");
         param.put("pwd", "123456");

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

@@ -10,8 +10,6 @@ import org.apache.ibatis.annotations.Mapper;
 public interface KwsLogMapper extends BaseMapper<KwsLog> {
     int deleteByPrimaryKey(Long id);
 
-    int insert(KwsLog record);
-
     int insertSelective(KwsLog record);
 
     KwsLog selectByPrimaryKey(Long id);

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

@@ -25,6 +25,10 @@ public class KwsLog implements Serializable {
      * 企业id
      */
     private String companyId;
+    /**
+     * 矿山id
+     */
+    private String mountainId;
 
     /**
      * 操作内容

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

@@ -32,6 +32,11 @@ public class KwsReportTemplate implements Serializable {
      */
     private String companyId;
 
+    /**
+     * 企业id
+     */
+    private String mountainId;
+
     /**
      * 制表时间
      */

+ 3 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/LocationDTO.java

@@ -1,5 +1,6 @@
 package com.sckw.slope.detection.model.dto;
 
+import jakarta.validation.constraints.NotBlank;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -12,5 +13,7 @@ import java.util.List;
  */
 @Data
 public class LocationDTO implements Serializable {
+    @NotBlank(message = "项目id不能为空")
+    private String projectId;
     private List<DeviceLocationDTO> deviceLocationList;
 }

+ 4 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/ProjectChartLogParam.java

@@ -2,6 +2,7 @@ package com.sckw.slope.detection.model.param;
 
 import jakarta.validation.constraints.NotBlank;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 
@@ -34,6 +35,7 @@ public class ProjectChartLogParam implements Serializable {
     /**
      * 维度(1年、2月、3周,4日)
      */
+    @NotBlank(message = "统计维度不能为空")
     private String latitude;
     /**
      * 设备id
@@ -48,10 +50,12 @@ public class ProjectChartLogParam implements Serializable {
     /**
      * 开始时间
      */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private String startTime;
     /**
      * 结束时间
      */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private String endTime;
     /**
      * 检测要素

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

@@ -39,6 +39,6 @@ public class ProjectCatLogVO implements Serializable {
     /**
      * 统计检测要素时间轴数据
      */
-    private List<Map<String, Object>> mapList;
+    private List<Map<String, Object>> monitor;
 
 }

+ 28 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CommonService.java

@@ -6,9 +6,13 @@ import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.enums.DictEnum;
+import com.sckw.core.model.enums.MessageLogEnum;
 import com.sckw.core.model.page.PageRes;
+import com.sckw.core.utils.IdWorker;
 import com.sckw.core.web.response.PhpResult;
 import com.sckw.slope.detection.dao.mysql.KwsDictMapper;
+import com.sckw.slope.detection.dao.mysql.KwsLogMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsLog;
 import com.sckw.slope.detection.model.dto.HeaderData;
 import com.sckw.slope.detection.model.dto.SystemDict;
 import com.sckw.slope.detection.model.vo.QueryDictTypePageReqVo;
@@ -19,7 +23,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
 
 import java.util.*;
 
@@ -41,6 +44,9 @@ public class CommonService {
     @Autowired
     KwsDictMapper dictMapper;
 
+    @Autowired
+    KwsLogMapper logMapper;
+
     public HeaderData getHeaderData(HttpServletRequest request) {
         /**
          * {"companyId":"198","companyName":"四川金顶集团","createBy":"2","createName":"600678","updateBy":"2","updateName":"600678","mountainId":"198"}
@@ -71,7 +77,7 @@ public class CommonService {
         return PageRes.build(info, list);
     }
 
-    public Map<String,SystemDict> getDictList(Map<String, Object> mapBody, Map<String, String> mapPara) {
+    public Map<String, SystemDict> getDictList(Map<String, Object> mapBody, Map<String, String> mapPara) {
         PhpResult result = detectionApiService.toSaasGetDict(url,
                 "/common/getDict", mapBody
                 , mapPara);
@@ -87,4 +93,24 @@ public class CommonService {
     }
 
 
+    public Map<String, SystemDict> getDictByDictCode(DictEnum dictEnum) {
+        Map<String, SystemDict> dictList = getDictList(null, new HashMap<String, String>() {{
+            put("code", dictEnum.getCodeType());
+            put("type", "1");
+        }});
+        return dictList;
+    }
+
+    public int insertLog(MessageLogEnum messageLogEnum, HeaderData headerData, Map<String, Object> logMap, Long operationBy) {
+        String content = com.sckw.core.utils.StringUtils.replaceTextVar(messageLogEnum.getContent(), logMap);
+        KwsLog log = new KwsLog();
+        log.setId(new IdWorker(NumberConstant.ONE).nextId());
+        log.setType(messageLogEnum.getType());
+        log.setCompanyId(headerData.getCompanyId());
+        log.setMountainId(headerData.getMountainId());
+        log.setContent(content);
+        log.setCreateBy(operationBy);
+        log.setCreateTime(new Date());
+        return logMapper.insert(log);
+    }
 }

+ 25 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceService.java

@@ -11,6 +11,7 @@ import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.enums.DeviceEnum;
 import com.sckw.core.model.enums.DictEnum;
 import com.sckw.core.model.enums.DictItemEnum;
+import com.sckw.core.model.enums.MessageLogEnum;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.StringUtils;
@@ -209,9 +210,15 @@ public class DeviceService {
 
     @Transactional
     public HttpResult locationSet(LocationDTO list, HttpServletRequest request) {
+        String projectId = list.getProjectId();
+        KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
+                .eq(KwsProject::getId, Long.parseLong(projectId)));
         HeaderData headerData = commonService.getHeaderData(request);
         List<DeviceLocationDTO> deviceLocationList = list.getDeviceLocationList();
         if (!CollectionUtils.isEmpty(deviceLocationList)) {
+            List<String> collect = deviceLocationList.stream().map(DeviceLocationDTO::getDeviceId).collect(Collectors.toList());
+            List<KwsDevice> kwsDevices = deviceMapper.selectList(new LambdaQueryWrapper<KwsDevice>()
+                    .in(KwsDevice::getId, collect).eq(KwsDevice::getDelFlag, 0));
             deviceLocationList.forEach(device -> {
                 deviceMapper.update(null, new LambdaUpdateWrapper<KwsDevice>()
                         .set(KwsDevice::getLogicLng, device.getLogicLng())
@@ -222,6 +229,24 @@ public class DeviceService {
                         .eq(KwsDevice::getId, device.getDeviceId())
                 );
             });
+            List<String> deviceNames = new ArrayList<>();
+            if (!CollectionUtils.isEmpty(kwsDevices)) {
+                deviceNames = kwsDevices.stream().map(KwsDevice::getName).collect(Collectors.toList());
+            }
+            StringBuilder deviceName = new StringBuilder();
+            if (!CollectionUtils.isEmpty(deviceNames)) {
+                for (int i = 0; i < deviceNames.size(); i++) {
+                    if (i != deviceNames.size() - 1) {
+                        deviceName.append(deviceNames.get(i)).append(",");
+                    } else {
+                        deviceName.append(deviceNames.get(i));
+                    }
+                }
+            }
+            Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+            logMap.put("projectName", project.getName());
+            logMap.put("deviceName", deviceName.toString());
+            commonService.insertLog(MessageLogEnum.UPDATE_DEVICE_LAY, headerData, logMap, headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
         }
         return HttpResult.ok();
     }

+ 87 - 23
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ProjectService.java

@@ -8,7 +8,9 @@ import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.enums.DeviceEnum;
+import com.sckw.core.model.enums.DictEnum;
 import com.sckw.core.model.enums.DictItemEnum;
+import com.sckw.core.model.enums.MessageLogEnum;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.RegularUtils;
@@ -144,6 +146,10 @@ public class ProjectService {
         company.setMountainId(headerData.getMountainId());
         company.setCompanyId(headerData.getCompanyId());
         mountainCompanyMapper.insert(company);
+        Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+        logMap.put("projectName", projectAddDto.getName());
+        logMap.put("mountainName", projectAddDto.getMountainName());
+        commonService.insertLog(MessageLogEnum.ADD_PROJECT, headerData, logMap, headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
         return HttpResult.ok();
     }
 
@@ -183,13 +189,14 @@ public class ProjectService {
     }
 
     @Transactional
-    public HttpResult update(ProjectUpdateDTO projectAddDto, HttpServletRequest response) {
+    public HttpResult update(ProjectUpdateDTO projectAddDto, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
         KwsProject project = new KwsProject();
         BeanUtils.copyProperties(projectAddDto, project);
         project.setId(Long.parseLong(projectAddDto.getId()));
         project.setStatus(NumberConstant.ZERO);
         LocalDateTime now = LocalDateTime.now();
-        project.setUpdateBy(Long.parseLong(commonService.getHeaderData(response).getUpdateBy()));
+        project.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
         project.setUpdateTime(now);
         projectMapper.updateById(project);
         String fence = projectAddDto.getFence();
@@ -198,13 +205,27 @@ public class ProjectService {
                 .set(KwsProjectArea::getFence, fence)
                 .set(KwsProjectArea::getArea, projectAddDto.getArea())
         );
+        Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+        logMap.put("projectName", projectAddDto.getName());
+        logMap.put("mountainName", projectAddDto.getMountainName());
+        commonService.insertLog(MessageLogEnum.UPDATE_PROJECT, headerData, logMap, headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
         return HttpResult.ok();
     }
 
     @Transactional
     public HttpResult dels(String ids, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
         List<Long> list = StringUtils.splitStrToList(ids, Long.class);
+        KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
+                .eq(KwsProject::getId, list.get(0)));
+        if (project == null) {
+            throw new BusinessException("要删除的项目不存在");
+        }
         int update = projectMapper.update(null, new LambdaUpdateWrapper<KwsProject>().in(KwsProject::getId, list).set(KwsProject::getDelFlag, "1"));
+        Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+        logMap.put("projectName", project.getName());
+        logMap.put("mountainName", project.getMountainName());
+        commonService.insertLog(MessageLogEnum.DELETE_PROJECT, headerData, logMap, headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
         if (update < 1) {
             throw new BusinessException("删除失败");
         }
@@ -261,6 +282,20 @@ public class ProjectService {
         String bindDeviceId = bindDevice.getBindDeviceId();
         //设备主从绑定
         List<KwsDeviceRelation> saveList = new ArrayList<>();
+        StringBuilder deviceName = new StringBuilder();
+        List<KwsDevice> kwsDevices = deviceMapper.selectList(new LambdaQueryWrapper<KwsDevice>()
+                .eq(KwsDevice::getDelFlag, 0)
+                .in(KwsDevice::getId, list));
+        if (CollectionUtils.isEmpty(kwsDevices)) {
+            throw new BusinessException("需要关联设备不存在");
+        }
+        for (int i = 0; i < kwsDevices.size(); i++) {
+            if (i != kwsDevices.size() - 1) {
+                deviceName.append(kwsDevices.get(i).getName()).append(",");
+            } else {
+                deviceName.append(kwsDevices.get(i).getName());
+            }
+        }
         list.forEach(id -> {
             String deviceId = "";
             if (bindDeviceId == null) {
@@ -327,6 +362,10 @@ public class ProjectService {
                 );
             });
         }
+        Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+        logMap.put("projectName", project.getName());
+        logMap.put("deviceName", deviceName.toString());
+        commonService.insertLog(MessageLogEnum.ADD_NETWORKING_DEVICE, headerData, logMap, headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
         return HttpResult.ok();
     }
 
@@ -383,7 +422,7 @@ public class ProjectService {
                 return HttpResult.ok();
             }
             //当前设备下的所有基本要素
-            List<ProjectCatLogVO> returnList = new ArrayList<>();
+            List<Map<String, ProjectCatLogVO>> returnList = new ArrayList<>();
             basicItem(mountainId, projectId, deviceId, kwsDevice, returnList);
 
             //集成要素 折线图
@@ -442,7 +481,7 @@ public class ProjectService {
      * @param deviceId   所属设备
      * @param kwsDevice  设备信息
      * @param returnList 返回数据
-     * @param date   时间范围
+     * @param date       时间范围
      */
     private void basicItemByWeek(String mountainId, String projectId, String deviceId, KwsDevice kwsDevice, List<ProjectCatLogVO> returnList, Date date) {
         List<ProjectDeviceVO> projectDeviceList = projectMapper.selectDeviceByProjectId(mountainId, Long.parseLong(projectId), Long.parseLong(deviceId));
@@ -553,7 +592,7 @@ public class ProjectService {
                         }
                     }
                 }
-                returnVO.setMapList(mapList);
+                returnVO.setMonitor(mapList);
                 returnList.add(returnVO);
             }
         }
@@ -562,7 +601,7 @@ public class ProjectService {
     /**
      * 集成要素折线图计算
      */
-    private void integrationItem(HeaderData headerData, String deviceId, KwsDevice kwsDevice, List<ProjectCatLogVO> returnList) {
+    private void integrationItem(HeaderData headerData, String deviceId, KwsDevice kwsDevice, List<Map<String, ProjectCatLogVO>> returnList) {
         List<KwsDeviceIntegration> deviceIntegrations = deviceIntegrationMapper.selectList(new LambdaQueryWrapper<KwsDeviceIntegration>()
                 .eq(KwsDeviceIntegration::getMountainId, headerData.getMountainId())
                 .eq(KwsDeviceIntegration::getDeviceId, deviceId)
@@ -575,6 +614,7 @@ public class ProjectService {
             List<KwsIntegration> kwsIntegrations = integrationMapper.selectList(new LambdaQueryWrapper<KwsIntegration>().in(KwsIntegration::getId, longList));
             if (!CollectionUtils.isEmpty(kwsIntegrations) && kwsIntegrations.size() > 0) {
                 kwsIntegrations.forEach(integration -> {
+                    Map<String, ProjectCatLogVO> returnMap = new HashMap<>(NumberConstant.SIXTEEN);
                     ProjectCatLogVO projectCatLogVO = new ProjectCatLogVO();
                     String integrationName = integration.getIntegrationName();
                     String partNames = integration.getPartNames();
@@ -605,8 +645,8 @@ public class ProjectService {
                     ThresholdLevelVO thresholdLevelVO = new ThresholdLevelVO();
                     String thresholdMax = "";
                     String thresholdMin = "";
-                    if (listMap.get("1") != null) {
-                        KwsThreshold kwsThreshold = listMap.get("1").get(0);
+                    if (listMap.get(1) != null) {
+                        KwsThreshold kwsThreshold = listMap.get(1).get(0);
                         thresholdMax = kwsThreshold.getMax();
                         thresholdMin = kwsThreshold.getMin();
                         thresholdLevelVO.setThresholdMax(thresholdMax);
@@ -616,8 +656,8 @@ public class ProjectService {
                     }
 //                thresholdMap.put("oneLevelAlarm", map);
                     projectCatLogVO.setOneLevelAlarm(thresholdLevelVO);
-                    if (listMap.get("2") != null) {
-                        KwsThreshold kwsThreshold = listMap.get("2").get(0);
+                    if (listMap.get(2) != null) {
+                        KwsThreshold kwsThreshold = listMap.get(2).get(0);
                         thresholdMax = kwsThreshold.getMax();
                         thresholdMin = kwsThreshold.getMin();
                         thresholdLevelVO.setThresholdMax(thresholdMax);
@@ -628,8 +668,8 @@ public class ProjectService {
 //                thresholdMap.put("twoLevelAlarm", map);
                     projectCatLogVO.setTwoLevelAlarm(thresholdLevelVO);
 
-                    if (listMap.get("3") != null) {
-                        KwsThreshold kwsThreshold = listMap.get("3").get(0);
+                    if (listMap.get(3) != null) {
+                        KwsThreshold kwsThreshold = listMap.get(3).get(0);
                         thresholdMax = kwsThreshold.getMax();
                         thresholdMin = kwsThreshold.getMin();
                         thresholdLevelVO.setThresholdMax(thresholdMax);
@@ -676,7 +716,9 @@ public class ProjectService {
                                     mapList.add(map);
                                 }
                             }
-                            projectCatLogVO.setMapList(mapList);
+                            projectCatLogVO.setMonitor(mapList);
+                            returnMap.put(integrationName, projectCatLogVO);
+                            returnList.add(returnMap);
                         }
                     }
                 });
@@ -687,12 +729,15 @@ public class ProjectService {
     /**
      * 折线图 基本要素
      */
-    private void basicItem(String mountainId, String projectId, String deviceId, KwsDevice kwsDevice, List<ProjectCatLogVO> returnList) {
+    private void basicItem(String mountainId, String projectId, String deviceId, KwsDevice kwsDevice, List<Map<String, ProjectCatLogVO>> returnList) {
         List<ProjectDeviceVO> projectDeviceList = projectMapper.selectDeviceByProjectId(mountainId, Long.parseLong(projectId), Long.parseLong(deviceId));
         if (!CollectionUtils.isEmpty(projectDeviceList)) {
             for (ProjectDeviceVO projectDeviceVO : projectDeviceList) {
+                Map<String, ProjectCatLogVO> returnMap = new HashMap<>();
                 ProjectCatLogVO returnVO = new ProjectCatLogVO();
                 String partName = projectDeviceVO.getPartName();
+                Map<String, SystemDict> dictByDictCode = commonService.getDictByDictCode(DictEnum.MODEL_PART);
+                String itemName = dictByDictCode.get(partName) == null ? partName : dictByDictCode.get(partName).getLabel();
                 //设置过阈值的基本要素
                 List<KwsDeviceReference> references = deviceReferenceMapper.selectList(new LambdaQueryWrapper<KwsDeviceReference>()
                         .eq(KwsDeviceReference::getDeviceId, deviceId)
@@ -706,7 +751,8 @@ public class ProjectService {
                     deviceReference = references.get(0);
                 }
                 //基准值
-                BigDecimal currentValue = deviceReference.getCurrentValue();
+                BigDecimal currentValue = deviceReference == null ? null : deviceReference.getCurrentValue();
+                returnVO.setReference(currentValue);
                 List<KwsThreshold> kwsThresholds = thresholdMapper.selectList(new LambdaQueryWrapper<KwsThreshold>()
                         .eq(KwsThreshold::getDelFlag, 0)
                         .eq(KwsThreshold::getItemName, partName)
@@ -723,8 +769,8 @@ public class ProjectService {
                 ThresholdLevelVO thresholdLevelVO = new ThresholdLevelVO();
                 String thresholdMax = "";
                 String thresholdMin = "";
-                if (listMap.get("1") != null) {
-                    KwsThreshold kwsThreshold = listMap.get("1").get(0);
+                if (listMap.get(1) != null) {
+                    KwsThreshold kwsThreshold = listMap.get(1).get(0);
                     thresholdMax = kwsThreshold.getMax();
                     thresholdMin = kwsThreshold.getMin();
                     thresholdLevelVO.setThresholdMax(thresholdMax);
@@ -734,8 +780,8 @@ public class ProjectService {
                 }
 //                thresholdMap.put("oneLevelAlarm", map);
                 returnVO.setOneLevelAlarm(thresholdLevelVO);
-                if (listMap.get("2") != null) {
-                    KwsThreshold kwsThreshold = listMap.get("2").get(0);
+                if (listMap.get(2) != null) {
+                    KwsThreshold kwsThreshold = listMap.get(2).get(0);
                     thresholdMax = kwsThreshold.getMax();
                     thresholdMin = kwsThreshold.getMin();
                     thresholdLevelVO.setThresholdMax(thresholdMax);
@@ -746,8 +792,8 @@ public class ProjectService {
 //                thresholdMap.put("twoLevelAlarm", map);
                 returnVO.setTwoLevelAlarm(thresholdLevelVO);
 
-                if (listMap.get("3") != null) {
-                    KwsThreshold kwsThreshold = listMap.get("3").get(0);
+                if (listMap.get(3) != null) {
+                    KwsThreshold kwsThreshold = listMap.get(3).get(0);
                     thresholdMax = kwsThreshold.getMax();
                     thresholdMin = kwsThreshold.getMin();
                     thresholdLevelVO.setThresholdMax(thresholdMax);
@@ -808,8 +854,9 @@ public class ProjectService {
                         }
                     }
                 }
-                returnVO.setMapList(mapList);
-                returnList.add(returnVO);
+                returnVO.setMonitor(mapList);
+                returnMap.put(itemName, returnVO);
+                returnList.add(returnMap);
             }
         }
     }
@@ -893,6 +940,23 @@ public class ProjectService {
                     .set(KwsDevice::getUpdateBy, headerData.getUpdateBy() == null ? Long.parseLong(headerData.getCreateBy()) : Long.parseLong(headerData.getUpdateBy()))
             );
         }
+        if (!CollectionUtils.isEmpty(deleteList)) {
+            List<KwsDevice> kwsDevices = deviceMapper.selectList(new LambdaQueryWrapper<KwsDevice>().in(KwsDevice::getId, deleteList).eq(KwsDevice::getDelFlag, 0));
+            if (!CollectionUtils.isEmpty(kwsDevices)) {
+                StringBuilder deviceName = new StringBuilder();
+                for (int i = 0; i < kwsDevices.size(); i++) {
+                    if (i != kwsDevices.size() - 1) {
+                        deviceName.append(kwsDevices.get(i).getName()).append(",");
+                    } else {
+                        deviceName.append(kwsDevices.get(i).getName());
+                    }
+                }
+                Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+                logMap.put("projectName", project.getName());
+                logMap.put("deviceName", deviceName.toString());
+                commonService.insertLog(MessageLogEnum.DELETE_NETWORKING_DEVICE, headerData, logMap, headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
+            }
+        }
         return HttpResult.ok("删除关联设备成功!");
     }
 }

+ 22 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ReportService.java

@@ -1,15 +1,20 @@
 package com.sckw.slope.detection.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.MessageLogEnum;
 import com.sckw.core.model.enums.ReportEnum;
 import com.sckw.core.model.enums.ReportTypeEnum;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.dao.mysql.KwsProjectMapper;
 import com.sckw.slope.detection.dao.mysql.KwsReportDataMapper;
 import com.sckw.slope.detection.dao.mysql.KwsReportTemplateMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsProject;
 import com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate;
 import com.sckw.slope.detection.model.dto.HeaderData;
 import com.sckw.slope.detection.model.param.StatementQuery;
@@ -22,7 +27,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.time.LocalDateTime;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author lfdc
@@ -38,6 +45,8 @@ public class ReportService {
 
     @Autowired
     KwsReportDataMapper reportDataMapper;
+    @Autowired
+    KwsProjectMapper projectMapper;
 
     @Autowired
     KwsReportTemplateMapper reportTemplateMapper;
@@ -67,12 +76,25 @@ public class ReportService {
 
     public HttpResult dels(String id, HttpServletRequest request) {
         HeaderData headerData = commonService.getHeaderData(request);
+        KwsReportTemplate template = reportTemplateMapper.selectOne(new LambdaQueryWrapper<KwsReportTemplate>().eq(KwsReportTemplate::getDelFlag, 0)
+                .eq(KwsReportTemplate::getId, Long.parseLong(id)));
+        if (template == null) {
+            throw new BusinessException("模板删除失败,参数错误");
+        }
         reportTemplateMapper.update(null, new LambdaUpdateWrapper<KwsReportTemplate>()
                 .eq(KwsReportTemplate::getId, Long.parseLong(id))
                 .set(KwsReportTemplate::getUpdateTime, LocalDateTime.now())
                 .set(KwsReportTemplate::getUpdateBy, (headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy())))
                 .set(KwsReportTemplate::getStatus, NumberConstant.ONE)
         );
+        KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
+                .eq(KwsProject::getId, Long.parseLong(template.getProjectId())));
+        Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+        logMap.put("projectName", project.getName());
+        logMap.put("templateName", template.getName());
+        commonService.insertLog(MessageLogEnum.DELETE_REPORT_TEMPLATE, headerData, logMap, headerData.getUpdateBy() == null ?
+                null : Long.parseLong(headerData.getUpdateBy()));
+
         return HttpResult.ok("删除成功");
     }
 }

+ 40 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ReportTemplateService.java

@@ -4,10 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.MessageLogEnum;
 import com.sckw.core.model.enums.ReportTypeEnum;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.dao.mysql.KwsProjectMapper;
 import com.sckw.slope.detection.dao.mysql.KwsReportTemplateMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsProject;
 import com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate;
 import com.sckw.slope.detection.model.dto.HeaderData;
 import com.sckw.slope.detection.model.dto.IsEnableDTO;
@@ -22,6 +25,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * @author lfdc
@@ -35,6 +40,9 @@ public class ReportTemplateService {
     @Autowired
     CommonService commonService;
 
+    @Autowired
+    KwsProjectMapper projectMapper;
+
     @Autowired
     KwsReportTemplateMapper reportTemplateMapper;
 
@@ -68,6 +76,12 @@ public class ReportTemplateService {
         template.setCreateTime(now);
         template.setUpdateTime(now);
         reportTemplateMapper.insert(template);
+        KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
+                .eq(KwsProject::getId, Long.parseLong(projectId)));
+        Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+        logMap.put("projectName", project.getName());
+        logMap.put("templateName", reportTemplateDTO.getName());
+        commonService.insertLog(MessageLogEnum.ADD_REPORT_TEMPLATE, headerData, logMap, headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
         return HttpResult.ok();
     }
 
@@ -111,6 +125,13 @@ public class ReportTemplateService {
         template.setStatus(Integer.parseInt(reportTemplateUpdateDTO.getStatus()));
         template.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
         template.setUpdateTime(LocalDateTime.now());
+        KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
+                .eq(KwsProject::getId, Long.parseLong(template.getProjectId())));
+        Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+        logMap.put("projectName", project.getName());
+        logMap.put("templateName", template.getName());
+        commonService.insertLog(MessageLogEnum.UPDATE_REPORT_TEMPLATE, headerData, logMap, headerData.getUpdateBy() == null ?
+                null : Long.parseLong(headerData.getUpdateBy()));
         return HttpResult.ok();
     }
 
@@ -121,12 +142,30 @@ public class ReportTemplateService {
         if (!isEnable.isFlag()) {
             status = "1";
         }
+        Long templateId = Long.parseLong(isEnable.getId());
+        KwsReportTemplate template = reportTemplateMapper.selectOne(new LambdaQueryWrapper<KwsReportTemplate>()
+                .eq(KwsReportTemplate::getId, templateId)
+                .eq(KwsReportTemplate::getMountainId, headerData.getMountainId()));
+        if (template == null) {
+            throw new BusinessException("模板数据异常!");
+        }
         reportTemplateMapper.update(null, new LambdaUpdateWrapper<KwsReportTemplate>()
                 .set(KwsReportTemplate::getStatus, status)
                 .set(KwsReportTemplate::getUpdateTime, LocalDateTime.now())
                 .set(KwsReportTemplate::getUpdateBy, (headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy())))
-                .eq(KwsReportTemplate::getId, isEnable.getId())
+                .eq(KwsReportTemplate::getId, templateId)
         );
+        KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
+                .eq(KwsProject::getId, Long.parseLong(template.getProjectId())));
+        Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+        logMap.put("projectName", project.getName());
+        logMap.put("templateName", template.getName());
+        MessageLogEnum messageLogEnum = MessageLogEnum.FORBIDDEN_REPORT_TEMPLATE;
+        if (isEnable.isFlag()) {
+             messageLogEnum = MessageLogEnum.FORBIDDEN_REPORT_TEMPLATE;
+        }
+        commonService.insertLog(messageLogEnum, headerData, logMap, headerData.getUpdateBy() == null ?
+                null : Long.parseLong(headerData.getUpdateBy()));
         return HttpResult.ok("修改成功");
     }
 }

+ 17 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ThresholdService.java

@@ -8,6 +8,7 @@ import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.enums.DeviceEnum;
 import com.sckw.core.model.enums.DictEnum;
+import com.sckw.core.model.enums.MessageLogEnum;
 import com.sckw.core.model.enums.ThresholdEnum;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.IdWorker;
@@ -16,7 +17,9 @@ import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.slope.detection.dao.mysql.*;
+import com.sckw.slope.detection.model.dos.mysql.KwsDevice;
 import com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference;
+import com.sckw.slope.detection.model.dos.mysql.KwsProject;
 import com.sckw.slope.detection.model.dos.mysql.KwsThreshold;
 import com.sckw.slope.detection.model.dto.*;
 import com.sckw.slope.detection.model.param.ThresholdDetailQuery;
@@ -57,6 +60,9 @@ public class ThresholdService {
     @Autowired
     KwsDeviceMapper deviceMapper;
 
+    @Autowired
+    KwsProjectMapper projectMapper;
+
     @Autowired
     KwsDeviceIntegrationMapper deviceIntegrationMapper;
 
@@ -229,6 +235,7 @@ public class ThresholdService {
     @Transactional
     public HttpResult configuration(ThresholdConfigurationDTO configurationDTO, HttpServletRequest request) {
         HeaderData headerData = commonService.getHeaderData(request);
+        String projectId = configurationDTO.getProjectId();
         List<ThresholdBean> threshold = configurationDTO.getThreshold();
         String itemName = configurationDTO.getItemName();
         String phones = configurationDTO.getPhones();
@@ -292,6 +299,16 @@ public class ThresholdService {
                 thresholdRepository.saveOrUpdate(selected);
             }
         }
+        Map<String, SystemDict> dict = commonService.getDictByDictCode(DictEnum.MODEL_PART);
+        KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
+                .eq(KwsProject::getId, Long.parseLong(projectId)));
+        KwsDevice kwsDevice = deviceMapper.selectOne(new LambdaQueryWrapper<KwsDevice>().eq(KwsDevice::getId, Long.parseLong(deviceId)));
+        Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+        logMap.put("projectName", project.getName());
+        logMap.put("element", dict == null ? itemName : dict.get(itemName).getLabel());
+        logMap.put("deviceName", kwsDevice == null ? null : kwsDevice.getName());
+        commonService.insertLog(MessageLogEnum.SETTINGS_DEVICE_THRESHOLD, headerData, logMap, headerData.getUpdateBy() == null ?
+                null : Long.parseLong(headerData.getUpdateBy()));
         return HttpResult.ok();
     }
 

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

@@ -8,12 +8,13 @@
     <result column="type" jdbcType="VARCHAR" property="type" />
     <result column="content" jdbcType="VARCHAR" property="content" />
       <result column="company_id" jdbcType="VARCHAR" property="companyId" />
+      <result column="mountain_id" jdbcType="VARCHAR" property="mountainId" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, `type`, content, create_by, create_time,company_id
+    id, `type`, content, create_by, create_time,company_id,mountain_id
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
@@ -27,13 +28,6 @@
     delete from kws_log
     where id = #{id,jdbcType=BIGINT}
   </delete>
-  <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsLog">
-    <!--@mbg.generated-->
-    insert into kws_log (id, `type`, content, 
-      create_by, create_time)
-    values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, 
-      #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP})
-  </insert>
   <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsLog">
     <!--@mbg.generated-->
     insert into kws_log

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

@@ -8,6 +8,7 @@
         <result column="name" jdbcType="VARCHAR" property="name"/>
         <result column="type" jdbcType="INTEGER" property="type"/>
         <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
+        <result column="mountain_id" jdbcType="VARCHAR" property="mountainId"/>
         <result column="project_id" jdbcType="VARCHAR" property="projectId"/>
         <result column="part_names" jdbcType="VARCHAR" property="partNames"/>
         <result column="tabulation_time" jdbcType="VARCHAR" property="tabulationTime"/>
@@ -34,6 +35,7 @@
         update_time,
         del_flag,
         company_id,
+        mountain_id,
         tabulation_time
     </sql>
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">