linwei
2024-02-22 9269fc94626bd9ed8c6c3d9e021d37b22d86a665
Merge remote-tracking branch 'origin/master'
9 files modified
1 files added
459 ■■■■■ changed files
src/main/java/org/springblade/modules/place/excel/PlaceCheckExcel.java 19 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml 14 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/service/impl/PlaceCheckServiceImpl.java 67 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskPlaceSelfCheck/controller/TaskPlaceSelfCheckController.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskPlaceSelfCheck/excel/TaskPlaceSelfCheckExcel.java 65 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskPlaceSelfCheck/mapper/TaskPlaceSelfCheckMapper.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskPlaceSelfCheck/mapper/TaskPlaceSelfCheckMapper.xml 148 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskPlaceSelfCheck/service/ITaskPlaceSelfCheckService.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/taskPlaceSelfCheck/service/impl/TaskPlaceSelfCheckServiceImpl.java 90 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/excel/PlaceCheckExcel.java
@@ -5,6 +5,9 @@
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import org.springblade.common.excel.ExcelDictConverter;
import org.springblade.common.excel.ExcelDictItem;
import java.io.Serializable;
/**
@@ -21,7 +24,15 @@
    private static final long serialVersionUID = 2L;
    /** 街道名称 */
    @ExcelProperty( value = "场所名称")
    private String placeName;
    @ExcelProperty(value = "场所地址")
    private String location;
    @ExcelProperty( value = "场所类别")
    private String nineType;
    @ExcelProperty( "所属街道")
    private String streetName;
@@ -31,9 +42,6 @@
    @ExcelProperty(value = "所属网格")
    private String gridName;
    @ExcelProperty( value = "场所名称")
    private String placeName;
    @ExcelProperty( value = "场所隐患")
    private String remark;
@@ -42,9 +50,6 @@
    @ExcelProperty(value = "场所负责人电话")
    private String principalPhone;
    @ExcelProperty(value = "场所地址")
    private String location;
    @ExcelProperty(value = "创建时间")
    private String createTime;
src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.java
@@ -44,7 +44,8 @@
                                            @Param("placeCheck") PlaceCheckVO placeCheck,
                                            @Param("isAdministrator") Integer isAdministrator,
                                            @Param("regionChildCodesList") List<String> regionChildCodesList,
                                            @Param("gridCodeList") List<String> gridCodeList);
                                            @Param("gridCodeList") List<String> gridCodeList,
                                            @Param("nineTypeList") List<String> nineTypeList);
    /**
     * 查询场所检查表
@@ -74,5 +75,6 @@
    List<PlaceCheckExcel> selectPlaceCheckListExcel(@Param("placeCheck") PlaceCheckVO placeCheck,
                                                    @Param("isAdministrator") Integer isAdministrator,
                                                    @Param("regionChildCodesList") List<String> regionChildCodesList,
                                                    @Param("gridCodeList") List<String> gridCodeList);
                                                    @Param("gridCodeList") List<String> gridCodeList,
                                                    @Param("nineTypeList") List<String> nineTypeList);
}
src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
@@ -128,6 +128,13 @@
            and jp.principal_phone like concat('%', #{placeCheck.principalPhone},'%')
        </if>
        <if test="nineTypeList!=null and nineTypeList.size()>0">
            and jp.nine_type in
            <foreach collection="nineTypeList" separator="," open="(" close=")" item="nineType">
                #{nineType}
            </foreach>
        </if>
        <if test="placeCheck.startTime!=null and placeCheck.startTime!=''">
            and date_format(jpc.create_time,'%Y-%m-%d') &gt;= #{placeCheck.startTime}
        </if>
@@ -306,6 +313,13 @@
            and jp.principal_phone like concat('%', #{placeCheck.principalPhone},'%')
        </if>
        <if test="nineTypeList!=null and nineTypeList.size()>0">
            and jp.nine_type in
            <foreach collection="nineTypeList" separator="," open="(" close=")" item="nineType">
                #{nineType}
            </foreach>
        </if>
        <if test="placeCheck.startTime!=null and placeCheck.startTime!=''">
            and date_format(jpc.create_time,'%Y-%m-%d') &gt;= #{placeCheck.startTime}
        </if>
src/main/java/org/springblade/modules/place/service/impl/PlaceCheckServiceImpl.java
@@ -17,8 +17,10 @@
package org.springblade.modules.place.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xxl.job.core.util.FileUtil;
import liquibase.repackaged.org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,11 +45,13 @@
import org.springblade.modules.place.service.IPlaceCheckService;
import org.springblade.modules.police.service.IPoliceAffairsGridService;
import org.springblade.modules.system.entity.DictBiz;
import org.springblade.modules.system.service.IDictBizService;
import org.springblade.modules.system.service.IRegionService;
import org.springblade.modules.task.service.ITaskService;
import org.springblade.modules.task.vo.TaskLabelReportingEventVO;
import org.springblade.modules.taskPlaceRectification.entity.TaskPlaceRectificationEntity;
import org.springblade.modules.taskPlaceRectification.service.ITaskPlaceRectificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.transaction.annotation.Transactional;
@@ -68,15 +72,34 @@
    private static Logger logger = LoggerFactory.getLogger(PlaceCheckServiceImpl.class);
    @Autowired
    private IDictBizService dictBizService;
    @Override
    public IPage<PlaceCheckVO> selectPlaceCheckPage(IPage<PlaceCheckVO> page, PlaceCheckVO placeCheck) {
        List<String> strings = new ArrayList<>();
        if (null!=placeCheck.getNineType()){
            QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("is_deleted",0).eq("dict_key",placeCheck.getNineType()).eq("code","nineType");
            // 先查询当前
            DictBiz one = dictBizService.getOne(queryWrapper);
            // 查询本身和子集的key
            List<DictBiz> list = dictBizService.getList("nineType", one.getId());
            if (list.size()==0){
                strings.add(placeCheck.getNineType().toString());
            }else {
                strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList());
            }
        }
        // 公共参数设置
        CommonParamSet commonParamSet = new CommonParamSet().invoke(PlaceCheckVO.class,placeCheck);
        List<PlaceCheckVO> placeCheckVOS = baseMapper.selectPlaceCheckPage(page,
            placeCheck,
            commonParamSet.getIsAdministrator(),
            commonParamSet.getRegionChildCodesList(),
            commonParamSet.getGridCodeList());
            commonParamSet.getGridCodeList(),
            strings);
        List<DictBiz> nineType = dictBizService.list(Wrappers.<DictBiz>lambdaQuery().eq(DictBiz::getCode, "nineType").eq(DictBiz::getIsDeleted, 0));
        for (PlaceCheckVO placeCheckVO : placeCheckVOS) {
            int number = 0;
            for (PatrolRecord patrolRecord : placeCheckVO.getPatrolRecordVOList()) {
@@ -85,6 +108,17 @@
                }
            }
            placeCheckVO.setNumber(number);
            for (DictBiz dictBiz : nineType) {
                if (StringUtils.isNotBlank(placeCheckVO.getNineType()) && placeCheckVO.getNineType().equals(dictBiz.getDictKey())) {
                    if (placeCheckVO.getNineType().contains("10,11,12")) {
                        placeCheckVO.setNineType("小学校(幼儿园、校外培训机构)- " + dictBiz.getDictValue());
                    } else if (placeCheckVO.getNineType().contains("13,14,15")) {
                        placeCheckVO.setNineType("小医院(诊所、养老院)- " + dictBiz.getDictValue());
                    } else {
                        placeCheckVO.setNineType(dictBiz.getDictValue());
                    }
                }
            }
        }
        return page.setRecords(placeCheckVOS);
    }
@@ -170,12 +204,41 @@
     */
    @Override
    public List<PlaceCheckExcel> exportPlaceCheck(PlaceCheckVO placeCheck) {
        List<String> strings = new ArrayList<>();
        if (null!=placeCheck.getNineType()){
            QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("is_deleted",0).eq("dict_key",placeCheck.getNineType()).eq("code","nineType");
            // 先查询当前
            DictBiz one = dictBizService.getOne(queryWrapper);
            // 查询本身和子集的key
            List<DictBiz> list = dictBizService.getList("nineType", one.getId());
            if (list.size()==0){
                strings.add(placeCheck.getNineType());
            }else {
                strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList());
            }
        }
        // 公共参数设置
        CommonParamSet commonParamSet = new CommonParamSet().invoke(PlaceCheckVO.class,placeCheck);
        List<PlaceCheckExcel> placeCheckVOS = baseMapper.selectPlaceCheckListExcel(placeCheck,
            commonParamSet.getIsAdministrator(),
            commonParamSet.getRegionChildCodesList(),
            commonParamSet.getGridCodeList());
            commonParamSet.getGridCodeList(),
            strings);
        List<DictBiz> nineType = dictBizService.list(Wrappers.<DictBiz>lambdaQuery().eq(DictBiz::getCode, "nineType").eq(DictBiz::getIsDeleted, 0));
        for (PlaceCheckExcel placeCheckVO : placeCheckVOS) {
            for (DictBiz dictBiz : nineType) {
                if (StringUtils.isNotBlank(placeCheckVO.getNineType()) && placeCheckVO.getNineType().equals(dictBiz.getDictKey())) {
                    if (placeCheckVO.getNineType().contains("10,11,12")) {
                        placeCheckVO.setNineType("小学校(幼儿园、校外培训机构)- " + dictBiz.getDictValue());
                    } else if (placeCheckVO.getNineType().contains("13,14,15")) {
                        placeCheckVO.setNineType("小医院(诊所、养老院)- " + dictBiz.getDictValue());
                    } else {
                        placeCheckVO.setNineType(dictBiz.getDictValue());
                    }
                }
            }
        }
        // 返回
        return placeCheckVOS;
    }
src/main/java/org/springblade/modules/taskPlaceSelfCheck/controller/TaskPlaceSelfCheckController.java
@@ -21,15 +21,22 @@
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.place.excel.PlaceCheckExcel;
import org.springblade.modules.place.vo.PlaceCheckVO;
import org.springblade.modules.taskPlaceSelfCheck.dto.TaskPlaceSelfCheckDTO;
import org.springblade.modules.taskPlaceSelfCheck.excel.TaskPlaceSelfCheckExcel;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.taskPlaceSelfCheck.entity.TaskPlaceSelfCheckEntity;
@@ -37,6 +44,8 @@
import org.springblade.modules.taskPlaceSelfCheck.wrapper.TaskPlaceSelfCheckWrapper;
import org.springblade.modules.taskPlaceSelfCheck.service.ITaskPlaceSelfCheckService;
import org.springblade.core.boot.ctrl.BladeController;
import java.util.List;
/**
 * 消防自查记任务表 控制器
@@ -149,11 +158,24 @@
     * 消防自查记任务表 修改
     */
    @PostMapping("/updateTaskPlaceSelfCheck")
    @ApiOperationSupport(order = 5)
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "更新自查详情接口", notes = "传入taskPlaceSelfCheck")
    public R updateTaskPlaceSelfCheck(@Valid @RequestBody TaskPlaceSelfCheckVO taskPlaceSelfCheck) throws Exception {
        return R.status(taskPlaceSelfCheckService.updateTaskPlaceSelfCheck(taskPlaceSelfCheck));
    }
    /**
     * 导出消防自查信息
     * @param taskPlaceSelfCheck
     */
    @GetMapping("export-taskPlaceSelfCheck")
    @ApiOperationSupport(order = 9)
    @ApiOperation(value = "导出消防自查", notes = "传入taskPlaceSelfCheck")
    public void exportTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck, HttpServletResponse response) {
        List<TaskPlaceSelfCheckExcel> list = taskPlaceSelfCheckService.exportTaskPlaceSelfCheck(taskPlaceSelfCheck);
        ExcelUtil.export(response, "消防自查" + DateUtil.time(), "消防自查记录表", list, TaskPlaceSelfCheckExcel.class);
    }
}
src/main/java/org/springblade/modules/taskPlaceSelfCheck/excel/TaskPlaceSelfCheckExcel.java
New file
@@ -0,0 +1,65 @@
package org.springblade.modules.taskPlaceSelfCheck.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import org.springblade.common.excel.ExcelDictConverter;
import org.springblade.common.excel.ExcelDictItem;
import java.io.Serializable;
/**
 * 消费自查检查
 *
 * @author zhongrj
 * @date 2024/02/22
 */
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class TaskPlaceSelfCheckExcel implements Serializable {
    private static final long serialVersionUID = 2L;
    @ExcelProperty( value = "场所名称")
    private String placeName;
    @ExcelProperty(value = "场所地址")
    private String location;
    @ExcelProperty( value = "场所类别")
    private String nineType;
    /** 街道名称 */
    @ExcelProperty( "所属街道")
    private String streetName;
    @ExcelProperty(value = "所属社区")
    private String communityName;
    @ExcelProperty(value = "所属网格")
    private String gridName;
    @ExcelProperty( value = "场所隐患")
    private String remark;
    @ExcelProperty(value = "场所负责人")
    private String principal;
    @ExcelProperty(value = "场所负责人电话")
    private String principalPhone;
    @ExcelProperty(value = "创建时间")
    private String createTime;
    @ExcelProperty(value = "审核状态")
    private String status;
}
src/main/java/org/springblade/modules/taskPlaceSelfCheck/mapper/TaskPlaceSelfCheckMapper.java
@@ -19,6 +19,7 @@
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.taskPlaceSelfCheck.dto.TaskPlaceSelfCheckDTO;
import org.springblade.modules.taskPlaceSelfCheck.entity.TaskPlaceSelfCheckEntity;
import org.springblade.modules.taskPlaceSelfCheck.excel.TaskPlaceSelfCheckExcel;
import org.springblade.modules.taskPlaceSelfCheck.vo.TaskPlaceSelfCheckVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -44,7 +45,8 @@
                                                            @Param("place") TaskPlaceSelfCheckVO taskPlaceSelfCheck,
                                                            @Param("isAdministrator") Integer isAdministrator,
                                                            @Param("regionChildCodesList") List<String> regionChildCodesList,
                                                            @Param("gridCodeList") List<String> gridCodeList);
                                                            @Param("gridCodeList") List<String> gridCodeList,
                                                            @Param("nineTypeList") List<String> nineTypeList);
    /**
     * 查询消防自查记任务表
@@ -61,4 +63,18 @@
     * @return 消防自查记任务表集合
     */
    public List<TaskPlaceSelfCheckDTO> selectTaskPlaceSelfCheckList(TaskPlaceSelfCheckDTO taskPlaceSelfCheckDTO);
    /**
     * 导出消防自查信息
     * @param taskPlaceSelfCheck
     * @param isAdministrator
     * @param regionChildCodesList
     * @param gridCodeList
     * @return
     */
    List<TaskPlaceSelfCheckExcel> exportTaskPlaceSelfCheck(@Param("nineTypeList") List<String> nineTypeList,
                                                           @Param("place") TaskPlaceSelfCheckVO taskPlaceSelfCheck,
                                                           @Param("isAdministrator") Integer isAdministrator,
                                                           @Param("regionChildCodesList") List<String> regionChildCodesList,
                                                           @Param("gridCodeList") List<String> gridCodeList);
}
src/main/java/org/springblade/modules/taskPlaceSelfCheck/mapper/TaskPlaceSelfCheckMapper.xml
@@ -36,7 +36,7 @@
        </collection>
    </resultMap>
    <!--自定义分页查询-->
    <select id="selectTaskPlaceSelfCheckPage" resultMap="taskPlaceSelfCheckResultMap">
        select jpc.*,
        jp.id jpid,
@@ -68,6 +68,13 @@
            </if>
            <if test="place.principal != null  and place.principal != ''">
                and jp.principal like concat('%', #{place.principal},'%')
            </if>
            <if test="nineTypeList!=null and nineTypeList.size()>0">
                and jp.nine_type in
                <foreach collection="nineTypeList" separator="," open="(" close=")" item="nineType">
                    #{nineType}
                </foreach>
            </if>
            <if test="place.remark != null  and place.remark != ''">and jpc.remark = #{place.remark}</if>
            <if test="place.updateTime != null ">and jpc.update_time = #{place.updateTime}</if>
@@ -337,4 +344,143 @@
            <if test="deleteFlag != null ">and delete_flag = #{deleteFlag}</if>
        </where>
    </select>
    <!--导出消防自查信息-->
    <select id="exportTaskPlaceSelfCheck" resultType="org.springblade.modules.taskPlaceSelfCheck.excel.TaskPlaceSelfCheckExcel">
        select
        jpc.id,
        case when jpc.status=1 then '待审核'
        when jpc.status=2 then '审核通过'
        when jpc.status=3 then '审核不通过'
        else '待完成' end as status,
        jpc.remark,
        jpc.create_time,
        jp.place_name,
        jp.location,
        jg.grid_name,
        jp.principal,
        jp.principal_phone,
        jp.nine_type,
        jp.is_nine,
        br.town_name as streetName,
        br.village_name as communityName,
        bu.`name`,
        jpe.legal_tel,
        jpe.legal_person
        FROM jczz_task_place_self_check jpc
        LEFT JOIN jczz_place jp ON jpc.house_code = jp.house_code and jp.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_place_ext jpe ON jpe.place_id = jp.id and jpe.is_deleted = 0
        LEFT JOIN blade_user bu ON bu.id = jpc.create_user and bu.is_deleted = 0
        LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
        <where>
            <if test="place.id != null ">and jpc.id = #{place.id}</if>
            <if test="place.taskId != null ">and jpc.task_id = #{place.taskId}</if>
            <if test="place.taskName != null  and place.taskName != ''">and jpc.task_name = #{place.taskName}</if>
            <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="nineTypeList!=null and nineTypeList.size()>0">
                and jp.nine_type in
                <foreach collection="nineTypeList" separator="," open="(" close=")" item="nineType">
                    #{nineType}
                </foreach>
            </if>
            <if test="place.remark != null  and place.remark != ''">and jpc.remark = #{place.remark}</if>
            <if test="place.updateTime != null ">and jpc.update_time = #{place.updateTime}</if>
            <if test="place.createTime != null ">and jpc.create_time = #{place.createTime}</if>
            <if test="place.houseCode != null  and place.houseCode != ''">and jpc.house_code = #{place.houseCode}</if>
            <if test="place.rectificationEndTime != null ">and jpc.rectification_end_time =
                #{place.rectificationEndTime}
            </if>
            <if test="place.rectificationCompleteTime != null ">and jpc.rectification_complete_time =
                #{place.rectificationCompleteTime}
            </if>
            <if test="place.rectificationFlag != null ">and jpc.rectification_flag = #{place.rectificationFlag}</if>
            <if test="place.policeStation != null  and place.policeStation != ''">and jpc.police_station =
                #{place.policeStation}
            </if>
            <if test="place.rectificationNoticeImgUrl != null  and place.rectificationNoticeImgUrl != ''">and
                jpc.rectification_notice_img_url = #{place.rectificationNoticeImgUrl}
            </if>
            <if test="place.signaturePath != null  and place.signaturePath != ''">and jpc.signature_path =
                #{place.signaturePath}
            </if>
            <if test="place.streetName!=null and place.streetName!=''">
                and br.town_name like concat('%', #{place.streetName},'%')
            </if>
            <if test="place.communityName!=null and place.communityName!=''">
                and br.village_name like concat('%', #{place.communityName},'%')
            </if>
            <if test="place.gridName!=null and place.gridName!=''">
                and jg.grid_name like concat('%', #{place.gridName},'%')
            </if>
            <if test="place.createUser != null ">and jpc.create_user = #{place.createUser}</if>
            <if test="place.imageUrls != null  and place.imageUrls != ''">and jpc.image_urls = #{place.imageUrls}</if>
            <if test="place.status != null ">and jpc.status = #{place.status}</if>
            <if test="place.deleteFlag != null ">and jpc.delete_flag = #{place.deleteFlag}</if>
            <if test="isAdministrator==2">
                <choose>
                    <when test="place.roleName != null and place.roleName != ''">
                        <if test="place.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="place.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>
        </where>
    </select>
</mapper>
src/main/java/org/springblade/modules/taskPlaceSelfCheck/service/ITaskPlaceSelfCheckService.java
@@ -19,6 +19,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.taskPlaceSelfCheck.dto.TaskPlaceSelfCheckDTO;
import org.springblade.modules.taskPlaceSelfCheck.entity.TaskPlaceSelfCheckEntity;
import org.springblade.modules.taskPlaceSelfCheck.excel.TaskPlaceSelfCheckExcel;
import org.springblade.modules.taskPlaceSelfCheck.vo.TaskPlaceSelfCheckVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -61,4 +62,11 @@
    Boolean savePlace(TaskPlaceSelfCheckVO taskPlaceSelfCheck) throws Exception;
    Boolean updateTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck) throws Exception;
    /**
     * 导出消防自查信息
     * @param taskPlaceSelfCheck
     * @return
     */
    List<TaskPlaceSelfCheckExcel> exportTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck);
}
src/main/java/org/springblade/modules/taskPlaceSelfCheck/service/impl/TaskPlaceSelfCheckServiceImpl.java
@@ -16,7 +16,10 @@
 */
package org.springblade.modules.taskPlaceSelfCheck.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import liquibase.repackaged.org.apache.commons.lang3.StringUtils;
import org.springblade.common.constant.CommonConstant;
import org.springblade.common.constant.DictConstant;
import org.springblade.common.param.CommonParamSet;
@@ -26,7 +29,10 @@
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.modules.patrol.entity.PatrolRecord;
import org.springblade.modules.patrol.service.IPatrolRecordService;
import org.springblade.modules.place.excel.NinePlaceExcel;
import org.springblade.modules.place.vo.PlaceCheckVO;
import org.springblade.modules.system.entity.DictBiz;
import org.springblade.modules.system.service.IDictBizService;
import org.springblade.modules.task.service.ITaskService;
import org.springblade.modules.taskPlaceRecord.entity.TaskPlaceRecordEntity;
import org.springblade.modules.taskPlaceRecord.service.ITaskPlaceRecordService;
@@ -35,14 +41,17 @@
import org.springblade.modules.taskPlaceRectification.service.ITaskPlaceRectificationService;
import org.springblade.modules.taskPlaceSelfCheck.dto.TaskPlaceSelfCheckDTO;
import org.springblade.modules.taskPlaceSelfCheck.entity.TaskPlaceSelfCheckEntity;
import org.springblade.modules.taskPlaceSelfCheck.excel.TaskPlaceSelfCheckExcel;
import org.springblade.modules.taskPlaceSelfCheck.vo.TaskPlaceSelfCheckVO;
import org.springblade.modules.taskPlaceSelfCheck.mapper.TaskPlaceSelfCheckMapper;
import org.springblade.modules.taskPlaceSelfCheck.service.ITaskPlaceSelfCheckService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@@ -56,15 +65,35 @@
@Service
public class TaskPlaceSelfCheckServiceImpl extends ServiceImpl<TaskPlaceSelfCheckMapper, TaskPlaceSelfCheckEntity> implements ITaskPlaceSelfCheckService {
    @Autowired
    private IDictBizService dictBizService;
    @Override
    public IPage<TaskPlaceSelfCheckVO> selectTaskPlaceSelfCheckPage(IPage<TaskPlaceSelfCheckVO> page, TaskPlaceSelfCheckVO taskPlaceSelfCheck) {
        List<String> strings = new ArrayList<>();
        if (null!=taskPlaceSelfCheck.getNineType()){
            QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>();
            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){
                strings.add(taskPlaceSelfCheck.getNineType().toString());
            }else {
                strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList());
            }
        }
        // 公共参数设置
        CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskPlaceSelfCheckVO.class,taskPlaceSelfCheck);
        List<TaskPlaceSelfCheckVO> placeCheckVOS = baseMapper.selectTaskPlaceSelfCheckPage(page,
            taskPlaceSelfCheck,
            commonParamSet.getIsAdministrator(),
            commonParamSet.getRegionChildCodesList(),
            commonParamSet.getGridCodeList());
            commonParamSet.getGridCodeList(),
            strings);
        List<DictBiz> nineType = dictBizService.list(Wrappers.<DictBiz>lambdaQuery().eq(DictBiz::getCode, "nineType").eq(DictBiz::getIsDeleted, 0));
        for (TaskPlaceSelfCheckVO placeCheckVO : placeCheckVOS) {
            int number = 0;
            for (TaskPlaceRecordVO patrolRecord : placeCheckVO.getTaskPlaceRecordVOList()) {
@@ -73,7 +102,19 @@
                }
            }
            placeCheckVO.setNumber(number);
            for (DictBiz dictBiz : nineType) {
                if (StringUtils.isNotBlank(placeCheckVO.getNineType()) && placeCheckVO.getNineType().equals(dictBiz.getDictKey())) {
                    if (placeCheckVO.getNineType().contains("10,11,12")) {
                        placeCheckVO.setNineType("小学校(幼儿园、校外培训机构)- " + dictBiz.getDictValue());
                    } else if (placeCheckVO.getNineType().contains("13,14,15")) {
                        placeCheckVO.setNineType("小医院(诊所、养老院)- " + dictBiz.getDictValue());
                    } else {
                        placeCheckVO.setNineType(dictBiz.getDictValue());
                    }
                }
            }
        }
        // 返回
        return page.setRecords(placeCheckVOS);
    }
@@ -160,4 +201,51 @@
        }
        throw new Exception("保存失败!");
    }
    /**
     * 导出消防自查信息
     * @param taskPlaceSelfCheck
     * @return
     */
    @Override
    public List<TaskPlaceSelfCheckExcel> exportTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck) {
        List<String> strings = new ArrayList<>();
        if (null!=taskPlaceSelfCheck.getNineType()){
            QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>();
            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){
                strings.add(taskPlaceSelfCheck.getNineType().toString());
            }else {
                strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList());
            }
        }
        // 公共参数设置
        CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskPlaceSelfCheckVO.class,taskPlaceSelfCheck);
        List<TaskPlaceSelfCheckExcel> taskPlaceSelfCheckExcels = baseMapper.exportTaskPlaceSelfCheck(
            strings,
            taskPlaceSelfCheck,
            commonParamSet.getIsAdministrator(),
            commonParamSet.getRegionChildCodesList(),
            commonParamSet.getGridCodeList());
        // 返回
        List<DictBiz> nineType = dictBizService.list(Wrappers.<DictBiz>lambdaQuery().eq(DictBiz::getCode, "nineType").eq(DictBiz::getIsDeleted, 0));
        for (TaskPlaceSelfCheckExcel ninePlaceExcel : taskPlaceSelfCheckExcels) {
            for (DictBiz dictBiz : nineType) {
                if (StringUtils.isNotBlank(ninePlaceExcel.getNineType()) && ninePlaceExcel.getNineType().equals(dictBiz.getDictKey())) {
                    if (ninePlaceExcel.getNineType().contains("10,11,12")) {
                        ninePlaceExcel.setNineType("小学校(幼儿园、校外培训机构)- " + dictBiz.getDictValue());
                    } else if (ninePlaceExcel.getNineType().contains("13,14,15")) {
                        ninePlaceExcel.setNineType("小医院(诊所、养老院)- " + dictBiz.getDictValue());
                    } else {
                        ninePlaceExcel.setNineType(dictBiz.getDictValue());
                    }
                }
            }
        }
        return taskPlaceSelfCheckExcels;
    }
}