| | |
| | | |
| | | import java.awt.geom.Point2D; |
| | | import java.io.Console; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Vector; |
| | | |
| | | import com.hxzkoa.json.tb_fence; |
| | | import com.hxzkoa.json.tb_map; |
| | |
| | | String[] dis = message.split(","); |
| | | // 3[tagid] :标签的ID号,唯一编号 |
| | | String tagid = dis[2]; |
| | | System.out.print("dis:"+dis); |
| | | //System.out.print("dis:"+dis); |
| | | // 4包序(0~255循环) |
| | | String baoxu = dis[3]; |
| | | // 5时间戳(这条报文发出的时间) |
| | |
| | | .toBean(JSONObject.fromObject(re_warning_bw.get("result").toString()), tb_warning.class); |
| | | // 判断标签是否存在 |
| | | |
| | | System.out.print("re_warning"+re_warning); |
| | | //System.out.print("re_warning"+re_warning); |
| | | tb_warning warning = new tb_warning(); |
| | | if (re_tag != null) { |
| | | int powerint = Integer.parseInt(tag.getPower()); |
| | |
| | | jsonObject = JSONObject.fromObject(tag); |
| | | JSONObject re_realAttendance_bw = HttpUtil.doPost(url_realAttendance_bw, jsonObject.toString(), |
| | | Config.getCharset()); |
| | | System.out.print(re_realAttendance_bw); |
| | | //System.out.print(re_realAttendance_bw); |
| | | if (re_realAttendance_bw!=null){ |
| | | tb_realkaoqing realkaoqing = (tb_realkaoqing) JSONObject.toBean( |
| | | JSONObject.fromObject(re_realAttendance_bw.get("result").toString()), tb_realkaoqing.class); |
| | |
| | | boolean zai = IsInStartAndEndTime.belongCalendar(intime, startime, stoptime);// 判断是否在围栏生效的时间内 |
| | | // 在围栏生效时间内 |
| | | if (zai) { |
| | | boolean ispoly = IsPtInPoly.inPoly(point, fence.getPts());// 判断ID坐标是否在围栏区域内 |
| | | Vector<Point2D.Double> pts = new Vector<Point2D.Double>(); |
| | | boolean ispoly = IsPtInPoly.inPoly(point, pts);// 判断ID坐标是否在围栏区域内 |
| | | // 如果在考勤区域内 |
| | | if (ispoly) { |
| | | // 判断在不在实时考勤集合中,如果不在则需要添加一条记录 |
| | |
| | | boolean zai = IsInStartAndEndTime.belongCalendar(intime, startime, stoptime);// 判断是否在围栏生效的时间内 |
| | | // 在围栏生效时间内 |
| | | if (zai) { |
| | | boolean ispoly = IsPtInPoly.inPoly(point, fence.getPts());// 判断ID坐标是否在围栏区域内 |
| | | Vector<Point2D.Double> pts = new Vector<Point2D.Double>(); |
| | | boolean ispoly = IsPtInPoly.inPoly(point, pts);// 判断ID坐标是否在围栏区域内 |
| | | // 如果在告警区域内 |
| | | if (ispoly) { |
| | | // 判断在不在实时告警集合中,如果不在则需要添加一条记录 |
| | |
| | | tb_xunjianbaobiao xunjianbaobiao = new tb_xunjianbaobiao(); |
| | | |
| | | // 判断标签坐标是否在生效的围栏区域内如果在则执行 |
| | | if (IsPtInPoly.inPoly(point, tb_fenceList.get(i).getPts())) { |
| | | Vector<Point2D.Double> pts = new Vector<Point2D.Double>(); |
| | | if (IsPtInPoly.inPoly(point, pts)) { |
| | | |
| | | // 通过区域名称找到该巡检区域对象 |
| | | // Tb_xunjianset xjs = |