zhongrj
2023-12-01 fbfc2679c8fccf7e355562d762da858418f4ddd5
新增居民查询对应物业,网格,公安快捷信息
5 files modified
1 files added
156 ■■■■■ changed files
src/main/java/org/springblade/modules/house/controller/HouseholdController.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.java 22 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml 37 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/service/IHouseholdService.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java 26 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/vo/HouseholdOtherVO.java 51 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/controller/HouseholdController.java
@@ -187,4 +187,17 @@
    }
    /**
     * 住户对应物业,网格,公安负责人查询
     * @param household
     * @return
     */
    @GetMapping("/getHouseholdOtherInfo")
    @ApiOperationSupport(order = 14)
    @ApiOperation(value = "住户对应物业,网格,公安负责人查询", notes = "住户对应物业,网格,公安负责人查询")
    public R getHouseholdOtherInfo(HouseholdVO household) {
        return R.data(householdService.getHouseholdOtherInfo(household));
    }
}
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.java
@@ -19,6 +19,7 @@
import org.apache.ibatis.annotations.Param;
import org.springblade.common.node.TreeStringNode;
import org.springblade.modules.house.entity.HouseholdEntity;
import org.springblade.modules.house.vo.HouseholdOtherVO;
import org.springblade.modules.house.vo.HouseholdVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -73,4 +74,25 @@
    List<HouseHoldExcel> export(HouseholdVO household);
    Integer statistics(Long userId);
    /**
     * 查询物业
     * @param household
     * @return
     */
    HouseholdOtherVO getProperty(@Param("household") HouseholdVO household);
    /**
     * 查询网格
     * @param household
     * @return
     */
    HouseholdOtherVO getGrid(@Param("household") HouseholdVO household);
    /**
     * 查询公安信息
     * @param household
     * @return
     */
    HouseholdOtherVO getSecurity(@Param("household") HouseholdVO household);
}
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
@@ -197,5 +197,42 @@
    </select>
    <!--查询物业-->
    <select id="getProperty" resultType="org.springblade.modules.house.vo.HouseholdOtherVO">
        SELECT
            jpcd.property_company_id as code,
            jpcd.principal as name,
            jpcd.principal_phone as phone
        FROM
            jczz_doorplate_address jda
        LEFT JOIN jczz_district jd ON jd.aoi_code = jda.aoi_code
        LEFT JOIN jczz_property_company_district jpcd on jpcd.district_id=jd.id
        WHERE 1=1
        AND jda.address_code = #{household.houseCode}
    </select>
    <!--查询网格-->
    <select id="getGrid" resultType="org.springblade.modules.house.vo.HouseholdOtherVO">
        SELECT
            jg.id as code,
            jgm.gridman_name as name,jgm.mobile as phone
        FROM
            jczz_grid_range jgr
        LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id and jg.is_deleted = 0
        LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id and jgm.is_deleted = 0
        WHERE 1=1
        AND jgr.house_code = #{household.houseCode}
    </select>
    <!--查询公安信息-->
    <select id="getSecurity" resultType="org.springblade.modules.house.vo.HouseholdOtherVO">
        SELECT
            address_code as code,policeman as name,policeman_phone as phone
        FROM
            jczz_doorplate_address
        WHERE
          address_code = #{household.houseCode}
    </select>
</mapper>
src/main/java/org/springblade/modules/house/service/IHouseholdService.java
@@ -75,4 +75,11 @@
    void importUserHouseHold(List<HouseHoldExcel> data, Boolean isCovered);
    Integer statistics(Long userId);
    /**
     * 住户对应物业,网格,公安负责人查询
     * @param household
     * @return
     */
    Object getHouseholdOtherInfo(HouseholdVO household);
}
src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java
@@ -22,6 +22,7 @@
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.house.entity.HouseholdEntity;
import org.springblade.modules.house.vo.HouseholdOtherVO;
import org.springblade.modules.house.vo.HouseholdVO;
import org.springblade.modules.house.mapper.HouseholdMapper;
import org.springblade.modules.house.service.IHouseholdService;
@@ -33,9 +34,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
/**
 * 住户 服务实现类
@@ -165,4 +164,25 @@
    public Integer statistics(Long userId) {
        return baseMapper.statistics(userId);
    }
    /**
     * 住户对应物业,网格,公安负责人查询
     * @param household
     * @return
     */
    @Override
    public Object getHouseholdOtherInfo(HouseholdVO household) {
        Map<String, Object> map = new HashMap<>(3);
        // 查询物业
        HouseholdOtherVO propertyOtherVO = baseMapper.getProperty(household);
        map.put("wy",propertyOtherVO);
        // 查询网格
        HouseholdOtherVO gridOtherVO = baseMapper.getGrid(household);
        map.put("wg",gridOtherVO);
        // 查询公安信息
        HouseholdOtherVO securityOtherVO = baseMapper.getSecurity(household);
        map.put("ga",securityOtherVO);
        // 返回
        return map;
    }
}
src/main/java/org/springblade/modules/house/vo/HouseholdOtherVO.java
New file
@@ -0,0 +1,51 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.house.vo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.house.entity.HouseholdEntity;
import java.util.ArrayList;
import java.util.List;
/**
 * 住户 视图实体类
 *
 * @author BladeX
 * @since 2023-10-28
 */
@Data
public class HouseholdOtherVO{
    private static final long serialVersionUID = 1L;
    /**
     * 编号
     */
    private String code;
    /**
     * 姓名
     */
    private String name;
    /**
     * 电话
     */
    private String phone;
}