|
@@ -1,5 +1,6 @@
|
|
|
package com.poyee.service.impl;
|
|
package com.poyee.service.impl;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.poyee.api.dict.SysDictFeignClient;
|
|
import com.poyee.api.dict.SysDictFeignClient;
|
|
|
import com.poyee.exception.BusinessException;
|
|
import com.poyee.exception.BusinessException;
|
|
|
import com.poyee.res.client.dict.SysDictDataRes;
|
|
import com.poyee.res.client.dict.SysDictDataRes;
|
|
@@ -20,6 +21,9 @@ public class SysDictDataServiceImpl implements SysDictDataService {
|
|
|
|
|
|
|
|
|
|
|
|
|
public void validateOptions(String dictType, String key) {
|
|
public void validateOptions(String dictType, String key) {
|
|
|
|
|
+ if (StrUtil.isBlank(key)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
List<SysDictDataRes> sysDictDataRes = ApiUtils.httpSuccess(this.sysDictFeignClient::getByDictType, dictType, "failed_to_call_dictionary_table_api");
|
|
List<SysDictDataRes> sysDictDataRes = ApiUtils.httpSuccess(this.sysDictFeignClient::getByDictType, dictType, "failed_to_call_dictionary_table_api");
|
|
|
if (sysDictDataRes.stream().noneMatch(x -> x.getValue().equals(key))) {
|
|
if (sysDictDataRes.stream().noneMatch(x -> x.getValue().equals(key))) {
|
|
|
throw new BusinessException("not_found_value_for_current_dict");
|
|
throw new BusinessException("not_found_value_for_current_dict");
|