Browse Source

feat: 字典值新增是否过滤字段

李学松 2 năm trước cách đây
mục cha
commit
2d5fdef451

+ 3 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/SysDictController.java

@@ -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());