| | |
| | | } |
| | | |
| | | /** |
| | | * 是否为民警 |
| | | * @return |
| | | */ |
| | | public static boolean isMj(String roleName) { |
| | | return StringUtil.containsAny(roleName, new CharSequence[]{"mj"}); |
| | | } |
| | | |
| | | /** |
| | | * 是否管理员角色 |
| | | * @return |
| | | */ |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity; |
| | |
| | | import org.springblade.modules.system.entity.Region; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springblade.modules.task.vo.TaskVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | @Override |
| | | public IPage<GridVO> selectGridPage(IPage<GridVO> page, GridVO grid) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | return page.setRecords(baseMapper.selectGridPage(page, grid,regionChildCodesList,isAdministrator)); |
| | | // List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | // Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(GridVO.class, grid); |
| | | return page.setRecords(baseMapper.selectGridPage(page, grid,commonParamSet.getRegionChildCodesList(),commonParamSet.getIsAdministrator())); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private String regionCode; |
| | | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | private String communityCode; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | |
| | | } |
| | |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "住户审核统计", notes = "网格员调用") |
| | | public R getStatistics() { |
| | | return R.data(householdService.statistics(AuthUtil.getUserId(), "")); |
| | | return R.data(householdService.statistics(AuthUtil.getUserId(), "",0)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | List<HouseRentalExcel> export(@Param("vo") HouseRentalTenantVO houseRental); |
| | | |
| | | Integer getStatisticsCount(Long userId,String neiCode); |
| | | Integer getStatisticsCount(@Param("house") HouseRentalTenantVO houseRental, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("gridCodeList") List<String> gridCodeList, |
| | | @Param("isAdministrator") Integer isAdministrator); |
| | | |
| | | } |
| | |
| | | <if test="vo.startTime != null and vo.startTime != '' and vo.endTime != null and vo.endTime != '' "> |
| | | AND jhr.create_time BETWEEN #{vo.startTime} and #{vo.endTime} |
| | | </if> |
| | | |
| | | <include refid="filterData"/> |
| | | |
| | | order by jhr.create_time desc,jhr.id desc |
| | | </select> |
| | | |
| | |
| | | FROM |
| | | jczz_house_rental jhr |
| | | LEFT JOIN jczz_doorplate_address jda ON jhr.house_code = jda.address_code |
| | | LEFT JOIN jczz_house jh ON jh.house_code = jhr.house_code |
| | | AND jh.is_deleted = 0 |
| | | LEFT JOIN jczz_grid jg ON jg.grid_code = jh.grid_code |
| | | AND jg.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag ON jh.jw_grid_code = jpag.jw_grid_code |
| | | AND jpag.is_deleted = 0 |
| | | <where> |
| | | <if test="neiCode != null and neiCode != ''"> |
| | | and jda.nei_code = #{neiCode} |
| | | <if test="house.neiCode != null and house.neiCode != ''"> |
| | | and jda.nei_code = #{house.neiCode} |
| | | </if> |
| | | <if test="userId != null"> |
| | | AND jhr.house_code IN ( |
| | | SELECT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid_range jgr |
| | | LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | WHERE |
| | | jg.is_deleted = 0 |
| | | AND jgm.user_id = #{userId} ) |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="house.roleName != null and house.roleName != ''"> |
| | | <if test="house.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="house.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> |
| | | <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> |
| | | |
| | | </otherwise> |
| | | </choose> |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | and jhr.is_deleted = 0 |
| | | and jhr.audit_status = 0 |
| | |
| | | */ |
| | | List<HouseholdVO> selectHouseholdPage(IPage page, |
| | | @Param("household") HouseholdVO household, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator); |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | | |
| | | /** |
| | | * 获取全部 |
| | |
| | | */ |
| | | List<HouseHoldExcel> export(@Param("household") HouseholdVO household); |
| | | |
| | | Integer statistics(Long userId, String neiCode); |
| | | Integer statistics(@Param("household") HouseholdVO household, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | | |
| | | /** |
| | | * 查询物业 |
| | |
| | | LEFT JOIN jczz_house jhs ON jh.house_code = jhs.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 jg.grid_code = jhs.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jhs.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | <where> |
| | | <if test="household.userId!=null"> |
| | | AND jg.grid_code IN ( SELECT DISTINCT jgm.grid_code FROM jczz_gridman jgm WHERE jgm.user_id = |
| | |
| | | </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="household.roleName != null and household.roleName != ''"> |
| | | <if test="household.roleName=='wgy'"> |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and jhs.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jhs.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="household.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> |
| | | |
| | | </otherwise> |
| | | </choose> |
| | | </otherwise> |
| | | </choose> |
| | | </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>--> |
| | | <!-- <otherwise>--> |
| | | <!-- and jg.community_code in ('')--> |
| | | <!-- </otherwise>--> |
| | | <!-- </choose>--> |
| | | <!-- </if>--> |
| | | <if test="household.building!=null and household.building!=''"> |
| | | and jhs.building like concat(#{household.building},'%') |
| | | </if> |
| | |
| | | |
| | | <select id="statistics" resultType="java.lang.Integer"> |
| | | SELECT |
| | | count( 1 ) |
| | | count(1) |
| | | FROM |
| | | jczz_household jh |
| | | LEFT JOIN jczz_doorplate_address jda ON jh.house_code = jda.address_code |
| | | LEFT JOIN jczz_house jhs ON jh.house_code = jhs.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 jg.grid_code = jhs.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jhs.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | <where> |
| | | <if test="neiCode != null and neiCode != ''"> |
| | | and jda.nei_code = #{neiCode} |
| | | <if test="household.neiCode != null and household.neiCode != ''"> |
| | | and jda.nei_code = #{household.neiCode} |
| | | </if> |
| | | <if test="userId != null"> |
| | | AND jh.house_code IN ( |
| | | SELECT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid_range jgr |
| | | LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | WHERE |
| | | jg.is_deleted = 0 |
| | | AND jgm.user_id = #{userId} ) |
| | | <if test="household.confirmFlag != null and household.confirmFlag != ''"> |
| | | and jh.confirm_flag = #{household.confirmFlag} |
| | | </if> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="household.roleName != null and household.roleName != ''"> |
| | | <if test="household.roleName=='wgy'"> |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and jhs.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jhs.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="household.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> |
| | | <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> |
| | | |
| | | </otherwise> |
| | | </choose> |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | and jh.is_deleted = 0 |
| | | and jh.confirm_flag = 0 |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | |
| | | void importUserHouseHold(List<HouseHoldExcel> data, Boolean isCovered); |
| | | |
| | | Integer statistics(Long userId,String neiCode); |
| | | Integer statistics(Long userId,String neiCode,Integer confirmFlag); |
| | | |
| | | /** |
| | | * 住户对应物业,网格,公安负责人查询 |
| | |
| | | |
| | | /** |
| | | * 自定义分页查询 |
| | | * |
| | | * @param page |
| | | * @param houseRental |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<HouseRentalTenantVO> selectHouseRentalPage(IPage<HouseRentalTenantVO> page, HouseRentalTenantVO houseRental) { |
| | | if (null!=houseRental.getAuditStatus()){ |
| | | if (houseRental.getAuditStatus()==0){ |
| | | if (null != houseRental.getAuditStatus()) { |
| | | if (houseRental.getAuditStatus() == 0) { |
| | | houseRental.setAuditStatus(2); |
| | | } |
| | | } |
| | |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator()); |
| | | for (HouseRentalTenantVO houseRentalTenantVO : houseRentalTenantVOS) { |
| | | if(houseRentalTenantVO.getStatus().equals(1)){ |
| | | if (houseRentalTenantVO.getStatus().equals(1)) { |
| | | houseRentalTenantVO.setStatus(30); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(0)){ |
| | | if (houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(0)) { |
| | | houseRentalTenantVO.setStatus(0); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(1)){ |
| | | if (houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(1)) { |
| | | houseRentalTenantVO.setStatus(1); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(3)){ |
| | | if (houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(3)) { |
| | | houseRentalTenantVO.setStatus(20); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(2)){ |
| | | if (houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(2)) { |
| | | houseRentalTenantVO.setStatus(10); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询房屋出租情况 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 自定义房屋出租新增 |
| | | * |
| | | * @param houseRentalVO |
| | | * @return |
| | | */ |
| | |
| | | // 获取请求头中的角色别名 |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | // 居民 |
| | | if (!Strings.isBlank(roleName) && roleName.equals("inhabitant")){ |
| | | if (!Strings.isBlank(roleName) && roleName.equals("inhabitant")) { |
| | | // 待审核 |
| | | houseRentalVO.setAuditStatus(0); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 保存租户信息 |
| | | * |
| | | * @param houseRentalVO |
| | | * @param flag |
| | | * @return |
| | | */ |
| | | public boolean saveHousehold(HouseRentalVO houseRentalVO, boolean flag) { |
| | | if (flag && houseRentalVO.getHouseholdVOList().size()>0) { |
| | | if (flag && houseRentalVO.getHouseholdVOList().size() > 0) { |
| | | List<String> phoneList = new ArrayList<>(); |
| | | List<HouseholdEntity> householdEntityList = new ArrayList<>(); |
| | | houseRentalVO.getHouseholdVOList().forEach(e -> { |
| | |
| | | } catch (Exception e) { |
| | | log.error("保存用户角色为居民:", e); |
| | | } |
| | | flag = iHouseholdService.saveBatch(householdEntityList); |
| | | flag = iHouseholdService.saveBatch(householdEntityList); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * 出租屋 自定义删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 出租屋 自定义修改 |
| | | * |
| | | * @param houseRental |
| | | * @return |
| | | */ |
| | |
| | | e.getId()).collect(Collectors.toList()).contains(vo.getId())).collect(Collectors.toList()); |
| | | |
| | | // 批量新增 |
| | | if (addList.size()>0) { |
| | | if (addList.size() > 0) { |
| | | addFlag = iHouseholdService.saveBatch(addList); |
| | | } |
| | | // 批量修改 |
| | |
| | | |
| | | /** |
| | | * 获取统计数据 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getStatistics(HouseRentalTenantVO houseRental) { |
| | | List<String> list = new ArrayList<>(); |
| | | if (null!=houseRental.getRoleName() && !houseRental.getRoleName().equals("")){ |
| | | if (houseRental.getRoleName().equals("网格员")){ |
| | | if (null != houseRental.getRoleName() && !houseRental.getRoleName().equals("")) { |
| | | if (houseRental.getRoleName().equals("网格员")) { |
| | | // 查询对应的房屋地址code |
| | | list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | } |
| | | // 查询 |
| | | List<HouseRentalStatistics> statistics = baseMapper.getStatistics(houseRental,list); |
| | | List<HouseRentalStatistics> statistics = baseMapper.getStatistics(houseRental, list); |
| | | // 返回 |
| | | return statistics; |
| | | } |
| | | |
| | | /** |
| | | * 出租屋 确认 |
| | | * |
| | | * @param houseRental |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 导出租赁信息 |
| | | * |
| | | * @param houseRentalVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | @Override |
| | | public Integer getStatisticsCount(HouseRentalTenantVO houseRental) { |
| | | return baseMapper.getStatisticsCount(houseRental.getUserId(), houseRental.getNeiCode()); |
| | | CommonParamSet<Object> commonParamSet = new CommonParamSet<>().invoke(HouseRentalTenantVO.class, houseRental); |
| | | return baseMapper.getStatisticsCount(houseRental, commonParamSet.getGridCodeList(), |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator()); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | 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.node.TreeIntegerNode; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.place.entity.PlaceEntity; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public IPage<HouseholdVO> selectHouseholdPage(IPage<HouseholdVO> page, HouseholdVO household) { |
| | | StopWatch stopWatch = new StopWatch(); |
| | | stopWatch.start(); |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | List<HouseholdVO> householdVOS = baseMapper.selectHouseholdPage(page, household,regionChildCodesList,isAdministrator); |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(HouseholdVO.class, household); |
| | | |
| | | // List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | // Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | |
| | | List<HouseholdVO> householdVOS = baseMapper.selectHouseholdPage(page, household, commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getGridCodeList()); |
| | | stopWatch.stop(); |
| | | System.out.println("selectHouseholdPage:" + stopWatch.getTotalTimeMillis()); |
| | | // System.out.println("selectHouseholdPage:" + stopWatch.getTotalTimeMillis()); |
| | | return page.setRecords(householdVOS); |
| | | } |
| | | |
| | | /** |
| | | * 查询房屋集合信息 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询房屋人员情况 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 处理字典 |
| | | * |
| | | * @param householdList |
| | | */ |
| | | private void handleDictBiz(List<HouseholdVO> householdList) { |
| | | if (householdList.size()>0){ |
| | | if (householdList.size() > 0) { |
| | | // 查询角色关系字典 |
| | | List<DictBiz> dictBizList = dictBizService.getList("roleRelation",null); |
| | | if (dictBizList.size()>0) { |
| | | List<DictBiz> dictBizList = dictBizService.getList("roleRelation", null); |
| | | if (dictBizList.size() > 0) { |
| | | // 遍历 |
| | | for (HouseholdVO householdVO : householdList) { |
| | | if (null != householdVO.getRelationship()) { |
| | |
| | | |
| | | /** |
| | | * 住户 自定义新增或修改 |
| | | * |
| | | * @param household |
| | | * @return |
| | | */ |
| | |
| | | boolean flag = false; |
| | | household.setUpdateTime(new Date()); |
| | | household.setUpdateUser(AuthUtil.getUserId()); |
| | | if (!Strings.isBlank(household.getRoleName()) && household.getRoleName().equals("居民")){ |
| | | if (!Strings.isBlank(household.getRoleName()) && household.getRoleName().equals("居民")) { |
| | | // 待审核 |
| | | household.setConfirmFlag(0); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 更新用户标签信息 |
| | | * |
| | | * @param household |
| | | */ |
| | | public void updateUserLabelInfo(HouseholdVO household) { |
| | | if (household.getHouseholdLabelList().size()>0){ |
| | | if (household.getHouseholdLabelList().size() > 0) { |
| | | List<HouseholdLabelVO> householdLabelList = household.getHouseholdLabelList(); |
| | | for (HouseholdLabelVO householdLabelVO : householdLabelList) { |
| | | if (!Strings.isBlank(household.getHouseCode())) { |
| | |
| | | |
| | | /** |
| | | * 更新用户信息 |
| | | * |
| | | * @param household |
| | | */ |
| | | public void updateUserInfo(HouseholdEntity household) { |
| | | // 判断用户是否为业主,如果是业主,则新增 |
| | | if (null!=household.getRelationship() && household.getRelationship()==1){ |
| | | if (null != household.getRelationship() && household.getRelationship() == 1) { |
| | | // 如果为业主 |
| | | // 新增用户 |
| | | bindUserHandle(household); |
| | |
| | | |
| | | /** |
| | | * 业主和用户绑定 |
| | | * |
| | | * @param |
| | | */ |
| | | public User bindUserHandle(HouseholdEntity householdEntity) { |
| | | User newUser = new User(); |
| | | if (null!=householdEntity.getPhoneNumber() && !householdEntity.getPhoneNumber().equals("")) { |
| | | if (null != householdEntity.getPhoneNumber() && !householdEntity.getPhoneNumber().equals("")) { |
| | | //根据手机号查询库里的数据 |
| | | User userParams = new User(); |
| | | userParams.setPhone(householdEntity.getPhoneNumber()); |
| | | User user = userService.getOne(Condition.getQueryWrapper(userParams)); |
| | | if (null==user) { |
| | | if (null == user) { |
| | | User userParams1 = new User(); |
| | | userParams1.setAccount(householdEntity.getPhoneNumber()); |
| | | userParams1.setIsDeleted(0); |
| | | user = userService.getOne(Condition.getQueryWrapper(userParams1)); |
| | | } |
| | | if (null!=user) { |
| | | if (null != user) { |
| | | //如果用户存在,则该用户id绑定场所 |
| | | householdEntity.setAssociatedUserId(user.getId()); |
| | | //更新住户信息 |
| | | updateById(householdEntity); |
| | | newUser = user; |
| | | // 判断用户是否包含了居民角色,不包含则需更新 |
| | | if (!user.getRoleId().contains("1717429059648606209")){ |
| | | if (!user.getRoleId().contains("1717429059648606209")) { |
| | | user.setRoleId(user.getRoleId() + ",1717429059648606209"); |
| | | //更新 |
| | | userService.updateById(user); |
| | |
| | | |
| | | /** |
| | | * 住户 自定义查询详情 |
| | | * |
| | | * @param household |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 住户审核统计 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer statistics(Long userId,String neiCode) { |
| | | return baseMapper.statistics(userId,neiCode); |
| | | public Integer statistics(Long userId, String neiCode,Integer confirmFlag) { |
| | | HouseholdVO householdVO = new HouseholdVO(); |
| | | householdVO.setConfirmFlag(confirmFlag); |
| | | householdVO.setNeiCode(neiCode); |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(HouseholdVO.class, householdVO); |
| | | |
| | | return baseMapper.statistics(householdVO,commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getGridCodeList()); |
| | | } |
| | | |
| | | /** |
| | | * 住户对应物业,网格,公安负责人查询 |
| | | * |
| | | * @param household |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 住户业主信息处理,将业主人员插入到用户表 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | for (HouseholdEntity householdEntity : householdEntityList) { |
| | | // 根据手机号查询对应账号和手机号的用户信息 |
| | | List<User> userList = userService.getUserListByPhoneOrAccount(householdEntity.getPhoneNumber()); |
| | | if (userList.size()>0){ |
| | | if (userList.size() > 0) { |
| | | User user = userList.get(0); |
| | | householdEntity.setAssociatedUserId(user.getId()); |
| | | // 更新 |
| | | updateById(householdEntity); |
| | | // 判断用户是否包含了居民角色,不包含则需更新 |
| | | if (!user.getRoleId().contains("1717429059648606209")){ |
| | | if (!user.getRoleId().contains("1717429059648606209")) { |
| | | user.setRoleId(user.getRoleId() + ",1717429059648606209"); |
| | | //更新 |
| | | userService.updateById(user); |
| | | } |
| | | }else { |
| | | } else { |
| | | // 插入用户信息 |
| | | //如果用户不存在,则新增一个用户 |
| | | User newUser = new User(); |
| | |
| | | |
| | | /** |
| | | * 同时删除对应的用户信息 |
| | | * |
| | | * @param idList |
| | | */ |
| | | public void removeHouseholdUser(List<Long> idList) { |
| | | for (Long id : idList) { |
| | | HouseholdEntity householdEntity = getById(id); |
| | | // 如果是业主 |
| | | if (householdEntity.getRelationship()==1){ |
| | | if (householdEntity.getRelationship() == 1) { |
| | | // 查询对应的用户 |
| | | User user = userService.getById(householdEntity.getAssociatedUserId()); |
| | | // 判断是否还绑定其他的房屋,如果有,则不操作用户 |
| | | QueryWrapper<HouseholdEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("is_deleted",0).eq("associated_user_id",user.getId()); |
| | | wrapper.eq("is_deleted", 0).eq("associated_user_id", user.getId()); |
| | | List<HouseholdEntity> householdEntityList = list(wrapper); |
| | | if (householdEntityList.size()==1){ |
| | | if (householdEntityList.size() == 1) { |
| | | // 判断角色 |
| | | if (!Strings.isBlank(user.getRoleId())){ |
| | | if (!Strings.isBlank(user.getRoleId())) { |
| | | List<String> stringList = Arrays.asList(user.getRoleId().split(",")); |
| | | // 查询场所 |
| | | QueryWrapper<PlaceEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("principal_user_id",user.getId()); |
| | | queryWrapper.eq("is_deleted", 0).eq("principal_user_id", user.getId()); |
| | | List<PlaceEntity> placeEntityList = placeService.list(queryWrapper); |
| | | // 即没有房屋和场所了就删除对应的居民角色 |
| | | if (placeEntityList.size()==0) { |
| | | if (placeEntityList.size() == 0) { |
| | | // 查看当前用户的角色是否只有一个 |
| | | if (stringList.size() > 1) { |
| | | // 查询是否对应有场所负责人,如果有则不删除,如果没有则删除对应的角色 |
| | |
| | | |
| | | /** |
| | | * 删除住户标签信息 |
| | | * |
| | | * @param idList |
| | | */ |
| | | public void removeHouseholdLabel(List<Long> idList) { |
| | | for (Long id : idList) { |
| | | QueryWrapper<UserHouseLabelEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("household_id",id); |
| | | wrapper.eq("household_id", id); |
| | | userHouseLabelService.remove(wrapper); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<HouseholdVO> getAllHouseHold(HouseholdVO household) { |
| | | return baseMapper.getAllHouseHold(household); |
| | | return baseMapper.getAllHouseHold(household); |
| | | } |
| | | |
| | | /** |
| | | * 住户列表查询 |
| | | * |
| | | * @param household |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据人员标签编号集合查询对应的住户(按颜色区分近多少天没有发过任务的住户) |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | |
| | | |
| | | private void recursion(TreeIntegerNode node) { |
| | | if (node.getChildren() != null && node.getChildren().size() > 0) { |
| | | if(node.getId().equals(1030)){ |
| | | if (node.getId().equals(1030)) { |
| | | int sum = node.getChildren().stream().mapToInt(TreeIntegerNode::getCount).sum(); |
| | | node.setCount(sum); |
| | | } |
| | | if(node.getId().equals(1031)){ |
| | | if (node.getId().equals(1031)) { |
| | | int sum = node.getChildren().stream().mapToInt(TreeIntegerNode::getCount).sum(); |
| | | node.setCount(sum); |
| | | } |
| | |
| | | */ |
| | | private Integer dldType; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | |
| | | |
| | | /** |
| | | * 拼接地址 |
| | |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | private String communityCode; |
| | |
| | | |
| | | private String aoiCode; |
| | | |
| | | private String neiCode; |
| | | |
| | | /** |
| | | * 标签id |
| | | */ |
| | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | // private String roleName; |
| | | |
| | | // 角色名称 |
| | | @ApiModelProperty(value = "角色名称", example = "") |
| | | private String roleName; |
| | | |
| | | // 社区编号 |
| | | @ApiModelProperty(value = "社区编号", example = "") |
| | | private String communityCode; |
| | | |
| | | } |
| | |
| | | */ |
| | | List<PlaceExtVO> selectPlaceExtPage(IPage page, |
| | | @Param("placeExt") PlaceExtVO placeExt, |
| | | @Param("houseCodeList") List<String> houseCodeList, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | |
| | | PlaceExtVO getDetail(@Param("placeExt") PlaceExtVO placeExt); |
| | | |
| | | |
| | | Integer selectCount(@Param("userId") Long userId, @Param("neiCode") String neiCode, @Param("confirmFlag") Integer confirmFlag); |
| | | Integer selectCount(@Param("placeExt") PlaceExtVO placeExt, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | | } |
| | |
| | | count( 1 ) |
| | | FROM |
| | | jczz_place_ext jpe |
| | | LEFT JOIN jczz_place jp ON jp.id = jpe.place_id and jp.is_deleted = 0 |
| | | LEFT JOIN jczz_doorplate_address jda ON locate(jda.address_code,jp.house_code)>0 |
| | | LEFT JOIN jczz_place jp ON jpe.place_id = jp.id AND jp.is_deleted = 0 and jp.place_name != '' |
| | | LEFT JOIN jczz_grid jg ON jp.grid_code = jg.grid_code AND jg.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 jczz_doorplate_address jda ON jp.house_code = jda.address_code |
| | | <where> |
| | | <if test="confirmFlag != null"> |
| | | and jpe.confirm_flag = #{confirmFlag} |
| | | <if test="placeExt.neiCode != null and placeExt.neiCode != ''"> |
| | | and jda.nei_code = #{placeExt.neiCode} |
| | | </if> |
| | | <if test="userId != null"> |
| | | AND jp.house_code IN ( |
| | | SELECT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid_range jgr |
| | | LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | WHERE |
| | | jg.is_deleted = 0 |
| | | <if test="neiCode != null and neiCode != ''"> |
| | | and jg.community_code = #{neiCode} |
| | | </if> |
| | | AND jgm.user_id = #{userId} ) |
| | | <if test="placeExt.confirmFlag != null"> |
| | | and jpe.confirm_flag = #{placeExt.confirmFlag} |
| | | </if> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="placeExt.roleName != null and placeExt.roleName != ''"> |
| | | <if test="placeExt.roleName=='wgy'"> |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and jp.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jp.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="placeExt.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> |
| | | <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 in ('') |
| | | ) |
| | | </otherwise> |
| | | </choose> |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | and jpe.is_deleted = 0 |
| | | </where> |
| | |
| | | |
| | | <select id="getDetail" resultType="org.springblade.modules.place.vo.PlaceExtVO"> |
| | | select jpe.*, |
| | | jp.place_name as placeName, |
| | | jp.lng, |
| | | jp.lat, |
| | | jp.location |
| | | jp.place_name as placeName, |
| | | jp.lng, |
| | | jp.lat, |
| | | jp.location |
| | | from jczz_place_ext jpe |
| | | left join jczz_place jp on jpe.place_id = jp.id and jp.is_deleted = 0 |
| | | where jpe.is_deleted = 0 and jpe.place_id = #{placeExt.placeId} |
| | | left join jczz_place jp on jpe.place_id = jp.id and jp.is_deleted = 0 |
| | | where jpe.is_deleted = 0 |
| | | and jpe.place_id = #{placeExt.placeId} |
| | | </select> |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.utils.SpringUtils; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.place.entity.PlaceEntity; |
| | | import org.springblade.modules.place.entity.PlaceExtEntity; |
| | |
| | | import org.springblade.modules.place.service.IPlacePractitionerService; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.place.vo.PlaceExtVO; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Autowired |
| | | private IPlacePractitionerService placePractitionerService; |
| | | |
| | | @Autowired |
| | | private IGridService gridService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | // @Autowired |
| | | // private IGridService gridService; |
| | | // |
| | | // @Autowired |
| | | // private IDeptService deptService; |
| | | |
| | | /** |
| | | * 自定义查询 |
| | |
| | | */ |
| | | @Override |
| | | public IPage<PlaceExtVO> selectPlaceExtPage(IPage<PlaceExtVO> page, PlaceExtVO placeExt) { |
| | | List<String> list = new ArrayList<>(); |
| | | // if (null != placeExt.getRoleName() && !placeExt.getRoleName().equals("")) { |
| | | // if (placeExt.getRoleName().equals("网格员")) { |
| | | // // 查询对应的房屋地址code |
| | | // list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId()); |
| | | // } |
| | | // if (!placeExt.getRoleName().equals("系统管理员")) { |
| | | // placeExt.setCreateUser(AuthUtil.getUserId()); |
| | | // List<String> list = new ArrayList<>(); |
| | | // String roleName = SpringUtils.getRequestParam("roleName"); |
| | | // String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | // if (!Strings.isBlank(communityCode)){ |
| | | // // 校验社区编号是否合规 |
| | | // if(null!=SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | // placeExt.setCommunityCode(communityCode); |
| | | // } |
| | | // } |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)){ |
| | | // 校验社区编号是否合规 |
| | | if(null!=SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | placeExt.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)){ |
| | | placeExt.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()); |
| | | } |
| | | } |
| | | if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | placeExt.setCommunityCode("361102003027"); |
| | | placeExt.setCreateUser(null); |
| | | } |
| | | return page.setRecords(baseMapper.selectPlaceExtPage(page, placeExt, list,regionChildCodesList,isAdministrator,gridCodeList)); |
| | | // List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | // Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | // // 网格编号集合 |
| | | // List<String> gridCodeList = new ArrayList<>(); |
| | | // // 民警角色 |
| | | // if (!Strings.isBlank(roleName)){ |
| | | // placeExt.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()); |
| | | // } |
| | | // } |
| | | // if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | // placeExt.setCommunityCode("361102003027"); |
| | | // placeExt.setCreateUser(null); |
| | | // } |
| | | CommonParamSet<Object> commonParamSet = new CommonParamSet<>().invoke(PlaceExtVO.class, placeExt); |
| | | |
| | | |
| | | return page.setRecords(baseMapper.selectPlaceExtPage(page, placeExt,commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(),commonParamSet.getGridCodeList())); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public Integer selectCount(Long userId, String neiCode, Integer confirmFlag) { |
| | | return baseMapper.selectCount(userId, neiCode, confirmFlag); |
| | | PlaceExtVO placeExt = new PlaceExtVO(); |
| | | placeExt.setConfirmFlag(confirmFlag); |
| | | placeExt.setNeiCode(neiCode); |
| | | CommonParamSet<Object> commonParamSet = new CommonParamSet<>().invoke(PlaceExtVO.class, placeExt); |
| | | return baseMapper.selectCount(placeExt,commonParamSet.getRegionChildCodesList(),commonParamSet.getIsAdministrator(),commonParamSet.getGridCodeList()); |
| | | } |
| | | } |
| | |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.task.vo.TaskLabelReportingEventVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | @Override |
| | | public IPage<PlaceVO> selectPlacePage(IPage<PlaceVO> page, PlaceVO place) { |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(PlaceVO.class,place); |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(PlaceVO.class, place); |
| | | List<PlaceVO> placeVOS = baseMapper.selectPlacePage(page, |
| | | place, |
| | | commonParamSet.getGridCodeList(), |
| | |
| | | |
| | | /** |
| | | * 设置场所的source 来源 |
| | | * |
| | | * @param placeVO |
| | | */ |
| | | public void setSource(PlaceVO placeVO) { |
| | | if (null!=placeVO.getSource()){ |
| | | if (null != placeVO.getSource()) { |
| | | placeVO.setSource(placeVO.getSource()); |
| | | }else { |
| | | } else { |
| | | // 查询该houseCode 是否存在地址总表,如果是,赋值 1,否则2 |
| | | QueryWrapper<DoorplateAddressEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("address_code",placeVO.getHouseCode()); |
| | | wrapper.eq("address_code", placeVO.getHouseCode()); |
| | | DoorplateAddressEntity one = doorplateAddressService.getOne(wrapper); |
| | | if (null!=one){ |
| | | if (null != one) { |
| | | placeVO.setSource(1); |
| | | }else { |
| | | } else { |
| | | placeVO.setSource(2); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 处理对应的绑定房屋数据 |
| | | * |
| | | * @param list |
| | | */ |
| | | public void handlePlaceOne(List<String> list,PlaceVO place) { |
| | | public void handlePlaceOne(List<String> list, PlaceVO place) { |
| | | // 处理对应的绑定房屋数据 |
| | | List<Long> longs = new ArrayList<>(); |
| | | // 把其他单个的场所数据删除 |
| | |
| | | */ |
| | | @Override |
| | | public IPage<PlaceVO> selectNinePlacePage(IPage<PlaceVO> page, 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()); |
| | | } |
| | | } |
| | | // 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()){ |
| | | if (null != place.getNineType()) { |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",place.getNineType()).eq("code","nineType"); |
| | | queryWrapper.eq("is_deleted", 0).eq("dict_key", place.getNineType()).eq("code", "nineType"); |
| | | // 先查询当前 |
| | | DictBiz one = dictBizService.getOne(queryWrapper); |
| | | // 查询本身和子集的key |
| | | List<DictBiz> list = dictBizService.getList("nineType", one.getId()); |
| | | if (list.size()==0){ |
| | | if (list.size() == 0) { |
| | | strings.add(place.getNineType().toString()); |
| | | }else { |
| | | } else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<PlaceVO> placeVOS = baseMapper.selectNinePlacePage(page, place, gridCodeList, regionChildCodesList, isAdministrator,strings); |
| | | List<PlaceVO> placeVOS = baseMapper.selectNinePlacePage(page, place, commonParamSet.getGridCodeList(), |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator(), strings); |
| | | // 返回 |
| | | return page.setRecords(placeVOS); |
| | | } |
| | |
| | | public List<NinePlaceExcel> export(PlaceVO place) { |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)){ |
| | | if (!Strings.isBlank(communityCode)) { |
| | | // 校验社区编号是否合规 |
| | | if(null!=SpringUtils.getBean(IRegionService.class).getById(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; |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | // 网格编号集合 |
| | | List<String> gridCodeList = new ArrayList<>(); |
| | | // 民警角色 |
| | | if (!Strings.isBlank(roleName)){ |
| | | if (!Strings.isBlank(roleName)) { |
| | | place.setRoleName(roleName); |
| | | if(roleName.equals("mj")) { |
| | | if (roleName.equals("mj")) { |
| | | regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | if (roleName.equals("wgy")) { |
| | |
| | | } |
| | | } |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=place.getNineType()){ |
| | | if (null != place.getNineType()) { |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",place.getNineType()).eq("code","nineType"); |
| | | queryWrapper.eq("is_deleted", 0).eq("dict_key", place.getNineType()).eq("code", "nineType"); |
| | | // 先查询当前 |
| | | DictBiz one = dictBizService.getOne(queryWrapper); |
| | | // 查询本身和子集的key |
| | | List<DictBiz> list = dictBizService.getList("nineType", one.getId()); |
| | | if (list.size()==0){ |
| | | if (list.size() == 0) { |
| | | strings.add(place.getNineType().toString()); |
| | | }else { |
| | | } else { |
| | | 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, gridCodeList, regionChildCodesList, isAdministrator, 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) { |
| | |
| | | updateById(placeEntity); |
| | | // 查询绑定关系是否已存在 |
| | | QueryWrapper<PlaceDoorEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("house_code",placeEntity.getHouseCode()).eq("place_id",placeEntity.getId()); |
| | | wrapper.eq("house_code", placeEntity.getHouseCode()).eq("place_id", placeEntity.getId()); |
| | | // 查询 |
| | | PlaceDoorEntity one = placeDoorService.getOne(wrapper); |
| | | if (null==one){ |
| | | if (null == one) { |
| | | // 新增 |
| | | PlaceDoorEntity placeDoorEntity = new PlaceDoorEntity(); |
| | | placeDoorEntity.setPlaceId(placeEntity.getId()); |
| | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | private String neiCode; |
| | | |
| | | /** |
| | | * 从业人员 |
| | |
| | | @ApiModelProperty("结束时间") |
| | | private String endTime; |
| | | |
| | | private String communityCode; |
| | | // private String communityCode; |
| | | |
| | | /** |
| | | * isApp |
| | | */ |
| | | private Integer isApp; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | private String communityCode; |
| | | |
| | | } |
| | |
| | | |
| | | private String phone; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | |
| | | /** |
| | | * 类型 2:非小区(能关联地址表) 3:商超 |
| | | */ |
| | |
| | | */ |
| | | private String communityCode; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | private String roleName; |
| | | |
| | | } |
| | |
| | | private String houseCode; |
| | | |
| | | /** 事件类型(1:取保候审,2旅馆 3打金店 4二手手机 5二手车 6 校园安全) */ |
| | | @ApiModelProperty(value = "事件类型(1:取保候审,2旅馆 3打金店 4二手手机 5二手车 6 校园安全 7.九小自查任务 8 九小整改任务 )", example = "") |
| | | @ApiModelProperty(value = "事件类型(1:取保候审,5二手交易 7.九小自查任务 8 九小整改任务 )", example = "") |
| | | @TableField("report_type") |
| | | private Integer reportType; |
| | | /** |
| | |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator); |
| | | |
| | | Integer selectTaskCount(TaskVO task); |
| | | Integer selectTaskCount(@Param("task") TaskVO task, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | | |
| | | |
| | | List<TaskVO> getBailReportingPage(IPage<TaskVO> page, TaskVO task); |
| | |
| | | and jt.report_type = #{task.reportType} |
| | | </if> |
| | | <if test="task.reportType == null"> |
| | | and jt.report_type in (2,3,4,5,6,7,8) |
| | | and jt.report_type in ( 5,8) |
| | | </if> |
| | | and jt.is_deleted = 0 |
| | | and jt.house_code is not null |
| | |
| | | |
| | | <select id="selectTaskCount" resultType="int" parameterType="org.springblade.modules.task.vo.TaskVO"> |
| | | SELECT |
| | | count( 1 ) |
| | | count(1) |
| | | FROM |
| | | jczz_task jt |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jt.house_code |
| | | LEFT JOIN jczz_place jp ON jt.house_code=jp.house_code and jp.is_deleted = 0 |
| | | LEFT JOIN blade_user bu on bu.id = jt.create_user and bu.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_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | <where> |
| | | <if test="status != null"> |
| | | and jt.status = #{status} |
| | | <if test="task.roleName != null and task.roleName != ''"> |
| | | <if test="task.roleName=='wgy'"> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and jp.grid_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jp.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </if> |
| | | <if test="task.roleName=='mj'"> |
| | | <if test="isAdministrator==2"> |
| | | <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> |
| | | </if> |
| | | </if> |
| | | <if test="frequency != null"> |
| | | and jt.frequency = #{frequency} |
| | | <if test="isAdministrator==2"> |
| | | <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 |
| | | br.village_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | <otherwise> |
| | | and |
| | | ( |
| | | jg.grid_code in ('') or br.village_code in ('') |
| | | ) |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="type != null"> |
| | | and jt.type = #{type} |
| | | <if test="task.status != null and task.status != null"> |
| | | and jt.status = #{task.status} |
| | | </if> |
| | | <!-- 取保候审 --> |
| | | <if test="reportType != null and reportType == 1 "> |
| | | and jt.report_type = 1 |
| | | <if test="task.neiCode != null and task.neiCode != null"> |
| | | and jg.community_code = #{task.neiCode} |
| | | </if> |
| | | <if test="task.communityCode != null and task.communityCode != null"> |
| | | and jg.community_code = #{task.communityCode} |
| | | </if> |
| | | <if test="task.communityName != null and task.communityName != null"> |
| | | and br.name like concat('%', #{task.communityName}, '%') |
| | | </if> |
| | | <if test="task.streetCode != null and task.streetCode != null"> |
| | | and br.town_code = #{task.streetCode} |
| | | </if> |
| | | <if test="task.realName != null and task.realName != null"> |
| | | and jp.principal like concat('%', #{task.realName}, '%') |
| | | </if> |
| | | <if test="task.phone != null and task.phone != null"> |
| | | and bu.phone like concat('%', #{task.phone}, '%') |
| | | </if> |
| | | <if test="task.frequency != null and task.frequency != ''"> |
| | | and jt.frequency = #{task.frequency} |
| | | </if> |
| | | <if test="task.name != null and task.name != ''"> |
| | | and jt.name like concat('%', #{task.name}, '%') |
| | | </if> |
| | | <if test="task.id != null ">and jt.id = #{task.id}</if> |
| | | <if test="task.type != null ">and jt.type = #{task.type}</if> |
| | | <if test="task.remark != null and task.remark != ''">and jt.remark = #{task.remark}</if> |
| | | <if test="task.createTime != null ">and jt.create_time = #{task.createTime}</if> |
| | | <if test="task.createUser != null ">and jt.create_user = #{task.createUser}</if> |
| | | <if test="task.updateTime != null ">and jt.update_time = #{task.updateTime}</if> |
| | | <if test="task.updateUser != null ">and jt.update_user = #{task.updateUser}</if> |
| | | <if test="task.isDeleted != null ">and jt.is_deleted = #{task.isDeleted}</if> |
| | | <if test="task.houseCode != null and task.houseCode != ''">and jt.house_code = #{task.houseCode}</if> |
| | | <if test="task.startTime != null and task.startTime != '' and task.endTime != null and task.endTime != '' "> |
| | | AND jt.create_time BETWEEN #{task.startTime} and #{task.endTime} |
| | | </if> |
| | | <!-- 场所店铺 --> |
| | | <if test="reportType != null and reportType == 2 "> |
| | | and jt.report_type in (2,3,4,5,6,7) |
| | | <if test="task.reportType != null"> |
| | | and jt.report_type = #{task.reportType} |
| | | </if> |
| | | |
| | | <if test="name != null and name != ''"> |
| | | and jt.name like concat('%', #{name}, '%') |
| | | <if test="task.reportType == null"> |
| | | and jt.report_type in (5,8) |
| | | </if> |
| | | <if test="neiCode != null and neiCode != ''"> |
| | | and jda.nei_code = #{neiCode} |
| | | </if> |
| | | <if test="userId != null"> |
| | | AND jt.house_code IN ( |
| | | SELECT |
| | | jgr.house_code |
| | | FROM |
| | | jczz_grid_range jgr |
| | | LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | WHERE |
| | | jg.is_deleted = 0 |
| | | AND jgm.user_id = #{userId} ) |
| | | </if> |
| | | and jt.is_deleted = 0 |
| | | and jt.house_code is not null |
| | | </where> |
| | | order by jt.create_time desc |
| | | </select> |
| | | |
| | | |
| | |
| | | */ |
| | | List<TaskReportForRepairsVO> selectTaskReportForRepairsPage(IPage page, |
| | | @Param("vo") TaskReportForRepairsVO taskReportForRepairs, |
| | | @Param("list") List<String> list, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("aoiCodeList") List<String> aoiCodeList, |
| | |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator); |
| | | |
| | | Integer getStatistics(Long userId, String neiCode); |
| | | Integer getStatistics(Long userId, String neiCode, String roleName); |
| | | |
| | | /** |
| | | * 更新状态--临时接口 |
| | |
| | | <where> |
| | | and jtr.is_deleted = 0 |
| | | and jtr.confirm_flag = 1 |
| | | <if test="userId != null"> |
| | | |
| | | <if test="userId != null and roleName == 'wgy'" > |
| | | AND ( |
| | | jp.grid_code IN ( |
| | | SELECT |
| | |
| | | AND jgm.user_id = #{userId} |
| | | )) |
| | | </if> |
| | | |
| | | <if test="userId != null and roleName == 'mj'"> |
| | | AND ( |
| | | jp.jw_grid_code IN ( |
| | | SELECT |
| | | jpag.jw_grid_code |
| | | FROM |
| | | jczz_police_affairs_grid jpag |
| | | WHERE |
| | | jpag.is_deleted = 0 |
| | | AND jpag.police_user_id = #{userId} |
| | | ) |
| | | OR jh.jw_grid_code IN ( |
| | | SELECT |
| | | jpag.jw_grid_code |
| | | FROM |
| | | jczz_police_affairs_grid jpag |
| | | WHERE |
| | | jpag.is_deleted = 0 |
| | | AND jpag.police_user_id = #{userId} |
| | | )) |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | |
| | | @Autowired |
| | | private ITaskService taskService; |
| | | |
| | | @Autowired |
| | | private IGridService gridService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | /** |
| | | * 自定义分页 |
| | |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskReportForRepairsVO.class, taskReportForRepairs); |
| | | taskReportForRepairs.setConfirmUserId(AuthUtil.getUserId()); |
| | | List<String> addressCodeList = new ArrayList<>(); |
| | | if (null != taskReportForRepairs.getRoleName() && !taskReportForRepairs.getRoleName().equals("")) { |
| | | if (taskReportForRepairs.getRoleName().equals("inhabitant")) { |
| | | taskReportForRepairs.setCreateUser(AuthUtil.getUserId()); |
| | |
| | | aoiCodeList = districtEntityList.stream().map(i -> i.getAoiCode()).collect(Collectors.toList()); |
| | | } |
| | | |
| | | return page.setRecords(baseMapper.selectTaskReportForRepairsPage(page, taskReportForRepairs, addressCodeList, |
| | | return page.setRecords(baseMapper.selectTaskReportForRepairsPage(page, taskReportForRepairs, |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator(), aoiCodeList, commonParamSet.getGridCodeList())); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public Integer getStatistics(Long userId, String neiCode) { |
| | | return baseMapper.getStatistics(userId, neiCode); |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | return baseMapper.getStatistics(userId, neiCode,roleName); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import liquibase.pro.packaged.W; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.constant.DictConstant; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.category.entity.CategoryEntity; |
| | | import org.springblade.modules.category.service.ICategoryService; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | | import org.springblade.modules.grid.entity.GridWorkLogEntity; |
| | | import org.springblade.modules.grid.entity.GridmanEntity; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.service.IGridWorkLogService; |
| | | import org.springblade.modules.grid.service.IGridmanService; |
| | | import org.springblade.modules.house.service.IHouseRentalService; |
| | | import org.springblade.modules.house.service.IHouseholdService; |
| | | import org.springblade.modules.house.vo.HouseRentalTenantVO; |
| | |
| | | import org.springblade.modules.place.service.IPlaceExtService; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springblade.modules.task.entity.*; |
| | | import org.springblade.modules.task.mapper.TaskMapper; |
| | | import org.springblade.modules.task.service.*; |
| | | import org.springblade.modules.task.vo.TaskVO; |
| | | import org.springblade.modules.taskPlaceRectification.service.ITaskPlaceRectificationService; |
| | | import org.springblade.modules.taskPlaceSelfCheck.entity.TaskPlaceSelfCheckEntity; |
| | | import org.springblade.modules.taskPlaceSelfCheck.service.ITaskPlaceSelfCheckService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Override |
| | | public IPage<TaskVO> selectTaskPage(IPage<TaskVO> page, TaskVO task) { |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)) { |
| | | // 校验社区编号是否合规 |
| | | if (null != SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | task.setCommunityCode(communityCode); |
| | | } |
| | | } |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | // String roleName = SpringUtils.getRequestParam("roleName"); |
| | | // String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | // if (!Strings.isBlank(communityCode)) { |
| | | // // 校验社区编号是否合规 |
| | | // if (null != SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | // task.setCommunityCode(communityCode); |
| | | // } |
| | | // } |
| | | // List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | // Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | // 网格编号集合 |
| | | List<String> gridCodeList = new ArrayList<>(); |
| | | // List<String> gridCodeList = new ArrayList<>(); |
| | | // 民警角色 |
| | | if (!Strings.isBlank(roleName)) { |
| | | task.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()); |
| | | } |
| | | } |
| | | if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | task.setCommunityCode("361102003027"); |
| | | } |
| | | // if (!Strings.isBlank(roleName)) { |
| | | // task.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()); |
| | | // } |
| | | // } |
| | | // if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | // task.setCommunityCode("361102003027"); |
| | | // } |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskVO.class,task); |
| | | if (null != task.getReportType() && task.getReportType() == 1) { |
| | | // 查询取保候审任务列表(人房相关) |
| | | return page.setRecords(baseMapper.selectTaskPageByPerson(page, task, regionChildCodesList, isAdministrator, gridCodeList)); |
| | | return page.setRecords(baseMapper.selectTaskPageByPerson(page, task, commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(), commonParamSet.getGridCodeList())); |
| | | } |
| | | // 查询非取保候审任务列表(场所相关) |
| | | return page.setRecords(baseMapper.selectTaskPage(page, task, regionChildCodesList, isAdministrator, gridCodeList)); |
| | | return page.setRecords(baseMapper.selectTaskPage(page, task, commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(), commonParamSet.getGridCodeList())); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<TaskVO> getBailReportingPage(IPage<TaskVO> page, TaskVO task) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | // 民警角色 |
| | | if (AuthUtil.getUserRole().equals("mj")) { |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskVO.class, task); |
| | | task.setUserId(AuthUtil.getUserId()); |
| | | return page.setRecords(baseMapper.selectTaskPageBy(page, task, regionChildCodesList, isAdministrator)); |
| | | return page.setRecords(baseMapper.selectTaskPageBy(page, task, commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator())); |
| | | } else { |
| | | if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | task.setCommunityCode("361102003027"); |
| | |
| | | taskVO.setStatus(1); |
| | | taskVO.setUserId(roleType > 0 ? AuthUtil.getUserId() : null); |
| | | taskVO.setNeiCode(neiCode); |
| | | taskVO.setReportType(2); |
| | | taskVO.setReportType(5); |
| | | taskVO.setIsDeleted(0); |
| | | // 查询网格员对应的网格id |
| | | String gridCode = getGridCode(); |
| | | // 标签事件 |
| | | Integer bqsj = baseMapper.selectTaskCount(taskVO); |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskVO.class,taskVO); |
| | | |
| | | // 标签报事-二手交易 |
| | | Integer bqsj = baseMapper.selectTaskCount(taskVO,commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(),commonParamSet.getGridCodeList()); |
| | | taskVO.setReportType(1); |
| | | // 取保候审 |
| | | Integer qbhs = baseMapper.selectTaskCount(taskVO); |
| | | Integer qbhs = baseMapper.selectTaskCount(taskVO,commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(),commonParamSet.getGridCodeList()); |
| | | // 报事报修 |
| | | Integer bsbx = SpringUtils.getBean(ITaskReportForRepairsService.class).getStatistics(roleType > 0 ? AuthUtil.getUserId() : null, neiCode); |
| | | // 住房审核 |
| | | Integer zhsh = iHouseholdService.statistics(roleType > 0 ? AuthUtil.getUserId() : null, neiCode); |
| | | // 住户审核 |
| | | Integer zhsh = iHouseholdService.statistics(roleType > 0 ? AuthUtil.getUserId() : null, neiCode,0); |
| | | // 出租审核 |
| | | HouseRentalTenantVO houseRentalTenantVO = new HouseRentalTenantVO(); |
| | | houseRentalTenantVO.setUserId(roleType > 0 ? AuthUtil.getUserId() : null); |
| | | houseRentalTenantVO.setNeiCode(neiCode); |
| | | Integer czsh = iHouseRentalService.getStatisticsCount(houseRentalTenantVO); |
| | | // 场所审核 |
| | | Integer cssh = SpringUtils.getBean(IPlaceExtService.class).selectCount(roleType > 0 ? AuthUtil.getUserId() : null, neiCode, 1); |
| | | // 走访日志 |
| | | // 查询网格员对应的网格id |
| | | String gridCode = getGridCode(); |
| | | Integer zfrw = SpringUtils.getBean(IGridWorkLogService.class).getGridWorkCountHandleCount(gridCode, 1); |
| | | // 消防自查 |
| | | Integer xfzc = SpringUtils.getBean(ITaskPlaceSelfCheckService.class).getCount(neiCode, 1); |
| | | // 消防隐患整改 |
| | | Integer xfyhzg = SpringUtils.getBean(ITaskPlaceRectificationService.class).getCount(neiCode, 1); |
| | | // 设置 |
| | | objectObjectHashMap.put("qbhs", qbhs); |
| | | objectObjectHashMap.put("bqsj", bqsj); |
| | | objectObjectHashMap.put("bsbx", bsbx); |
| | | objectObjectHashMap.put("zhsh", zhsh); |
| | | objectObjectHashMap.put("czsh", czsh); |
| | | objectObjectHashMap.put("cssh", cssh); |
| | | objectObjectHashMap.put("zfrw", zfrw); |
| | | objectObjectHashMap.put("qbhs", qbhs);// 取保候审 |
| | | objectObjectHashMap.put("bqsj", bqsj);// 标签报事-二手交易 |
| | | objectObjectHashMap.put("bsbx", bsbx);// 报事报修 |
| | | objectObjectHashMap.put("zhsh", zhsh);// 住户审核 |
| | | objectObjectHashMap.put("czsh", czsh);// 出租审核 |
| | | objectObjectHashMap.put("cssh", cssh);// 场所审核 |
| | | objectObjectHashMap.put("zfrw", zfrw);// 走访日志 |
| | | objectObjectHashMap.put("xfzc", xfzc);// 消防自查 |
| | | objectObjectHashMap.put("xfyhzg", xfyhzg);// 消防隐患整改 |
| | | return objectObjectHashMap; |
| | | } |
| | | |
| | |
| | | taskVO.setUserId(AuthUtil.getUserId()); |
| | | taskVO.setFrequency(1); |
| | | taskVO.setStatus(1); |
| | | Integer disposable = baseMapper.selectTaskCount(taskVO); |
| | | Integer disposable = baseMapper.selectTaskCount(taskVO,null,null,null); |
| | | taskVO.setFrequency(2); |
| | | Integer periodicity = baseMapper.selectTaskCount(taskVO); |
| | | Integer periodicity = baseMapper.selectTaskCount(taskVO,null,null,null); |
| | | objectObjectHashMap.put("disposable", disposable); |
| | | objectObjectHashMap.put("periodicity", periodicity); |
| | | return objectObjectHashMap; |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date returnTime; |
| | | |
| | | |
| | | } |
| | |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("gridCodeList") List<String> gridCodeList, |
| | | @Param("nineTypeList") List<String> nineTypeList); |
| | | |
| | | Integer getCount(String neiCode, int i, Long userId); |
| | | } |
| | |
| | | order by jtpr.create_time desc |
| | | </select> |
| | | |
| | | <select id="getCount" resultType="java.lang.Integer"> |
| | | SELECT count(1) |
| | | FROM jczz_task_place_rectification jtpr |
| | | LEFT JOIN jczz_place jp ON jp.house_code = jtpr.house_code |
| | | WHERE jp.jw_grid_code IN |
| | | (SELECT jpag.jw_grid_code FROM jczz_police_affairs_grid jpag WHERE jpag.police_user_id like concat('%',${userId},'%')) |
| | | AND jtpr.`status` = 1 |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | List<TaskPlaceRectificationExcel> export(TaskPlaceRectificationsVO taskPlaceRectificationVO); |
| | | |
| | | void importPlaceRectifications(List<PlaceRectificationsExcel> data, Boolean isCovered); |
| | | |
| | | Integer getCount(String neiCode, int i); |
| | | } |
| | |
| | | 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.utils.AuthUtils; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | |
| | | // } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public Integer getCount(String neiCode, int i) { |
| | | // 获取请求头中的角色别名 |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | if (AuthUtils.isMj(roleName)) { |
| | | return baseMapper.getCount(neiCode, i, AuthUtil.getUserId()); |
| | | } |
| | | return 0; |
| | | } |
| | | } |
| | |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | | |
| | | Integer getCount(String neiCode, int i,Long userId); |
| | | } |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getCount" resultType="java.lang.Integer"> |
| | | SELECT count(1) |
| | | FROM jczz_task_place_self_check jtpsc |
| | | LEFT JOIN jczz_place jp ON jp.house_code = jtpsc.house_code |
| | | WHERE jp.jw_grid_code IN |
| | | (SELECT jpag.jw_grid_code FROM jczz_police_affairs_grid jpag WHERE jpag.police_user_id like concat('%',${userId},'%') ) |
| | | AND jtpsc.`status` = 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List<TaskPlaceSelfCheckExcel> exportTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck); |
| | | |
| | | Integer getCount(String neiCode, int i); |
| | | } |
| | |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.common.constant.DictConstant; |
| | | 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; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | |
| | | @Override |
| | | public IPage<TaskPlaceSelfCheckVO> selectTaskPlaceSelfCheckPage(IPage<TaskPlaceSelfCheckVO> page, TaskPlaceSelfCheckVO taskPlaceSelfCheck) { |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=taskPlaceSelfCheck.getNineType()){ |
| | | if (null != taskPlaceSelfCheck.getNineType()) { |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",taskPlaceSelfCheck.getNineType()).eq("code","nineType"); |
| | | queryWrapper.eq("is_deleted", 0).eq("dict_key", taskPlaceSelfCheck.getNineType()).eq("code", "nineType"); |
| | | // 先查询当前 |
| | | DictBiz one = dictBizService.getOne(queryWrapper); |
| | | // 查询本身和子集的key |
| | | List<DictBiz> list = dictBizService.getList("nineType", one.getId()); |
| | | if (list.size()==0){ |
| | | if (list.size() == 0) { |
| | | strings.add(taskPlaceSelfCheck.getNineType().toString()); |
| | | }else { |
| | | } else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskPlaceSelfCheckVO.class,taskPlaceSelfCheck); |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskPlaceSelfCheckVO.class, taskPlaceSelfCheck); |
| | | List<TaskPlaceSelfCheckVO> placeCheckVOS = baseMapper.selectTaskPlaceSelfCheckPage(page, |
| | | taskPlaceSelfCheck, |
| | | commonParamSet.getIsAdministrator(), |
| | |
| | | item.setCreateUser(AuthUtil.getUserId()); |
| | | }); |
| | | List<TaskPlaceRecordEntity> collect = taskPlaceRecordList.stream().filter(item -> item.getState().equals(0)).collect(Collectors.toList()); |
| | | boolean b = bean.saveBatch(collect); |
| | | updateById(taskPlaceSelfCheck); |
| | | if (b) { |
| | | return b; |
| | | if (collect.size() > 0) { |
| | | bean.saveBatch(collect); |
| | | } |
| | | throw new Exception("保存失败!"); |
| | | updateById(taskPlaceSelfCheck); |
| | | return save; |
| | | } |
| | | return false; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 导出消防自查信息 |
| | | * |
| | | * @param taskPlaceSelfCheck |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TaskPlaceSelfCheckExcel> exportTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck) { |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=taskPlaceSelfCheck.getNineType()){ |
| | | if (null != taskPlaceSelfCheck.getNineType()) { |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",taskPlaceSelfCheck.getNineType()).eq("code","nineType"); |
| | | queryWrapper.eq("is_deleted", 0).eq("dict_key", taskPlaceSelfCheck.getNineType()).eq("code", "nineType"); |
| | | // 先查询当前 |
| | | DictBiz one = dictBizService.getOne(queryWrapper); |
| | | // 查询本身和子集的key |
| | | List<DictBiz> list = dictBizService.getList("nineType", one.getId()); |
| | | if (list.size()==0){ |
| | | if (list.size() == 0) { |
| | | strings.add(taskPlaceSelfCheck.getNineType().toString()); |
| | | }else { |
| | | } else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskPlaceSelfCheckVO.class,taskPlaceSelfCheck); |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskPlaceSelfCheckVO.class, taskPlaceSelfCheck); |
| | | List<TaskPlaceSelfCheckExcel> taskPlaceSelfCheckExcels = baseMapper.exportTaskPlaceSelfCheck( |
| | | strings, |
| | | taskPlaceSelfCheck, |
| | |
| | | } |
| | | return taskPlaceSelfCheckExcels; |
| | | } |
| | | |
| | | @Override |
| | | public Integer getCount(String neiCode, int i) { |
| | | // 获取请求头中的角色别名 |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | if (AuthUtils.isMj(roleName)) { |
| | | return baseMapper.getCount(neiCode, i, AuthUtil.getUserId()); |
| | | } |
| | | return 0; |
| | | } |
| | | } |