瀏覽代碼

Merge branch 'fpg-master' of 123.57.213.14:guoqiang.duan/zgzt-sys-java into fpg-master

guoqiang 5 月之前
父節點
當前提交
4c890d058d

+ 164 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/events/controller/LeanEventsController.java

@@ -0,0 +1,164 @@
+package org.jeecg.modules.events.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.events.entity.LeanEvents;
+import org.jeecg.modules.events.entity.LeanEventsHost;
+import org.jeecg.modules.events.service.ILeanEventsHostService;
+import org.jeecg.modules.events.service.ILeanEventsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+
+/**
+* @Description: 精益事件管理表
+* @Author: jeecg-boot
+* @Date:   2024-09-20
+* @Version: V1.0
+*/
+@Api(tags="精益事件管理表")
+@RestController
+@RequestMapping("/events/leanEvents")
+@Slf4j
+public class LeanEventsController extends JeecgController<LeanEvents, ILeanEventsService> {
+   @Autowired
+   private ILeanEventsService leanEventsService;
+
+    @Autowired
+    private ILeanEventsHostService leanEventsHostService;
+   /**
+    * 分页列表查询
+    *
+    * @param leanEvents
+    * @param pageNo
+    * @param pageSize
+    * @param req
+    * @return
+    */
+   //@AutoLog(value = "精益事件管理表-分页列表查询")
+   @ApiOperation(value="精益事件管理表-分页列表查询", notes="精益事件管理表-分页列表查询")
+   @GetMapping(value = "/list")
+   public Result<IPage<LeanEvents>> queryPageList(LeanEvents leanEvents,
+                                  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+                                  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+                                  HttpServletRequest req) {
+       QueryWrapper<LeanEvents> queryWrapper = QueryGenerator.initQueryWrapper(leanEvents, req.getParameterMap());
+       Page<LeanEvents> page = new Page<LeanEvents>(pageNo, pageSize);
+       IPage<LeanEvents> pageList = leanEventsService.page(page, queryWrapper);
+       return Result.OK(pageList);
+   }
+
+   /**
+    *   添加
+    *
+    * @param leanEvents
+    * @return
+    */
+   @AutoLog(value = "精益事件管理表-添加")
+   @ApiOperation(value="精益事件管理表-添加", notes="精益事件管理表-添加")
+//	@RequiresPermissions("events:lean_events:add")
+   @PostMapping(value = "/add")
+   public Result<String> add(@RequestBody LeanEvents leanEvents) {
+       leanEventsService.save(leanEvents);
+       return Result.OK("添加成功!");
+   }
+
+   /**
+    *  编辑
+    *
+    * @param leanEvents
+    * @return
+    */
+   @AutoLog(value = "精益事件管理表-编辑")
+   @ApiOperation(value="精益事件管理表-编辑", notes="精益事件管理表-编辑")
+//	@RequiresPermissions("events:lean_events:edit")
+   @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+   public Result<String> edit(@RequestBody LeanEvents leanEvents) {
+       leanEventsService.updateById(leanEvents);
+       return Result.OK("编辑成功!");
+   }
+
+   /**
+    *   通过id删除
+    *
+    * @param id
+    * @return
+    */
+   @AutoLog(value = "精益事件管理表-通过id删除")
+   @ApiOperation(value="精益事件管理表-通过id删除", notes="精益事件管理表-通过id删除")
+   @DeleteMapping(value = "/delete")
+   public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+       leanEventsService.removeById(id);
+       leanEventsHostService.remove(new LambdaQueryWrapper<LeanEventsHost>().eq(LeanEventsHost::getEventsId,id));
+       return Result.OK("删除成功!");
+   }
+
+   /**
+    *  批量删除
+    *
+    * @param ids
+    * @return
+    */
+   @AutoLog(value = "精益事件管理表-批量删除")
+   @ApiOperation(value="精益事件管理表-批量删除", notes="精益事件管理表-批量删除")
+   @DeleteMapping(value = "/deleteBatch")
+   public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+       this.leanEventsService.removeByIds(Arrays.asList(ids.split(",")));
+       leanEventsHostService.remove(new LambdaQueryWrapper<LeanEventsHost>().in(LeanEventsHost::getEventsId,Arrays.asList(ids.split(","))));
+       return Result.OK("批量删除成功!");
+   }
+
+   /**
+    * 通过id查询
+    *
+    * @param id
+    * @return
+    */
+   //@AutoLog(value = "精益事件管理表-通过id查询")
+   @ApiOperation(value="精益事件管理表-通过id查询", notes="精益事件管理表-通过id查询")
+   @GetMapping(value = "/queryById")
+   public Result<LeanEvents> queryById(@RequestParam(name="id",required=true) String id) {
+       LeanEvents leanEvents = leanEventsService.getById(id);
+       if(leanEvents==null) {
+           return Result.error("未找到对应数据");
+       }
+       return Result.OK(leanEvents);
+   }
+
+   /**
+   * 导出excel
+   *
+   * @param request
+   * @param leanEvents
+   */
+   @RequestMapping(value = "/exportXls")
+   public ModelAndView exportXls(HttpServletRequest request, LeanEvents leanEvents) {
+       return super.exportXls(request, leanEvents, LeanEvents.class, "精益事件管理表");
+   }
+
+   /**
+     * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+   @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+   public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+       return super.importExcel(request, response, LeanEvents.class);
+   }
+
+}

+ 74 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/events/entity/LeanEvents.java

@@ -0,0 +1,74 @@
+package org.jeecg.modules.events.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecg.common.aspect.annotation.Dict;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 精益事件管理表
+ * @Author: jeecg-boot
+ * @Date:   2024-09-20
+ * @Version: V1.0
+ */
+@Data
+@TableName("lean_events")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="lean_events对象", description="精益事件管理表")
+public class LeanEvents implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**精益事件名称*/
+	@Excel(name = "精益事件名称", width = 15)
+    @ApiModelProperty(value = "精益事件名称")
+    private String title;
+	/**精益事件描述*/
+	@Excel(name = "精益事件描述", width = 15)
+    @ApiModelProperty(value = "精益事件描述")
+    private String remark;
+	/**状态*/
+	@Excel(name = "状态", width = 15, dicCode = "open_close")
+	@Dict(dicCode = "open_close")
+    @ApiModelProperty(value = "状态")
+    private String status;
+	/**精益事件类型*/
+	@Excel(name = "精益事件类型", width = 15, dicCode = "lean_events_types")
+	@Dict(dicCode = "lean_events_types")
+    @ApiModelProperty(value = "精益事件类型")
+    private String envModule;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+}

+ 14 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/events/mapper/LeanEventsMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.events.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.events.entity.LeanEvents;
+
+/**
+ * @Description: 精益事件管理表
+ * @Author: jeecg-boot
+ * @Date:   2024-09-20
+ * @Version: V1.0
+ */
+public interface LeanEventsMapper extends BaseMapper<LeanEvents> {
+
+}

+ 5 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/events/mapper/xml/LeanEventsMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.events.mapper.LeanEventsMapper">
+
+</mapper>

+ 14 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/events/service/ILeanEventsService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.events.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.events.entity.LeanEvents;
+
+/**
+ * @Description: 精益事件管理表
+ * @Author: jeecg-boot
+ * @Date:   2024-09-20
+ * @Version: V1.0
+ */
+public interface ILeanEventsService extends IService<LeanEvents> {
+
+}

+ 18 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/events/service/impl/LeanEventsServiceImpl.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.events.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.events.entity.LeanEvents;
+import org.jeecg.modules.events.mapper.LeanEventsMapper;
+import org.jeecg.modules.events.service.ILeanEventsService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @Description: 精益事件管理表
+ * @Author: jeecg-boot
+ * @Date:   2024-09-20
+ * @Version: V1.0
+ */
+@Service
+public class LeanEventsServiceImpl extends ServiceImpl<LeanEventsMapper, LeanEvents> implements ILeanEventsService {
+
+}

+ 4 - 4
jeecg-module-gather/src/main/java/org/jeecg/modules/fpgJob/LeanEventTriggerWarnTask.java

@@ -91,10 +91,10 @@ public class LeanEventTriggerWarnTask {
                 leanEventsHostList.forEach(y ->{
                     // 事件类型为host_stop、host_open
                     if (EDeviceInformationType.HOST_OPEN.getCode().equals(y.getDeviceInformationType())){
-                        leanEventWarnInfoService.openDeviceTriggerWarnInfo(fpgGatherData);
+                        leanEventWarnInfoService.openDeviceTriggerWarnInfo(fpgGatherData, y);
                     }
                     if (EDeviceInformationType.HOST_STOP.getCode().equals(y.getDeviceInformationType())){
-                        leanEventWarnInfoService.stopDeviceTriggerWarnInfo(fpgGatherData);
+                        leanEventWarnInfoService.stopDeviceTriggerWarnInfo(fpgGatherData, y);
                     }
                 });
             }
@@ -113,11 +113,11 @@ public class LeanEventTriggerWarnTask {
                 leanEventsHostList.forEach(s ->{
                     // 事件类型为 fpg_open
                     if (EDeviceInformationType.FPG_OPEN.getCode().equals(s.getDeviceInformationType())){
-                        leanEventWarnInfoService.openFpgTriggerWarnInfo(fpgGatherData);
+                        leanEventWarnInfoService.openFpgTriggerWarnInfo(fpgGatherData, s);
                     }
                     // 事件类型为 fpg_close
                     if (EDeviceInformationType.FPG_CLOSE.getCode().equals(s.getDeviceInformationType())){
-                        leanEventWarnInfoService.closeFpgTriggerWarnInfo(fpgGatherData);
+                        leanEventWarnInfoService.closeFpgTriggerWarnInfo(fpgGatherData, s);
                     }
                     // 事件类型为 fpg_ing_time
                     if (EDeviceInformationType.FPG_ING_TIME.getCode().equals(s.getDeviceInformationType())){

+ 4 - 4
jeecg-module-gather/src/main/java/org/jeecg/modules/leanEventWarn/service/ILeanEventWarnInfoService.java

@@ -13,13 +13,13 @@ import org.jeecg.modules.leanEventWarn.entity.LeanEventWarnInfo;
  */
 public interface ILeanEventWarnInfoService extends IService<LeanEventWarnInfo> {
 
-    void openDeviceTriggerWarnInfo(FpgGatherData fpgGatherData);
+    void openDeviceTriggerWarnInfo(FpgGatherData fpgGatherData, LeanEventsHost leanEventsHost);
 
-    void stopDeviceTriggerWarnInfo(FpgGatherData fpgGatherData);
+    void stopDeviceTriggerWarnInfo(FpgGatherData fpgGatherData, LeanEventsHost leanEventsHost);
 
-    void openFpgTriggerWarnInfo(FpgGatherData fpgGatherData);
+    void openFpgTriggerWarnInfo(FpgGatherData fpgGatherData, LeanEventsHost leanEventsHost);
 
-    void closeFpgTriggerWarnInfo(FpgGatherData fpgGatherData);
+    void closeFpgTriggerWarnInfo(FpgGatherData fpgGatherData, LeanEventsHost leanEventsHost);
 
     void runTimeTriggerWarnInfo(FpgGatherData fpgGatherData, LeanEventsHost leanEventsHost);
 

+ 49 - 22
jeecg-module-gather/src/main/java/org/jeecg/modules/leanEventWarn/service/impl/LeanEventWarnInfoServiceImpl.java

@@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.common.enums.EDeviceInformationType;
+import org.jeecg.modules.events.entity.LeanEvents;
 import org.jeecg.modules.events.entity.LeanEventsHost;
+import org.jeecg.modules.events.service.ILeanEventsHostService;
+import org.jeecg.modules.events.service.ILeanEventsService;
 import org.jeecg.modules.gatherData.entity.FpgStatiscsModelMongodb;
 import org.jeecg.modules.leanEventWarn.entity.LeanEventWarnInfo;
 import org.jeecg.modules.leanEventWarn.entity.LeanEventsHostConfig;
@@ -62,9 +65,15 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
     @Autowired
     ISystemVariableService systemVariableService;
 
+    @Autowired
+    ILeanEventsHostService leanEventsHostService;
+
+    @Autowired
+    ILeanEventsService leanEventsService;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void openDeviceTriggerWarnInfo(FpgGatherData fpgGatherData) {
+    public void openDeviceTriggerWarnInfo(FpgGatherData fpgGatherData, LeanEventsHost leanEventsHost) {
         LeanEventWarnInfo leanEventWarnInfo = new LeanEventWarnInfo();
         leanEventWarnInfo.setDeviceRegionId(fpgGatherData.getDeviceRegionId());
         leanEventWarnInfo.setDeviceInformationId(fpgGatherData.getDeviceInformationId());
@@ -83,8 +92,9 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         BigDecimal limitCurrent = new BigDecimal(systemVariable.getDefaultValue());
 
         if (fpgGatherData.getRunCurrent().compareTo(limitCurrent) < 0){
+            LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
             // 上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("HOST_OPEN状态下,辅设备电流小于5A,触发告警!");
+            leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
             leanEventWarnInfo.setWarnType(EDeviceInformationType.HOST_OPEN.getCode());
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -94,7 +104,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void stopDeviceTriggerWarnInfo(FpgGatherData fpgGatherData) {
+    public void stopDeviceTriggerWarnInfo(FpgGatherData fpgGatherData, LeanEventsHost leanEventsHost) {
         LeanEventWarnInfo leanEventWarnInfo = new LeanEventWarnInfo();
         leanEventWarnInfo.setDeviceRegionId(fpgGatherData.getDeviceRegionId());
         leanEventWarnInfo.setDeviceInformationId(fpgGatherData.getDeviceInformationId());
@@ -111,8 +121,9 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         }
         BigDecimal limitCurrent = new BigDecimal(systemVariable.getDefaultValue());
         if (fpgGatherData.getRunCurrent().compareTo(limitCurrent) > 0){
+            LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
             // 上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("HOST_CLOSE状态下,辅设备电流大于" + limitCurrent + "A,触发告警!");
+            leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
             leanEventWarnInfo.setWarnType(EDeviceInformationType.HOST_STOP.getCode());
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -122,7 +133,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void openFpgTriggerWarnInfo(FpgGatherData fpgGatherData) {
+    public void openFpgTriggerWarnInfo(FpgGatherData fpgGatherData, LeanEventsHost leanEventsHost) {
         LeanEventWarnInfo leanEventWarnInfo = new LeanEventWarnInfo();
         leanEventWarnInfo.setDeviceRegionId(fpgGatherData.getDeviceRegionId());
         leanEventWarnInfo.setDeviceInformationId(fpgGatherData.getDeviceInformationId());
@@ -155,7 +166,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean topsIsExit = topsNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> DateUtils.containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (topsIsExit && fpgGatherData.getRunCurrent().compareTo(limitCurrent) < 0){
             // 采集到的数据电流小于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,尖时段采集到的数据电流小于" + limitCurrent + "A,触发告警!");
+            LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+            leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
             leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_OPEN.getCode());
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -164,7 +176,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean peaksIsExit = peaksNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> DateUtils.containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (peaksIsExit && fpgGatherData.getRunCurrent().compareTo(limitCurrent) < 0){
             // 采集到的数据电流小于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,峰时段采集到的数据电流小于" + limitCurrent + "A,触发告警!");
+            LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+            leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
             leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_OPEN.getCode());
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -173,7 +186,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean flatIsExit = flatNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> DateUtils.containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (flatIsExit && fpgGatherData.getRunCurrent().compareTo(limitCurrent) < 0){
             // 采集到的数据电流小于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,平时段采集到的数据电流小于" + limitCurrent + "A,触发告警!");
+            LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+            leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
             leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_OPEN.getCode());
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -182,7 +196,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean valleysIsExit = valleysNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> DateUtils.containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (valleysIsExit && fpgGatherData.getRunCurrent().compareTo(limitCurrent) < 0){
             // 采集到的数据电流小于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_OPEN状态下,谷时段采集到的数据电流小于" + limitCurrent + "A,触发告警!");
+            LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+            leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
             leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_OPEN.getCode());
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -212,7 +227,7 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void closeFpgTriggerWarnInfo(FpgGatherData fpgGatherData) {
+    public void closeFpgTriggerWarnInfo(FpgGatherData fpgGatherData, LeanEventsHost leanEventsHost) {
         LeanEventWarnInfo leanEventWarnInfo = new LeanEventWarnInfo();
         leanEventWarnInfo.setDeviceRegionId(fpgGatherData.getDeviceRegionId());
         leanEventWarnInfo.setDeviceInformationId(fpgGatherData.getDeviceInformationId());
@@ -245,7 +260,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean topsIsExit = topsNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> DateUtils.containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (topsIsExit && fpgGatherData.getRunCurrent().compareTo(limitCurrent) > 0){
             // 采集到的数据电流大于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_CLOSE状态下,尖采集到的数据电流大于" + limitCurrent + "A,触发告警!");
+            LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+            leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
             leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_CLOSE.getCode());
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -254,7 +270,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean peaksIsExit = peaksNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> DateUtils.containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (peaksIsExit && fpgGatherData.getRunCurrent().compareTo(limitCurrent) > 0){
             // 采集到的数据电流大于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_CLOSE状态下,峰采集到的数据电流大于" + limitCurrent + "A,触发告警!");
+            LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+            leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
             leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_CLOSE.getCode());
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -263,7 +280,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean flatIsExit = flatNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> DateUtils.containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (flatIsExit && fpgGatherData.getRunCurrent().compareTo(limitCurrent) > 0){
             // 采集到的数据电流大于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_CLOSE状态下,平采集到的数据电流大于" + limitCurrent + "A,触发告警!");
+            LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+            leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
             leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_CLOSE.getCode());
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -272,7 +290,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
         boolean valleysIsExit = valleysNewPeaksAndValleysTimeConfigList.stream().anyMatch(a -> DateUtils.containsCreateTime(localDateTime, a.getStartTime(), a.getEndTime()));
         if (valleysIsExit && fpgGatherData.getRunCurrent().compareTo(limitCurrent) > 0){
             // 采集到的数据电流大于5A,上报告警信息
-            leanEventWarnInfo.setDeviceWarnInfo("FPG_CLOSE状态下,谷采集到的数据电流大于" + limitCurrent + "A,触发告警!");
+            LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+            leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
             leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_CLOSE.getCode());
             leanEventWarnInfo.setDeviceWarnLevel("0");
             // 更新或者新增逻辑处理
@@ -325,7 +344,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
                     .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
             if (topsIngTimeSum.intValue() > runTimeLimit){
                 // 尖——累加运行时长超过限制时长,触发告警
-                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,尖运行时长超过限制时长" + runTimeLimit + ",触发告警!");
+                LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+                leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
                 leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_ING_TIME.getCode());
                 leanEventWarnInfo.setDeviceWarnLevel("0");
                 // 更新或者新增逻辑处理
@@ -336,7 +356,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
                     .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
             if (peaksIngTimeSum.intValue() > runTimeLimit){
                 // 峰——累加运行时长超过限制时长,触发告警
-                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,峰运行时长超过限制时长" + runTimeLimit + ",触发告警!");
+                LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+                leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
                 leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_ING_TIME.getCode());
                 leanEventWarnInfo.setDeviceWarnLevel("0");
                 // 更新或者新增逻辑处理
@@ -347,7 +368,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
                     .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
             if (flatIngTimeSum.intValue() > runTimeLimit){
                 // 平——累加运行时长超过限制时长,触发告警
-                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,平运行时长超过限制时长" + runTimeLimit + ",触发告警!");
+                LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+                leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
                 leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_ING_TIME.getCode());
                 leanEventWarnInfo.setDeviceWarnLevel("0");
                 // 更新或者新增逻辑处理
@@ -358,7 +380,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
                     .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(60), 0, RoundingMode.CEILING);
             if (valleysIngTimeSum.intValue() > runTimeLimit){
                 // 谷——累加运行时长超过限制时长,触发告警
-                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_ING_TIME,谷运行时长超过限制时长" + runTimeLimit + ",触发告警!");
+                LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+                leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
                 leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_ING_TIME.getCode());
                 leanEventWarnInfo.setDeviceWarnLevel("0");
                 // 更新或者新增逻辑处理
@@ -410,7 +433,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
             BigDecimal topsPowerLimitSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelMongodb::getTopsPower).reduce(BigDecimal.ZERO, BigDecimal::add);
             if (topsPowerLimitSum.intValue() > powerLimit){
                 // 尖——累加累计功率超过功率限制,触发告警
-                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_POWER_LIMIT,尖累计功率超过功率限制" + powerLimit +"A,触发告警!");
+                LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+                leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
                 leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_POWER_LIMIT.getCode());
                 leanEventWarnInfo.setDeviceWarnLevel("0");
                 // 更新或者新增逻辑处理
@@ -420,7 +444,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
             BigDecimal peaksPowerLimitSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelMongodb::getPeaksPower).reduce(BigDecimal.ZERO, BigDecimal::add);
             if (peaksPowerLimitSum.intValue() > powerLimit){
                 // 峰——累加累计功率超过功率限制,触发告警
-                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_POWER_LIMIT,峰累计功率超过功率限制" + powerLimit +"A,触发告警!");
+                LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+                leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
                 leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_POWER_LIMIT.getCode());
                 leanEventWarnInfo.setDeviceWarnLevel("0");
                 // 更新或者新增逻辑处理
@@ -430,7 +455,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
             BigDecimal flatPowerLimitSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelMongodb::getFlatPower).reduce(BigDecimal.ZERO, BigDecimal::add);
             if (flatPowerLimitSum.intValue() > powerLimit){
                 // 平——累加累计功率超过功率限制,触发告警
-                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_POWER_LIMIT,平累计功率超过功率限制" + powerLimit +"A,触发告警!");
+                LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+                leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
                 leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_POWER_LIMIT.getCode());
                 leanEventWarnInfo.setDeviceWarnLevel("0");
                 // 更新或者新增逻辑处理
@@ -440,7 +466,8 @@ public class LeanEventWarnInfoServiceImpl extends ServiceImpl<LeanEventWarnInfoM
             BigDecimal valleysPowerLimitSum = fpgStatiscsModelDataList.stream().map(FpgStatiscsModelMongodb::getValleysPower).reduce(BigDecimal.ZERO, BigDecimal::add);
             if (valleysPowerLimitSum.intValue() > powerLimit){
                 // 谷——累加累计功率超过功率限制,触发告警
-                leanEventWarnInfo.setDeviceWarnInfo("事件类型为FPG_POWER_LIMIT,谷累计功率超过功率限制" + powerLimit +"A,触发告警!");
+                LeanEvents leanEvents = leanEventsService.getById(leanEventsHost.getEventsId());
+                leanEventWarnInfo.setDeviceWarnInfo(leanEvents.getRemark());
                 leanEventWarnInfo.setWarnType(EDeviceInformationType.FPG_POWER_LIMIT.getCode());
                 leanEventWarnInfo.setDeviceWarnLevel("0");
                 // 更新或者新增逻辑处理