| | |
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import com.alibaba.fastjson.*;
|
| | | import com.moral.common.util.BeanUtils;
|
| | | import com.moral.common.util.ParameterUtils;
|
| | | import com.moral.common.util.StringUtils;
|
| | | import com.moral.entity.*;
|
| | |
| | | @Resource
|
| | | private WeatherService weatherService;
|
| | |
|
| | | @Resource |
| | | private QualityDailyService qualityDailyService;
|
| | |
|
| | | /**
|
| | | * Screen login. 大屏登录
|
| | | *
|
| | |
| | | StringBuilder areaNamesBuilder = new StringBuilder("中国");
|
| | | if(!((Integer) orgId).equals(dictionaryDataService.querySupperOrgId())) {
|
| | | Organization organization = organizationService.getOrganizationById((Integer) orgId);
|
| | | if(organization.getAreaNames()!=null){
|
| | | AreaNames areaNames = organization.getAreaNames();
|
| | | if(!StringUtils.isNullOrEmpty(areaNames.getProvinceName())){
|
| | | areaNamesBuilder.append("/");
|
| | | areaNamesBuilder.append(areaNames.getProvinceName());
|
| | | if(!StringUtils.isNullOrEmpty(areaNames.getCityName())){
|
| | | areaNamesBuilder.append("/");
|
| | | areaNamesBuilder.append(areaNames.getCityName());
|
| | | if(!StringUtils.isNullOrEmpty(areaNames.getAreaName())){
|
| | | areaNamesBuilder.append("/");
|
| | | areaNamesBuilder.append(areaNames.getAreaName());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | if(organization.getAreaNames()!=null){
|
| | | Map<String,String> areaNameMap = BeanUtils.beanToMap(organization.getAreaNames());
|
| | | List<String> names = areaNameMap.entrySet().stream().filter(item -> {
|
| | | return item.getValue()!=null;
|
| | | }).map(item -> {
|
| | | return item.getValue();
|
| | | }).collect(Collectors.toList());
|
| | | AreaNames areaNames = organization.getAreaNames();
|
| | | areaNamesBuilder.append("/");
|
| | | areaNamesBuilder.append(String.join("/",names));
|
| | | }
|
| | | // 企业用户
|
| | | if( 0 == organization.getRank()) {
|
| | | resultMap.put("type","enterprise");
|
| | | }else{
|
| | | resultMap.put("type","government");
|
| | | }
|
| | | resultMap.put("areaCode",
|
| | | organization.getVillageCode()|
|
| | | organization.getTownCode()|
|
| | | organization.getAreaCode()*1000000|
|
| | | organization.getCityCode()*1000000|
|
| | | organization.getProvinceCode()*1000000);
|
| | | }
|
| | | resultMap.put("mapPath",areaNamesBuilder.toString());
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | @RequestMapping(value = "/map-page", method = RequestMethod.GET)
|
| | | public ModelAndView map(ModelAndView model, @RequestParam("areaCode")int code, @RequestParam("accountId")int accountId){
|
| | | public ModelAndView map(ModelAndView model, @RequestParam("areaCode")long code, @RequestParam("accountId")int accountId){
|
| | | Account account = accountService.getAccountById(accountId);
|
| | | String regionName = areaService.queryFullNameByCode(code);
|
| | | if(account!=null&®ionName!=null){
|
| | |
| | | @GetMapping("report_alarm_datas")
|
| | | public ResultBean<List<Map<String, Object>>> getAlarmData(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | parameters.put("type", "month");
|
| | | ParameterUtils.getTimeType4Time(parameters);
|
| | | //parameters.put("type", "month");
|
| | | String sensorKey = "list";
|
| | | if (ObjectUtils.isEmpty(parameters.get("sensorKey"))) {
|
| | | parameters.put("description", "description");
|
| | |
| | | @ApiImplicitParams(value = {
|
| | | @ApiImplicitParam(name = "accountId",defaultValue = "1", value = "登录账号的id", required = true, paramType = "query", dataType = "String"),
|
| | | @ApiImplicitParam(name = "sensorKey",defaultValue = "e1,e2,e3", value = "传感器key,如有多个用逗号分隔", required = true, paramType = "query", dataType = "String"),
|
| | | @ApiImplicitParam(name = "time",defaultValue = "", value = "时间(long类型时间戳)", required = false, paramType = "query", dataType = "String"), |
| | | @ApiImplicitParam(name = "time",defaultValue = "", value = "时间(long类型时间)", required = false, paramType = "query", dataType = "String"), |
| | | @ApiImplicitParam(name = "interval",defaultValue = "30", value = "时间间隔(秒)", required = true, paramType = "query", dataType = "Integer"),
|
| | | })
|
| | | public ResultBean<Map<String, Object>> getActualDataByRegion(HttpServletRequest request) throws Exception {
|
| | |
| | | Map<String, Object> map = historyService.getActualDataByRegion(parameters);
|
| | | return new ResultBean<Map<String, Object>>(map);
|
| | | }
|
| | |
|
| | | @GetMapping("quality")
|
| | | @ApiOperation(value = "获取优良天数", notes = "获取优良天数")
|
| | | @ApiImplicitParams(value = {
|
| | | @ApiImplicitParam(name = "organizationId",defaultValue = "5", value = "登录账号的组织id", required = true, paramType = "query", dataType = "String")
|
| | | })
|
| | | public ResultBean<Map<String, Object>> getQualityCountDayByRegion(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | Map<String, Object> map = qualityDailyService.getQualityCountDayByRegion(parameters);
|
| | | return new ResultBean<Map<String, Object>>(map);
|
| | | }
|
| | | }
|