From fb783f79cac8d1524fcf3f41cfaa275a6bd6e70c Mon Sep 17 00:00:00 2001
From: CJJ <Administrator@USER-20180117QL>
Date: 星期四, 20 十二月 2018 21:11:40 +0800
Subject: [PATCH] 修改

---
 gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java b/gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java
index 20e7edf..87a204a 100644
--- a/gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java
+++ b/gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java
@@ -109,15 +109,27 @@
 	}
     //鏌ヨ褰撳墠鏈�澶х殑鐢垫睜缁刬d
 	public static int searchMaxBattgroupId(){
-		int BattgroupId_max=(new Batt_rtstateDAOImpl()).searchMaxBattgroupId();//褰撳墠鍐呭瓨涓渶澶х殑鐢垫睜缁刬d
-		int BattgroupId_next=BattgroupId_max+1;
-		return BattgroupId_next;
+		int battgroupid=0;
+		int BattgroupId_inf=(new Batt_rtstateDAOImpl()).searchMaxBattgroupId();//褰撳墠鍐呭瓨涓渶澶х殑鐢垫睜缁刬d
+		int BattgroupId_apply=(new Battinf_applyImpl()).searchMaxBattgroupId_apply();//褰撳墠鍐呭瓨涓渶澶х殑鐢垫睜缁刬d
+		if(BattgroupId_inf>=BattgroupId_apply){
+			battgroupid=BattgroupId_inf+1;
+		}else{
+			battgroupid=BattgroupId_apply+1;
+		}
+		return battgroupid;
 	}
 	//鏌ヨ褰撳墠鏈�澶х殑stationid
 	public static int searchStationId(){
-		int station_max=(new BattInfImpl()).searchMaxId();//褰撳墠鏈�澶х殑stationid
-		int station_next=station_max+1;
-		return station_next;
+		int stationid=0;
+		int stationid_inf=(new BattInfImpl()).searchMaxId();//褰撳墠鏈�澶х殑stationid
+		int stationid_apply=(new Battinf_applyImpl()).searchMaxId_apply();//褰撳墠鏈�澶х殑stationid
+		if(stationid_inf>=stationid_apply){
+			stationid=stationid_inf+1;
+		}else{
+			stationid=stationid_apply+1;
+		}
+		return stationid;
 	}
 	//鏌ヨ褰撳墠鏈�澶х殑dev_id
 	public static int searchmaxdev_id(){

--
Gitblit v1.9.1