package fence;
|
import java.awt.geom.Point2D;
|
import java.util.Vector;
|
|
import Judge.JugeNumber;
|
import Method.GetNowTime;
|
import Method.InsertData;
|
import PbuliClass.IsPtInPoly;
|
import PbuliClass.Shi_jian_cha_sss;
|
import PbuliClass.ShowMessage;
|
import jiekou.Warnig;
|
import person.Person;
|
import person.person_Dell;
|
import tbDataModel.TbFence;
|
|
/**ÅжÏÔÚÇøÓòÄÚÍ£ÁôÊÇ·ñ³¬Ê±*/
|
public class Pointinchaoshi {
|
static Vector<Person> csvc=new Vector<Person>();
|
public static void isinchaoshi(String tagid,int x,int y,String floor,int size) {
|
Person person=person_Dell.get_Person(tagid);
|
if(person==null) {//ÈËÔ±²»´æÔÚÔÚÔòÍ˳ö
|
return;
|
}
|
for(int i=0;i<size;i++) {
|
TbFence fc=Fences.getChaoshi_fences().get(i);
|
String baoliu3=fc.getBaoliu3();
|
if(baoliu3==null) {
|
continue;
|
}
|
if(!JugeNumber.isDigit(baoliu3)) {//Èç¹ûΧÀ¸Ê±¼äÎÞÏÞÖÆÔò½øÈëÏÂÒ»¸öÑ»·
|
continue;
|
}
|
String fcfloor=fc.getFloor();
|
String allFnece = fc.getBaoliu10();
|
if(floor.equals(fcfloor)&&!allFnece.equals("1")) {//±êÇ©ËùÔÚ²ãºÍΧÀ¸ÔÚÒ»²ã
|
Point2D.Double point=new Point2D.Double(x,y);
|
boolean isin=IsPtInPoly.inPoly(point, fc.getPts());
|
String area=fc.getName();
|
boolean a=serch(tagid);//²éÏÂÈËÊÇ·ñÒѾÔÚ¸ÃΧÀ¸ÄÚ
|
if(isin) {
|
int chaoshistate=person.getChaoshistate();//Èç¹ûÈËÔ±ÒѾ´¦ÓÚ³¬Ê±×´Ì¬
|
String name=person.getP_name();
|
String time=person.getChaoshiqutime();
|
int oktime=Integer.parseInt(baoliu3);
|
if(chaoshistate==1) {
|
int b= Shi_jian_cha_sss.get_time_cha_s(GetNowTime.now(),time);
|
ShowMessage.zidingyi(name+tagid+"ÔÚ"+area+"Í£Áô³¬"+b+"Ã뱨¾¯");
|
Warnig.chaoshi("1",area, fcfloor,oktime+"", name, tagid);
|
Palyvoice.play("outtime.wav");
|
Kongzhizhengdong.contril(tagid,"Í£ÁôÒѳ¬Ê±");//¿ØÖÆÕ𶯻òÕß·äÃù
|
return;
|
}
|
if(a) {
|
int b= Shi_jian_cha_sss.get_time_cha_s(GetNowTime.now(),time);
|
if(b>oktime) {//Èç¹ûÍ£Áôʱ¼ä³¬Ê±
|
ShowMessage.zidingyi(name+tagid+"ÔÚ"+area+"Í£Áô³¬"+b+"Ã뱨¾¯");
|
InsertData.into_database("³¬Ê±±¨¾¯",area,name,"",tagid,GetNowTime.now(),"","");
|
person.setP_fence("4");
|
Warnig.chaoshi("1",area,fcfloor,oktime+"", name, tagid);
|
person.setChaoshistate(1);
|
Palyvoice.play("outtime.wav");
|
Kongzhizhengdong.contril(tagid,"Í£ÁôÒѳ¬Ê±");//¿ØÖÆÕ𶯻òÕß·äÃù
|
}
|
}else {
|
person.setChaoshiquname(area);
|
person.setChaoshiqutime(GetNowTime.now());
|
csvc.add(person);
|
}
|
return;
|
}
|
}
|
}
|
int chaoshistate=person.getChaoshistate();//Èç¹ûÈËÔ±ÒѾ´¦ÓÚ³¬Ê±×´Ì¬
|
if(chaoshistate==1) {
|
csvc.removeElement(person);
|
person.setChaoshistate(0);
|
person.setChaoshiquname("");
|
person.setChaoshiqutime("");
|
Warnig.chaoshi("0","","","","", tagid);
|
}
|
|
}
|
|
|
|
/**´Ó¼¯ºÏÖÐѰÕÒij¸öÈË*/
|
public static boolean serch(String tagid) {
|
boolean a=false;
|
int size=csvc.size();
|
if(size !=0) {
|
for(int i=0;i<size;i++) {
|
Person b=csvc.get(i);
|
String tagid1=b.getP_tagid();
|
if(tagid.equals(tagid1) ) {
|
a=true;
|
break;
|
}
|
}
|
}
|
return a;
|
|
}
|
|
}
|