文档库--导入修改

This commit is contained in:
zhn
2022-03-09 19:02:03 +08:00
parent b7129e4def
commit 643cd72daa
2 changed files with 38 additions and 9 deletions
@@ -654,15 +654,17 @@ public class DateUtils extends PropertyEditorSupport {
* @Return: boolean
*/
public static boolean isValidDate(String str){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String[] strArr = str.split(",");
for (String dateStr : strArr) {
String replace = dateStr.replace("/", "-");
try {
simpleDateFormat.setLenient(false);
simpleDateFormat.parse(replace);
} catch (Exception e){
return false;
if(org.apache.commons.lang3.StringUtils.isNotBlank(str)){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String[] strArr = str.split(",");
for (String dateStr : strArr) {
String replace = dateStr.replace("/", "-");
try {
simpleDateFormat.setLenient(false);
simpleDateFormat.parse(replace);
} catch (Exception e){
return false;
}
}
}
return true;
@@ -2402,6 +2402,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (StringUtils.isNotBlank(stringCellValue)) {
String replace = stringCellValue.replace("", ",");
rowList.put(headerCell.getStringCellValue(), replace);
}else{
rowList.put(headerCell.getStringCellValue(), "");
}
}
}
@@ -2486,6 +2488,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
errorMsg += key + "为必填项,不能为空";
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
errorMsg += key + "不能超过" + dbLength + "个字符";
countError++;
}
//判断数据是否匹配
if (StringUtils.isNotBlank(value)) {
for (String valueTemp : value.split(",")) {
@@ -2531,6 +2538,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
errorMsg += key + "为必填项,不能为空";
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
errorMsg += key + "不能超过" + dbLength + "个字符";
countError++;
}
//判断是否是单选
if (StringUtils.isNotBlank(value) && value.contains(",")) {
errorMsg += key + "为单选项";
@@ -2556,6 +2568,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
errorMsg += key + "为必填项,不能为空";
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
errorMsg += key + "不能超过" + dbLength + "个字符";
countError++;
}
//下拉多选
for (String valueTemp : value.split(",")) {
if (!itemNameList.contains(valueTemp)) {
@@ -2618,6 +2635,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
errorMsg += key + "为必填项,不能为空";
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
errorMsg += key + "不能超过" + dbLength + "个字符";
countError++;
}
if (StringUtils.isNotBlank(value)) {
StringBuilder sb = new StringBuilder();
for (String fileName : value.split(",")) {
@@ -2653,6 +2675,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
errorMsg += key + "为必填项,不能为空";
countError++;
}
//判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
errorMsg += key + "不能超过" + dbLength + "个字符";
countError++;
}
//判断库中是否存在,如果存在则存id,如果不存在则存输入的值
List<Map<String, Object>> listBySerialNumber = getListBySerialNumber(value);
String serialNumberStr = "";