jichaobo 3 лет назад
Родитель
Сommit
70c0d87e1a

+ 2 - 2
WebRoot/view/frontpage/js/map.js

@@ -407,7 +407,7 @@ var draw_all = function(){
 			d7a += obj.d7a;
 			d7oc+= obj.d7oc;
 			d7ac+= obj.d7ac;
-			if((obj.lat>30)&&(obj.lat<33)&&(obj.lng>120)&&(obj.lng<125)){
+			if((obj.lat>30)&&(obj.lat<40)&&(obj.lng>120)&&(obj.lng<125)){
 				totalLng += obj.lng;
 				totalLat += obj.lat;
 				latngCount++;
@@ -613,7 +613,7 @@ var chk_company_cur = function(idx){
 		if(idx>=StatusStore.length)
 			idx = 0;
 		var obj = StatusStore[idx];
-		if((obj.lat>30)&&(obj.lat<33)&&(obj.lng>120)&&(obj.lng<125))
+		if((obj.lat>30)&&(obj.lat<40)&&(obj.lng>120)&&(obj.lng<125))
 			return idx;
 		nrow++;
 		if(nrow>=StatusStore.length)

+ 23 - 2
src/cn/com/usky/iot/alarm/service/YtiotVAlarmServiceImpl.java

@@ -2980,6 +2980,9 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
 		String data2 = null;
 		JSONObject q_json = null;
 		JSONObject json = new JSONObject();
+		String Sql = null;
+		List pl_list = null;
+
 		json.put("action", "updateHj");
 		if(queryJson!=null) {
 			q_json = JSONObject.fromObject(queryJson);
@@ -3010,13 +3013,13 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
 				if(Integer.parseInt(confirmAll)==1) {
 					hqlwhere = " where u.id.deviceCode='"+device_code+"' and u.id.name='"+name+"' and u.id.status='"+status+"' and u.id.data4='"+data4+"' and u.id.data2='"+data2+"' and u.id.clzt=0";
 					sqlwhere = " where device_code='"+device_code+"' and name='"+name+"' and status='"+status+"' and data4='"+data4+"' and data2='"+data2+"' and clzt=0";
+					Sql="SELECT * from ytiot_v_hj WHERE device_code='"+device_code+"' AND clzt=0 and data4='"+data4+"' and data2='"+data2+"'";
+					pl_list = ytiotVAlarmDao.queryBySQL(Sql);
 				}else {
 					hqlwhere = " where u.id.id="+id+" ";
 					sqlwhere = " where id="+id+" ";
 				}
 				int RowCount = ytiotVAlarmDao.getHJCount(hqlwhere);
-//				System.out.println("火警测试1"+hqlwhere);
-//				System.out.println("火警测试2"+sqlwhere);
 				if(RowCount>0) {
 					ytiotVAlarmDao.execSQL(" update ytiot_v_hj2 set clwb='"+clwb+"', clnr='"+clnr+"', clzt=1 , clsj=now(), clr='"+V_LOGINNAME+"' "+sqlwhere);
 					System.out.println(" update ytiot_v_hj2 set clwb='"+clwb+"', clnr='"+clnr+"', clzt=1 , clsj=now(), clr='"+V_LOGINNAME+"' "+sqlwhere);
@@ -3030,6 +3033,24 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
 
 						com.alibaba.fastjson.JSONObject jsonObject = HttpClientUtils.doPost("http://47.98.201.187:55335/report", null,json1);
 //					System.out.println("jsonObject = " + jsonObject);
+					}else{
+						if (pl_list.isEmpty()==false){
+							int Nrow = 0;
+							for(Iterator iterator = pl_list.iterator();iterator.hasNext();){
+								Object[] objects = (Object[]) iterator.next();
+								HashMap<String, Object> map = new HashMap<>();
+								System.out.println(objects[0]);
+								map.put("SubType",1);
+								map.put("DeviceId",device_code);
+								map.put("InsertId",objects[0]);
+								map.put("Confirmed",true);
+								com.alibaba.fastjson.JSONObject json1 = new com.alibaba.fastjson.JSONObject(map);
+								System.out.println(json1);
+								com.alibaba.fastjson.JSONObject jsonObject = HttpClientUtils.doPost("http://47.98.201.187:55335/report", null,json1);
+								Nrow++;
+							}
+						}
+
 					}
 					json.put("activerow", RowCount);
 					json.put("success", "true");