konghl 4 anni fa
parent
commit
5c299da82a

+ 0 - 2
location-rescue-service/pom.xml

165
165
166
166
167
167
168
    <!--
169
    <repositories>
168
    <repositories>
170
        <repository>
169
        <repository>
171
            <id>mgpd</id>
170
            <id>mgpd</id>
187
            </snapshots>
186
            </snapshots>
188
        </pluginRepository>
187
        </pluginRepository>
189
    </pluginRepositories>
188
    </pluginRepositories>
190
    -->
191
189
192
    <build>
190
    <build>
193
191

+ 1 - 0
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/impl/DeviceManageServiceImpl.java

215
        return result;
215
        return result;
216
    }
216
    }
217
217
218
    @Override
218
    public List<Map<String, String>> queryDeviceTypeList() {
219
    public List<Map<String, String>> queryDeviceTypeList() {
219
        CharacteristicSpec characteristicSpec = characteristicSpecService
220
        CharacteristicSpec characteristicSpec = characteristicSpecService
220
                .findBusinessSpecByCharSpecCode(EbcConstant.BUSINESS_SPEC_PRODUCT_TYPE);
221
                .findBusinessSpecByCharSpecCode(EbcConstant.BUSINESS_SPEC_PRODUCT_TYPE);

+ 0 - 1
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/task/TimingTask.java

9
9
10
import com.ai.abc.api.model.CommonRequest;
10
import com.ai.abc.api.model.CommonRequest;
11
import com.ai.abc.api.model.CommonResponse;
11
import com.ai.abc.api.model.CommonResponse;
12
import com.ai.bss.location.rescue.service.impl.AlarmManagementServiceImpl;
13
import com.ai.bss.location.rescue.util.DateUtil;
12
import com.ai.bss.location.rescue.util.DateUtil;
14
import com.ai.bss.position.service.api.EntityPositionCommand;
13
import com.ai.bss.position.service.api.EntityPositionCommand;
15
14

+ 1 - 1
location-rescue-service/src/main/java/com/ai/bss/location/rescue/util/HttpServiceUtil.java

40
 *
40
 *
41
 * @author chencai
41
 * @author chencai
42
 */
42
 */
43
@Slf4j
44
public class HttpServiceUtil {
43
public class HttpServiceUtil {
45
	static Logger log = LoggerFactory.getLogger(HttpServiceUtil.class);
44
	static Logger log = LoggerFactory.getLogger(HttpServiceUtil.class);
46
45
192
		httpGet.addHeader(HTTP.CONTENT_TYPE, HTTP_CONTENT_TYPE_JSON);
191
		httpGet.addHeader(HTTP.CONTENT_TYPE, HTTP_CONTENT_TYPE_JSON);
193
		CloseableHttpResponse response = null;
192
		CloseableHttpResponse response = null;
194
		try {
193
		try {
194
			log.debug("调用北向接口:url= " + url);
195
			response = (CloseableHttpResponse) httpClient.execute(httpGet);
195
			response = (CloseableHttpResponse) httpClient.execute(httpGet);
196
		} catch (Exception e) {
196
		} catch (Exception e) {
197
			log.error("sendGet Exception: " + e.getMessage());
197
			log.error("sendGet Exception: " + e.getMessage());

+ 7 - 4
location-rescue-service/src/main/java/com/ai/bss/location/rescue/util/NorthboundInterfaceUtil.java

7
import org.slf4j.Logger;
7
import org.slf4j.Logger;
8
import org.slf4j.LoggerFactory;
8
import org.slf4j.LoggerFactory;
9
import org.springframework.beans.factory.annotation.Value;
9
import org.springframework.beans.factory.annotation.Value;
10
import org.springframework.context.annotation.Configuration;
10
import org.springframework.stereotype.Component;
11
11
12
import com.alibaba.fastjson.JSON;
12
import com.alibaba.fastjson.JSON;
13
import com.alibaba.fastjson.JSONObject;
13
import com.alibaba.fastjson.JSONObject;
17
 *
17
 *
18
 * @date 2010/09/24 23:42
18
 * @date 2010/09/24 23:42
19
 */
19
 */
20
@Configuration
20
//@Configuration
21
@Component
21
public class NorthboundInterfaceUtil {
22
public class NorthboundInterfaceUtil {
22
23
23
    private static final Logger logger = LoggerFactory.getLogger(NorthboundInterfaceUtil.class);
24
    private static final Logger logger = LoggerFactory.getLogger(NorthboundInterfaceUtil.class);
46
        Map<String, Object> resultMap = new HashMap<String, Object>();
47
        Map<String, Object> resultMap = new HashMap<String, Object>();
47
        Map<String, String> signMap = new HashMap<String, String>();
48
        Map<String, String> signMap = new HashMap<String, String>();
48
49
49
        // 1.在缓存中获取sessionId与sign
50
        // 1.在缓存中获取sign与sessionId
50
        Object sign =CacheUtil.getCache("ebc_iot_north_sign");
51
        Object sign =CacheUtil.getCache("ebc_iot_north_sign");
51
        Object session_id = CacheUtil.getCache("ebc_iot_north_session_id");
52
        Object session_id = CacheUtil.getCache("ebc_iot_north_session_id");
52
53
53
        if (sign == null ) {
54
        if (session_id == null ) {
54
            // 2.如果没有调用登录接口从新获取
55
            // 2.如果没有调用登录接口从新获取
56
            logger.debug("未从缓存中获取北向接口的sessionId");
55
            signMap = iotLogin();
57
            signMap = iotLogin();
56
58
57
            if (signMap == null) {
59
            if (signMap == null) {
60
            }
62
            }
61
63
62
        } else {
64
        } else {
65
            logger.debug("已从缓存中获取北向接口的sessionId");
63
            signMap.put("ebc_iot_north_sign", String.valueOf(sign));
66
            signMap.put("ebc_iot_north_sign", String.valueOf(sign));
64
            signMap.put("ebc_iot_north_session_id", String.valueOf(session_id));
67
            signMap.put("ebc_iot_north_session_id", String.valueOf(session_id));
65
68

+ 8 - 7
location-rescue-service/src/main/resources/ipu-cache.xml

3
	<cache name="ssn" type="redis">
3
	<cache name="ssn" type="redis">
4
		<servers>
4
		<servers>
5
	        <!-- 如果不是cluster,则只使用第一个redis -->
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" />
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
			<server ip="10.19.90.34" port="7106" />
12
	    </servers>
13
	    </servers>
13
		<!-- 客户端类型:Jedis,JedisCluster -->
14
		<!-- 客户端类型:Jedis,JedisCluster -->
14
	    <config name="clientType" value="JedisCluster"/>
15
	    <config name="clientType" value="Jedis"/>
15
	    <!-- 访问redis的密码,可以为空 -->
16
	    <!-- 访问redis的密码,可以为空 -->
16
	    <config name="auth" value="Ipu@321!"/>
17
	    <config name="auth" value="Ipu@321!"/>
17
	    <!-- redis池的可用连接实例的最大数目,缺省为8 -->
18
	    <!-- redis池的可用连接实例的最大数目,缺省为8 -->