Merge remote-tracking branch 'origin/master'
| | |
| | | * |
| | | * @return regionCode |
| | | */ |
| | | public static List<String> getRegionChildCodesByDeptId(String deptId) { |
| | | public static List<String> getRegionChildCodesByDeptId(String deptId,String communityCode) { |
| | | //多个部门按逗号分割 |
| | | List<String> deptIdList = Arrays.asList(deptId.split(",")); |
| | | |
| | |
| | | // 查询对应的区域编号code |
| | | Dept dept = deptService.getById(id); |
| | | if (null!=dept && !Strings.isBlank(dept.getRegionCode()) && !AuthUtil.isAdministrator()){ |
| | | list = getRegionChildCodes(dept.getRegionCode()); |
| | | list = getRegionChildCodes(dept.getRegionCode(),communityCode); |
| | | //行政区划不为空添加进集合 |
| | | if (list.size()>0){ |
| | | allRegionList.addAll(list); |
| | |
| | | * |
| | | * @return regionCode |
| | | */ |
| | | public static List<String> getPoliceRegionChildCodesByDeptId(String deptId) { |
| | | public static List<String> getPoliceRegionChildCodesByDeptId(String deptId,String communityCode) { |
| | | // 去重 |
| | | List<String> regionCodeList = new ArrayList<>(); |
| | | if (!Strings.isBlank(deptId)) { |
| | |
| | | // 只取公安的 |
| | | if (dept.getDeptNature() == 1) { |
| | | if (null != dept && !Strings.isBlank(dept.getRegionCode()) && !AuthUtil.isAdministrator()) { |
| | | list = getPoliceRegionChildCodes(dept.getRegionCode()); |
| | | list = getPoliceRegionChildCodes(dept.getRegionCode(),communityCode); |
| | | //行政区划不为空添加进集合 |
| | | if (list.size() > 0) { |
| | | allRegionList.addAll(list); |
| | |
| | | * |
| | | * @return regionCode |
| | | */ |
| | | public static List<String> getRegionChildCodes(String regionCode) { |
| | | public static List<String> getRegionChildCodes(String regionCode,String communityCode) { |
| | | if (regionCode == null) { |
| | | return null; |
| | | } |
| | | List<String> regionCodeList = CacheUtil.get(SYS_CACHE, REGION_CHILDCODES_CODE, regionCode, List.class); |
| | | if (regionCodeList == null || regionCodeList.size()==0) { |
| | | regionCodeList = new ArrayList<>(); |
| | | List<Region> deptChild = getRegionChild(regionCode); |
| | | List<Region> deptChild = getRegionChild(regionCode,communityCode); |
| | | if (deptChild != null) { |
| | | List<String> collect = deptChild.stream().map(Region::getCode).collect(Collectors.toList()); |
| | | regionCodeList.addAll(collect); |
| | |
| | | * |
| | | * @return regionCode |
| | | */ |
| | | public static List<String> getPoliceRegionChildCodes(String regionCode) { |
| | | public static List<String> getPoliceRegionChildCodes(String regionCode,String communityCode) { |
| | | if (regionCode == null) { |
| | | return null; |
| | | } |
| | | List<String> regionCodeList = CacheUtil.get(SYS_CACHE, REGION_CHILDCODES_CODE, regionCode, List.class); |
| | | if (regionCodeList == null || regionCodeList.size()==0) { |
| | | regionCodeList = new ArrayList<>(); |
| | | List<Region> deptChild = getPoliceRegionChild(regionCode); |
| | | List<Region> deptChild = getPoliceRegionChild(regionCode,communityCode); |
| | | if (deptChild != null) { |
| | | List<String> collect = deptChild.stream().map(Region::getCode).collect(Collectors.toList()); |
| | | regionCodeList.addAll(collect); |
| | |
| | | * @param regionCode |
| | | * @return |
| | | */ |
| | | private static List<Region> getPoliceRegionChild(String regionCode) { |
| | | return CacheUtil.get(SYS_CACHE, REGION_CHILD_CODE, regionCode, () -> regionService.getPoliceRegionChild(regionCode)); |
| | | private static List<Region> getPoliceRegionChild(String regionCode,String communityCode) { |
| | | return CacheUtil.get(SYS_CACHE, REGION_CHILD_CODE, regionCode, () -> regionService.getPoliceRegionChild(regionCode,communityCode)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param regionCode |
| | | * @return |
| | | */ |
| | | private static List<Region> getRegionChild(String regionCode) { |
| | | return CacheUtil.get(SYS_CACHE, REGION_CHILD_CODE, regionCode, () -> regionService.getRegionChild(regionCode)); |
| | | private static List<Region> getRegionChild(String regionCode,String communityCode) { |
| | | return CacheUtil.get(SYS_CACHE, REGION_CHILD_CODE, regionCode, () -> regionService.getRegionChild(regionCode,communityCode)); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 区域编号集合 |
| | | */ |
| | | private List<String> regionChildCodesList; |
| | | private List<String> regionChildCodesList = new ArrayList<>(); |
| | | /** |
| | | * 是否为超级管理员 |
| | | */ |
| | |
| | | /** |
| | | * 网格编号集合 |
| | | */ |
| | | private List<String> gridCodeList; |
| | | private List<String> gridCodeList = new ArrayList<>(); |
| | | |
| | | public List<String> getRegionChildCodesList() { |
| | | return regionChildCodesList; |
| | |
| | | } |
| | | |
| | | if (isAdministrator == 2) { |
| | | // 获取当前用户的所属行政区划编号() |
| | | regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | if (!Strings.isBlank(communityCode)) { |
| | | // 请求头带了后直接使用过滤 |
| | | regionChildCodesList.add(communityCode); |
| | | }else { |
| | | // 获取当前用户的所属行政区划编号() |
| | | regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId(), communityCode); |
| | | // 民警角色 |
| | | if (!Strings.isBlank(roleName) && roleName.equals("mj")) { |
| | | regionChildCodesList = SysCache.getPoliceRegionChildCodesByDeptId(AuthUtil.getDeptId(),communityCode); |
| | | } |
| | | } |
| | | // 获取网格编号集合 |
| | | gridCodeList = new ArrayList<>(); |
| | | if (!Strings.isBlank(roleName)) { |
| | | // 设置角色别名 |
| | | roleNameField.setAccessible(true); |
| | | roleNameField.set(t, roleName); |
| | | // 民警角色 |
| | | if (roleName.equals("mj")) { |
| | | regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | // 网格员角色 |
| | | if (roleName.equals("wgy")) { |
| | | gridCodeList = SpringUtil.getBean(IGridService.class).getGridListByUserId(AuthUtil.getUserId()); |
| | |
| | | @TableField("title") |
| | | private String title; |
| | | |
| | | /** 类型 0:文章 1经营性收支,2:物业招标 3:公益报名 4:选举调查 5:反诈宣传 */ |
| | | @ApiModelProperty(value = "类型 0:文章 1经营性收支,2:物业招标 3:公益报名 4:选举调查 5:反诈宣传", example = "") |
| | | /** 类型 0:文章 1经营性收支,2:物业招标 3:公益报名 4:选举调查 5:业主大会 6:反诈宣传 */ |
| | | @ApiModelProperty(value = "类型 0:文章 1经营性收支,2:物业招标 3:公益报名 4:选举调查 5:业主大会 6:反诈宣传", example = "") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | |
| | | } |
| | | if (userRole.contains("jdgly")) { |
| | | IDistrictService districtService = SpringUtils.getBean(IDistrictService.class); |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId(),null); |
| | | List<DistrictEntity> list = districtService.list(Wrappers.<DistrictEntity>lambdaQuery().in(DistrictEntity::getCommunityCode, regionChildCodesList)); |
| | | if (list.size() > 0) { |
| | | article.setDistrictIdList(list.stream().map(item -> item.getId()).collect(Collectors.toList())); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import org.springblade.modules.community.excel.CommunityExcel; |
| | |
| | | |
| | | @Override |
| | | public IPage<CommunityVO> selectCommunityPage(IPage<CommunityVO> page, CommunityVO community) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | return page.setRecords(baseMapper.selectCommunityPage(page, community,regionChildCodesList,isAdministrator)); |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(CommunityVO.class, community); |
| | | return page.setRecords(baseMapper.selectCommunityPage(page, |
| | | community, |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator())); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private String townName; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | private String communityCode; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.common.utils.RoleUtil; |
| | | import org.springblade.common.utils.SpringUtils; |
| | |
| | | import org.springblade.modules.property.service.IPropertyCompanyDistrictService; |
| | | import org.springblade.modules.property.service.IPropertyCompanyService; |
| | | import org.springblade.modules.property.service.IPropertyDistrictUserService; |
| | | import org.springblade.modules.task.vo.TaskReportForRepairsVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Override |
| | | public IPage<DistrictVO> selectDistrictPage(IPage<DistrictVO> page, DistrictVO district) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | List<DistrictVO> districtVOS = baseMapper.selectDistrictPage(page, district, regionChildCodesList, isAdministrator); |
| | | CommonParamSet invoke = new CommonParamSet<>().invoke(DistrictVO.class, district); |
| | | List<DistrictVO> districtVOS = baseMapper.selectDistrictPage(page, |
| | | district, |
| | | invoke.getRegionChildCodesList(), |
| | | invoke.getIsAdministrator()); |
| | | // 遍历 |
| | | for (DistrictVO districtVO : districtVOS) { |
| | | // 设置对应的网格名称 |
| | |
| | | */ |
| | | package org.springblade.modules.district.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springblade.modules.district.entity.DistrictEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | |
| | | */ |
| | | private String gridName; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | |
| | | private List<String> districtIdList; |
| | | |
| | | /** |
| | |
| | | |
| | | // 是否过滤0 否 1 是 |
| | | private Integer filterFlag = 0; |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | @ApiModelProperty(value = "社区编号") |
| | | private String communityCode; |
| | | |
| | | } |
| | |
| | | } |
| | | if (roleName.equals("民警")) { |
| | | // 查询对应的社区编号 |
| | | communityList = SysCache.getPoliceRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | communityList = SysCache.getPoliceRegionChildCodesByDeptId(AuthUtil.getDeptId(),null); |
| | | } |
| | | } |
| | | // 查询街道 |
| | |
| | | if (null != houseParam.getRoleName() && !houseParam.getRoleName().equals("")) { |
| | | if (houseParam.getRoleName().equals("民警") && !userId.equals("1726859808689696770")) { |
| | | // 查询对应社区编号集合 |
| | | stringList = SysCache.getPoliceRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | stringList = SysCache.getPoliceRegionChildCodesByDeptId(AuthUtil.getDeptId(),null); |
| | | } |
| | | } |
| | | return stringList; |
| | |
| | | <if test="gridPatrolRecord.context!=null and gridPatrolRecord.context!=''"> |
| | | and jgpr.context like concat('%',#{gridPatrolRecord.context},'%') |
| | | </if> |
| | | <if test="gridPatrolRecord.createUser!=null"> |
| | | and jgpr.create_user = #{gridPatrolRecord.createUser} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | |
| | | List<GridWorkLogVO> selectGridWorkLogPage(IPage page, |
| | | @Param("gridWorkLog") GridWorkLogVO gridWorkLog, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("gridCodeList") List<String> gridCodeList, |
| | | @Param("isAdministrator") Integer isAdministrator); |
| | | |
| | | /** |
| | |
| | | select |
| | | jgwl.*, |
| | | jh.name,jh.phone_number as phone, |
| | | if(jda.id is not null,jda.address_name,jh.current_address) as address, |
| | | jda.town_street_name AS townName, |
| | | jda.nei_name AS neiName, |
| | | jh.current_address AS address, |
| | | br.town_name AS townName, |
| | | br.name AS neiName, |
| | | jg.grid_name, |
| | | bu.real_name as createUserName |
| | | from jczz_grid_work_log jgwl |
| | | left join jczz_household jh on jgwl.household_id = jh.id and jh.is_deleted = 0 |
| | | left join jczz_house jhs on jhs.house_code = jh.house_code and jhs.is_deleted = 0 |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_code |
| | | LEFT JOIN jczz_grid jg on jhs.grid_code = jg.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN blade_user bu on bu.id = jgwl.create_user and bu.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jhs.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | left join blade_region br on br.code = jpag.community_code |
| | | where jgwl.is_deleted = 0 |
| | | <if test="gridWorkLog.type !=null"> |
| | | and jgwl.type = #{gridWorkLog.type} |
| | |
| | | and jh.phone_number like concat('%',#{gridWorkLog.phone},'%') |
| | | </if> |
| | | <if test="gridWorkLog.townName!=null and gridWorkLog.townName!=''"> |
| | | and jda.town_street_name like concat('%',#{gridWorkLog.townName},'%') |
| | | and br.town_name like concat('%',#{gridWorkLog.townName},'%') |
| | | </if> |
| | | <if test="gridWorkLog.neiName!=null and gridWorkLog.neiName!=''"> |
| | | and jda.nei_name like concat('%',#{gridWorkLog.neiName},'%') |
| | | and br.name like concat('%',#{gridWorkLog.neiName},'%') |
| | | </if> |
| | | <if test="gridWorkLog.gridId !=null"> |
| | | and jg.id = #{gridWorkLog.gridId} |
| | | </if> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and jg.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | <when test="gridWorkLog.roleName != null and gridWorkLog.roleName != ''"> |
| | | <if test="gridWorkLog.roleName=='wgy'"> |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and jh.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jh.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="gridWorkLog.roleName=='mj'"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jpag.community_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | and jg.community_code in ('') |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and |
| | | ( |
| | | jg.grid_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | or |
| | | jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | <otherwise> |
| | | and |
| | | ( |
| | | jg.grid_code in ('') or jpag.community_code in ('') |
| | | ) |
| | | </otherwise> |
| | | </choose> |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | |
| | | package org.springblade.modules.grid.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.AuthUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.grid.entity.GridPatrolRecordEntity; |
| | | import org.springblade.modules.grid.vo.GridPatrolRecordVO; |
| | |
| | | */ |
| | | @Override |
| | | public IPage<GridPatrolRecordVO> selectGridPatrolRecordPage(IPage<GridPatrolRecordVO> page, GridPatrolRecordVO gridPatrolRecord) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | return page.setRecords(baseMapper.selectGridPatrolRecordPage(page, gridPatrolRecord,regionChildCodesList,isAdministrator)); |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(GridPatrolRecordVO.class, gridPatrolRecord); |
| | | if (!Strings.isBlank(gridPatrolRecord.getRoleName())) { |
| | | gridPatrolRecord.setCreateUser(AuthUtils.getUserId()); |
| | | } |
| | | return page.setRecords(baseMapper.selectGridPatrolRecordPage(page, |
| | | gridPatrolRecord, |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator())); |
| | | } |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.grid.entity.GridWorkLogEntity; |
| | |
| | | |
| | | @Override |
| | | public IPage<GridWorkLogVO> selectGridWorkLogPage(IPage<GridWorkLogVO> page, GridWorkLogVO gridWorkLog) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | CommonParamSet<Object> commonParamSet = new CommonParamSet<>().invoke(GridWorkLogVO.class,gridWorkLog); |
| | | if (!Strings.isBlank(gridWorkLog.getRoleName()) && gridWorkLog.getRoleName().equals("网格员")){ |
| | | gridWorkLog.setGridId(getGridId()); |
| | | } |
| | | return page.setRecords(baseMapper.selectGridWorkLogPage(page, gridWorkLog,regionChildCodesList,isAdministrator)); |
| | | return page.setRecords(baseMapper.selectGridWorkLogPage(page, |
| | | gridWorkLog, |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getGridCodeList(), |
| | | commonParamSet.getIsAdministrator())); |
| | | } |
| | | /** |
| | | * 获取网格员id |
| | |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.flowable.idm.engine.impl.persistence.entity.UserEntity; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | |
| | | |
| | | @Override |
| | | public IPage<GridmanVO> selectGridmanPage(IPage<GridmanVO> page, GridmanVO gridman) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | return page.setRecords(baseMapper.selectGridmanPage(page, gridman, regionChildCodesList, isAdministrator)); |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(GridmanVO.class, gridman); |
| | | return page.setRecords(baseMapper.selectGridmanPage(page, gridman, commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator())); |
| | | } |
| | | |
| | | /** |
| | |
| | | public class GridPatrolRecordVO extends GridPatrolRecordEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | private String communityCode; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | |
| | | } |
| | |
| | | */ |
| | | private String houseCode; |
| | | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | private String communityCode; |
| | | |
| | | } |
| | |
| | | * 区域编号 |
| | | */ |
| | | private String regionCode; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> labelStatistics(HouseVO house) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | return baseMapper.labelStatistics(house, regionChildCodesList, isAdministrator); |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(HouseVO.class, house); |
| | | return baseMapper.labelStatistics(house, commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator()); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> labelCommunityStatistics(HouseVO house) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | List<Map<String, Object>> list = baseMapper.labelCommunityStatistics(house, regionChildCodesList); |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(HouseVO.class, house); |
| | | List<Map<String, Object>> list = baseMapper.labelCommunityStatistics(house, commonParamSet.getRegionChildCodesList()); |
| | | for (Map<String, Object> map : list) { |
| | | List<LabelVO> code = baseMapper.getlabelCount(house, regionChildCodesList, isAdministrator, map.get("code").toString()); |
| | | List<LabelVO> code = baseMapper.getlabelCount(house, |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(), |
| | | map.get("code").toString()); |
| | | map.put("child",code); |
| | | } |
| | | return list; |
| | |
| | | String userRole = AuthUtil.getUserRole(); |
| | | // 街道身份,只查找该街道下面的业委会 |
| | | if (userRole.contains("jdgly")) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId(),null); |
| | | IDistrictService bean = SpringUtils.getBean(IDistrictService.class); |
| | | List<DistrictEntity> list = bean.list(Wrappers.<DistrictEntity>lambdaQuery() |
| | | .in(DistrictEntity::getCommunityCode, regionChildCodesList)); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.house.vo.HouseVO; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganization; |
| | | import org.springblade.modules.partyOrganization.mapper.PartyOrganizationMapper; |
| | | import org.springblade.modules.partyOrganization.service.IPartyOrganizationService; |
| | |
| | | |
| | | @Override |
| | | public IPage<PartyOrganizationVO> getPage(IPage<PartyOrganizationVO> page, PartyOrganizationVO partyOrganizationVO) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | return page.setRecords(baseMapper.getPage(page,partyOrganizationVO,regionChildCodesList,isAdministrator)); |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(PartyOrganizationVO.class, partyOrganizationVO); |
| | | return page.setRecords(baseMapper.getPage(page, |
| | | partyOrganizationVO, |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator())); |
| | | } |
| | | } |
| | |
| | | package org.springblade.modules.partyOrganization.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganization; |
| | | |
| | |
| | | |
| | | //负责人名字或者党成员名字 |
| | | private String name; |
| | | |
| | | // 角色名称 |
| | | @ApiModelProperty(value = "角色名称", example = "") |
| | | private String roleName; |
| | | |
| | | // 社区编号 |
| | | @ApiModelProperty(value = "社区编号", example = "") |
| | | private String communityCode; |
| | | } |
| | |
| | | left join blade_user bu on bu.id = jp.principal_user_id and bu.is_deleted = 0 |
| | | left join jczz_place_ext jpe on jpe.place_id=jp.id and jpe.is_deleted = 0 |
| | | left join jczz_grid jg on jg.grid_code = jp.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | left join blade_region br on br.code = jpag.community_code |
| | | LEFT JOIN blade_user bus on bus.id = jpag.police_user_id |
| | | left join ( |
| | |
| | | import org.springblade.modules.house.service.IHouseholdService; |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.label.entity.LabelEntity; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationVO; |
| | | import org.springblade.modules.place.entity.*; |
| | | import org.springblade.modules.place.excel.NinePlaceExcel; |
| | | import org.springblade.modules.place.excel.PlaceAndRelExcel; |
| | |
| | | |
| | | @Override |
| | | public List<NinePlaceExcel> export(PlaceVO place) { |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)) { |
| | | // 校验社区编号是否合规 |
| | | if (null != SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | place.setCommunityCode(communityCode); |
| | | } |
| | | } |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | // 网格编号集合 |
| | | List<String> gridCodeList = new ArrayList<>(); |
| | | // 民警角色 |
| | | if (!Strings.isBlank(roleName)) { |
| | | place.setRoleName(roleName); |
| | | if (roleName.equals("mj")) { |
| | | regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | if (roleName.equals("wgy")) { |
| | | gridCodeList = SpringUtil.getBean(IGridService.class).getGridListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | } |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(PlaceVO.class, place); |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null != place.getNineType()) { |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<NinePlaceExcel> aa = baseMapper.export(place, gridCodeList, regionChildCodesList, isAdministrator, strings); |
| | | List<NinePlaceExcel> aa = baseMapper.export(place, |
| | | commonParamSet.getGridCodeList(), |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(), |
| | | strings); |
| | | IDictBizService bean = SpringUtils.getBean(IDictBizService.class); |
| | | List<DictBiz> nineType = bean.list(Wrappers.<DictBiz>lambdaQuery().eq(DictBiz::getCode, "nineType").eq(DictBiz::getIsDeleted, 0)); |
| | | for (NinePlaceExcel ninePlaceExcel : aa) { |
| | |
| | | and ST_Intersects(geom, ST_GeomFromText(${point},0)) |
| | | </select> |
| | | |
| | | <!--判断该点在哪个警务网格--> |
| | | <!--查询对应的社区编号--> |
| | | <select id="getCommunityCodeListByUserId" resultType="java.lang.String"> |
| | | SELECT community_code FROM jczz_police_affairs_grid |
| | | WHERE is_deleted = 0 |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.RoleUtil; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | |
| | | import org.springblade.modules.district.service.IDistrictService; |
| | | import org.springblade.modules.ownersCommittee.entity.OwnersCommitteeEntity; |
| | | import org.springblade.modules.ownersCommittee.service.IOwnersCommitteeService; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationVO; |
| | | import org.springblade.modules.property.entity.PropertyCapitalApplyEntity; |
| | | import org.springblade.modules.property.entity.PropertyCompanyDistrictEntity; |
| | | import org.springblade.modules.property.entity.PropertyCompanyEntity; |
| | |
| | | |
| | | @Override |
| | | public IPage<PropertyCapitalApplyVO> selectPropertyCapitalApplyPage(IPage<PropertyCapitalApplyVO> page, PropertyCapitalApplyVO propertyCapitalApply) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(PropertyCapitalApplyVO.class, propertyCapitalApply); |
| | | // 判断角色,物业角色只能查询当前小区的 |
| | | String userRole = AuthUtil.getUserRole(); |
| | | if (RoleUtil.isProperty(userRole)) { |
| | | // 查询小区id |
| | | IPropertyDistrictUserService propertyDistrictUserService = SpringUtils.getBean(IPropertyDistrictUserService.class); |
| | | List<String> districtIds = propertyDistrictUserService.selectPropertyDistrictByUserId(AuthUtil.getUserId()); |
| | | // 通过用户机构查询用户的物业公司 |
| | | // 通过用户机构查询用户的物业公司 |
| | | IPropertyCompanyService bean = SpringUtil.getBean(IPropertyCompanyService.class); |
| | | PropertyCompanyEntity one = bean.getOne(Wrappers.<PropertyCompanyEntity>lambdaQuery().eq(PropertyCompanyEntity::getDeptId, AuthUtil.getDeptId())); |
| | |
| | | return page.setRecords(new ArrayList<>()); |
| | | } |
| | | } |
| | | return page.setRecords(baseMapper.selectPropertyCapitalApplyPage(page, propertyCapitalApply, regionChildCodesList, isAdministrator)); |
| | | return page.setRecords(baseMapper.selectPropertyCapitalApplyPage(page, propertyCapitalApply, |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator())); |
| | | } |
| | | |
| | | @Autowired |
| | |
| | | */ |
| | | private String regionCode; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | |
| | | /** |
| | | * 区域编号 |
| | | */ |
| | | private String communityCode; |
| | | |
| | | } |
| | |
| | | * 查询公安相关的区域数据 |
| | | * @return |
| | | */ |
| | | List<Region> getPoliceList(); |
| | | List<Region> getPoliceList(@Param("communityCode") String communityCode); |
| | | } |
| | |
| | | <!--查询公安相关的区域数据--> |
| | | <select id="getPoliceList" resultType="org.springblade.modules.system.entity.Region"> |
| | | SELECT id as code,parentId as parent_code,name,'' as ancestors,null as region_level,1 as sort FROM police_region |
| | | where 1=1 |
| | | <if test="communityCode!=null and communityCode!=''"> |
| | | and id like concat('%',#{communityCode},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | |
| | | * @param regionCode |
| | | * @return |
| | | */ |
| | | List<Region> getRegionChild(String regionCode); |
| | | List<Region> getRegionChild(String regionCode,String communityCode); |
| | | |
| | | /** |
| | | * 获取民警下级区域 |
| | | * @param regionCode |
| | | * @return |
| | | */ |
| | | List<Region> getPoliceRegionChild(String regionCode); |
| | | List<Region> getPoliceRegionChild(String regionCode,String communityCode); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public List<TreeStringNode> getTree(RegionParamVO region) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId(),null); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | if (null!=region.getDeptNature()){ |
| | | // 公安 |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Region> getRegionChild(String regionCode) { |
| | | public List<Region> getRegionChild(String regionCode,String communityCode) { |
| | | // 创建区域对象 |
| | | List<Region> list = new ArrayList<>(); |
| | | // 查询公安相关的区域数据 |
| | | List<Region> regionList = baseMapper.getPoliceList(); |
| | | List<Region> regionList = baseMapper.getPoliceList(communityCode); |
| | | if (regionList.size()>0) { |
| | | List<Region> policeList = treeRegionList(regionList,regionCode, list); |
| | | list.addAll(policeList); |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Region> getPoliceRegionChild(String regionCode) { |
| | | public List<Region> getPoliceRegionChild(String regionCode,String communityCode) { |
| | | // 创建区域对象 |
| | | List<Region> list = new ArrayList<>(); |
| | | // 查询公安相关的区域数据 |
| | | List<Region> regionList = baseMapper.getPoliceList(); |
| | | List<Region> regionList = baseMapper.getPoliceList(communityCode); |
| | | if (regionList.size()>0) { |
| | | List<Region> policeList = treeRegionList(regionList,regionCode, list); |
| | | list.addAll(policeList); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getStatisticsCount") |
| | | @ApiLog("报事报修任务表 详情") |
| | | @ApiLog("查询报事报修统计") |
| | | public R statisticsCount(@RequestParam(value = "houseCode",required = false) String houseCode) { |
| | | bladeLogger.info("查询报事报修统计", JsonUtil.toJson(houseCode)); |
| | | return R.data(taskReportForRepairsService.getStatisticsCount(houseCode)); |
| | |
| | | jczz_task_place_rectification jtpr |
| | | LEFT JOIN jczz_place jp ON jtpr.house_code = jp.house_code and jp.is_deleted = 0 |
| | | LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN blade_region br ON br.`code` = jg.community_code |
| | | LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id |
| | | LEFT JOIN blade_user bu ON bu.id = jtpr.create_user |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code |
| | | LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id and jpe.is_deleted = 0 |
| | | LEFT JOIN blade_user bu ON bu.id = jtpr.create_user and bu.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | LEFT JOIN blade_region br ON br.`code` = jpag.community_code |
| | | <where> |
| | | <if test="taskPalce.id != null ">and jtpr.id = #{taskPalce.id}</if> |
| | | <if test="taskPalce.placeCheckId != null ">and jtpr.place_check_id = #{taskPalce.placeCheckId}</if> |
| | |
| | | import liquibase.repackaged.org.apache.commons.lang3.StringUtils; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.AuthUtils; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | */ |
| | | @Override |
| | | public IPage<TaskPlaceRectificationVO> selectTaskPlaceRectificationList(IPage<TaskPlaceRectificationVO> page, TaskPlaceRectificationDTO taskPlaceRectificationDTO) { |
| | | // 数据过滤 todo |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)) { |
| | | // 校验社区编号是否合规 |
| | | if (null != SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | taskPlaceRectificationDTO.setCommunityCode(communityCode); |
| | | } |
| | | } |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | // 网格编号集合 |
| | | List<String> gridCodeList = new ArrayList<>(); |
| | | // 民警角色 |
| | | if (!Strings.isBlank(roleName)) { |
| | | taskPlaceRectificationDTO.setRoleName(roleName); |
| | | if (roleName.equals("mj")) { |
| | | regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | if (roleName.equals("wgy")) { |
| | | gridCodeList = SpringUtil.getBean(IGridService.class).getGridListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | } |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(TaskPlaceRectificationDTO.class, taskPlaceRectificationDTO); |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null != taskPlaceRectificationDTO.getNineType()) { |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | |
| | | } |
| | | List<TaskPlaceRectificationVO> taskPlaceRectificationVOS = baseMapper.selectTaskPlaceRectificationList(page, |
| | | taskPlaceRectificationDTO, |
| | | regionChildCodesList, |
| | | isAdministrator, |
| | | gridCodeList, |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getGridCodeList(), |
| | | strings); |
| | | for (TaskPlaceRectificationVO taskPlaceRectificationVO : taskPlaceRectificationVOS) { |
| | | StringBuilder builder = new StringBuilder(""); |
| | |
| | | |
| | | @Override |
| | | public List<TaskPlaceRectificationExcel> export(TaskPlaceRectificationsVO taskPlaceRectificationVO) { |
| | | // 数据过滤 todo |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)) { |
| | | // 校验社区编号是否合规 |
| | | if (null != SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | taskPlaceRectificationVO.setCommunityCode(communityCode); |
| | | } |
| | | } |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | // 网格编号集合 |
| | | List<String> gridCodeList = new ArrayList<>(); |
| | | // 民警角色 |
| | | if (!Strings.isBlank(roleName)) { |
| | | taskPlaceRectificationVO.setRoleName(roleName); |
| | | if (roleName.equals("mj")) { |
| | | regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | if (roleName.equals("wgy")) { |
| | | gridCodeList = SpringUtil.getBean(IGridService.class).getGridListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | } |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(TaskPlaceRectificationsVO.class, taskPlaceRectificationVO); |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null != taskPlaceRectificationVO.getNineType()) { |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | |
| | | } |
| | | List<TaskPlaceRectificationExcel> export = baseMapper.export( |
| | | taskPlaceRectificationVO, |
| | | regionChildCodesList, |
| | | isAdministrator, |
| | | gridCodeList, |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getGridCodeList(), |
| | | strings); |
| | | IDictBizService bean = SpringUtils.getBean(IDictBizService.class); |
| | | List<DictBiz> nineType = bean.list(Wrappers.<DictBiz>lambdaQuery().eq(DictBiz::getCode, "nineType").eq(DictBiz::getIsDeleted, 0)); |
| | |
| | | */ |
| | | @Override |
| | | public TaskReportStatistics getStatisticsCount(String houseCode) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | return baseMapper.getStatisticsCount(AuthUtil.getUserId(), houseCode, regionChildCodesList, isAdministrator); |
| | | TaskReportForRepairsVO reportForRepairsVO = new TaskReportForRepairsVO(); |
| | | reportForRepairsVO.setHouseCode(houseCode); |
| | | CommonParamSet invoke = new CommonParamSet<>().invoke(TaskReportForRepairsVO.class, reportForRepairsVO); |
| | | return baseMapper.getStatisticsCount(AuthUtil.getUserId(), houseCode, invoke.getRegionChildCodesList(), invoke.getIsAdministrator()); |
| | | } |
| | | |
| | | /** |
| | |
| | | private String communityName; |
| | | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | private String communityCode; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | |
| | | @ApiModelProperty(value = "社区编号", example = "") |
| | | private String communityCode; |
| | | |
| | | /** |
| | | * 地址编码 |
| | | */ |
| | | private String houseCode; |
| | | |
| | | } |