浏览代码

Merge branch 'feature-management-2021-9-16' of http://47.111.81.118:3000/hanzhengyi/usky-power into feature-management-2021-9-16

guoenzhou 3 年之前
父节点
当前提交
fa1015a0ef
共有 43 个文件被更改,包括 2482 次插入1 次删除
  1. 21 0
      fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinAlarmConfigController.java
  2. 41 0
      fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinContentListController.java
  3. 143 0
      fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinCruxConfigController.java
  4. 21 0
      fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinHistoricalConfigController.java
  5. 21 0
      fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinHistoricalRelationController.java
  6. 21 0
      fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinStatusConfigController.java
  7. 1 1
      fiveep-controller/src/main/java/com/bizmatics/controller/web/MybatisGeneratorUtils.java
  8. 83 0
      fiveep-model/src/main/java/com/bizmatics/model/BulletinAlarmConfig.java
  9. 47 0
      fiveep-model/src/main/java/com/bizmatics/model/BulletinContentList.java
  10. 131 0
      fiveep-model/src/main/java/com/bizmatics/model/BulletinCruxConfig.java
  11. 108 0
      fiveep-model/src/main/java/com/bizmatics/model/BulletinHistoricalConfig.java
  12. 62 0
      fiveep-model/src/main/java/com/bizmatics/model/BulletinHistoricalRelation.java
  13. 53 0
      fiveep-model/src/main/java/com/bizmatics/model/BulletinStatusConfig.java
  14. 112 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/AlarmPowerVo.java
  15. 186 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/BulletinCruxConfigVo.java
  16. 114 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/BulletinHistoricalConfigAddVo.java
  17. 83 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/BulletinHistoricalRelationVo.java
  18. 88 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/DeviceDataVo.java
  19. 9 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/RtData.java
  20. 16 0
      fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinAlarmConfigMapper.java
  21. 16 0
      fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinContentListMapper.java
  22. 44 0
      fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinCruxConfigMapper.java
  23. 16 0
      fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinHistoricalConfigMapper.java
  24. 16 0
      fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinHistoricalRelationMapper.java
  25. 16 0
      fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinStatusConfigMapper.java
  26. 20 0
      fiveep-persistence/src/main/resources/mapper/mysql/BulletinAlarmConfigMapper.xml
  27. 13 0
      fiveep-persistence/src/main/resources/mapper/mysql/BulletinContentListMapper.xml
  28. 153 0
      fiveep-persistence/src/main/resources/mapper/mysql/BulletinCruxConfigMapper.xml
  29. 25 0
      fiveep-persistence/src/main/resources/mapper/mysql/BulletinHistoricalConfigMapper.xml
  30. 16 0
      fiveep-persistence/src/main/resources/mapper/mysql/BulletinHistoricalRelationMapper.xml
  31. 14 0
      fiveep-persistence/src/main/resources/mapper/mysql/BulletinStatusConfigMapper.xml
  32. 16 0
      fiveep-service/src/main/java/com/bizmatics/service/BulletinAlarmConfigService.java
  33. 20 0
      fiveep-service/src/main/java/com/bizmatics/service/BulletinContentListService.java
  34. 49 0
      fiveep-service/src/main/java/com/bizmatics/service/BulletinCruxConfigService.java
  35. 16 0
      fiveep-service/src/main/java/com/bizmatics/service/BulletinHistoricalConfigService.java
  36. 16 0
      fiveep-service/src/main/java/com/bizmatics/service/BulletinHistoricalRelationService.java
  37. 16 0
      fiveep-service/src/main/java/com/bizmatics/service/BulletinStatusConfigService.java
  38. 20 0
      fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinAlarmConfigServiceImpl.java
  39. 36 0
      fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinContentListServiceImpl.java
  40. 523 0
      fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinCruxConfigServiceImpl.java
  41. 20 0
      fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinHistoricalConfigServiceImpl.java
  42. 20 0
      fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinHistoricalRelationServiceImpl.java
  43. 20 0
      fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinStatusConfigServiceImpl.java

+ 21 - 0
fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinAlarmConfigController.java

@@ -0,0 +1,21 @@
+package com.bizmatics.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-07
+ */
+@Controller
+@RequestMapping("/bulletinAlarmConfig")
+public class BulletinAlarmConfigController {
+
+}
+

+ 41 - 0
fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinContentListController.java

@@ -0,0 +1,41 @@
+package com.bizmatics.controller.web;
+
+
+import com.bizmatics.common.core.bean.ApiResult;
+import com.bizmatics.model.BulletinContentList;
+import com.bizmatics.service.BulletinContentListService;
+import com.bizmatics.service.vo.DeviceCountVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 内容清单
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+@RestController
+@RequestMapping("/bulletinContentList")
+public class BulletinContentListController {
+
+    @Autowired
+    private BulletinContentListService bulletinContentListService;
+
+    /**
+     * 内容清单列表查询
+     * @return
+     */
+    @GetMapping("/getBulletinContentList")
+    public ApiResult<List<BulletinContentList>> getBulletinContentList() {
+        return ApiResult.success(bulletinContentListService.getBulletinContentList());
+    }
+
+}
+

+ 143 - 0
fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinCruxConfigController.java

@@ -0,0 +1,143 @@
+package com.bizmatics.controller.web;
+
+
+import com.bizmatics.common.core.bean.ApiResult;
+import com.bizmatics.model.BulletinAlarmConfig;
+import com.bizmatics.model.BulletinCruxConfig;
+import com.bizmatics.model.DeviceAnalogVariableList;
+import com.bizmatics.model.DeviceAttribute;
+import com.bizmatics.model.vo.BulletinHistoricalConfigAddVo;
+import com.bizmatics.service.BulletinCruxConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 数据看板
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+@RestController
+@RequestMapping("/bulletinCruxConfig")
+public class BulletinCruxConfigController {
+    @Autowired
+    private BulletinCruxConfigService bulletinCruxConfigService;
+
+    /**
+     * 数据看板-数据配置查询
+     *
+     * @param siteId    站点ID
+     * @param id        配置id
+     * @param colorType 类型
+     * @return
+     */
+    @GetMapping("/getBulletinCruxConfigList")
+    public ApiResult<List<Object>> getBulletinCruxConfigList(@RequestParam(value = "siteId") Integer siteId,
+                                                             @RequestParam(value = "id", required = false, defaultValue = "0") Integer id,
+                                                             @RequestParam(value = "colorType", required = false) String colorType) {
+        return ApiResult.success(bulletinCruxConfigService.getBulletinCruxConfigList(siteId, id, colorType));
+    }
+
+
+    /**
+     * 数据看板-数据配置1编辑新增
+     *
+     * @param bulletinCruxConfig
+     * @return
+     */
+    @PostMapping("editBulletinCruxConfig")
+    public ApiResult<Void> editBulletinCruxConfig(@RequestBody BulletinCruxConfig bulletinCruxConfig) {
+        bulletinCruxConfigService.editBulletinCruxConfig(bulletinCruxConfig);
+        return ApiResult.success();
+    }
+
+    /**
+     * 数据看板-数据配置2编辑新增
+     *
+     * @param bulletinHistoricalConfigAddVo
+     * @return
+     */
+    @PostMapping("editBulletinHistoricalConfig")
+    public ApiResult<Void> editBulletinHistoricalConfig(@RequestBody BulletinHistoricalConfigAddVo bulletinHistoricalConfigAddVo) {
+        bulletinCruxConfigService.editBulletinHistoricalConfig(bulletinHistoricalConfigAddVo);
+        return ApiResult.success();
+    }
+
+    /**
+     * 数据看板-数据配置3编辑新增
+     *
+     * @param bulletinAlarmConfig
+     * @return
+     */
+    @PostMapping("editBulletinAlarmConfig")
+    public ApiResult<Void> editBulletinAlarmConfig(@RequestBody BulletinAlarmConfig bulletinAlarmConfig) {
+        bulletinCruxConfigService.editBulletinAlarmConfig(bulletinAlarmConfig);
+        return ApiResult.success();
+    }
+
+    /**
+     * 数据看板-数据配置1删除
+     *
+     * @param id 配置ID
+     * @return
+     */
+    @GetMapping("/delBulletinCruxConfig")
+    public ApiResult<Void> delBulletinCruxConfig(@RequestParam(value = "id") Integer id) {
+        bulletinCruxConfigService.delBulletinCruxConfig(id);
+        return ApiResult.success();
+    }
+
+
+    /**
+     * 数据看板-数据配置2删除
+     *
+     * @param id 配置ID
+     * @return
+     */
+    @GetMapping("/delBulletinHistoricalConfig")
+    public ApiResult<Void> delBulletinHistoricalConfig(@RequestParam(value = "id") Integer id) {
+        bulletinCruxConfigService.delBulletinHistoricalConfig(id);
+        return ApiResult.success();
+    }
+
+
+    /**
+     * 数据看板-数据配置3删除
+     *
+     * @param id 配置ID
+     * @return
+     */
+    @GetMapping("/delBulletinAlarmConfig")
+    public ApiResult<Void> delBulletinAlarmConfig(@RequestParam(value = "id") Integer id) {
+        bulletinCruxConfigService.delBulletinAlarmConfig(id);
+        return ApiResult.success();
+    }
+
+
+    /**
+     * 监控设备下拉框
+     *
+     * @param siteId 站点id
+     * @return
+     */
+    @GetMapping("/getDeviceAttribute")
+    public ApiResult<List<DeviceAttribute>> getDeviceAttribute(@RequestParam(value = "siteId") Integer siteId) {
+        return ApiResult.success(bulletinCruxConfigService.getDeviceAttribute(siteId));
+    }
+
+
+    /**
+     * 变量下拉框
+     *
+     * @param monitoringEquipment 监控设备ID
+     * @return
+     */
+    @GetMapping("/getDeviceAnalogVariableList")
+    public ApiResult<List<DeviceAnalogVariableList>> getDeviceAnalogVariableList(@RequestParam(value = "monitoringEquipment") Integer monitoringEquipment) {
+        return ApiResult.success(bulletinCruxConfigService.getDeviceAnalogVariableList(monitoringEquipment));
+    }
+
+}
+

+ 21 - 0
fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinHistoricalConfigController.java

@@ -0,0 +1,21 @@
+package com.bizmatics.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+@Controller
+@RequestMapping("/bulletinHistoricalConfig")
+public class BulletinHistoricalConfigController {
+
+}
+

+ 21 - 0
fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinHistoricalRelationController.java

@@ -0,0 +1,21 @@
+package com.bizmatics.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+@Controller
+@RequestMapping("/bulletinHistoricalRelation")
+public class BulletinHistoricalRelationController {
+
+}
+

+ 21 - 0
fiveep-controller/src/main/java/com/bizmatics/controller/web/BulletinStatusConfigController.java

@@ -0,0 +1,21 @@
+package com.bizmatics.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+@Controller
+@RequestMapping("/bulletinStatusConfig")
+public class BulletinStatusConfigController {
+
+}
+

+ 1 - 1
fiveep-controller/src/main/java/com/bizmatics/controller/web/MybatisGeneratorUtils.java

@@ -70,7 +70,7 @@ public class MybatisGeneratorUtils {
         // strategy.setTablePrefix("t_"); // 表名前缀
         strategy.setEntityLombokModel(true); //使用lombok
         //修改自己想要生成的表
-        strategy.setInclude(new String[]{"sys_oper_log"});  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+        strategy.setInclude(new String[]{"bulletin_alarm_config"});  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
         mpg.setStrategy(strategy);
 
         // 关闭默认 xml 生成,调整生成 至 根目录

+ 83 - 0
fiveep-model/src/main/java/com/bizmatics/model/BulletinAlarmConfig.java

@@ -0,0 +1,83 @@
+package com.bizmatics.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BulletinAlarmConfig implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 历史数据关联表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 列表标题
+     */
+    private String listTitle;
+
+    /**
+     * 图标路径
+     */
+    private String iconPath;
+
+    /**
+     * 告警类型
+     */
+    private String alarmType;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 站点id
+     */
+    private Integer siteId;
+
+    /**
+     * X轴坐标
+     */
+    private Integer coordinatex;
+
+    /**
+     * Y轴坐标
+     */
+    private Integer coordinatey;
+
+    /**
+     * 宽
+     */
+    private Integer wide;
+
+    /**
+     * 高
+     */
+    private Integer high;
+
+
+}

+ 47 - 0
fiveep-model/src/main/java/com/bizmatics/model/BulletinContentList.java

@@ -0,0 +1,47 @@
+package com.bizmatics.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BulletinContentList implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 内容清单ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 清单图片路径
+     */
+    private String picturePath;
+
+    /**
+     * 清单标题
+     */
+    private String listTitle;
+
+    /**
+     * 清单内容
+     */
+    private String listContent;
+
+
+}

+ 131 - 0
fiveep-model/src/main/java/com/bizmatics/model/BulletinCruxConfig.java

@@ -0,0 +1,131 @@
+package com.bizmatics.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BulletinCruxConfig implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 关键数据配置表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 数据名称
+     */
+    private String dataName;
+
+    /**
+     * 数据类型
+     */
+    private Integer dataType;
+
+    /**
+     * 数据取值
+     */
+    private Integer dataValue;
+
+    /**
+     * 背景颜色
+     */
+    private String backgroundColor;
+
+    /**
+     * 数据名称颜色
+     */
+    private String dataNameColor;
+
+    /**
+     * 数据值颜色
+     */
+    private String dataValueColor;
+
+    /**
+     * 数据名称字体大小
+     */
+    private String dataNameFont;
+
+    /**
+     * 数据值字体大小
+     */
+    private String dataValueFont;
+
+    /**
+     * 图标路径
+     */
+    private String iconPath;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 站点id
+     */
+    private Integer siteId;
+
+    /**
+     * 变量ID
+     */
+    private Integer variableId;
+
+    /**
+     * 计算周期:1本日 2本月 3本年 4实时值
+     */
+    private Integer cycle;
+
+    /**
+     * 计算方法:1平均 2最大 3最小
+     */
+    private Integer method;
+
+    /**
+     * 保留小数
+     */
+    private Integer digit;
+
+    /**
+     * X轴坐标
+     */
+    private Integer coordinatex;
+
+    /**
+     * Y轴坐标
+     */
+    private Integer coordinatey;
+
+    /**
+     * 宽
+     */
+    private Integer wide;
+
+    /**
+     * 高
+     */
+    private Integer high;
+}

+ 108 - 0
fiveep-model/src/main/java/com/bizmatics/model/BulletinHistoricalConfig.java

@@ -0,0 +1,108 @@
+package com.bizmatics.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BulletinHistoricalConfig implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 关键数据配置表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 数据标题
+     */
+    private String dataTitle;
+
+    /**
+     * 图标路径
+     */
+    private String iconPath;
+
+    /**
+     * 查询周期
+     */
+    private Integer queryCycle;
+
+    /**
+     * 查询类型
+     */
+    private Integer queryType;
+
+    /**
+     * 最大值是否标注
+     */
+    private Integer maxDimension;
+
+    /**
+     * 最小值是否标注
+     */
+    private Integer minDimension;
+
+    /**
+     * 平均值是否标注
+     */
+    private Integer meanDimension;
+
+    /**
+     * 纵轴自适应
+     */
+    private Integer lonAdaptation;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 站点id
+     */
+    private Integer siteId;
+
+    /**
+     * X轴坐标
+     */
+    private Integer coordinatex;
+
+    /**
+     * Y轴坐标
+     */
+    private Integer coordinatey;
+
+    /**
+     * 宽
+     */
+    private Integer wide;
+
+    /**
+     * 高
+     */
+    private Integer high;
+
+
+}

+ 62 - 0
fiveep-model/src/main/java/com/bizmatics/model/BulletinHistoricalRelation.java

@@ -0,0 +1,62 @@
+package com.bizmatics.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BulletinHistoricalRelation implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 历史数据关联表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 历史数据模块id
+     */
+    private Integer historicalId;
+
+    /**
+     * 监控设备id
+     */
+    private Integer deviceId;
+
+    /**
+     * 变量id
+     */
+    private Integer variableId;
+
+    /**
+     * 统计图颜色
+     */
+    private String graphicColor;
+
+    /**
+     * 1折线图 2柱形图
+     */
+    private Integer graphicType;
+
+    /**
+     * 显示名称
+     */
+    private String displayName;
+
+
+}

+ 53 - 0
fiveep-model/src/main/java/com/bizmatics/model/BulletinStatusConfig.java

@@ -0,0 +1,53 @@
+package com.bizmatics.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BulletinStatusConfig implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 关键数据配置表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 数据标题
+     */
+    private String dataTitle;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 站点id
+     */
+    private Integer siteId;
+
+
+}

+ 112 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/AlarmPowerVo.java

@@ -0,0 +1,112 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 电力告警
+ * </p>
+ *
+ * @author ya
+ * @since 2021-07-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class AlarmPowerVo implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 电力告警表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 阿里云平台设备名称
+     */
+    private String deviceCode;
+
+    /**
+     * 告警名称
+     */
+    private String alarmName;
+
+    /**
+     * 发送时间
+     */
+    private Date sendingTime;
+
+    /**
+     * 告警类型(alert 告警)
+     */
+    private String alarmType;
+
+    /**
+     * 测点名称
+     */
+    private String measName;
+
+    /**
+     * 遥信值(0  正常  1 告警)
+     */
+    private Integer digitalValue;
+
+    /**
+     * 测点描述
+     */
+    private String measDesc;
+
+    /**
+     * 发生时间
+     */
+    private Date soeTime;
+
+    /**
+     * 处理人
+     */
+    private String handler;
+
+    /**
+     * 处理时间
+     */
+    private Date handlingTime;
+
+    /**
+     * 处理内容
+     */
+    private String handlingContent;
+
+    /**
+     * 联系电话
+     */
+    private String handlerPhone;
+
+    /**
+     * 处理状态(0 未处理,1 已处理)
+     */
+    private Integer handlingStatus;
+    /**
+     * 图片
+      */
+    private String image;
+
+    @TableField(exist = false)
+    private Integer siteId;
+
+    /**
+     * 设备名称
+     */
+    private String deviceName;
+
+
+}

+ 186 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/BulletinCruxConfigVo.java

@@ -0,0 +1,186 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BulletinCruxConfigVo implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 关键数据配置表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 数据名称
+     */
+    private String dataName;
+
+    /**
+     * 数据类型
+     */
+    private Integer dataType;
+
+    /**
+     * 数据取值
+     */
+    private Integer dataValue;
+
+    /**
+     * 背景颜色
+     */
+    private String backgroundColor;
+
+    /**
+     * 数据名称颜色
+     */
+    private String dataNameColor;
+
+    /**
+     * 数据值颜色
+     */
+    private String dataValueColor;
+
+    /**
+     * 数据名称字体大小
+     */
+    private String dataNameFont;
+
+    /**
+     * 数据值字体大小
+     */
+    private String dataValueFont;
+
+    /**
+     * 图标路径
+     */
+    private String iconPath;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 站点id
+     */
+    private Integer siteId;
+
+    /**
+     * 变量ID
+     */
+    private Integer variableId;
+
+    /**
+     * 计算周期:1本日 2本月 3本年 4实时值
+     */
+    private Integer cycle;
+
+    /**
+     * 计算方法:1平均 2最大 3最小
+     */
+    private Integer method;
+
+    /**
+     * 保留小数
+     */
+    private Integer digit;
+
+
+    private Object textValue;
+
+    private String idx;
+
+    /**
+     * X轴坐标
+     */
+    private Integer coordinatex;
+
+    /**
+     * Y轴坐标
+     */
+    private Integer coordinatey;
+
+    /**
+     * 宽
+     */
+    private Integer wide;
+
+    /**
+     * 高
+     */
+    private Integer high;
+
+
+    /**
+     * 历史数据模块id
+     */
+    private Integer historicalId;
+
+    /**
+     * 监控设备id
+     */
+    private Integer deviceId;
+
+    /**
+     * 统计图颜色
+     */
+    private String graphicColor;
+
+    /**
+     * 1折线图 2柱形图
+     */
+    private Integer graphicType;
+
+    /**
+     * 显示名称
+     */
+    private String displayName;
+
+    /**
+     * 变量配置
+     */
+    private Object relationData;
+
+    /**
+     * 模板类型
+     */
+    private String colorType;
+
+
+    /**
+     * 列表标题
+     */
+    private String listTitle;
+
+
+    /**
+     * 告警类型
+     */
+    private String alarmType;
+
+}

+ 114 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/BulletinHistoricalConfigAddVo.java

@@ -0,0 +1,114 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.bizmatics.model.BulletinHistoricalRelation;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BulletinHistoricalConfigAddVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 关键数据配置表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 数据标题
+     */
+    private String dataTitle;
+
+    /**
+     * 图标路径
+     */
+    private String iconPath;
+
+    /**
+     * 查询周期
+     */
+    private Integer queryCycle;
+
+    /**
+     * 查询类型
+     */
+    private Integer queryType;
+
+    /**
+     * 最大值是否标注
+     */
+    private Integer maxDimension;
+
+    /**
+     * 最小值是否标注
+     */
+    private Integer minDimension;
+
+    /**
+     * 平均值是否标注
+     */
+    private Integer meanDimension;
+
+    /**
+     * 纵轴自适应
+     */
+    private Integer lonAdaptation;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 站点id
+     */
+    private Integer siteId;
+
+    /**
+     * X轴坐标
+     */
+    private Integer coordinatex;
+
+    /**
+     * Y轴坐标
+     */
+    private Integer coordinatey;
+
+    /**
+     * 宽
+     */
+    private Integer wide;
+
+    /**
+     * 高
+     */
+    private Integer high;
+
+
+    private List<BulletinHistoricalRelation> bulletinHistoricalRelationList;
+
+
+}

+ 83 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/BulletinHistoricalRelationVo.java

@@ -0,0 +1,83 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BulletinHistoricalRelationVo implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 历史数据关联表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 历史数据模块id
+     */
+    private Integer historicalId;
+
+    /**
+     * 监控设备id
+     */
+    private Integer deviceId;
+
+    /**
+     * 变量id
+     */
+    private Integer variableId;
+
+    /**
+     * 统计图颜色
+     */
+    private String graphicColor;
+
+    /**
+     * 1折线图 2柱形图
+     */
+    private Integer graphicType;
+
+    /**
+     * 显示名称
+     */
+    private String displayName;
+
+
+    /**
+     * 数据
+     */
+    private Object datas;
+
+    /**
+     * 时间
+     */
+    private Object timeKeys;
+
+    /**
+     * 查询周期
+     */
+    private Integer queryCycle;
+
+    /**
+     * 查询类型 1平均 2最大
+     */
+    private Integer queryType;
+
+}

+ 88 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/DeviceDataVo.java

@@ -0,0 +1,88 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2021-07-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class DeviceDataVo implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 设备信息表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 设备编号
+     */
+    private String deviceCode;
+
+    /**
+     * 设备名称
+     */
+    private String deviceName;
+
+    /**
+     * 楼层
+     */
+    private String floor;
+    /**
+     * 所属站点
+     */
+    private Integer siteId;
+
+    /**
+     * 设备安装位置
+     */
+    private String deviceAddress;
+
+    /**
+     * 1:183用电设备,2:视频监控设备,3:171用电设备,4:173用电设备,5:158智能网关,6:其他
+     */
+    private String deviceType;
+
+    /**
+     * 安装时间
+     */
+    private Date installTime;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+    /**
+     * 使能标识(0 不生效,1生效)
+     */
+    private Integer enable;
+
+    /**
+     * sim卡号
+     */
+    private String sim;
+
+    /**
+     * 变量编号
+     */
+    private String variableCoding;
+
+}

+ 9 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/RtData.java

@@ -23,6 +23,15 @@ import java.util.Date;
 @Accessors(chain = true)
 public class RtData implements Serializable {
 
+    /**
+     * 值
+     */
     private String textValue;
 
+    /**
+     * 上报时间
+     */
+    @TableField("dataTime")
+    private Date dataTime;
+
 }

+ 16 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinAlarmConfigMapper.java

@@ -0,0 +1,16 @@
+package com.bizmatics.persistence.mapper;
+
+import com.bizmatics.model.BulletinAlarmConfig;
+import com.bizmatics.common.mvc.base.CrudMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-07
+ */
+public interface BulletinAlarmConfigMapper extends CrudMapper<BulletinAlarmConfig> {
+
+}

+ 16 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinContentListMapper.java

@@ -0,0 +1,16 @@
+package com.bizmatics.persistence.mapper;
+
+import com.bizmatics.model.BulletinContentList;
+import com.bizmatics.common.mvc.base.CrudMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+public interface BulletinContentListMapper extends CrudMapper<BulletinContentList> {
+
+}

+ 44 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinCruxConfigMapper.java

@@ -0,0 +1,44 @@
+package com.bizmatics.persistence.mapper;
+
+import com.bizmatics.common.mvc.base.CrudMapper;
+import com.bizmatics.model.BulletinCruxConfig;
+import com.bizmatics.model.vo.*;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+public interface BulletinCruxConfigMapper extends CrudMapper<BulletinCruxConfig> {
+    int delBulletinCruxConfig(Integer id);
+
+    int delBulletinHistoricalConfig(Integer id);
+
+    int delBulletinAlarmConfig(Integer id);
+
+    int delBulletinHistoricalRelation(Integer historicalId);
+
+    List<SiteData> getSiteData(Integer siteId);
+
+    List<RtData> getTextData(String table, String fieldData, String deviceCode, String startTime, String endTime);
+
+    Integer getAlarmCount(@Param("siteId") Integer siteId);
+
+    List<BulletinHistoricalRelationVo> getRelationData(Integer siteId);
+
+    List<BulletinCruxConfigVo> getBulletinHistoricalConfig(Integer siteId, Integer id);
+
+    List<DeviceDataVo> getDeviceData(Integer id);
+
+    List<RtData> getHtAnalogData(String table, String fieldData, String deviceCode, String startTime, String endTime, String group);
+
+    List<BulletinCruxConfigVo> getBulletinAlarmConfig(Integer siteId, Integer id);
+
+    List<AlarmPowerVo> getAlarmPower(Integer siteId, String measName);
+}

+ 16 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinHistoricalConfigMapper.java

@@ -0,0 +1,16 @@
+package com.bizmatics.persistence.mapper;
+
+import com.bizmatics.model.BulletinHistoricalConfig;
+import com.bizmatics.common.mvc.base.CrudMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+public interface BulletinHistoricalConfigMapper extends CrudMapper<BulletinHistoricalConfig> {
+
+}

+ 16 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinHistoricalRelationMapper.java

@@ -0,0 +1,16 @@
+package com.bizmatics.persistence.mapper;
+
+import com.bizmatics.model.BulletinHistoricalRelation;
+import com.bizmatics.common.mvc.base.CrudMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+public interface BulletinHistoricalRelationMapper extends CrudMapper<BulletinHistoricalRelation> {
+
+}

+ 16 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/BulletinStatusConfigMapper.java

@@ -0,0 +1,16 @@
+package com.bizmatics.persistence.mapper;
+
+import com.bizmatics.model.BulletinStatusConfig;
+import com.bizmatics.common.mvc.base.CrudMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+public interface BulletinStatusConfigMapper extends CrudMapper<BulletinStatusConfig> {
+
+}

+ 20 - 0
fiveep-persistence/src/main/resources/mapper/mysql/BulletinAlarmConfigMapper.xml

@@ -0,0 +1,20 @@
+<?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="com.bizmatics.persistence.mapper.BulletinAlarmConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.bizmatics.model.BulletinAlarmConfig">
+        <id column="id" property="id" />
+        <result column="list_title" property="listTitle" />
+        <result column="icon_path" property="iconPath" />
+        <result column="alarm_type" property="alarmType" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="site_id" property="siteId" />
+        <result column="coordinatex" property="coordinatex" />
+        <result column="coordinatey" property="coordinatey" />
+        <result column="wide" property="wide" />
+        <result column="high" property="high" />
+    </resultMap>
+
+</mapper>

+ 13 - 0
fiveep-persistence/src/main/resources/mapper/mysql/BulletinContentListMapper.xml

@@ -0,0 +1,13 @@
+<?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="com.bizmatics.persistence.mapper.BulletinContentListMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.bizmatics.model.BulletinContentList">
+        <id column="id" property="id" />
+        <result column="picture_path" property="picturePath" />
+        <result column="list_title" property="listTitle" />
+        <result column="list_content" property="listContent" />
+    </resultMap>
+
+</mapper>

+ 153 - 0
fiveep-persistence/src/main/resources/mapper/mysql/BulletinCruxConfigMapper.xml

@@ -0,0 +1,153 @@
+<?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="com.bizmatics.persistence.mapper.BulletinCruxConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.bizmatics.model.BulletinCruxConfig">
+        <id column="id" property="id" />
+        <result column="data_name" property="dataName" />
+        <result column="data_type" property="dataType" />
+        <result column="data_value" property="dataValue" />
+        <result column="background_color" property="backgroundColor" />
+        <result column="data_name_color" property="dataNameColor" />
+        <result column="data_value_color" property="dataValueColor" />
+        <result column="data_name_font" property="dataNameFont" />
+        <result column="data_value_font" property="dataValueFont" />
+        <result column="icon_path" property="iconPath" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="site_id" property="siteId" />
+        <result column="variable_id" property="variableId" />
+        <result column="cycle" property="cycle" />
+        <result column="method" property="method" />
+        <result column="digit" property="digit" />
+        <result column="coordinatex" property="coordinatex" />
+        <result column="coordinatey" property="coordinatey" />
+        <result column="wide" property="wide" />
+        <result column="high" property="high" />
+    </resultMap>
+
+    <delete id="delBulletinCruxConfig" parameterType="Long">
+        delete from bulletin_crux_config where id=#{id}
+    </delete>
+
+    <delete id="delBulletinHistoricalConfig" parameterType="Long">
+        delete from bulletin_historical_config where id=#{id}
+    </delete>
+
+    <delete id="delBulletinAlarmConfig" parameterType="Long">
+        delete from bulletin_alarm_config where id=#{id}
+    </delete>
+
+    <delete id="delBulletinHistoricalRelation" parameterType="Integer">
+        delete from bulletin_historical_relation where historical_id=#{historicalId}
+    </delete>
+
+    <select id="getSiteData" resultType="com.bizmatics.model.vo.SiteData">
+        select s.id,s.site_name,s.site_address,s.phone,s.spare_phone,s.installed_capacity,sdp.power_supply_type,sdp.voltage_level,sdp.operation_time,s.create_time
+        from site as s
+        left join site_dynamic_properties as sdp
+        on s.id = sdp.site_id
+        <where>
+            and s.id=#{siteId}
+        </where>
+    </select>
+
+    <select id="getTextData" resultType="com.bizmatics.model.vo.RtData">
+        select ${fieldData}
+        from ${table}
+        <where>
+            and deviceName=#{deviceCode}
+            <if test="endTime != null and startTime != null and endTime != '' and startTime != ''">
+                and dataTime BETWEEN #{startTime} and #{endTime}
+            </if>
+        </where>
+    </select>
+
+
+    <select id="getAlarmCount" resultType="java.lang.Integer">
+        SELECT
+        count(1)
+        FROM
+        device AS a
+        JOIN alarm_power AS b ON a.device_code = b.device_code
+        <where>
+            a. ENABLE = 1
+            AND a.site_id = #{siteId}
+        </where>
+    </select>
+
+    <select id="getRelationData" resultType="com.bizmatics.model.vo.BulletinHistoricalRelationVo">
+        SELECT
+        a.query_type,a.query_cycle,b.*
+        FROM
+        bulletin_historical_config AS a
+        JOIN bulletin_historical_relation AS b ON a.id = b.historical_id
+        <where>
+            a.site_id = #{siteId}
+        </where>
+    </select>
+
+    <select id="getBulletinHistoricalConfig" resultType="com.bizmatics.model.vo.BulletinCruxConfigVo">
+        SELECT
+        *
+        FROM
+        bulletin_historical_config
+        <where>
+            site_id = #{siteId}
+            <if test="id != null and id != 0">
+                and id = #{id}
+            </if>
+        </where>
+    </select>
+
+    <select id="getDeviceData" resultType="com.bizmatics.model.vo.DeviceDataVo">
+        SELECT
+        a.*, b.variable_coding
+        FROM
+        device AS a
+        JOIN device_analog_variable_list AS b ON a.id = b.communication_equipment
+        <where>
+            b.id = #{id}
+        </where>
+    </select>
+
+    <select id="getHtAnalogData" resultType="com.bizmatics.model.vo.RtData">
+        select ${fieldData}
+        from ${table}
+        <where>
+            and deviceName=#{deviceCode}
+            <if test="endTime != null and startTime != null and endTime != '' and startTime != ''">
+                and dataTime BETWEEN #{startTime} and #{endTime}
+            </if>
+        </where>
+        ${group}
+    </select>
+
+
+    <select id="getBulletinAlarmConfig" resultType="com.bizmatics.model.vo.BulletinCruxConfigVo">
+        SELECT
+        *
+        FROM
+        bulletin_alarm_config
+        <where>
+            site_id = #{siteId}
+            <if test="id != null and id != 0">
+                and id = #{id}
+            </if>
+        </where>
+    </select>
+
+    <select id="getAlarmPower" resultType="com.bizmatics.model.vo.AlarmPowerVo">
+        SELECT
+        b.device_name,
+        a.*
+        FROM
+        alarm_power AS a
+        JOIN device AS b ON a.device_code = b.device_code
+        <where>
+            b.site_id = #{siteId}
+            AND a.meas_name = #{measName}
+        </where>
+    </select>
+</mapper>

+ 25 - 0
fiveep-persistence/src/main/resources/mapper/mysql/BulletinHistoricalConfigMapper.xml

@@ -0,0 +1,25 @@
+<?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="com.bizmatics.persistence.mapper.BulletinHistoricalConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.bizmatics.model.BulletinHistoricalConfig">
+        <id column="id" property="id" />
+        <result column="data_title" property="dataTitle" />
+        <result column="icon_path" property="iconPath" />
+        <result column="query_cycle" property="queryCycle" />
+        <result column="query_type" property="queryType" />
+        <result column="max_dimension" property="maxDimension" />
+        <result column="min_dimension" property="minDimension" />
+        <result column="mean_dimension" property="meanDimension" />
+        <result column="lon_adaptation" property="lonAdaptation" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="site_id" property="siteId" />
+        <result column="coordinatex" property="coordinatex" />
+        <result column="coordinatey" property="coordinatey" />
+        <result column="wide" property="wide" />
+        <result column="high" property="high" />
+    </resultMap>
+
+</mapper>

+ 16 - 0
fiveep-persistence/src/main/resources/mapper/mysql/BulletinHistoricalRelationMapper.xml

@@ -0,0 +1,16 @@
+<?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="com.bizmatics.persistence.mapper.BulletinHistoricalRelationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.bizmatics.model.BulletinHistoricalRelation">
+        <id column="id" property="id" />
+        <result column="historical_id" property="historicalId" />
+        <result column="device_id" property="deviceId" />
+        <result column="variable_id" property="variableId" />
+        <result column="graphic_color" property="graphicColor" />
+        <result column="graphic_type" property="graphicType" />
+        <result column="display_name" property="displayName" />
+    </resultMap>
+
+</mapper>

+ 14 - 0
fiveep-persistence/src/main/resources/mapper/mysql/BulletinStatusConfigMapper.xml

@@ -0,0 +1,14 @@
+<?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="com.bizmatics.persistence.mapper.BulletinStatusConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.bizmatics.model.BulletinStatusConfig">
+        <id column="id" property="id" />
+        <result column="data_title" property="dataTitle" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="site_id" property="siteId" />
+    </resultMap>
+
+</mapper>

+ 16 - 0
fiveep-service/src/main/java/com/bizmatics/service/BulletinAlarmConfigService.java

@@ -0,0 +1,16 @@
+package com.bizmatics.service;
+
+import com.bizmatics.model.BulletinAlarmConfig;
+import com.bizmatics.common.mvc.base.CrudService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-07
+ */
+public interface BulletinAlarmConfigService extends CrudService<BulletinAlarmConfig> {
+
+}

+ 20 - 0
fiveep-service/src/main/java/com/bizmatics/service/BulletinContentListService.java

@@ -0,0 +1,20 @@
+package com.bizmatics.service;
+
+import com.bizmatics.common.mvc.base.CrudService;
+import com.bizmatics.model.BulletinContentList;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+public interface BulletinContentListService extends CrudService<BulletinContentList> {
+
+    List<BulletinContentList> getBulletinContentList();
+
+}

+ 49 - 0
fiveep-service/src/main/java/com/bizmatics/service/BulletinCruxConfigService.java

@@ -0,0 +1,49 @@
+package com.bizmatics.service;
+
+import com.bizmatics.model.BulletinAlarmConfig;
+import com.bizmatics.model.BulletinCruxConfig;
+import com.bizmatics.common.mvc.base.CrudService;
+import com.bizmatics.model.DeviceAnalogVariableList;
+import com.bizmatics.model.DeviceAttribute;
+import com.bizmatics.model.vo.BulletinCruxConfigVo;
+import com.bizmatics.model.vo.BulletinHistoricalConfigAddVo;
+import com.bizmatics.model.vo.BulletinHistoricalRelationVo;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+public interface BulletinCruxConfigService extends CrudService<BulletinCruxConfig> {
+
+    List<Object> getBulletinCruxConfigList(Integer siteId, Integer id, String colorType);
+
+    void editBulletinCruxConfig(BulletinCruxConfig bulletinCruxConfig);
+
+    void editBulletinHistoricalConfig(BulletinHistoricalConfigAddVo bulletinHistoricalConfigAddVo);
+
+    void editBulletinAlarmConfig(BulletinAlarmConfig bulletinAlarmConfig);
+
+    void delBulletinCruxConfig(Integer id);
+
+    void delBulletinHistoricalConfig(Integer id);
+
+    void delBulletinAlarmConfig(Integer id);
+
+    List<DeviceAttribute> getDeviceAttribute(Integer siteId);
+
+    List<DeviceAnalogVariableList> getDeviceAnalogVariableList(Integer monitoringEquipment);
+
+    List<BulletinCruxConfigVo> getBulletinHistoricalConfig(Integer siteId,Integer id);
+
+    List<BulletinHistoricalRelationVo> getBulletinHistoricalRelationVo(Integer siteId);
+
+    List<BulletinCruxConfigVo> getBulletinAlarmConfig(Integer siteId, Integer id);
+
+    List<BulletinCruxConfigVo> getbulletinCruxConfig(Integer siteId, Integer id);
+}

+ 16 - 0
fiveep-service/src/main/java/com/bizmatics/service/BulletinHistoricalConfigService.java

@@ -0,0 +1,16 @@
+package com.bizmatics.service;
+
+import com.bizmatics.model.BulletinHistoricalConfig;
+import com.bizmatics.common.mvc.base.CrudService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+public interface BulletinHistoricalConfigService extends CrudService<BulletinHistoricalConfig> {
+
+}

+ 16 - 0
fiveep-service/src/main/java/com/bizmatics/service/BulletinHistoricalRelationService.java

@@ -0,0 +1,16 @@
+package com.bizmatics.service;
+
+import com.bizmatics.model.BulletinHistoricalRelation;
+import com.bizmatics.common.mvc.base.CrudService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+public interface BulletinHistoricalRelationService extends CrudService<BulletinHistoricalRelation> {
+
+}

+ 16 - 0
fiveep-service/src/main/java/com/bizmatics/service/BulletinStatusConfigService.java

@@ -0,0 +1,16 @@
+package com.bizmatics.service;
+
+import com.bizmatics.model.BulletinStatusConfig;
+import com.bizmatics.common.mvc.base.CrudService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+public interface BulletinStatusConfigService extends CrudService<BulletinStatusConfig> {
+
+}

+ 20 - 0
fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinAlarmConfigServiceImpl.java

@@ -0,0 +1,20 @@
+package com.bizmatics.service.impl;
+
+import com.bizmatics.model.BulletinAlarmConfig;
+import com.bizmatics.persistence.mapper.BulletinAlarmConfigMapper;
+import com.bizmatics.service.BulletinAlarmConfigService;
+import com.bizmatics.common.mvc.base.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-07
+ */
+@Service
+public class BulletinAlarmConfigServiceImpl extends AbstractCrudService<BulletinAlarmConfigMapper, BulletinAlarmConfig> implements BulletinAlarmConfigService {
+
+}

+ 36 - 0
fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinContentListServiceImpl.java

@@ -0,0 +1,36 @@
+package com.bizmatics.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.bizmatics.model.BulletinContentList;
+import com.bizmatics.model.DeviceAnalogVariableList;
+import com.bizmatics.model.DeviceAttribute;
+import com.bizmatics.model.vo.DeviceOneVo;
+import com.bizmatics.persistence.mapper.BulletinContentListMapper;
+import com.bizmatics.service.BulletinContentListService;
+import com.bizmatics.common.mvc.base.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+@Service
+public class BulletinContentListServiceImpl extends AbstractCrudService<BulletinContentListMapper, BulletinContentList> implements BulletinContentListService {
+    /**
+     * 内容清单列表查询
+     * @return
+     */
+    public List<BulletinContentList> getBulletinContentList() {
+        LambdaQueryWrapper<BulletinContentList> queryWrapper = Wrappers.lambdaQuery();
+        List<BulletinContentList> bulletinContentList = this.list(queryWrapper);
+        return bulletinContentList;
+    }
+}

+ 523 - 0
fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinCruxConfigServiceImpl.java

@@ -0,0 +1,523 @@
+package com.bizmatics.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.bizmatics.common.core.exception.BusinessException;
+import com.bizmatics.common.mvc.base.AbstractCrudService;
+import com.bizmatics.model.*;
+import com.bizmatics.model.system.SysUser;
+import com.bizmatics.model.vo.*;
+import com.bizmatics.persistence.mapper.BulletinCruxConfigMapper;
+import com.bizmatics.service.*;
+import com.bizmatics.service.util.SecurityUtils;
+import org.apache.commons.collections.ExtendedProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.util.*;
+
+/**
+ * 数据看板
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+@Service
+public class BulletinCruxConfigServiceImpl extends AbstractCrudService<BulletinCruxConfigMapper, BulletinCruxConfig> implements BulletinCruxConfigService {
+
+    @Autowired
+    private DeviceAnalogVariableListService deviceAnalogVariableListService;
+    @Autowired
+    private DeviceService deviceService;
+    @Autowired
+    private DeviceStatusService deviceStatusService;
+    @Autowired
+    private BulletinHistoricalConfigService bulletinHistoricalConfigService;
+    @Autowired
+    private BulletinHistoricalRelationService bulletinHistoricalRelationService;
+    @Autowired
+    private BulletinAlarmConfigService bulletinAlarmConfigService;
+    @Autowired
+    private DeviceAttributeService deviceAttributeService;
+
+    /**
+     * 数据看板-数据配置查询
+     *
+     * @param siteId 站点ID
+     * @param id     配置ID
+     * @return
+     */
+    @Override
+    public List<Object> getBulletinCruxConfigList(Integer siteId, Integer id, String colorType) {
+        List<Object> list2 = new ArrayList<>();
+        if (id != 0 && colorType.equals("iconText")) {
+            //配置数据查询1
+            List<BulletinCruxConfigVo> lsit1 = this.getbulletinCruxConfig(siteId, id);
+            if (lsit1.size() > 0) {
+                for (int i = 0; i < lsit1.size(); i++) {
+                    lsit1.get(i).setIdx("" + (list2.size() + 1));
+                    list2.add(lsit1.get(i));
+                }
+            }
+        } else if (id != 0 && colorType.equals("echarts")) {
+            //配置数据查询2
+            List<BulletinCruxConfigVo> lsit3 = this.getBulletinHistoricalConfig(siteId,id);
+            if (lsit3.size() > 0) {
+                for (int i = 0; i < lsit3.size(); i++) {
+                    lsit3.get(i).setColorType("echarts");
+                    lsit3.get(i).setIdx("" + (list2.size() + 1));
+                    list2.add(lsit3.get(i));
+                }
+            }
+        } else if (id != 0 && colorType.equals("tabls")) {
+            //配置数据查询3
+            List<BulletinCruxConfigVo> lsit4 = this.getBulletinAlarmConfig(siteId,id);
+            if (lsit4.size() > 0) {
+                for (int i = 0; i < lsit4.size(); i++) {
+                    lsit4.get(i).setIdx("" + (list2.size() + 1));
+                    list2.add(lsit4.get(i));
+                }
+            }
+        } else {
+            id = 0;
+            //配置数据查询1
+            List<BulletinCruxConfigVo> lsit1 = this.getbulletinCruxConfig(siteId, id);
+            if (lsit1.size() > 0) {
+                for (int i = 0; i < lsit1.size(); i++) {
+                    lsit1.get(i).setIdx("" + (list2.size() + 1));
+                    list2.add(lsit1.get(i));
+                }
+            }
+
+            //配置数据查询2
+            List<BulletinCruxConfigVo> lsit3 = this.getBulletinHistoricalConfig(siteId,id);
+            if (lsit3.size() > 0) {
+                for (int i = 0; i < lsit3.size(); i++) {
+                    lsit3.get(i).setColorType("echarts");
+                    lsit3.get(i).setIdx("" + (list2.size() + 1));
+                    list2.add(lsit3.get(i));
+                }
+            }
+
+            //配置数据查询3
+            List<BulletinCruxConfigVo> lsit4 = this.getBulletinAlarmConfig(siteId,id);
+            if (lsit4.size() > 0) {
+                for (int i = 0; i < lsit4.size(); i++) {
+                    lsit4.get(i).setIdx("" + (list2.size() + 1));
+                    list2.add(lsit4.get(i));
+                }
+            }
+        }
+        return list2;
+    }
+
+
+    /**
+     * 配置数据查询1
+     *
+     * @param siteId
+     * @param id
+     * @return
+     */
+    @Override
+    public List<BulletinCruxConfigVo> getbulletinCruxConfig(Integer siteId, Integer id) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        SimpleDateFormat sdfa = new SimpleDateFormat("yyyy");
+        //配置数据查询1
+        LambdaQueryWrapper<BulletinCruxConfig> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(BulletinCruxConfig::getSiteId, siteId);
+        if (id != 0) {
+            queryWrapper.eq(BulletinCruxConfig::getId, id);
+        }
+        List<BulletinCruxConfig> list = this.list(queryWrapper);
+        List<BulletinCruxConfigVo> list1 = new ArrayList<>();
+        if (list.size() > 0) {
+            for (int i = 0; i < list.size(); i++) {
+                BulletinCruxConfigVo bulletinCruxConfigVo = new BulletinCruxConfigVo();
+                bulletinCruxConfigVo.setId(list.get(i).getId());
+                bulletinCruxConfigVo.setDataName(list.get(i).getDataName());
+                bulletinCruxConfigVo.setDataType(list.get(i).getDataType());
+                bulletinCruxConfigVo.setDataValue(list.get(i).getDataValue());
+                bulletinCruxConfigVo.setBackgroundColor(list.get(i).getBackgroundColor());
+                bulletinCruxConfigVo.setDataNameColor(list.get(i).getDataNameColor());
+                bulletinCruxConfigVo.setDataValueColor(list.get(i).getDataValueColor());
+                bulletinCruxConfigVo.setDataNameFont(list.get(i).getDataNameFont());
+                bulletinCruxConfigVo.setDataValueFont(list.get(i).getDataValueFont());
+                bulletinCruxConfigVo.setIconPath(list.get(i).getIconPath());
+                bulletinCruxConfigVo.setCreateBy(list.get(i).getCreateBy());
+                bulletinCruxConfigVo.setCreateTime(list.get(i).getCreateTime());
+                bulletinCruxConfigVo.setSiteId(list.get(i).getSiteId());
+                bulletinCruxConfigVo.setCoordinatex(list.get(i).getCoordinatex());
+                bulletinCruxConfigVo.setCoordinatey(list.get(i).getCoordinatey());
+                bulletinCruxConfigVo.setWide(list.get(i).getWide());
+                bulletinCruxConfigVo.setHigh(list.get(i).getHigh());
+//                bulletinCruxConfigVo.setIdx(""+(list2.size()+1));
+                bulletinCruxConfigVo.setColorType("iconText");
+                if (list.get(i).getDataType() == 1) {//普通文本
+
+                } else if (list.get(i).getDataType() == 2) {//站点管理信息
+                    List<SiteData> site = baseMapper.getSiteData(list.get(i).getSiteId());
+                    //1名称 2地址 3联系电话 4额定容量 5供电类型 6电压等级 7投运时间 8运行天数
+                    if (list.get(i).getDataValue() == 1) {
+                        bulletinCruxConfigVo.setTextValue(site.get(0).getSiteName());
+                    } else if (list.get(i).getDataValue() == 2) {
+                        bulletinCruxConfigVo.setTextValue(site.get(0).getSiteAddress());
+                    } else if (list.get(i).getDataValue() == 3) {
+                        bulletinCruxConfigVo.setTextValue(site.get(0).getPhone());
+                    } else if (list.get(i).getDataValue() == 4) {
+                        bulletinCruxConfigVo.setTextValue(site.get(0).getInstalledCapacity());
+                    } else if (list.get(i).getDataValue() == 5) {
+                        if (site.get(0).getPowerSupplyType() == 1) {
+                            bulletinCruxConfigVo.setTextValue("单路");
+                        } else if (site.get(0).getPowerSupplyType() == 2) {
+                            bulletinCruxConfigVo.setTextValue("双路");
+                        }
+                    } else if (list.get(i).getDataValue() == 6) {
+                        bulletinCruxConfigVo.setTextValue(site.get(0).getVoltageLevel());
+                    } else if (list.get(i).getDataValue() == 7) {
+                        bulletinCruxConfigVo.setTextValue("" + site.get(0).getOperationTime());
+                    } else if (list.get(i).getDataValue() == 8) {
+                        int time = daysBetween(site.get(0).getCreateTime(), new Date());
+                        bulletinCruxConfigVo.setTextValue("" + time);
+                    }
+                } else if (list.get(i).getDataType() == 3) {//智能设备数据
+                    LambdaQueryWrapper<DeviceAnalogVariableList> queryWrapper1 = Wrappers.lambdaQuery();
+                    queryWrapper1.eq(DeviceAnalogVariableList::getId, list.get(i).getVariableId());
+                    List<DeviceAnalogVariableList> deviceAttributelist = deviceAnalogVariableListService.list(queryWrapper1);
+                    String[] deviceAttribute = deviceAttributelist.get(0).getVariableCoding().split("_");
+                    String deviceCode = deviceAttribute[0];
+                    String field = deviceAttribute[1];
+                    String fieldData = null;
+                    if (list.get(i).getMethod() == 1) {//平均
+                        fieldData = " avg(" + field + ") as textValue ";
+                    } else if (list.get(i).getMethod() == 2) {//最大
+                        fieldData = " max(" + field + ") as textValue ";
+                    } else if (list.get(i).getMethod() == 3) {//最小
+                        fieldData = " min(" + field + ") as textValue ";
+                    }
+                    LambdaQueryWrapper<Device> queryWrapper2 = Wrappers.lambdaQuery();
+                    queryWrapper2.eq(Device::getDeviceCode, deviceCode);
+                    List<Device> Devicelist = deviceService.list(queryWrapper2);
+                    String table = "ht_analog_data";
+                    String table1 = "rt_analog_data";
+                    if (Devicelist.get(0).getDeviceType().equals("1")) {
+                        table = "ht_analog_data";
+                        table1 = "rt_analog_data";
+                    } else if (Devicelist.get(0).getDeviceType().equals("3")) {
+                        table = "ht_analog_171_data";
+                        table1 = "rt_analog_171_data";
+                    } else if (Devicelist.get(0).getDeviceType().equals("4")) {
+                        table = "ht_analog_173_data";
+                        table1 = "rt_analog_173_data";
+                    }
+                    String startHms = "00:00:00";
+                    String endHms = "23:59:59";
+                    if (list.get(i).getCycle() == 1) {//本日
+                        String time = sdf.format(new Date());
+                        String startTime = time + " " + startHms;
+                        String endTime = time + " " + endHms;
+                        List<RtData> rtData = baseMapper.getTextData(table, fieldData, deviceCode, startTime, endTime);
+                        bulletinCruxConfigVo.setTextValue(rtData.get(0).getTextValue());
+                    } else if (list.get(i).getCycle() == 2) {//本月
+                        Calendar calendar = new GregorianCalendar();
+                        calendar.setTime(new Date());
+                        //获得本月第一天
+                        calendar.add(Calendar.MONTH, 0);
+                        calendar.set(Calendar.DAY_OF_MONTH, 1);
+                        String startTime = sdf.format(calendar.getTime()) + " " + startHms;
+                        //获得本月最后一天
+                        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
+                        String endTime = sdf.format(calendar.getTime()) + " " + endHms;
+                        List<RtData> rtData = baseMapper.getTextData(table, fieldData, deviceCode, startTime, endTime);
+                        bulletinCruxConfigVo.setTextValue(rtData.get(0).getTextValue());
+                    } else if (list.get(i).getCycle() == 3) {//本年
+                        String time = sdfa.format(new Date());
+                        String startTime = time + "-01-01 00:00:00";
+                        String endTime = time + "-12-31 23:59:59";
+                        List<RtData> rtData = baseMapper.getTextData(table, fieldData, deviceCode, startTime, endTime);
+                        bulletinCruxConfigVo.setTextValue(rtData.get(0).getTextValue());
+                    } else if (list.get(i).getCycle() == 3) {//实时值
+                        List<RtData> rtData = baseMapper.getTextData(table1, field + " as textValue ", deviceCode, null, null);
+                        bulletinCruxConfigVo.setTextValue(rtData.get(0).getTextValue());
+                    }
+                } else if (list.get(i).getDataType() == 4) {//站点告警状态
+                    Integer alarCount = baseMapper.getAlarmCount(siteId);
+                    bulletinCruxConfigVo.setTextValue("无告警");
+                    if (alarCount > 0) {
+                        bulletinCruxConfigVo.setTextValue("告警");
+                    }
+                } else if (list.get(i).getDataType() == 5) {//站点通信状态
+                    LambdaQueryWrapper<DeviceStatus> queryWrapper1 = Wrappers.lambdaQuery();
+                    queryWrapper1.eq(DeviceStatus::getSiteId, siteId);
+                    List<DeviceStatus> deviceStatusList = deviceStatusService.list(queryWrapper1);
+                    if (deviceStatusList.size() > 0) {
+                        for (int j = 0; j < deviceStatusList.size(); j++) {
+                            bulletinCruxConfigVo.setTextValue("在线");
+                            if (deviceStatusList.get(j).getDeviceStatus() == 1) {
+                                bulletinCruxConfigVo.setTextValue("离线");
+                            }
+                        }
+                    } else {
+                        bulletinCruxConfigVo.setTextValue("离线");
+                    }
+                }
+                list1.add(bulletinCruxConfigVo);
+            }
+        }
+        return list1;
+    }
+
+
+    /**
+     * 配置数据查询2
+     *
+     * @param siteId
+     * @return
+     */
+    @Override
+    public List<BulletinCruxConfigVo> getBulletinHistoricalConfig(Integer siteId,Integer id) {
+        List<BulletinCruxConfigVo> bulletinCruxConfigVoList = baseMapper.getBulletinHistoricalConfig(siteId,id);
+        List<BulletinHistoricalRelationVo> bulletinHistoricalRelationList = this.getBulletinHistoricalRelationVo(siteId);
+        if (bulletinCruxConfigVoList.size() > 0) {
+            for (int i = 0; i < bulletinCruxConfigVoList.size(); i++) {
+                List<Object> bulletinHistoricalRelationList1 = new ArrayList<>();
+                for (int j = 0; j < bulletinHistoricalRelationList.size(); j++) {
+                    if (bulletinCruxConfigVoList.get(i).getId() == bulletinHistoricalRelationList.get(j).getHistoricalId()) {
+                        bulletinHistoricalRelationList1.add(bulletinHistoricalRelationList.get(j));
+                    }
+                }
+                bulletinCruxConfigVoList.get(i).setRelationData(bulletinHistoricalRelationList1);
+            }
+        }
+        return bulletinCruxConfigVoList;
+    }
+
+    /**
+     * 配置2变量数据
+     *
+     * @param siteId
+     * @return
+     */
+    @Override
+    public List<BulletinHistoricalRelationVo> getBulletinHistoricalRelationVo(Integer siteId) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        SimpleDateFormat sdf1 = new SimpleDateFormat("HH:mm:ss");
+        List<BulletinHistoricalRelationVo> bulletinHistoricalRelationList = baseMapper.getRelationData(siteId);
+        if (bulletinHistoricalRelationList.size() > 0) {
+            for (int i = 0; i < bulletinHistoricalRelationList.size(); i++) {
+                List<DeviceDataVo> deviceData = baseMapper.getDeviceData(bulletinHistoricalRelationList.get(i).getVariableId());
+                String table = "ht_analog_data";
+                if (deviceData.get(0).getDeviceType().equals("3")) {
+                    table = "ht_analog_171_data";
+                } else if (deviceData.get(0).getDeviceType().equals("4")) {
+                    table = "ht_analog_173_data";
+                }
+
+                String deviceCode = deviceData.get(0).getDeviceCode();
+                String time = sdf.format(new Date());
+                String startTime = time + " 00:00:00";
+                String endTime = time + " 23:59:59";
+                String field = " " + deviceData.get(0).getVariableCoding().split("_")[1] + " as textValue ,dataTime";
+                String group = " group by dataTime ";
+                if (bulletinHistoricalRelationList.get(i).getQueryCycle() == 2) {
+                    Calendar calendar = new GregorianCalendar();
+                    calendar.setTime(new Date());
+                    //获得本月第一天
+                    calendar.add(Calendar.MONTH, 0);
+                    calendar.set(Calendar.DAY_OF_MONTH, 1);
+                    startTime = sdf.format(calendar.getTime()) + " 00:00:00";
+                    //获得本月最后一天
+                    calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
+                    endTime = sdf.format(calendar.getTime()) + " 23:59:59";
+                    group = " group by freezingTime ";
+                    if (bulletinHistoricalRelationList.get(i).getQueryType() == 1) {
+                        field = " avg(" + deviceData.get(0).getVariableCoding().split("_")[1] + ") as textValue ,freezingTime as dataTime";
+                    } else if (bulletinHistoricalRelationList.get(i).getQueryType() == 2) {
+                        field = " max(" + deviceData.get(0).getVariableCoding().split("_")[1] + ") as textValue ,freezingTime as dataTime";
+                    }
+                }
+                List<RtData> RtData = baseMapper.getHtAnalogData(table, field, deviceCode, startTime, endTime, group);
+                List<String> timeKeys = new ArrayList<>();
+                List<String> datas = new ArrayList<>();
+                if (RtData.size() > 0) {
+                    for (int j = 0; j < RtData.size(); j++) {
+                        datas.add(RtData.get(j).getTextValue());
+                        if (bulletinHistoricalRelationList.get(i).getQueryCycle() == 1) {
+                            timeKeys.add("" + sdf1.format(RtData.get(j).getDataTime()));
+                        } else if (bulletinHistoricalRelationList.get(i).getQueryCycle() == 2) {
+                            timeKeys.add("" + sdf.format(RtData.get(j).getDataTime()));
+                        }
+
+                    }
+                    bulletinHistoricalRelationList.get(i).setDatas(datas);
+                    bulletinHistoricalRelationList.get(i).setTimeKeys(timeKeys);
+                }
+            }
+        }
+        return bulletinHistoricalRelationList;
+    }
+
+    @Override
+    public List<BulletinCruxConfigVo> getBulletinAlarmConfig(Integer siteId, Integer id) {
+        List<BulletinCruxConfigVo> bulletinAlarmConfigList = baseMapper.getBulletinAlarmConfig(siteId, id);
+        if (bulletinAlarmConfigList.size() > 0) {
+            for (int i = 0; i < bulletinAlarmConfigList.size(); i++) {
+                bulletinAlarmConfigList.get(i).setColorType("tabls");
+                List<AlarmPowerVo> AlarmPowerVoList = baseMapper.getAlarmPower(siteId, bulletinAlarmConfigList.get(i).getAlarmType());
+                bulletinAlarmConfigList.get(i).setTextValue(AlarmPowerVoList);
+            }
+        }
+        return bulletinAlarmConfigList;
+    }
+
+
+    public int daysBetween(Date smdate, Date bdate) {
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            smdate = sdf.parse(sdf.format(smdate));
+            bdate = sdf.parse(sdf.format(bdate));
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(smdate);
+            long time1 = cal.getTimeInMillis();
+            cal.setTime(bdate);
+            long time2 = cal.getTimeInMillis();
+            long between_days = (time2 - time1) / (1000 * 3600 * 24);
+            return Integer.parseInt(String.valueOf(between_days));
+        } catch (Exception e) {
+            throw new BusinessException("时间计算错误");
+        }
+    }
+
+    /**
+     * 数据看板-数据配置1编辑新增
+     *
+     * @param bulletinCruxConfig
+     */
+    @Override
+    public void editBulletinCruxConfig(BulletinCruxConfig bulletinCruxConfig) {
+        if (bulletinCruxConfig.getId() != 0) {
+            this.updateById(bulletinCruxConfig);
+        } else {
+            SysUser user = SecurityUtils.getLoginUser().getUser();
+            bulletinCruxConfig.setCreateTime(LocalDateTime.now());
+            bulletinCruxConfig.setCreateBy(user.getUserName());
+            this.save(bulletinCruxConfig);
+        }
+    }
+
+    /**
+     * 数据看板-数据配置2编辑新增
+     * @param bulletinHistoricalConfigAddVo
+     */
+    @Transactional
+    @Override
+    public void editBulletinHistoricalConfig(BulletinHistoricalConfigAddVo bulletinHistoricalConfigAddVo){
+        List<BulletinHistoricalRelation> bulletinHistoricalRelation = bulletinHistoricalConfigAddVo.getBulletinHistoricalRelationList();
+        BulletinHistoricalConfig bulletinHistoricalConfig = new BulletinHistoricalConfig();
+        bulletinHistoricalConfig.setId(bulletinHistoricalConfigAddVo.getId());
+        bulletinHistoricalConfig.setDataTitle(bulletinHistoricalConfigAddVo.getDataTitle());
+        bulletinHistoricalConfig.setIconPath(bulletinHistoricalConfigAddVo.getIconPath());
+        bulletinHistoricalConfig.setQueryCycle(bulletinHistoricalConfigAddVo.getQueryCycle());
+        bulletinHistoricalConfig.setQueryType(bulletinHistoricalConfigAddVo.getQueryType());
+        bulletinHistoricalConfig.setMaxDimension(bulletinHistoricalConfigAddVo.getMaxDimension());
+        bulletinHistoricalConfig.setMinDimension(bulletinHistoricalConfigAddVo.getMinDimension());
+        bulletinHistoricalConfig.setMeanDimension(bulletinHistoricalConfigAddVo.getMeanDimension());
+        bulletinHistoricalConfig.setLonAdaptation(bulletinHistoricalConfigAddVo.getLonAdaptation());
+        bulletinHistoricalConfig.setSiteId(bulletinHistoricalConfigAddVo.getSiteId());
+        bulletinHistoricalConfig.setCoordinatex(bulletinHistoricalConfigAddVo.getCoordinatex());
+        bulletinHistoricalConfig.setCoordinatey(bulletinHistoricalConfigAddVo.getCoordinatey());
+        bulletinHistoricalConfig.setWide(bulletinHistoricalConfigAddVo.getWide());
+        bulletinHistoricalConfig.setHigh(bulletinHistoricalConfigAddVo.getHigh());
+        if (bulletinHistoricalConfigAddVo.getId() != 0) {
+            bulletinHistoricalConfigService.updateById(bulletinHistoricalConfig);
+            if (bulletinHistoricalRelation.size()>0){
+                Integer historicalId = bulletinHistoricalConfigAddVo.getId();
+                baseMapper.delBulletinHistoricalRelation(historicalId);
+                for (int i = 0; i < bulletinHistoricalRelation.size(); i++) {
+                    bulletinHistoricalRelation.get(i).setHistoricalId(bulletinHistoricalConfigAddVo.getId());
+                    bulletinHistoricalRelationService.save(bulletinHistoricalRelation.get(i));
+                }
+            }
+        } else {
+            SysUser user = SecurityUtils.getLoginUser().getUser();
+            bulletinHistoricalConfig.setCreateTime(LocalDateTime.now());
+            bulletinHistoricalConfig.setCreateBy(user.getUserName());
+            bulletinHistoricalConfigService.save(bulletinHistoricalConfig);
+            Integer historicalId = bulletinHistoricalConfig.getId();
+            if (bulletinHistoricalRelation.size()>0){
+                for (int i = 0; i < bulletinHistoricalRelation.size(); i++) {
+                    bulletinHistoricalRelation.get(i).setHistoricalId(historicalId);
+                    bulletinHistoricalRelationService.save(bulletinHistoricalRelation.get(i));
+                }
+            }
+        }
+    }
+
+    /**
+     * 数据看板-数据配置3编辑新增
+     * @param bulletinAlarmConfig
+     */
+    @Override
+    public void editBulletinAlarmConfig(BulletinAlarmConfig bulletinAlarmConfig){
+        if (bulletinAlarmConfig.getId() != 0) {
+            bulletinAlarmConfigService.updateById(bulletinAlarmConfig);
+        } else {
+            SysUser user = SecurityUtils.getLoginUser().getUser();
+            bulletinAlarmConfig.setCreateTime(LocalDateTime.now());
+            bulletinAlarmConfig.setCreateBy(user.getUserName());
+            bulletinAlarmConfigService.save(bulletinAlarmConfig);
+        }
+    }
+
+    /**
+     * 数据看板-数据配置1删除
+     *
+     * @param id 配置ID
+     */
+    @Override
+    public void delBulletinCruxConfig(Integer id) {
+        baseMapper.delBulletinCruxConfig(id);
+    }
+
+    /**
+     * 数据看板-数据配置2删除
+     * @param id 配置ID
+     */
+    @Transactional
+    @Override
+    public void delBulletinHistoricalConfig(Integer id) {
+        baseMapper.delBulletinHistoricalConfig(id);
+        baseMapper.delBulletinHistoricalRelation(id);
+    }
+
+    /**
+     * 数据看板-数据配置3删除
+     * @param id 配置ID
+     */
+    @Override
+    public void delBulletinAlarmConfig(Integer id) {
+        baseMapper.delBulletinAlarmConfig(id);
+    }
+
+
+
+    @Override
+    public List<DeviceAttribute> getDeviceAttribute(Integer siteId){
+        LambdaQueryWrapper<DeviceAttribute> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(DeviceAttribute::getSiteId, siteId);
+        List<DeviceAttribute> list = deviceAttributeService.list(queryWrapper);
+        return list;
+    }
+
+    @Override
+    public List<DeviceAnalogVariableList> getDeviceAnalogVariableList(Integer monitoringEquipment){
+        LambdaQueryWrapper<DeviceAnalogVariableList> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(DeviceAnalogVariableList::getMonitoringEquipment, monitoringEquipment);
+        List<DeviceAnalogVariableList> list = deviceAnalogVariableListService.list(queryWrapper);
+        return list;
+    }
+}

+ 20 - 0
fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinHistoricalConfigServiceImpl.java

@@ -0,0 +1,20 @@
+package com.bizmatics.service.impl;
+
+import com.bizmatics.model.BulletinHistoricalConfig;
+import com.bizmatics.persistence.mapper.BulletinHistoricalConfigMapper;
+import com.bizmatics.service.BulletinHistoricalConfigService;
+import com.bizmatics.common.mvc.base.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+@Service
+public class BulletinHistoricalConfigServiceImpl extends AbstractCrudService<BulletinHistoricalConfigMapper, BulletinHistoricalConfig> implements BulletinHistoricalConfigService {
+
+}

+ 20 - 0
fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinHistoricalRelationServiceImpl.java

@@ -0,0 +1,20 @@
+package com.bizmatics.service.impl;
+
+import com.bizmatics.model.BulletinHistoricalRelation;
+import com.bizmatics.persistence.mapper.BulletinHistoricalRelationMapper;
+import com.bizmatics.service.BulletinHistoricalRelationService;
+import com.bizmatics.common.mvc.base.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-06
+ */
+@Service
+public class BulletinHistoricalRelationServiceImpl extends AbstractCrudService<BulletinHistoricalRelationMapper, BulletinHistoricalRelation> implements BulletinHistoricalRelationService {
+
+}

+ 20 - 0
fiveep-service/src/main/java/com/bizmatics/service/impl/BulletinStatusConfigServiceImpl.java

@@ -0,0 +1,20 @@
+package com.bizmatics.service.impl;
+
+import com.bizmatics.model.BulletinStatusConfig;
+import com.bizmatics.persistence.mapper.BulletinStatusConfigMapper;
+import com.bizmatics.service.BulletinStatusConfigService;
+import com.bizmatics.common.mvc.base.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-01
+ */
+@Service
+public class BulletinStatusConfigServiceImpl extends AbstractCrudService<BulletinStatusConfigMapper, BulletinStatusConfig> implements BulletinStatusConfigService {
+
+}