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
package BaoWen;
import Method.GetNowTime;
import Method.InsertData;
import PbuliClass.Music;
import PbuliClass.Shi_jian_cha_sss;
import PbuliClass.ShowMessage;
import person.Person;
import person.person_Dell;
import tbDataModel_Dell.Tb_Warnig_Dell;
 
/**Èç¹ûÓвâ¾àÐÅÏ¢µ÷ÓÃÏÂÃæµÄ·½·¨*/
public class Have_ceju_message_do {
    /**Èç¹ûÓвâ¾àÐÅÏ¢×öЩÏÂÃæµÄÊÂÇé*/
    public static void dosometing(
            String receive_tagid,
            String battery,
            String ip,
            String sos,
            String[] anchorids,
            String tagoff,
            int[] distance,
            String xiumian,
            String jizhi,
            Person person
            ) {        
        if(anchorids.length>0) {
            String anchorid="0";
            for(int i=0;i<anchorids.length;i++) {
                int dis=distance[i];
                if(dis !=0 && dis !=131071) {
                    //Anchor_Dell.set_anchor_mode2(anchorids[i]);//µÈÐ޸ĻùÕ¾¶Ïµç²â¾àÖµ¸Ä±äÎÊÌâ¼ÓÉÏ
                    if(anchorid!=null && anchorid.equals("0")) {
                        anchorid=anchorids[i];                        
                    }
                }else {
                    Dell_55AA12.dell_anchordistance_err(anchorids[i] ,dis);//´¦Àí²â¾àÒì³£
                }
                Dell_55AA0C.anchor_onlie_record(anchorids[i]);//»ùÕ¾ÉÏÏ߼Ǽ
            }
            alert_person(receive_tagid,battery,sos,tagoff,anchorid,xiumian,jizhi,person);
        }
    }
 
 
    /**ÓкϷ¨²â¾àÐÅÏ¢ÐÞ¸ÄÈËÔ±Ïà¹ØÐÅÏ¢*/
    public static void alert_person(
            String tagid, 
            String battery,
            String sos,
            String tagoff,
            String anchorid,
            String xiumian,
            String jingzhi,
            Person person
            ) {        
        if (person!= null) {
            person.setP_sos(sos);
            person.setXiumian(xiumian);
            String beforejingzhi=person.getJingzhi();
            if(!beforejingzhi.equals(jingzhi)) {
                person_Dell.autor_alert_hz(person);
            }
            person.setJingzhi(jingzhi);
            //Èç¹ûsosΪ1ÐèÒª´¥·¢ÓïÒô²¢¼Ç¼µ½¸æ¾¯Êý¾Ý¿âÖР           
            if(sos.equals("1")) {                                
                String time=person.getSostime();
                int shicha=Shi_jian_cha_sss.get_time_cha_s(GetNowTime.now(), time);
                if(shicha>3) {//Èç¹ûʱ¼ä²îСÓÚ1ÃëÔò²»·¢Éù
                    new Music("systemFiles/voice/sos.wav").start();//µ÷ÓÃÒôƵÎļþ    
                }                
                person.setSostime(GetNowTime.now());
                String sosstate=person.getSos_state();
                if(sosstate.equals("0")) {
                    String xy=person.getP_x()+","+person.getP_y()+","+person.getP_floor();
                    InsertData.sosInsertTbWarning(tagid,"SOS", "δ´¦Àí",xy);//½«¸æ¾¯¼Ç¼³öÈëµ½Êý¾Ý¿â
                    person.setSos_state("1");//SOS¸æ¾¯Î´´¦Àí
                }
            }
 
            //±êÇ©±»²ð³ý
            String tagoffstate=person.getTagoff();            
            if(tagoff.equals("0") && tagoffstate.equals("1")) {
                ShowMessage.zidingyi(tagid+"±»²ð³ý");
                person.setTagoff("0");
                InsertData.sosInsertTbWarning(tagid,"±»²ð³ý", "δ´¦Àí", GetNowTime.now());//½«¸æ¾¯¼Ç¼³öÈëµ½Êý¾Ý¿â
                Tb_Warnig_Dell.add_tb_warning("±»²ð³ý", tagid, "δ´¦Àí",GetNowTime.now());
            }else if(tagoff.equals("1")) {
                person.setTagoff(tagoff);
            }
 
            person.setP_power(battery);
        }
    }
    
 
    
 
}