From 1af31e38c6a2cd072ed310149c656780610fe57b Mon Sep 17 00:00:00 2001
From: DELL <1525436766@qq.com>
Date: 星期一, 21 四月 2025 08:42:54 +0800
Subject: [PATCH] 2.修复锁具开启之后记录bug

---
 ElectLock_Monitor/src/com/dev/lock/data/ElectLock_State.java |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/ElectLock_Monitor/src/com/dev/lock/data/ElectLock_State.java b/ElectLock_Monitor/src/com/dev/lock/data/ElectLock_State.java
index d60f95d..652e16b 100644
--- a/ElectLock_Monitor/src/com/dev/lock/data/ElectLock_State.java
+++ b/ElectLock_Monitor/src/com/dev/lock/data/ElectLock_State.java
@@ -15,8 +15,11 @@
 	
 //	public static int Reg_Count_Real = 8;		//瀵勫瓨鍣ㄦ暟閲�
 //	public static int Reg_Count_Real = 11;		//瀵勫瓨鍣ㄦ暟閲�
-	public static int Reg_Count_Real = 12;		//瀵勫瓨鍣ㄦ暟閲�
+//	public static int Reg_Count_Real = 12;		//瀵勫瓨鍣ㄦ暟閲�
+	public static int Reg_Count_Real = 14;		//瀵勫瓨鍣ㄦ暟閲�
 	
+	
+	private int lock_id;				//閿佸叿ID[褰撳墠闇�瑕佹搷浣滅殑閿佸叿ID鍙穄
 	private Date record_time = new Date(0);			//'鏇存柊鏃堕棿',
 	private String gprs_sn;				//'gprs妯″潡SN鐮�',
 	private String client_ip;			//'璁惧IP鍦板潃',
@@ -31,7 +34,7 @@
 	private int err_tol_count;			//'鎬婚敊璇鏁�',
 	private int err_count;				//'杩炵画閿欒璁℃暟',
 	private int op_cmd;					//'鎺у埗鍛戒护',
-	private int id_card_set;			//'鎺堟潈ID鍗″彿',
+	private long id_card_set;			//'鎺堟潈ID鍗″彿',
 	private int lock_addr_set;			//'璁剧疆璁惧鍦板潃[鎱庣敤]',
 	private int workmodel;				//宸ヤ綔妯″紡銆�0-绂荤嚎妯″紡   1-鍦ㄧ嚎妯″紡銆�
 	
@@ -45,9 +48,12 @@
 
 	private String ctl_uname = "";		//鎿嶄綔鐢ㄦ埛鍚�
 	
+	private int bluetooth_st_state;		//钃濈墮寮�鍏筹細0-鍏抽棴钃濈墮  1-寮�鍚摑鐗�
+	private int bluetooth_state;		//钃濈墮鐘舵�侊細0锛氳摑鐗欏凡鍏抽棴锛�1锛氳摑鐗欏凡寮�鍚�
+	
 	
 	private int lock_open_count;	//'閿佸叿鎬诲紑鍚鏁�'
-	private Date last_update_time;	//涓婁竴娆¢攣鍏峰紑鍚垨鍏抽棴鏃堕棿
+	private Date last_update_time = new Date(0);	//涓婁竴娆¢攣鍏峰紑鍚垨鍏抽棴鏃堕棿
 	
 	public ElectLock_State() {
 		
@@ -78,9 +84,15 @@
 		for(int k =0;k<mac_addr.length;k++) {
 			mac_addr[k] = ComBase.changeByteToInt(buffer.get());
 		}
-		workmodel  = ComBase.changeShortToInt(buffer.getShort()); 
+		workmodel  = ComBase.changeShortToInt(buffer.getShort());
 		
-		System.out.println("宸ヤ綔妯″紡锛�" + workmodel);
+		bluetooth_st_state  = ComBase.changeShortToInt(buffer.getShort()); 
+		bluetooth_state  = ComBase.changeShortToInt(buffer.getShort()); 
+		
+//		System.out.println("宸ヤ綔妯″紡锛�" + workmodel);
+//		System.out.println("BlutoothMAC:" + getLockMacAddr());
+//		System.out.println("bluetooth_st_state:" + getBluetooth_st_state());
+//		System.out.println("bluetooth_state:" + getBluetooth_state());
 //		System.out.println("BlutoothMAC:" + getLockMacAddr());
 		
 		//System.out.println("this.lock_state:"+tmp_lock_state+"********lock_state:"+lock_state);
@@ -113,6 +125,26 @@
 		}
 	}
 	
+	public int getBluetooth_st_state() {
+		return bluetooth_st_state;
+	}
+
+
+	public int getBluetooth_state() {
+		return bluetooth_state;
+	}
+
+
+	public void setBluetooth_st_state(int bluetooth_st_state) {
+		this.bluetooth_st_state = bluetooth_st_state;
+	}
+
+
+	public void setBluetooth_state(int bluetooth_state) {
+		this.bluetooth_state = bluetooth_state;
+	}
+
+
 	public int getLockDevId() {
 		return 10000000 + this.lock_addr;
 	}
@@ -217,7 +249,7 @@
 		return op_cmd;
 	}
 
-	public int getId_card_set() {
+	public long getId_card_set() {
 		return id_card_set;
 	}
 
@@ -281,7 +313,7 @@
 		this.op_cmd = op_cmd;
 	}
 
-	public void setId_card_set(int id_card_set) {
+	public void setId_card_set(long id_card_set) {
 		this.id_card_set = id_card_set;
 	}
 
@@ -319,6 +351,19 @@
 	}
 
 
+	public int getLock_id() {
+		return lock_id;
+	}
+
+	public int getLockAddr() {
+		return lock_id%1000;
+	}
+
+	public void setLock_id(int lock_id) {
+		this.lock_id = lock_id;
+	}
+
+
 	public void addCommCount() {
 		this.comm_count ++ ;
 		if(this.comm_count > 999990000) {

--
Gitblit v1.9.1