From e37e5966f637f62b59b247ded62a7b6aa9ee144f Mon Sep 17 00:00:00 2001 From: hdw <hdw@192.168.7.112> Date: 星期四, 03 一月 2019 16:11:09 +0800 Subject: [PATCH] 电池信息配置添加投入使用日期 --- gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java | 35 +++++++++++++++++++++++++++++------ 1 files changed, 29 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..e1066eb 100644 --- a/gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java +++ b/gx_tieta/src/com/fgkj/dao/BattinfGroupFactory.java @@ -109,15 +109,38 @@ } //鏌ヨ褰撳墠鏈�澶х殑鐢垫睜缁刬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_rtstate=(new Batt_rtstateDAOImpl()).searchMaxBattgroupId();//褰撳墠鍐呭瓨涓渶澶х殑鐢垫睜缁刬d + int BattgroupId_apply=(new Battinf_applyImpl()).searchMaxBattgroupId_apply();//褰撳墠鍐呭瓨涓渶澶х殑鐢垫睜缁刬d + int BattgroupId_inf=(new BattInfImpl()).searchMaxBattgroupId();//褰撳墠鍐呭瓨涓渶澶х殑鐢垫睜缁刬d + if(BattgroupId_inf>=BattgroupId_apply){ + battgroupid=BattgroupId_inf; + if(battgroupid>=BattgroupId_rtstate) { + battgroupid=battgroupid; + }else { + battgroupid=BattgroupId_rtstate; + } + }else{ + battgroupid=BattgroupId_apply; + if(battgroupid>=BattgroupId_rtstate) { + battgroupid=battgroupid; + }else { + battgroupid=BattgroupId_rtstate; + } + } + return battgroupid+1; } //鏌ヨ褰撳墠鏈�澶х殑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