|
@@ -270,7 +270,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
//要插入的账号列表
|
|
//要插入的账号列表
|
|
List<User> userList = new ArrayList<>();
|
|
List<User> userList = new ArrayList<>();
|
|
//由于第一行需要指明列对应的标题
|
|
//由于第一行需要指明列对应的标题
|
|
- for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
|
|
|
|
|
|
+ for (int rowIndex = 0; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
|
|
XSSFRow row = sheet.getRow(rowIndex);
|
|
XSSFRow row = sheet.getRow(rowIndex);
|
|
if (row == null) {
|
|
if (row == null) {
|
|
continue;
|
|
continue;
|
|
@@ -281,6 +281,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
XSSFCell phoneCell = row.getCell(1);
|
|
XSSFCell phoneCell = row.getCell(1);
|
|
nameCell.setCellType(CellType.STRING);
|
|
nameCell.setCellType(CellType.STRING);
|
|
phoneCell.setCellType(CellType.STRING);
|
|
phoneCell.setCellType(CellType.STRING);
|
|
|
|
+ if("姓名".equals(nameCell.getStringCellValue()) && "手机号".equals(phoneCell.getStringCellValue()) && rowIndex==0){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
String name = nameCell.getStringCellValue();
|
|
String name = nameCell.getStringCellValue();
|
|
String phone = phoneCell.getStringCellValue();
|
|
String phone = phoneCell.getStringCellValue();
|
|
phoneList.add(phone);
|
|
phoneList.add(phone);
|