zhongrj
2024-01-20 625d68d8fa25b0077bd8ff9608f03f2b17e6208d
房屋新增网格编号及查询调整
8 files modified
69 ■■■■ changed files
src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.xml 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/service/IGridWorkLogService.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/service/impl/GridWorkLogServiceImpl.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/entity/HouseEntity.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseMapper.xml 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml 20 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java 19 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.java
@@ -45,9 +45,9 @@
    /**
     * 走访日志数量统计
     * @param gridId 网格id
     * @param gridCode 网格编号
     * @param status 状态
     * @return
     */
    Integer getGridWorkCountHandleCount(@Param("gridId") Integer gridId,@Param("status")  Integer status);
    Integer getGridWorkCountHandleCount(@Param("gridCode") String gridCode,@Param("status")  Integer status);
}
src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.xml
@@ -68,13 +68,13 @@
    <select id="getGridWorkCountHandleCount" resultType="java.lang.Integer">
        select count(*) from jczz_grid_work_log jgwl
        left join jczz_household jh on jgwl.household_id = jh.id and jh.is_deleted = 0
        left join jczz_grid_range jgr on jgr.house_code=jh.house_code
        left join jczz_house jhs on jhs.house_code=jh.house_code
        where jgwl.is_deleted = 0
        <if test="status!=null">
            and jgwl.status = #{status}
        </if>
        <if test="gridId!=null">
            and jgr.grid_id = #{gridId}
        <if test="gridCode!=null and gridCode!=''">
            and jhs.grid_code = #{gridCode}
        </if>
    </select>
src/main/java/org/springblade/modules/grid/service/IGridWorkLogService.java
@@ -42,9 +42,9 @@
    /**
     * 走访日志数量统计
     * @param gridId 网格id
     * @param gridCode 网格编号
     * @param status 状态
     * @return
     */
    Integer getGridWorkCountHandleCount(Integer gridId, Integer status);
    Integer getGridWorkCountHandleCount(String gridCode, Integer status);
}
src/main/java/org/springblade/modules/grid/service/impl/GridWorkLogServiceImpl.java
@@ -71,12 +71,12 @@
    /**
     * 走访日志数量统计
     * @param gridId 网格id
     * @param gridCode 网格编号
     * @param status 状态
     * @return
     */
    @Override
    public Integer getGridWorkCountHandleCount(Integer gridId, Integer status) {
        return baseMapper.getGridWorkCountHandleCount(gridId,status);
    public Integer getGridWorkCountHandleCount(String gridCode, Integer status) {
        return baseMapper.getGridWorkCountHandleCount(gridCode,status);
    }
}
src/main/java/org/springblade/modules/house/entity/HouseEntity.java
@@ -130,6 +130,11 @@
     */
    @ApiModelProperty(value = "网格id")
    private Integer gridId;
    /**
     * 网格编号
     */
    @ApiModelProperty(value = "网格编号")
    private String gridCode;
    /**
     * 来源 1:地址总表  2:国控采集
src/main/java/org/springblade/modules/house/mapper/HouseMapper.xml
@@ -138,8 +138,7 @@
        br.town_name as townStreetName,br.name as neiName,
        jg.grid_name
        from jczz_house jh
        left join jczz_grid_range jgr on jgr.house_code = jh.house_code
        left join jczz_grid jg on jg.id = jgr.grid_id and jg.is_deleted = 0
        left join jczz_grid jg on jg.grid_code = jh.grid_code and jg.is_deleted = 0
        left join blade_region br on br.code = jg.community_code
        <where>
            <if test="house.id != null ">and jh.id = #{house.id}</if>
@@ -204,7 +203,7 @@
            </if>
            and jh.is_deleted = 0
            ORDER BY
            jh.update_time DESC
            jh.update_time desc,jh.id desc
        </where>
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
@@ -174,11 +174,10 @@
        jczz_household jh
        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_range jgr on jgr.house_code=jda.address_code
        LEFT JOIN jczz_grid jg on jg.id = jgr.grid_id and jg.is_deleted = 0
        LEFT JOIN jczz_grid jg on jg.grid_code = jhs.grid_code and jg.is_deleted = 0
        <where>
            <if test="household.userId!=null">
                AND jg.id IN ( SELECT DISTINCT jgm.grid_id FROM jczz_gridman jgm WHERE jgm.user_id = #{household.userId}
                AND jg.grid_code IN ( SELECT DISTINCT jgm.grid_code FROM jczz_gridman jgm WHERE jgm.user_id = #{household.userId}
                )
            </if>
            <if test="household.name!=null and household.name !=''">
@@ -283,12 +282,11 @@
        jczz_household jh
        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_range jgr on jgr.house_code=jda.address_code
        LEFT JOIN jczz_grid jg on jg.id = jgr.grid_id and jg.is_deleted = 0
        LEFT JOIN jczz_grid jg on jg.grid_code = jhs.grid_code and jg.is_deleted = 0
        where jh.is_deleted = 0
        and jh.name != '' and jh.name is not null
        <if test="household.userId!=null">
            AND jg.id IN ( SELECT DISTINCT jgm.grid_id FROM jczz_gridman jgm WHERE jgm.user_id = #{household.userId}
            AND jg.grid_code IN ( SELECT DISTINCT jgm.grid_code FROM jczz_gridman jgm WHERE jgm.user_id = #{household.userId}
            )
        </if>
        <if test="household.name!=null and household.name !=''">
@@ -668,12 +666,11 @@
        jczz_household jh
        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_range jgr on jgr.house_code=jda.address_code
        LEFT JOIN jczz_grid jg on jg.id = jgr.grid_id and jg.is_deleted = 0
        LEFT JOIN jczz_grid jg on jg.grid_code = jhs.grid_code and jg.is_deleted = 0
        LEFT JOIN jczz_user_house_label juhl on juhl.house_code = jda.address_code and lable_type=1
        <where>
            <if test="household.userId!=null">
                AND jg.id IN ( SELECT DISTINCT jgm.grid_id FROM jczz_gridman jgm WHERE jgm.user_id = #{household.userId}
                AND jg.grid_code IN ( SELECT DISTINCT jgm.grid_code FROM jczz_gridman jgm WHERE jgm.user_id = #{household.userId}
                )
            </if>
            <if test="household.name!=null and household.name !=''">
@@ -789,11 +786,10 @@
        jczz_household jh
        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_range jgr on jgr.house_code=jda.address_code
        LEFT JOIN jczz_grid jg on jg.id = jgr.grid_id and jg.is_deleted = 0
        LEFT JOIN jczz_grid jg on jg.grid_code = jhs.grid_code and jg.is_deleted = 0
        <where>
            <if test="household.userId!=null">
                AND jg.id IN ( SELECT DISTINCT jgm.grid_id FROM jczz_gridman jgm WHERE jgm.user_id = #{household.userId}
                AND jg.grid_code IN ( SELECT DISTINCT jgm.grid_code FROM jczz_gridman jgm WHERE jgm.user_id = #{household.userId}
                )
            </if>
            <if test="household.name!=null and household.name !=''">
src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java
@@ -31,8 +31,10 @@
import org.springblade.core.secure.utils.AuthUtil;
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;
@@ -72,9 +74,6 @@
    @Autowired
    private IHouseRentalService iHouseRentalService;
    @Autowired
    private IDeptService deptService;
    @Autowired
    private ICategoryService categoryService;
@@ -205,7 +204,7 @@
        taskVO.setReportType(2);
        taskVO.setIsDeleted(0);
        // 查询网格员对应的网格id
        Integer gridId = getGridId();
        String gridCode = getGridCode();
        // 标签事件
        Integer bqsj = baseMapper.selectTaskCount(taskVO);
        taskVO.setReportType(1);
@@ -223,7 +222,7 @@
        // 场所审核
        Integer cssh = SpringUtils.getBean(IPlaceExtService.class).selectCount(roleType > 0 ? AuthUtil.getUserId() : null, neiCode, 1);
        // 走访日志
        Integer zfrw = SpringUtils.getBean(IGridWorkLogService.class).getGridWorkCountHandleCount(gridId,1);
        Integer zfrw = SpringUtils.getBean(IGridWorkLogService.class).getGridWorkCountHandleCount(gridCode,1);
        // 设置
        objectObjectHashMap.put("qbhs", qbhs);
        objectObjectHashMap.put("bqsj", bqsj);
@@ -239,12 +238,10 @@
     * 获取网格员id
     * @return
     */
    private Integer getGridId() {
        QueryWrapper<GridmanEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("is_deleted",0).eq("user_id",AuthUtil.getUserId());
        List<GridmanEntity> list = SpringUtils.getBean(IGridmanService.class).list(wrapper);
        if (list.size()>0){
            return list.get(0).getGridId();
    private String getGridCode() {
        GridEntity grid = SpringUtils.getBean(IGridService.class).getGridByUserId(AuthUtil.getUserId());
        if (null!=grid){
            return grid.getGridCode();
        }
        return null;
    }