Commit 9eb0d911 authored by hongguangwu's avatar hongguangwu

MVP1.7.0 优化

parent dc68e0a0
......@@ -3370,6 +3370,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
}
}
} else {
// 为空的检查一下起始时间有没有值,有值,截止日期不可为空
DiyExcelImportUtil.validateUtilEmpty(shuValue, attr, errorFormat, startDateMap);
}
}
}
......
......@@ -714,6 +714,17 @@ public class DiyExcelImportUtil implements Serializable {
return tempStr;
}
// 为空的检查一下起始时间有没有值,有值,截止日期不可为空
public static void validateUtilEmpty(String c, ExcelAttribute attr, StringBuilder errorFormat, Map<String, Date> startDateMap) {
//非空校验
if (Common.isEmpty(c) && Common.isNotNull(attr.pattern())) {
Date startDate = startDateMap.get(attr.pattern());
if (startDate != null) {
errorFormat.append(attr.name()).append("_起始日期有值则截止日期必填;");
}
}
}
private static boolean getMatchRes(String c, ExcelAttribute attr, String pattern) {
return !c.matches(Common.isEmpty(attr.pattern()) ? pattern : attr.pattern());
}
......
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