| | |
| | | package org.springblade.common.param; |
| | | |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.apache.poi.hssf.record.DVALRecord; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.utils.AuthUtils; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static org.springblade.core.secure.utils.AuthUtil.getUserRole; |
| | | |
| | | @Data |
| | | public class CommonParamSet<T> { |
| | | /** |
| | | * 区域编号集合 |
| | |
| | | * 是否为超级管理员 |
| | | */ |
| | | private Integer isAdministrator; |
| | | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | private String communityCode; |
| | | /** |
| | | * 网格编号集合 |
| | | */ |
| | |
| | | return str; |
| | | } |
| | | |
| | | public String getCommunityCode() { |
| | | return communityCode; |
| | | } |
| | | |
| | | public <U> CommonParamSet invoke(Class<U> clazz, T t) { |
| | | //获取传入对象信息 |
| | | U u = clazz.cast(t); |
| | |
| | | // 获取请求头中的角色别名 |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | // 获取请求头中的社区编号 |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)) { |
| | | // 校验社区编号是否合规 |
| | | if (null != SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | |
| | | } |
| | | |
| | | if (isAdministrator == 2) { |
| | | if (!Strings.isBlank(communityCode)) { |
| | | if (Strings.isNotBlank(communityCode)) { |
| | | // 请求头带了后直接使用过滤 |
| | | regionChildCodesList.add(communityCode); |
| | | }else { |