fix: 78204
This commit is contained in:
@@ -295,7 +295,7 @@ public class ImportUtil {
|
||||
// 下拉单选
|
||||
if (FieldShowTypeEnum.DROPDOWN_SINGLE_SELECT.getValue().equals(tag.getFieldShowType()) ||
|
||||
FieldShowTypeEnum.DROPDOWN_MULTI_SELECT.getValue().equals(tag.getFieldShowType())) {
|
||||
if (!this.dictValid(tag.getDictField(), cellValue)) {
|
||||
if (!this.singleDictValid(tag.getDictField(), cellValue)) {
|
||||
log.error("第" + row + "列" + tag.getDbFieldTxt() + "填写错误 ");
|
||||
errMsg.append("第").append(row).append("列").append(tag.getDbFieldTxt()).append("填写错误 ");
|
||||
} else {
|
||||
@@ -568,6 +568,17 @@ public class ImportUtil {
|
||||
return StrUtil.isNotBlank(cellValue);
|
||||
}
|
||||
|
||||
// 字典验证(判断填写的是否是中的一个)
|
||||
public boolean singleDictValid(String dictCode, String cellValue) {
|
||||
Map<String, DictModel> sexDictModelMap =
|
||||
sysBaseAPI.getDictItems(dictCode).stream()
|
||||
.collect(Collectors.toMap(DictModel::getText, d -> d));
|
||||
if (sexDictModelMap.get(cellValue) == null) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// 字典验证(判断填写的是否是中的一个)
|
||||
public boolean dictValid(String dictCode, String cellValue) {
|
||||
String[] valueList = cellValue.split(",");
|
||||
|
||||
Reference in New Issue
Block a user