From 69a3e436bedfc828930e08cbbac7df57f4fd83cb Mon Sep 17 00:00:00 2001 From: ZhuDongming <773644075@qq.com> Date: Fri, 12 Jun 2020 16:46:03 +0800 Subject: [PATCH] update去除站点层,更改设备图标为站点图标 --- src/main/java/com/moral/controller/ScreenController.java | 87 +++++++++++++++++++++++++++++++------------ 1 files changed, 62 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/moral/controller/ScreenController.java b/src/main/java/com/moral/controller/ScreenController.java index 269c6a1..23c06ea 100644 --- a/src/main/java/com/moral/controller/ScreenController.java +++ b/src/main/java/com/moral/controller/ScreenController.java @@ -9,35 +9,20 @@ import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; - -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; -import org.apache.commons.net.ftp.FTPClient; -import org.apache.log4j.Logger; -import org.dom4j.Document; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.cglib.beans.BeanMap; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.ObjectUtils; -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.ModelAndView; -import org.xml.sax.InputSource; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; @@ -94,6 +79,29 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.MapUtils; +import org.apache.commons.net.ftp.FTPClient; +import org.apache.log4j.Logger; +import org.dom4j.Document; +import org.dom4j.Element; +import org.dom4j.io.SAXReader; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cglib.beans.BeanMap; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.util.ObjectUtils; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; +import org.xml.sax.InputSource; import static com.moral.common.util.ResourceUtil.getValue; import static com.moral.common.util.WebUtils.getParametersStartingWith; @@ -1598,4 +1606,33 @@ } return new ResultBean<List<Map<String, Object>>>(list); } + + @RequestMapping(value = "/newMap-page", method = RequestMethod.GET) + public ModelAndView newMap(ModelAndView model, @RequestParam("areaCode") long code, + @RequestParam("accountId") int accountId) { + Account account = accountService.getAccountById(accountId); + String regionName = areaService.queryFullNameByCode(code); + if (account != null && regionName != null) { + Object sensors = sensorService.queryAll(); + JSONObject params = new JSONObject(); + params.put("regionCode", code); + params.put("regionName", regionName); + params.put("accountId", accountId); + params.put("orgId", account.getOrganizationId()); + params.put("sensors", sensors); + String paramsJson = params.toJSONString(); + model.addObject("mapParams", paramsJson); + model.setViewName("newmap"); + return model; + } else { + StringBuilder msg = new StringBuilder(); + msg.append(" param[0] areaCode:"); + msg.append(code); + msg.append(" param[0] accountId:"); + msg.append(accountId); + log.warn(msg); + model.setViewName("403"); + return model; + } + } } -- Gitblit v1.8.0