liukangdong
2024-11-29 701d5ca0fb3da20fb336d66e08f4aa3c6b85c731
Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit
已添加5个文件
已修改16个文件
562 ■■■■ 文件已修改
server/system_gateway/src/main/resources/application-dev.yml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/EnergyController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/FightingAdminController.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/resources/bootstrap.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/BaseListPageRequest.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/RegionTopPowerResponse.java 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/AlarmDataVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/AlarmEventDataVO.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/DeviceNumByTypeVO.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/FightingAdminBoardVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/FightingAdminCenterDataVO.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/MonitorDataInfoVO.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/MonitorDataVO.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/YearDeviceDataVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java 204 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/third/BoardService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/resources/application-dev.yml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_gateway/src/main/resources/application-dev.yml
@@ -1,12 +1,12 @@
spring:
  # æ•°æ®æºé…ç½®
  datasource:
    url: jdbc:mysql://sh-cdb-aiskr3vy.sql.tencentcdb.com:62443/antaiwuliu?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
    username: doumee
    password: rtjgfEr@&0c0m
#    url: jdbc:mysql://10.50.250.253:3306/antaiwuliu?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
#    username: root
#    password: Atwl@2024
#    url: jdbc:mysql://sh-cdb-aiskr3vy.sql.tencentcdb.com:62443/antaiwuliu?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
#    username: doumee
#    password: rtjgfEr@&0c0m
    url: jdbc:mysql://10.50.250.253:3306/antaiwuliu?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
    username: root
    password: Atwl@2024
    driver-class-name: com.mysql.cj.jdbc.Driver
    type: com.alibaba.druid.pool.DruidDataSource
server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -3036,6 +3036,12 @@
        calendar.add(Calendar.DATE, days);//
        return calendar.getTime();
    }
    public static Date addMonthToDate(Date date, int month) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.MONTH, month);//
        return calendar.getTime();
    }
    public static String afterDateToStr(Integer days){
        Date date = new Date();
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/EnergyController.java
@@ -48,8 +48,6 @@
    @LoginNoRequired
    @ApiOperation("用电总能耗同比、环比和区域用电量集合")
    @GetMapping("/energyRegionData")
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/FightingAdminController.java
@@ -3,11 +3,18 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.doumee.api.BaseController;
import com.doumee.config.annotation.LoginNoRequired;
import com.doumee.core.haikang.model.HKConstants;
import com.doumee.core.haikang.model.param.BaseResponse;
import com.doumee.core.haikang.model.param.request.FireDevStatusTotalRequest;
import com.doumee.core.haikang.model.param.respose.FireDevStatusListResponse;
import com.doumee.core.haikang.model.param.respose.MonthDataByMeterTypeResponse;
import com.doumee.core.haikang.service.HKService;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.PlatformLogMapper;
import com.doumee.dao.business.model.PlatformLog;
import com.doumee.dao.web.response.platformReport.*;
import com.doumee.service.business.third.BoardService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -33,94 +40,56 @@
@Slf4j
@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/board/api/fightingAdmin")
public class FightingAdminController extends BaseController {
    @Autowired
    private BoardService boardService;
    @LoginNoRequired
    @ApiOperation("中心数据")
    @GetMapping("/centerData")
    public ApiResponse<FightingAdminBoardVO> centerData() {
        FightingAdminBoardVO data = new FightingAdminBoardVO();
        Random random = new Random();
        data.setOfflineDeviceNum(random.nextInt(20));
        data.setOnlineDeviceNum(random.nextInt(20));
        data.setErrDeviceNum(random.nextInt(20));
        data.setShieldDeviceNum(random.nextInt(20));
        data.setTodayDangerNum(random.nextInt(20));
        data.setDealDangerNum(random.nextInt(20));
    public ApiResponse<FightingAdminCenterDataVO> centerData() {
        FightingAdminCenterDataVO data = boardService.centerFightingAdminData();
        return ApiResponse.success(data);
    }
    @LoginNoRequired
    @ApiOperation("今日各系统设备状态及告警数量")
    @GetMapping("/deviceAlarmData")
    public ApiResponse<List<DeviceAlarmDataVO>> deviceAlarmData() {
        List<DeviceAlarmDataVO> deviceAlarmDataVOList = new ArrayList<>();
        Random random = new Random();
        for (int i = 1; i <= 5; i++) {
            DeviceAlarmDataVO deviceAlarmDataVO = new DeviceAlarmDataVO();
            deviceAlarmDataVO.setDeviceTypeName("设备名称_"+i);
            deviceAlarmDataVO.setAlarmNum(random.nextInt(20));
            deviceAlarmDataVO.setErrNum(random.nextInt(20));
            deviceAlarmDataVO.setOfflineNum(random.nextInt(20));
            deviceAlarmDataVO.setShieldNum(random.nextInt(20));
            deviceAlarmDataVO.setStatusTotal(deviceAlarmDataVO.getAlarmNum() + deviceAlarmDataVO.getErrNum() + deviceAlarmDataVO.getOfflineNum() + deviceAlarmDataVO.getShieldNum());
            deviceAlarmDataVOList.add(deviceAlarmDataVO);
        }
        return ApiResponse.success(deviceAlarmDataVOList);
    }
    @LoginNoRequired
    @ApiOperation("报警信息")
    @GetMapping("/alarmData")
    public ApiResponse<AlarmDataVO> alarmData() {
        AlarmDataVO alarmDataVO = new AlarmDataVO();
        Random random = new Random();
        alarmDataVO.setTotalNum(random.nextInt(30));
        alarmDataVO.setRealNum(random.nextInt(alarmDataVO.getTotalNum()));
        alarmDataVO.setErrNum(random.nextInt(alarmDataVO.getRealNum()));
        alarmDataVO.setLiftNum(random.nextInt(alarmDataVO.getErrNum()));
        alarmDataVO.setProcessingNum(random.nextInt(alarmDataVO.getErrNum()));
    public ApiResponse<AlarmDataVO> alarmDataSumByCate() {
        AlarmDataVO alarmDataVO = boardService.alarmDataSumByCate();
        return ApiResponse.success(alarmDataVO);
    }
    @LoginNoRequired
    @ApiOperation("告警信息集合")
    @GetMapping("/alarmDataList")
    public ApiResponse<List<AlarmEventDataVO>> alarmDataList() {
        List<AlarmEventDataVO> data  = boardService.fightingAdminAlertList();
        return ApiResponse.success(data);
    }
    @LoginNoRequired
    @ApiOperation("检测数据集合")
    @GetMapping("/monitorDataList")
    public ApiResponse<List<MonitorDataVO>> monitorDataList() {
        List<MonitorDataVO> data  = boardService.monitorDataList();
        return ApiResponse.success(data);
    }
    @LoginNoRequired
    @ApiOperation("告警处理分析")
    @ApiOperation("告警处理分析集合")
    @GetMapping("/alarmHandleData")
    public ApiResponse<List<AlarmHandleDataVO>> alarmHandleData(@RequestParam Integer type) {
        List<AlarmHandleDataVO> alarmHandleDataVOList = new ArrayList<>();
        Random random = new Random();
        for (int i = 1; i <= 12; i++) {
            AlarmHandleDataVO alarmHandleDataVO = new AlarmHandleDataVO();
            alarmHandleDataVO.setMonthStr(i+"月");
            alarmHandleDataVO.setAlarmNum(random.nextInt(20));
            alarmHandleDataVO.setErrNum(random.nextInt(20));
            alarmHandleDataVO.setLiftNum(random.nextInt(20));
            alarmHandleDataVO.setProcessingNum(random.nextInt(20));
            alarmHandleDataVOList.add(alarmHandleDataVO);
        }
    public ApiResponse<List<AlarmDataVO>> alarmHandleData() {
        List<AlarmDataVO> alarmHandleDataVOList = boardService.fightingAlarmHandleData();
        return ApiResponse.success(alarmHandleDataVOList);
    }
    @LoginNoRequired
    @ApiOperation("本年消防设备/设施维护情况")
    @ApiOperation("本年和本月新增消防设备/设施维护情况")
    @GetMapping("/yearDeviceData")
    public ApiResponse<YearDeviceDataVO> yearDeviceData() {
        Random random = new Random();
        YearDeviceDataVO yearDeviceDataVO = new YearDeviceDataVO();
        yearDeviceDataVO.setMonthAddNum(random.nextInt(100));
        yearDeviceDataVO.setPlanProtectTotal(random.nextInt(1000));
        yearDeviceDataVO.setProtectNum(yearDeviceDataVO.getPlanProtectTotal());
        YearDeviceDataVO yearDeviceDataVO = boardService.yearFightingAdminDeviceData();
        return ApiResponse.success(yearDeviceDataVO);
    }
}
server/visits/dmvisit_admin/src/main/resources/bootstrap.yml
@@ -1,6 +1,6 @@
spring:
  profiles:
    active: dev
    active: pro
  application:
    name: visitsAdmin
    # å®‰å…¨é…ç½®
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java
@@ -157,11 +157,13 @@
        String[] energyTodayLoadData= new String[]{"/api/v1/exhibition/energy/getTodayLoadData","能耗看板-5.园区实时负荷曲线"};//能耗看板-5.园区实时负荷曲线
        String[] energyTrend= new String[]{"/api/v1/report/energyTrend","能耗看板-6按月查询近12个月的用电总量数据"};//能耗看板-6按月查询近12个月的用电总量数据
        String[] fireStatistic= new String[]{"/api/v1/fireStatistic","消防维保统计"};//消防维保统计
        String[] fireStatisticMonth= new String[]{"/api/v1/fireStatisticMonth","消防维保统计每月新增"};//消防维保统计每月新增
        String[] getFireDevStatusTotal= new String[]{"/api/dataBoardService/v2/getFireDevStatusTotal","消防看板-消防设备在离线1"};//消防看板-消防设备在离线1
        String[] getFireDevStatusList= new String[]{"/api/dataBoardService/v2/getFireDevStatusList","消防看板-各类型设备在线率2"};//消防看板-各类型设备在线率2
        String[] findAlarmBaseDataStatistic= new String[]{"/api/v1/alarm/findAlarmBaseDataStatistic","消防看板-4报警信息统计"};//消防看板-4报警信息统计
        String[] findHomeAlarmInfoPage= new String[]{"/api/v1/alarm/findHomeAlarmInfoPage","安防看板-- åˆ†é¡µæŸ¥è¯¢æœªå¤„理报警信息6"};//安防看板-- åˆ†é¡µæŸ¥è¯¢æœªå¤„理报警信息6
        String[] minitorDataSearch= new String[]{"/api/fem/v1/minitor/data/search","分页查询设备监测历史数据"};//分页查询设备监测历史数据
        String[] minitorDataSearchV1= new String[]{"/api/fem/v1/minitor/data/search","分页查询设备监测历史数据"};//分页查询设备监测历史数据
        String[] minitorDataSearch= new String[]{"/api/fpms/v2/minitor/data/search"};//分页查询设备监测历史数据
    }
    /**
     * é™„录A.55消防设备类型
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
@@ -791,6 +791,14 @@
        return startDoPostStringArtemis(HKConstants.InterfacePath.fireStatistic,body);
    }
    /**
     * æ¶ˆé˜²ç»´ä¿æ¯æœˆæ–°å¢žç»Ÿè®¡
     * @param body
     * @return
     */
    public static String fireStatisticMonth(String body) {
        return startDoPostStringArtemis(HKConstants.InterfacePath.fireStatisticMonth,body);
    }
    /**
     * æ¶ˆé˜²çœ‹æ¿-消防设备在离线1
     * @param body
     * @return
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/BaseListPageRequest.java
@@ -6,6 +6,7 @@
public class BaseListPageRequest {
  private String   userId;//     Head      String      true      ç”¨æˆ·ID
  private Integer  pageNo    ;//integer    True    é¡µç ,pageNo≥1
  private Integer  page    ;//integer    True    é¡µç ,pageNo≥1
  private Integer  pageSize;//    integer    True    åˆ†é¡µå¤§å°
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/RegionTopPowerResponse.java
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -1767,6 +1767,25 @@
        return  null;
    }
    /**
     *本月新增维保设备数
     * api_fire_statistic_month
     * @return
     */
    public  static  BaseResponse<FireStatisticResponse>   fireStatisticMonth(FireStatisticRequest param){
        log.info("【海康消防维保统计每月新增】================开始===="+JSONObject.toJSONString(param));
        try {
            String res = HKTools.fireStatisticMonth(JSONObject.toJSONString(param));
            TypeReference typeReference =
                    new TypeReference< BaseResponse<FireStatisticResponse>>(){};
            BaseResponse<FireStatisticResponse>   result = JSONObject.parseObject(res, typeReference.getType());
            logResult(result,"海康消防维保统计每月新增");
            return  result;
        }catch (Exception e){
            log.error("【海康消防维保统计每月新增】================失败====:\n"+ e.getMessage());
        }
        return  null;
    }
    /**
     *消防看板-消防设备在离线1
     * @return
     */
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/AlarmDataVO.java
@@ -27,6 +27,10 @@
    @ApiModelProperty(value = "处理中数量")
    private Integer processingNum;
    @ApiModelProperty(value = "统计时间开始")
    private String  startDate;
    @ApiModelProperty(value = "统计时间结束")
    private String  endDate;
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/AlarmEventDataVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
package com.doumee.dao.web.response.platformReport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * æœ¬å¹´æ¶ˆé˜²è®¾å¤‡/设施维护情况
 *
 * @Author : Rk
 * @create 2024/10/25 14:26
 */
@Data
public class AlarmEventDataVO {
    @ApiModelProperty(value = "报警源详细地址")
    private String location;
    @ApiModelProperty(value = "报警源名称")
    private String alarmName;
    @ApiModelProperty(value = "区域名称")
    private String regionName;
    @ApiModelProperty(value = "区域编码")
    private String regionIndexCode;
    @ApiModelProperty(value = "报警时间 æ—¶é—´æ ¼å¼yyyy-MM-dd HH:mm:ss")
    private String alarmTime;
    @ApiModelProperty(value = "报警源资源名称")
    private String resourceName;
    @ApiModelProperty(value = "报警状态")
    private String handleStatus;
    @ApiModelProperty(value = "报警类型名称")
    private String alarmTypeName;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/DeviceNumByTypeVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
package com.doumee.dao.web.response.platformReport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * æ¶ˆé˜²ç®¡æŽ§å¤§å±
 *
 * @Author : Rk
 * @create 2024/10/25 13:53
 */
@Data
public class DeviceNumByTypeVO {
    @ApiModelProperty(value = "设备类型名称")
    private String  typeName;
    @ApiModelProperty(value = "在线设备数量")
    private Integer onlineDeviceNum;
    @ApiModelProperty(value = "报警设备数量")
    private Integer alarmDeviceNum;
    @ApiModelProperty(value = "故障设备数量")
    private Integer errDeviceNum;
    @ApiModelProperty(value = "总设备数")
    private Integer totalDeviceNum;
    @ApiModelProperty(value = "离线设备数量")
    private Integer offlineDeviceNum;
    @ApiModelProperty(value = "屏蔽设备数量")
    private Integer shieldDeviceNum;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/FightingAdminBoardVO.java
@@ -15,6 +15,8 @@
public class FightingAdminBoardVO {
    @ApiModelProperty(value = "设备类型名称")
    private String  typeName;
    @ApiModelProperty(value = "在线设备数量")
    private Integer onlineDeviceNum;
@@ -23,6 +25,8 @@
    @ApiModelProperty(value = "故障设备数量")
    private Integer errDeviceNum;
    @ApiModelProperty(value = "总设备数")
    private Integer totalDeviceNum;
    @ApiModelProperty(value = "离线设备数量")
    private Integer offlineDeviceNum;
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/FightingAdminCenterDataVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
package com.doumee.dao.web.response.platformReport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * æ¶ˆé˜²ç®¡æŽ§å¤§å±
 *
 * @Author : Rk
 * @create 2024/10/25 13:53
 */
@Data
public class FightingAdminCenterDataVO {
    @ApiModelProperty(value = "在线设备数量")
    private Integer onlineDeviceNum;
    @ApiModelProperty(value = "报警设备数量")
    private Integer alarmDeviceNum;
    @ApiModelProperty(value = "故障设备数量")
    private Integer errDeviceNum;
    @ApiModelProperty(value = "总设备数")
    private Integer totalDeviceNum;
    @ApiModelProperty(value = "离线设备数量")
    private Integer offlineDeviceNum;
    @ApiModelProperty(value = "屏蔽设备数量")
    private Integer shieldDeviceNum;
    @ApiModelProperty(value = "隐患总数")
    private Integer dangerTotalNum;
    @ApiModelProperty(value = "今日隐患处理量")
    private Integer dangerDealedNum;
    @ApiModelProperty(value = "按设备分类统计呵呵" , hidden = true)
    private List<DeviceNumByTypeVO> deviceTypeList;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/MonitorDataInfoVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package com.doumee.dao.web.response.platformReport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * æœ¬å¹´æ¶ˆé˜²è®¾å¤‡/设施维护情况
 *
 * @Author : Rk
 * @create 2024/10/25 14:26
 */
@Data
public class MonitorDataInfoVO {
    @ApiModelProperty(value = "监测类型")
    private String typeCode    ;//String    false    ç›‘测类型,参考[附录A.70 æ¶ˆé˜²ç›‘测类型]@[智慧园区管理平台V1.4.301-附录-附录A æ•°æ®å­—å…¸#附录A.70 æ¶ˆé˜²ç›‘测类型]中类型大类
    @ApiModelProperty(value = "监测名称")
    private String typeName    ;//String    false    ç›‘测名称
    @ApiModelProperty(value = "报警源详细地址")
    private String location;
    @ApiModelProperty(value = "监测值")
    private String value;
    @ApiModelProperty(value = "小类名称")
    private String cateName;
    @ApiModelProperty(value = "小类编号")
    private String cateCode;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/MonitorDataVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package com.doumee.dao.web.response.platformReport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * æœ¬å¹´æ¶ˆé˜²è®¾å¤‡/设施维护情况
 *
 * @Author : Rk
 * @create 2024/10/25 14:26
 */
@Data
public class MonitorDataVO {
    @ApiModelProperty(value = "设备或者传感器名称")
    private String name;
    @ApiModelProperty(value = "监测数据集合")
    private List<MonitorDataInfoVO> dataList;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/YearDeviceDataVO.java
@@ -21,6 +21,8 @@
    @ApiModelProperty(value = "本月新增维保")
    private Integer monthAddNum;
    @ApiModelProperty(value = "本月维保总数")
    private Integer monthTotalNum;
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
@@ -29,8 +29,10 @@
import com.doumee.service.business.third.BoardService;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -48,6 +50,8 @@
public class BoardServiceImpl implements BoardService {
    @Autowired
    private PlatformLogMapper platformLogMapper;
    @Autowired
    private HiddenDangerMapper hiddenDangerMapper;
    @Autowired
    private PlatformWaterGasMapper platformWaterGasMapper;
    @Autowired
@@ -401,11 +405,11 @@
        List<EnergyDataVO> loadCurveList = new ArrayList<>();
        try {
            BaseResponse<List<EnergyTodayLoadDataResponse>>  response = HKService.energyTodayLoadData();
            if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) || response.getData()==null ){
            if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){
                for (EnergyTodayLoadDataResponse model :response.getData()) {
                    EnergyDataVO data = new EnergyDataVO();
                    data.setTimeData(model.getName());
                    data.setEnergy(new BigDecimal(model.getName()));
                    data.setEnergy(new BigDecimal(StringUtils.defaultString(model.getValue(),"0")));
                    loadCurveList.add(data);
                }
            }
@@ -434,6 +438,192 @@
        return oilDataVOList;
    }
    /**
     * ã€æ¶ˆé˜²ç®¡æŽ§ã€‘看板-本年和本月新增消防设备/设施维护情况
     * @return
     *
     */
    @Override
    public    List<AlarmEventDataVO> fightingAdminAlertList(){
        List<AlarmEventDataVO> data = new ArrayList<>();
        //查询24小时内的
        FindHomeAlarmInfoPageRequest param = new FindHomeAlarmInfoPageRequest();
        param.setHour(24);
        param.setPage(1);
        param.setAlarmStartTime(DateUtil.getPlusTime2(DateUtil.addDaysToDate(new Date(),-1)));
        param.setAlarmEndTime(DateUtil.getPlusTime2(new Date()));
        param.setPageSize(20);
        BaseResponse<BaseListPageResponse<FindHomeAlarmInfoPageResponse>> response = HKService.findHomeAlarmInfoPage(param);
        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)
                && response.getData()!=null
                &&response.getData().getList()!=null) {
            for(FindHomeAlarmInfoPageResponse r : response.getData().getList()){
                AlarmEventDataVO t = new AlarmEventDataVO();
                BeanUtils.copyProperties(r,t);
                data.add(t);
            }
        }
            return data;
    }
    /**
     * ã€æ¶ˆé˜²ç®¡æŽ§ã€‘看板-实时监测数据
     * @return
     *
     */
    @Override
    public  List<MonitorDataVO> monitorDataList(){
        List<MonitorDataVO> list = new ArrayList<>();
        MinitorDataSearchRequest param = new MinitorDataSearchRequest();
        param.setResourceTypeCodes(new String[]{});
        param.setRegionIndexCode("root0001");
        param.setIncludeDown("1");
        param.setUserId("admin");
        BaseResponse<BaseListPageResponse<MonitorDataSearchResponse>> response = HKService.minitorDataSearch(param);
        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)
                && response.getData()!=null ) {
            List<MonitorDataSearchResponse> r = response.getData().getList();
            if(r!= null){
                for(MonitorDataSearchResponse model : r){
                    MonitorDataVO m = new MonitorDataVO();
                    m.setName(model.getName());
                    m.setDataList(new ArrayList<>());
                    if(model.getValues()!=null){
                        for(MonitorDataValResponse v : model.getValues()){
                            MonitorDataInfoVO vm = new MonitorDataInfoVO();
                            vm.setValue(v.getMonitorValue());
                            vm.setCateName(v.getMonitorSpecificName());
                            vm.setCateCode(v.getMonitorTypeKey());
                            vm.setTypeCode(v.getMonitorTypeCode());
                            vm.setTypeName(v.getMonitorTypeName());
                        }
                    }
                }
            }
        }
        return  list;
    }
    /**
     * ã€æ¶ˆé˜²ç®¡æŽ§ã€‘看板-告警处理分析集合
     * @return
     *
     */
    @Override
    public   List<AlarmDataVO> fightingAlarmHandleData(){
        List<AlarmDataVO> alarmHandleDataVOList = new ArrayList<>();
        Date now = DateUtil.getStartOfDay(new Date());
        for (int i = 1; i < 12; i++) {
            Date start  =  DateUtil.addMonthToDate(now,-12+i);
            Date end  =  DateUtil.addMonthToDate(now,-11+i);
            AlarmDataVO t = getAlertDataByStartEndTime(DateUtil.getPlusTime2(start),DateUtil.getPlusTime2(end));
            alarmHandleDataVOList.add(t);
        }
        return alarmHandleDataVOList;
    }
    /**
     * ã€æ¶ˆé˜²ç®¡æŽ§ã€‘看板-告警信息集合
     *
     * @return
     *
     */
    @Override
    public   AlarmDataVO alarmDataSumByCate(){
        AlarmDataVO alarmDataVO = getAlertDataByStartEndTime(DateUtil.getPlusTime2(DateUtil.addDaysToDate(new Date(),-1))
                ,(DateUtil.getPlusTime2(new Date())));
        return  alarmDataVO;
    }
    public static AlarmDataVO getAlertDataByStartEndTime(String start,String end){
        AlarmDataVO alarmDataVO = new AlarmDataVO();
        FindAlarmBaseDataStatisticRequest param = new FindAlarmBaseDataStatisticRequest();
        param.setAlarmStartTime(start);
        param.setAlarmEndTime(end);
        param.setUserId("admin");
        BaseResponse<FindAlarmBaseDataStatisticResponse> response = HKService.findAlarmBaseDataStatistic(param);
        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)
                && response.getData()!=null ) {
            alarmDataVO.setTotalNum(Constants.formatIntegerNum(response.getData().getTotalAlarmNum()));
            alarmDataVO.setRealNum(Constants.formatIntegerNum(response.getData().getTotalAlarmNum()));
            alarmDataVO.setErrNum(Constants.formatIntegerNum(response.getData().getMisReportAlarmNum()));
            alarmDataVO.setLiftNum(Constants.formatIntegerNum(response.getData().getHandledAlarmNum()));
            alarmDataVO.setProcessingNum(Constants.formatIntegerNum(response.getData().getUnHandedAlarmNum()));
            alarmDataVO.setStartDate(start);
            alarmDataVO.setEndDate(end);
        }
        return  alarmDataVO;
    }
    /**
     * ã€æ¶ˆé˜²ç®¡æŽ§ã€‘看板-本年和本月新增消防设备/设施维护情况
     * @return
     */
    @Override
    public    YearDeviceDataVO yearFightingAdminDeviceData(){
        YearDeviceDataVO data = new YearDeviceDataVO();
        FireStatisticRequest param = new FireStatisticRequest();
        param.setIndexCode("api_fire_statistic");
        BaseResponse<FireStatisticResponse> response = HKService.fireStatistic(param);
        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ) {
            data.setProtectNum(Constants.formatIntegerNum(response.getData().getMaintenanceNum()));
            data.setPlanProtectTotal(Constants.formatIntegerNum(response.getData().getDeviceTotalNum()));
        }
        param = new FireStatisticRequest();
        param.setIndexCode("api_fire_statistic_month");
        BaseResponse<FireStatisticResponse> response1 = HKService.fireStatisticMonth(param);
        if(response1 != null && StringUtils.equals(response1.getCode(), HKConstants.RESPONSE_SUCCEE)
                && response1.getData()!=null ) {
            data.setMonthAddNum(Constants.formatIntegerNum(response1.getData().getMaintenanceNum()));
            data.setMonthTotalNum(Constants.formatIntegerNum(response1.getData().getDeviceTotalNum()));
        }
            return data;
    }
    /**
     * ã€æ¶ˆé˜²ç®¡æŽ§ã€‘看板-分类和汇总的各状态设备数量
     * @return
     */
    @Override
    public  FightingAdminCenterDataVO centerFightingAdminData(){
        FightingAdminCenterDataVO data = new FightingAdminCenterDataVO();
        List<DeviceNumByTypeVO> list = new ArrayList<>();
        FireDevStatusTotalRequest param = new FireDevStatusTotalRequest();
        param.setIncludeBool(1);
        param.setRegionIds(new String[]{"root000000"});
        BaseResponse<List<FireDevStatusListResponse>> response = HKService.getFireDevStatusList(param);
        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){
            for(FireDevStatusListResponse r :response.getData()){
                DeviceNumByTypeVO t = new DeviceNumByTypeVO();
                t.setTypeName(r.getDevTypeName());
                t.setOfflineDeviceNum(Constants.formatIntegerNum(r.getOfflineFireDevCount()));
                t.setAlarmDeviceNum(Constants.formatIntegerNum(r.getAlarmFireDevCount()));
                t.setOnlineDeviceNum(Constants.formatIntegerNum(r.getOnlineFireDevCount()));
                t.setErrDeviceNum(Constants.formatIntegerNum(r.getFaultFireDevCount()));
                t.setTotalDeviceNum(Constants.formatIntegerNum(r.getTotalFireDevCount()));
                list.add(t);
                data.setOfflineDeviceNum(Constants.formatIntegerNum( data.getOfflineDeviceNum())+Constants.formatIntegerNum(r.getOfflineFireDevCount()));
                data.setAlarmDeviceNum(Constants.formatIntegerNum( data.getAlarmDeviceNum())+Constants.formatIntegerNum(r.getAlarmFireDevCount()));
                data.setOnlineDeviceNum(Constants.formatIntegerNum( data.getOnlineDeviceNum())+Constants.formatIntegerNum(r.getOnlineFireDevCount()));
                data.setErrDeviceNum(Constants.formatIntegerNum( data.getErrDeviceNum())+Constants.formatIntegerNum(r.getFaultFireDevCount()));
                data.setTotalDeviceNum(Constants.formatIntegerNum( data.getTotalDeviceNum())+Constants.formatIntegerNum(r.getTotalFireDevCount()));
            }
        }
        data.setDeviceTypeList(list);
        Long totalNum =hiddenDangerMapper.selectCount(new QueryWrapper<HiddenDanger>().lambda()
                .eq(HiddenDanger::getIsdeleted,Constants.ZERO )
                .apply("to_day(create_data) = to_days(now())" ) );
        data.setDangerTotalNum(totalNum !=null?totalNum.intValue():0);//今日隐患数量
        totalNum =hiddenDangerMapper.selectCount(new QueryWrapper<HiddenDanger>().lambda()
                .eq(HiddenDanger::getIsdeleted,Constants.ZERO )
                .in(HiddenDanger::getStatus,Constants.ONE,Constants.TWO )
                .apply("to_day(check_date) = to_days(now())" ) );
        data.setDangerDealedNum(totalNum !=null?totalNum.intValue():0);//今日处理隐患数量
        return  data;
    }
    /**
     * ç”¨ç”µæ€»èƒ½è€—同比、环比和区域用电量集合
     * @return
@@ -473,7 +663,7 @@
        Date month0 = DateUtil.getDateFromString(firstDate);
        Date month1 = DateUtil.increaseMonth(month0,-1);//上月
        Date month2 = DateUtil.increaseMonth(month0,-2);//上上月
        Date month3 = DateUtil.increaseMonth(month0,-12);//去年同月
        Date month3 = DateUtil.increaseMonth(month0,-13);//去年同月
        List<PlatformWaterGas> list =  platformWaterGasMapper.selectList(new QueryWrapper<PlatformWaterGas>()
                .lambda()
@@ -494,10 +684,10 @@
                        data.getGasQuantity().setTotal(Constants.formatBigdecimal(model.getNum())+"");
                    }
                    if(model.getTimeInfo().getTime() == month2.getTime()){
                        data.getGasQuantity().setSameNum(Constants.formatBigdecimal(model.getNum()) );
                        data.getGasQuantity().setRingNum(Constants.formatBigdecimal(model.getNum()) );
                    }
                    if(model.getTimeInfo().getTime() == month3.getTime()){
                        data.getGasQuantity().setRingNum(Constants.formatBigdecimal(model.getNum()) );
                        data.getGasQuantity().setSameNum(Constants.formatBigdecimal(model.getNum()) );
                    }
                }else if(Constants.equalsInteger(model.getType(),Constants.ZERO)){
@@ -509,10 +699,10 @@
                        data.getWaterQuantity().setTotal(Constants.formatBigdecimal(model.getNum())+"");
                    }
                    if(model.getTimeInfo().getTime() == month2.getTime()){
                        data.getWaterQuantity().setSameNum(Constants.formatBigdecimal(model.getNum()) );
                        data.getWaterQuantity().setRingNum(Constants.formatBigdecimal(model.getNum()) );
                    }
                    if(model.getTimeInfo().getTime() == month3.getTime()){
                        data.getWaterQuantity().setRingNum(Constants.formatBigdecimal(model.getNum()) );
                        data.getWaterQuantity().setSameNum(Constants.formatBigdecimal(model.getNum()) );
                    }
                }
            }
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/third/BoardService.java
@@ -69,4 +69,16 @@
    RegionEnergyListResponse energyRegionData();
    EnergyBoardVO centerEnergyData();
    FightingAdminCenterDataVO centerFightingAdminData();
    YearDeviceDataVO yearFightingAdminDeviceData();
    List<AlarmEventDataVO> fightingAdminAlertList();
    AlarmDataVO alarmDataSumByCate();
    List<AlarmDataVO> fightingAlarmHandleData();
    List<MonitorDataVO> monitorDataList();
}
server/visits/dmvisit_service/src/main/resources/application-dev.yml
@@ -1,12 +1,12 @@
spring:
  # æ•°æ®æºé…ç½®
  datasource:
    url: jdbc:mysql://sh-cdb-aiskr3vy.sql.tencentcdb.com:62443/antaiwuliu?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
    username: doumee
    password: rtjgfEr@&0c0m
#    url: jdbc:mysql://10.50.250.253:3306/antaiwuliu?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
#    username: root
#    password: Atwl@2024
#    url: jdbc:mysql://sh-cdb-aiskr3vy.sql.tencentcdb.com:62443/antaiwuliu?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
#    username: doumee
#    password: rtjgfEr@&0c0m
    url: jdbc:mysql://10.50.250.253:3306/antaiwuliu?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
    username: root
    password: Atwl@2024
    driver-class-name: com.mysql.cj.jdbc.Driver
    type: com.alibaba.druid.pool.DruidDataSource
  redis: