添加英文大屏接口修改
This commit is contained in:
@ -13,6 +13,7 @@ import com.ho.business.vo.resp.iargeScreen.EnergySavingRespVo;
|
||||
import com.ho.business.vo.resp.iargeScreen.Subdata;
|
||||
import com.ho.common.tools.annotation.CommonLargeScreenToken;
|
||||
import com.ho.common.tools.annotation.TokenIgnore;
|
||||
import com.ho.common.tools.constant.CommonConstant;
|
||||
import com.ho.common.tools.constant.ContextConstant;
|
||||
import com.ho.common.tools.constant.RedisKeyConstant;
|
||||
import com.ho.common.tools.entity.SimpleUser;
|
||||
@ -20,6 +21,7 @@ import com.ho.common.tools.entity.WeatherRespVo;
|
||||
import com.ho.common.tools.exception.DataResult;
|
||||
import com.ho.common.tools.service.RedisService;
|
||||
import com.ho.common.tools.util.BigDecimalUtil;
|
||||
import com.ho.common.tools.util.TranslateUtils;
|
||||
import com.ho.flow.vo.resp.event.EventDayNum;
|
||||
import com.ho.user.api.entity.SysDept;
|
||||
import com.ho.user.api.vo.req.QueryDeptReqVO;
|
||||
@ -33,6 +35,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
@ -174,9 +177,17 @@ public class IargeScreenShowController {
|
||||
@PostMapping("/newWeather")
|
||||
@ApiOperation(value = "新大屏天气接口")
|
||||
@TokenIgnore
|
||||
public DataResult<WeatherRespVo> newWeather() {
|
||||
public DataResult<WeatherRespVo> newWeather(HttpServletRequest request) {
|
||||
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||
String key = RedisKeyConstant.WEATHER_PROVINCE_CITY + adCode;
|
||||
WeatherRespVo info = (WeatherRespVo) redisService.get(key);
|
||||
if(CommonConstant.EN_US.equals(lang)){
|
||||
try {
|
||||
info.setSkyCon(TranslateUtils.translate(info.getSkyCon()));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return DataResult.success(info);
|
||||
}
|
||||
|
||||
@ -199,7 +210,8 @@ public class IargeScreenShowController {
|
||||
@TokenIgnore
|
||||
@CommonLargeScreenToken
|
||||
public DataResult<List<Subdata>> getCommonRegionalDistribution(HttpServletRequest request) {
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonRegionList(getSimpleUser(request));
|
||||
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonRegionList(getSimpleUser(request),lang);
|
||||
regionList.sort(Comparator.comparing((Subdata::getRegionValue)).reversed());
|
||||
return DataResult.success(regionList);
|
||||
}
|
||||
@ -243,7 +255,8 @@ public class IargeScreenShowController {
|
||||
@TokenIgnore
|
||||
@CommonLargeScreenToken
|
||||
public DataResult<List<Subdata>> getCommonIncomeList(HttpServletRequest request) {
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonProfit(null, null, getSimpleUser(request));
|
||||
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonProfit(null, null, getSimpleUser(request),lang);
|
||||
if (regionList.size() > maxSize) {
|
||||
regionList = regionList.subList(0, maxSize);
|
||||
}
|
||||
@ -259,7 +272,8 @@ public class IargeScreenShowController {
|
||||
@TokenIgnore
|
||||
@CommonLargeScreenToken
|
||||
public DataResult<List<Subdata>> getCommonEfficiencyDate(HttpServletRequest request) {
|
||||
List<Subdata> efficiencyList = iargeScreenShowService.getCommonEfficiencyDate(getSimpleUser(request));
|
||||
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||
List<Subdata> efficiencyList = iargeScreenShowService.getCommonEfficiencyDate(getSimpleUser(request),lang);
|
||||
return DataResult.success(efficiencyList);
|
||||
}
|
||||
|
||||
@ -271,7 +285,7 @@ public class IargeScreenShowController {
|
||||
List<Integer> ids = getSimpleUser(request);
|
||||
List<Station> stations = new ArrayList<>();
|
||||
if (ids != null) {
|
||||
stations = iargeScreenShowService.getCountStations(ids);
|
||||
stations = iargeScreenShowService.getCountStations(ids,null);
|
||||
}
|
||||
return DataResult.success(stations);
|
||||
}
|
||||
@ -281,7 +295,8 @@ public class IargeScreenShowController {
|
||||
@TokenIgnore
|
||||
@CommonLargeScreenToken
|
||||
public DataResult<List<Subdata>> getCommonCapacity(HttpServletRequest request) {
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonCapacity(getSimpleUser(request));
|
||||
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonCapacity(getSimpleUser(request),lang);
|
||||
return DataResult.success(regionList);
|
||||
}
|
||||
|
||||
@ -339,8 +354,9 @@ public class IargeScreenShowController {
|
||||
@PostMapping("getZhongZiDistribution")
|
||||
@ApiOperation(value = "中自电站区域分布")
|
||||
@TokenIgnore
|
||||
public DataResult<List<Subdata>> getZhongZiDistribution(@RequestBody CockpitReqVO vo) {
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonRegionList((getByDeptId(vo.getDeptId())));
|
||||
public DataResult<List<Subdata>> getZhongZiDistribution(@RequestBody CockpitReqVO vo,HttpServletRequest request) {
|
||||
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonRegionList((getByDeptId(vo.getDeptId())),lang);
|
||||
regionList.sort(Comparator.comparing((Subdata::getRegionValue)).reversed());
|
||||
return DataResult.success(regionList);
|
||||
}
|
||||
@ -379,8 +395,9 @@ public class IargeScreenShowController {
|
||||
@PostMapping("getZhongZiIncomeList")
|
||||
@ApiOperation(value = "中自电站收益排名")
|
||||
@TokenIgnore
|
||||
public DataResult<List<Subdata>> getZhongZiIncomeList(@RequestBody CockpitReqVO vo) {
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonProfit(null, null, getByDeptId(vo.getDeptId()));
|
||||
public DataResult<List<Subdata>> getZhongZiIncomeList(@RequestBody CockpitReqVO vo,HttpServletRequest request) {
|
||||
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonProfit(null, null, getByDeptId(vo.getDeptId()),lang);
|
||||
if (regionList.size() > maxSize) {
|
||||
regionList = regionList.subList(0, maxSize);
|
||||
}
|
||||
@ -394,8 +411,9 @@ public class IargeScreenShowController {
|
||||
@PostMapping("getZhongZiEfficiencyDate")
|
||||
@ApiOperation(value = "中自系统转换率")
|
||||
@TokenIgnore
|
||||
public DataResult<List<Subdata>> getZhongZiEfficiencyDate(@RequestBody CockpitReqVO vo) {
|
||||
List<Subdata> efficiencyList = iargeScreenShowService.getCommonEfficiencyDate(getByDeptId(vo.getDeptId()));
|
||||
public DataResult<List<Subdata>> getZhongZiEfficiencyDate(@RequestBody CockpitReqVO vo,HttpServletRequest request) {
|
||||
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||
List<Subdata> efficiencyList = iargeScreenShowService.getCommonEfficiencyDate(getByDeptId(vo.getDeptId()),lang);
|
||||
return DataResult.success(efficiencyList);
|
||||
}
|
||||
|
||||
@ -406,7 +424,7 @@ public class IargeScreenShowController {
|
||||
List<Integer> ids = getByDeptId(vo.getDeptId());
|
||||
List<Station> stations = new ArrayList<>();
|
||||
if (ids != null) {
|
||||
stations = iargeScreenShowService.getCountStations(ids);
|
||||
stations = iargeScreenShowService.getCountStations(ids,null);
|
||||
}
|
||||
return DataResult.success(stations);
|
||||
}
|
||||
@ -414,8 +432,9 @@ public class IargeScreenShowController {
|
||||
@PostMapping("getZhongZiCapacity")
|
||||
@ApiOperation(value = "中自装机容量倒排")
|
||||
@TokenIgnore
|
||||
public DataResult<List<Subdata>> getZhongZiCapacity(@RequestBody CockpitReqVO vo) {
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonCapacity(getByDeptId(vo.getDeptId()));
|
||||
public DataResult<List<Subdata>> getZhongZiCapacity(@RequestBody CockpitReqVO vo,HttpServletRequest request) {
|
||||
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||
List<Subdata> regionList = iargeScreenShowService.getCommonCapacity(getByDeptId(vo.getDeptId()),lang);
|
||||
return DataResult.success(regionList);
|
||||
}
|
||||
|
||||
|
||||
@ -219,7 +219,7 @@ public class OuterApiController {
|
||||
@PostMapping("selectByStationIds")
|
||||
@TokenIgnore
|
||||
public DataResult<List<Station>> selectByStationIds(@RequestBody List<Integer> ids) {
|
||||
List<Station> stations = stationService.selectStationsByIds(ids);
|
||||
List<Station> stations = stationService.selectStationsByIds(ids,null);
|
||||
return DataResult.success(stations);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user