标准excl导入
This commit is contained in:
+5
-3
@@ -713,12 +713,14 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
*/
|
||||
public HashMap<String, String> analysisStandId(ImportDto importDto) {
|
||||
HashMap<String, String> result = new HashMap<>();
|
||||
if (importDto.getStandId() == null) {
|
||||
String standId = importDto.getStandId();
|
||||
|
||||
if (standId == null) {
|
||||
importDto.setErrorStr("标准号为空");
|
||||
error.add(importDto);
|
||||
return null;
|
||||
} else {
|
||||
String standId = importDto.getStandId();
|
||||
// String standId = importDto.getStandId();
|
||||
//格式 非空格字符+空格+非空格字符+‘-’或‘—’或空格+年份 如Q/FT F003—2001
|
||||
Pattern pattern = Pattern.compile("^\\S*\\s\\S*[\\u2014\\u002d\\s]\\d{4}$");
|
||||
if (!pattern.matcher(standId).matches()) {
|
||||
@@ -730,7 +732,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
String sort = "";
|
||||
String number = "";
|
||||
String year = "";
|
||||
String[] split = importDto.getStandId().split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
|
||||
String[] split = standId.split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
|
||||
|
||||
|
||||
// 多种格式(╯‵□′)╯︵┻━┻ Q-FL T015-2021 Q/ FL T015-2021 Q/FL T015-2021
|
||||
|
||||
Reference in New Issue
Block a user