zsh_root
2024-01-02 7b595546af704983dbafcd0d385c8768ddacefc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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;
 
    }
 
}