linwe
2024-07-15 8f5aeec641d916806553ef9772d55e17e93db150
代码优化
13 files modified
1 files added
599 ■■■■■ changed files
src/main/java/org/springblade/es/service/ElasticsearchDocumentService.java 10 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/backblast/service/impl/BackblastPubRecordServiceImpl.java 10 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/doorplateAddress/controller/DoorplateAddressController.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/doorplateAddress/excel/ImportDoorplateExcel.java 272 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/doorplateAddress/service/IDoorplateAddressService.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/doorplateAddress/service/impl/DoorplateAddressServiceImpl.java 26 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseMapper.xml 23 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/task/mapper/TaskLabelReportingEventMapper.xml 16 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/task/mapper/TaskMapper.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml 123 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/task/mapper/TaskPlaceRectificationMapper.xml 13 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java 29 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/es/service/ElasticsearchDocumentService.java
@@ -18,7 +18,10 @@
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.reindex.*;
import org.elasticsearch.index.reindex.BulkByScrollResponse;
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.index.reindex.UpdateByQueryRequest;
import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptType;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
@@ -46,7 +49,6 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.elasticsearch.script.Script;
import java.io.IOException;
import java.util.ArrayList;
@@ -429,6 +431,10 @@
    @Async
    public void addHousehold(EsParam esParam, HouseholdEntity household) {
        if (elasticsearchSync) {
            // 如果关系为空,则默认为19
            if (household.getRelationship() == null) {
                household.setRelationship(19);
            }
            try {
                indexDocument(esParam.getIndexName(),
                    "tableId", household.getId().toString(),
src/main/java/org/springblade/modules/backblast/service/impl/BackblastPubRecordServiceImpl.java
@@ -209,12 +209,16 @@
        // 再删除对应的宣传对象信息
        if (flag){
            IBackblastPubPersonService backblastPubPersonService = SpringUtil.getBean(IBackblastPubPersonService.class);
            for (Long id : toLongList) {
                // 删除所有
                QueryWrapper<BackblastPubPersonEntity> wrapper = new QueryWrapper<>();
                wrapper.eq("backblast_pub_record_id", id);
                wrapper.in("backblast_pub_record_id", toLongList);
                backblastPubPersonService.remove(wrapper);
            }
            // for (Long id : toLongList) {
            //     // 删除所有
            //     QueryWrapper<BackblastPubPersonEntity> wrapper = new QueryWrapper<>();
            //     wrapper.eq("backblast_pub_record_id", id);
            //     backblastPubPersonService.remove(wrapper);
            // }
        }
        return flag;
    }
src/main/java/org/springblade/modules/doorplateAddress/controller/DoorplateAddressController.java
@@ -25,6 +25,7 @@
import javax.validation.Valid;
import org.springblade.common.param.ToObject;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.mp.support.Condition;
@@ -34,13 +35,18 @@
import org.springblade.core.tool.node.ForestNodeMerger;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity;
import org.springblade.modules.doorplateAddress.excel.ImportDoorplateExcel;
import org.springblade.modules.doorplateAddress.service.IDoorplateAddressService;
import org.springblade.modules.doorplateAddress.vo.DoorplateAddressVOTree;
import org.springblade.modules.doorplateAddress.vo.DoorplateAddressVO;
import org.springblade.modules.doorplateAddress.wrapper.DoorplateAddressWrapper;
import org.springblade.modules.house.excel.HouseAndHoldExcel;
import org.springblade.modules.house.excel.HouseAndHoldImporter;
import org.springblade.modules.house.excel.ImportHouseholdExcel;
import org.springblade.modules.house.vo.HouseParam;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.multipart.MultipartFile;
import sun.rmi.runtime.Log;
import java.util.List;
@@ -299,4 +305,16 @@
        return R.data(houseBuildingCode);
    }
    /**
     * 更新地址总表
     */
    @PostMapping("import-doorplate")
    @ApiOperationSupport(order = 12)
    @ApiOperation(value = "更新地址总表", notes = "传入excel")
    public R importUser(MultipartFile file) {
        String data = doorplateAddressService.importDoorplate(ExcelUtil.read(file, ImportDoorplateExcel.class));
        return R.data(200, data, data);
    }
}
src/main/java/org/springblade/modules/doorplateAddress/excel/ImportDoorplateExcel.java
New file
@@ -0,0 +1,272 @@
package org.springblade.modules.doorplateAddress.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 com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
/**
 * ImportHouseHoldExcel
 *
 * @author Chill
 */
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class ImportDoorplateExcel implements Serializable {
    private static final long serialVersionUID = 2L;
    /**
     * 地址名称
     */
    @ExcelProperty(value = "地址名称")
    private String addressName;
    /**
     * 门牌地址编码
     */
    @ExcelProperty(value = "门牌地址编码")
    private String addressCode;
    /**
     * 经度
     */
    @ExcelProperty(value = "经度")
    private String X;
    /**
     * 纬度
     */
    @ExcelProperty(value = "纬度")
    private String Y;
    /**
     * x84经度
     */
    @ExcelProperty(value = "x84经度")
    @TableField("x_84")
    private String x84;
    /**
     * y84纬度
     */
    @ExcelProperty(value = "y84纬度")
    @TableField("y_84")
    private String y84;
    /**
     * 行政区编码
     */
    @ExcelProperty(value = "行政区编码")
    private String regionCode;
    /**
     * 行政区名称
     */
    @ExcelProperty(value = "行政区名称")
    private String regionName;
    /**
     * 乡镇街道编号
     */
    @ExcelProperty(value = "乡镇街道编号")
    @TableField("town_street_code")
    private String townStreetCode;
    /**
     * 乡镇街道名称
     */
    @ExcelProperty(value = "乡镇街道名称")
    private String townStreetName;
    /**
     * 居委会(社区)编号
     */
    @ExcelProperty(value = "居委会(社区)编号")
    private String neiCode;
    /**
     * 居委会(社区)名称
     */
    @ExcelProperty(value = "居委会(社区)名称")
    private String neiName;
    /**
     * 街路巷编码
     */
    @ExcelProperty(value = "街路巷编码")
    private String streetRuCode;
    /**
     * 街路巷名称
     */
    @ExcelProperty(value = "街路巷名称")
    private String streetRuName;
    /**
     * 分局代码
     */
    @ExcelProperty(value = "分局代码")
    private String branchCode;
    /**
     * 分局名称
     */
    @ExcelProperty(value = "分局名称")
    private String branchName;
    /**
     * 派出所代码
     */
    @ExcelProperty(value = "派出所代码")
    private String localPoliceStationCode;
    /**
     * 派出所名称
     */
    @ExcelProperty(value = "派出所名称")
    private String localPoliceStationName;
    /**
     * 警务室代码
     */
    @ExcelProperty(value = "警务室代码")
    private String policeAffairsCode;
    /**
     * 警务室名称
     */
    @ExcelProperty(value = "警务室名称")
    private String policeAffairsName;
    /**
     * 单元编码
     */
    @ExcelProperty(value = "单元编码")
    private String unitCode;
    /**
     * 单元号(名称)
     */
    @ExcelProperty(value = "单元号(名称)")
    private String unitName;
    /**
     * 楼栋编码
     */
    @ExcelProperty(value = "楼栋编码")
    private String buildingCode;
    /**
     * 楼栋号(名称)
     */
    @ExcelProperty(value = "楼栋号(名称)")
    private String buildingName;
    /**
     * 户室号(名称)
     */
    @ExcelProperty(value = "户室号(名称)")
    private String houseName;
    /**
     * 楼层
     */
    @ExcelProperty(value = "楼层")
    private String floor;
    /**
     * 小区编码
     */
    @ExcelProperty(value = "小区编码")
    private String aoiCode;
    /**
     * 小区名称
     */
    @ExcelProperty(value = "小区名称")
    private String aoiName;
    /**
     * 兴趣点code
     */
    @ExcelProperty(value = "兴趣点code")
    private String poiCode;
    /**
     * 兴趣点名称
     */
    @ExcelProperty(value = "兴趣点名称")
    private String poi;
    /**
     * 地址级别
     */
    @ExcelProperty(value = "地址级别")
    private Integer addressLevel;
    /**
     * 父节点地址编码
     */
    @ExcelProperty(value = "父节点地址编码")
    private String parentAddressCode;
    /**
     * 采集照片url
     */
    @ExcelProperty(value = "采集照片url")
    private String gatPicUrl;
    /**
     * 门牌状态
     */
    @ExcelProperty(value = "门牌状态")
    private String doorplateStatus;
    /**
     * 门牌类型
     */
    @ExcelProperty(value = "门牌类型")
    private String doorplateType;
    /**
     * 门牌类型编号
     */
    @ExcelProperty(value = "门牌类型编号")
    private String doorplateTypeCode;
    /**
     * 门牌号
     */
    @ExcelProperty(value = "门牌号")
    private String doorplateNum;
    /**
     * 门牌名称
     */
    @ExcelProperty(value = "门牌名称")
    private String doorplateName;
    /**
     * 二维码路径
     */
    @ExcelProperty(value = "二维码路径")
    private String qrCodePath;
    /**
     * 子门牌号
     */
    @ExcelProperty(value = "子门牌号")
    private String subDoorPlateNo;
    /**
     * 大门名称
     */
    @ExcelProperty(value = "大门名称")
    private String gateName;
    /**
     * 操作类型
     */
    @ExcelProperty(value = "操作类型")
    private Integer operationType;
    /**
     * 地址类型
     */
    @ExcelProperty(value = "地址类型")
    private Integer addressType;
    /**
     * 子小区名称
     */
    @ExcelProperty(value = "子小区名称")
    private String subAoi;
    /**
     * 民警姓名
     */
    @ExcelProperty(value = "民警姓名")
    private String policeman;
    /**
     * 民警电话
     */
    @ExcelProperty(value = "民警电话")
    private String policemanPhone;
    /**
     * 警务网格编码
     */
    @ExcelProperty(value = "警务网格编码")
    private String jwwgCode;
}
src/main/java/org/springblade/modules/doorplateAddress/service/IDoorplateAddressService.java
@@ -19,6 +19,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity;
import org.springblade.modules.doorplateAddress.excel.ImportDoorplateExcel;
import org.springblade.modules.doorplateAddress.vo.DoorplateAddressVOTree;
import org.springblade.modules.doorplateAddress.vo.DoorplateAddressVO;
import org.springblade.modules.house.vo.HouseParam;
@@ -143,4 +144,11 @@
     * @return
     */
    boolean gridRangeDataHandle(String townName,String communityName);
    /**
     * 导入门牌地址
     * @param read
     * @return
     */
    String importDoorplate(List<ImportDoorplateExcel> read);
}
src/main/java/org/springblade/modules/doorplateAddress/service/impl/DoorplateAddressServiceImpl.java
@@ -30,6 +30,7 @@
import org.springblade.common.utils.NodeTreeUtil;
import org.springblade.common.utils.SpringUtils;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.modules.category.dto.CategoryDTO;
import org.springblade.modules.category.service.ICategoryService;
@@ -38,6 +39,7 @@
import org.springblade.modules.district.entity.DistrictEntity;
import org.springblade.modules.district.service.IDistrictService;
import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity;
import org.springblade.modules.doorplateAddress.excel.ImportDoorplateExcel;
import org.springblade.modules.doorplateAddress.mapper.DoorplateAddressMapper;
import org.springblade.modules.doorplateAddress.service.IDoorplateAddressService;
import org.springblade.modules.doorplateAddress.vo.DoorplateAddressVO;
@@ -1225,4 +1227,28 @@
//            backblastPubRecord.setJwGridCode(policeAffairsGridEntity.getJwGridCode());
//        }
    }
    @Override
    public String importDoorplate(List<ImportDoorplateExcel> read) {
        int i = 1;
        for (ImportDoorplateExcel importDoorplateExcel : read) {
            System.out.println("第-" + i + "-条记录");
            i++;
            DoorplateAddressEntity copyDoorplateAddress = Objects.requireNonNull(BeanUtil.copy(importDoorplateExcel, DoorplateAddressEntity.class));
            DoorplateAddressEntity doorplateAddressEntity = baseMapper.selectOne(Wrappers.<DoorplateAddressEntity>lambdaQuery()
                .eq(DoorplateAddressEntity::getAddressCode, importDoorplateExcel.getAddressCode()));
            if (null == doorplateAddressEntity) {
                baseMapper.insert(copyDoorplateAddress);
            } else {
                doorplateAddressEntity.setStreetRuCode(copyDoorplateAddress.getStreetRuCode());
                doorplateAddressEntity.setStreetRuName(copyDoorplateAddress.getStreetRuName());
                doorplateAddressEntity.setNeiName(copyDoorplateAddress.getNeiName());
                doorplateAddressEntity.setAoiCode(copyDoorplateAddress.getAoiCode());
                doorplateAddressEntity.setAoiName(copyDoorplateAddress.getAoiName());
                baseMapper.update(doorplateAddressEntity, Wrappers.<DoorplateAddressEntity>lambdaQuery()
                    .eq(DoorplateAddressEntity::getAddressCode, importDoorplateExcel.getAddressCode()));
            }
        }
        return null;
    }
}
src/main/java/org/springblade/modules/house/mapper/HouseMapper.xml
@@ -464,10 +464,12 @@
        LEFT JOIN jczz_grid jg on jg.grid_code = jh.grid_code and jg.is_deleted = 0
        LEFT JOIN jczz_police_affairs_grid jpag on jh.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
        <where>
            jda.nei_code in
            <foreach collection="communityCodeList" item="code" open="(" close=")" separator=",">
                #{code}
            </foreach>
            <if test="communityCodeList != null and communityCodeList.size()>0">
                jda.nei_code in
                <foreach collection="communityCodeList" item="code" open="(" close=")" separator=",">
                    #{code}
                </foreach>
            </if>
            and jda.doorplate_type = '户室牌'
            <choose>
                <when test="(buildingCode != null  and buildingCode != '') or
@@ -844,12 +846,19 @@
    <!--查询未绑定网格或警格的数据-->
    <select id="getNotBindGridOrJwGridList" resultType="org.springblade.modules.house.entity.HouseEntity">
        select id,lng,lat from jczz_house where is_deleted = 0 and lng != ''
        SELECT
        jh.id,
        IFNULL(jh.lng,jda.x) lng,
        IFNULL(jh.lat,jda.y) lat
        FROM
        jczz_house jh INNER JOIN jczz_doorplate_address jda on jda.address_code=jh.house_code
        WHERE
        jh.is_deleted = 0
        <if test="type == 1">
            and grid_code is null
            and jh.grid_code is null
        </if>
        <if test="type == 2">
            and jw_grid_code is null
            and jh.jw_grid_code is null
        </if>
    </select>
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
@@ -956,10 +956,12 @@
        jczz_household jh
        LEFT JOIN jczz_doorplate_address jda ON jh.house_code = jda.address_code
        <where>
            jda.nei_code in
            <foreach collection="communityCodeList" item="code" open="(" close=")" separator=",">
                #{code}
            </foreach>
            <if test="communityCodeList != null and communityCodeList.size()>0">
                jda.nei_code in
                <foreach collection="communityCodeList" item="code" open="(" close=")" separator=",">
                    #{code}
                </foreach>
            </if>
            and jda.doorplate_type = '户室牌'
            AND jh.is_deleted = 0
            <if test="userId != null and roleType == '1'">
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -20,6 +20,8 @@
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.common.utils.ImageUtils;
import org.springblade.common.utils.WeiXinSecurityUtil;
import org.springblade.core.launch.constant.AppConstant;
@@ -53,6 +55,7 @@
@Api(value = "对象存储端点", tags = "对象存储端点")
@RequestMapping(AppConstant.APPLICATION_RESOURCE_NAME + "/oss/endpoint")
public class OssEndpoint {
    private static final Logger logger = LoggerFactory.getLogger(OssEndpoint.class);
    /**
     * 对象存储构建类
@@ -367,16 +370,21 @@
     * @return attachId
     */
    private Long buildAttachData(Long attachId, String fileName, Long fileSize, BladeFile bladeFile, MultipartFile file) {
        String fileExtension = FileUtil.getFileExtension(fileName);
        AttachData attach = new AttachData();
        attach.setAttachId(attachId);
        attach.setName(bladeFile.getName());
        attach.setOriginalName(bladeFile.getOriginalName());
        attach.setSize(fileSize);
        attach.setExtension(fileExtension);
        attach.setData(ImageUtils.mulToBase64(file));
        attachDataService.save(attach);
        return attach.getId();
        try {
            String fileExtension = FileUtil.getFileExtension(fileName);
            AttachData attach = new AttachData();
            attach.setAttachId(attachId);
            attach.setName(bladeFile.getName());
            attach.setOriginalName(bladeFile.getOriginalName());
            attach.setSize(fileSize);
            attach.setExtension(fileExtension);
            attach.setData(ImageUtils.mulToBase64(file));
            attachDataService.save(attach);
            return attach.getId();
        } catch (Exception e) {
            logger.error("附件数据表保存失败", e);
        }
        return 0L;
    }
    /**
src/main/java/org/springblade/modules/task/mapper/TaskLabelReportingEventMapper.xml
@@ -300,9 +300,22 @@
        LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
        LEFT JOIN blade_region br on br.code = jpag.community_code
        where jtlre.is_deleted = 0
        <if test="taskLabelReportingEvent.streetName != null and taskLabelReportingEvent.streetName != ''">
            AND br.town_name like concat('%',#{taskLabelReportingEvent.streetName},'%')
        </if>
        <if test="taskLabelReportingEvent.communityName != null and taskLabelReportingEvent.communityName != ''">
            AND br.village_name like concat('%',#{taskLabelReportingEvent.communityName},'%')
        </if>
        <if test="taskLabelReportingEvent.userId != null and taskLabelReportingEvent.userId != ''">
            AND jtlre.user_id = #{taskLabelReportingEvent.userId}
        </if>
        <if test="taskLabelReportingEvent.houseCode != null  and taskLabelReportingEvent.houseCode != ''">
            and jp.house_code = #{taskLabelReportingEvent.houseCode}
        </if>
        <if test="taskLabelReportingEvent.eventType != null and taskLabelReportingEvent.eventType != ''">
            AND jtlre.event_type = #{taskLabelReportingEvent.eventType}
        </if>
@@ -327,6 +340,9 @@
        <if test="taskLabelReportingEvent.principalPhone != null and taskLabelReportingEvent.principalPhone != ''">
            AND jp.principal_phone like concat('%',#{taskLabelReportingEvent.principalPhone},'%')
        </if>
        <if test="taskLabelReportingEvent.startTime != null and taskLabelReportingEvent.startTime != '' and taskLabelReportingEvent.endTime != null and taskLabelReportingEvent.endTime != '' ">
            AND jtlre.create_time BETWEEN #{taskLabelReportingEvent.startTime} and #{taskLabelReportingEvent.endTime}
        </if>
        <if test="taskLabelReportingEvent.roleName != null and taskLabelReportingEvent.roleName != ''">
            <if test="taskLabelReportingEvent.roleName=='wgy'">
                <if test="isAdministrator==2">
src/main/java/org/springblade/modules/task/mapper/TaskMapper.java
@@ -75,4 +75,17 @@
                                        @Param("regionChildCodesList") List<String> regionChildCodesList,
                                        @Param("isAdministrator") Integer isAdministrator,
                                        @Param("gridCodeList") List<String> gridCodeList);
    /**
     * 取保候审统计
     * @param task
     * @param regionChildCodesList
     * @param isAdministrator
     * @param gridCodeList
     * @return
     */
    Integer selectTaskPageByPersonCount(@Param("task") TaskVO task,
                                        @Param("regionChildCodesList") List<String> regionChildCodesList,
                                        @Param("isAdministrator") Integer isAdministrator,
                                        @Param("gridCodeList") List<String> gridCodeList);
}
src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
@@ -640,4 +640,127 @@
    </select>
    <select id="selectTaskPageByPersonCount" resultType="java.lang.Integer">
        SELECT
        count(1)
        FROM
        jczz_task jt
        LEFT JOIN jczz_house jh ON jt.house_code=jh.house_code and jh.is_deleted = 0
        LEFT JOIN blade_user bu on bu.id = jt.create_user and bu.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
        LEFT JOIN jczz_task_bail_reporting_event jtbre on jtbre.task_id = jt.id
        <where>
            <if test="isAdministrator==2">
                <choose>
                    <when test="task.roleName != null and task.roleName != ''">
                        <if test="task.roleName=='wgy'">
                            <choose>
                                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
                                    and jh.grid_code in
                                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
                                        #{code}
                                    </foreach>
                                </when>
                                <otherwise>
                                    and jh.grid_code in ('')
                                </otherwise>
                            </choose>
                        </if>
                        <if test="task.roleName=='mj' and isAdministrator==2">
                            <choose>
                                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
                                    and br.village_code in
                                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
                                        #{code}
                                    </foreach>
                                </when>
                                <otherwise>
                                    and br.village_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
                                br.village_code in
                                <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
                                    #{code}
                                </foreach>
                                )
                            </when>
                            <otherwise>
                                and
                                (
                                jg.grid_code in ('') or br.village_code in ('')
                                )
                            </otherwise>
                        </choose>
                    </otherwise>
                </choose>
            </if>
            <if test="task.status != null and task.status != null">
                and jt.status = #{task.status}
            </if>
            <if test="task.aoiCode != null and task.aoiCode != null">
                and jh.district_code = #{task.aoiCode}
            </if>
            <if test="task.neiCode != null and task.neiCode != null">
                and jg.community_code = #{task.neiCode}
            </if>
            <if test="task.communityCode != null and task.communityCode != null">
                and jg.community_code = #{task.communityCode}
            </if>
            <if test="task.communityName != null and task.communityName != null">
                and br.name like concat('%', #{task.communityName}, '%')
            </if>
            <if test="task.streetCode != null and task.streetCode != null">
                and br.town_code = #{task.streetCode}
            </if>
            <if test="task.realName != null and task.realName != null">
                and bu.name like concat('%', #{task.realName}, '%')
            </if>
            <if test="task.phone != null and task.phone != null">
                and bu.phone like concat('%', #{task.phone}, '%')
            </if>
            <if test="task.districtName != null and task.districtName != null">
                and jh.district_name like concat('%', #{task.districtName}, '%')
            </if>
            <if test="task.frequency != null and task.frequency != ''">
                and jt.frequency = #{task.frequency}
            </if>
            <if test="task.name != null and task.name != ''">
                and jt.name like concat('%', #{task.name}, '%')
            </if>
            <if test="task.id != null ">and jt.id = #{task.id}</if>
            <if test="task.type != null ">and jt.type = #{task.type}</if>
            <if test="task.remark != null  and task.remark != ''">and jt.remark = #{task.remark}</if>
            <if test="task.createTime != null ">and jt.create_time = #{task.createTime}</if>
            <if test="task.createUser != null ">and jt.create_user = #{task.createUser}</if>
            <if test="task.updateTime != null ">and jt.update_time = #{task.updateTime}</if>
            <if test="task.updateUser != null ">and jt.update_user = #{task.updateUser}</if>
            <if test="task.isDeleted != null ">and jt.is_deleted = #{task.isDeleted}</if>
            <if test="task.houseCode != null  and task.houseCode != ''">and jt.house_code = #{task.houseCode}</if>
            <if test="task.startTime != null and task.startTime != '' and task.endTime != null and task.endTime != '' ">
                AND jt.create_time BETWEEN #{task.startTime} and #{task.endTime}
            </if>
            <!-- 取保候审 或 报事报修 -->
            <if test="task.reportType != null and task.reportType != 2 ">
                and jt.report_type = #{task.reportType}
            </if>
            and jt.is_deleted = 0
            order by jt.create_time desc
        </where>
    </select>
</mapper>
src/main/java/org/springblade/modules/task/mapper/TaskPlaceRectificationMapper.xml
@@ -492,7 +492,10 @@
            <if test="taskPalce.id != null ">and jtpr.id = #{taskPalce.id}</if>
            <if test="taskPalce.placeCheckId != null ">and jtpr.place_check_id = #{taskPalce.placeCheckId}</if>
            <if test="taskPalce.taskId != null ">and jtpr.task_id = #{taskPalce.taskId}</if>
            <if test="taskPalce.status != null ">and jtpr.status = #{taskPalce.status}</if>
            <if test="taskPalce.status != null and taskPalce.status != 2  ">and jtpr.status = #{taskPalce.status}</if>
            <if test="taskPalce.status != null and taskPalce.status == 2 ">and jtpr.status in (2,3)</if>
            <if test="taskPalce.taskName != null  and taskPalce.taskName != ''">and jtpr.task_name =
                #{taskPalce.taskName}
            </if>
@@ -504,6 +507,14 @@
                and jtpr.create_time&lt;=#{taskPalce.endTime}
            </if>
            <if test="taskPalce.streetName!=null and taskPalce.streetName!=''">
                and br.town_name like concat('%',#{taskPalce.streetName},'%')
            </if>
            <if test="taskPalce.communityName!=null and taskPalce.communityName!=''">
                and br.village_name like concat('%',#{taskPalce.communityName},'%')
            </if>
            <if test="taskPalce.placeName!=null and taskPalce.placeName!=''">
                and jp.place_name like concat('%',#{taskPalce.placeName},'%')
            </if>
src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java
@@ -31,6 +31,8 @@
import org.springblade.common.constant.DictConstant;
import org.springblade.common.param.CommonParamSet;
import org.springblade.common.utils.SpringUtils;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.category.entity.CategoryEntity;
import org.springblade.modules.category.service.ICategoryService;
@@ -111,31 +113,6 @@
    @Override
    public IPage<TaskVO> selectTaskPage(IPage<TaskVO> page, TaskVO task) {
//        String roleName = SpringUtils.getRequestParam("roleName");
//        String communityCode = SpringUtils.getRequestParam("communityCode");
//        if (!Strings.isBlank(communityCode)) {
//            // 校验社区编号是否合规
//            if (null != SpringUtils.getBean(IRegionService.class).getById(communityCode)) {
//                task.setCommunityCode(communityCode);
//            }
//        }
//        List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId());
//        Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2;
        // 网格编号集合
//        List<String> gridCodeList = new ArrayList<>();
        // 民警角色
//        if (!Strings.isBlank(roleName)) {
//            task.setRoleName(roleName);
//            if (roleName.equals("mj")) {
//                regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId());
//            }
//            if (roleName.equals("wgy")) {
//                gridCodeList = SpringUtil.getBean(IGridService.class).getGridListByUserId(AuthUtil.getUserId());
//            }
//        }
//        if (AuthUtil.getUserAccount().equals("18879306957")) {
//            task.setCommunityCode("361102003027");
//        }
        CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskVO.class, task);
        if (null != task.getReportType() && task.getReportType() == 1) {
            // 查询取保候审任务列表(人房相关)
@@ -253,7 +230,7 @@
            commonParamSet.getIsAdministrator(), commonParamSet.getGridCodeList());
        taskVO.setReportType(CommonConstant.NUMBER_ONE);
        // 取保候审
        Integer qbhs = baseMapper.selectTaskCount(taskVO, commonParamSet.getRegionChildCodesList(),
        Integer qbhs = baseMapper.selectTaskPageByPersonCount(taskVO, commonParamSet.getRegionChildCodesList(),
            commonParamSet.getIsAdministrator(), commonParamSet.getGridCodeList());
        // 报事报修
        Integer bsbx = SpringUtils.getBean(ITaskReportForRepairsService.class).getStatistics(roleType > 0 ? AuthUtil.getUserId() : null, neiCode, commonParamSet.getRegionChildCodesList(),