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