3
import java.nio.charset.Charset;
4
import java.util.HashMap;
5
import java.util.Map;
6
7
import org.slf4j.Logger;
8
import org.slf4j.LoggerFactory;
9
import org.springframework.beans.factory.annotation.Value;
10
import org.springframework.context.annotation.Configuration;
11
12
import com.alibaba.fastjson.JSON;
13
import com.alibaba.fastjson.JSONObject;
14
15
/**
16
 * 北向接口统一入口
17
 *
18
 * @date 2010/09/24 23:42
19
 */
20
@Configuration
21
public class NorthboundInterfaceUtil {
22
23
    private static final Logger logger = LoggerFactory.getLogger(NorthboundInterfaceUtil.class);
24
25
    @Value("${aap.iot.userCode:IOT_ADMIN}")
26
    private String userCode;
27
28
    @Value("${aap.iot.passWord:123456}")
29
    private String passWord;
30
31
    @Value("${url.iot.login:http://47.105.130.83:8083/sso/login}")
32
    private String iotLoginUrl;
33
34
    @Value("${url.iot.service:http://47.105.130.83:8083/dmp/terminalNorthApi/}")
35
    private String iotServiceUrl;
36
37
    /**
38
     * GET请求调用北向接口方法
39
     *
40
     * @param url
41
     * @return
42
     * @throws Exception
43
     */
44
    public Map<String, Object> iotGetCallUtil(String url) throws Exception {
45
        logger.debug("GET调用北向接口");
46
        Map<String, Object> resultMap = new HashMap<String, Object>();
47
        Map<String, String> signMap = new HashMap<String, String>();
48
49
        // 1.在缓存中获取sessionId与sign
50
        Object sign =CacheUtil.getCache("ebc_iot_north_sign");
51
        Object session_id = CacheUtil.getCache("ebc_iot_north_session_id");
52
53
        if (sign == null ) {
54
            // 2.如果没有调用登录接口从新获取
55
            signMap = iotLogin();
56
57
            if (signMap == null) {
58
                logger.debug("调用北向接口登录失败");
59
                return resultMap;
60
            }
61
62
        } else {
63
            signMap.put("ebc_iot_north_sign", String.valueOf(sign));
64
            signMap.put("ebc_iot_north_session_id", String.valueOf(session_id));
65
66
        }
67
68
        // 3.调用北向服务接口
69
        // (1)设置字符集
70
        Charset charset = Charset.forName("utf-8");
71
        try {
72
            // (2)调用接口
73
            String resultJson = HttpServiceUtil.sendGet(iotServiceUrl + url, charset, signMap);
74
            // (3)将参数转为Map<String,String>【将返回值统一为String】
75
            resultMap = JSON.parseObject(resultJson, Map.class);
76
        } catch (Exception e) {
77
            logger.error("调用北向接口失败: " + e.getMessage());
78
            return new HashMap<String, Object>();
79
        }
80
81
        if (resultMap == null) {
82
            logger.error("调用北向接口返回值为空");
83
            return new HashMap<String, Object>();
84
85
        } else if ("登录超时".equals(resultMap.get("resultMsg"))) {
86
            // 4.登录超时,需重新登录
87
            logger.info("调用北向接口失败,需重新登录");
88
            // (1)清除缓存
89
            CacheUtil.removeCache("ebc_iot_north_sign");
90
            CacheUtil.removeCache("ebc_iot_north_session_id");
91
            // (2)重新登录
92
            signMap = iotLogin();
93
94
            if (signMap == null) {
95
                logger.debug("再次调用北向接口登录失败");
96
                return resultMap;
97
            }
98
99
            try {
100
                // (3)再次调用接口
101
                String resultJson = HttpServiceUtil.sendGet(iotServiceUrl + url, charset, signMap);
102
                // (4)获取返回值
103
                resultMap = JSON.parseObject(resultJson, Map.class);
104
            } catch (Exception e) {
105
                logger.error("再次调用北向接口失败: " + e.getMessage());
106
                return new HashMap<String, Object>();
107
            }
108
109
            if (resultMap == null) {
110
                logger.error("再次调用北向接口返回值为空");
111
                return new HashMap<String, Object>();
112
            }
113
        }
114
115
        // 5.判断是否调用成功
116
        if (NorthboundInterfaceConstant.resultCode_succeed.equals(resultMap.get("resultCode"))) {
117
            logger.info("调用北向接口成功");
118
            return resultMap;
119
        } else {
120
            logger.info("调用北向接口失败");
121
            return new HashMap<String, Object>();
122
        }
123
    }
124
125
    /**
126
     * POST请求调用北向接口方法
127
     *
128
     * @param url
129
     * @param paramsMap
130
     * @return
131
     * @throws Exception
132
     */
133
    public Map<String, Object> iotPostCallUtil(String url, Map<String, Object> paramsMap) throws Exception {
134
        logger.debug("POSt调用北向接口");
135
        Map<String, Object> resultMap = new HashMap<String, Object>();
136
        Map<String, String> signMap = new HashMap<String, String>();
137
138
        // 1.在缓存中获取sessionId与sign
139
        Object sign =CacheUtil.getCache("ebc_iot_north_sign");
140
        Object session_id = CacheUtil.getCache("ebc_iot_north_session_id");
141
142
        if (sign == null ) {
143
            // 2.如果没有调用登录接口从新获取
144
            signMap = iotLogin();
145
146
            if (signMap == null) {
147
                logger.debug("调用北向接口登录失败");
148
                return resultMap;
149
            }
150
151
        } else {
152
            signMap.put("ebc_iot_north_sign", String.valueOf(sign));
153
            signMap.put("ebc_iot_north_session_id", String.valueOf(session_id));
154
155
        }
156
157
        // 3.调用北向服务接口
158
        // (1)设置字符集
159
        Charset charset = Charset.forName("utf-8");
160
        try {
161
            // (2)调用接口
162
            String resultJson = HttpServiceUtil.sendPost(iotServiceUrl + url, paramsMap, charset, signMap);
163
            // (3)将参数转为Map<String,String>【将返回值统一为String】
164
            resultMap = JSON.parseObject(resultJson, Map.class);
165
        } catch (Exception e) {
166
            logger.error("调用北向接口失败: " + e.getMessage());
167
            return new HashMap<String, Object>();
168
        }
169
170
        if (resultMap == null) {
171
            logger.error("调用北向接口返回值为空");
172
            return new HashMap<String, Object>();
173
        } else if ("登录超时".equals(resultMap.get("resultMsg"))) {
174
            // 4.登录超时,需重新登录
175
            logger.info("调用北向接口登录超时,需重新登录");
176
            // (1)清除缓存
177
            CacheUtil.removeCache("ebc_iot_north_sign");
178
            CacheUtil.removeCache("ebc_iot_north_session_id");
179
            // (2)重新登录
180
            signMap = iotLogin();
181
182
            if (signMap == null) {
183
                logger.debug("再次调用北向接口登录失败");
184
                return resultMap;
185
            }
186
187
            try {
188
                // (3)再次调用接口
189
                String resultJson = HttpServiceUtil.sendPost(iotServiceUrl + url, paramsMap, charset, signMap);
190
                // (4)获取返回值
191
                resultMap = JSON.parseObject(resultJson, Map.class);
192
            } catch (Exception e) {
193
                logger.error("再次调用北向接口失败: " + e.getMessage());
194
                return new HashMap<String, Object>();
195
            }
196
197
            if (resultMap == null) {
198
                logger.error("再次调用北向接口返回值为空");
199
                return new HashMap<String, Object>();
200
            }
201
        }
202
203
        // 5.判断是否调用成功
204
        if (NorthboundInterfaceConstant.resultCode_succeed.equals(resultMap.get("resultCode"))) {
205
            logger.info("调用北向接口成功");
206
            return resultMap;
207
        } else {
208
            logger.info("调用北向接口失败");
209
            return new HashMap<String, Object>();
210
        }
211
    }
212
213
    /**
214
     * 调用登录接口获取sessionId与sign
215
     *
216
     * @return
217
     */
218
    private Map<String, String> iotLogin() throws Exception {
219
        logger.debug("登录北向接口");
220
        HashMap<String, Object> loginParamMap = new HashMap<>();
221
222
        // 调用登录接口获取sessionId与sign
223
        loginParamMap.put("userCode", userCode);
224
        loginParamMap.put("passWord", passWord);
225
226
        // 设置字符集
227
        Charset charset = Charset.forName("utf-8");
228
229
        //Map<String, String> loginResultMap =new HashMap<String,String>();
230
        JSONObject loginResultJsonObject = null;
231
        try {
232
            // 调用登录接口
233
            String loginResult = HttpServiceUtil.sendPost(iotLoginUrl, loginParamMap, charset);
234
            loginResultJsonObject = JSON.parseObject(loginResult);
235
        } catch (Exception e) {
236
            logger.error("登录北向接口失败: " + e.getMessage());
237
            return null;
238
        }
239
240
        if (loginResultJsonObject != null && NorthboundInterfaceConstant.resultCode_succeed.equals(String.valueOf(loginResultJsonObject.get("resultCode")))) {
241
            logger.info("登录北向接口成功");
242
243
            Map<String, String> resultMap = (Map<String, String>) loginResultJsonObject.get("result");
244
            // 将数据存到缓存中
245
            CacheUtil.setCache("ebc_iot_north_sign", resultMap.get("sign"));
246
            CacheUtil.setCache("ebc_iot_north_session_id", resultMap.get("session_id"));
247
            return resultMap;
248
        } else {
249
            logger.info("登录北向接口失败");
250
            return null;
251
        }
252
    }
253
}

+ 48 - 0
ebc-sea-platform/src/main/java/com/ai/bss/location/rescue/util/SpringUtil.java

@ -0,0 +1,48 @@
1
package com.ai.bss.location.rescue.util;
2
3
import org.slf4j.Logger;
4
import org.slf4j.LoggerFactory;
5
import org.springframework.beans.BeansException;
6
import org.springframework.context.ApplicationContext;
7
import org.springframework.context.ApplicationContextAware;
8
import org.springframework.stereotype.Component;
9
10
@Component
11
public class SpringUtil implements ApplicationContextAware {
12
	private static final Logger logger = LoggerFactory.getLogger(SpringUtil.class);
13
	private static ApplicationContext applicationContext;
14
15
	private static void setApplicationcontext(ApplicationContext applicationContext) {
16
		if(SpringUtil.applicationContext == null) {
17
			SpringUtil.applicationContext = applicationContext;
18
        }
19
	}
20
	
21
    @Override
22
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
23
    	setApplicationcontext(applicationContext);
24
        logger.debug("---------------------------------------------------------------------");
25
        logger.debug("========ApplicationContext配置成功,在普通类可以通过调用SpringUtils.getAppContext()获取applicationContext对象,applicationContext="+SpringUtil.applicationContext+"========");
26
        logger.debug("---------------------------------------------------------------------");
27
    }
28
29
    //获取applicationContext
30
    public static ApplicationContext getApplicationContext() {
31
        return applicationContext;
32
    }
33
34
    //通过name获取 Bean.
35
    public static Object getBean(String name){
36
        return getApplicationContext().getBean(name);
37
    }
38
39
    //通过class获取Bean.
40
    public static <T> T getBean(Class<T> clazz){
41
        return getApplicationContext().getBean(clazz);
42
    }
43
44
    //通过name,以及Clazz返回指定的Bean
45
    public static <T> T getBean(String name,Class<T> clazz){
46
        return getApplicationContext().getBean(name, clazz);
47
    }
48
}

+ 15 - 0
ebc-sea-platform/src/main/resources/pro/application-gis.properties

@ -0,0 +1,15 @@
1
#gis\u767b\u5f55\u8d26\u53f7\u548c\u5bc6\u7801
2
aap.gis.userName=EBC_PPRS
3
aap.gis.passwd=ITBS93wMYHosT
4
5
#gis\u7684token\u5730\u5740
6
url.gis.token=http://192.168.74.189:9999/gisIntf/account/gettoken
7
8
#\u6d77\u56fe\u4e2d\u5fc3\u5750\u6807
9
seaMap.centre.longitude=123.396036
10
seaMap.centre.latitude=31.560302
11
12
#\u6d77\u56fe\u663e\u793a\u6bd4\u4f8b\u5c3a
13
# 5-->300km,6-->200km,7-->100km,8-->50km,9-->20km,10-->10km,11-->5km
14
# 12-->2km,13-->1km,14-->500m,15-->300m,16-->200m,17-->100m,18-->50m
15
seaMap.scale=8

+ 14 - 0
ebc-sea-platform/src/main/resources/pro/application-iot.properties

@ -0,0 +1,14 @@
1
#\u5317\u5411\u767b\u5f55\u8d26\u53f7\u548c\u5bc6\u7801
2
aap.iot.userCode=IOT_ADMIN
3
aap.iot.passWord=123456
4
5
#iot\u7684\u5317\u5411\u63a5\u53e3\u6ce8\u518c\u5730\u5740
6
#url.iot.login=http://60.205.219.67:8300/sso/login
7
url.iot.login=http://47.105.130.83:8083/sso/login
8
9
#iot\u7684\u5317\u5411\u63a5\u53e3\u7edf\u4e00\u5730\u5740
10
#url.iot.service=http://60.205.219.67:8300/dmp/terminalNorthApi/
11
url.iot.service=http://47.105.130.83:8083/dmp/terminalNorthApi/
12
13
#\u7ec8\u7aef\u8d85\u65f6\u79bb\u7ebf\u65f6\u95f4(\u5206\u949f)
14
device.overtime.offline=20

+ 54 - 0
ebc-sea-platform/src/main/resources/pro/application.properties

@ -0,0 +1,54 @@
1
spring.application.name=WorkTaskSpec
2
server.port=8011
3
4
server.servlet.context-path=/ipu
5
6
# DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
7
#spring.datasource.url=jdbc:mysql://localhost:3306/cmp
8
spring.datasource.url=jdbc:mysql://10.19.90.34:3307/energy?serverTimezone=Asia/Shanghai&characterEncoding=utf-8&verifyServerCertificate=false&useSSL=false&requireSSL=false
9
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
10
spring.datasource.username=ebc
11
spring.datasource.password=ebc@123
12
13
# JPA (JpaBaseConfiguration, HibernateJpaAutoConfiguration)
14
#spring.jpa.database=default
15
spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect
16
spring.jpa.hibernate.ddl-auto=none
17
spring.jpa.show-sql=true
18
spring.jpa.properties.hibernate.format_sql=true
19
spring.jpa.properties.hibernate.generate_statistics=false
20
spring.main.allow-bean-definition-overriding=true
21
22
#kafka
23
kafka.bootstrap-servers=47.105.160.21:9090
24
#kafka.bootstrap-servers=10.19.90.34:2182
25
#kafka.topic.deviceLocation=Topic_IoT_DeviceLocation
26
#kafka.topic.alarm=Topic_IoT_IndividualAlarm
27
kafka.topic.deviceLocation=DeviceLocationA
28
kafka.topic.alarm=IndividualAlarmA
29
kafka.producer.batch-size=16785
30
kafka.producer.retries=1
31
kafka.producer.buffer-memory=33554432
32
kafka.producer.linger=1
33
kafka.consumer.auto-offset-reset=latest
34
kafka.consumer.max-poll-records=3100
35
kafka.consumer.enable-auto-commit=false
36
kafka.consumer.auto-commit-interval=1000
37
kafka.consumer.session-timeout=20000
38
kafka.consumer.max-poll-interval=15000
39
kafka.consumer.max-partition-fetch-bytes=15728640
40
kafka.listener.batch-listener=false
41
kafka.listener.concurrencys=3,6
42
kafka.listener.poll-timeout=1500
43
44
45
# CACHE
46
#spring.cache.type=ehcache
47
#spring.cache.ehcache.config=ehcache.xml
48
49
# LOGGING
50
logging.level.com.ai=debug
51
logging.level.org.springframework.data=debug
52
53
# \u5f15\u5165gis\u548ciot\u7684\u914d\u7f6e\u6587\u4ef6
54
spring.profiles.active=iot,gis

+ 114 - 0
ebc-sea-platform/src/main/resources/pro/ipu-cache.xml

@ -0,0 +1,114 @@
1
<?xml version = '1.0' encoding = 'UTF-8'?>
2
<caches>
3
	<cache name="ssn" type="redis">
4
		<servers>
5
	        <!-- 如果不是cluster,则只使用第一个redis -->
6
	        <server ip="121.42.183.206" port="7101" />
7
	        <server ip="121.42.183.206" port="7102" />
8
	        <server ip="121.42.183.206" port="7103" />
9
	        <server ip="121.42.183.206" port="7104" />
10
	        <server ip="121.42.183.206" port="7105" />
11
	        <server ip="121.42.183.206" port="7106" />
12
	    </servers>
13
		<!-- 客户端类型:Jedis,JedisCluster -->
14
	    <config name="clientType" value="JedisCluster"/>
15
	    <!-- 访问redis的密码,可以为空 -->
16
	    <config name="auth" value="Ipu@321!"/>
17
	    <!-- redis池的可用连接实例的最大数目,缺省为8 -->
18
	    <config name="poolSize" value="10"/>
19
	    <!-- redis池最多有多少个状态为idle(空闲的)的jedis实例,缺省为8,空闲连接大于这个数会进行回收 -->
20
	    <config name="maxIdle"/>
21
	    <!-- 最小空闲数,空闲连接小于这个数会建立新的连接,缺省为0 -->
22
	    <config name="minIdle"/>
23
	    <!-- 等待Response超时时间,默认2000ms -->
24
	    <config name="soTimeout"/>
25
	    <!-- 连接Redis Server超时时间,默认2000ms -->
26
	    <config name="connTimeout"/>
27
	    <!-- 出现异常最大重试次数 -->
28
	    <config name="maxAttempts"/>
29
	</cache>
30
	
31
	<cache name="SSN_CACHE" type="redis">
32
		<servers>
33
	        <!-- 如果不是cluster,则只使用第一个redis -->
34
	        <server ip="121.42.183.206" port="7101" />
35
	        <server ip="121.42.183.206" port="7102" />
36
	        <server ip="121.42.183.206" port="7103" />
37
	        <server ip="121.42.183.206" port="7104" />
38
	        <server ip="121.42.183.206" port="7105" />
39
	        <server ip="121.42.183.206" port="7106" />
40
	    </servers>
41
		<!-- 客户端类型:Jedis,JedisCluster -->
42
	    <config name="clientType" value="JedisCluster"/>
43
	    <!-- 访问redis的密码,可以为空 -->
44
	    <config name="auth" value="Ipu@321!"/>
45
	    <!-- redis池的可用连接实例的最大数目,缺省为8 -->
46
	    <config name="poolSize" value="10"/>
47
	    <!-- redis池最多有多少个状态为idle(空闲的)的jedis实例,缺省为8,空闲连接大于这个数会进行回收 -->
48
	    <config name="maxIdle"/>
49
	    <!-- 最小空闲数,空闲连接小于这个数会建立新的连接,缺省为0 -->
50
	    <config name="minIdle"/>
51
	    <!-- 等待Response超时时间,默认2000ms -->
52
	    <config name="soTimeout"/>
53
	    <!-- 连接Redis Server超时时间,默认2000ms -->
54
	    <config name="connTimeout"/>
55
	    <!-- 出现异常最大重试次数 -->
56
	    <config name="maxAttempts"/>
57
	</cache>
58
	
59
	<cache name="client_route" type="redis">
60
		<servers>
61
	        <!-- 如果不是cluster,则只使用第一个redis -->
62
	        <server ip="121.42.183.206" port="7101" />
63
	        <server ip="121.42.183.206" port="7102" />
64
	        <server ip="121.42.183.206" port="7103" />
65
	        <server ip="121.42.183.206" port="7104" />
66
	        <server ip="121.42.183.206" port="7105" />
67
	        <server ip="121.42.183.206" port="7106" />
68
	    </servers>
69
		<!-- 客户端类型:Jedis,JedisCluster -->
70
	    <config name="clientType" value="JedisCluster"/>
71
	    <!-- 访问redis的密码,可以为空 -->
72
	    <config name="auth" value="Ipu@321!"/>
73
	    <!-- redis池的可用连接实例的最大数目,缺省为8 -->
74
	    <config name="poolSize" value="10"/>
75
	    <!-- redis池最多有多少个状态为idle(空闲的)的jedis实例,缺省为8,空闲连接大于这个数会进行回收 -->
76
	    <config name="maxIdle"/>
77
	    <!-- 最小空闲数,空闲连接小于这个数会建立新的连接,缺省为0 -->
78
	    <config name="minIdle"/>
79
	    <!-- 等待Response超时时间,默认2000ms -->
80
	    <config name="soTimeout"/>
81
	    <!-- 连接Redis Server超时时间,默认2000ms -->
82
	    <config name="connTimeout"/>
83
	    <!-- 出现异常最大重试次数 -->
84
	    <config name="maxAttempts"/>
85
	</cache>
86
	
87
	<cache name="pushServer_route" type="redis">
88
		<servers>
89
	        <!-- 如果不是cluster,则只使用第一个redis -->
90
	        <server ip="121.42.183.206" port="7101" />
91
	        <server ip="121.42.183.206" port="7102" />
92
	        <server ip="121.42.183.206" port="7103" />
93
	        <server ip="121.42.183.206" port="7104" />
94
	        <server ip="121.42.183.206" port="7105" />
95
	        <server ip="121.42.183.206" port="7106" />
96
	    </servers>
97
		<!-- 客户端类型:Jedis,JedisCluster -->
98
	    <config name="clientType" value="JedisCluster"/>
99
	    <!-- 访问redis的密码,可以为空 -->
100
	    <config name="auth" value="Ipu@321!"/>
101
	    <!-- redis池的可用连接实例的最大数目,缺省为8 -->
102
	    <config name="poolSize" value="10"/>
103
	    <!-- redis池最多有多少个状态为idle(空闲的)的jedis实例,缺省为8,空闲连接大于这个数会进行回收 -->
104
	    <config name="maxIdle"/>
105
	    <!-- 最小空闲数,空闲连接小于这个数会建立新的连接,缺省为0 -->
106
	    <config name="minIdle"/>
107
	    <!-- 等待Response超时时间,默认2000ms -->
108
	    <config name="soTimeout"/>
109
	    <!-- 连接Redis Server超时时间,默认2000ms -->
110
	    <config name="connTimeout"/>
111
	    <!-- 出现异常最大重试次数 -->
112
	    <config name="maxAttempts"/>
113
	</cache>
114
</caches>

+ 77 - 0
ebc-sea-platform/src/main/resources/pro/sso.properties

@ -0,0 +1,77 @@
1
#\u7CFB\u7EDF\u57DF
2
SYSTEM_DOMAIN=LOGIN_CACHE_ROUTE
3
4
#------------------------------cookie\u914D\u7F6E-------------#
5
##COOKIE\u7684\u6709\u6548\u57DF,\u4E0D\u8BBE\u7F6E\uFF0C\u5219\u81EA\u52A8\u8BBE\u7F6E
6
#COOKIE_DOMAIN=crm.chinapost.yw.com
7
8
COOKIE_PATH=/
9
10
##Session \u8D85\u65F6\u65F6\u95F4(\u79D2)
11
SESSION_TIMEOUT=3600
12
COOKIE_MAXAGE=-1
13
14
15
TENANT_REGISTER_CLASS=com.ai.customermanager.services.impl.CustRegisterVercodeImpl
16
17
18
##\u8FDC\u7A0B\u7F13\u5B58\u8C03\u7528\u7C7B\uFF0C\u8FD9\u4E2A\u7C7B\u5FC5\u987B\u6709\u4E09\u4E2A\u51FD\u6570 
19
##    public boolean set(String key,String value)
20
##    public String get(String key)
21
##    public boolean del(String key);
22
COOKIE_CACHE_CLASS=com.ai.sso.util.SessionRedisCache
23
24
LOGGING_INTERFACE_CLASS=com.wframe.baseinfo.util.BaseInfoUtil
25
26
##COOKIE_IS_CACHE \u662F\u5426\u7F13\u5B58\u5230\u8FDC\u7AEF\u3002
27
COOKIE_IS_CACHE=1
28
29
30
##IS_CHECK_LOGIN \u662F\u5426\u68C0\u67E5\u767B\u9646\u3002
31
IS_CHECK_LOGIN=1
32
33
34
LOGIN_SERVICE=uspa_IOrgmodelClientCSV_loginIn
35
LOGINNOPASS_SERVICE=uspa_IOrgmodelClientCSV_loginWithNoPassword
36
37
38
Access-Control-Allow-origin=http://crm.chinapost.yw.com:18080/
39
40
##\u68C0\u67E5SesisonId,sign \u662F\u5426\u6B63\u786E
41
SESSION_CHECK_SIGN=com.ai.sso.util.SessionCheckSign
42
SESSION_CHECK_LOGIN=com.ai.sso.util.SessionCheckLogin
43
#redis
44
45
##MAIN_PAGE
46
#MAIN_PAGE=http://crm.chinapost.com:18880/
47
##RETURN TAG \u8FD4\u56DE\u5B57\u7B26\u4E32
48
49
RETURN_TAG={"MESSAGE":"NOLOGIN","CODE":999999,"FLAG":"FAIL","RESULT":{"URL":"http://crm.chinapost.yw.com:18080/"}}
50
#RETURN_TAG=<html><script language="javascript"> function init(){ if(window.parent!=null) { window.parent.location.href ="http://crm.chinapost.com:18880"; } else window.location.href ="http://crm.chinapost.com:18880"; } </script><body onload="init()"></body></html>
51
52
53
54
redis.single=10.11.20.117:6379
55
redis.pool.maxTotal=1000
56
redis.pool.minIdle=5
57
redis.pool.maxIdle=100
58
redis.pool.testOnBorrow=false
59
redis.pool.maxWait=5000
60
redis.pool.testOnReturn=true
61
redis.pool.testWhileIdle=true
62
redis.pool.timeBetweenEvictionRunsMillis=10000
63
redis.password=luMZulgbotmo71aa
64
65
SESSION_DEFAULT_VERCODE=Hiz#8uAqkjhoPmXu8%aaa
66
67
#\u662F\u5426\u8FDB\u884C\u63A5\u53E3\u6743\u9650\u63A7\u5236 1 \u8FDB\u884C\u63A5\u53E3\u6743\u9650\u63A7\u5236 
68
is_check_interface=0
69
70
71
#BJYM\u4F7F\u7528
72
#USER_LOGIN_AUTH_CLASS=com.wframe.msgmanager.services.impl.UserLoginAuth4TestImpl
73
##\u5C0F\u7A0B\u5E8F\u4F7F\u7528
74
USER_LOGIN_AUTH_CLASS=com.wframe.usermanager.services.impl.UserLoginAuthImpl
75
#USER_LOGIN_AUTH_CLASS=com.wframe.msgmanager.services.impl.UserLoginByTokenImpl
76
#USER_LOGIN_AUTH_CLASS=com.wframe.msgmanager.services.impl.UserLoginByToken4XblImpl
77
SIGN_KEY_CODE=TENANT_CODE

IPU标准版:整理getQrCodePhotoViaCamera、getQrCodePhotoViaLibrary插件 · 888753fc58 - Nuosi Git Service
瀏覽代碼

IPU标准版:整理getQrCodePhotoViaCamera、getQrCodePhotoViaLibrary插件

liufl5 3 年之前
父節點
當前提交
888753fc58

+ 16 - 0
IPUMobileFunc/IPUMobileFunc/Camera/IPUCameraPlugin.h

@ -34,4 +34,20 @@
34 34
*/
35 35
- (void)playVideo:(NSArray *)param;
36 36
37
#pragma mark - 二维码相关
38
/**
39
 拍照获取包含二维码的照片
40
 @param param 压缩参数,可选,不传则返回图片路径以及不对图片进行压缩
41
 {"base64" : "返回图片形式,0:图片路径, 1: base64", "length" : "照片大小,单位B,如400 * 1024", "width" : "照片最小宽度,如300"}
42
 callback: {"result" : "图片base64编码或者路径", "qrcodes" : ["图片中所含二维码检测结果,如无二维码则为空字符串"]}
43
 */
44
- (void)getQrCodePhotoViaCamera:(NSArray *)param;
45
/**
46
 通过相册获取包含二维码的照片
47
 @param param 压缩参数,可选,不传则返回图片路径以及不对图片进行压缩
48
 {"base64" : "返回图片形式,0:图片路径, 1: base64", "length" : "照片大小,单位B,如400 * 1024", "width" : "照片最小宽度,如300"}
49
 callback: {"result" : "图片base64编码或者路径", "qrcodes" : ["图片中所含二维码检测结果,如无二维码则为空字符串"]}
50
 */
51
- (void)getQrCodePhotoViaLibrary:(NSArray *)param;
52
37 53
@end

+ 12 - 8
IPUMobileFunc/IPUMobileFunc/Camera/IPUCameraPlugin.m

@ -293,18 +293,22 @@ JS调用插件名:getPicture
293 293
294 294
295 295
#pragma mark - 二维码相关
296
/// 拍照获取包含二维码的照片
297
/// @param param 压缩参数,可选,不传则返回图片路径以及不对图片进行压缩
298
/// {"base64" : "返回图片形式,0:图片路径, 1: base64", "length" : "照片大小,单位B,如400 * 1024", "width" : "照片最小宽度,如300"}
299
/// callback: {"result" : "图片base64编码或者路径", "qrcodes" : ["图片中所含二维码检测结果,如无二维码则为空字符串"]}
296
/**
297
拍照获取包含二维码的照片
298
@param param 压缩参数,可选,不传则返回图片路径以及不对图片进行压缩
299
{"base64" : "返回图片形式,0:图片路径, 1: base64", "length" : "照片大小,单位B,如400 * 1024", "width" : "照片最小宽度,如300"}
300
callback: {"result" : "图片base64编码或者路径", "qrcodes" : ["图片中所含二维码检测结果,如无二维码则为空字符串"]}
301
*/
300 302
- (void)getQrCodePhotoViaCamera:(NSArray *)param {
301 303
    [self getQrCodePhoto:param type:UIImagePickerControllerSourceTypeCamera];
302 304
}
303 305
304
/// 通过相册获取包含二维码的照片
305
/// @param param 压缩参数,可选,不传则返回图片路径以及不对图片进行压缩
306
/// {"base64" : "返回图片形式,0:图片路径, 1: base64", "length" : "照片大小,单位B,如400 * 1024", "width" : "照片最小宽度,如300"}
307
/// callback: {"result" : "图片base64编码或者路径", "qrcodes" : ["图片中所含二维码检测结果,如无二维码则为空字符串"]}
306
/**
307
通过相册获取包含二维码的照片
308
@param param 压缩参数,可选,不传则返回图片路径以及不对图片进行压缩
309
{"base64" : "返回图片形式,0:图片路径, 1: base64", "length" : "照片大小,单位B,如400 * 1024", "width" : "照片最小宽度,如300"}
310
callback: {"result" : "图片base64编码或者路径", "qrcodes" : ["图片中所含二维码检测结果,如无二维码则为空字符串"]}
311
*/
308 312
- (void)getQrCodePhotoViaLibrary:(NSArray *)param {
309 313
    [self getQrCodePhoto:param type:UIImagePickerControllerSourceTypePhotoLibrary];
310 314
}

+ 0 - 1
display-center/Res/config/mobile-action.xml

@ -52,7 +52,6 @@
52 52
    
53 53
    <action name="getQrCodePhotoViaCamera"  class="IPUCameraPlugin" method="getQrCodePhotoViaCamera"/>
54 54
    <action name="getQrCodePhotoViaLibrary" class="IPUCameraPlugin" method="getQrCodePhotoViaLibrary"/>
55
56 55
    <action name="scanSingle"   class="IPUQRCodePlugin" method="scanSingle"/>
57 56
    <action name="scanQrCode"   class="IPUQRCodePlugin" method="scanSingle"/>
58 57
    <action name="scanMultiple" class="IPUQRCodePlugin" method="scanMultiple"/>

二進制
display-center/display-center.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate


Merge remote-tracking branch 'origin/master' · 5151d2fea9 - Nuosi Git Service
Browse Source

Merge remote-tracking branch 'origin/master'

wangdong6 4 years ago
parent
commit
5151d2fea9

+ 0 - 1
ebc-middle-platform/src/modules/call-help/history.vue

@ -186,7 +186,6 @@ export default {
186 186
      return row.longitude + ', ' + row.latitude
187 187
    },
188 188
    businessType_formatter(row, column) {
189
      debugger
190 189
      var arr = this.alarmTypes.filter((item) => {
191 190
        return item.alarmTypeId === row.businessType
192 191
      })

+ 11 - 0
ebc-middle-platform/src/modules/layouts/BasicLayout.vue

@ -148,6 +148,17 @@ export default {
148 148
      this.alarmObj.userName = obj.data.employeeName
149 149
      this.alarmObj.workTaskId = obj.data.workTaskId
150 150
      this.modal = true
151
      var str = this.alarmObj.userName + ',' + this.alarmObj.alarmType
152
      this.speckText(str)
153
    },
154
    speckText(str) {
155
      // var url = "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=" + encodeURI(str)
156
      // var n = new Audio(url)
157
      // n.src = url
158
      // n.play()
159
      var msg = new SpeechSynthesisUtterance(str)
160
      speechSynthesis.speak(msg)
161
      window.speechSynthesis.speak()
151 162
    },
152 163
    connect() {
153 164
      if (this.stompClient == null || !this.stompClient.connected()) {

+ 40 - 0
ebc-middle-platform/src/modules/orientation/orientation.scss

@ -165,6 +165,46 @@
165 165
      }
166 166
    }
167 167
}
168
.card-block{
169
  padding: 30px 20px 5px 10px;
170
  background-color: #edeef1;
171
  border-radius: 5px;
172
}
173
.card-block-progress{
174
  position: absolute;
175
  z-index: 1;
176
  right: 5px;
177
  top: 1px;
178
}
179
.card-block-time{
180
  font-size: 12px;
181
  position: absolute;
182
  z-index: 1;
183
  right: 5px;
184
  top: 1px;
185
}
186
.card-block-name{
187
  font-size: 12px;
188
  position: absolute;
189
  z-index: 1;
190
  left: 5px;
191
  top: 1px;
192
}
193
.track-label{
194
  position: absolute;
195
  z-index: 10;
196
  left: 240px;
197
  bottom: 50px;
198
  top: 130px;
199
  background-color: #ffffff;
200
  //font-size: 60px;
201
  line-height: 30px;
202
  overflow-y: auto;
203
  color: #fff;
204
  display: flex;
205
  padding: 10px 5px 10px 5px;
206
  border-radius: 5px;
207
}
168 208
.track-modal-container{
169 209
  display: flex;
170 210
  .track-modal-left{

+ 51 - 15
ebc-middle-platform/src/modules/orientation/orientation.vue

@ -127,7 +127,28 @@
127 127
            >导出至Excel</t-button
128 128
            >
129 129
          </div>
130
          <div id="track-map" style="height: 467.5px;"></div>
130
          <div>
131
            <div id="track-map" style="height: 467.5px;"></div>
132
            <div class="track-label">
133
              <t-timeline :horizontal="true">
134
135
136
                <t-timeline-item v-for="(item,index) in timelineList" :key="index" :time="item.time" >
137
                  <slot>
138
                    <div class="card card-has-border" style="width: 100px">
139
                      <div class="card-block">
140
                        <span class="card-block-name">{{ item.name }}</span>
141
                        <span class="card-block-time">{{ item.duration }}</span>
142
                        <div>
143
                          <t-progress :percent="item.proportion" hide-info></t-progress>
144
                        </div>
145
                      </div>
146
                    </div>
147
                  </slot>
148
                </t-timeline-item>
149
              </t-timeline>
150
            </div>
151
          </div>
131 152
        </div>
132 153
      </div>
133 154
    </t-modal>
@ -264,6 +285,26 @@ export default {
264 285
        normal: true
265 286
      },
266 287
      personList: [],
288
      timelineList: [
289
        {
290
          time: '2020.11.30',
291
          name: '码头',
292
          duration: '15min',
293
          proportion: 25
294
        },
295
        {
296
          time: '2020.11.30',
297
          name: '1#船舶',
298
          duration: '56min',
299
          proportion: 80
300
        },
301
        {
302
          time: '2020.11.30',
303
          name: '1#风机',
304
          duration: '45min',
305
          proportion: 45
306
        }
307
      ],
267 308
      rescuer: [],
268 309
      appointAlarmId: '',
269 310
      trackPerson: '',
@ -536,7 +577,6 @@ export default {
536 577
            if (e.coreEntityId == la.getAttributes().elementId) {
537 578
              if (la.point) {
538 579
                this.map.closePopup(la.point.popup)
539
                la.point.popup.remove()
540 580
                this.map.removeLayer(la.point)
541 581
              }
542 582
              console.log(la.getAttributes().elementId)
@ -572,11 +612,7 @@ export default {
572 612
      // this.loadMapArea()
573 613
      // this.loadCoreEntity()
574 614
    },
575
    getPopup(point, positionList, type, name, offset, url) {
576
      // if (point.popup) {
577
      //   point.popup.remove()
578
      //   point.popup = null
579
      // }
615
    getPopup(point, positionList, type, name, offset, url) { // 生成Popup
580 616
      var maxWidth = 100
581 617
      if (type) {
582 618
        maxWidth = 300
@ -614,21 +650,18 @@ export default {
614 650
      point.popup.setLatLng(point.getLatLng())
615 651
      // 设置弹出框弹出内容
616 652
      point.popup.setContent(content)
617
      if (this.switch1) {
618
        point.popup.openOn(this.map)
619
      } else {
620
        this.popClose(point.popup)
653
      point.popup.openo = this.switch1
654
      point.popup.openOn(this.map) // 需要先显示
655
      if (!this.switch1) { // 如果全局关闭则立即关闭
656
        this.map.closePopup(point.popup)
621 657
      }
622
      // point.popup = popup
623
      point.on('click', (e) => {
658
      point.on('click', (e) => { // 配置点击事件 点击开关
624 659
        if (point.popup.openo) {
625 660
          this.map.closePopup(point.popup)
626 661
        } else {
627 662
          point.popup.openOn(this.map)
628 663
        }
629 664
      })
630
      point.popup.openo = true
631
      // return point.popup
632 665
    },
633 666
    popClose(e) {
634 667
      e.popup.openo = false
@ -761,6 +794,9 @@ export default {
761 794
              this.map.addLayer(e.point)
762 795
              if (e.point.popup) {
763 796
                e.point.popup.openOn(this.map)
797
                if (!this.switch1) { // 如果全局关闭则立即关闭
798
                  this.map.closePopup(e.point.popup)
799
                }
764 800
              }
765 801
            }
766 802
          }

+ 61 - 0
security-protection-service/pom.xml

@ -35,6 +35,46 @@
35 35
36 36
        <dependency>
37 37
            <groupId>com.ai.bss</groupId>
38
            <artifactId>work-tool-service-api</artifactId>
39
            <version>2.1.5-SNAPSHOT</version>
40
        </dependency>
41
42
        <dependency>
43
            <groupId>com.ai.bss</groupId>
44
            <artifactId>work-tool-service</artifactId>
45
            <version>2.1.5-SNAPSHOT</version>
46
        </dependency>
47
48
        <dependency>
49
            <groupId>com.ai.bss</groupId>
50
            <artifactId>worker-service</artifactId>
51
            <version>2.1.5-SNAPSHOT</version>
52
            <exclusions>
53
                <exclusion>
54
                    <groupId>org.springframework.boot</groupId>
55
                    <artifactId>
56
                        spring-boot-starter-security
57
                    </artifactId>
58
                </exclusion>
59
            </exclusions>
60
        </dependency>
61
62
        <dependency>
63
            <groupId>com.ai.bss</groupId>
64
            <artifactId>characteristic-spec-service</artifactId>
65
            <version>2.1.5-SNAPSHOT</version>
66
        </dependency>
67
68
        <dependency>
69
            <groupId>com.ai.bss</groupId>
70
            <artifactId>work-attendance-service-api</artifactId>
71
            <version>2.1.5-SNAPSHOT</version>
72
        </dependency>
73
74
75
76
        <dependency>
77
            <groupId>com.ai.bss</groupId>
38 78
            <artifactId>system-user-service</artifactId>
39 79
            <version>2.1.5-SNAPSHOT</version>
40 80
            <exclusions>
@ -72,6 +112,27 @@
72 112
                </exclusion>
73 113
            </exclusions>
74 114
        </dependency>
115
116
        <!-- uspa登录拦截效验-->
117
118
        <dependency>
119
            <groupId>com.wframe</groupId>
120
            <artifactId>sso-util</artifactId>
121
            <version>1.2</version>
122
        </dependency>
123
124
        <!-- 缓存 -->
125
        <dependency>
126
            <groupId>com.ai.ipu</groupId>
127
            <artifactId>ipu-cache</artifactId>
128
            <version>3.1-SNAPSHOT</version>
129
            <exclusions>
130
                <exclusion>
131
                    <groupId>org.apache.logging.log4j</groupId>
132
                    <artifactId>log4j-slf4j-impl</artifactId>
133
                </exclusion>
134
            </exclusions>
135
        </dependency>
75 136
    </dependencies>
76 137
    <repositories>
77 138
        <repository>

+ 120 - 0
security-protection-service/src/main/java/com/ai/bss/security/protection/controller/AttendanceReportController.java

@ -0,0 +1,120 @@
1
package com.ai.bss.security.protection.controller;
2
3
4
import com.ai.abc.api.model.CommonRequest;
5
import com.ai.abc.api.model.CommonResponse;
6
import com.ai.bss.components.common.model.PageBean;
7
import com.ai.bss.security.protection.service.interfaces.AttendanceReportService;
8
import com.ai.bss.security.protection.util.EbcConstant;
9
import com.github.pagehelper.PageInfo;
10
import org.slf4j.Logger;
11
import org.slf4j.LoggerFactory;
12
import org.springframework.beans.factory.annotation.Autowired;
13
import org.springframework.stereotype.Controller;
14
import org.springframework.web.bind.annotation.RequestBody;
15
import org.springframework.web.bind.annotation.RequestMapping;
16
import org.springframework.web.bind.annotation.ResponseBody;
17
18
import java.util.Date;
19
import java.util.HashMap;
20
import java.util.List;
21
import java.util.Map;
22
23
/**
24
 * 考勤报表
25
 */
26
@Controller
27
@RequestMapping("/attendanceReport")
28
public class AttendanceReportController {
29
	Logger logger = LoggerFactory.getLogger(AttendanceReportController.class);
30
31
	@Autowired
32
	AttendanceReportService attendanceReportService;
33
34
	/**
35
	 * 分页查询考勤报表日报
36
	 * @param request 组合条件
37
	 *                                workDay : 日报日期 (yyyy-MM-dd格式),必选
38
	 *                                orgId:所属组织ID
39
	 *                                id:个人编码(员工编码)
40
	 *                                nameAsLike:姓名(模糊匹配)
41
	 *                                mainJobPositionId: 职位
42
	 */
43
44
	@ResponseBody
45
	@RequestMapping("/queryDailyAttendanceReport")
46
	public CommonResponse<PageBean<Map<String,Object>>> queryDailyAttendanceReport(@RequestBody CommonRequest<Map<String, Object>> request) throws Exception {
47
		// 当前页数
48
		int pageNumber = request.getPageNumber() < 1 ? 1 : request.getPageNumber();
49
		// 每页条数
50
		int pageSize = request.getPageSize() < 1 ? EbcConstant.DEFAULT_PAGE_SIZE : request.getPageSize();
51
52
		Map<String, Object> params = request.getData() == null ? new HashMap<String, Object>() : request.getData();
53
		CommonResponse<PageBean<Map<String,Object>>> commonResponse = attendanceReportService.queryDailyAttendanceReport(params, pageNumber, pageSize);
54
55
56
		return commonResponse;
57
58
	}
59
60
	/**
61
	 * 分页查询考勤报表月报
62
	 *  							month :月份 (yyyy-MM格式),必选
63
	 *                              orgId:所属组织ID,必选
64
	 *                              id:个人编码(员工编码)
65
	 *                              nameAsLike:姓名(模糊匹配)
66
	 *                              mainJobPositionId: 职位
67
	 */
68
69
	@ResponseBody
70
	@RequestMapping("/queryMonthlyAttendanceReport")
71
	public CommonResponse<PageBean<Map<String,Object>>> queryMonthlyAttendanceReport(@RequestBody CommonRequest<Map<String, Object>> request) throws Exception {
72
		// 当前页数
73
		int pageNumber = request.getPageNumber() < 1 ? 1 : request.getPageNumber();
74
		// 每页条数
75
		int pageSize = request.getPageSize() < 1 ? EbcConstant.DEFAULT_PAGE_SIZE : request.getPageSize();
76
77
		Map<String, Object> params = request.getData() == null ? new HashMap<String, Object>() : request.getData();
78
		CommonResponse<PageBean<Map<String,Object>>> commonResponse= attendanceReportService.queryMonthlyAttendanceReport(params, pageNumber, pageSize);
79
80
		return commonResponse;
81
82
	}
83
84
85
	/**
86
	 * 分页查询异常考勤
87
	 */
88
	@ResponseBody
89
	@RequestMapping("/queryPageAbnormalAttendance")
90
	public CommonResponse<PageBean<Map<String,Object>>> queryPageAbnormalAttendance(@RequestBody CommonRequest<Map<String, Object>> request) throws Exception {
91
		// 当前页数
92
		int pageNumber = request.getPageNumber() < 1 ? 1 : request.getPageNumber();
93
		// 每页条数
94
		int pageSize = request.getPageSize() < 1 ? EbcConstant.DEFAULT_PAGE_SIZE : request.getPageSize();
95
96
		Map<String, Object> params = request.getData() == null ? new HashMap<String, Object>() : request.getData();
97
		CommonResponse<PageBean<Map<String,Object>>> commonResponse= attendanceReportService.queryPageAbnormalAttendance(params, pageNumber, pageSize);
98
99
		return commonResponse;
100
101
102
	}
103
104
	/**
105
	 * 查询考勤详情
106
	 *  						id:个人编码(员工编码)
107
	 *                          beginDay:开始日期
108
	 *                          endDay: 结束日期
109
	 */
110
111
	@ResponseBody
112
	@RequestMapping("/queryAttendanceDetailReport")
113
	public CommonResponse<List<Map<String, Object>>> queryAttendanceDetailReport(@RequestBody CommonRequest<Map<String, Object>> request) throws Exception {
114
		Map<String, Object> params = request.getData() == null ? new HashMap<String, Object>() : request.getData();
115
		CommonResponse<List<Map<String, Object>>> commonResponse = attendanceReportService.queryAttendanceDetailReport(params);
116
		return commonResponse;
117
118
119
	}
120
}

+ 0 - 46
security-protection-service/src/main/java/com/ai/bss/security/protection/controller/abnormalAttendanceController.java

@ -1,46 +0,0 @@
1
package com.ai.bss.security.protection.controller;
2
3
import com.ai.bss.security.protection.service.interfaces.AreaInRecordService;
4
import com.github.pagehelper.PageInfo;
5
import org.slf4j.Logger;
6
import org.slf4j.LoggerFactory;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.stereotype.Controller;
9
import org.springframework.web.bind.annotation.RequestMapping;
10
import org.springframework.web.bind.annotation.ResponseBody;
11
12
import java.util.Date;
13
import java.util.Map;
14
15
/**
16
 * 异常考勤
17
 */
18
@Controller
19
@RequestMapping("/abnormalAttendance")
20
public class abnormalAttendanceController {
21
	Logger logger = LoggerFactory.getLogger(abnormalAttendanceController.class);
22
23
	@Autowired
24
	AreaInRecordService areaInRecordService;
25
26
	/**
27
	 * 分页查询考勤统计分析
28
	 */
29
30
	@ResponseBody
31
	@RequestMapping("/queryPageAttendanceCount")
32
	public PageInfo queryPageAttendanceCount(Map params) throws Exception {
33
		// 当前页数
34
		int pageNum = (int)params.get("pageNum") < 1 ? 1 : (int)params.get("pageNum");
35
		// 每页条数
36
		int pageSize = (int)params.get("pageSize") < 1 ? 1: (int)params.get("pageSize");
37
		if(params.get("currentDate")==null|| params.get("currentDate").equals("")){
38
			params.put("currentDate",new Date());
39
		}
40
		PageInfo pageInfo = areaInRecordService.queryPageAttendanceCount(params, pageNum, pageSize);
41
42
43
		return pageInfo;
44
45
	}
46
}

+ 3 - 3
security-protection-service/src/main/java/com/ai/bss/security/protection/controller/AreaInOutRecordController.java

@ -13,12 +13,12 @@ import java.util.Date;
13 13
import java.util.Map;
14 14
15 15
/**
16
 * 考勤管理
16
 * 进出记录
17 17
 */
18 18
@Controller
19 19
@RequestMapping("/areaInOutRecordManage")
20
public class AreaInOutRecordController {
21
	Logger logger = LoggerFactory.getLogger(AreaInOutRecordController.class);
20
public class areaInOutRecordController {
21
	Logger logger = LoggerFactory.getLogger(areaInOutRecordController.class);
22 22
23 23
	@Autowired
24 24
	AreaInRecordService areaInRecordService;

+ 0 - 46
security-protection-service/src/main/java/com/ai/bss/security/protection/controller/attendanceReportController.java

@ -1,46 +0,0 @@
1
package com.ai.bss.security.protection.controller;
2
3
import com.ai.bss.security.protection.service.interfaces.AreaInRecordService;
4
import com.github.pagehelper.PageInfo;
5
import org.slf4j.Logger;
6
import org.slf4j.LoggerFactory;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.stereotype.Controller;
9
import org.springframework.web.bind.annotation.RequestMapping;
10
import org.springframework.web.bind.annotation.ResponseBody;
11
12
import java.util.Date;
13
import java.util.Map;
14
15
/**
16
 * 考勤报表
17
 */
18
@Controller
19
@RequestMapping("/attendanceReport")
20
public class attendanceReportController {
21
	Logger logger = LoggerFactory.getLogger(attendanceReportController.class);
22
23
	@Autowired
24
	AreaInRecordService areaInRecordService;
25
26
	/**
27
	 * 分页查询考勤统计分析
28
	 */
29
30
	@ResponseBody
31
	@RequestMapping("/queryPageAttendanceCount")
32
	public PageInfo queryPageAttendanceCount(Map params) throws Exception {
33
		// 当前页数
34
		int pageNum = (int)params.get("pageNum") < 1 ? 1 : (int)params.get("pageNum");
35
		// 每页条数
36
		int pageSize = (int)params.get("pageSize") < 1 ? 1: (int)params.get("pageSize");
37
		if(params.get("currentDate")==null|| params.get("currentDate").equals("")){
38
			params.put("currentDate",new Date());
39
		}
40
		PageInfo pageInfo = areaInRecordService.queryPageAttendanceCount(params, pageNum, pageSize);
41
42
43
		return pageInfo;
44
45
	}
46
}

+ 75 - 0
security-protection-service/src/main/java/com/ai/bss/security/protection/service/impl/AttendanceReportServiceImpl.java

@ -0,0 +1,75 @@
1
package com.ai.bss.security.protection.service.impl;
2
3
import com.ai.abc.api.model.CommonRequest;
4
import com.ai.abc.api.model.CommonResponse;
5
import com.ai.bss.components.common.model.PageBean;
6
import com.ai.bss.security.protection.service.interfaces.AttendanceReportService;
7
import com.ai.bss.security.protection.util.EbcConstant;
8
import com.ai.bss.worker.service.api.AttendanceStatusQuery;
9
import lombok.SneakyThrows;
10
import org.springframework.beans.factory.annotation.Autowired;
11
import org.springframework.stereotype.Service;
12
13
import java.text.ParseException;
14
import java.util.List;
15
import java.util.Map;
16
17
/**
18
 * @Auther: 王超
19
 * @Date: 2020/11/30 10:58
20
 * @Description:
21
 */
22
23
@Service
24
public class AttendanceReportServiceImpl implements AttendanceReportService {
25
26
27
28
    @Autowired
29
    AttendanceStatusQuery attendanceStatusQuery;
30
    @Override
31
    public CommonResponse<PageBean<Map<String,Object>>> queryMonthlyAttendanceReport(Map<String, Object> params, int pageNumber, int pageSize) {
32
        CommonResponse<PageBean<Map<String,Object>>>  attendanceReport = null;
33
        try {
34
            attendanceReport = attendanceStatusQuery.queryMonthlyAttendanceReport((new CommonRequest<>(params,pageNumber,pageSize)));
35
        } catch (ParseException e) {
36
            e.printStackTrace();
37
        }
38
        return attendanceReport;
39
    }
40
41
    @Override
42
    public CommonResponse<PageBean<Map<String,Object>>> queryPageAbnormalAttendance(Map<String, Object> params, int pageNumber, int pageSize) {
43
        params.put("statusType", EbcConstant.ATTENDANCE_STATUSTYPE_ABNORMAL);
44
        CommonResponse<PageBean<Map<String,Object>>>  attendanceReport = null;
45
        try {
46
            attendanceReport = attendanceStatusQuery.queryMonthlyAttendanceReport((new CommonRequest<>(params,pageNumber,pageSize)));
47
        } catch (ParseException e) {
48
            e.printStackTrace();
49
        }
50
        return attendanceReport;
51
    }
52
53
54
    @Override
55
    public CommonResponse<List<Map<String, Object>>> queryAttendanceDetailReport(Map<String, Object> params) {
56
        CommonResponse<List<Map<String, Object>>> attendanceReportResponse =  null;
57
        try {
58
            attendanceReportResponse = attendanceStatusQuery.queryAttendanceDetailReport(new CommonRequest<>(params,1,10));
59
        } catch (ParseException e) {
60
            e.printStackTrace();
61
        }
62
        return attendanceReportResponse;
63
    }
64
65
    @Override
66
    public CommonResponse<PageBean<Map<String,Object>>> queryDailyAttendanceReport(Map<String, Object> params, int pageNumber, int pageSize) {
67
        CommonResponse<PageBean<Map<String,Object>>>  attendanceReport = null;
68
        try {
69
            attendanceReport = attendanceStatusQuery.queryDailyAttendanceReport((new CommonRequest<>(params,pageNumber,pageSize)));
70
        } catch (ParseException e) {
71
            e.printStackTrace();
72
        }
73
        return attendanceReport;
74
    }
75
}

+ 18 - 0
security-protection-service/src/main/java/com/ai/bss/security/protection/service/interfaces/AttendanceReportService.java

@ -0,0 +1,18 @@
1
package com.ai.bss.security.protection.service.interfaces;
2
3
import com.ai.abc.api.model.CommonResponse;
4
import com.ai.bss.components.common.model.PageBean;
5
import com.github.pagehelper.PageInfo;
6
7
import java.util.List;
8
import java.util.Map;
9
10
public interface AttendanceReportService {
11
    CommonResponse<PageBean<Map<String,Object>>> queryMonthlyAttendanceReport(Map<String, Object> params, int pageNumber, int pageSize);
12
13
    CommonResponse<PageBean<Map<String,Object>>> queryPageAbnormalAttendance(Map<String, Object> params, int pageNumber, int pageSize);
14
15
    CommonResponse<List<Map<String, Object>>> queryAttendanceDetailReport(Map<String, Object> params);
16
17
    CommonResponse<PageBean<Map<String,Object>>> queryDailyAttendanceReport(Map<String, Object> params, int pageNumber, int pageSize);
18
}

+ 37 - 0
security-protection-service/src/main/java/com/ai/bss/security/protection/util/EbcConstant.java

@ -0,0 +1,37 @@
1
package com.ai.bss.security.protection.util;
2
3
/**
4
 * 业务常量
5
 * @author konghl@asiainfo.com
6
 * 2020-10-20
7
 */
8
public class EbcConstant {
9
	// 下拉列表最大查询条数
10
	public static final int COMBOBOX_MAXNUM = 30;
11
12
	// 每页默认查询条数
13
	public static final int DEFAULT_PAGE_SIZE = 20;
14
15
16
	// 异常考勤查询常量异常取值 abnormal,
17
	public static final String ATTENDANCE_STATUSTYPE_ABNORMAL = "ABNORMAL";
18
19
	// 异常考勤查询常量正常取值normal
20
	public static final String ATTENDANCE_STATUSTYPE_NORMAL = "NORMAL";
21
22
	// 轨迹回放单次查询条数
23
	public static final int TRACK_PLAYBACK_SIZE = 100;
24
25
26
	// 考勤查询:日
27
	public static final String AREA_IN_OUT_RECORD_DAY = "day";
28
29
	// 考勤查询:周
30
	public static final String AREA_IN_OUT_RECORD_WEEK = "week";
31
32
	// 考勤查询:月
33
	public static final String AREA_IN_OUT_RECORD_MONTH = "month";
34
35
	
36
	
37
}

+ 15 - 11
security-protection-service/src/main/resources/application.properties

@ -1,10 +1,18 @@
1 1
spring.application.name=WorkTaskSpec
2
3
4
#server.servlet.context-path=/ipu
5
2 6
server.port=8018
3 7
4 8
server.servlet.context-path=/sp
5 9
6 10
# DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
7 11
#spring.datasource.url=jdbc:mysql://localhost:3306/cmp
12
#spring.datasource.url=jdbc:mysql://10.11.20.120:3306/common_frm?serverTimezone=Asia/Shanghai&characterEncoding=utf-8&verifyServerCertificate=false&useSSL=false&requireSSL=false
13
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
14
#spring.datasource.username=comon_frm
15
#spring.datasource.password=1qaz@WSX
8 16
spring.datasource.url=jdbc:mysql://10.19.90.34:3307/energy?serverTimezone=Asia/Shanghai&characterEncoding=utf-8&verifyServerCertificate=false&useSSL=false&requireSSL=false
9 17
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
10 18
spring.datasource.username=ebc
@ -20,18 +28,18 @@ spring.jpa.properties.hibernate.generate_statistics=false
20 28
spring.main.allow-bean-definition-overriding=true
21 29
22 30
#kafka
23
kafka.bootstrap-servers=47.105.160.21:9090
24
#kafka.bootstrap-servers=10.19.90.34:2182
25
#kafka.topic.deviceLocation=Topic_IoT_DeviceLocation
26
#kafka.topic.alarm=Topic_IoT_IndividualAlarm
27
kafka.topic.deviceLocation=DeviceLocationA
28
kafka.topic.alarm=IndividualAlarmA
31
#kafka.bootstrap-servers=47.105.160.21:9090
32
kafka.bootstrap-servers=10.19.90.34:9090
33
kafka.topic.deviceLocation=Topic_IoT_DeviceLocation_111
34
kafka.topic.alarm=Topic_IoT_IndividualAlarm_111
35
#kafka.topic.deviceLocation=DeviceLocationA
36
#kafka.topic.alarm=IndividualAlarmA
29 37
kafka.producer.batch-size=16785
30 38
kafka.producer.retries=1
31 39
kafka.producer.buffer-memory=33554432
32 40
kafka.producer.linger=1
33 41
kafka.consumer.auto-offset-reset=latest
34
kafka.consumer.max-poll-records=3100
42
kafka.consumer.max-poll-records=20
35 43
kafka.consumer.enable-auto-commit=false
36 44
kafka.consumer.auto-commit-interval=1000
37 45
kafka.consumer.session-timeout=20000
@ -41,7 +49,6 @@ kafka.listener.batch-listener=false
41 49
kafka.listener.concurrencys=3,6
42 50
kafka.listener.poll-timeout=1500
43 51
44
45 52
# CACHE
46 53
#spring.cache.type=ehcache
47 54
#spring.cache.ehcache.config=ehcache.xml
@ -49,6 +56,3 @@ kafka.listener.poll-timeout=1500
49 56
# LOGGING
50 57
logging.level.com.ai=debug
51 58
logging.level.org.springframework.data=debug
52
53
# \u5f15\u5165gis\u548ciot\u7684\u914d\u7f6e\u6587\u4ef6
54
spring.profiles.active=iot,gis