liujie
2025-06-23 ba41b9351647a36bad13c0ab03d3fb602f5f4b27
2.0后台模块
17个文件已修改
1个文件已添加
1528 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/AnalyticStatisticsController.java 164 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/BannerController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/ComplaintRejectController.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/MgtComplaintController.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/ProblemTypeController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/dao/ComplaintMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/dao/ComplaintRejectMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/entity/Complaint.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/vo/ComplaintVO.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/scheduled/ComplaintTasks.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/IComplaintRejectService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/IComplaintService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/ComplaintRejectServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/ComplaintServiceImpl.java 199 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/utils/ExcelUtil.java 351 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/warpper/MgtComplaintQuery.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintMapper.xml 538 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintRejectMapper.xml 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/AnalyticStatisticsController.java
@@ -52,6 +52,9 @@
    @Resource
    private IComActService comActService;
    @Resource
    private ISystemUserService iSystemUserService;
    @PostMapping("/data")
@@ -59,28 +62,15 @@
    public R<AnalyticStatisticsDataVo> data(@Valid @RequestBody AnalyticStatisticsQuery query){
        SystemUserVo loginUserInfo = getLoginUserInfoWest();
        Integer id = loginUserInfo.getId();
        List<SystemUserLevel> listBySystemUsers = systemUserLevelService.getListBySystemUserId(id);
        if(listBySystemUsers.size()==0){
            // 没有权限
            return R.ok(new AnalyticStatisticsDataVo());
        }
        SystemUser systemUser = iSystemUserService.getById(id);
        Integer accountLevel = systemUser.getAccountLevel();
        LambdaQueryWrapper<Complaint> wrapper = new LambdaQueryWrapper<>();
        SystemUserLevel systemUserLevel = listBySystemUsers.stream().filter(e -> e.getLevel() == 1).findFirst().orElse(null);
        if(query.getCityCode()!=null){
            // 判断是否有市级权限
            if(systemUserLevel==null){
                throw new ServiceException("没有市级权限");
            }
            wrapper.eq(Complaint::getCityCode, query.getCityCode());
        }
        if(query.getDistrictCode()!=null){
            // 判断是否有区县权限
            List<SystemUserLevel> systemUserLevels2 = listBySystemUsers.stream().filter(e -> e.getLevel() == 2 && e.getDistrictsCode().equals(query.getDistrictCode().toString())).collect(Collectors.toList());
            // 没有市权限 也没有该区权限
            if(systemUserLevels2.size()==0 && systemUserLevel==null){
            if(accountLevel!=2){
                throw new ServiceException("没有该区县权限");
            }
            wrapper.eq(Complaint::getDistrictsCode, query.getDistrictCode());
            wrapper.eq(Complaint::getSuperiorId, query.getDistrictCode());
        }
        if(query.getStreetId()!=null){
            // 获取街道上一级查看是否有上级权限
@@ -88,14 +78,13 @@
            if(comStreet==null){
                throw new ServiceException("没有该街道权限");
            }
            List<SystemUserLevel> systemUserLevels2 = listBySystemUsers.stream().filter(e -> e.getLevel() == 2 && e.getDistrictsCode().equals(comStreet.getAreaCode().toString())).collect(Collectors.toList());
            // 判断是否有街道权限
            List<SystemUserLevel> systemUserLevels3 = listBySystemUsers.stream().filter(e -> e.getLevel() == 3 && e.getStreetId().equals(query.getStreetId().toString())).collect(Collectors.toList());
            // 没有市级 上级区县  本级街道权限
            if(systemUserLevels3.size()==0 && systemUserLevel==null && systemUserLevels2.size()==0){
            if(accountLevel==2 || (accountLevel==3 && systemUser.getDistrictsCode().equals(query.getDistrictCode().toString()))){
                wrapper.eq(Complaint::getSuperiorId, query.getStreetId());
            }else {
                throw new ServiceException("没有该街道权限");
            }
            wrapper.eq(Complaint::getStreetId, query.getStreetId());
        }
        if(query.getCommunityId()!=null){
@@ -103,65 +92,22 @@
            if (comAct == null) {
                throw new ServiceException("没有该社区权限");
            }
            // 查看是否有上级街道权限
            List<SystemUserLevel> systemUserLevels2 = listBySystemUsers.stream().filter(e -> e.getLevel() == 3 && e.getStreetId().equals(comAct.getStreetId().toString())).collect(Collectors.toList());
            // 查看是否有上级区权限
            List<SystemUserLevel> systemUserLevels3 = listBySystemUsers.stream().filter(e -> e.getLevel() == 2 && e.getDistrictsCode().equals(comAct.getAreaCode())).collect(Collectors.toList());
            // 查看是否有本级权限
            List<SystemUserLevel> systemUserLevels4 = listBySystemUsers.stream().filter(e -> e.getLevel() == 4 && e.getCommunityId().equals(query.getCommunityId())).collect(Collectors.toList());
            // 判断是否有上面的4个权限
            if(systemUserLevels4.size()==0 && systemUserLevels3.size()==0 && systemUserLevels2.size()==0 && systemUserLevel==null){
            if(accountLevel==2 ||  (accountLevel==3 && systemUser.getDistrictsCode().equals(comAct.getStreetId().toString()) || accountLevel==4 && systemUser.getCommunityId().equals(comAct.getCommunityId()))){
                wrapper.eq(Complaint::getSuperiorId, query.getCommunityId());
            }else {
                throw new ServiceException("没有该社区权限");
            }
            wrapper.eq(Complaint::getCommunityId, query.getCommunityId());
        }
        // 都为空 查他有的
        if(query.getCityCode()==null && query.getDistrictCode()==null && query.getStreetId()==null && query.getCommunityId()==null){
            // 看是否直接是市级账号
            if(systemUserLevel==null){
                List<String> districtsCodes=new ArrayList<>();
                List<String> streetIds=new ArrayList<>();
                List<Long> communityIds=new ArrayList<>();
                // 不是市级 查看是否是区县账号
                List<SystemUserLevel> systemUserLevels2 = listBySystemUsers.stream().filter(e -> e.getLevel() == 2).collect(Collectors.toList());
                if(!systemUserLevels2.isEmpty()){
                    // 区县账号 找出code
                    districtsCodes = systemUserLevels2.stream().map(SystemUserLevel::getDistrictsCode).collect(Collectors.toList());
                }else {
                    districtsCodes.add("-1");
                }
                List<SystemUserLevel> systemUserLevels3 = listBySystemUsers.stream().filter(e -> e.getLevel() == 3).collect(Collectors.toList());
                if(!systemUserLevels3.isEmpty()){
                    // 街道账号 找出id 且不在上面的区县下的街道
                    List<String> finalDistrictsCodes1 = districtsCodes;
                    streetIds = systemUserLevels3.stream().filter(e -> !finalDistrictsCodes1.contains(e.getDistrictsCode())).map(SystemUserLevel::getStreetId).collect(Collectors.toList());
                    if(streetIds.isEmpty()){
                        streetIds.add("-1");
                    }
                }else {
                    streetIds.add("-1");
                }
                List<SystemUserLevel> systemUserLevels4 = listBySystemUsers.stream().filter(e -> e.getLevel() == 4).collect(Collectors.toList());
                if(!systemUserLevels4.isEmpty()){
                    // community账号 找出id 且不在上面的街道下的社区
                    List<String> finalStreetIds1 = streetIds;
                    List<String> finalDistrictsCodes2 = districtsCodes;
                    communityIds = systemUserLevels4.stream().filter(e -> !finalStreetIds1.contains(e.getStreetId()) && !finalDistrictsCodes2.contains(e.getDistrictsCode())).map(SystemUserLevel::getCommunityId).collect(Collectors.toList());
                }else {
                    communityIds.add(-1L);
                }
                List<String> finalDistrictsCodes = districtsCodes;
                List<String> finalStreetIds = streetIds;
                List<Long> finalCommunityIds = communityIds;
                wrapper.and(wrapper1 -> {
                    wrapper1.in(Complaint::getDistrictsCode, finalDistrictsCodes).or().in(Complaint::getStreetId, finalStreetIds).or().in(Complaint::getCommunityId, finalCommunityIds);
                });
            if(systemUser.getSystemRoleId()==1){
                wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel());
            }else {
                wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel())
                        .eq(Complaint::getAssignPersonId,systemUser.getOneDepartmentId());
            }
        }
@@ -196,70 +142,34 @@
    public R<AnalyticStatisticsRegionVo> getRegion(){
        SystemUserVo loginUserInfo = getLoginUserInfoWest();
        Integer id = loginUserInfo.getId();
        List<SystemUserLevel> listBySystemUsers = systemUserLevelService.getListBySystemUserId(id);
        // 如果有市级权限  展示所有
        SystemUserLevel systemUserLevel = listBySystemUsers.stream().filter(e -> e.getLevel() == 1).findFirst().orElse(null);
        SystemUser systemUser = iSystemUserService.getById(id);
        // 如果有区权限  展示所有
        AnalyticStatisticsRegionVo analyticStatisticsRegionVo = new AnalyticStatisticsRegionVo();
        if(systemUserLevel!=null){
        if(systemUser.getAccountLevel()==2){
            // 查询所有的县 街道 社区
            List<BcRegion> list = bcRegionService.list(new LambdaQueryWrapper<BcRegion>().eq(BcRegion::getParentId, 510400));
            List<ComStreet> list1 = comStreetService.list(new LambdaQueryWrapper<ComStreet>().eq(ComStreet::getCityCode, 510400));
            List<ComAct> list2 = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getState,0).eq(ComAct::getCityCode, 510400));
            analyticStatisticsRegionVo.setBcRegions(list);
            List<ComStreet> list1 = comStreetService.list(new LambdaQueryWrapper<ComStreet>().eq(ComStreet::getAppId, "wx0cef797390444b75"));
            List<ComAct> list2 = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getState,0).eq(ComAct::getAppId, "wx0cef797390444b75"));
            analyticStatisticsRegionVo.setComStreets(list1);
            analyticStatisticsRegionVo.setComActs(list2);
            return R.ok(analyticStatisticsRegionVo);
        }
        // 有区县级权限
        List<SystemUserLevel> systemUserLevels = listBySystemUsers.stream().filter(e -> e.getLevel() == 2).collect(Collectors.toList());
        // 拥有的区县code
        List<String> collect = systemUserLevels.stream().map(SystemUserLevel::getDistrictsCode).collect(Collectors.toList());
        if(collect.size()==0){
            collect.add("-1");
        }
        // 找出这个区县的
        List<BcRegion> list = bcRegionService.list(new LambdaQueryWrapper<BcRegion>().eq(BcRegion::getParentId, 510400).in(BcRegion::getRegionCode, collect));
        // 区县街道
        List<ComStreet> list1 = comStreetService.list(new LambdaQueryWrapper<ComStreet>().in(ComStreet::getAreaCode, collect));
        // 区县社区
        List<ComAct> list2 = comActService.list(new LambdaQueryWrapper<ComAct>().in(ComAct::getAreaCode, collect).eq(ComAct::getState,0));
        // 有街道权限 排除上个查询出来的
        List<SystemUserLevel> systemUserLevels1 = listBySystemUsers.stream().filter(e -> e.getLevel() == 3 && !collect.contains(e.getDistrictsCode())).collect(Collectors.toList());
        List<String> collect1 = systemUserLevels1.stream().map(SystemUserLevel::getStreetId).collect(Collectors.toList());
        if(collect1.size()==0){
            collect1.add("-1");
        if(systemUser.getAccountLevel()==3){
            // 查询所有的县 街道 社区
            List<ComStreet> list1 = comStreetService.list(new LambdaQueryWrapper<ComStreet>().eq(ComStreet::getStreetId, systemUser.getStreetId()).eq(ComStreet::getAppId, "wx0cef797390444b75"));
            List<ComAct> list2 = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, systemUser.getStreetId()).eq(ComAct::getState,0).eq(ComAct::getAppId, "wx0cef797390444b75"));
            analyticStatisticsRegionVo.setComStreets(list1);
            analyticStatisticsRegionVo.setComActs(list2);
            return R.ok(analyticStatisticsRegionVo);
        }
        // 区县街道
        List<ComStreet> list3 = comStreetService.list(new LambdaQueryWrapper<ComStreet>().in(ComStreet::getStreetId, collect1));
        // 区县社区
        List<ComAct> list4 = comActService.list(new LambdaQueryWrapper<ComAct>().in(ComAct::getStreetId, collect1).eq(ComAct::getState,0));
        list1.addAll(list3);
        list2.addAll(list4);
        // 有社区权限 排除上个查询出来的
        List<SystemUserLevel> systemUserLevels2 = listBySystemUsers.stream().filter(e -> e.getLevel() == 4 && !collect.contains(e.getDistrictsCode()) && !collect1.contains(e.getStreetId())).collect(Collectors.toList());
        List<Long> collect2 = systemUserLevels2.stream().map(SystemUserLevel::getCommunityId).collect(Collectors.toList());
        if(collect2.size()==0){
            collect2.add(-1l);
        if(systemUser.getAccountLevel()==4){
            // 查询所有的县 街道 社区
            List<ComAct> list2 = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getCommunityId, systemUser.getCommunityId()).eq(ComAct::getState,0).eq(ComAct::getAppId, "wx0cef797390444b75"));
            analyticStatisticsRegionVo.setComActs(list2);
            return R.ok(analyticStatisticsRegionVo);
        }
        // 区县社区
        List<ComAct> list6 = comActService.list(new LambdaQueryWrapper<ComAct>().in(ComAct::getCommunityId, collect2).eq(ComAct::getState,0));
        list2.addAll(list6);
        analyticStatisticsRegionVo.setBcRegions(list);
        analyticStatisticsRegionVo.setComStreets(list1);
        analyticStatisticsRegionVo.setComActs(list2);
        return R.ok(analyticStatisticsRegionVo);
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/BannerController.java
@@ -41,7 +41,7 @@
    public R<IPage<Banner>> list(String name, Integer pageNum, Integer pageSize){
        Integer id = this.getLoginUserInfoWest().getId();
        SystemUser systemUser = systemUserService.getById(id);
        if(systemUser.getAccountLevel() != 1){
        if(systemUser.getAccountLevel() != 2){
            return R.ok();
        }
        IPage<Banner> list = bannerService.list(name, pageNum, pageSize);
@@ -55,7 +55,7 @@
    public R<Banner> add(@RequestBody Banner banner){
        Integer id = this.getLoginUserInfoWest().getId();
        SystemUser systemUser = systemUserService.getById(id);
        if(systemUser.getAccountLevel() != 1){
        if(systemUser.getAccountLevel() != 2){
            return R.fail("添加失败,权限不足。");
        }
        banner.setDel(0);
@@ -71,7 +71,7 @@
    public R<Banner> edit(@RequestBody Banner banner){
        Integer id = this.getLoginUserInfoWest().getId();
        SystemUser systemUser = systemUserService.getById(id);
        if(systemUser.getAccountLevel() != 1){
        if(systemUser.getAccountLevel() != 2){
            return R.fail("编辑失败,权限不足。");
        }
        bannerService.updateById(banner);
@@ -85,7 +85,7 @@
    public R delete(@PathVariable("id") Integer id){
        Integer id1 = this.getLoginUserInfoWest().getId();
        SystemUser systemUser = systemUserService.getById(id1);
        if(systemUser.getAccountLevel() != 1){
        if(systemUser.getAccountLevel() != 2){
            return R.fail("删除失败,权限不足。");
        }
        String name = bannerService.getById(id).getName();
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/ComplaintRejectController.java
@@ -1,15 +1,19 @@
package com.panzhihua.westcommittee.api;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.west.SystemUserVo;
import com.panzhihua.westcommittee.model.entity.ComAct;
import com.panzhihua.westcommittee.model.entity.SystemUserLevel;
import com.panzhihua.westcommittee.model.query.ComplaintRejectQuery;
import com.panzhihua.westcommittee.model.vo.ComplaintRejectVo;
import com.panzhihua.westcommittee.service.IComActService;
import com.panzhihua.westcommittee.service.IComplaintRejectService;
import com.panzhihua.westcommittee.service.ISystemUserLevelService;
import com.panzhihua.westcommittee.service.ISystemUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
@@ -36,58 +40,40 @@
    @Resource
    private IComplaintRejectService complaintRejectService;
    @Resource
    private ISystemUserLevelService systemUserLevelService;
    private IComActService comActService;
    @GetMapping("/list")
    @ApiOperation(value = "获取问题驳回统计列表", tags = {"西区纪委后台-问题驳回统计"})
    public R<IPage<ComplaintRejectVo>> list(ComplaintRejectQuery query){
        SystemUserVo loginUserInfo = getLoginUserInfoWest();
        Integer id = loginUserInfo.getId();
        List<SystemUserLevel> listBySystemUsers = systemUserLevelService.getListBySystemUserId(id);
        SystemUserLevel systemUserLevel = listBySystemUsers.stream().filter(e -> e.getLevel() == 1).findFirst().orElse(null);
        List<String> districtsCodes=new ArrayList<>();
        List<String> streetIds=new ArrayList<>();
        List<Long> communityIds=new ArrayList<>();
        // 看是否直接是市级账号
        if(systemUserLevel==null){
            // 不是市级 查看是否是区县账号
            List<SystemUserLevel> systemUserLevels2 = listBySystemUsers.stream().filter(e -> e.getLevel() == 2).collect(Collectors.toList());
            if(!systemUserLevels2.isEmpty()){
                // 区县账号 找出code
                districtsCodes = systemUserLevels2.stream().map(SystemUserLevel::getDistrictsCode).collect(Collectors.toList());
            }else {
                districtsCodes.add("-1");
            }
            List<SystemUserLevel> systemUserLevels3 = listBySystemUsers.stream().filter(e -> e.getLevel() == 3).collect(Collectors.toList());
            if(!systemUserLevels3.isEmpty()){
                // 街道账号 找出id 且不在上面的区县下的街道
                List<String> finalDistrictsCodes1 = districtsCodes;
                streetIds = systemUserLevels3.stream().filter(e -> !finalDistrictsCodes1.contains(e.getDistrictsCode())).map(SystemUserLevel::getStreetId).collect(Collectors.toList());
                if(streetIds.isEmpty()){
        if(loginUserInfo.getAccountLevel()!=2){
            if(loginUserInfo.getAccountLevel()==3){
                if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){
                    streetIds.add("-1");
                    List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, loginUserInfo.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList());
                    communityIds.addAll(ids);
                }
            }else {
                streetIds.add("-1");
            }
            if(loginUserInfo.getAccountLevel()==4){
                if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){
                    streetIds.add("-1");
                    communityIds.add(loginUserInfo.getCommunityId());
                }
            }
            List<SystemUserLevel> systemUserLevels4 = listBySystemUsers.stream().filter(e -> e.getLevel() == 4).collect(Collectors.toList());
            if(!systemUserLevels4.isEmpty()){
                // community账号 找出id 且不在上面的街道下的社区
                List<String> finalStreetIds1 = streetIds;
                List<String> finalDistrictsCodes2 = districtsCodes;
                communityIds = systemUserLevels4.stream().filter(e -> !finalStreetIds1.contains(e.getStreetId()) && !finalDistrictsCodes2.contains(e.getDistrictsCode())).map(SystemUserLevel::getCommunityId).collect(Collectors.toList());
            }else {
                communityIds.add(-1L);
            }
            List<String> finalDistrictsCodes = districtsCodes;
            List<String> finalStreetIds = streetIds;
            List<Long> finalCommunityIds = communityIds;
            IPage<ComplaintRejectVo> list  = complaintRejectService.getComplaintRejectListOther(query,finalDistrictsCodes,finalStreetIds,finalCommunityIds);
            IPage<ComplaintRejectVo> list  = complaintRejectService.getComplaintRejectListOther(query,finalDistrictsCodes,finalStreetIds,finalCommunityIds,loginUserInfo);
            return R.ok(list);
        }else {
            IPage<ComplaintRejectVo> list  = complaintRejectService.getComplaintRejectList(query);
            IPage<ComplaintRejectVo> list  = complaintRejectService.getComplaintRejectList(query,loginUserInfo);
            return R.ok(list);
        }
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/MgtComplaintController.java
@@ -1,13 +1,23 @@
package com.panzhihua.westcommittee.api;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.west.SystemUserVo;
import com.panzhihua.westcommittee.annotation.DistributedLock;
import com.panzhihua.westcommittee.annotation.SysLog;
import com.panzhihua.westcommittee.model.dto.AssignComplainDto;
import com.panzhihua.westcommittee.model.dto.ComplaintProcessUpdateDto;
import com.panzhihua.westcommittee.model.entity.Complaint;
import com.panzhihua.westcommittee.model.entity.Department;
import com.panzhihua.westcommittee.model.entity.SystemUser;
import com.panzhihua.westcommittee.model.vo.ComplaintVO;
import com.panzhihua.westcommittee.model.vo.DispatchVO;
import com.panzhihua.westcommittee.service.IComplaintService;
import com.panzhihua.westcommittee.service.IDepartmentService;
import com.panzhihua.westcommittee.service.ISystemUserService;
import com.panzhihua.westcommittee.warpper.MgtComplaintQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -18,6 +28,8 @@
import javax.validation.Valid;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
 * @author mitao
@@ -29,6 +41,48 @@
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
public class MgtComplaintController extends BaseController {
    private final IComplaintService complaintService;
    private final ISystemUserService systemUserService;
    private final IDepartmentService departmentService;
    @PostMapping("/save")
    @ApiOperation(value = "录入诉求")
    @DistributedLock(lockName = "complaint_serial_number_lock")
    public R<?> save(@Valid @RequestBody Complaint complaint) {
        complaintService.saveComplaintAdmin(complaint, getLoginUserInfoWest());
        return R.ok();
    }
    @GetMapping("/getAllocationList")
    @ApiOperation(value = "获取分配派单位列表")
    public R<List<DispatchVO>> getAllocationList() {
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        SystemUser systemUser = systemUserService.getById(loginUserInfoWest.getId());
        if(systemUser.getSystemRoleId()!=1){
            return R.fail("非管理员,无权限");
        }
        List<DispatchVO> dispatchVOList = new ArrayList<>();
        Integer oneDepartmentId = systemUser.getOneDepartmentId();
        Department byId = departmentService.getById(oneDepartmentId);
        List<Department> list1 = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getTier, byId.getTier()));
        for (Department department : list1) {
            DispatchVO dispatchVO = new DispatchVO();
            dispatchVO.setId(department.getId().toString());
            dispatchVO.setName(department.getName());
            dispatchVOList.add(dispatchVO);
        }
        return R.ok(dispatchVOList);
    }
    @PostMapping("/assignComplain")
    @ApiOperation(value = "分配诉求")
    public R<?> assignComplain(@Valid@RequestBody AssignComplainDto dto) {
        complaintService.assignComplain(getLoginUserInfo(),dto.getComplainId(),dto.getDeptId(),dto.getRemark());
        return R.ok();
    }
    @ApiOperation("诉求列表")
    @PostMapping("/page")
@@ -36,6 +90,10 @@
        SystemUserVo loginUserInfo = getLoginUserInfoWest();
        return R.ok(complaintService.pageList(query,loginUserInfo));
    }
    @ApiOperation("诉求详情")
    @GetMapping("/detail/{id}")
    public R<ComplaintVO> detail(@ApiParam(name = "id", value = "诉求id", required = true) @PathVariable("id") Long id) {
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/ProblemTypeController.java
@@ -45,7 +45,7 @@
    public R<IPage<ProblemType>> list(String name, Integer pageNum, Integer pageSize){
        Integer id = this.getLoginUserInfoWest().getId();
        SystemUser systemUser = systemUserService.getById(id);
        if(systemUser.getAccountLevel() != 1){
        if(systemUser.getAccountLevel() != 2){
            return R.ok();
        }
        IPage<ProblemType> list = problemTypeService.list(name, pageNum, pageSize);
@@ -59,7 +59,7 @@
    public R add(@RequestBody ProblemType problemType){
        Integer id = this.getLoginUserInfoWest().getId();
        SystemUser systemUser = systemUserService.getById(id);
        if(systemUser.getAccountLevel() != 1){
        if(systemUser.getAccountLevel() != 2){
            return R.fail("添加失败");
        }
        long count = problemTypeService.count(new LambdaQueryWrapper<ProblemType>().eq(ProblemType::getName, problemType.getName()).eq(ProblemType::getDel, 0));
@@ -79,7 +79,7 @@
    public R edit(@RequestBody ProblemType problemType){
        Integer id = this.getLoginUserInfoWest().getId();
        SystemUser systemUser = systemUserService.getById(id);
        if(systemUser.getAccountLevel() != 1){
        if(systemUser.getAccountLevel() != 2){
            return R.fail("编辑失败");
        }
        long count = problemTypeService.count(new LambdaQueryWrapper<ProblemType>().eq(ProblemType::getName, problemType.getName()).eq(ProblemType::getDel, 0).ne(ProblemType::getId, problemType.getId()));
@@ -97,7 +97,7 @@
    public R delete(@PathVariable("id") Integer id){
        Integer userid = this.getLoginUserInfoWest().getId();
        SystemUser systemUser = systemUserService.getById(userid);
        if(systemUser.getAccountLevel() != 1){
        if(systemUser.getAccountLevel() != 2){
            return R.fail("删除失败");
        }
        String name = problemTypeService.getById(id).getName();
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/dao/ComplaintMapper.java
@@ -136,4 +136,11 @@
    String getHouseAddressFromId(@Param("houseId") String houseId);
    Page<ComplaintVO> pageList1(Page<ComplaintVO> page, @Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo);
    Page<ComplaintVO> pageList2(@Param("objectPage") Page<Object> objectPage, @Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo, @Param("ids") List<Long> communityIds);
    Page<ComplaintVO> pageList3(@Param("objectPage") Page<Object> objectPage, @Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo);
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/dao/ComplaintRejectMapper.java
@@ -20,8 +20,12 @@
 */
public interface ComplaintRejectMapper extends BaseMapper<ComplaintReject> {
    IPage<ComplaintRejectVo> getComplaintRejectList(@Param("page") Page<ComplaintRejectVo> page, @Param("applyStartTime") String applyStartTime, @Param("applyEndTime") String applyEndTime, @Param("examineStartTime") String examineStartTime, @Param("examineEndTime") String examineEndTime, @Param("query") ComplaintRejectQuery query);
    IPage<ComplaintRejectVo> getComplaintRejectList(@Param("page") Page<ComplaintRejectVo> page, @Param("applyStartTime") String applyStartTime, @Param("applyEndTime") String applyEndTime, @Param("examineStartTime") String examineStartTime, @Param("examineEndTime") String examineEndTime, @Param("query") ComplaintRejectQuery query, @Param("roleId") Integer roleId);
    IPage<ComplaintRejectVo> getComplaintRejectListOther(@Param("page") Page<ComplaintRejectVo> page, @Param("applyStartTime") String applyStartTime, @Param("applyEndTime") String applyEndTime, @Param("examineStartTime") String examineStartTime, @Param("examineEndTime") String examineEndTime, @Param("query") ComplaintRejectQuery query, @Param("finalDistrictsCodes") List<String> finalDistrictsCodes, @Param("finalStreetIds") List<String> finalStreetIds, @Param("finalCommunityIds") List<Long> finalCommunityIds);
    IPage<ComplaintRejectVo> getComplaintRejectListOther(@Param("page") Page<ComplaintRejectVo> page, @Param("applyStartTime") String applyStartTime, @Param("applyEndTime") String applyEndTime, @Param("examineStartTime") String examineStartTime, @Param("examineEndTime") String examineEndTime, @Param("query") ComplaintRejectQuery query, @Param("finalDistrictsCodes") List<String> finalDistrictsCodes, @Param("finalStreetIds") List<String> finalStreetIds, @Param("finalCommunityIds") List<Long> finalCommunityIds, @Param("roleId") Integer roleId);
    IPage<ComplaintRejectVo> getComplaintRejectList1(@Param("page") Page<ComplaintRejectVo> page, @Param("applyStartTime") String applyStartTime, @Param("applyEndTime") String applyEndTime, @Param("examineStartTime") String examineStartTime, @Param("examineEndTime") String examineEndTime, @Param("query") ComplaintRejectQuery query, @Param("oneDepartmentId") Integer oneDepartmentId);
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/entity/Complaint.java
@@ -50,17 +50,17 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date time;
    @ApiModelProperty(value = "问题类型")
    @ApiModelProperty(value = "问题类型(事件类型)")
    @TableField("problem_type")
    @NotBlank(message = "问题类型不能为空")
    private String problemType;
    @ApiModelProperty(value = "群众姓名")
    @ApiModelProperty(value = "群众姓名(诉求人)")
    @TableField("name")
    @NotBlank(message = "群众姓名不能为空")
    private String name;
    @ApiModelProperty(value = "联系电话")
    @ApiModelProperty(value = "联系电话(诉求人类型电话)")
    @TableField("contact_number")
    @NotBlank(message = "联系电话不能为空")
    private String contactNumber;
@@ -70,7 +70,7 @@
    @NotBlank(message = "地点不能为空")
    private String location;
    @ApiModelProperty(value = "详细地址描述")
    @ApiModelProperty(value = "详细地址描述(事件地点)")
    @TableField("detailed_address")
    @NotBlank(message = "详细地址不能为空")
    private String detailedAddress;
@@ -136,7 +136,7 @@
    @TableField("create_by")
    private Long createBy;
    @ApiModelProperty(value = "创建时间")
    @ApiModelProperty(value = "创建时间((report_type 2-4 显示 接件时间))")
    @TableField("create_time")
    @JsonFormat (pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
@@ -199,11 +199,11 @@
    @ApiModelProperty(value = "纬度")
    private BigDecimal latitude;
    @ApiModelProperty(value = "录入人")
    @ApiModelProperty(value = "录入人(report_type 2-4 显示 接件人)")
    @TableField("report_user_name")
    private String reportUserName;
    @ApiModelProperty(value = "录入人联系方式")
    @ApiModelProperty(value = "录入人联系方式(report_type 2-4 显示 接件人电话)")
    @TableField("report_user_phone")
    private String reportUserPhone;
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/vo/ComplaintVO.java
@@ -31,13 +31,13 @@
    private Long auditCreateBy;
    @ApiModelProperty("上报人层级 1=市级账号,2=区县账号,3=街道账号,4=社区账号 5=党员账号")
    @ApiModelProperty("上报人层级 1=市级账号,2=区县账号,3=街道账号,4=社区账号 ")
    private Integer reporterLevel;
    @ApiModelProperty(value = "上报人联系方式")
    private String reporterPhone;
    @ApiModelProperty(value = "所属部门")
    @ApiModelProperty(value = "所属部门 (处理人)")
    private String departmentName;
    @ApiModelProperty(value = "上报提交时间")
@@ -106,6 +106,11 @@
    @ApiModelProperty(value = "提醒倒计时")
    private Double remindTime;
    @ApiModelProperty(value = "事件上报情况")
    private String reportStr;
    @ApiModelProperty(value = "处理人")
    private String deptName;
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/scheduled/ComplaintTasks.java
@@ -104,6 +104,11 @@
                config.getCommunityHandlingTime()
              );
        if(!complaintTimeoutList.isEmpty()) {
            // 后续当前不在发送
            complaintService.update(new LambdaUpdateWrapper<Complaint>().in(Complaint::getId, complaintTimeoutList.stream().map(ComplaintTimeout::getComplaintId).collect(Collectors.toList())).set(Complaint::getNowLevelSms, 1));
        }
        Map<Integer, List<ComplaintTimeout>> timeOutMap = complaintTimeoutList.stream()
                .collect(Collectors.groupingBy(ComplaintTimeout::getNowLevel));
@@ -230,8 +235,6 @@
        if (!CollectionUtils.isEmpty(communityTimeOutList)){
            List<ComplaintTimeout> collect = communityTimeOutList.stream().filter(e -> e.getAssignStatus() == 0).collect(Collectors.toList());
            List<SystemUser> communityUserList = systemUserService.list(new LambdaQueryWrapper<SystemUser>()
                    .eq(SystemUser::getAccountLevel, 4)
                    .in(SystemUser::getSystemRoleId,1,2)
@@ -283,10 +286,7 @@
        }
        if(!complaintTimeoutList.isEmpty()) {
            // 短信发送完成 当前不在发送
            complaintService.update(new LambdaUpdateWrapper<Complaint>().in(Complaint::getId, complaintTimeoutList.stream().map(ComplaintTimeout::getComplaintId).collect(Collectors.toList())).set(Complaint::getNowLevelSms, 1));
        }
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/IComplaintRejectService.java
@@ -1,8 +1,10 @@
package com.panzhihua.westcommittee.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.panzhihua.common.model.vos.west.SystemUserVo;
import com.panzhihua.westcommittee.model.entity.ComplaintReject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.westcommittee.model.entity.SystemUser;
import com.panzhihua.westcommittee.model.query.ComplaintRejectQuery;
import com.panzhihua.westcommittee.model.vo.ComplaintRejectVo;
@@ -24,9 +26,9 @@
     * @param query
     * @return
     */
    IPage<ComplaintRejectVo> getComplaintRejectList(ComplaintRejectQuery query);
    IPage<ComplaintRejectVo> getComplaintRejectList(ComplaintRejectQuery query, SystemUserVo loginUserInfo);
    IPage<ComplaintRejectVo> getComplaintRejectListOther(ComplaintRejectQuery query, List<String> finalDistrictsCodes, List<String> finalStreetIds, List<Long> finalCommunityIds);
    IPage<ComplaintRejectVo> getComplaintRejectListOther(ComplaintRejectQuery query, List<String> finalDistrictsCodes, List<String> finalStreetIds, List<Long> finalCommunityIds, SystemUserVo loginUserInfo);
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/IComplaintService.java
@@ -258,4 +258,6 @@
    Page<String> getHouseAddress(GetHouseAddressQuery query);
    void saveComplaintAdmin(Complaint complaint, SystemUserVo loginUserInfoWest);
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/ComplaintRejectServiceImpl.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.vos.west.SystemUserVo;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.westcommittee.dao.ComplaintRejectMapper;
import com.panzhihua.westcommittee.model.entity.ComplaintReject;
@@ -25,7 +26,7 @@
public class ComplaintRejectServiceImpl extends ServiceImpl<ComplaintRejectMapper, ComplaintReject> implements IComplaintRejectService {
    @Override
    public IPage<ComplaintRejectVo> getComplaintRejectList(ComplaintRejectQuery query) {
    public IPage<ComplaintRejectVo> getComplaintRejectList(ComplaintRejectQuery query, SystemUserVo systemUserVo) {
        Page<ComplaintRejectVo> page = new Page<>(query.getPageNum(), query.getPageSize());
        String applyStartTime=null;
        String applyEndTime=null;
@@ -41,11 +42,15 @@
            examineStartTime=split[0]+" 00:00:00";
            examineEndTime=split[1]+" 23:59:59";
        }
        return this.baseMapper.getComplaintRejectList(page,applyStartTime,applyEndTime,examineStartTime,examineEndTime,query);
        if(systemUserVo.getSystemRoleId()<2){
            return this.baseMapper.getComplaintRejectList(page,applyStartTime,applyEndTime,examineStartTime,examineEndTime,query,systemUserVo.getSystemRoleId());
        }else {
            return this.baseMapper.getComplaintRejectList1(page,applyStartTime,applyEndTime,examineStartTime,examineEndTime,query,systemUserVo.getOneDepartmentId());
        }
    }
    @Override
    public IPage<ComplaintRejectVo> getComplaintRejectListOther(ComplaintRejectQuery query, List<String> finalDistrictsCodes, List<String> finalStreetIds, List<Long> finalCommunityIds) {
    public IPage<ComplaintRejectVo> getComplaintRejectListOther(ComplaintRejectQuery query, List<String> finalDistrictsCodes, List<String> finalStreetIds, List<Long> finalCommunityIds, SystemUserVo loginUserInfo) {
        Page<ComplaintRejectVo> page = new Page<>(query.getPageNum(), query.getPageSize());
        String applyStartTime=null;
        String applyEndTime=null;
@@ -61,6 +66,6 @@
            examineStartTime=split[0]+" 00:00:00";
            examineEndTime=split[1]+" 23:59:59";
        }
        return this.baseMapper.getComplaintRejectListOther(page,applyStartTime,applyEndTime,examineStartTime,examineEndTime,query,finalDistrictsCodes,finalStreetIds,finalCommunityIds);
        return this.baseMapper.getComplaintRejectListOther(page,applyStartTime,applyEndTime,examineStartTime,examineEndTime,query,finalDistrictsCodes,finalStreetIds,finalCommunityIds,loginUserInfo.getSystemRoleId());
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/ComplaintServiceImpl.java
@@ -172,7 +172,7 @@
        } else {
            PartyMember partyMember = partyMemberService.getPartyMemberByPhone(loginUserInfoVO.getPhone());
            complaint.setCityCode(510400);
            if(partyMember!=null){
            if (partyMember != null) {
                //党员
                complaint.setDistrictsCode(Integer.valueOf(partyMember.getDistrictsCode()));
                complaint.setStreetId(Long.valueOf(partyMember.getStreetId()));
@@ -181,7 +181,7 @@
                complaint.setReportUserName(partyMember.getName());
                complaint.setReportUserPhone(partyMember.getPhone());
                complaint.setSuperiorId(partyMember.getCommunityId());
            }else {
            } else {
                complaint.setDistrictsCode(Integer.valueOf(loginUserInfoVO.getAreaCode()));
                complaint.setStreetId(loginUserInfoVO.getStreetId());
                complaint.setCommunityId(loginUserInfoVO.getCommunityId());
@@ -289,9 +289,9 @@
            systemUser = null;
            //党员
            PartyMember partyMember = partyMemberService.getPartyMemberByPhone(loginUserInfoVO.getPhone());
            if(partyMember!=null){
            if (partyMember != null) {
                targetId = partyMember.getCommunityId();
            }else {
            } else {
                targetId = loginUserInfoVO.getCommunityId();
            }
        }
@@ -313,7 +313,7 @@
            // 街道 1
            if (systemUser.getSystemRoleId() == 1) {
                // 获取这个街道所管的社区id
                List<Long> communityIds = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId,systemUser.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList());
                List<Long> communityIds = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, systemUser.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList());
                // 是管理员 可以看到下派来的  也可以看到上派待审核的
                page = baseMapper.selectComplaintPage5(page, query, systemUser.getStreetId(), communityIds);
            } else {
@@ -339,39 +339,39 @@
            // 处理页面颜色展示和倒计时
            Date nowLevelTime = record.getNowLevelTime();
            if(record.getNowLevel()==2){
            if (record.getNowLevel() == 2) {
                Integer HandlingTime = config.getDistrictHandlingTime();
                Integer DeadlineReminder = config.getDistrictDeadlineReminder();
                // 判断是超时 还是  临期
                if (nowLevelTime.getTime()  + HandlingTime * 24 * 60 * 60 * 1000< date.getTime()) {
                if (nowLevelTime.getTime() + HandlingTime * 24 * 60 * 60 * 1000 < date.getTime()) {
                    record.setRemindStatus(2);
                }else if (nowLevelTime.getTime() + DeadlineReminder * 24 * 60 * 60 * 1000 < date.getTime()) {
                } else if (nowLevelTime.getTime() + DeadlineReminder * 24 * 60 * 60 * 1000 < date.getTime()) {
                    record.setRemindStatus(1);
                }
                long l = nowLevelTime.getTime() + HandlingTime * 24 * 60 * 60 * 1000 - date.getTime();
                double days = (double) l / (24 * 60 * 60 * 1000); // 毫秒转天数
                BigDecimal result = new BigDecimal(days).setScale(1, RoundingMode.HALF_UP); // 保留1位小数
                record.setRemindTime(result.doubleValue());
            }else if(record.getNowLevel()==3){
            } else if (record.getNowLevel() == 3) {
                Integer HandlingTime = config.getStreetHandlingTime();
                Integer DeadlineReminder = config.getStreetDeadlineReminder();
                // 判断是超时 还是  临期
                if (nowLevelTime.getTime()  + HandlingTime * 24 * 60 * 60 * 1000< date.getTime()) {
                if (nowLevelTime.getTime() + HandlingTime * 24 * 60 * 60 * 1000 < date.getTime()) {
                    record.setRemindStatus(2);
                }else if (nowLevelTime.getTime() + DeadlineReminder * 24 * 60 * 60 * 1000 < date.getTime()) {
                } else if (nowLevelTime.getTime() + DeadlineReminder * 24 * 60 * 60 * 1000 < date.getTime()) {
                    record.setRemindStatus(1);
                }
                long l = nowLevelTime.getTime() + HandlingTime * 24 * 60 * 60 * 1000 - date.getTime();
                double days = (double) l / (24 * 60 * 60 * 1000); // 毫秒转天数
                BigDecimal result = new BigDecimal(days).setScale(1, RoundingMode.HALF_UP); // 保留1位小数
                record.setRemindTime(result.doubleValue());
            } else if(record.getNowLevel()==4){
            } else if (record.getNowLevel() == 4) {
                Integer HandlingTime = config.getCommunityHandlingTime();
                Integer DeadlineReminder = config.getCommunityDeadlineReminder();
                // 判断是超时 还是  临期
                if (nowLevelTime.getTime()  + HandlingTime * 24 * 60 * 60 * 1000< date.getTime()) {
                if (nowLevelTime.getTime() + HandlingTime * 24 * 60 * 60 * 1000 < date.getTime()) {
                    record.setRemindStatus(2);
                }else if (nowLevelTime.getTime() + DeadlineReminder * 24 * 60 * 60 * 1000 < date.getTime()) {
                } else if (nowLevelTime.getTime() + DeadlineReminder * 24 * 60 * 60 * 1000 < date.getTime()) {
                    record.setRemindStatus(1);
                }
                long l = nowLevelTime.getTime() + HandlingTime * 24 * 60 * 60 * 1000 - date.getTime();
@@ -379,9 +379,6 @@
                BigDecimal result = new BigDecimal(days).setScale(1, RoundingMode.HALF_UP); // 保留1位小数
                record.setRemindTime(result.doubleValue());
            }
            int count = complaintCommentService.count(new LambdaQueryWrapper<ComplaintComment>().eq(ComplaintComment::getComplaintId, record.getId()));
@@ -677,10 +674,10 @@
        } else {
            //党员
            PartyMember partyMember = partyMemberService.getPartyMemberByPhone(loginUserInfoVO.getPhone());
            if(partyMember!=null){
            if (partyMember != null) {
                targetId = partyMember.getId().toString();
            }else {
                targetId =loginUserInfoVO.getUserId().toString();
            } else {
                targetId = loginUserInfoVO.getUserId().toString();
            }
        }
@@ -732,13 +729,13 @@
                }
            }
        } else {
            if (detail.getFirstStatus() == 1 && detail.getStatus() != 3  && detail.getStatus() != 8) {
            if (detail.getFirstStatus() == 1 && detail.getStatus() != 3 && detail.getStatus() != 8) {
                detail.setStatus(0);
            } else if(detail.getFirstStatus()==0){
            } else if (detail.getFirstStatus() == 0) {
                detail.setStatus(5);
            }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 3  ){
            } else if (detail.getFirstStatus() == 1 && detail.getStatus() == 3) {
                detail.setStatus(3);
            }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 8){
            } else if (detail.getFirstStatus() == 1 && detail.getStatus() == 8) {
                detail.setStatus(8);
            }
        }
@@ -789,13 +786,13 @@
        //获取当前身份,1=党员,2=管理员
        ComplaintVO detail = baseMapper.getDetail(id);
        // 更新状态 此时status是表中的状态 未做变动
        if (detail.getFirstStatus() == 1 && detail.getStatus() != 3  && detail.getStatus() != 8) {
        if (detail.getFirstStatus() == 1 && detail.getStatus() != 3 && detail.getStatus() != 8) {
            detail.setStatus(0);
        } else if(detail.getFirstStatus()==0){
        } else if (detail.getFirstStatus() == 0) {
            detail.setStatus(5);
        }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 3  ){
        } else if (detail.getFirstStatus() == 1 && detail.getStatus() == 3) {
            detail.setStatus(3);
        }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 8){
        } else if (detail.getFirstStatus() == 1 && detail.getStatus() == 8) {
            detail.setStatus(8);
        }
@@ -808,11 +805,6 @@
        return detail;
    }
    /**
@@ -893,12 +885,12 @@
        complaint.setHandlingDay(handlingDay);
        this.updateById(complaint);
        if(dto.getStatus()==3){
        if (dto.getStatus() == 3) {
            // 发送短信
            Long createBy = complaint.getCreateBy();
            String phone = systemUserService.getCreateByIdPhone(createBy);
            if(StringUtils.isNotEmpty(phone)){
            if (StringUtils.isNotEmpty(phone)) {
                AliSmsUtil.sendSuccessMessage(phone);
            }
        }
@@ -1226,8 +1218,6 @@
            complaintFlowService.createFlow(complaintAuditRecord2, 0, loginUserInfoVO.getUserId());
            // 通过修改状态  已经修改superiorId  和层级  不需要修改 superiorId
            Complaint complaint = this.getById(complaintReporAuditDTO.getId());
            complaint.setAssignPersonId(complaintReporAuditDTO.getDeptId());
@@ -1245,15 +1235,15 @@
            Department byId = departmentService.getById(complaintReporAuditDTO.getDeptId());
            complaintFlow.setName(byId.getName());
            complaintFlow.setType(1);
            complaintFlow.setCreateTime(new Date(System.currentTimeMillis()+1000));
            complaintFlow.setCreateTime(new Date(System.currentTimeMillis() + 1000));
            complaintFlowService.save(complaintFlow);
            this.updateById(complaint);
            List<SystemUser> list = systemUserService.list(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getOneDepartmentId, complaintReporAuditDTO.getDeptId()).eq(SystemUser::getSystemRoleId, 1).eq(SystemUser::getStatus, 1));
            if(!list.isEmpty()){
            if (!list.isEmpty()) {
                List<String> phoneList = list.stream().map(SystemUser::getPhone).collect(Collectors.toList());
                AliSmsUtil.sendAssignMessageAdmin(phoneList,complaint.getSerialNumber());
                AliSmsUtil.sendAssignMessageAdmin(phoneList, complaint.getSerialNumber());
            }
        } else {
@@ -1571,7 +1561,36 @@
     */
    @Override
    public Page<ComplaintVO> pageList(MgtComplaintQuery query, SystemUserVo loginUserInfo) {
        return baseMapper.pageList(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
        if (loginUserInfo.getAccountLevel() == 2) {
            if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){
                Page<ComplaintVO> complaintVOPage = baseMapper.pageList(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
                return complaintVOPage;
            }else {
                Page<ComplaintVO> complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
                return complaintVOPage;
            }
        }
        if (loginUserInfo.getAccountLevel() == 3) {
            if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){
                // 获取这个街道所管的社区id
                List<Long> communityIds = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, loginUserInfo.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList());
                Page<ComplaintVO> complaintVOPage = baseMapper.pageList2(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo,communityIds);
                return complaintVOPage;
            }else {
                Page<ComplaintVO> complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
                return complaintVOPage;
            }
        }
        if (loginUserInfo.getAccountLevel() == 4) {
            if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){
                Page<ComplaintVO> complaintVOPage = baseMapper.pageList3(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
                return complaintVOPage;
            }else {
                Page<ComplaintVO> complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
                return complaintVOPage;
            }
        }
        return new Page<>();
    }
    @Override
@@ -2128,9 +2147,9 @@
            List<SystemUser> list = systemUserService.list(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getOneDepartmentId, userId).eq(SystemUser::getSystemRoleId, 1).eq(SystemUser::getStatus, 1));
            if(!list.isEmpty()){
            if (!list.isEmpty()) {
                List<String> phoneList = list.stream().map(SystemUser::getPhone).collect(Collectors.toList());
                AliSmsUtil.sendAssignMessageAdmin(phoneList,complaint.getSerialNumber());
                AliSmsUtil.sendAssignMessageAdmin(phoneList, complaint.getSerialNumber());
            }
        } else {
@@ -2149,13 +2168,13 @@
        page = baseMapper.pageScreenList(page, query);
        page.getRecords().forEach(detail -> {
            if (detail.getFirstStatus() == 1 && detail.getStatus() != 3  && detail.getStatus() != 8) {
            if (detail.getFirstStatus() == 1 && detail.getStatus() != 3 && detail.getStatus() != 8) {
                detail.setStatus(0);
            } else if(detail.getFirstStatus()==0){
            } else if (detail.getFirstStatus() == 0) {
                detail.setStatus(5);
            }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 3  ){
            } else if (detail.getFirstStatus() == 1 && detail.getStatus() == 3) {
                detail.setStatus(3);
            }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 8){
            } else if (detail.getFirstStatus() == 1 && detail.getStatus() == 8) {
                detail.setStatus(8);
            }
        });
@@ -2165,7 +2184,91 @@
    @Override
    public Page<String> getHouseAddress(GetHouseAddressQuery query) {
        Page<String> page = new Page<>(query.getPageNum(), query.getPageSize());
        return  this.baseMapper.getHouseAddress(page,query.getAddress());
        return this.baseMapper.getHouseAddress(page, query.getAddress());
    }
    @Override
    public void saveComplaintAdmin(Complaint complaint, SystemUserVo systemUser) {
        // 获取当前日期(年月日)
        String datePrefix = new SimpleDateFormat("yyyyMMdd").format(new Date());
        // 查询当前日期的最大流水号
        Complaint lastComplaint = getOne(new LambdaQueryWrapper<Complaint>()
                .likeRight(Complaint::getSerialNumber, datePrefix) // 查询以当前日期开头的流水号
                .orderByDesc(Complaint::getSerialNumber)
                .last("limit 1"));
        String serialNumber;
        if (isNull(lastComplaint)) {
            // 如果当天没有记录,从 0001 开始
            serialNumber = datePrefix + "0001";
        } else {
            // 获取当前日期的最大流水号,并递增
            String lastSerialNumber = lastComplaint.getSerialNumber();
            int num = Integer.parseInt(lastSerialNumber.substring(lastSerialNumber.length() - 4)); // 提取后4位数字
            serialNumber = datePrefix + String.format("%04d", num + 1); // 递增并格式化为4位
        }
        // 设置流水号
        complaint.setSerialNumber(serialNumber);
        Integer accountLevel = 4;
        //获取当前身份
        //1=党员,2=管理员
        accountLevel = systemUser.getAccountLevel();
        switch (accountLevel) {
            case 2:
                //区县级
                complaint.setCityCode(510400);
                complaint.setDistrictsCode(Integer.valueOf(systemUser.getDistrictsCode()));
                complaint.setReportUserName(systemUser.getName());
                complaint.setReportUserPhone(systemUser.getPhone());
                complaint.setSuperiorId(Long.valueOf(systemUser.getDistrictsCode()));
                break;
            case 3:
                //街道
                complaint.setCityCode(510400);
                complaint.setDistrictsCode(Integer.valueOf(systemUser.getDistrictsCode()));
                complaint.setStreetId(Long.valueOf(systemUser.getStreetId()));
                complaint.setReportUserName(systemUser.getName());
                complaint.setReportUserPhone(systemUser.getPhone());
                complaint.setSuperiorId(Long.valueOf(systemUser.getStreetId()));
                break;
            case 4:
                //社区
                complaint.setCityCode(510400);
                complaint.setDistrictsCode(Integer.valueOf(systemUser.getDistrictsCode()));
                complaint.setStreetId(Long.valueOf(systemUser.getStreetId()));
                complaint.setCommunityId(systemUser.getCommunityId());
                complaint.setReportUserName(systemUser.getName());
                complaint.setReportUserPhone(systemUser.getPhone());
                complaint.setSuperiorId(systemUser.getCommunityId());
                break;
        }
        complaint.setReportType(accountLevel);
        complaint.setNowLevel(accountLevel);
        complaint.setLastLevel(accountLevel);
        complaint.setLastSuperiorId(complaint.getSuperiorId());
        // 设置其他字段
        complaint.setStatus(ProcessStatusEnum.PROCESSING.getCode());
        complaint.setCreateTime(new Date(System.currentTimeMillis()));
        complaint.setUpdateTime(new Date(System.currentTimeMillis()));
        //查询系统配置诉求处理期限,设置截止日期
        WorkOrderItemConfig config = workOrderItemConfigService.lambdaQuery().orderByDesc(WorkOrderItemConfig::getId).last("LIMIT 1").one();
        if (Objects.isNull(config)) {
            throw new ServiceException("工单事项未配置,请联系管理员");
        }
        complaint.setNowLevelTime(new Date());
        complaint.setNowLevelSms(0);
        // 保存诉求记录
        save(complaint);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/utils/ExcelUtil.java
New file
@@ -0,0 +1,351 @@
package com.panzhihua.westcommittee.utils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * 定义Excel工具类
 */
@Component
public class ExcelUtil {
    public List<List<List<String>>> upload(String s,MultipartFile file){
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
        } catch (IOException e) {
            e.printStackTrace();
        }
        //获取文件名
        String fileName=s;
        List<List<List<String>>> list = null;
        if(validateExcel(fileName)) {
            // 根据版本选择创建Workbook的方式
            Workbook wb = null;
            // 根据文件名判断文件是2003版本还是2007版本
            if (isExcel2007(fileName)) {
                try {
                    wb = new XSSFWorkbook(inputStream);
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            } else {
                try {
                    wb = new HSSFWorkbook(inputStream);
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            int num = wb.getNumberOfSheets();//获取页数
            list = new ArrayList<>();
            for (int i = 0; i < num; i++) {
                List<List<String>> sheetList = new ArrayList<>();
                //获取每一页对象
                Sheet sheet = wb.getSheetAt(i);
                // 得到Excel的行数
                int totalRows = sheet.getPhysicalNumberOfRows();
                for (int j = 0; j < totalRows; j++) {
                    if (j == 0) {
                        continue;// 标题行
                    }
                    Row row = sheet.getRow(j);// 获取索引为i的行数据
                    if(null == row){
                        continue;
                    }
                    int index = sheet.getRow(0).getPhysicalNumberOfCells();//获取标题的列数用于遍历
                    List<String> strings = new ArrayList<>();
                    int in = 0;//用于遍历单元格判断该行是否全为空值
                    for (int k = 0; k < index; k++) {//遍历获取每个单元格的数据
                        String str = null;
                        Cell cell = row.getCell(k);
                        if(cell == null) {
                            str = "";
                            in++;
                        }else {
                            switch (cell.getCellType()) {//判断数据类型取值
                                case NUMERIC :
                                    if (DateUtil.isCellDateFormatted(cell)) {
                                        Date theDate = cell.getDateCellValue();
                                        str = String.valueOf(theDate.getTime());
                                    }else{
                                        String string = String.valueOf(cell.getNumericCellValue());
                                        str = string.substring(0, string.indexOf("."));
                                    }
                                    break;
                                case STRING :
                                    str = cell.getStringCellValue();
                                    if(str == null) {
                                        str = "";
                                        in++;
                                    }
                                    break;
                                case _NONE :
                                    System.err.println("_NONE");
                                    break;
                                case FORMULA :
                                    System.err.println("FORMULA");
                                    break;
                                case BLANK :
                                    str = cell.getStringCellValue();
                                    if(str.equals("")) {
                                        str = "";
                                        in++;
                                    }
                                    break;
                                case BOOLEAN :
                                    System.err.println("BOOLEAN");
                                    break;
                                case ERROR :
                                    System.err.println("ERROR");
                                    break;
                                default:
                                    break;
                            }
                        }
                        strings.add(String.valueOf(str).trim());
                    }
                    if(in != index) {//判断如果每个单元格都为null则不需要添加到集合中
                        sheetList.add(strings);
                    }
                }
                list.add(sheetList);
            }
        }
        return list;
    }
    public List<List<List<String>>> upload(MultipartFile file){
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
        } catch (IOException e) {
            e.printStackTrace();
        }
        //获取文件名
        String fileName=file.getOriginalFilename();
        List<List<List<String>>> list = null;
        if(validateExcel(fileName)) {
            // 根据版本选择创建Workbook的方式
            Workbook wb = null;
            // 根据文件名判断文件是2003版本还是2007版本
            if (isExcel2007(fileName)) {
                try {
                    wb = new XSSFWorkbook(inputStream);
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            } else {
                try {
                    wb = new HSSFWorkbook(inputStream);
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            int num = wb.getNumberOfSheets();//获取页数
            list = new ArrayList<>();
            for (int i = 0; i < num; i++) {
                List<List<String>> sheetList = new ArrayList<>();
                //获取每一页对象
                Sheet sheet = wb.getSheetAt(i);
                // 得到Excel的行数
                int totalRows = sheet.getPhysicalNumberOfRows();
                for (int j = 0; j < totalRows; j++) {
                    if (j == 0) {
                        continue;// 标题行
                    }
                    Row row = sheet.getRow(j);// 获取索引为i的行数据
                    if(null == row){
                        continue;
                    }
                    int index = sheet.getRow(0).getPhysicalNumberOfCells();//获取标题的列数用于遍历
                    List<String> strings = new ArrayList<>();
                    int in = 0;//用于遍历单元格判断该行是否全为空值
                    for (int k = 0; k < index; k++) {//遍历获取每个单元格的数据
                        String str = null;
                        Cell cell = row.getCell(k);
                        if(cell == null) {
                            str = "";
                            in++;
                        }else {
                            switch (cell.getCellType()) {//判断数据类型取值
                                case NUMERIC :
                                    if (DateUtil.isCellDateFormatted(cell)) {
                                        Date theDate = cell.getDateCellValue();
                                        str = String.valueOf(theDate.getTime());
                                    }else{
                                        String string = String.valueOf(cell.getNumericCellValue());
                                        str = string.substring(0, string.indexOf("."));
                                    }
                                    break;
                                case STRING :
                                    str = cell.getStringCellValue();
                                    if(str == null) {
                                        str = "";
                                        in++;
                                    }
                                    break;
                                case _NONE :
                                    System.err.println("_NONE");
                                    break;
                                case FORMULA :
                                    System.err.println("FORMULA");
                                    break;
                                case BLANK :
                                    str = cell.getStringCellValue();
                                    if(str.equals("")) {
                                        str = "";
                                        in++;
                                    }
                                    break;
                                case BOOLEAN :
                                    System.err.println("BOOLEAN");
                                    break;
                                case ERROR :
                                    System.err.println("ERROR");
                                    break;
                                default:
                                    break;
                            }
                        }
                        strings.add(String.valueOf(str).trim());
                    }
                    if(in != index) {//判断如果每个单元格都为null则不需要添加到集合中
                        sheetList.add(strings);
                    }
                }
                list.add(sheetList);
            }
        }
        return list;
    }
    // @描述:是否是2003的excel,返回true是2003
    public static boolean isExcel2003(String filePath)  {
        return filePath.matches("^.+\\.(?i)(xls)$");
    }
    //@描述:是否是2007的excel,返回true是2007
    public static boolean isExcel2007(String filePath)  {
        return filePath.matches("^.+\\.(?i)(xlsx)$");
    }
    /**
     * 验证EXCEL文件
     * @param filePath
     * @return
     */
    public static boolean validateExcel(String filePath){
        if (filePath == null || !(isExcel2003(filePath) || isExcel2007(filePath))){
            return false;
        }
        return true;
    }
    /**
     * 将数据写入Excel中
     * @param titles    标题
     * @param datas     数据
     * @return
     */
    public HSSFWorkbook writeDataToExcel(List<List<String>> titles, List<List<List<String>>> datas) {
        HSSFWorkbook hssfWorkbook = new HSSFWorkbook();
        for(int i = 0; i < titles.size(); i++){
            HSSFSheet hssfSheet = hssfWorkbook.createSheet();
            hssfSheet.setColumnWidth(0, 6 * 256);
            hssfSheet.setDefaultRowHeightInPoints(20f);
            HSSFRow hssfRow = hssfSheet.createRow(0);//设置第一行数据(标题)
            HSSFCellStyle style = hssfWorkbook.createCellStyle();
            HSSFFont font = hssfWorkbook.createFont();
            font.setBold(true);
            style.setFont(font);
            style.setAlignment(HorizontalAlignment.CENTER);
            for (int l = 0; l < titles.get(i).size(); l++) {
                HSSFCell hssfCell = hssfRow.createCell(l);
                hssfCell.setCellType(CellType.STRING);//设置表格类型
                hssfCell.setCellValue(titles.get(i).get(l));
                hssfCell.setCellStyle(style);
                hssfSheet.setColumnWidth(l , 20 * 256);
            }
            //将数据添加到表格中
            List<String> data = null;
            for (int l = 0; l < datas.get(i).size(); l++) {
                hssfRow = hssfSheet.createRow(l + 1);
                data = datas.get(i).get(l);
                for (int j = 0; j < data.size(); j++) {
                    HSSFCell hssfCell = hssfRow.createCell(j);
                    hssfCell.setCellType(CellType.STRING);//设置表格类型
                    hssfCell.setCellValue(data.get(j));
                }
            }
        }
        return hssfWorkbook;
    }
    public static HSSFWorkbook getHSSFWorkbook(String sheetName, String[] title, String[][] values, HSSFWorkbook wb) {
        // 第一步,创建一个webbook,对应一个Excel文件
        if (wb == null) {
            wb = new HSSFWorkbook();
        }
        // 第二步,在webbook中添加一个sheet,对应Excel文件中的sheet
        HSSFSheet sheet = wb.createSheet(sheetName);
        // 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
        HSSFRow row = sheet.createRow(0);
        // 第四步,创建单元格,并设置值表头 设置表头居中
        HSSFCellStyle style = wb.createCellStyle();
        style.setLocked(true);
        style.setAlignment(HorizontalAlignment.CENTER); // 创建一个居中格式
        HSSFCell cell = null;
        // 创建标题
        for (int i = 0; i < title.length; i++) {
            cell = row.createCell(i);
            cell.setCellValue(title[i]);
            cell.setCellStyle(style);
        }
        // 创建内容
        for (int i = 0; i < values.length; i++) {
            row = sheet.createRow(i + 1);
            for (int j = 0; j < values[i].length; j++) {
                cell = row.createCell(j);
                cell.setCellValue(values[i][j]);
                cell.setCellStyle(style);
            }
        }
        return wb;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/warpper/MgtComplaintQuery.java
@@ -13,16 +13,16 @@
@Data
@ApiModel("管理后台诉求管理查询数据传输对象")
public class MgtComplaintQuery extends BasePage {
    @ApiModelProperty(value = "录入人")
    @ApiModelProperty(value = "接件人")
    private String reportUserName;
    @ApiModelProperty(value = "录入人联系方式")
    @ApiModelProperty(value = "接件人联系方式")
    private String reportUserPhone;
    @ApiModelProperty(value = "群众姓名")
    @ApiModelProperty(value = "诉求人")
    private String name;
    @ApiModelProperty(value = "群众联系方式")
    @ApiModelProperty(value = "诉求人联系方式")
    private String contactNumber;
    @ApiModelProperty(value = "发生时间-开始")
@@ -33,9 +33,24 @@
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String endTime;
    @ApiModelProperty(value = "问题类型")
    @ApiModelProperty(value = "地址")
    private String address;
    @ApiModelProperty(value = "事件类型")
    private String problemType;
    @ApiModelProperty(value = "流转状态:0-正在办理 1-延期办理 2-超时办理 3-已办结 4-上报待审核")
    private Integer status;
    @ApiModelProperty(value = "处理人")
    private String deptName;
    @ApiModelProperty(value = "事件上报情况")
    private String reportStr;
    @ApiModelProperty(value = "事件评价 0:不满意 1:一般 2:满意 3:非常满意")
    private Integer commentRate;
    @ApiModelProperty(value = "处理人所属层级")
    private Integer level;
    @ApiModelProperty(value = "处理人所属层级code")
    private String code;
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintMapper.xml
@@ -267,8 +267,9 @@
        ORDER BY sc.create_time DESC
    </select>
    <select id="pageList" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO">
        SELECT * FROM(
        SELECT sc.id,
        select * from (
        SELECT
        sc.id,
        sc.serial_number,
        sc.time,
        sc.problem_type,
@@ -280,20 +281,21 @@
        sc.description_content,
        sc.images,
        sc.videos,
        CASE
        WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 4
        WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 4
        ELSE sc.status
        case
        WHEN  sc.now_level = 2  and sc.assign_status =0 and  (scar.audit_status=1 or scar.audit_status is null) THEN -1
        WHEN  sc.now_level = 2 and sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7
        WHEN  sc.now_level = 2 and sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5
        WHEN  sc.now_level = 2 and sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6
        WHEN sc.`status` =8 THEN 3
        WHEN sc.`status` =3 THEN 3
        ELSE 0
        END AS status,
        CASE
        WHEN sc.status = 8  THEN 1
        ELSE 0
        END AS evaluateButtonStatus,
        sc.report_type,
        sc.report_user_name,
        sc.report_user_phone,
        sc.superior_id,
        sc.city_code,
        sc.districts_code,
        sc.street_id,
        sc.community_id,
        sc.party_member_id,
        sc.create_by,
        sc.create_time,
        sc.update_by,
@@ -310,62 +312,85 @@
        sc.over_time_days,
        sc.latitude,
        sc.longitude,
        sc.redispatch,
        sc.now_level,
        sc.now_level_time,
        scar.audit_type,
        scar.audit_status,
        scar.reporter_level,
        scar.comment,
        scar.create_time AS reportTime,
        scar.system_user_id,
        scar.create_by as auditCreateBy,
        scar.reporter,
        scar.reporter_id,
        scar.superior_id superiorId2,
        scar.department_name,
        scar.department_id,
        scc.rate
        sc.assign_status AS assignStatus,
        case
            when scar.id is not null  and scar.audit_status =1 and scar.audit_type= 2 then '上报'
        else '自办'
         end
        AS reportStr,
        wd.name as deptName,
        wd.tier,
        wd.districts_code as code1 ,
        wd.street_id as code2,
        wd.community_id as code3,
        sc.report_user_name,
        sc.report_user_phone,
        scar.auditor_name,
        sc.comment_rate
        FROM west_complaint sc
        LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1
        LEFT JOIN west_complaint_comment scc ON sc.id = scc.complaint_id
        ) AS t
        <where>
            <if test="1 == loginUserInfo.accountLevel">
                and t.city_code = 510400
            </if>
            <if test="2 == loginUserInfo.accountLevel">
                and (t.districts_code = #{loginUserInfo.districtsCode} OR t.id in (select complaint_id from
                west_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type =
                #{loginUserInfo.accountLevel} and superior_id = #{loginUserInfo.districtsCode}))
            </if>
            <if test="3 == loginUserInfo.accountLevel">
                and (t.street_id = #{loginUserInfo.streetId} OR t.id in (select complaint_id from
                west_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type =
                #{loginUserInfo.accountLevel} and superior_id = #{loginUserInfo.streetId}))
            </if>
            <if test="4 == loginUserInfo.accountLevel">
                and (t.community_id = #{loginUserInfo.communityId} OR t.id in (select complaint_id from
                west_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type =
                #{loginUserInfo.accountLevel} and superior_id = #{loginUserInfo.communityId}))
            </if>
            <if test="query.status!=null and query.status!=''">
                AND t.status = #{query.status}
            </if>
            <if test="query.reportUserName != null and query.reportUserName!=''">
                AND t.report_user_name LIKE CONCAT('%',#{query.reportUserName},'%')
            </if>
            <if test="query.reportUserPhone != null and query.reportUserPhone!=''">
                AND t.report_user_phone LIKE CONCAT('%',#{query.reportUserPhone},'%')
            </if>
            <if test="query.name != null and query.name!=''">
                AND t.name LIKE CONCAT('%',#{query.name},'%')
            </if>
            <if test="query.contactNumber != null and query.contactNumber!=''">
                AND t.contact_number LIKE CONCAT('%',#{query.contactNumber},'%')
            </if>
            <if test="query.startTime != null and query.endTime!=null">
                AND t.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.problemType != null and query.problemType!=''">
                AND t.problem_type =#{query.problemType}
            </if>
        </where>
        GROUP BY t.id
        ORDER BY t.create_time DESC
        LEFT JOIN west_department wd ON wd.id = sc.assign_person_id
        ) as t1 where 1=1
        <if test="query.name != null and query.name!=''">
            and t1.name = #{query.name}
        </if>
        <if test="query.contactNumber != null and query.contactNumber!=''">
            and t1.contact_number = #{query.contactNumber}
        </if>
        <if test="query.reportUserName != null and query.reportUserName!=''">
            and t1.report_user_name = #{query.reportUserName}
        </if>
        <if test="query.reportUserPhone != null and query.reportUserPhone!=''">
            and t1.report_user_phone = #{query.reportUserPhone}
        </if>
        <if test="query.startTime != null and query.endTime!=null">
            and t1.create_time between #{query.startTime} and #{query.endTime}
        </if>
        <if test="query.address != null and query.address!=''">
            and t1.detailed_address like concat("%",#{query.address},"%")
        </if>
        <if test="query.problemType != null and query.problemType!=''">
            and t1.problem_type =#{query.problemType}
        </if>
        <if test="query.deptName != null and query.deptName!=''">
            and t1.deptName =#{query.deptName}
        </if>
        <if test="query.reportStr != null and query.reportStr!=''">
            and t1.reportStr =#{query.reportStr}
        </if>
        <if test="query.commentRate != null">
            and t1.comment_rate =#{query.commentRate}
        </if>
        <if test="query.level!=null and query.level ==2  and query.code!=null ">
            and t1.tier =2 and t1.code1=#{query.code}
        </if>
        <if test="query.level!=null and query.level ==3  and query.code!=null ">
            and t1.tier =3 and t1.code2=#{query.code}
        </if>
        <if test="query.level!=null and query.level ==4  and query.code!=null ">
            and t1.tier =4 and t1.code3=#{query.code}
        </if>
        <if test="loginUserInfo.systemRoleId !=2 ">
            and t1.problem_type !='检举'
        </if>
        ORDER BY t1.create_time DESC
    </select>
    <select id="getList" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO">
        SELECT * FROM(
@@ -940,9 +965,7 @@
        <if test="query.status !=null">
            and t1.status = #{query.status}
        </if>
        <if test="query.status ==null">
            and t1.status >-1
        </if>
        ORDER BY t1.create_time DESC
    </select>
    <select id="selectComplaintPage5" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO">
@@ -1018,9 +1041,7 @@
        <if test="query.status !=null">
            and t1.status = #{query.status}
        </if>
        <if test="query.status ==null">
            and t1.status >-1
        </if>
        ORDER BY t1.create_time DESC
    </select>
    <select id="selectComplaintPage4" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO">
@@ -1163,9 +1184,7 @@
        <if test="query.status !=null">
            and t1.status = #{query.status}
        </if>
        <if test="query.status ==null">
            and t1.status >-1
        </if>
        ORDER BY t1.create_time DESC
    </select>
@@ -1244,4 +1263,387 @@
    <select id="getHouseAddressFromId" resultType="java.lang.String">
            select address from com_mng_population_house where id=#{houseId}
    </select>
    <select id="pageList1" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO">
        select * from (
        SELECT
        sc.id,
        sc.serial_number,
        sc.time,
        sc.problem_type,
        sc.name,
        sc.contact_number,
        sc.location,
        sc.detailed_address,
        sc.description_title,
        sc.description_content,
        sc.images,
        sc.videos,
        case
        WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7
        WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5
        WHEN sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6
        ELSE sc.status
        END AS status,
        CASE
        WHEN sc.status = 8 THEN 1
        ELSE 0
        END AS evaluateButtonStatus,
        sc.report_type,
        sc.superior_id,
        sc.create_by,
        sc.create_time,
        sc.update_by,
        sc.update_time,
        sc.completion_description,
        sc.completion_images,
        sc.completion_videos,
        sc.completion_other_description,
        sc.completion_time,
        sc.completion_user_id,
        sc.completion_username,
        sc.completion_user_phone,
        sc.closing_time,
        sc.over_time_days,
        sc.latitude,
        sc.longitude,
        sc.redispatch,
        sc.now_level,
        sc.now_level_time,
        scar.audit_type,
        scar.audit_status,
        scar.reporter_level,
        scar.comment,
        scar.create_time AS reportTime,
        scar.system_user_id,
        scar.create_by as auditCreateBy,
        scar.reporter,
        scar.reporter_id,
        scar.superior_id superiorId2,
        scar.department_name,
        scar.department_id,
        sc.assign_status AS assignStatus,
        case
        when scar.id is not null and scar.audit_status =1 and scar.audit_type= 2 then '上报'
        else '自办'
        end
        AS reportStr,
        wd.name as deptName,
        wd.tier,
        wd.districts_code as code1 ,
        wd.street_id as code2,
        wd.community_id as code3,
        sc.report_user_name,
        sc.report_user_phone,
        scar.auditor_name,
        sc.comment_rate
        FROM west_complaint sc
        LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1
        LEFT JOIN west_department wd ON wd.id = sc.assign_person_id
        WHERE sc.assign_person_id =#{loginUserInfo.oneDepartmentId}
        ) as t1 where 1=1
        <if test="query.name != null and query.name!=''">
            and t1.name = #{query.name}
        </if>
        <if test="query.contactNumber != null and query.contactNumber!=''">
            and t1.contact_number = #{query.contactNumber}
        </if>
        <if test="query.reportUserName != null and query.reportUserName!=''">
            and t1.report_user_name = #{query.reportUserName}
        </if>
        <if test="query.reportUserPhone != null and query.reportUserPhone!=''">
            and t1.report_user_phone = #{query.reportUserPhone}
        </if>
        <if test="query.startTime != null and query.endTime!=null">
            and t1.create_time between #{query.startTime} and #{query.endTime}
        </if>
        <if test="query.address != null and query.address!=''">
            and t1.detailed_address like concat("%",#{query.address},"%")
        </if>
        <if test="query.problemType != null and query.problemType!=''">
            and t1.problem_type =#{query.problemType}
        </if>
        <if test="query.deptName != null and query.deptName!=''">
            and t1.deptName =#{query.deptName}
        </if>
        <if test="query.reportStr != null and query.reportStr!=''">
            and t1.reportStr =#{query.reportStr}
        </if>
        <if test="query.commentRate != null">
            and t1.comment_rate =#{query.commentRate}
        </if>
        <if test="query.level!=null and query.level ==2  and query.code!=null ">
            and t1.tier =2 and t1.code1=#{query.code}
        </if>
        <if test="query.level!=null and query.level ==3  and query.code!=null ">
            and t1.tier =3 and t1.code2=#{query.code}
        </if>
        <if test="query.level!=null and query.level ==4  and query.code!=null ">
            and t1.tier =4 and t1.code3=#{query.code}
        </if>
        <if test="loginUserInfo.systemRoleId !=2 ">
            and t1.problem_type !='检举'
        </if>
        ORDER BY t1.create_time DESC
    </select>
    <select id="pageList2" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO">
        select * from (
        SELECT distinct
        sc.id,
        sc.serial_number,
        sc.time,
        sc.problem_type,
        sc.name,
        sc.contact_number,
        sc.location,
        sc.detailed_address,
        sc.description_title,
        sc.description_content,
        sc.images,
        sc.videos,
        case
        WHEN  (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7
        WHEN   (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5
        WHEN   (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6
        WHEN sc.`status` =8 THEN 3
        WHEN sc.`status` =3 THEN 3
        WHEN  sc.now_level = 3  and sc.assign_status =0 and  (scar.audit_status=1 or scar.audit_status is null) THEN -1
        ELSE 0
        END AS status,
        CASE
        WHEN sc.status = 8  THEN 1
        ELSE 0
        END AS evaluateButtonStatus,
        sc.report_type,
        sc.superior_id,
        sc.create_by,
        sc.create_time,
        sc.update_by,
        sc.update_time,
        sc.completion_description,
        sc.completion_images,
        sc.completion_videos,
        sc.completion_other_description,
        sc.completion_time,
        sc.completion_user_id,
        sc.completion_username,
        sc.completion_user_phone,
        sc.closing_time,
        sc.over_time_days,
        sc.latitude,
        sc.longitude,
        sc.redispatch,
        sc.now_level,
        sc.now_level_time,
        scar.audit_type,
        scar.audit_status,
        scar.reporter_level,
        scar.comment,
        scar.create_time AS reportTime,
        scar.system_user_id,
        scar.create_by as auditCreateBy,
        scar.reporter,
        scar.reporter_id,
        scar.superior_id superiorId2,
        scar.department_name,
        scar.department_id,
        sc.assign_status AS assignStatus,
        case
        when scar.id is not null and scar.audit_status =1 and scar.audit_type= 2 then '上报'
        else '自办'
        end
        AS reportStr,
        wd.name as deptName,
        wd.tier,
        wd.districts_code as code1 ,
        wd.street_id as code2,
        wd.community_id as code3,
        sc.report_user_name,
        sc.report_user_phone,
        scar.auditor_name,
        sc.comment_rate
        FROM west_complaint sc
        LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1
        LEFT JOIN west_department wd ON wd.id = sc.assign_person_id
        where
        (sc.superior_id =#{loginUserInfo.streetId} and 3 =sc.now_level) or (sc.last_superior_id = #{loginUserInfo.streetId} and  3 =sc.last_level)
        or (4 =sc.now_level and sc.superior_id in <foreach collection="ids" item="item" separator="," open="(" close=")">#{item}</foreach>)
        or (sc.community_id in <foreach collection="ids" item="item" separator="," open="(" close=")">#{item}</foreach>)
        or (sc.street_id =#{loginUserInfo.streetId})
        ) as t1 where 1=1
        <if test="query.name != null and query.name!=''">
            and t1.name = #{query.name}
        </if>
        <if test="query.contactNumber != null and query.contactNumber!=''">
            and t1.contact_number = #{query.contactNumber}
        </if>
        <if test="query.reportUserName != null and query.reportUserName!=''">
            and t1.report_user_name = #{query.reportUserName}
        </if>
        <if test="query.reportUserPhone != null and query.reportUserPhone!=''">
            and t1.report_user_phone = #{query.reportUserPhone}
        </if>
        <if test="query.startTime != null and query.endTime!=null">
            and t1.create_time between #{query.startTime} and #{query.endTime}
        </if>
        <if test="query.address != null and query.address!=''">
            and t1.detailed_address like concat("%",#{query.address},"%")
        </if>
        <if test="query.problemType != null and query.problemType!=''">
            and t1.problem_type =#{query.problemType}
        </if>
        <if test="query.deptName != null and query.deptName!=''">
            and t1.deptName =#{query.deptName}
        </if>
        <if test="query.reportStr != null and query.reportStr!=''">
            and t1.reportStr =#{query.reportStr}
        </if>
        <if test="query.commentRate != null">
            and t1.comment_rate =#{query.commentRate}
        </if>
        <if test="query.level!=null and query.level ==2  and query.code!=null ">
            and t1.tier =2 and t1.code1=#{query.code}
        </if>
        <if test="query.level!=null and query.level ==3  and query.code!=null ">
            and t1.tier =3 and t1.code2=#{query.code}
        </if>
        <if test="query.level!=null and query.level ==4  and query.code!=null ">
            and t1.tier =4 and t1.code3=#{query.code}
        </if>
        <if test="loginUserInfo.systemRoleId !=2 ">
            and t1.problem_type !='检举'
        </if>
        ORDER BY t1.create_time DESC
    </select>
    <select id="pageList3" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO">
        select * from (
                          SELECT distinct
                              sc.id,
                              sc.serial_number,
                              sc.time,
                              sc.problem_type,
                              sc.name,
                              sc.contact_number,
                              sc.location,
                              sc.detailed_address,
                              sc.description_title,
                              sc.description_content,
                              sc.images,
                              sc.videos,
                              case
                                  WHEN  sc.now_level = 4 and  sc.assign_status = 0 THEN -1
                                  WHEN  (sc.now_level = 4 or sc.last_level = 4) and sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7
                                  WHEN  (sc.now_level = 4 or sc.last_level = 4) and sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5
                                  WHEN  (sc.now_level = 4 or sc.last_level = 4) and sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6
                                  WHEN sc.`status` =8 THEN 3
                                  WHEN sc.`status` =3 THEN 3
                                  WHEN sc.assign_status = 0   THEN -1
                                  ELSE 0
                                  END AS status,
                              CASE
                                  WHEN sc.status = 8  THEN 1
                                  ELSE 0
                                  END AS evaluateButtonStatus,
                              sc.report_type,
                              sc.superior_id,
                              sc.create_by,
                              sc.create_time,
                              sc.update_by,
                              sc.update_time,
                              sc.completion_description,
                              sc.completion_images,
                              sc.completion_videos,
                              sc.completion_other_description,
                              sc.completion_time,
                              sc.completion_user_id,
                              sc.completion_username,
                              sc.completion_user_phone,
                              sc.closing_time,
                              sc.over_time_days,
                              sc.latitude,
                              sc.longitude,
                              sc.redispatch,
                              sc.now_level,
                              sc.now_level_time,
                              scar.audit_type,
                              scar.audit_status,
                              scar.reporter_level,
                              scar.comment,
                              scar.create_time AS reportTime,
                              scar.system_user_id,
                              scar.create_by as auditCreateBy,
                              scar.reporter,
                              scar.reporter_id,
                              scar.superior_id superiorId2,
                              scar.department_name,
                              scar.department_id,
                              sc.assign_status AS assignStatus,
                              case
                                  when scar.id is not null and scar.audit_status =1 and scar.audit_type= 2 then '上报'
                                  else '自办'
                                  end
                                                AS reportStr,
                              wd.name as deptName,
                              wd.tier,
                              wd.districts_code as code1 ,
                              wd.street_id as code2,
                              wd.community_id as code3,
                              sc.report_user_name,
                              sc.report_user_phone,
                              scar.auditor_name,
                              sc.comment_rate
                          FROM west_complaint sc
                                   LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1
                                   LEFT JOIN west_department wd ON wd.id = sc.assign_person_id
                          where
                              (sc.superior_id =#{loginUserInfo.communityId} and sc.now_level=4) or (sc.last_superior_id = #{loginUserInfo.communityId} and sc.last_level=4)
                             or (sc.community_id = #{loginUserInfo.communityId})
                      ) as t1  where 1=1
        <if test="query.name != null and query.name!=''">
            and t1.name = #{query.name}
        </if>
        <if test="query.contactNumber != null and query.contactNumber!=''">
            and t1.contact_number = #{query.contactNumber}
        </if>
        <if test="query.reportUserName != null and query.reportUserName!=''">
            and t1.report_user_name = #{query.reportUserName}
        </if>
        <if test="query.reportUserPhone != null and query.reportUserPhone!=''">
            and t1.report_user_phone = #{query.reportUserPhone}
        </if>
        <if test="query.startTime != null and query.endTime!=null">
            and t1.create_time between #{query.startTime} and #{query.endTime}
        </if>
        <if test="query.address != null and query.address!=''">
            and t1.detailed_address like concat("%",#{query.address},"%")
        </if>
        <if test="query.problemType != null and query.problemType!=''">
            and t1.problem_type =#{query.problemType}
        </if>
        <if test="query.deptName != null and query.deptName!=''">
            and t1.deptName =#{query.deptName}
        </if>
        <if test="query.reportStr != null and query.reportStr!=''">
            and t1.reportStr =#{query.reportStr}
        </if>
        <if test="query.commentRate != null">
            and t1.comment_rate =#{query.commentRate}
        </if>
        <if test="query.level!=null and query.level ==2  and query.code!=null ">
            and t1.tier =2 and t1.code1=#{query.code}
        </if>
        <if test="query.level!=null and query.level ==3  and query.code!=null ">
            and t1.tier =3 and t1.code2=#{query.code}
        </if>
        <if test="query.level!=null and query.level ==4  and query.code!=null ">
            and t1.tier =4 and t1.code3=#{query.code}
        </if>
        <if test="loginUserInfo.systemRoleId !=2 ">
            and t1.problem_type !='检举'
        </if>
        ORDER BY t1.create_time DESC
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintRejectMapper.xml
@@ -40,6 +40,10 @@
            <if test="examineStartTime !=null">
                and t3.audit_time between #{examineStartTime} and #{examineEndTime}
            </if>
            <if test="roleId !=2">
                and t2.problem_type !='检举'
            </if>
        </where>
        order by t3.create_time desc
@@ -54,6 +58,9 @@
        left join west_complaint t2 on t3.complaint_id = t2.id
        <where>
            t3.audit_status=2
            <if test="roleId !=2">
                and t2.problem_type !='检举'
            </if>
            <if test="query.serialNumber != null and query.serialNumber != ''">
                and t2.serial_number = #{query.serialNumber}
            </if>
@@ -86,10 +93,6 @@
            <foreach collection="finalStreetIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
            or t2.districts_code in
            <foreach collection="finalDistrictsCodes" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
            )
@@ -98,4 +101,43 @@
    </select>
    <select id="getComplaintRejectList1" resultType="com.panzhihua.westcommittee.model.vo.ComplaintRejectVo">
        select t3.reject_reason remark,t3.audit_time examineTime,t2.id complaintId,t2.serial_number serialNumber,t2.report_user_name reportUserName,t2.status,
        t2.report_user_phone reportUserPhone,t3.auditor_name examineUserName,t3.create_time applyTime,t3.apply_name applyUserName
        from west_complaint_audit_record t3
        left join west_complaint t2 on t3.complaint_id = t2.id
        <where>
            t3.audit_status=2 and t2.assign_person_id =#{oneDepartmentId}
            <if test="query.serialNumber != null and query.serialNumber != ''">
                and t2.serial_number = #{query.serialNumber}
            </if>
            <if test="query.reportUserName != null and query.reportUserName != ''">
                and t2.report_user_name like concat("%",#{query.reportUserName},"%")
            </if>
            <if test="query.status != null">
                and t2.status = #{query.status}
            </if>
            <if test="query.reportUserPhone != null and query.reportUserPhone != ''">
                and t2.report_user_phone like concat("%",#{query.reportUserPhone},"%")
            </if>
            <if test="query.applyUserName != null and query.applyUserName != ''">
                and t3.apply_name like concat("%",#{query.applyUserName},"%")
            </if>
            <if test="query.examineUserName != null and query.examineUserName != ''">
                and t3.auditor_name like concat("%",#{query.examineUserName},"%")
            </if>
            <if test="applyStartTime !=null">
                and t3.create_time between #{applyStartTime} and #{applyEndTime}
            </if>
            <if test="examineStartTime !=null">
                and t3.audit_time between #{examineStartTime} and #{examineEndTime}
            </if>
            <if test="role !=2">
                and t2.problem_type !='检举'
            </if>
        </where>
        order by t3.create_time desc
    </select>
</mapper>