linwei
2024-02-02 77b8b6463ace59df830140c018489f65dd7e6d54
导出
4 files modified
154 ■■■■■ 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 45 ●●●●● 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
@@ -122,6 +123,7 @@
    /**
     * 查询场所集合信息
     *
     * @param userId
     * @return
     */
@@ -132,6 +134,7 @@
    /**
     * 场所信息自定义新增/修改
     *
     * @param placeVO
     * @return
     */
@@ -190,6 +193,7 @@
    /**
     * 房屋绑定
     *
     * @param placeVO
     */
    public void houseCodeBind(PlaceVO placeVO) {
@@ -223,6 +227,7 @@
    /**
     * 设置场所完善状态
     *
     * @param placeVO
     */
    private void setPlaceStatus(PlaceVO placeVO) {
@@ -242,6 +247,7 @@
    /**
     * 网格绑定
     *
     * @param placeVO
     */
    public void gridBind(PlaceVO placeVO) {
@@ -276,6 +282,7 @@
    /**
     * 网格编号绑定
     *
     * @param placeVO
     */
    public void gridCodeBind(PlaceVO placeVO) {
@@ -293,6 +300,7 @@
    /**
     * 网格员角色位置绑定-grid_id
     *
     * @param placeVO
     */
    public void gridmanPositionHandle(PlaceVO placeVO) {
@@ -323,6 +331,7 @@
    /**
     * 网格员角色位置绑定-grid_code
     *
     * @param placeVO
     */
    public void gridmanGridCodePositionHandle(PlaceVO placeVO) {
@@ -340,6 +349,7 @@
    /**
     * 民警角色位置绑定
     *
     * @param placeVO
     */
    private void policePositionHandle(PlaceVO placeVO) {
@@ -374,6 +384,7 @@
    /**
     * 民警角色时通过位置绑定网格
     *
     * @param placeVO
     */
    private void policeGridCodePositionHandle(PlaceVO placeVO) {
@@ -397,6 +408,7 @@
    /**
     * 场所标签信息绑定入库
     *
     * @param placeVO
     */
    @Transactional(rollbackFor = Exception.class)
@@ -422,6 +434,7 @@
    /**
     * 插入场所标签信息
     *
     * @param placeVO
     */
    public void savePlaceLabel(PlaceVO placeVO) {
@@ -508,6 +521,7 @@
    /**
     * 场所负责人和用户绑定
     *
     * @param placeVO
     */
    @Transactional(rollbackFor = Exception.class)
@@ -564,6 +578,7 @@
    /**
     * 保存场所详情及任务信息
     *
     * @param placeVO
     */
    @Transactional(rollbackFor = Exception.class)
@@ -590,6 +605,7 @@
    /**
     * 历史场所挂接处理-临时
     *
     * @param place
     * @return
     */
@@ -611,6 +627,7 @@
    /**
     * 历史场所标签挂接处理-临时
     *
     * @param place
     * @return
     */
@@ -636,6 +653,7 @@
    /**
     * 场所表 自定义详情查询
     *
     * @param place
     * @return
     */
@@ -692,6 +710,7 @@
    /**
     * 场所数据到导入
     *
     * @param data
     * @param isCovered
     */
@@ -723,6 +742,7 @@
    /**
     * 更新用户信息
     *
     * @param placeExcel
     * @return
     */
@@ -742,6 +762,7 @@
    /**
     * 更新用户信息
     *
     * @param placeExcel
     * @return
     */
@@ -761,6 +782,7 @@
    /**
     * 场所(商超)导入
     *
     * @param data
     * @param isCovered
     */
@@ -828,6 +850,7 @@
    /**
     * 插入标签关系表
     *
     * @param placeExcel
     */
    public void savPlaceLabelBind(PlaceAndRelExcel placeExcel,PlaceEntity placeEntity) {
@@ -869,6 +892,7 @@
    /**
     * 自定义修改
     *
     * @param placeVO
     * @return
     */
@@ -928,6 +952,7 @@
    /**
     * 历史场所详情数据处理
     *
     * @param place
     * @return
     */
@@ -960,6 +985,7 @@
    /**
     * 商超数据处理
     *
     * @return
     */
    @Override
@@ -982,6 +1008,7 @@
    /**
     * 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所)
     *
     * @param stringList
     * @param tableName
     * @return
@@ -993,6 +1020,7 @@
    /**
     * 删除
     *
     * @param longs
     * @return
     */
@@ -1013,6 +1041,7 @@
    /**
     * 删除场所负责人对应的用户
     *
     * @param longs
     */
    public void removeUser(List<Long> longs) {
@@ -1061,6 +1090,7 @@
    /**
     * 删除场所对应的详情
     *
     * @param longs
     */
    public void removePlaceExt(List<Long> longs) {
@@ -1073,6 +1103,7 @@
    /**
     * 删除对应的标签绑定信息
     *
     * @param longs
     */
    public void removePlaceLabel(List<Long> longs) {
@@ -1085,6 +1116,7 @@
    /**
     * 九小场所档案
     *
     * @param page
     * @param place
     * @return
@@ -1107,6 +1139,17 @@
    @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) {