baibx il y a 4 mois
Parent
commit
8fa5c44077

+ 10 - 1
com.sharemao.core.task/src/main/java/com/sharemao/core/task/iot2/ct/RealNameV2.java

@@ -2,6 +2,7 @@ package com.sharemao.core.task.iot2.ct;
2
 
2
 
3
 import com.nianzai.base.dao.util.DAOHelper;
3
 import com.nianzai.base.dao.util.DAOHelper;
4
 import com.nianzai.util.DateTimeUtil;
4
 import com.nianzai.util.DateTimeUtil;
5
+import com.nianzai.util.Tools;
5
 import com.sharemao.core.task.iot.bw.BW;
6
 import com.sharemao.core.task.iot.bw.BW;
6
 import org.apache.commons.logging.Log;
7
 import org.apache.commons.logging.Log;
7
 import org.apache.commons.logging.LogFactory;
8
 import org.apache.commons.logging.LogFactory;
@@ -30,13 +31,21 @@ public class RealNameV2 {
30
 		{
31
 		{
31
 			for(Map<String,Object> m:simlist)
32
 			for(Map<String,Object> m:simlist)
32
 			{
33
 			{
34
+                if (m.get("iccid")==null||Tools.isEmpty(m.get("iccid").toString())){
35
+                    continue;
36
+                }
33
 				String iccid=m.get("iccid").toString();
37
 				String iccid=m.get("iccid").toString();
34
 				int kasid=Integer.parseInt(m.get("kasid").toString());
38
 				int kasid=Integer.parseInt(m.get("kasid").toString());
35
                 String token=CTAPI.getToken(kasid);
39
                 String token=CTAPI.getToken(kasid);
36
 				if (kasid==27) {
40
 				if (kasid==27) {
37
 					iccid = iccid.toUpperCase();
41
 					iccid = iccid.toUpperCase();
38
 				}
42
 				}
39
-				String resettm=m.get("resettm")==null?"":m.get("resettm").toString();
43
+                String resettm="";
44
+                String sqli="SELECT resettm FROM `iccidtemp` where iccid='"+iccid+"'";
45
+                List<Map<String,Object>> resettmList=DAOHelper.find("ufiiccid", sqli);
46
+                if (resettmList!=null && !resettmList.isEmpty() && resettmList.get(0)!=null && resettmList.get(0).get("resettm")!=null){
47
+                    resettm = resettmList.get(0).get("resettm").toString();
48
+                }
40
 				String status;
49
 				String status;
41
                 if (kasid==59){
50
                 if (kasid==59){
42
                     status = CTAPI.zysm(iccid,resettm);
51
                     status = CTAPI.zysm(iccid,resettm);

+ 2 - 16
com.sharemao.web.manager/src/main/java/test/SMD.java

@@ -37,25 +37,11 @@ public class SMD
37
 {
37
 {
38
 	public static void main(String[] args) throws Exception 
38
 	public static void main(String[] args) throws Exception 
39
 	{
39
 	{
40
-//		sim2();
40
+		sim2();
41
 //        updrv();
41
 //        updrv();
42
 //        show();
42
 //        show();
43
 
43
 
44
-        int t=0;
45
-        StringBuilder sb = new StringBuilder();
46
-        for (int i = 0; i < 32; i++) {
47
-            String sql="select devid from device"+i+" where mode = 6 or mode =7 or mode=8";
48
-            List<Map<String, Object>> devices =RCPService.getMifiService().getMapList(sql);
49
-            t += devices.size();
50
-            if (devices != null) {
51
-                devices.stream().forEach(item -> {
52
-                    String devid = String.valueOf(item.get("devid"));
53
-                    sb.append(",'").append(devid).append("'");
54
-                });
55
-            }
56
-        }
57
-        System.out.println("("+sb.substring(1)+")");
58
-        System.out.println(t);
44
+
59
     }
45
     }
60
 
46
 
61
 	//内置卡1入库
47
 	//内置卡1入库

+ 1 - 2
com.shuhaiwifi.web.auth2/src/main/java/com/shuhaiwifi/web/auth2/iot/Iot.java

@@ -9,7 +9,7 @@ public class Iot
9
 	public static int wx=5;//五兴4G移动卡
9
 	public static int wx=5;//五兴4G移动卡
10
 	public static int yljs=6;//亿联4G移动(江苏移动)
10
 	public static int yljs=6;//亿联4G移动(江苏移动)
11
 	public static int zy=7;//中亿4G移动卡
11
 	public static int zy=7;//中亿4G移动卡
12
-	public static int bmbjyd=8;//铂明
12
+	public static int bmyd=8;//铂明
13
 	public static int bmlcyd=9;//铂明C4870聊城移动
13
 	public static int bmlcyd=9;//铂明C4870聊城移动
14
 	public static int wx2=10;//五兴4G移动卡
14
 	public static int wx2=10;//五兴4G移动卡
15
 	public static int lxxj=11;//龙鑫新疆移动
15
 	public static int lxxj=11;//龙鑫新疆移动
@@ -17,7 +17,6 @@ public class Iot
17
 	public static int lxqh=13;//龙鑫青海移动
17
 	public static int lxqh=13;//龙鑫青海移动
18
 	public static int lxgz=14;//龙鑫贵州移动
18
 	public static int lxgz=14;//龙鑫贵州移动
19
 	public static int whhnyd=15;//文航河南移动
19
 	public static int whhnyd=15;//文航河南移动
20
-    public static int bmgdyd=16;//铂明广东移动
21
 
20
 
22
 	public static String getOprtStr(String iccid)
21
 	public static String getOprtStr(String iccid)
23
 	{
22
 	{

+ 47 - 46
com.shuhaiwifi.web.auth2/src/main/java/com/shuhaiwifi/web/auth2/iot/ThirdToken.java

@@ -190,53 +190,54 @@ public class ThirdToken {
190
 				}
190
 				}
191
 			}
191
 			}
192
 		}
192
 		}
193
-		if(kasid==Iot.bmbjyd || kasid==Iot.bmlcyd || kasid==Iot.bmgdyd) {
194
-			String appId="",openId="",channelId="";
195
-			if (kasid==Iot.bmbjyd) {
196
-				appId="C5010100A23100111720247";
197
-				openId="GFLaxxfVMG4DGkgcdZEEg4zexmje3dq4";
198
-				channelId="236";
199
-			} else if (kasid==Iot.bmlcyd){
200
-				appId="C5010531Aq5201817914";
201
-				openId="GFLaxxfVMG4DGkgcdZEEg4zexmje3dq4";
202
-				channelId="216";
203
-			} else {
204
-                appId="C5010200A9992002368004";
205
-                openId="GFLaxxfVMG4DGkgcdZEEg4zexmje3dq4";
206
-                channelId="239";
193
+        if (kasid==Iot.bmlcyd){
194
+            String appId="C5010531Aq5201817914";
195
+            String openId="GFLaxxfVMG4DGkgcdZEEg4zexmje3dq4";
196
+            String channelId="216";
197
+            Map<String, String> receivedData = new HashMap<String, String>();
198
+            String times=String.valueOf(System.currentTimeMillis()/1000);
199
+            receivedData.put("times", times);
200
+            receivedData.put("appId", appId);
201
+            receivedData.put("channelId", channelId);
202
+            TreeMap<String, String> sortedData = new TreeMap<>(receivedData);
203
+            // 构建待签名字符串
204
+            StringBuilder stringA = new StringBuilder();
205
+            stringA.append(openId);
206
+            for (Map.Entry<String, String> entry : sortedData.entrySet()) {
207
+                String key = entry.getKey();
208
+                String value = entry.getValue();
209
+                if (value != null && !value.isEmpty() && !"sign".equals(key) ) {
210
+                    stringA.append(key).append(value);
211
+                }
212
+            }
213
+            // 拼接key,并进行MD5运算
214
+            stringA.append(openId);
215
+            String signValue = SecureUtil.sha1((stringA.toString())).toUpperCase();
216
+            String url="http://db.jinmaiiot.com:7021/api/external/getDeviceToken?appId="+appId+"&openId="+openId+"&times="+times+"&sign="+signValue+"&channelId="+channelId;
217
+            logger.info("bmlcyd>>>"+url);
218
+            String content= HttpUtil.get(url);
219
+            logger.info(content);
220
+            JSONObject resJson = JSONObject.parseObject(content);
221
+            JSONArray result=resJson.getJSONArray("result");
222
+            int status=resJson.getIntValue("status");
223
+            if(status==0) {
224
+                resJson=JSONObject.parseObject(String.valueOf(result.get(0)));
225
+                token=resJson.getString("token");
226
+                logger.info(token);
227
+            }
228
+        }
229
+		if(kasid==Iot.bmyd) {
230
+            String url="http://db.jinmaiiot.com:7021/query/queryYd?method=deviceToken&openId=GFLaxxfVMG4DGkgcdZEEg4zexmje3dq4&msisdn=1442352353017";
231
+            logger.info("bmyd>>>"+url);
232
+            String content= HttpUtil.get(url);
233
+            logger.info(content);
234
+            JSONObject resJson = JSONObject.parseObject(content);
235
+            JSONObject result=resJson.getJSONObject("result");
236
+            int status=resJson.getIntValue("code");
237
+            if(status==0) {
238
+                token=result.getString("token");
239
+                logger.info(token);
207
             }
240
             }
208
-			Map<String, String> receivedData = new HashMap<String, String>();
209
-			String times=String.valueOf(System.currentTimeMillis()/1000);
210
-			receivedData.put("times", times);
211
-			receivedData.put("appId", appId);
212
-			receivedData.put("channelId", channelId);
213
-			TreeMap<String, String> sortedData = new TreeMap<>(receivedData);
214
-			// 构建待签名字符串
215
-			StringBuilder stringA = new StringBuilder();
216
-			stringA.append(openId);
217
-			for (Map.Entry<String, String> entry : sortedData.entrySet()) {
218
-			    String key = entry.getKey();
219
-			    String value = entry.getValue();
220
-			    if (value != null && !value.isEmpty() && !"sign".equals(key) ) {
221
-			        stringA.append(key).append(value);
222
-			    }
223
-			}
224
-			// 拼接key,并进行MD5运算
225
-			stringA.append(openId);
226
-			System.out.println(stringA.toString());
227
-			String signValue = SecureUtil.sha1((stringA.toString())).toUpperCase();
228
-			String url="http://db.jinmaiiot.com:7021/api/external/getDeviceToken?appId="+appId+"&openId="+openId+"&times="+times+"&sign="+signValue+"&channelId="+channelId;
229
-			logger.info("bmyd>>>"+url);
230
-			String content= HttpUtil.get(url);
231
-			logger.info(content);
232
-			JSONObject resJson = JSONObject.parseObject(content);
233
-			JSONArray result=resJson.getJSONArray("result");
234
-			int status=resJson.getIntValue("status");
235
-			if(status==0) {
236
-				resJson=JSONObject.parseObject(String.valueOf(result.get(0)));
237
-				token=resJson.getString("token");
238
-	        	logger.info(token);
239
-			}
240
 		}
241
 		}
241
 		if(kasid==Iot.lxxj || kasid==Iot.lxyn || kasid==Iot.lxqh || kasid==Iot.lxgz) {
242
 		if(kasid==Iot.lxxj || kasid==Iot.lxyn || kasid==Iot.lxqh || kasid==Iot.lxgz) {
242
 			String appId="";
243
 			String appId="";