|
|
|
@ -1,15 +1,20 @@
|
|
|
|
|
package com.ibeetl.admin.core.util.beetl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
|
|
import com.ibeetl.admin.core.entity.CoreDict;
|
|
|
|
|
import com.ibeetl.admin.core.service.CoreDictService;
|
|
|
|
|
import com.ibeetl.admin.core.service.CorePlatformService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@Component
|
|
|
|
|
public class DictQueryFunction {
|
|
|
|
|
|
|
|
|
|
CoreDictService dictService = SpringUtil.getBean(CoreDictService.class);
|
|
|
|
|
@Autowired
|
|
|
|
|
CorePlatformService platformService;
|
|
|
|
|
@Autowired
|
|
|
|
|
CoreDictService dictService;
|
|
|
|
|
|
|
|
|
|
public List<CoreDict> dictDownQuery(String type) {
|
|
|
|
|
if(type.contains(".")){
|
|
|
|
|
return dictService.findAllByTable(type);
|
|
|
|
@ -17,7 +22,18 @@ public class DictQueryFunction {
|
|
|
|
|
return dictService.findAllByType(type);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<CoreDict> dictDownQuery(String type, boolean forceClearCache) {
|
|
|
|
|
if (forceClearCache) {
|
|
|
|
|
platformService.clearDictCache();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(type.contains(".")){
|
|
|
|
|
return dictService.findAllByTable(type);
|
|
|
|
|
}else {
|
|
|
|
|
return dictService.findAllByType(type);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<CoreDict> dictListByValue(String group,String value){
|
|
|
|
|
|
|
|
|
|