|
|
@@ -100,6 +100,10 @@ public class ReportSearchConfigurationServiceImpl extends ServiceImpl<ReportSear
|
|
|
if("date-cascader".equals(showType) && searchKey.equals(SearchKeyCodeEnum.SEARCHKEY_AREACODES.getCode())){
|
|
|
return querySysAreaList();
|
|
|
}
|
|
|
+ //查询管理人树
|
|
|
+ if("date-tree".equals(showType) && searchKey.equals(SearchKeyCodeEnum.SEARCHKEY_MANAGEID.getCode())){
|
|
|
+ return getUserManageListByUserIdByPhone(userId);
|
|
|
+ }
|
|
|
//查询 合作保险公司 单独写
|
|
|
return null;
|
|
|
}
|
|
|
@@ -161,6 +165,29 @@ public class ReportSearchConfigurationServiceImpl extends ServiceImpl<ReportSear
|
|
|
public List<ReportDictDto> getPartnerCompanyListByCompanyId(String companyId) {
|
|
|
return this.getBaseMapper().getPartnerCompanyListByCompanyId(companyId);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2025/9/22 15:08
|
|
|
+ * @Description: 通过用户id查询管理员树
|
|
|
+ */
|
|
|
+ public List<UserTreeDto> getUserManageListByUserIdByPhone(String userId) {
|
|
|
+ //先查租户是最上级 本人不需要查询
|
|
|
+ //直接查询机构表中构造成树
|
|
|
+ String systemCode = this.getBaseMapper().getUserByPhone(userId);
|
|
|
+ List<UserTreeDto> userTreeDtoList = this.getBaseMapper().getUserListBySystemCode(systemCode);
|
|
|
+ List<UserTreeDto> voUserList = new ArrayList<>();
|
|
|
+ userTreeDtoList.forEach(item->{
|
|
|
+ UserTreeDto userTreeDto = new UserTreeDto(item);
|
|
|
+ voUserList.add(userTreeDto);
|
|
|
+ });
|
|
|
+ Map<String, List<UserTreeDto>> map = voUserList.stream().collect(Collectors.groupingBy(UserTreeDto::getParentId));
|
|
|
+ voUserList.forEach(i -> i.setChildren(map.getOrDefault(i.getId(), new ArrayList<>())));
|
|
|
+ List<UserTreeDto> sysUserVos = map.get("0");
|
|
|
+ List<UserTreeDto> newResultDept = new ArrayList<>();
|
|
|
+ newResultDept.addAll(sysUserVos);
|
|
|
+ return newResultDept;
|
|
|
+ }
|
|
|
/**
|
|
|
* @version
|
|
|
* @author: hxl
|
|
|
@@ -172,18 +199,17 @@ public class ReportSearchConfigurationServiceImpl extends ServiceImpl<ReportSear
|
|
|
//先查租户是最上级 本人不需要查询
|
|
|
//直接查询机构表中构造成树
|
|
|
String systemCode = this.getBaseMapper().getUserByUserId(userId);
|
|
|
-
|
|
|
- List<UserTreeDto> sysDeptList = this.getBaseMapper().getUserListBySystemCode(systemCode);
|
|
|
- List<UserTreeDto> voDept = new ArrayList<>();
|
|
|
- sysDeptList.forEach(item->{
|
|
|
+ List<UserTreeDto> userTreeDtoList = this.getBaseMapper().getUserListBySystemCode(systemCode);
|
|
|
+ List<UserTreeDto> voUserList = new ArrayList<>();
|
|
|
+ userTreeDtoList.forEach(item->{
|
|
|
UserTreeDto userTreeDto = new UserTreeDto(item);
|
|
|
- voDept.add(userTreeDto);
|
|
|
+ voUserList.add(userTreeDto);
|
|
|
});
|
|
|
- Map<String, List<UserTreeDto>> map = voDept.stream().collect(Collectors.groupingBy(UserTreeDto::getParentId));
|
|
|
- voDept.forEach(i -> i.setChildren(map.getOrDefault(i.getId(), new ArrayList<>())));
|
|
|
- List<UserTreeDto> sysDeptVos = map.get("0");
|
|
|
+ Map<String, List<UserTreeDto>> map = voUserList.stream().collect(Collectors.groupingBy(UserTreeDto::getParentId));
|
|
|
+ voUserList.forEach(i -> i.setChildren(map.getOrDefault(i.getId(), new ArrayList<>())));
|
|
|
+ List<UserTreeDto> sysUserVos = map.get("0");
|
|
|
List<UserTreeDto> newResultDept = new ArrayList<>();
|
|
|
- newResultDept.addAll(sysDeptVos);
|
|
|
+ newResultDept.addAll(sysUserVos);
|
|
|
return newResultDept;
|
|
|
}
|
|
|
|