From 4a5064d82d0949e6a6f530e90fab1c0fbaca80b5 Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Thu, 18 Dec 2025 17:26:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=85=E5=A4=B4=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=8E=BB=E6=8E=89=E5=A4=A9=E6=B0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AirQualityAnalysisController.java | 14 ++++++++++---- .../controller/RainBigScreenController.java | 8 +++++++- .../worker/service/impl/WorkerInfoServiceImpl.java | 2 +- src/main/resources/application.properties | 1 + 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/zhgd/xmgl/modules/environment/controller/AirQualityAnalysisController.java b/src/main/java/com/zhgd/xmgl/modules/environment/controller/AirQualityAnalysisController.java index 3e3a0b9ad..6b27a1353 100644 --- a/src/main/java/com/zhgd/xmgl/modules/environment/controller/AirQualityAnalysisController.java +++ b/src/main/java/com/zhgd/xmgl/modules/environment/controller/AirQualityAnalysisController.java @@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.MapUtils; import com.gexin.fastjson.JSONObject; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; /** @@ -37,7 +39,8 @@ import java.util.Map; public class AirQualityAnalysisController { @Autowired private IAirQualityAnalysisService airQualityAnalysisService; - + @Value("${enableTianqi:0}") + private Integer enableTianqi; /** * 添加 @@ -61,7 +64,6 @@ public class AirQualityAnalysisController { return result; } - /** * 通过id查询 * @@ -78,7 +80,6 @@ public class AirQualityAnalysisController { return Result.success(airQualityAnalysis); } - @ApiOperation(value = "当天空气质量统计", notes = "当天空气质量统计", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"), @@ -90,7 +91,6 @@ public class AirQualityAnalysisController { return Result.success(list); } - @ApiOperation(value = "查询天气-周", notes = "查询天气-周", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "cityid", value = "市区编码", paramType = "body", required = false, dataType = "String"), @@ -98,6 +98,9 @@ public class AirQualityAnalysisController { }) @PostMapping(value = "/getWeatherData") public Result getWeatherData(@RequestBody Map map) { + if (Objects.equals(enableTianqi, 0)) { + return Result.ok(); + } return Result.success(airQualityAnalysisService.getWeatherData(map)); } @@ -107,6 +110,9 @@ public class AirQualityAnalysisController { }) @PostMapping(value = "/getWeatherLiveData") public Result getWeatherLiveData(@RequestBody Map map) { + if (Objects.equals(enableTianqi, 0)) { + return Result.ok(); + } return Result.success(airQualityAnalysisService.getWeatherLiveData(MapUtils.getString(map, "cityid"))); } diff --git a/src/main/java/com/zhgd/xmgl/modules/environment/controller/RainBigScreenController.java b/src/main/java/com/zhgd/xmgl/modules/environment/controller/RainBigScreenController.java index 00456da2f..0538ad2ec 100644 --- a/src/main/java/com/zhgd/xmgl/modules/environment/controller/RainBigScreenController.java +++ b/src/main/java/com/zhgd/xmgl/modules/environment/controller/RainBigScreenController.java @@ -15,6 +15,7 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -23,6 +24,7 @@ import springfox.documentation.annotations.ApiIgnore; import java.util.List; import java.util.Map; +import java.util.Objects; @RestController @RequestMapping("/xmgl/rainBigScreen") @@ -37,6 +39,8 @@ public class RainBigScreenController { private IRainAlarmService rainAlarmService; @Autowired private IAirQualityAnalysisService airQualityAnalysisService; + @Value("${enableTianqi:0}") + private Integer enableTianqi; /** * 通过id查询 @@ -54,7 +58,6 @@ public class RainBigScreenController { return Result.success(airQualityAnalysis); } - @ApiOperation(value = "当天空气质量统计", notes = "当天空气质量统计", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"), @@ -73,6 +76,9 @@ public class RainBigScreenController { }) @PostMapping(value = "/getWeatherData") public Result getWeatherData(@RequestBody Map map) { + if (Objects.equals(enableTianqi, 0)) { + return Result.ok(); + } return Result.success(airQualityAnalysisService.getWeatherData(map)); } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerInfoServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerInfoServiceImpl.java index e3ccd3ad1..a5d8aaf6f 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerInfoServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerInfoServiceImpl.java @@ -326,7 +326,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl selectWorkerInfoList(Map map) { int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString()); - int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10000).toString()); + int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 50000).toString()); map.put("workerInfoGreenScore", PropertiesUtil.getWorkerInfoGreenScore()); map.put("workerInfoRedScore", PropertiesUtil.getWorkerInfoRedScore()); if (SecurityUtils.getUser() != null) { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index c8245976e..4eadf3008 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -219,3 +219,4 @@ h5.exam.url=http://192.168.34.133:20626/#/pages/personLocation/login/login?examP facePass=1 #logback-spring.xml指定配置路径 #logging.config=/root/java/logback-spring.xml +enableTianqi=0