-num-old"> 74
		loginParamMap.put("userCode", userCode);
75
		loginParamMap.put("passWord", passWord);
76
77
		// 设置字符集
78
		Charset charset = Charset.forName("utf-8");
79
80
		// 调用登录接口
81
		String loginResult = HttpServiceUtil.sendPost(UrlAddress.IOT_LOGIN, loginParamMap, charset);
82
83
		Map mapType = JSON.parseObject(loginResult, Map.class);
84
		Map result = (Map) mapType.get("result");
85
86
		if ("0".equals(String.valueOf(mapType.get("resultCode")))) {
87
			logger.info("登录北向接口成功");
88
			// 将数据存到缓存中
89
			HttpURLConnectionUtil.setMapCache(result);
90
		} else {
91
			logger.info("登录北向接口失败");
92
		}
93
		return cacheMap;
94
	}
95
96
	/**
97
	 * 调用北向接口方法
98
	 * 
99
	 * @return
100
	 */
101
	public static Map<String, String> iotCallMothod(String url, Map<String, String> params) throws Exception {
102
		// 调用北向服务的接口
103
		logger.debug("调用北向接口");
104
105
		// 1.在缓存中获取sessionId与sign
106
		Map<String, String> mapCache = HttpURLConnectionUtil.getMapCache();
107
		if (mapCache.isEmpty() || mapCache.get("sign") == null || mapCache.get("sessionId") == null) {
108
			// 2.如果没有调用登录接口从新获取
109
			HttpURLConnectionUtil.iotLogin();
110
		}
111
112
		// 3.调用北向服务接口
113
		// 设置字符集
114
		Charset charset = Charset.forName("utf-8");
115
		// (1)调用接口
116
		String resultJson = HttpServiceUtil.sendPost(url, params, charset);
117
		// (2)将参数转为Map<String,String>【将返回值统一为String】
118
		Map<String, String> resultMap = JSON.parseObject(resultJson, Map.class);
119
120
		// 登录超时,需重新登录
121
		if ("登录超时".equals(resultMap.get("resultMsg"))) {
122
			logger.info("调用北向接口失败,需重新登录");
123
			// 4.调用不成功可能是登录过期
124
			// (1)清除缓存
125
			HttpURLConnectionUtil.clear();
126
			// (2)重新登录
127
			HttpURLConnectionUtil.iotLogin();
128
			// (3)再次调用接口
129
			String fianlresultJson = HttpServiceUtil.sendPost(url, params, charset);
130
			// (4)获取返回值
131
			resultMap = JSON.parseObject(fianlresultJson, Map.class);
132
		}
133
134
		// 判断是否调用成功
135
		if ("0".equals(resultMap.get("resultCode"))) {
136
			logger.info("调用北向接口成功");
137
		} else {
138
			logger.info("调用北向接口失败");
139
		}
140
141
		return resultMap;
142
	}
268 143
269 144
}

+ 76 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/util/ProductEnum.java

@ -0,0 +1,76 @@
1
package com.ai.ipu.server.util;
2
3
import java.util.HashMap;
4
import java.util.Map;
5
6
/**
7
 * 设备类型枚举
8
 * 
9
 * @author konghl@asiainfo.com 
10
 * 2020-10-19
11
 */
12
public enum ProductEnum {
13
	// 船舶
14
	ship("001", "船舶", 1),
15
	// 风机
16
	fan("002", "风机", 2),
17
	// 升压站
18
	booster("003", "升压站", 2),
19
	// 测风塔
20
	anemometer("004", "测风塔", 2);
21
22
	private String productId;
23
	private String productName;
24
	private int productType;
25
26
	private ProductEnum(String productId, String productName, int productType) {
27
		this.productId = productId;
28
		this.productName = productName;
29
		this.productType = productType;
30
	}
31
32
	public String getProductId() {
33
		return productId;
34
	}
35
36
	public String getProductName() {
37
		return productName;
38
	}
39
40
	public int getProductType() {
41
		return productType;
42
	}
43
44
	/**
45
	 * 根据类型获取对应的产品类型列表
46
	 * 
47
	 * @param type 类型(1:绑定终端,2:不绑定终端)
48
	 * @return
49
	 */
50
	public static Map<String, Object> getProductByType(int type) {
51
		Map<String, Object> map = new HashMap<String, Object>();
52
53
		for (ProductEnum productEnum : ProductEnum.values()) {
54
			if (productEnum.getProductType() == type) {
55
				map.put("id", productEnum.getProductId());
56
				map.put("name", productEnum.getProductName());
57
			}
58
		}
59
		return map;
60
	}
61
62
	/**
63
	 * 获取所有的产品类型列表
64
	 * 
65
	 * @return
66
	 */
67
	public static Map<String, Object> getAllProduct() {
68
		Map<String, Object> map = new HashMap<String, Object>();
69
70
		for (ProductEnum productEnum : ProductEnum.values()) {
71
			map.put("id", productEnum.getProductId());
72
			map.put("name", productEnum.getProductName());
73
		}
74
		return map;
75
	}
76
}

+ 13 - 0
ebc-sea-platform/src/main/resources/push-action.xml

@ -0,0 +1,13 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<actions>
3
	<!-- 查询服务当前连接数 -->
4
	<action name="ChannelStatus" 
5
	    class="com.ai.ipu.server.stomp.action.ChannelStatusAction" />
6
	<action name="StatsForChannel" 
7
	    class="com.ai.ipu.server.stomp.action.StatisticsForChannelAction" />
8
	<!-- 服务统计接口 -->
9
	<action name="StatsForServer" 
10
	    class="com.ai.ipu.server.connect.action.impl.StatisticsForServerAction" />
11
	<action name="StatsForClient" 
12
	    class="com.ai.ipu.server.connect.action.impl.StatisticsForClientAction" />
13
</actions>

Merge branch 'dev-security' of http://10.1.235.20:3000/asiainfo/ebc into dev-security · fcaf6b7f28 - Nuosi Git Service
瀏覽代碼

Merge branch 'dev-security' of http://10.1.235.20:3000/asiainfo/ebc into dev-security

xiayu3 4 年之前
父節點
當前提交
fcaf6b7f28

+ 0 - 0
security-protection-platform/.aid/mock/userRights.js


+ 0 - 0
security-protection-platform/src/api/userRights/index.js


+ 12 - 0
security-protection-platform/src/modules/userRights/organizationmana/index.vue

@ -0,0 +1,12 @@
1
<template>
2
  <div>组织管理页面</div>
3
</template>
4
5
<script>
6
export default {
7
8
}
9
</script>
10
11
<style>
12
</style>

+ 12 - 0
security-protection-platform/src/modules/userRights/usermana/index.vue

@ -0,0 +1,12 @@
1
<template>
2
  <div>123</div>
3
</template>
4
5
<script>
6
export default {
7
8
}
9
</script>
10
11
<style>
12
</style>

+ 35 - 13
security-protection-platform/src/routes.js

@ -33,13 +33,26 @@ export const constantRoutes = [
33 33
  {
34 34
    path: '/videoSurveillance',
35 35
    component: Layout,
36
    meta: { icon: 'home' },
36
    meta: { icon: 'video' },
37 37
    children: [
38 38
      {
39 39
        name: 'videoSurveillance',
40 40
        path: '',
41 41
        component: () => import(/* webpackChunkName: "videoSurveillance" */ './modules/videoSurveillance'),
42
        meta: { title: '视频监控', icon: 'home' }
42
        meta: { title: '视频监控', icon: 'video' }
43
      }
44
    ]
45
  },
46
  {
47
    path: '/access',
48
    component: Layout,
49
    meta: { icon: 'file-solution-outline' },
50
    children: [
51
      {
52
        name: 'access',
53
        path: '',
54
        component: () => import(/* webpackChunkName: "sys_attendance" */ './modules/access/index.vue'),
55
        meta: { title: '进出记录', icon: 'file-solution-outline' }
43 56
      }
44 57
    ]
45 58
  },
@ -64,13 +77,13 @@ export const constantRoutes = [
64 77
  }, {
65 78
    path: '/workorder',
66 79
    component: Layout,
67
    meta: { icon: 'home' },
80
    meta: { icon: 'calendar-outline' },
68 81
    children: [
69 82
      {
70 83
        name: 'workorder',
71 84
        path: '',
72 85
        component: () => import(/* webpackChunkName: "workorder" */ './modules/workorder'),
73
        meta: { title: '假勤管理', icon: 'home' }
86
        meta: { title: '假勤管理', icon: 'calendar-outline' }
74 87
      }
75 88
    ]
76 89
  },
@ -82,7 +95,7 @@ export const constantRoutes = [
82 95
      {
83 96
        name: 'ai_alarm',
84 97
        path: '',
85
        component: () => import(/* webpackChunkName: "sys_attendance" */ './modules/aialarm/index.vue'),
98
        component: () => import(/* webpackChunkName: "alarm" */ './modules/aialarm/index.vue'),
86 99
        meta: { title: 'AI报警', icon: 'bell' }
87 100
      }
88 101
    ]
@ -102,7 +115,7 @@ export const constantRoutes = [
102 115
      {
103 116
        name: 'sys_task',
104 117
        path: 'assignment',
105
        component: () => import(/* webpackChunkName: "sys_attendance" */ './modules/system/assignment'),
118
        component: () => import(/* webpackChunkName: "sys__task" */ './modules/system/assignment'),
106 119
        meta: { title: 'AI任务' }
107 120
      },
108 121
      {
@ -120,18 +133,27 @@ export const constantRoutes = [
120 133
    ]
121 134
  },
122 135
  {
123
    path: '/access',
136
    path: '/userRights',
124 137
    component: Layout,
125
    meta: { icon: 'home' },
138
    meta: { title: '用户权限', icon: 'lock' },
139
    redirect: '/userRights/usermana',
126 140
    children: [
127 141
      {
128
        name: 'access',
129
        path: '',
130
        component: () => import(/* webpackChunkName: "sys_attendance" */ './modules/access/index.vue'),
131
        meta: { title: '进出记录', icon: 'home' }
142
        name: 'organizationmana',
143
        path: 'organizationmana',
144
        component: () => import(/* webpackChunkName: "user_rights" */ './modules/userRights/organizationmana'),
145
        meta: { title: '组织管理' }
146
      },
147
      {
148
        name: 'usermana',
149
        path: 'usermana',
150
        component: () => import(/* webpackChunkName: "user_rights" */ './modules/userRights/usermana'),
151
        meta: { title: '用户管理' }
132 152
      }
153
133 154
    ]
134
  }, {
155
  },
156
  {
135 157
    path: '*',
136 158
    hidden: true,
137 159
    component: {