|
@@ -419,14 +419,17 @@ public class UserServiceImpl implements UserService {
|
|
|
|
|
|
@Override
|
|
|
public int findMaxNumberByLoginNameStart(String prefix) {
|
|
|
+ int splitCount=prefix.split("-").length;
|
|
|
List<User> list = userDao.findStartWithLoginName(prefix);
|
|
|
int number = 0;
|
|
|
for (User user : list) {
|
|
|
try {
|
|
|
String[] str = user.getLoginName().split("-");
|
|
|
- int no = Integer.parseInt(str[str.length - 1]);
|
|
|
- if (number < no) {
|
|
|
- number = no;
|
|
|
+ if(str.length==splitCount+1) {
|
|
|
+ int no = Integer.parseInt(str[str.length - 1]);
|
|
|
+ if (number < no) {
|
|
|
+ number = no;
|
|
|
+ }
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|