|
@@ -104,12 +104,13 @@ public class SysDictController {
|
|
|
*/
|
|
|
@GetMapping("/type/{type}")
|
|
|
// @Cacheable(value = CacheConstants.DICT_DETAILS, key = "#type", unless = "#result.data.isEmpty()")
|
|
|
- public R<?> getDictByType(@PathVariable String type) {
|
|
|
+ public R<?> getDictByType(@PathVariable String type,
|
|
|
+ @RequestParam(required = false, defaultValue = "true") Boolean filterData) {
|
|
|
|
|
|
List<SysDictItem> list = sysDictItemService.list(Wrappers.<SysDictItem>query().lambda().eq(SysDictItem::getType, type));
|
|
|
|
|
|
Integer deptId = SecurityUtils.getUser().getDeptId();
|
|
|
- if ("subject_location".equals(type) && 1 != deptId) {
|
|
|
+ if (filterData && "subject_location".equals(type) && 1 != deptId) {
|
|
|
List<SysDeptSub> l = deptSubService.list(Wrappers.<SysDeptSub>lambdaQuery().eq(SysDeptSub::getDeptId, deptId).eq(SysDeptSub::getEnableFlag, "1"));
|
|
|
if (CollUtil.isNotEmpty(l)) {
|
|
|
List<String> collect = l.stream().filter(sub -> sub.getSubjectLocation() != null).map(sub -> sub.getSubjectLocation().getType()).collect(Collectors.toList());
|