linwei
2024-02-02 77b8b6463ace59df830140c018489f65dd7e6d54
导出
4 files modified
308 ■■■■ changed files
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml 101 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java 199 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskPlaceRectification/controller/TaskPlaceRectificationController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.java
@@ -19,6 +19,7 @@
import org.apache.ibatis.annotations.Param;
import org.springblade.common.node.TreeStringNode;
import org.springblade.modules.place.entity.PlaceEntity;
import org.springblade.modules.place.excel.NinePlaceExcel;
import org.springblade.modules.place.excel.PlaceAndRelExcel;
import org.springblade.modules.place.vo.PlaceVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -139,4 +140,9 @@
     */
    List<PlaceVO> getPlaceListByParam(@Param("list") List<String> stringList,
                                      @Param("tableName") String tableName);
    List<NinePlaceExcel> export( @Param("place") PlaceVO place,
                                 @Param("houseCodeList") List<String> houseCodeList,
                                 @Param("regionChildCodesList") List<String> regionChildCodesList,
                                 @Param("isAdministrator") Integer isAdministrator);
}
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
@@ -401,6 +401,107 @@
        )
    </select>
    <select id="export" resultType="org.springblade.modules.place.excel.NinePlaceExcel">
        select
        jp.*,
        jpe.id as placeExtId,
        bu.real_name as username,bu.phone as phone,
        br.town_name as townStreetName,br.name as neiName,
        jpe.confirm_flag confirmFlag,
        jg.grid_name as gridName,
        bus.`name` AS policeName,
        bu.phone AS policePhone,
        jda.address_name,
        bd.dept_name
        from jczz_place jp
        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 blade_region br on br.code = jg.community_code
        LEFT JOIN jczz_community jc on jc.`code`=jg.community_code
        LEFT JOIN blade_user bus on bus.id = jc.res_police_user_id
        LEFT JOIN blade_dept bd on bd.id = bus.dept_id
        LEFT JOIN jczz_doorplate_address jda on jda.address_code=jp.house_code
        left join (
        select a.* from jczz_place_poi_label a inner join
        (
        select place_id,max(id) as id from jczz_place_poi_label b group by place_id
        ) b on a.id = b.id
        ) jppl on jppl.place_id = jp.id
        where jp.is_deleted = 0 and jp.source!=3
        and jp.place_name != ''
        <if test="place.placeName!=null and place.placeName!=''">
            and jp.place_name like concat('%',#{place.placeName},'%')
        </if>
        <if test="place.principal!=null and place.principal!=''">
            and jp.principal like concat('%',#{place.principal},'%')
        </if>
        <if test="place.principalPhone!=null and place.principalPhone!=''">
            and jp.principal_phone like concat('%',#{place.principalPhone},'%')
        </if>
        <if test="place.houseCode!=null and place.houseCode!=''">
            and jp.house_code like concat('%',#{place.houseCode},'%')
        </if>
        <if test="place.townStreetName!=null and place.townStreetName!=''">
            and br.town_name like concat('%',#{place.townStreetName},'%')
        </if>
        <if test="place.deptName!=null and place.deptName!=''">
            and bd.dept_name like concat('%',#{place.deptName},'%')
        </if>
        <if test="place.policeName!=null and place.policeName!=''">
            and bus.name like concat('%',#{place.policeName},'%')
        </if>
        <if test="place.nineType!=null and place.nineType!=''">
            and jp.nine_type = #{place.nineType}
        </if>
        <if test="place.neiName!=null and place.neiName!=''">
            and br.name like concat('%',#{place.neiName},'%')
        </if>
        <if test="place.id!=null">
            and jp.id = #{place.id}
        </if>
        <if test="place.isNine!=null">
            and jp.is_nine = #{place.isNine}
        </if>
        <if test="place.source!=null">
            and jp.source = #{place.source}
        </if>
        <if test="place.isPerfect==1">
            and jp.status = 1
        </if>
        <if test="place.isPerfect==2">
            and jp.status = 2
        </if>
        <if test="houseCodeList != null and houseCodeList.size()>0">
            and jp.house_code in
            <foreach collection="houseCodeList" item="houseCode" separator ="," open="("  close=")">
                #{houseCode}
            </foreach>
        </if>
        <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>
                </when>
                <otherwise>
                    and jg.grid_code in ('')
                </otherwise>
            </choose>
        </if>
        order by jp.create_time desc,jp.id desc
    </select>
    <resultMap type="org.springblade.modules.place.dto.PlaceDTO" id="PlaceDTOResult">
        <result property="id"    column="id"    />
        <result property="houseCode"    column="house_code"    />
src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java
@@ -100,6 +100,7 @@
    /**
     * 自定义列表查询
     *
     * @param page
     * @param place
     * @return
@@ -107,21 +108,22 @@
    @Override
    public IPage<PlaceVO> selectPlacePage(IPage<PlaceVO> page, PlaceVO place) {
        List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId());
        Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2;
        Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2;
        List<String> list = new ArrayList<>();
        if (null!=place.getRoleName() && !place.getRoleName().equals("")){
            if (place.getRoleName().equals("网格员")){
        if (null != place.getRoleName() && !place.getRoleName().equals("")) {
            if (place.getRoleName().equals("网格员")) {
                // 查询对应的房屋地址code
                list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId());
            }
        }
        List<PlaceVO> placeVOS = baseMapper.selectPlacePage(page, place,list,regionChildCodesList,isAdministrator);
        List<PlaceVO> placeVOS = baseMapper.selectPlacePage(page, place, list, regionChildCodesList, isAdministrator);
        // 返回
        return page.setRecords(placeVOS);
    }
    /**
     * 查询场所集合信息
     *
     * @param userId
     * @return
     */
@@ -132,6 +134,7 @@
    /**
     * 场所信息自定义新增/修改
     *
     * @param placeVO
     * @return
     */
@@ -142,14 +145,14 @@
        placeVO.setUpdateUser(AuthUtil.getUserId());
        placeVO.setUpdateTime(new Date());
        // 查看是否包含houseCode,如果有,则更新
        if (!Strings.isBlank(placeVO.getHouseCode())){
        if (!Strings.isBlank(placeVO.getHouseCode())) {
            // 更新,先查询场所信息
            QueryWrapper<PlaceEntity> wrapper = new QueryWrapper<>();
            wrapper.eq("is_deleted",0).eq("house_code",placeVO.getHouseCode());
            wrapper.eq("is_deleted", 0).eq("house_code", placeVO.getHouseCode());
            PlaceEntity one = getOne(wrapper);
            if (null!=one) {
            if (null != one) {
                placeVO.setId(one.getId());
            }else {
            } else {
                // 新增,地址表中没有或者地址表中有场所表中没有的(是房屋的),扫码进来的
                save(placeVO);
            }
@@ -159,7 +162,7 @@
            setPlaceStatus(placeVO);
            // 更新场所信息
            flag = updateById(placeVO);
        }else {
        } else {
            // 设置基础数据
            placeVO.setCreateUser(AuthUtil.getUserId());
            placeVO.setCreateTime(new Date());
@@ -190,39 +193,41 @@
    /**
     * 房屋绑定
     *
     * @param placeVO
     */
    public void houseCodeBind(PlaceVO placeVO) {
        String houseCode = placeVO.getHouseCode();
        List<String> list = Arrays.asList(houseCode.split(","));
        if (list.size()>1){
        if (list.size() > 1) {
            // 处理对应的绑定房屋数据
            List<Long> longs = new ArrayList<>();
            // 把其他单个的场所数据删除
            for (String code : list) {
                // 先查询对应的场所id
                QueryWrapper<PlaceEntity> wrapper = new QueryWrapper<>();
                wrapper.eq("house_code",code).eq("is_deleted",0);
                wrapper.eq("house_code", code).eq("is_deleted", 0);
                PlaceEntity one = getOne(wrapper);
                if (null!=one){
                if (null != one) {
                    longs.add(one.getId());
                    // 删除对应的单个编号的场所
                    removeById(one.getId());
                }
            }
            if (longs.size()>0) {
            if (longs.size() > 0) {
                // 删除对应的详情
                removePlaceExt(longs);
                // 删除对应的标签绑定信息
                removePlaceLabel(longs);
            }
        }else {
        } else {
            // 一对一,暂时不处理,后续考虑需加绑定关系表
        }
    }
    /**
     * 设置场所完善状态
     *
     * @param placeVO
     */
    private void setPlaceStatus(PlaceVO placeVO) {
@@ -231,10 +236,10 @@
            && !Strings.isBlank(placeVO.getLocation())
            && !Strings.isBlank(placeVO.getPlaceName())
            && !Strings.isBlank(placeVO.getImageUrls())
        ){
        ) {
            // 已完善
            placeVO.setStatus(2);
        }else {
        } else {
            // 未完善
            placeVO.setStatus(1);
        }
@@ -242,28 +247,29 @@
    /**
     * 网格绑定
     *
     * @param placeVO
     */
    public void gridBind(PlaceVO placeVO) {
        if (null!=placeVO.getGridId()){
        if (null != placeVO.getGridId()) {
            // 判断关联关系表是否存在
            QueryWrapper<GridRangeEntity> wrapper = new QueryWrapper<>();
            wrapper.eq("house_code",placeVO.getHouseCode());
            wrapper.eq("house_code", placeVO.getHouseCode());
            GridRangeEntity one = gridRangeService.getOne(wrapper);
            if (null==one){
            if (null == one) {
                // 新增
                GridRangeEntity gridRangeEntity = new GridRangeEntity();
                gridRangeEntity.setHouseCode(placeVO.getHouseCode());
                gridRangeEntity.setGridId(placeVO.getGridId());
                // 插入
                gridRangeService.save(gridRangeEntity);
            }else {
            } else {
                // 修改绑定
                one.setGridId(placeVO.getGridId());
                // 修改
                gridRangeService.updateById(one);
            }
        }else {
        } else {
            // 判断角色,如果是网格员则直接使用网格员的网格id,如果是民警则采用点落面的方式进行获取网格的id
            if (!Strings.isBlank(placeVO.getRoleName())) {
                // 网格员角色位置绑定
@@ -276,11 +282,12 @@
    /**
     * 网格编号绑定
     *
     * @param placeVO
     */
    public void gridCodeBind(PlaceVO placeVO) {
        // 无网格编号时
        if (Strings.isBlank(placeVO.getGridCode())){
        if (Strings.isBlank(placeVO.getGridCode())) {
            // 判断角色,如果是网格员则直接使用网格员的网格id,如果是民警则采用点落面的方式进行获取网格的id
            if (!Strings.isBlank(placeVO.getRoleName())) {
                // 网格员场所网格编号绑定-新
@@ -293,6 +300,7 @@
    /**
     * 网格员角色位置绑定-grid_id
     *
     * @param placeVO
     */
    public void gridmanPositionHandle(PlaceVO placeVO) {
@@ -311,7 +319,7 @@
                    gridRangeEntity.setGridId(gridId);
                    // 插入
                    gridRangeService.save(gridRangeEntity);
                }else {
                } else {
                    // 修改绑定
                    one.setGridId(gridId);
                    // 修改
@@ -323,6 +331,7 @@
    /**
     * 网格员角色位置绑定-grid_code
     *
     * @param placeVO
     */
    public void gridmanGridCodePositionHandle(PlaceVO placeVO) {
@@ -340,16 +349,17 @@
    /**
     * 民警角色位置绑定
     *
     * @param placeVO
     */
    private void policePositionHandle(PlaceVO placeVO) {
        // 是民警且位置信息存在
        if (placeVO.getRoleName().equals("民警") && !Strings.isBlank(placeVO.getLng())) {
            //点坐标解析
            String point = "'POINT(" + placeVO.getLng() + " " + placeVO.getLat() +")'";
            String point = "'POINT(" + placeVO.getLng() + " " + placeVO.getLat() + ")'";
//            String point = "'POINT(" + villageInfoExcel.getLatitude() + " " + villageInfoExcel.getLongitude() +")'";
            List<GridEntity> gridEntityList = gridMapper.spatialAnalysis(point);
            if (gridEntityList.size()>0) {
            if (gridEntityList.size() > 0) {
                GridEntity gridEntity = gridEntityList.get(0);
                // 判断关联关系表是否存在
                QueryWrapper<GridRangeEntity> wrapper = new QueryWrapper<>();
@@ -362,7 +372,7 @@
                    gridRangeEntity.setGridId(gridEntity.getId());
                    // 插入
                    gridRangeService.save(gridRangeEntity);
                }else {
                } else {
                    // 修改绑定
                    one.setGridId(gridEntity.getId());
                    // 修改
@@ -374,16 +384,17 @@
    /**
     * 民警角色时通过位置绑定网格
     *
     * @param placeVO
     */
    private void policeGridCodePositionHandle(PlaceVO placeVO) {
        // 是民警且位置信息存在
        if (placeVO.getRoleName().equals("民警") && !Strings.isBlank(placeVO.getLng())) {
            //点坐标解析
            String point = "'POINT(" + placeVO.getLng() + " " + placeVO.getLat() +")'";
            String point = "'POINT(" + placeVO.getLng() + " " + placeVO.getLat() + ")'";
//            String point = "'POINT(" + villageInfoExcel.getLatitude() + " " + villageInfoExcel.getLongitude() +")'";
            List<GridEntity> gridEntityList = gridMapper.spatialAnalysis(point);
            if (gridEntityList.size()>0) {
            if (gridEntityList.size() > 0) {
                GridEntity gridEntity = gridEntityList.get(0);
                if (null != gridEntity && !Strings.isBlank(gridEntity.getGridCode())) {
                    // 场所编号绑定
@@ -397,6 +408,7 @@
    /**
     * 场所标签信息绑定入库
     *
     * @param placeVO
     */
    @Transactional(rollbackFor = Exception.class)
@@ -404,24 +416,25 @@
        // 先查询对于的场所是否已有标签信息
        // 查询对应已存在的从业人员
        QueryWrapper<PlacePoiLabel> wrapper = new QueryWrapper<>();
        wrapper.eq("place_id",placeVO.getId());
        wrapper.eq("place_id", placeVO.getId());
        List<PlacePoiLabel> oldList = placePoiLabelService.list(wrapper);
        if (oldList.size()>0){
        if (oldList.size() > 0) {
            // 先将老的全部删除,然后批量插入
            QueryWrapper<PlacePoiLabel> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("place_id",placeVO.getId());
            queryWrapper.eq("place_id", placeVO.getId());
            boolean remove = placePoiLabelService.remove(queryWrapper);
            if (remove){
            if (remove) {
                // 批量新增
                savePlaceLabel(placeVO);
            }
        }else {
        } else {
            savePlaceLabel(placeVO);
        }
    }
    /**
     * 插入场所标签信息
     *
     * @param placeVO
     */
    public void savePlaceLabel(PlaceVO placeVO) {
@@ -508,12 +521,13 @@
    /**
     * 场所负责人和用户绑定
     *
     * @param placeVO
     */
    @Transactional(rollbackFor = Exception.class)
    public User bindUserHandle(PlaceVO placeVO) {
        User newUser = new User();
        if (null!=placeVO.getPrincipalPhone() && !placeVO.getPrincipalPhone().equals("")) {
        if (null != placeVO.getPrincipalPhone() && !placeVO.getPrincipalPhone().equals("")) {
            placeVO.setPrincipal(placeVO.getPrincipal());
            placeVO.setPrincipalPhone(placeVO.getPrincipalPhone());
            //根据手机号查询库里的数据
@@ -521,19 +535,19 @@
            userParams.setPhone(placeVO.getPrincipalPhone());
            userParams.setIsDeleted(0);
            User user = userService.getOne(Condition.getQueryWrapper(userParams));
            if (null==user){
            if (null == user) {
                User userParams1 = new User();
                userParams1.setAccount(placeVO.getPrincipalPhone());
                userParams1.setIsDeleted(0);
                user = userService.getOne(Condition.getQueryWrapper(userParams1));
            }
            if (null!=user) {
            if (null != user) {
                //如果用户存在,则该用户id绑定场所
                placeVO.setPrincipalUserId(user.getId());
                newUser = user;
                // 判断用户是否包含了居民角色,不包含则需更新
                if (!user.getRoleId().contains("1717429059648606209")){
                if (!user.getRoleId().contains("1717429059648606209")) {
                    user.setRoleId(user.getRoleId() + ",1717429059648606209");
                    //更新
                    userService.updateById(user);
@@ -556,7 +570,7 @@
                //绑定id
                placeVO.setPrincipalUserId(newUser.getId());
                //给人员打上场所负责人的标签
                baseMapper.saveUserLabel(newUser.getId(),1002);
                baseMapper.saveUserLabel(newUser.getId(), 1002);
            }
        }
        return newUser;
@@ -564,6 +578,7 @@
    /**
     * 保存场所详情及任务信息
     *
     * @param placeVO
     */
    @Transactional(rollbackFor = Exception.class)
@@ -572,8 +587,8 @@
        placeExtEntity.setPlaceId(placeVO.getId());
        // 判断是否已存在,已存在则不新增
        QueryWrapper<PlaceExtEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("is_deleted",0)
            .eq("place_id",placeVO.getId());
        wrapper.eq("is_deleted", 0)
            .eq("place_id", placeVO.getId());
        PlaceExtEntity one = placeExtService.getOne(wrapper);
        if (null == one) {
            placeExtEntity.setPlaceId(placeVO.getId());
@@ -590,6 +605,7 @@
    /**
     * 历史场所挂接处理-临时
     *
     * @param place
     * @return
     */
@@ -600,7 +616,7 @@
        // 遍历
        for (PlaceVO placeVO : list) {
            User user = bindUserHandle(placeVO);
            if (null!=user){
            if (null != user) {
                placeVO.setPrincipalUserId(user.getId());
                //更新场所用户id绑定
                baseMapper.updatePlaceEntity(placeVO);
@@ -611,6 +627,7 @@
    /**
     * 历史场所标签挂接处理-临时
     *
     * @param place
     * @return
     */
@@ -621,7 +638,7 @@
        List<PlaceVO> list = baseMapper.getAllHistoryPlace();
        // 遍历
        for (PlaceVO placeVO : list) {
            if (null!=placeVO.getLabel()){
            if (null != placeVO.getLabel()) {
                String[] split = placeVO.getLabel().split(",");
                for (String s : split) {
                    PlacePoiLabel placePoiLabel = new PlacePoiLabel();
@@ -636,6 +653,7 @@
    /**
     * 场所表 自定义详情查询
     *
     * @param place
     * @return
     */
@@ -674,7 +692,7 @@
                queryWrapper.eq("is_deleted", 0).eq("place_id", placeVO.getId());
                placeVO.setPlaceExtEntity(placeExtService.getOne(queryWrapper));
            }
        }else {
        } else {
            // 查询地址编码信息(社区派出所相关信息)
            if (!Strings.isBlank(place.getHouseCode())) {
                QueryWrapper<DoorplateAddressEntity> queryWrapper = new QueryWrapper<>();
@@ -692,6 +710,7 @@
    /**
     * 场所数据到导入
     *
     * @param data
     * @param isCovered
     */
@@ -700,10 +719,10 @@
        for (PlaceExcel placeExcel : data) {
            // 判断是否存在,不存在则插入,否则不操作
            QueryWrapper<PlaceEntity> wrapper = new QueryWrapper<>();
            wrapper.eq("is_deleted",0)
                .eq("house_code",placeExcel.getHouseCode());
            wrapper.eq("is_deleted", 0)
                .eq("house_code", placeExcel.getHouseCode());
            PlaceEntity one = getOne(wrapper);
            if (null == one){
            if (null == one) {
                Long userId = updateUser(placeExcel);
                // 插入场所
                PlaceEntity placeEntity = new PlaceEntity();
@@ -723,6 +742,7 @@
    /**
     * 更新用户信息
     *
     * @param placeExcel
     * @return
     */
@@ -742,6 +762,7 @@
    /**
     * 更新用户信息
     *
     * @param placeExcel
     * @return
     */
@@ -761,6 +782,7 @@
    /**
     * 场所(商超)导入
     *
     * @param data
     * @param isCovered
     */
@@ -770,7 +792,7 @@
        for (PlaceAndRelExcel placeExcel : data) {
            // 判断是否存在,不存在则插入,否则不操作
            PlaceEntity one = baseMapper.getPlaceAndRelInfo(placeExcel);
            if (null == one){
            if (null == one) {
                Long userId = updateUser(placeExcel);
                // 插入场所
                PlaceEntity placeEntity = new PlaceEntity();
@@ -791,7 +813,7 @@
                //一个一个插入,防止同一个表中有相同的数据
                save(placeEntity);
                // 插入标签关系表
                savPlaceLabelBind(placeExcel,placeEntity);
                savPlaceLabelBind(placeExcel, placeEntity);
                // 插入关联数据表
                PlaceRelEntity placeRelEntity = new PlaceRelEntity();
                placeRelEntity.setPlaceId(placeEntity.getId());
@@ -807,7 +829,7 @@
                placeRelEntity.setUpdateUser(AuthUtil.getUserId());
                // 新增
                placeRelService.save(placeRelEntity);
            }else {
            } else {
                // 只更新商铺信息
                Long userId = updateUser(placeExcel);
                // 插入场所
@@ -828,10 +850,11 @@
    /**
     * 插入标签关系表
     *
     * @param placeExcel
     */
    public void savPlaceLabelBind(PlaceAndRelExcel placeExcel,PlaceEntity placeEntity) {
        if (!Strings.isBlank(placeExcel.getLabelCode())){
    public void savPlaceLabelBind(PlaceAndRelExcel placeExcel, PlaceEntity placeEntity) {
        if (!Strings.isBlank(placeExcel.getLabelCode())) {
            PlaceVO placeVO = new PlaceVO();
            placeVO.setId(placeEntity.getId());
            placeVO.setLabel(placeExcel.getLabelCode());
@@ -852,7 +875,7 @@
        for (PlaceEntity placeEntity : list) {
            // 查询对应的用户信息
            User user = userService.getById(placeEntity.getPrincipalUserId());
            if (null!=user) {
            if (null != user) {
                // 设置场所负责人,手机号
                if (null != user.getRealName() && !user.getRealName().equals("")) {
                    placeEntity.setPrincipal(user.getRealName());
@@ -869,6 +892,7 @@
    /**
     * 自定义修改
     *
     * @param placeVO
     * @return
     */
@@ -896,8 +920,8 @@
            // 处理单个
            String labelCode = placePoiLabel.getPoiCode().toString();
            // 切割成三个,分别是大类,中类,小类
            String bigString = labelCode.substring(0,2);
            String midString = labelCode.substring(0,4);
            String bigString = labelCode.substring(0, 2);
            String midString = labelCode.substring(0, 4);
            // 大类
            PlacePoiLabel big = new PlacePoiLabel();
            big.setPlaceId(placePoiLabel.getPlaceId());
@@ -905,9 +929,9 @@
            big.setType(1);
            // 保存前先判断
            QueryWrapper<PlacePoiLabel> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("place_id",placePoiLabel.getPlaceId()).eq("poi_code",Integer.parseInt(bigString));
            queryWrapper.eq("place_id", placePoiLabel.getPlaceId()).eq("poi_code", Integer.parseInt(bigString));
            PlacePoiLabel one = placePoiLabelService.getOne(queryWrapper);
            if (null==one) {
            if (null == one) {
                placePoiLabelService.save(big);
            }
            // 中类
@@ -917,9 +941,9 @@
            mid.setType(2);
            // 保存前先判断
            QueryWrapper<PlacePoiLabel> wrapper = new QueryWrapper<>();
            wrapper.eq("place_id",placePoiLabel.getPlaceId()).eq("poi_code",Integer.parseInt(midString));
            wrapper.eq("place_id", placePoiLabel.getPlaceId()).eq("poi_code", Integer.parseInt(midString));
            PlacePoiLabel two = placePoiLabelService.getOne(wrapper);
            if (null==two) {
            if (null == two) {
                placePoiLabelService.save(mid);
            }
        }
@@ -928,6 +952,7 @@
    /**
     * 历史场所详情数据处理
     *
     * @param place
     * @return
     */
@@ -938,15 +963,15 @@
        // 遍历更新
        for (PlaceEntity placeEntity : list) {
            QueryWrapper<PlaceExtEntity> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("place_id",placeEntity.getId()).eq("is_deleted",0);
            queryWrapper.eq("place_id", placeEntity.getId()).eq("is_deleted", 0);
            PlaceExtEntity one = placeExtService.getOne(queryWrapper);
            if (null==one){
            if (null == one) {
                // 新增
                PlaceExtEntity placeExtEntity = new PlaceExtEntity();
                if (null!=placeEntity.getPrincipalUserId()){
                if (null != placeEntity.getPrincipalUserId()) {
                    // 待审核
                    placeExtEntity.setConfirmFlag(1);
                }else {
                } else {
                    // 待完善
                    placeExtEntity.setConfirmFlag(4);
                }
@@ -960,6 +985,7 @@
    /**
     * 商超数据处理
     *
     * @return
     */
    @Override
@@ -968,7 +994,7 @@
        List<PlaceEntity> placeEntityList = baseMapper.placeAndRelHandle();
        // 处理
        for (PlaceEntity placeEntity : placeEntityList) {
            if (Strings.isBlank(placeEntity.getHouseCode())){
            if (Strings.isBlank(placeEntity.getHouseCode())) {
                // 并生成36位的houseCode
                placeEntity.setHouseCode(IdUtils.getIdBy36());
                // 商超数据
@@ -982,17 +1008,19 @@
    /**
     * 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所)
     *
     * @param stringList
     * @param tableName
     * @return
     */
    @Override
    public List<PlaceVO> getPlaceListByParam(List<String> stringList,String tableName) {
        return baseMapper.getPlaceListByParam(stringList,tableName);
    public List<PlaceVO> getPlaceListByParam(List<String> stringList, String tableName) {
        return baseMapper.getPlaceListByParam(stringList, tableName);
    }
    /**
     * 删除
     *
     * @param longs
     * @return
     */
@@ -1013,28 +1041,29 @@
    /**
     * 删除场所负责人对应的用户
     *
     * @param longs
     */
    public void removeUser(List<Long> longs) {
        // 遍历
        for (Long id : longs) {
            PlaceEntity placeEntity = getById(id);
            if (null!=placeEntity.getPrincipalUserId()){
            if (null != placeEntity.getPrincipalUserId()) {
                User user = userService.getById(placeEntity.getPrincipalUserId());
                // 查询场所判断是否还绑定有其他的场所
                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 = list(queryWrapper);
                // 如果没有(1个 当前的还没有删除)
                if (placeEntityList.size()==1){
                if (placeEntityList.size() == 1) {
                    // 判断角色
                    if (!Strings.isBlank(user.getRoleId())){
                    if (!Strings.isBlank(user.getRoleId())) {
                        // 判断是否还绑定其他的房屋,如果有,则不操作用户
                        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 = householdService.list(wrapper);
                        // 即没有房屋和场所了就删除对应的居民角色
                        if (householdEntityList.size()==0) {
                        if (householdEntityList.size() == 0) {
                            List<String> stringList = Arrays.asList(user.getRoleId().split(","));
                            // 查看当前用户的角色是否只有一个
                            if (stringList.size() > 1) {
@@ -1061,30 +1090,33 @@
    /**
     * 删除场所对应的详情
     *
     * @param longs
     */
    public void removePlaceExt(List<Long> longs) {
        for (Long id : longs) {
            QueryWrapper<PlaceExtEntity> wrapper = new QueryWrapper<>();
            wrapper.eq("place_id",id);
            wrapper.eq("place_id", id);
            placeExtService.remove(wrapper);
        }
    }
    /**
     * 删除对应的标签绑定信息
     *
     * @param longs
     */
    public void removePlaceLabel(List<Long> longs) {
        for (Long id : longs) {
            QueryWrapper<PlacePoiLabel> wrapper = new QueryWrapper<>();
            wrapper.eq("place_id",id);
            wrapper.eq("place_id", id);
            placePoiLabelService.remove(wrapper);
        }
    }
    /**
     * 九小场所档案
     *
     * @param page
     * @param place
     * @return
@@ -1092,21 +1124,32 @@
    @Override
    public IPage<PlaceVO> selectNinePlacePage(IPage<PlaceVO> page, PlaceVO place) {
        List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId());
        Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2;
        Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2;
        List<String> list = new ArrayList<>();
        if (null!=place.getRoleName() && !place.getRoleName().equals("")){
            if (place.getRoleName().equals("网格员")){
        if (null != place.getRoleName() && !place.getRoleName().equals("")) {
            if (place.getRoleName().equals("网格员")) {
                // 查询对应的房屋地址code
                list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId());
            }
        }
        List<PlaceVO> placeVOS = baseMapper.selectNinePlacePage(page, place,list,regionChildCodesList,isAdministrator);
        List<PlaceVO> placeVOS = baseMapper.selectNinePlacePage(page, place, list, regionChildCodesList, isAdministrator);
        // 返回
        return page.setRecords(placeVOS);
    }
    @Override
    public List<NinePlaceExcel> export(PlaceVO place) {
        return null;
        place.setIsNine(1);
        List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId());
        Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2;
        List<String> list = new ArrayList<>();
        if (null != place.getRoleName() && !place.getRoleName().equals("")) {
            if (place.getRoleName().equals("网格员")) {
                // 查询对应的房屋地址code
                list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId());
            }
        }
        List<NinePlaceExcel> aa = baseMapper.export(place, list, regionChildCodesList, isAdministrator);
        return aa;
    }
}
src/main/java/org/springblade/modules/taskPlaceRectification/controller/TaskPlaceRectificationController.java
@@ -182,7 +182,7 @@
    /**
     * 民警审核
     */
    @GetMapping("/rectificationStatistics")
    @PostMapping("/rectificationStatistics")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "九小场所类型隐患数量统计", notes = "传入taskPlaceRectification")
    public R rectificationStatistics(@Valid @RequestBody TaskPlaceRectificationVO taskPlaceRectification) {