linwe
2024-07-12 06b8f63c0603a4ece96e76b996591904be459a65
线上错误日志bug修复
7 files modified
67 ■■■■■ changed files
src/main/java/org/springblade/modules/backblast/service/impl/BackblastPubRecordServiceImpl.java 25 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/mapper/GridmanMapper.xml 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/service/impl/GridmanServiceImpl.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/mapper/HouseMapper.xml 12 ●●●●● 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/house/service/impl/HouseholdServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/service/impl/UserHouseLabelServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/backblast/service/impl/BackblastPubRecordServiceImpl.java
@@ -1,30 +1,27 @@
package org.springblade.modules.backblast.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.logging.log4j.util.Strings;
import org.springblade.common.param.CommonParamSet;
import org.springblade.common.param.GridSet;
import org.springblade.common.utils.SpringUtils;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.modules.backblast.entity.BackblastPubPersonEntity;
import org.springblade.modules.backblast.entity.BackblastPubRecordEntity;
import org.springblade.modules.backblast.excel.BackblastPubRecordExcel;
import org.springblade.modules.backblast.service.IBackblastPubPersonService;
import org.springblade.modules.backblast.vo.BackblastPubRecordVO;
import org.springblade.modules.backblast.mapper.BackblastPubRecordMapper;
import org.springblade.modules.backblast.service.IBackblastPubPersonService;
import org.springblade.modules.backblast.service.IBackblastPubRecordService;
import org.springblade.modules.backblast.vo.BackblastPubRecordVO;
import org.springblade.modules.grid.entity.GridEntity;
import org.springblade.modules.grid.service.IGridService;
import org.springblade.modules.place.entity.PlacePractitionerEntity;
import org.springblade.modules.place.service.IPlacePractitionerService;
import org.springblade.modules.police.entity.PoliceAffairsGridEntity;
import org.springblade.modules.police.service.IPoliceAffairsGridService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
@@ -71,6 +68,8 @@
        boolean flag = false;
        // 点落面计算警格,网格,警格
        setGridInfo(backblastPubRecord);
        // "otherId":"\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"[1]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\"\\\"\""
        backblastPubRecord.setOtherId(cleanEscapes(backblastPubRecord.getOtherId()));
        // 设置民警姓名电话(非民警暂时也记录)
        User user = SpringUtils.getBean(IUserService.class).getById(AuthUtil.getUserId());
        if (null!=user){
@@ -91,6 +90,20 @@
    }
    /**
     * 清理字符串中的多余转义字符
     * @param originalStr 原始字符串
     * @return 清理后的字符串
     */
    private static String cleanEscapes(String originalStr) {
        // 替换多个反斜杠为单个反斜杠
        String replacedBackslashes = originalStr.replaceAll("\\\\+", "\\\\");
        // 替换转义的双引号为空
        String cleanedStr = replacedBackslashes.replaceAll("\\\\\"", "").replaceAll("\"","");
        return cleanedStr;
    }
    /**
     * 宣防对象操作
     * @param backblastPubRecord
     * @return
src/main/java/org/springblade/modules/grid/mapper/GridmanMapper.xml
@@ -80,10 +80,12 @@
        FROM jczz_gridman jgm
        LEFT JOIN jczz_grid jg ON jg.grid_code = jgm.grid_code
        <where>
            jg.community_code in
            <foreach collection="communityCodeList" item="code" open="(" close=")" separator=",">
                #{code}
            </foreach>
            <if test="communityCodeList !=null and communityCodeList.size() >0">
                jg.community_code in
                <foreach collection="communityCodeList" item="code" open="(" close=")" separator=",">
                    #{code}
                </foreach>
            </if>
            AND jg.is_deleted = 0
            <if test="userId!=null and roleType == '1'">
                and jgm.user_id= #{userId}
src/main/java/org/springblade/modules/grid/service/impl/GridmanServiceImpl.java
@@ -20,9 +20,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.logging.log4j.util.Strings;
import org.flowable.idm.engine.impl.persistence.entity.UserEntity;
import org.springblade.common.cache.SysCache;
import org.springblade.common.param.CommonParamSet;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
@@ -279,6 +277,10 @@
    public Object getGridStatistics(String code, String roleType) {
        Map<String, Object> objectObjectHashMap = new HashMap<>();
        List<String> communityCodeList = Func.toStrList(code);
        // 判断 communityCodeList
        if (communityCodeList != null && communityCodeList.size() == 0) {
            return objectObjectHashMap;
        }
        if (roleType.equals("2")) {
            Integer gridStatistics = baseMapper.getGridStatistics(communityCodeList, null, roleType);
            Integer companyStatistics = baseMapper.getCompanyStatistics(communityCodeList, null, roleType);
src/main/java/org/springblade/modules/house/mapper/HouseMapper.xml
@@ -407,10 +407,12 @@
        jczz_house jh
        LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_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 jh.is_deleted = 0
           <if test="buildingCode != null  and buildingCode != ''">
               and jda.building_code=#{buildingCode}
@@ -870,7 +872,7 @@
            LEFT JOIN jczz_police_affairs_grid jpag on jh.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
            LEFT JOIN jczz_user_house_label juhl ON juhl.house_code = jh.house_code and juhl.lable_type = 2
            where jda.doorplate_type = '户室牌'
            <if test="communityCodeList != null">
            <if test="communityCodeList !=null and communityCodeList.size()>0">
                and jda.nei_code in
                <foreach collection="communityCodeList" item="code" open="(" close=")" separator=",">
                    #{code}
src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
@@ -898,10 +898,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 jh.is_deleted = 0
            and jda.doorplate_type = '户室牌'
            <if test="userId != null and roleType == '1'">
src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java
@@ -743,7 +743,7 @@
        for (Long id : idList) {
            HouseholdEntity householdEntity = getById(id);
            // 如果是业主
            if (null!= householdEntity.getRelationship() && householdEntity.getRelationship() == 1) {
            if (null != householdEntity && null != householdEntity.getRelationship() && householdEntity.getRelationship() == 1) {
                // 查询对应的用户
                User user = userService.getById(householdEntity.getAssociatedUserId());
                // 判断是否还绑定其他的房屋,如果有,则不操作用户
src/main/java/org/springblade/modules/house/service/impl/UserHouseLabelServiceImpl.java
@@ -77,7 +77,7 @@
            return updateById(householdLabel);
        }
        // 插入
        return save(householdLabel);
        return saveOrUpdate(householdLabel);
    }
    @Override