|
|
|
@ -25,9 +25,11 @@ import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description : 字典管理服务
|
|
|
|
@ -267,4 +269,30 @@ public class SysDictionaryController extends CoreBaseController{
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/tree")
|
|
|
|
|
@ApiOperation(value = "查询字典树",notes = "查询字典树")
|
|
|
|
|
public ResultBean findSysDictionaryTree(){
|
|
|
|
|
try {
|
|
|
|
|
// 根据软件类型分组
|
|
|
|
|
Map group = sysDictionaryService.findSysDictionaryByTop().stream().collect(Collectors.groupingBy(SysDictionary::getSoftType));
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> dictTree = new ArrayList<>();
|
|
|
|
|
Map child;
|
|
|
|
|
for (CommonEnumUtil.SOFT_TYPE softType :CommonEnumUtil.SOFT_TYPE.values()) {
|
|
|
|
|
if(group.containsKey(softType.getValue())){
|
|
|
|
|
child = new HashMap();
|
|
|
|
|
child.put("id",softType.getCode());
|
|
|
|
|
child.put("name",softType.getValue());
|
|
|
|
|
child.put("childList",group.get(softType.getValue()));
|
|
|
|
|
dictTree.add(child);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(dictTree);
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|