yangbq пре 1 месец
родитељ
комит
ecf7556623

+ 5 - 0
pom.xml

@@ -102,6 +102,11 @@
             <version>3.0.5</version>
         </dependency>
         <dependency>
+            <groupId>cn.dev33</groupId>
+            <artifactId>sa-token-spring-boot-starter</artifactId>
+            <version>1.40.0</version>
+        </dependency>
+        <dependency>
             <groupId>com.belerweb</groupId>
             <artifactId>pinyin4j</artifactId>
             <version>2.5.1</version>

+ 26 - 0
src/main/java/com/project/zcustom/config/SaTokenConfigure.java

@@ -0,0 +1,26 @@
+package com.project.zcustom.config;
+
+import cn.dev33.satoken.interceptor.SaInterceptor;
+import cn.dev33.satoken.stp.StpUtil;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * @Description
+ * @Author bqyang
+ * @Date 2025/2/25 18:20
+ * @Version 1.0
+ */
+@Configuration
+public class SaTokenConfigure implements WebMvcConfigurer {
+
+    // 注册拦截器
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        // 注册 Sa-Token 拦截器,校验规则为 StpUtil.checkLogin() 登录校验。
+        registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin()))
+                .addPathPatterns("/**")
+                .excludePathPatterns("/user/doLogin");
+    }
+}

+ 0 - 24
src/main/java/com/project/zcustom/controller/core/Constants.java

@@ -113,29 +113,5 @@ public class Constants {
      */
     public static final String RESOURCE_PREFIX = "/profile";
 
-    /**
-     * RMI 远程方法调用
-     */
-    public static final String LOOKUP_RMI = "rmi:";
 
-    /**
-     * LDAP 远程方法调用
-     */
-    public static final String LOOKUP_LDAP = "ldap:";
-
-    /**
-     * LDAPS 远程方法调用
-     */
-    public static final String LOOKUP_LDAPS = "ldaps:";
-
-    /**
-     * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
-     */
-    public static final String[] JOB_WHITELIST_STR = {"com.project"};
-
-    /**
-     * 定时任务违规的字符
-     */
-    public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
-            "org.springframework", "org.apache", "com.project.common.utils.file"};
 }

+ 0 - 87
src/main/java/com/project/zcustom/controller/crontab/PlatCrontabTaskController.java

@@ -1,87 +0,0 @@
-package com.project.zcustom.controller.crontab;
-
-import com.project.zcustom.controller.core.BaseController;
-import com.project.zcustom.domain.basics.PlatAppOrg;
-import com.project.zcustom.service.basics.IPlatAppOrgService;
-import com.project.zcustom.tools.DataTools;
-import lombok.RequiredArgsConstructor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-
-/**
- *  定时任务控制器
- * @author change
- * @date 2024-04-07
- */
-@RequiredArgsConstructor(onConstructor_ = @Autowired)
-@RestController
-@Component("crontabTask")
-public class PlatCrontabTaskController extends BaseController {
-    private static final Logger logger = LoggerFactory.getLogger(PlatCrontabTaskController.class);
-    @Resource
-    private DataTools dataTools;
-    @Resource
-    private IPlatAppOrgService iPlatAppOrgService;
-
-    /**
-     * 定时任务 服务保障中心
-     * 每10分钟统计
-     */
-    public void serviceData() {
-        synchronized (this) {
-            logger.info("开始获取接口数据");
-//            dataTools.getServiceData("10001","测试");
-
-            List<PlatAppOrg> platAppOrgList = iPlatAppOrgService.selectPlatAppOrgList(new PlatAppOrg());
-            if(!platAppOrgList.isEmpty()){
-                for (PlatAppOrg platAppOrg : platAppOrgList){
-                    dataTools.getServiceData(platAppOrg.getAppOrg(),platAppOrg.getAppName());
-                }
-            }
-            logger.info("获取接口数据完成");
-        }
-    }
-
-    /**
-     * 定时任务 楼宇运行监控场景
-     * 每10分钟统计
-     */
-    public void buildData() {
-        synchronized (this) {
-            logger.info("开始楼宇运行获取接口数据");
-            dataTools.getEnergyData();
-            dataTools.getEnergyStatisticsData();
-            dataTools.getElectricityStatisticsData();
-            dataTools.getWaterData();
-            dataTools.getWaterStatisticsData();
-            dataTools.getPowerStatisticsData();
-            dataTools.getDataCenterRoom();
-            dataTools.getPowerForMonth();
-            dataTools.getOfficeCarbon();
-            dataTools.getUseHeatGas();
-            List<PlatAppOrg> platAppOrgList = iPlatAppOrgService.selectPlatAppOrgList(new PlatAppOrg());
-            if(!platAppOrgList.isEmpty()){
-                for (PlatAppOrg platAppOrg : platAppOrgList){
-                    dataTools.getCarbonData(platAppOrg.getAppOrg());
-                    dataTools.getNonHeatingData(platAppOrg.getAppOrg());
-                    dataTools.getUsePowerStatistics(platAppOrg.getAppOrg());
-                    dataTools.getHeatingEnergy(platAppOrg.getAppOrg());
-                    dataTools.getGasInfo(platAppOrg.getAppOrg());
-                    dataTools.getResourceInfo(platAppOrg.getAppOrg());
-                    dataTools.getGreenPowerInfo(platAppOrg.getAppOrg());
-                    dataTools.getOfficeCarbonForYear(platAppOrg.getAppOrg());
-                }
-            }
-            logger.info("楼宇运行获取接口数据完成");
-        }
-    }
-
-
-}

+ 8 - 24
src/main/java/com/project/zcustom/controller/service/PlatBasicsController.java

@@ -2,17 +2,19 @@ package com.project.zcustom.controller.service;
 
 import com.project.zcustom.controller.core.AjaxResult;
 import com.project.zcustom.controller.core.BaseController;
-import com.project.zcustom.domain.basics.PlatAppOrg;
 import com.project.zcustom.domain.basics.PlatBasics;
 import com.project.zcustom.domain.video.ZhhqLargeScreenUnit;
-import com.project.zcustom.service.basics.*;
+import com.project.zcustom.service.basics.IPlatAppOrgService;
+import com.project.zcustom.service.basics.IPlatBasicsCompanyService;
+import com.project.zcustom.service.basics.IPlatBasicsServerService;
+import com.project.zcustom.service.basics.IPlatBasicsService;
 import com.project.zcustom.service.video.IZhhqLargeScreenUnitService;
-import com.project.zcustom.tools.DataTools;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * 基础运行数据Controller
@@ -30,7 +32,6 @@ public class PlatBasicsController extends BaseController {
     private final IPlatBasicsServerService platBasicsServerService;
     private final IPlatAppOrgService iPlatAppOrgService;
     private final IZhhqLargeScreenUnitService iZhhqLargeScreenUnitService;
-    private final DataTools dataTools;
 
 
     @RequestMapping("/getOverviewData")
@@ -76,21 +77,4 @@ public class PlatBasicsController extends BaseController {
         return AjaxResult.success("新增成功", iZhhqLargeScreenUnitService.save(znhqLargeScreenUnit));
     }
 
-    @GetMapping("/testApi")
-    public AjaxResult testApi() {
-        synchronized (this) {
-            logger.info("开始获取接口数据");
-//            dataTools.getServiceData("1E001","国网晋城供电公司");
-
-            List<PlatAppOrg> platAppOrgList = iPlatAppOrgService.selectPlatAppOrgList(new PlatAppOrg());
-            if(!platAppOrgList.isEmpty()){
-                for (PlatAppOrg platAppOrg : platAppOrgList){
-                    dataTools.getServiceData(platAppOrg.getAppOrg(),platAppOrg.getAppName());
-                }
-            }
-            logger.info("获取接口数据完成");
-        }
-        return AjaxResult.success("查询成功", 1);
-    }
-
 }

+ 3 - 40
src/main/java/com/project/zcustom/controller/service/PlatBuildController.java

@@ -2,16 +2,14 @@ package com.project.zcustom.controller.service;
 
 import com.project.zcustom.controller.core.AjaxResult;
 import com.project.zcustom.controller.core.BaseController;
-import com.project.zcustom.domain.basics.PlatAppOrg;
 import com.project.zcustom.service.basics.IPlatAppOrgService;
 import com.project.zcustom.service.build.IPlatBuildParamsService;
 import com.project.zcustom.service.build.IPlatBuildYearTrendService;
-import com.project.zcustom.tools.DataTools;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * 楼宇接口Controller
@@ -24,7 +22,6 @@ import java.util.List;
 @RequiredArgsConstructor(onConstructor_ = @Autowired)
 public class PlatBuildController extends BaseController {
 
-    private final DataTools dataTools;
     private final IPlatBuildYearTrendService iPlatBuildYearTrendService;
     private final IPlatBuildParamsService iPlatBuildParamsService;
     private final IPlatAppOrgService iPlatAppOrgService;
@@ -120,38 +117,4 @@ public class PlatBuildController extends BaseController {
     public AjaxResult officeCarbonForFloor() {
         return AjaxResult.success("查询成功", iPlatBuildParamsService.selectPlatBuildParamsListByField("type","12"));
     }
-
-
-    @RequestMapping("/testApi")
-    public AjaxResult testApi() {
-        synchronized (this) {
-            logger.info("开始获取接口数据");
-            dataTools.getEnergyData();
-            dataTools.getEnergyStatisticsData();
-            dataTools.getElectricityStatisticsData();
-            dataTools.getWaterData();
-            dataTools.getWaterStatisticsData();
-            dataTools.getPowerStatisticsData();
-            dataTools.getDataCenterRoom();
-            dataTools.getPowerForMonth();
-            dataTools.getOfficeCarbon();
-            dataTools.getUseHeatGas();
-            List<PlatAppOrg> platAppOrgList = iPlatAppOrgService.selectPlatAppOrgList(new PlatAppOrg());
-            if(!platAppOrgList.isEmpty()){
-                for (PlatAppOrg platAppOrg : platAppOrgList){
-                    dataTools.getCarbonData(platAppOrg.getAppOrg());
-                    dataTools.getNonHeatingData(platAppOrg.getAppOrg());
-                    dataTools.getUsePowerStatistics(platAppOrg.getAppOrg());
-                    dataTools.getHeatingEnergy(platAppOrg.getAppOrg());
-                    dataTools.getGasInfo(platAppOrg.getAppOrg());
-                    dataTools.getResourceInfo(platAppOrg.getAppOrg());
-                    dataTools.getGreenPowerInfo(platAppOrg.getAppOrg());
-                    dataTools.getOfficeCarbonForYear(platAppOrg.getAppOrg());
-                }
-            }
-            logger.info("获取接口数据完成");
-        }
-        return AjaxResult.success("查询成功", 1);
-    }
-
 }

+ 26 - 0
src/main/java/com/project/zcustom/controller/system/LoginController.java

@@ -0,0 +1,26 @@
+package com.project.zcustom.controller.system;
+
+import cn.dev33.satoken.stp.StpUtil;
+import com.project.zcustom.controller.core.AjaxResult;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Description
+ * @Author bqyang
+ * @Date 2025/2/25 18:27
+ * @Version 1.0
+ */
+@RestController
+@RequestMapping("/user")
+public class LoginController {
+
+    @PostMapping("/doLogin")
+    public AjaxResult login(@RequestParam String username, @RequestParam String password) {
+        StpUtil.login(1);
+        String token = StpUtil.getTokenValue();
+        return AjaxResult.success(token);
+    }
+}

+ 20 - 0
src/main/java/com/project/zcustom/exception/GlobalExceptionHandler.java

@@ -0,0 +1,20 @@
+package com.project.zcustom.exception;
+
+import com.project.zcustom.controller.core.AjaxResult;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+/**
+ * @Description
+ * @Author bqyang
+ * @Date 2025/2/25 18:23
+ * @Version 1.0
+ */
+@RestControllerAdvice
+public class GlobalExceptionHandler {
+
+    @ExceptionHandler
+    public AjaxResult handlerException(Exception e) {
+        return AjaxResult.error(e.getMessage());
+    }
+}

+ 0 - 188
src/main/java/com/project/zcustom/tools/ApiUrlConfig.java

@@ -1,188 +0,0 @@
-package com.project.zcustom.tools;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-
-@Component
-@ConfigurationProperties(prefix = "apiurl")
-public class ApiUrlConfig {
-    // 服务保障中心接口地址
-    private static String serviceUrl;
-    public static String getServiceUrl() {
-        return serviceUrl;
-    }
-    public void setServiceUrl(String serviceUrl) {
-        ApiUrlConfig.serviceUrl = serviceUrl;
-    }
-
-    // 楼宇运行监控 接口前缀
-    private static String buildPrefix;
-    public static String getBuildPrefix() {
-        return buildPrefix;
-    }
-    public void setBuildPrefix(String buildPrefix) {
-        ApiUrlConfig.buildPrefix = buildPrefix;
-    }
-
-    // 楼宇运行监控 碳排放量月度变化趋势图接口
-    private static String buildCarbonEmissionStatistics;
-    public static String getBuildCarbonEmissionStatistics() {
-        return ApiUrlConfig.buildPrefix + buildCarbonEmissionStatistics;
-    }
-    public void setBuildCarbonEmissionStatistics(String buildCarbonEmissionStatistics) {
-        ApiUrlConfig.buildCarbonEmissionStatistics = buildCarbonEmissionStatistics;
-    }
-
-    // 办公能耗情况接口 年度累计综合能耗
-    private static String buildEnergyForYear;
-    public static String getBuildEnergyForYear() {
-        return ApiUrlConfig.buildPrefix + buildEnergyForYear;
-    }
-    public void setBuildEnergyForYear(String buildEnergyForYear) {
-        ApiUrlConfig.buildEnergyForYear = buildEnergyForYear;
-    }
-
-    // 办公能耗情况接口 年度综合能耗趋势接口
-    private static String buildEnergyStatistics;
-    public static String getBuildEnergyStatistics() {
-        return ApiUrlConfig.buildPrefix + buildEnergyStatistics;
-    }
-    public void setBuildEnergyStatistics(String buildEnergyStatistics) {
-        ApiUrlConfig.buildEnergyStatistics = buildEnergyStatistics;
-    }
-
-    // 办公能耗情况接口 年度累计电耗接口
-    private static String buildPowerForYear;
-    public static String getBuildPowerForYear() {
-        return ApiUrlConfig.buildPrefix + buildPowerForYear;
-    }
-    public void setBuildPowerForYear(String buildPowerForYear) {
-        ApiUrlConfig.buildPowerForYear = buildPowerForYear;
-    }
-
-    // 办公能耗情况接口 年度电耗趋势接口
-    private static String buildElectricityStatistics;
-    public static String getBuildElectricityStatistics() {
-        return ApiUrlConfig.buildPrefix + buildElectricityStatistics;
-    }
-    public void setBuildElectricityStatistics(String buildElectricityStatistics) {
-        ApiUrlConfig.buildElectricityStatistics = buildElectricityStatistics;
-    }
-
-    // 办公能耗情况接口 年度累计水耗接口
-    private static String buildWaterForYear;
-    public static String getBuildWaterForYear() {
-        return ApiUrlConfig.buildPrefix + buildWaterForYear;
-    }
-    public void setBuildWaterForYear(String buildWaterForYear) {
-        ApiUrlConfig.buildWaterForYear = buildWaterForYear;
-    }
-
-    // 办公能耗情况接口 年度水耗趋势接口
-    private static String buildWaterStatistics;
-    public static String getBuildWaterStatistics() {
-        return ApiUrlConfig.buildPrefix + buildWaterStatistics;
-    }
-    public void setBuildWaterStatistics(String buildWaterStatistics) {
-        ApiUrlConfig.buildWaterStatistics = buildWaterStatistics;
-    }
-
-    // 办公能耗情况接口 年度累计非供暖能耗接口
-    private static String buildNonHeatingEnergyForYear;
-    public static String getBuildNonHeatingEnergyForYear() {
-        return ApiUrlConfig.buildPrefix + buildNonHeatingEnergyForYear;
-    }
-    public void setBuildNonHeatingEnergyForYear(String buildNonHeatingEnergyForYear) {
-        ApiUrlConfig.buildNonHeatingEnergyForYear = buildNonHeatingEnergyForYear;
-    }
-
-    // 办公能耗情况接口 年度非供暖能耗趋势接口
-    private static String buildUsePowerStatistics;
-    public static String getBuildUsePowerStatistics() {
-        return ApiUrlConfig.buildPrefix + buildUsePowerStatistics;
-    }
-    public void setBuildUsePowerStatistics(String buildUsePowerStatistics) {
-        ApiUrlConfig.buildUsePowerStatistics = buildUsePowerStatistics;
-    }
-
-    // 办公能耗情况接口 月用电量信息接口
-    private static String buildPowerForMonth;
-    public static String getBuildPowerForMonth() {
-        return ApiUrlConfig.buildPrefix + buildPowerForMonth;
-    }
-    public void setBuildPowerForMonth(String buildPowerForMonth) {
-        ApiUrlConfig.buildPowerForMonth = buildPowerForMonth;
-    }
-
-    // 办公能耗情况接口 楼宇月用水电热信息接口
-    private static String buildUseHeatGas;
-    public static String getBuildUseHeatGas() {
-        return ApiUrlConfig.buildPrefix + buildUseHeatGas;
-    }
-    public void setBuildUseHeatGas(String buildUseHeatGas) {
-        ApiUrlConfig.buildUseHeatGas = buildUseHeatGas;
-    }
-
-    // 数据中心机房信息接口
-    private static String buildDataCenterRoom;
-    public static String getBuildDataCenterRoom() {
-        return ApiUrlConfig.buildPrefix + buildDataCenterRoom;
-    }
-    public void setBuildDataCenterRoom(String buildDataCenterRoom) {
-        ApiUrlConfig.buildDataCenterRoom = buildDataCenterRoom;
-    }
-
-    // 供暖能耗信息接口
-    private static String buildHeatingEnergy;
-    public static String getBuildHeatingEnergy() {
-        return ApiUrlConfig.buildPrefix + buildHeatingEnergy;
-    }
-    public void setBuildHeatingEnergy(String buildHeatingEnergy) {
-        ApiUrlConfig.buildHeatingEnergy = buildHeatingEnergy;
-    }
-
-    // 燃气用量信息接口
-    private static String buildGasInfo;
-    public static String getBuildGasInfo() {
-        return ApiUrlConfig.buildPrefix + buildGasInfo;
-    }
-    public void setBuildGasInfo(String buildGasInfo) {
-        ApiUrlConfig.buildGasInfo = buildGasInfo;
-    }
-
-    // 资源信息接口
-    private static String buildResourceInfo;
-    public static String getBuildResourceInfo() {
-        return ApiUrlConfig.buildPrefix + buildResourceInfo;
-    }
-    public void setBuildResourceInfo(String buildResourceInfo) {
-        ApiUrlConfig.buildResourceInfo = buildResourceInfo;
-    }
-
-    // 可再生电力信息接口
-    private static String buildGreenPowerInfo;
-    public static String getBuildGreenPowerInfo() {
-        return ApiUrlConfig.buildPrefix + buildGreenPowerInfo;
-    }
-    public void setBuildGreenPowerInfo(String buildGreenPowerInfo) {
-        ApiUrlConfig.buildGreenPowerInfo = buildGreenPowerInfo;
-    }
-
-    // 办公碳排放情况接口
-    private static String buildOfficeCarbonForYear;
-    public static String getBuildOfficeCarbonForYear() {
-        return ApiUrlConfig.buildPrefix + buildOfficeCarbonForYear;
-    }
-    public void setBuildOfficeCarbonForYear(String buildOfficeCarbonForYear) {
-        ApiUrlConfig.buildOfficeCarbonForYear = buildOfficeCarbonForYear;
-    }
-
-    // 各单位年度累计办公碳排放量统计接口
-    private static String buildOfficeCarbonForFloor;
-    public static String getBuildOfficeCarbonForFloor() {
-        return ApiUrlConfig.buildPrefix + buildOfficeCarbonForFloor;
-    }
-    public void setBuildOfficeCarbonForFloor(String buildOfficeCarbonForFloor) {
-        ApiUrlConfig.buildOfficeCarbonForFloor = buildOfficeCarbonForFloor;
-    }
-}

+ 0 - 702
src/main/java/com/project/zcustom/tools/DataTools.java

@@ -1,702 +0,0 @@
-package com.project.zcustom.tools;
-
-
-import com.alibaba.fastjson2.JSONArray;
-import com.alibaba.fastjson2.JSONObject;
-import com.project.zcustom.controller.core.HttpUtils;
-import com.project.zcustom.controller.core.StringUtils;
-import com.project.zcustom.domain.build.PlatBuildParams;
-import com.project.zcustom.domain.build.PlatBuildYearTrend;
-import com.project.zcustom.domain.plat.PlatApiRecord;
-import com.project.zcustom.mapper.plat.PlatApiRecordMapper;
-import com.project.zcustom.service.access.IPlatAccessService;
-import com.project.zcustom.service.basics.IPlatBasicsService;
-import com.project.zcustom.service.build.IPlatBuildParamsService;
-import com.project.zcustom.service.build.IPlatBuildYearTrendService;
-import com.project.zcustom.service.employee.IPlatEmployeeHealthService;
-import com.project.zcustom.service.employee.IPlatEmployeeTypeService;
-import com.project.zcustom.service.plat.IPlatApiRecordService;
-import com.project.zcustom.service.post.IPlatPostStationService;
-import com.project.zcustom.service.property.IPlatPropertyService;
-import com.project.zcustom.service.smart.IPlatGreenSmartOtherService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
-
-/**
- * 数据获取
- *
- * @author change
- * @date 2024-10-21
- */
-@Service
-public class DataTools {
-    private static final Logger log = LoggerFactory.getLogger(DataTools.class);
-
-    @Resource
-    IPlatEmployeeTypeService platEmployeeTypeService;
-    @Resource
-    IPlatEmployeeHealthService platEmployeeHealthService;
-    @Resource
-    IPlatBasicsService platBasicsService;
-    @Resource
-    IPlatPostStationService postStationService;
-    @Resource
-    IPlatPropertyService platPropertyService;
-    @Resource
-    IPlatGreenSmartOtherService iPlatGreenSmartOtherService;
-    @Resource
-    IPlatAccessService iPlatAccessService;
-    @Resource
-    IPlatApiRecordService iPlatApiRecordService;
-    @Resource
-    IPlatBuildYearTrendService iPlatBuildYearTrendService;
-    @Resource
-    IPlatBuildParamsService iPlatBuildParamsService;
-    @Resource
-    PlatApiRecordMapper platApiRecordMapper;
-
-
-    /**
-     * 获取服务保障中心的数据
-     */
-    public void getServiceData(String appOrg, String appName) {
-        String url = ApiUrlConfig.getServiceUrl();
-        System.out.printf("------------服务保障中心:%s", url);
-        JSONObject params = new JSONObject();
-        params.put("appOrg", appOrg);
-        String result = HttpUtils.sendPost(url, params.toJSONString());
-        log.info("result======================{}",result);
-        log.info("url======================{}",url);
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg(appOrg);
-        log.info("platApiRecord======================{}",platApiRecord);
-        log.info("start++++++++++++++++++++++++++++++++");
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-        log.info("end++++++++++++++++++++++++++++++++");
-
-        System.out.printf("------------接口返回:%s", result);
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("entity")) {
-                JSONArray data = JSONArray.parseArray(resultMap.get("entity").toString());
-                for (Object o : data) {
-                    Map<String, Object> temp = JSONObject.parseObject(o.toString(), Map.class);
-                    if (temp.containsKey("dataType")) {
-                        if (temp.containsKey("dataResult")) {
-                            Map<String, Object> dataResult = JSONObject.parseObject(temp.get("dataResult").toString(), Map.class);
-                            if (Objects.equals(temp.get("dataType").toString(), "employeeType")) {
-                                platEmployeeTypeService.addPlatEmployeeType(appOrg, dataResult);
-                            } else if (Objects.equals(temp.get("dataType").toString(), "employeeHealth")) {
-                                platEmployeeHealthService.addPlatEmployeeHealth(appOrg, dataResult);
-                            } else if (Objects.equals(temp.get("dataType").toString(), "greenSmart")) {
-                                iPlatGreenSmartOtherService.addPlatGreenSmartOther(appOrg, dataResult);
-                            } else if (Objects.equals(temp.get("dataType").toString(), "postStation")) {
-                                postStationService.addPlatPostStation(appOrg, dataResult);
-                            } else if (Objects.equals(temp.get("dataType").toString(), "property")) {
-                                platPropertyService.addPlatProperty(appOrg, dataResult);
-                            } else if (Objects.equals(temp.get("dataType").toString(), "basics")) {
-                                platBasicsService.addPlatBasics(appOrg, appName, dataResult);
-                            } else if (Objects.equals(temp.get("dataType").toString(), "access")) {
-                                iPlatAccessService.addPlatAccess(appOrg, dataResult);
-                            }
-                        }
-                    }
-                }
-            } else {
-                throw new RuntimeException("接口返回失败:" + result);
-            }
-        } else {
-            throw new RuntimeException("接口请求失败:" + result);
-        }
-    }
-
-    /**
-     * 碳排放量月度变化趋势图接口
-     */
-    public void getCarbonData(String appOrg) {
-        String url = ApiUrlConfig.getBuildCarbonEmissionStatistics();
-//        String params = "startTime=''&endTime=''";
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg(appOrg);
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-
-        System.out.printf("------------接口返回:%s", result);
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("key", "value", "value1", "title", "title1");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildYearTrend platBuildYearTrend = new PlatBuildYearTrend();
-                        iPlatBuildYearTrendService.setBuildYearTrendData(platBuildYearTrend,keyList,map,0,"");
-                        iPlatBuildYearTrendService.addPlatBuildYearTrend(platBuildYearTrend,"");
-                    }
-                }
-            }
-        }
-
-    }
-
-    /**
-     * 年度累计综合能耗
-     */
-    public void getEnergyData() {
-        String url = ApiUrlConfig.getBuildEnergyForYear();
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg("");
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-
-        System.out.printf("------------接口返回:%s", result);
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                Map<String, Object> mapData = JSONObject.parseObject(resultMap.get("data").toString(), Map.class);
-                PlatBuildParams platBuildParams = new PlatBuildParams();
-                List<String> keyList = Arrays.asList("name","key","value","value1","value2","value3");
-                iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,mapData,0,"");
-                iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-            }
-        }
-    }
-
-    /**
-     * 年度综合能耗趋势接口
-     */
-    public void getEnergyStatisticsData() {
-        String url = ApiUrlConfig.getBuildEnergyStatistics();
-        //        String params = "startTime=''&endTime=''";
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg("");
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("key", "value", "value1", "title", "title1");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildYearTrend platBuildYearTrend = new PlatBuildYearTrend();
-                        iPlatBuildYearTrendService.setBuildYearTrendData(platBuildYearTrend,keyList,map,1,"");
-                        iPlatBuildYearTrendService.addPlatBuildYearTrend(platBuildYearTrend,"");
-                    }
-                }
-            }
-        }
-        System.out.printf("------------接口返回:%s", result);
-    }
-
-
-    /**
-     * 年度累计电耗接口
-     */
-    public void getPowerStatisticsData() {
-        String url = ApiUrlConfig.getBuildPowerForYear();
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg("");
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-
-        System.out.printf("------------接口返回:%s", result);
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("name","key","value","value1","value2","value3");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildParams platBuildParams = new PlatBuildParams();
-                        iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,map,1,"");
-                        iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * 年度电耗趋势接口
-     */
-    public void getElectricityStatisticsData() {
-        String url = ApiUrlConfig.getBuildElectricityStatistics();
-        //        String params = "startTime=''&endTime=''";
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg("");
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-
-        System.out.printf("------------接口返回:%s", result);
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("key", "value", "value1", "title", "title1");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildYearTrend platBuildYearTrend = new PlatBuildYearTrend();
-                        iPlatBuildYearTrendService.setBuildYearTrendData(platBuildYearTrend,keyList,map,2,"");
-                        iPlatBuildYearTrendService.addPlatBuildYearTrend(platBuildYearTrend,"");
-                    }
-                }
-            }
-        }
-    }
-
-
-    /**
-     * 年度累计水耗接口
-     */
-    public void getWaterData() {
-        String url = ApiUrlConfig.getBuildWaterForYear();
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg("");
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                Map<String, Object> mapData = JSONObject.parseObject(resultMap.get("data").toString(), Map.class);
-                PlatBuildParams platBuildParams = new PlatBuildParams();
-                List<String> keyList = Arrays.asList("name","key","value","value1","value2","value3");
-                iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,mapData,2,"");
-                iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-
-            }
-        }
-    }
-
-    /**
-     * 年度水耗趋势接口
-     */
-    public void getWaterStatisticsData() {
-        String url = ApiUrlConfig.getBuildWaterStatistics();
-        //        String params = "startTime=''&endTime=''";
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg("");
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("key", "value", "value1", "title", "title1");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildYearTrend platBuildYearTrend = new PlatBuildYearTrend();
-                        iPlatBuildYearTrendService.setBuildYearTrendData(platBuildYearTrend,keyList,map,3,"");
-                        iPlatBuildYearTrendService.addPlatBuildYearTrend(platBuildYearTrend,"");
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * 年度累计非供暖能耗接口
-     */
-    public void getNonHeatingData(String appOrg) {
-        String url = ApiUrlConfig.getBuildNonHeatingEnergyForYear();
-        String params = "appOrg=" + appOrg;
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg(appOrg);
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                Map<String, Object> mapData = JSONObject.parseObject(resultMap.get("data").toString(), Map.class);
-                PlatBuildParams platBuildParams = new PlatBuildParams();
-                List<String> keyList = Arrays.asList("name","key","num","value1","value2","value3");
-                iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,mapData,0,"");
-                iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-            }
-        }
-
-    }
-
-    /**
-     * 年度非供暖能耗趋势接口
-     */
-    public void getUsePowerStatistics(String appOrg) {
-        String url = ApiUrlConfig.getBuildUsePowerStatistics();
-        String params = "appOrg=" + appOrg;
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg(appOrg);
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("key", "value", "value1", "title", "title1");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildYearTrend platBuildYearTrend = new PlatBuildYearTrend();
-                        iPlatBuildYearTrendService.setBuildYearTrendData(platBuildYearTrend,keyList,map,4,"");
-                        iPlatBuildYearTrendService.addPlatBuildYearTrend(platBuildYearTrend,"");
-                    }
-                }
-            }
-        }
-    }
-
-
-    /**
-     * 月用电量信息接口
-     */
-    public void getPowerForMonth() {
-        String url = ApiUrlConfig.getBuildPowerForMonth();
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-
-       // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg("");
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("name","key","value","value1","value2","value3");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildParams platBuildParams = new PlatBuildParams();
-                        iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,map,4,"");
-                        iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * 楼宇月用水电热信息接口
-     */
-    public void getUseHeatGas() {
-        String url = ApiUrlConfig.getBuildUseHeatGas();
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg("");
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("name","key","num","value1","value2","value3");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildParams platBuildParams = new PlatBuildParams();
-                        iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,map,5,"");
-                        iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * 数据中心机房信息接口
-     */
-    public void getDataCenterRoom() {
-        String url = ApiUrlConfig.getBuildDataCenterRoom();
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg("");
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("name","key","num","value1","value2","value3");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildParams platBuildParams = new PlatBuildParams();
-                        iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,map,6,"");
-                        iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * 供暖能耗信息接口
-     */
-    public void getHeatingEnergy(String appOrg) {
-        String url = ApiUrlConfig.getBuildHeatingEnergy();
-        String params = "appOrg=" + appOrg;
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg(appOrg);
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("name","key","num","value1","value2","value3");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildParams platBuildParams = new PlatBuildParams();
-                        iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,map,7,"");
-                        iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * 燃气用量信息接口
-     */
-    public void getGasInfo(String appOrg) {
-        String url = ApiUrlConfig.getBuildGasInfo();
-        String params = "appOrg=" + appOrg;
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg(appOrg);
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("name","key","num","value1","value2","value3");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildParams platBuildParams = new PlatBuildParams();
-                        iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,map,8,"");
-                        iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * 资源信息接口
-     */
-    public void getResourceInfo(String appOrg) {
-        String url = ApiUrlConfig.getBuildResourceInfo();
-        String params = "appOrg=" + appOrg;
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg(appOrg);
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("name","key","num","value1","value2","value3");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildParams platBuildParams = new PlatBuildParams();
-                        iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,map,9,"");
-                        iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * 可再生电力信息接口
-     */
-    public void getGreenPowerInfo(String appOrg) {
-        String url = ApiUrlConfig.getBuildGreenPowerInfo();
-        String params = "appOrg=" + appOrg;
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg(appOrg);
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("name","key","num","value1","value2","value3");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildParams platBuildParams = new PlatBuildParams();
-                        iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,map,10,"");
-                        iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-                    }
-                }
-            }
-        }
-    }
-
-
-    /**
-     * 办公碳排放情况
-     */
-    public void getOfficeCarbonForYear(String appOrg) {
-        String url = ApiUrlConfig.getBuildOfficeCarbonForYear();
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-
-       // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg(appOrg);
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-        System.out.printf("------------接口返回:%s", result);
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                Map<String, Object> mapData = JSONObject.parseObject(resultMap.get("data").toString(), Map.class);
-                PlatBuildParams platBuildParams = new PlatBuildParams();
-                List<String> keyList = Arrays.asList("name","key","value","value1","value2","value3");
-                iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,mapData,11,"");
-                iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-
-            }
-        }
-    }
-
-
-    /**
-     * 各单位年度累计办公碳排放量统计接口
-     */
-    public void getOfficeCarbon() {
-        String url = ApiUrlConfig.getBuildOfficeCarbonForFloor();
-        String params = "";
-        String result = HttpUtils.sendGet(url, params);
-
-        // 添加接口请求记录
-        PlatApiRecord platApiRecord = new PlatApiRecord();
-        platApiRecord.setApiUrl(url);
-        platApiRecord.setApiResult(result);
-        platApiRecord.setAppOrg("");
-        platApiRecordMapper.insertPlatApiRecord(platApiRecord);
-        System.out.printf("------------接口返回:%s", result);
-
-        if (StringUtils.isNotBlank(result)) {
-            Map<String, Object> resultMap = JSONObject.parseObject(result, Map.class);
-            if (Objects.equals(resultMap.get("code").toString(), "200") && resultMap.containsKey("data")) {
-                List<Map<String, Object>> dataList = StringUtils.getListMap(resultMap.get("data").toString());
-                if (!dataList.isEmpty()) {
-                    List<String> keyList = Arrays.asList("name","key","num","value1","value2","value3");
-                    for (Map<String, Object> map : dataList) {
-                        PlatBuildParams platBuildParams = new PlatBuildParams();
-                        iPlatBuildParamsService.setBuildParamsData(platBuildParams,keyList,map,12,"");
-                        iPlatBuildParamsService.addPlatBuildParams(platBuildParams,"");
-                    }
-                }
-            }
-        }
-    }
-
-
-}

+ 3 - 46
src/main/resources/application-dev.yml

@@ -1,46 +1,3 @@
-# 接口地址配置
-apiurl:
-  # 服务保障中心接口地址
-  #serviceUrl: http://25.39.79.244:18080/zhhq_app/zhhq_large_screen/queryByAppOrg
-  serviceUrl: http://192.168.1.189/fxkj/php/public/home/Wechat/test
-  # 楼宇运行监控 接口前缀
-  buildPrefix: http://192.168.1.74:6789/psbims/office/energy/
-  # 楼宇运行监控 碳排放量月度变化趋势图接口
-  buildCarbonEmissionStatistics: carbonEmissionStatistics
-  # 办公能耗情况接口 年度累计综合能耗
-  buildEnergyForYear: energyForYear
-  # 办公能耗情况接口 年度综合能耗趋势接口
-  buildEnergyStatistics: energyStatistics
-  # 办公能耗情况接口 年度累计电耗接口
-  buildPowerForYear: powerForYear
-  # 办公能耗情况接口 年度电耗趋势接口
-  buildElectricityStatistics: electricityStatistics
-  # 办公能耗情况接口 年度累计水耗接口
-  buildWaterForYear: waterForYear
-  # 办公能耗情况接口 年度水耗趋势接口
-  buildWaterStatistics: waterStatistics
-  # 办公能耗情况接口 年度累计非供暖能耗接口
-  buildNonHeatingEnergyForYear: nonHeatingEnergyForYear
-  # 办公能耗情况接口 年度非供暖能耗趋势接口
-  buildUsePowerStatistics: usePowerStatistics
-  # 办公能耗情况接口 月用电量信息接口
-  buildPowerForMonth: powerForMonth
-  # 办公能耗情况接口 楼宇月用水电热信息接口
-  buildUseHeatGas: useHeatGas
-  # 数据中心机房信息接口
-  buildDataCenterRoom: dataCenterRoom
-  # 供暖能耗信息接口
-  buildHeatingEnergy: heatingEnergy
-  # 燃气用量信息接口
-  buildGasInfo: gasInfo
-  # 资源信息接口
-  buildResourceInfo: resourceInfo
-  # 可再生电力信息接口
-  buildGreenPowerInfo: greenPowerInfo
-  # 办公碳排放情况接口
-  buildOfficeCarbonForYear: officeCarbonForYear
-  # 各单位年度累计办公碳排放量统计接口
-  buildOfficeCarbonForFloor: officeCarbonForFloor
 server:
   port: 8080
   servlet:
@@ -48,9 +5,9 @@ server:
 spring:
   datasource:
     driverClassName: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://192.168.1.200:3306/24_sxgw?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
-    username: ENC(bab7d1d874c1cae4ea48b01fb6843e09)
-    password: ENC(0c52b0f8c04d702fa6e78bff3bcf1af7)
+    url: jdbc:mysql://127.0.0.1:3306/sxgw?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
+    username: root
+    password: 1qaz2wsx
   jackson:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8

+ 0 - 43
src/main/resources/application-pad.yml

@@ -1,46 +1,3 @@
-# 接口地址配置
-apiurl:
-  # 服务保障中心接口地址
-  #serviceUrl: http://25.39.79.244:18080/zhhq_app/zhhq_large_screen/queryByAppOrg
-  serviceUrl: http://172.20.52.31:18080/zhhq_api/zhhq_large_screen/queryByAppOrg
-  # 楼宇运行监控 接口前缀
-  buildPrefix: http://25.39.67.168:10611/psbims/office/energy/
-  # 楼宇运行监控 碳排放量月度变化趋势图接口
-  buildCarbonEmissionStatistics: carbonEmissionStatistics
-  # 办公能耗情况接口 年度累计综合能耗
-  buildEnergyForYear: energyForYear
-  # 办公能耗情况接口 年度综合能耗趋势接口
-  buildEnergyStatistics: energyStatistics
-  # 办公能耗情况接口 年度累计电耗接口
-  buildPowerForYear: powerForYear
-  # 办公能耗情况接口 年度电耗趋势接口
-  buildElectricityStatistics: electricityStatistics
-  # 办公能耗情况接口 年度累计水耗接口
-  buildWaterForYear: waterForYear
-  # 办公能耗情况接口 年度水耗趋势接口
-  buildWaterStatistics: waterStatistics
-  # 办公能耗情况接口 年度累计非供暖能耗接口
-  buildNonHeatingEnergyForYear: nonHeatingEnergyForYear
-  # 办公能耗情况接口 年度非供暖能耗趋势接口
-  buildUsePowerStatistics: usePowerStatistics
-  # 办公能耗情况接口 月用电量信息接口
-  buildPowerForMonth: powerForMonth
-  # 办公能耗情况接口 楼宇月用水电热信息接口
-  buildUseHeatGas: useHeatGas
-  # 数据中心机房信息接口
-  buildDataCenterRoom: dataCenterRoom
-  # 供暖能耗信息接口
-  buildHeatingEnergy: heatingEnergy
-  # 燃气用量信息接口
-  buildGasInfo: gasInfo
-  # 资源信息接口
-  buildResourceInfo: resourceInfo
-  # 可再生电力信息接口
-  buildGreenPowerInfo: greenPowerInfo
-  # 办公碳排放情况接口
-  buildOfficeCarbonForYear: officeCarbonForYear
-  # 各单位年度累计办公碳排放量统计接口
-  buildOfficeCarbonForFloor: officeCarbonForFloor
 server:
   port: 19901
   servlet:

+ 18 - 1
src/main/resources/application.yml

@@ -1,3 +1,20 @@
 spring:
   profiles:
-    active: dev
+    active: dev
+
+############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
+sa-token:
+  # token 名称(同时也是 cookie 名称)
+  token-name: satoken
+  # token 有效期(单位:秒) 默认30天,-1 代表永久有效
+  timeout: 2592000
+  # token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
+  active-timeout: -1
+  # 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
+  is-concurrent: true
+  # 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
+  is-share: true
+  # token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik)
+  token-style: simple-uuid
+  # 是否输出操作日志
+  is-log: true