From 3bf4a89e8470abf09ca61db5a5e8e8e84f45455b Mon Sep 17 00:00:00 2001
From: kaiyu <404897439@qq.com>
Date: Wed, 30 Sep 2020 14:12:56 +0800
Subject: [PATCH] 添加标识符
---
src/main/java/com/moral/controller/WebController.java | 70 ++++++-----------------------------
1 files changed, 12 insertions(+), 58 deletions(-)
diff --git a/src/main/java/com/moral/controller/WebController.java b/src/main/java/com/moral/controller/WebController.java
index 5fef648..43a14aa 100644
--- a/src/main/java/com/moral/controller/WebController.java
+++ b/src/main/java/com/moral/controller/WebController.java
@@ -6,6 +6,7 @@
import com.moral.common.util.*;
import com.moral.common.webAnno.UserLoginToken;
import com.moral.entity.AreaNames;
+import com.moral.entity.Device;
import com.moral.entity.MonitorPoint;
import com.moral.entity.Organization;
import com.moral.service.*;
@@ -45,6 +46,9 @@
HistoryMinutelyService historyMinutelyService;
@Resource
MonitorPointService monitorPointService;
+ @Resource
+ DeviceService deviceService;
+
@UserLoginToken
@GetMapping("test")
@@ -136,64 +140,6 @@
return resultMap;
}
- //������
- @UserLoginToken
- @RequestMapping("getAccountInfoTest")
- public Map<String, Object> getAccountInfoTest(@RequestBody Map<String, Object> parameters) {
- Map<String, Object> resultMap = new HashMap<String, Object>();
- System.out.println(parameters);
- if (!(parameters.containsKey("account") && parameters.containsKey("password"))) {
- resultMap.put("msg", "������������������������������������");
- resultMap.put("accountId", -1);
- } else {
- resultMap = accountService.screenLoginNew(parameters);
- // ������������������������������������������
- Object orgId = resultMap.get("orgId");
- if (resultMap.get("orgId") != null && resultMap.get("orgId") instanceof Integer) {
- StringBuilder areaNamesBuilder = new StringBuilder("������");
- //���������������������������������
- if (!((Integer) orgId).equals(dictionaryDataService.querySupperOrgId())) {
- //���������������������������������������������������
- Organization organization = organizationService.getOrganizationById((Integer) orgId);
- 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 (organization.getRank() != null && organization.getRank() == 0) {
- resultMap.put("type", "enterprise");
- } else {
- resultMap.put("type", "government");
- }
- Number mapAreaCode = null;
- if (organization.getVillageCode() != null) {
- mapAreaCode = organization.getVillageCode();
- } else if (organization.getTownCode() != null) {
- mapAreaCode = organization.getTownCode();
- } else if (organization.getAreaCode() != null) {
- mapAreaCode = organization.getAreaCode();
- } else if (organization.getCityCode() != null) {
- mapAreaCode = organization.getCityCode();
- } else if (organization.getProvinceCode() != null) {
- mapAreaCode = organization.getProvinceCode();
- }
- resultMap.put("mapAreaCode", mapAreaCode.toString());
- }
- resultMap.put("mapPath", areaNamesBuilder.toString());
- String accountId = String.valueOf(resultMap.get("accountId"));
- resultMap.put("token", webTokenService.getToken(accountId));
- }
- }
- return resultMap;
- }
-
@UserLoginToken
@GetMapping("report_avg_datas")
@@ -225,4 +171,12 @@
List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsAndDevicesByRegion(parameters);
return new ResultBean<List<MonitorPoint>>(monitorPoints);
}
+
+ /* @UserLoginToken*/
+ @GetMapping("coordinates")
+ public ResultBean<List<Device>> getDeviceCoordinatesAndState(HttpServletRequest request){
+ Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
+ ParameterUtils.getRegionType4RegionCode(parameters);
+ return new ResultBean<List<Device>>(deviceService.queryDevice(parameters));
+ }
}
--
Gitblit v1.8.0