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++;
|
}
|
}
|
|
}
|