diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicFormService.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicFormService.java index d8c1b38..3bcb434 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicFormService.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicFormService.java @@ -112,4 +112,13 @@ public interface IDynamicFormService { * @param dynamicFormFormShowFieldDTOs */ void setDynamicFieldData(ModelAndView mv, List dynamicFormFormShowFieldDTOs); + + /** + * 从字段列表中获取字典字段 + * + * @param dynamicFormDTOs + * @return + * @throws SearchException + */ + List listDataDictionaryField(List dynamicFormDTOs) throws SearchException; } diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java index fe742af..e64646a 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java @@ -242,6 +242,19 @@ public class DynamicFormServiceImpl extends AbstractService implements IDynamicF mv.addObject("radioMapList", radioMapList); } + @Override + public List listDataDictionaryField(List dynamicFormDTOs) throws SearchException { + List dataDictionaryFields = new ArrayList<>(); + for (DynamicFormDTO dynamicFormDTO : dynamicFormDTOs) { + if (StringUtils.equals(dynamicFormDTO.getFieldType(), FieldTypeEnum.SELECT.getValue()) + || StringUtils.equals(dynamicFormDTO.getFieldType(), FieldTypeEnum.RADIO.getValue()) + || StringUtils.equals(dynamicFormDTO.getFieldType(), FieldTypeEnum.CHECKBOX.getValue())) { + dataDictionaryFields.add(dynamicFormDTO.getFieldName()); + } + } + return dataDictionaryFields; + } + /** * 判断是否是动态字段 *