包头修改配置去掉天气

This commit is contained in:
guoshengxiong 2025-12-18 17:26:40 +08:00
parent c89c0dd3d6
commit 4a5064d82d
4 changed files with 19 additions and 6 deletions

View File

@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import com.gexin.fastjson.JSONObject; import com.gexin.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; 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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; 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.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
/** /**
@ -37,7 +39,8 @@ import java.util.Map;
public class AirQualityAnalysisController { public class AirQualityAnalysisController {
@Autowired @Autowired
private IAirQualityAnalysisService airQualityAnalysisService; private IAirQualityAnalysisService airQualityAnalysisService;
@Value("${enableTianqi:0}")
private Integer enableTianqi;
/** /**
* 添加 * 添加
@ -61,7 +64,6 @@ public class AirQualityAnalysisController {
return result; return result;
} }
/** /**
* 通过id查询 * 通过id查询
* *
@ -78,7 +80,6 @@ public class AirQualityAnalysisController {
return Result.success(airQualityAnalysis); return Result.success(airQualityAnalysis);
} }
@ApiOperation(value = "当天空气质量统计", notes = "当天空气质量统计", httpMethod = "POST") @ApiOperation(value = "当天空气质量统计", notes = "当天空气质量统计", httpMethod = "POST")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"), @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ -90,7 +91,6 @@ public class AirQualityAnalysisController {
return Result.success(list); return Result.success(list);
} }
@ApiOperation(value = "查询天气-周", notes = "查询天气-周", httpMethod = "POST") @ApiOperation(value = "查询天气-周", notes = "查询天气-周", httpMethod = "POST")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "cityid", value = "市区编码", paramType = "body", required = false, dataType = "String"), @ApiImplicitParam(name = "cityid", value = "市区编码", paramType = "body", required = false, dataType = "String"),
@ -98,6 +98,9 @@ public class AirQualityAnalysisController {
}) })
@PostMapping(value = "/getWeatherData") @PostMapping(value = "/getWeatherData")
public Result<String> getWeatherData(@RequestBody Map<String, Object> map) { public Result<String> getWeatherData(@RequestBody Map<String, Object> map) {
if (Objects.equals(enableTianqi, 0)) {
return Result.ok();
}
return Result.success(airQualityAnalysisService.getWeatherData(map)); return Result.success(airQualityAnalysisService.getWeatherData(map));
} }
@ -107,6 +110,9 @@ public class AirQualityAnalysisController {
}) })
@PostMapping(value = "/getWeatherLiveData") @PostMapping(value = "/getWeatherLiveData")
public Result<Object> getWeatherLiveData(@RequestBody Map<String, Object> map) { public Result<Object> getWeatherLiveData(@RequestBody Map<String, Object> map) {
if (Objects.equals(enableTianqi, 0)) {
return Result.ok();
}
return Result.success(airQualityAnalysisService.getWeatherLiveData(MapUtils.getString(map, "cityid"))); return Result.success(airQualityAnalysisService.getWeatherLiveData(MapUtils.getString(map, "cityid")));
} }

View File

@ -15,6 +15,7 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; 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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -23,6 +24,7 @@ import springfox.documentation.annotations.ApiIgnore;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
@RestController @RestController
@RequestMapping("/xmgl/rainBigScreen") @RequestMapping("/xmgl/rainBigScreen")
@ -37,6 +39,8 @@ public class RainBigScreenController {
private IRainAlarmService rainAlarmService; private IRainAlarmService rainAlarmService;
@Autowired @Autowired
private IAirQualityAnalysisService airQualityAnalysisService; private IAirQualityAnalysisService airQualityAnalysisService;
@Value("${enableTianqi:0}")
private Integer enableTianqi;
/** /**
* 通过id查询 * 通过id查询
@ -54,7 +58,6 @@ public class RainBigScreenController {
return Result.success(airQualityAnalysis); return Result.success(airQualityAnalysis);
} }
@ApiOperation(value = "当天空气质量统计", notes = "当天空气质量统计", httpMethod = "POST") @ApiOperation(value = "当天空气质量统计", notes = "当天空气质量统计", httpMethod = "POST")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"), @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ -73,6 +76,9 @@ public class RainBigScreenController {
}) })
@PostMapping(value = "/getWeatherData") @PostMapping(value = "/getWeatherData")
public Result<String> getWeatherData(@RequestBody Map<String, Object> map) { public Result<String> getWeatherData(@RequestBody Map<String, Object> map) {
if (Objects.equals(enableTianqi, 0)) {
return Result.ok();
}
return Result.success(airQualityAnalysisService.getWeatherData(map)); return Result.success(airQualityAnalysisService.getWeatherData(map));
} }

View File

@ -326,7 +326,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
@Override @Override
public IPage<WorkerInfo> selectWorkerInfoList(Map<String, Object> map) { public IPage<WorkerInfo> selectWorkerInfoList(Map<String, Object> map) {
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString()); 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("workerInfoGreenScore", PropertiesUtil.getWorkerInfoGreenScore());
map.put("workerInfoRedScore", PropertiesUtil.getWorkerInfoRedScore()); map.put("workerInfoRedScore", PropertiesUtil.getWorkerInfoRedScore());
if (SecurityUtils.getUser() != null) { if (SecurityUtils.getUser() != null) {

View File

@ -219,3 +219,4 @@ h5.exam.url=http://192.168.34.133:20626/#/pages/personLocation/login/login?examP
facePass=1 facePass=1
#logback-spring.xml指定配置路径 #logback-spring.xml指定配置路径
#logging.config=/root/java/logback-spring.xml #logging.config=/root/java/logback-spring.xml
enableTianqi=0