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
package Method;
import BaoWen.DellMessage;
import PbuliClass.ShowMessage;
import tag.Tag_Dell;
import tag.Tag_Into_Database;
 
/**×Ô¶¯Ìí¼Ó±êÇ©µÄ·½·¨*/
public class AddTagZidong {
    static int i=1;
    public static void addtag(String ss) {
            //1.Èç¹ûÊÇ55aa01¿ªÍ·
            //²åÈëºÏ·¨µÄÒÔ55AA01¿ªÍ·µÄ¶ÁģʽÊý¾Ý²â¾àÊý¾Ý
            if(ss.startsWith("55AA01") && ss.length()==42) {
                String[] hex=StringToHex.hex(ss);
                //Ä£¿éID receive_tagid
                String  receive_tagid=(hex[6]+hex[5]).toUpperCase();
                
                //Èç¹û±êÇ©²»´æÔÚÔòÌí¼Ó±êÇ©
                if (Tag_Dell.get_tag(receive_tagid) ==null) {
                    //µçÁ¿
                    String power=String.valueOf(DellMessage.decodeHEX(hex[13]));
                    //ÏòÊé¿âÌí¼Ó±êÇ©
                    Tag_Into_Database.insert_all_Tag_info_dabase(receive_tagid,"δ°ó¶¨", power, "ÔÚÏß", "150", "ÎÞ", "1");
                    
                    //Ïò¼¯ºÏÌí¼Ó±êÇ©
                    Tag_Dell.add_tag(receive_tagid, "δ°ó¶¨", "150","ÎÞ","1",0,"",2);
                    
                    ShowMessage.zidingyi("Ìí¼ÓµÚ"+i+"¸ö±êÇ©"+receive_tagid+"³É¹¦£¡");
                    
                    i++;
                }
                
            }
    }
    
    /**×Ô¶¯Ìí¼Ó±êÇ©*/
    public static void auto_addtag(String tagid,String power) {
        //Èç¹û±êÇ©²»´æÔÚÔòÌí¼Ó±êÇ©
        if (Tag_Dell.get_tag(tagid) ==null) {
            //µçÁ¿
            
            //ÏòÊé¿âÌí¼Ó±êÇ©
            Tag_Into_Database.insert_all_Tag_info_dabase(tagid,"×Ô¶¯Ìí¼Ó", power, "1", "150", "1000", "1");
            
            //Ïò¼¯ºÏÌí¼Ó±êÇ©
            Tag_Dell.add_tag(tagid, "×Ô¶¯Ìí¼Ó", "150","ÎÞ","1",0,"",2);
            
            ShowMessage.zidingyi("Ìí¼ÓµÚ"+i+"¸ö±êÇ©"+tagid+"³É¹¦£¡");
            
            i++;
        }
    }
 
}