Commit d3efa07d authored by fangxinjiang's avatar fangxinjiang

加排序-fxj

parent 5aedee18
...@@ -76,6 +76,7 @@ import java.time.ZoneId; ...@@ -76,6 +76,7 @@ import java.time.ZoneId;
import java.util.*; import java.util.*;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static java.util.regex.Pattern.compile; import static java.util.regex.Pattern.compile;
...@@ -2956,7 +2957,11 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -2956,7 +2957,11 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e); log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR); return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
} }
return R.ok(errorMessageList); // 方式1:使用 stream sorted
List<ErrorMessage> sortedErrorList = errorMessageList.stream()
.sorted(Comparator.comparing(ErrorMessage::getLineNum))
.collect(Collectors.toList());
return R.ok(sortedErrorList);
} }
private void importEmployeeRegistrationNew(List<EmployeeRegistrationNewVo> excelVOList, private void importEmployeeRegistrationNew(List<EmployeeRegistrationNewVo> excelVOList,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment