package person; import java.util.Iterator; import java.util.List; import java.util.Vector; import javax.swing.ImageIcon; import DataBase.DatabaseManagement; import Judge.JugeNumber; import Method.BaoWenShow; import Method.ControTag; import Method.GetNowTime; import Method.InsertData; import PbuliClass.Music; import PbuliClass.ShowMessage; import PbuliClass.Systems; import home.Open_soft_dialog; import jiekou.display; import tag.Tag_Dell; import tbDataModel_Dell.Department; import tbDataModel_Dell.Department_Dell; import tbDataModel_Dell.Tb_Warnig_Dell; import urt.Urt_read; @SuppressWarnings("rawtypes") public class person_Dell { static Vector person_vector=new Vector<>();//ÈËÔ±µÄ¼¯ºÏµÄ¼¯ºÏ static Vector noinperson_vector=new Vector<>();//ÈËÔ±µÄ¼¯ºÏµÄ¼¯ºÏ static { Open_soft_dialog.addara("¼ÓÔØtb_person"); Iterator iterator = DatabaseManagement.table_AandD("tb_person","DESC").iterator(); while (iterator.hasNext()) {//µü´úÆ÷´æÔÚÔªËØ List info = (List) iterator.next();//½«µü´úÆ÷ÀïÃæµÄÔªËØ¸øµ½info¼¯ºÏ Person person=new Person(); String name=(String)info.get(1); person.setP_name(name);//ÐÕÃû String tagid=(String)info.get(2); int tagid_int=Integer.parseInt(tagid,16); person.setTagidint(tagid_int); person.setP_tagid(tagid);//id person.setP_sex((String)info.get(3));//ÐÔ±ð person.setP_minzu((String)info.get(4));//Ãñ×å person.setP_phone((String)info.get(5));//µç»° String s1 = (String) info.get(6); person.setP_department(s1);//²¿ÃÅ person.setP_ban((String)info.get(7));//°à person.setP_zu((String)info.get(8));//×é person.setP_idcardnum((String)info.get(9));//Éí·ÝÖ¤ºÅ person.setP_adress((String)info.get(10));//µØÖ· person.setP_canin((String)info.get(11));//ÄܽøÈëÇøÓò String a=(String)info.get(12); String b=(String)info.get(13); if(JugeNumber.hasLetter(a) || JugeNumber.hasLetter(b) ) { a="0"; b="0"; ShowMessage.zidingyi("´íÎ󣬱êÇ©"+(String)info.get(2)+"x="+a); } person.setP_x(Integer.parseInt((String)info.get(12)));//X×ø±ê person.setP_y(Integer.parseInt((String)info.get(13)));//y×ø±ê person.setP_floor((String)info.get(14));//ËùÔÚ²ã person.setP_sos((String)info.get(15));//SOS״̬ String pwr=(String)info.get(17); if(pwr==null || pwr.equals("null")||pwr.equals("-1")) { pwr="δ֪"; } person.setP_power(pwr);//±êÇ©µçÁ¿ String infc=(String)info.get(19); if(infc==null || infc.length()>2) { infc="0"; } person.setP_fence(infc);//ÊÇ·ñÔÚΧÀ¸ÇøÓò person.setP_fencename((String)info.get(20));//ËùÔÚΧÀ¸ÇøÓòÃû³Æ person.setP_kaoqqingname("");//ËùÔÚ¿¼ÇÚÇøÓòÃû³Æ Department dptm=Department_Dell.get_department(s1); if (dptm==null){ ShowMessage.zidingyi_24(tagid+","+name+",tb_person±í²¿ÃÅ"+s1+"²»´æÔÚ"); break; } ImageIcon imgicon=dptm.getDepart_image(); if(imgicon==null) { imgicon=new ImageIcon("image/targeticon/default.png"); } person.setP_image(imgicon);//ͼƬ person.setP_addtiem((String)info.get(23));//Ìí¼Óʱ¼ä String s = (String) info.get(24); if (s==null){ s="0"; } person.setP_power_wanig(s);//±êÇ©µÍµçÁ¿¸æ¾¯×´Ì¬ person.setP_sousuo((String)info.get(25));//±êÇ©ËÑË÷״̬ //·Ã¿ÍID String baoliu1=(String)info.get(28); if(baoliu1==null) { baoliu1="0000"; } person.setBaoliu1(baoliu1); //´æ·Å·Ã¿ÍID person.setBaoliu2((String)info.get(29));//´æ·Å¾­¶È person.setBaoliu3((String)info.get(30));//´æ·Åγ¶È person.setBaoliu4((String)info.get(31)); //´æ·Å¸ß³Ì String baoliu16=(String)info.get(43);//ÐÄÂÊ if(baoliu16==null || baoliu16.equals("null")||baoliu16.equals("-1")) { baoliu16="δ֪"; } person.setBaoliu16(baoliu16); String baoliu18=(String)info.get(45);//ÊÇ·ñ¶Ô½øÈë³öÃÅÉúЧ if(baoliu18==null) { baoliu18="3"; } String baoliu19=(String)info.get(46);//±êÇ©ÀàÐÍ if(baoliu19==null) { baoliu19="ϵͳĬÈÏ"; } person.setBaoliu18(baoliu18); person.setBaoliu19(baoliu19); person.setNeedbaseid("0"); personchushihuacanshu(person,0); person_vector.add(person); } } /**ÉèÖÃÈËÔ±³õʼ»¯µÄĬÈÏÖµ*/ public static void personchushihuacanshu(Person person,int datafrom) { if(person !=null) { String time=GetNowTime.now(); person.setP_online("0");//³õʼ»¯ÉèÖñêÇ©ÀëÏß person.setP_kaoqing("0");//ÊÇ·ñÔÚ¿¼ÇÚÇøÓò person.setP_shipin("0"); person.setP_shipingname("δ½øÈë"); person.setBaoliu5("0");//±êÇ©ÀàÐÍÈںϱêÇ©2£¬´¿UWB±êÇ©1 person.setBaoliu8("0"); //ÈںϱêÇ©µØÖ· person.setBaoliu9("0");//ÈںϱêÇ©µÄ¶Ë¿Ú person.setSos_state("0");//ÉèÖÃÈËÔ±µÄSOS״̬Ϊ0 person.setIndoor_fence(3); person.setOutwarning(false);//³õʼ»¯Ä¬ÈÏÈËÔ±²»ÔÚ¸æ¾¯ÇøÓòÄÚ person.setGpson_off(-1);//GPSĬÈÏ´ò¿ª person.setTagoff("3"); person.setGpsxinhao10(""); person.setHz(-1);//³õʼ»¯ÉèÖÃÆµÂÊΪN person.setRealhz(-1); person.setXiumian("3");//³õʼ»¯ÉèÖñêÇ©ÐÝÃß״̬δ֪ person.setJingzhi("3"); person.setPian(-2);//³õʼ»¯ÉèÖÃʱ¼äƬΪ-2 person.setInwuxiaoqu(0); person.setInbaiduoutwarning(-1); person.setdistance_juge_indoor(-1); person.setJingdu("0");//ÉèÖñêÇ©³õʼµÄ¾­¶È person.setWeidu("0");//ÉèÖñêÇ©³õʼµÄγ¶È person.setGao("0");//ÉèÖñêÇ©³õʼµÄ¸ß person.setIschoose(0);//ÉèÖñêÇ©³õʼ»¯Ã»Óб»Ñ¡ÖÐ person.setGpsstate("-1"); person.setGngga_state(-1); person.setPosfrom(3);//λÖÃÊý¾ÝÀ´Ô´³õʼ»¯ person.setBaoliu10("-1");//ÉèÖóõʼ»¯Ïà¶Ôº£°Î¸ß¶È person.setFloortrue("0"); person.setUwbopen(-1); person.setHeart_rates("-1"); person.setSystolic_val("-1"); person.setDiastolic_val("-1"); person.setOxygen_val("-1"); person.setTemp_val("-1"); person.setSostime(time);//ÉèÖñêÇ©SOS³õʼ»¯µÄʱ¼ä person.setBaoliu16("-1");//³õʼ»¯ÐÄÂÊ person.setBaoliu17("0");//³õʼ»¯×´Ì¬ÉèÖÃÈËԱĬÈÏûÓгö×÷񵂿Óò person.setChaoyuanquname("");//ÉèÖÃÈËÔ±³õʼ»¯²»ÔÚ³¬Ô±ÇøÓò person.setChaoshiquname(""); person.setChaoshiqutime(""); person.setChaoshistate(0);//³õʼ»¯³¬Ê±×´Ì¬Îª0 person.setP_fence("0"); person.setHavexinhao(false);//³õʼ»¯Ã»ÓÐÊÕµ½ÐźŠperson.setXinhaotime("");//½ÓÊÕµ½ÐźŵÄʱ¼ä person.setIsinwaring(0);//³õʼ»¯ÉèÖò»ÔÚ½øÈë¸æ¾¯ÇøÓò person.setKongzhitime(time); person.setNowzhendong(0);//ÉèÖñêÇ©³õʼ»¯Õð¶¯×´Ì¬ person.setJinmenstate(3);//½øÃÅ״̬£¬¶ÔÓ¦±£Áôbaoliu20 person.setChumenstate(3);//³öÃÅ״̬£¬¶ÔÓ¦±£Áôbaoliu21 person.setMessagerelaystate(3);//³õʼ»¯ÐÅÏ¢»Ø¸´×´Ì¬ person.setMessagebianma("0"); person.setP_floor("0"); person.setBaoliu18("-1"); person.setSendvoicetime(time); person.setP_addtiem(time); person.setReason_indoor_from("δ֪"); person.setIndoor_or_outdoor(3); person.setReceive_gngga_time("-1");//ÊÕµ½ÓÐЧGNGGAÊý¾Ýʱ¼ä³õʼ»¯Ä¬ÈÏ-1 person.setReceive_uwbpos_time("-1");//ÊÕµ½ÓÐЧUWBÊý¾Ýʱ¼ä³õʼ»¯Ä¬ÈÏ-1 } } /**×Ô¶¯Ð޸ıêǩƵÂÊ*/ public static void autor_alert_hz(Person person) { if(Systems.isZidongshijianpian()) {//Èç¹û¿ªÆô×Ô¶¯Ê±¼äƬ¹¦ÄÜÔò·µ»Ø return; } int hz=0; for(int i=0;i199) {//Èç¹ûƵÂÊ´óÓÚ200 for(int i=0;i1) { String tagid1=person1.getP_tagid(); ControTag.auto_alert_taghz("1", tagid1); String message="¾²Ö¹±êÇ©:"+tagid1+"ƵÂʸÄΪ1"; BaoWenShow.showdebug("debug", message); } } } }else { if(tagneedhz!=realhz && tagneedhz!=0) { int hz2=hz+tagneedhz-realhz; if(hz2<200) { ControTag.auto_alert_taghz(String.valueOf(tagneedhz), tagid); }else { for(int i=0;i1) { String tagid1=person1.getP_tagid(); ControTag.auto_alert_taghz("1", tagid1); String message="¾²Ö¹±êÇ©:"+tagid1+"ƵÂʸÄΪ1"; BaoWenShow.showdebug("debug", message); } } } } } } String message="×Ô¶¯¸ÄƵÂÊ,×Ü:"+hz+","+tagid+",real:"+realhz+",need:"+tagneedhz; BaoWenShow.showdebug("debug", message); } /**ͨ¹ý±êÇ©idÕÒµ½Ä³¸öÈËÔ±¶ÔÏó*/ public static Person get_Person(String tagid) { Person person=null; if(person_vector.size() !=0) { Iterator it=person_vector.iterator(); while(it.hasNext()) { Person person1=it.next(); String idtag=person1.getP_tagid(); if(idtag.equals(tagid)) { person=person1; break; } } } return person; } /**ÐÞ¸ÄÈËÔ±ÊÇ·ñ²»ÔÚ³öÈ¥¸æ¾¯ÇøÓòµÄ״̬*/ public static void alert_outwarnig(String tagid,boolean a) { if(get_Person(tagid) !=null) { get_Person(tagid).setOutwarning(a); } } /**¸Ä±ä±êÇ©µÄËÑË÷״̬Ϊ1*/ public static void alert_p_sousuo(String tagid) { if(get_Person(tagid) !=null) { get_Person(tagid).setP_sousuo("1"); String updateSQL="UPDATE tb_person SET p_sousuo='1' where p_tagid='"+tagid+"'"; DatabaseManagement.update(updateSQL); } } /**½«ËùÓбêÇ©ËÑË÷״̬¸ÄΪ0*/ public static void alert_all_sousuo() { int size=person_vector.size(); for(int i=0;i it=person_vector.iterator(); while(it.hasNext()) { Person person1=it.next(); String idnum=person1.getP_idcardnum(); //Èç¹ûÉí·ÝÖ¤ºÅ²»Îª¿Õ if(idnum !=null) { if(idnum.equals(idcardnum)) { person=person1; break; } } } } return person; } /**ÐÞ¸ÄÈËÔ±µÄÐÅÏ¢*/ public static void alert_person(String tagid,String bumen,String name,String sex,String phone) { if(get_Person(tagid) !=null) { get_Person(tagid).setP_department(bumen); get_Person(tagid).setP_name(name); get_Person(tagid).setP_sex(sex); get_Person(tagid).setP_phone(phone); get_Person(tagid).setP_image(Department_Dell.get_department(bumen).getDepart_image()); } } /**¸Ã·½·¨ÓÃÓÚ·¢¿¨Ê±ÐÞ¸ÄÈËÔ±µÄÐÅÏ¢*/ public static void alert_person_faka( String tagid, String bumen, String name, String sex, String phone, String idcardnum) { if(get_Person(tagid) !=null) { get_Person(tagid).setP_department(bumen); get_Person(tagid).setP_name(name); get_Person(tagid).setP_sex(sex); get_Person(tagid).setP_phone(phone); get_Person(tagid).setP_image(Department_Dell.get_department(bumen).getDepart_image()); get_Person(tagid).setP_idcardnum(idcardnum); } } /**ÐÞ¸ÄÈËÔ±ÐÕÃû*/ public static void alert_person_name(String tagid,String name,String type) { if(get_Person(tagid) !=null) { get_Person(tagid).setP_name(name); get_Person(tagid).setBaoliu19(type); String[] ziduan= {"p_name","baoliu19","p_tagid"}; String[] zhi= {name,type,tagid}; DatabaseManagement.fast_alert_dbase("tb_person", ziduan, zhi); } } /**ÐÞ¸ÄÈËÔ±ÐÕÃûºÍÊý¾Ý¿âÎÞ¹Ø*/ public static void alert_person_name2(String tagid,String name) { if(get_Person(tagid) !=null) { get_Person(tagid).setP_name(name); } } /**ÐÂÔöÒ»¸öÈËÔ±¶ÔÏó*/ public static void add_person(String tagid,String bumen,String name, String sex,String phone,String sulv,String type) { if(get_Person(tagid) ==null) { Person newperson=new Person(); newperson.setP_name(name); newperson.setP_department(bumen); newperson.setP_tagid(tagid); int tagid_int=Integer.parseInt(tagid,16); newperson.setTagidint(tagid_int); newperson.setP_sex(sex); newperson.setP_phone(phone); if(sulv.equals("ÎÞ")) { sulv="10000"; } newperson.setSulv(Double.parseDouble(sulv)); newperson.setBaoliu19(type);//±êÇ©µÄÀàÐÍ String bumen0=bumen; String p_image=""; if(Department_Dell.get_department(bumen)==null) { bumen0="ϵͳĬÈÏ"; } if (Department_Dell.get_department(bumen0)==null){ newperson.setP_image(new ImageIcon("image/targeticon/default.png")); p_image="image/targeticon/default.png"; }else{ newperson.setP_image(Department_Dell.get_department(bumen0).getDepart_image()); p_image=Department_Dell.get_department(bumen0).getIconadress(); } newperson.setP_x(0); newperson.setP_y(0); person_Dell.personchushihuacanshu(newperson,1);//ÉèÖñêÇ©³õʼ»¯²ÎÊý person_vector.add(newperson); String[] ziduan= { "p_name", "p_tagid", "p_sex", "p_minzu", "p_phone", "p_department", "p_x", "p_y", "p_floor", "p_sos", "p_online", "p_power", "p_kaoqing", "p_fence", "p_image", "baoliu19", "p_addtiem"}; String[] zhi= { name, tagid, sex, "ºº", phone, bumen, "0", "0", "0", "0", "0", "δ֪", "0", "0", p_image, type, GetNowTime.now() }; DatabaseManagement.insertfast("tb_person", ziduan, zhi); } } /**ÐÂÔöÒ»¸öÈËÔ±¶ÔÏóºÍÊý¾Ý¿âÎÞ¹Ø*/ public static void add_person2(String tagid,String bumen,String name,String sex,String phone) { if(get_Person(tagid) ==null) { Person newperson=new Person(); newperson.setP_name(name); newperson.setP_department(bumen); newperson.setP_tagid(tagid); int tagid_int=Integer.parseInt(tagid,16); newperson.setTagidint(tagid_int); newperson.setP_sex(sex); newperson.setP_phone(phone); String bumen0=bumen; if(Department_Dell.get_department(bumen)==null) { bumen0="ϵͳĬÈÏ"; } newperson.setP_image(Department_Dell.get_department(bumen0).getDepart_image()); newperson.setP_x(0); newperson.setP_y(0); person_Dell.personchushihuacanshu(newperson,0);//ÉèÖñêÇ©³õʼ»¯²ÎÊý person_vector.add(newperson); } } /**ÓÃÓÚ·¢¿¨µÄʱºòÏòÈËÔ±Êý¾Ý¿â²åÈëÒ»ÌõÊý¾Ý³É¹¦·µ»Øtrue*/ public static boolean add_person_in_database( String p_name, String p_tagid, String p_sex, String p_minzu, String p_phone, String p_department, String p_idcardnum, String p_adress) { boolean succ=false; String p_sos="0"; String p_online="0"; String p_power="100"; String updateSQL="INSERT tb_person (id," + "p_name," + "p_tagid," + "p_sex," + "p_minzu," + "p_phone," + "p_department," + "p_idcardnum," + "p_adress," + "p_sos," + "p_online," + "p_power," + "p_addtiem ) VALUES (default,'" +p_name+"','" +p_tagid+"','" +p_sex+"','" +p_minzu+"','" +p_phone+"','" +p_department+"','" +p_idcardnum+"','" +p_adress+"','" +p_sos+"','" +p_online+"','" +p_power+"','" +GetNowTime.now2()+"')"; if(DatabaseManagement.update(updateSQL) !=0) { Person newperson=new Person(); newperson.setP_name(p_name); newperson.setP_department(p_department); newperson.setP_tagid(p_tagid); int tagid_int=Integer.parseInt(p_tagid,16); newperson.setTagidint(tagid_int); newperson.setP_sex(p_sex); newperson.setP_phone(p_phone); newperson.setP_image(Department_Dell.get_department(p_department).getDepart_image()); newperson.setP_x(0); newperson.setP_y(0); newperson.setP_online("0"); newperson.setP_floor("0"); newperson.setP_kaoqing("0"); newperson.setP_sos("0"); newperson.setP_fence("0"); newperson.setP_power("100"); newperson.setSos_state("0");//ÉèÖÃÈËÔ±µÄSOS״̬Ϊ0 person_vector.add(newperson); succ=true; }; return succ; } /**ÓÃÓÚ·¢¿¨µÄʱºòÐÞ¸ÄÊý¾Ý¿âÈËÔ±ÐÅÏ¢³É¹¦·µ»Øtrue*/ public static boolean alert_tbperson_database( String p_name, String p_tagid, String p_sex, String p_minzu, String p_phone, String p_department, String p_idcardnum, String p_adress ) { boolean succ=false; String updateSQL="UPDATE tb_person SET p_name='"+p_name+ "', p_department='"+p_department+ "', p_sex='"+p_sex+ "', p_phone='"+p_phone+ "', p_idcardnum='"+p_idcardnum+ "', p_adress='"+p_adress+ "', p_addtiem='"+GetNowTime.now2()+ "'where p_tagid='"+p_tagid+"'"; if(DatabaseManagement.update(updateSQL) !=0) { person_Dell.alert_person_faka(p_tagid, p_department, p_name, p_sex, p_phone,p_idcardnum); StringBuffer updateSQLtag=new StringBuffer("UPDATE tb_tag SET " + "state='"+p_name +"'where tag_id='"+p_tagid+"'"); DatabaseManagement.update(updateSQLtag.toString()); updateSQLtag=new StringBuffer(); succ=true; } return succ; } /**ɾ³ýÒ»¸öÈËÔ±¶ÔÏó*/ public static void remove_person(String tagid) { if(get_Person(tagid) != null) { person_vector.remove(get_Person(tagid)); } } /**ɾ³ýÒ»¸öÈËÔ±¶ÔÏó*/ public static void remove_person_and_database(String tagid) { if(get_Person(tagid) != null) { String deleteSql="DELETE FROM tb_person WHERE p_tagid='"+tagid+"'"; if (DatabaseManagement.update(deleteSql)!=0) { person_vector.remove(get_Person(tagid)); }else { ShowMessage.zidingyi_24("ɾ³ýÊý¾Ý¿âtb_personÖеÄ"+tagid+"ʧ°Ü£¡"); } } } /**ÔÚԭʼÐÅÏ¢´¦ÐÂÔöÒ»¸öÈËÔ±¶ÔÏó*/ public static void add_person_raw(String tagid ) { if(get_Person(tagid) ==null) { String x="0"; String y="0"; String online="1"; String power="100"; String floor="0"; String name="δ°ó¶¨"; String bumen="ϵͳĬÈÏ"; String sex="ÄÐ"; String phone="01068214881"; String kaoqing="0"; String fence="0"; String sos="0"; String updateSQL="INSERT tb_person (id,p_name,p_department,p_tagid,P_sex,p_phone,p_x,p_y," + "p_online,p_power,p_floor,p_kaoqing,p_fence,p_sos,p_addtiem) VALUES (default,'"+ name+ "','"+bumen+ "','"+tagid+ "','"+sex+ "','"+phone+ "','"+x+ "','"+y+ "','"+online+ "','"+power+ "','"+floor+ "','"+kaoqing+ "','"+fence+ "','"+sos+ "','"+GetNowTime.now2()+"')"; if(DatabaseManagement.update(updateSQL)!=0) { Person newperson=new Person(); newperson.setP_name(name); newperson.setP_department(bumen); newperson.setP_tagid(tagid); int tagid_int=Integer.parseInt(tagid,16); newperson.setTagidint(tagid_int); newperson.setP_sex(sex); newperson.setP_phone(phone); newperson.setP_image(Department_Dell.get_department(bumen).getDepart_image()); newperson.setP_x(0); newperson.setP_y(0); newperson.setP_online("0"); newperson.setP_floor("0"); newperson.setP_kaoqing(kaoqing); newperson.setP_sos(sos); newperson.setP_fence(fence); newperson.setSos_state("0");//ÉèÖÃÈËÔ±µÄSOS״̬Ϊ0 person_vector.add(newperson); } } } /**ÐÞ¸ÄÈËÔ±ÊÇ·ñ´¦ÓÚÊÓÆµÇøÓòÐÅÏ¢*/ public static void alart_shiping(String tagid,String inout,String p_shipingname) { if(get_Person(tagid) !=null) { get_Person(tagid).setP_shipin(inout); get_Person(tagid).setP_shipingname(p_shipingname); } } /**ɾ³ýËùÓÐÈËÔ±¶ÔÏó*/ public static void removall_person() { if(person_vector.size()!= 0) { person_vector.removeAllElements();; } } /**ÐÞ¸ÄÈËÔ±µÄ¿¼ÇÚ״̬ÔÚ¿¼ÇÚÇøÓòΪ1²»ÔÚ¿¼ÇÚÇøÓòΪ0 * @param state ÊÇ·ñÔÚ¿¼ÇÚÇøÓò*/ public static void alert_kaoqing(String tagid,String state) { if(get_Person(tagid) != null) { get_Person(tagid).setP_kaoqing(state); } } /**ÐÞ¸ÄÈËÔ±ÊÇ·ñÔÚΧÀ¸ÖÐ״̬ÔÚΧÀ¸ÇøÓòΪ1²»ÔÚ¿¼ÇÚÇøÓòΪ0 * Êý×Ö0£ºÃ»ÓÐÔÚÈÎºÎ¸æ¾¯ÇøÓò * Êý×Ö1£ºÔÚ½øÈë¸æ¸æ¾¯ÇøÓòÄÚ * Êý×Ö2£ºÔÚ³öÈ¥¸æ¾¯ÇøÓòÍâ³öÇøÓò±¨¾¯ * Êý×Ö3£ºÔÚ³¬Ô±¸æ¾¯ÇøÓòÄÚ³¬Ô±±¨¾¯ * Êý×Ö4£ºÔÚ³¬Ê±±¨¾¯ÇøÓòÄÚÍ£Áô³¬Ê±±¨¾¯ * Êý×Ö5£ºÔÚ×÷񵂿ÓòÍⱨ¾¯£¬´ú±í³öÁË×÷񵂿Óò * Êý×Ö6£ºÔÚÖ¸¶¨µÄÇøÓòÍⱨ¾¯£¬´ú±í³öÁËÖ¸¶¨ÇøÓò */ public static void alert_isin_fence(String tagid,String state,String fencename) { Person prs=get_Person(tagid); if(prs!= null) { prs.setInwarningtime(GetNowTime.now()); prs.setP_fencename(fencename); } } /**ÐÞ¸ÄÈËÔ±SOSÐÅÏ¢*/ public static void alert_sos(String tagid,String sos) { if(get_Person(tagid) != null) { get_Person(tagid).setP_sos(sos); //Èç¹ûsosΪ1ÐèÒª´¥·¢ÓïÒô²¢¼Ç¼µ½¸æ¾¯Êý¾Ý¿âÖÐ String sosstate=get_Person(tagid).getSos_state(); if(sos.equals("1") && sosstate.equals("0")) { get_Person(tagid).setSos_state("1");//SOS¸æ¾¯Î´´¦Àí new Music("systemFiles/voice/sos.wav").start();//µ÷ÓÃÒôƵÎļþ InsertData.sosInsertTbWarning(tagid,"SOS", "δ´¦Àí", ""); } } } /**Ð޸ıêÇ©µÄ²ð³ý״̬*/ public static void alert_tagoff(String tagid,String tagoff) { if(get_Person(tagid) != null) { //±êÇ©±»²ð³ý String tagoffstate=get_Person(tagid).getTagoff(); if(tagoff.equals("1") && tagoffstate.equals("0")) { ShowMessage.zidingyi(GetNowTime.now()+",±êÇ©£º"+tagid+",±»²ð³ý"+tagoff); get_Person(tagid).setTagoff("1"); InsertData.sosInsertTbWarning(tagid,"±»²ð³ý", "δ´¦Àí", GetNowTime.now());//½«¸æ¾¯¼Ç¼³öÈëµ½Êý¾Ý¿â Tb_Warnig_Dell.add_tb_warning("±»²ð³ý", tagid, "δ´¦Àí",GetNowTime.now()); }else { get_Person(tagid).setTagoff(tagoff); } } } /**½«ËùÓÐÈËÔ±µÄSOS״̬ÐÞ¸ÄΪ0*/ public static void alert_Allperson_sos(String state) { if(person_vector.size() != 0) { Iterator it = person_vector.iterator(); while(it.hasNext()) { Person person=(Person) it.next(); person.setP_sos(state); person.setSos_state("0");//0±íʾÒÑ´¦ÀíSOS״̬ person.setP_fence("0"); } } } /**½«ËùÓÐSOSºÍËùÓеĽøÈëΧÀ¸×´Ì¬¸ÄΪ0*/ public static void alert_all_sos_and_infence(String state) { if(person_vector.size() != 0) { Iterator it = person_vector.iterator(); while(it.hasNext()) { Person person=(Person) it.next(); person.setP_sos(state); person.setP_fence(state); person.setOutwarning(false); person.setSos_state("0");//0±íʾÒÑ´¦ÀíSOS״̬ } } } /**ÐÞ¸ÄÈËÔ±µÄSOS״̬£¬×´Ì¬·ÖΪδ´¦Àí1£¬ÒÑ´¦ÀíΪ0*/ public static void alert_sos_state(String tagid ,String state) { if(get_Person(tagid) != null) { get_Person(tagid).setSos_state(state); } } // public static Vector getPerson_vector() { return person_vector; } /**»ñÈ¡ËùÓÐÔÚÏßÈËÔ±×ÜÊý*/ public static int get_online_person() { int online_num=0; if(person_vector.size() != 0) { Iterator it = person_vector.iterator(); while(it.hasNext()) { Person person=(Person) it.next(); String online=person.getP_online(); if(online.equals("1")) { online_num++; } } } return online_num; } /**»ñÈ¡ËùÓÐÔÚÏßÀëÏß³µÁ¾×ÜÊý*/ public static int[] get_online_car() { int[] num=new int[2]; int online_num=0; int off_num=0; if(person_vector.size() != 0) { Iterator it = person_vector.iterator(); while(it.hasNext()) { Person person=(Person) it.next(); String online=person.getP_online(); String type=person.getBaoliu19();//±êÇ©ÀàÐÍ if(online.equals("1")) { if(type.equals("³µÔØ´øÆÁ") || type.equals("³µÔرêÇ©") ) { online_num++; } }else { if(type.equals("³µÔØ´øÆÁ") || type.equals("³µÔرêÇ©") ) { off_num++; } } } } num[0]=online_num; num[1]=off_num; return num; } /**»ñÈ¡ËùÓÐÔÚÏßÀëÏßwuzi×ÜÊý*/ public static int[] get_online_wuzi() { int[] num=new int[2]; int online_num=0; int off_num=0; if(person_vector.size() != 0) { Iterator it = person_vector.iterator(); while(it.hasNext()) { Person person=(Person) it.next(); String online=person.getP_online(); String type=person.getBaoliu19();//±êÇ©ÀàÐÍ if(online.equals("1")) { if(type.equals("Îï×ʱêÇ©")) { online_num++; } }else { if(type.equals("Îï×ʱêÇ©")) { off_num++; } } } } num[0]=online_num; num[1]=off_num; return num; } /**ÐÞ¸ÄÈËÔ±µÄX,Y,FLOOR,jingdu,weidu,gaoduÔÚÏß״̬ÐÅÏ¢*/ public static void alert_person_UWBxyfpo( String tagid, int x, int y, String z, String floor, String time ) { Person person=get_Person(tagid); if(person!= null) { if(Systems.isShow0ceng()) { person.setFloortrue(floor); floor="0"; } person.setP_floor(floor); person.setP_online("1"); person.setUwb_x(x); person.setUwb_y(y); int zz=Integer.parseInt(z); person.setUwb_z(zz); person.setP_addtiem(time); person.setBaoliu4(floor); } } /**ÐÞ¸ÄÈËÔ±µÄµçÁ¿£¬±êÇ©ÏÖÔںͻùÕ¾²â¾àid*/ public static void alert_person_power(String tagid,String power,String anchorid) { if(get_Person(tagid) != null) { get_Person(tagid).setP_power(power); get_Person(tagid).setNow_ceju_anchorid(anchorid); } } /**´¦ÀíËùÓе͵çÁ¿×´Ì¬*/ public static void alert_person_power_lowpowerstate(String tagid) { Person person=get_Person(tagid); if( person!= null) { person.setP_power_wanig("0"); String sql="update tb_person set p_power_wanig=0 where p_tagid='"+tagid+"';"; DatabaseManagement.update(sql); }else if(tagid.equals("ËùÓбêÇ©")) { if(person_vector.size() != 0) { Iterator it = person_vector.iterator(); while(it.hasNext()) { Person person1=(Person) it.next(); person1.setP_power_wanig("0"); } String sql="update tb_person set p_power_wanig=0;"; DatabaseManagement.update(sql); } } } /**ÐÞ¸ÄÈËԱ״̬ΪÀëÏß*/ public static void alert_person_offline(String tagid) { if(get_Person(tagid) != null) { get_Person(tagid).setP_online("0"); get_Person(tagid).setP_kaoqing("0"); get_Person(tagid).setP_kaoqqingname(""); } } /**ÐÞ¸ÄÈËÔ±µçÁ¿£¬Ê±¼ä£¬sos£¬×´Ì¬*/ public static void alert_gps(String tagid,String power) { if(get_Person(tagid) != null) { get_Person(tagid).setP_power(power); } } /**δ¼ÈëϵͳµÄ±êÇ©¼ÓÈëÒ»¸ö¼¯ºÏ*/ public static void noinaddperson(String tagid,String anchorid) { Person person=get_noinPerson(tagid); if(person==null) { person=new Person(); person.setNow_ceju_anchorid(anchorid); noinperson_vector.add(person); }else { person.setNow_ceju_anchorid(anchorid); } } /**GPSģʽϸıäÈËÔ±µÄÔÚÏß״̬ºÍʱ¼ä*/ public static void have_ok_gnggan_alertperson(String tagid) { Person person=get_Person(tagid); if( person!= null) { person.setP_addtiem(GetNowTime.now()); person.setP_online("1"); } } /**ÐÞ¸ÄÈËÔ±ÐÅÏ¢*/ public static void alert3_person_tb_person( String p_name, String p_tagid, String p_sex, String p_phone, String p_department) { if(get_Person(p_tagid) != null) { String bumen=p_department; if(Department_Dell.get_department(p_department)==null) { bumen="ϵͳĬÈÏ"; } get_Person(p_tagid).setP_department(bumen); get_Person(p_tagid).setP_name(p_name); get_Person(p_tagid).setP_sex(p_sex); get_Person(p_tagid).setP_phone(p_phone); get_Person(p_tagid).setP_image(Department_Dell.get_department(bumen).getDepart_image()); String imageAdress=Department_Dell.get_department(bumen).getIconadress(); String[] ziduan= {"p_name","p_sex", "p_phone","p_department","p_image","p_tagid"}; String[] zhi= {p_name,p_sex, p_phone,p_department,imageAdress,p_tagid}; DatabaseManagement.fast_alert_dbase("tb_person", ziduan, zhi); } } /**»ñÈ¡ËùÓеÄÔÚÏßÈËÔ±¼¯ºÏ * String in=1ÔÚÏßÈËÔ± * String in=0ÀëÏßÈËÔ±*/ public static Vector get_oline_personvc(String in){ Vector person_vector1=new Vector<>(); int size=person_vector.size(); if(size !=0) { for(int i=0;i serch(String tagid) { Vector person_vector1=new Vector<>(); int size=person_vector.size(); if(size !=0) { for(int i=0;i getNoinperson_vector() { return noinperson_vector; } public static void setNoinperson_vector(Vector noinperson_vector) { person_Dell.noinperson_vector = noinperson_vector; } /**ͨ¹ý±êÇ©idÕÒµ½Ä³¸öÈËÔ±¶ÔÏó*/ public static Person get_noinPerson(String tagid) { Person person=null; if(noinperson_vector.size() !=0) { Iterator it=noinperson_vector.iterator(); while(it.hasNext()) { Person person1=it.next(); String idtag=person1.getP_tagid(); if(idtag.equals(tagid)) { person=person1; break; } } } return person; } /**»ñÈ¡ÐèÒª·ÖÅäʱ¼äƬµÄÉ豸¼¯ºÏ*/ public static Vector needpianvc(){ Vector needpian=new Vector(); int size=person_vector.size(); if (size != 0) { for (int i = 0; i 70) { state="³¬¸ß"; } String[] ziduan= {"tagid","name","heart","okheart","state","time"}; String[] zhi= {tagid,name,heart,okheart,state,time}; DatabaseManagement.insertfast("tb_heart_record", ziduan, zhi); } } } } /**ÐÞ¸ÄËùÓбêÇ©µÄƵÂÊ*/ public static void alert_all_tag_hz(int hz,int needhz) { int size=person_vector.size(); for(int i=0;i