// 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>

更新摇一摇利用系统截屏的功能 · f843fb9404 - Nuosi Git Service
Przeglądaj źródła

更新摇一摇利用系统截屏的功能

leijie 4 lat temu
rodzic
commit
f843fb9404

+ 1 - 1
show-server/src/main/webapp/biz/js/plugins/sensor.js

@ -31,7 +31,7 @@ require(["ipuMobile","jcl","jquery","ipuUI"], function(IpuMobile,jcl,$,ipuUI) {
31 31
                }
32 32
                $("#screenCapture_path").html("回调结果:" + path);
33 33
                $("#screenCapture_pic").html("<img src='" + path + "' style='max-width:60%;'/>");
34
            },0,"/sdcard/pic/testPic.png",paintData.toString(),"IPU应用将截取您屏幕上显示的所有内容");
34
            },0,"/sdcard/pic/testPic.png",paintData.toString(),0,"IPU应用将截取您屏幕上显示的所有内容");
35 35
            // var type = 0;
36 36
            // var isSaveToPhoto = 1;
37 37
            // IpuMobile.noStatusScreenCapture(function(path) {

+ 2 - 2
show-server/src/main/webapp/ipu/frame/mobile/expand-mobile.js

@ -639,9 +639,9 @@ define(["require", "jcl"], function (require, Wade) {
639 639
      }, stopShakingListener: function () {
640 640
        storageCallback("stopShakingListener", callback);
641 641
        execute("stopShakingListener", [isApp]);
642
      }, captureGraffitiPic: function (callback, type, info, paintData, title) {
642
      }, captureGraffitiPic: function (callback, type, info, paintData,captureType,title) {
643 643
        storageCallback("captureGraffitiPic", callback);
644
        execute("captureGraffitiPic", [type, info, paintData, title]);
644
        execute("captureGraffitiPic", [type, info, paintData, captureType,title]);
645 645
      }, graffitiPic: function (callback, type, info, paintData) {
646 646
        storageCallback("graffitiPic", callback);
647 647
        execute("graffitiPic", [type, info, paintData]);

android-share - Nuosi Git Service

ipu的trunk版的android工程和服务端工程。

yangbiao 7b3513ac7e aa 10 anni fa
..
bin 7b3513ac7e aa 10 anni fa
build 22bd19543c 初始化 10 anni fa
etc 95ca34ee42 fix some bug 10 anni fa
src 22bd19543c 初始化 10 anni fa
web 7b3513ac7e aa 10 anni fa
.gitignore 22bd19543c 初始化 10 anni fa
.project 22bd19543c 初始化 10 anni fa