liujie
2025-06-27 3632162b5cbffbe53f86094604f213d20fda2e35
2.0后台模块接口
25个文件已修改
1个文件已添加
1331 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/AnalyticStatisticsController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/DepartmentController.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/MgtComplaintController.java 227 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemMenuController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemUserController.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/controller/ComplaintController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/controller/PartyMemberController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/controller/StaticsController.java 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/dao/ComplaintMapper.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/dao/SystemUserMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/enums/ComplaintExportEnum.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/dto/AssignComplainDto.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/dto/ComplaintTimeout.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/dto/SetProblemTypeDto.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/entity/Complaint.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/scheduled/ComplaintTasks.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/IComplaintService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/ISystemMenuService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/ComplaintServiceImpl.java 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/StaticsService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/SystemMenuServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/SystemUserServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/warpper/MgtComplaintQuery.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintAuditRecordMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintMapper.xml 561 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/SystemUserMapper.xml 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/AnalyticStatisticsController.java
@@ -103,18 +103,27 @@
        // 都为空 查他有的
        if(query.getCityCode()==null && query.getDistrictCode()==null && query.getStreetId()==null && query.getCommunityId()==null){
            if(systemUser.getSystemRoleId()==1 || systemUser.getSystemRoleId()==2){
            if(systemUser.getSystemRoleId()==1){
                    wrapper.ne(Complaint::getProblemType,"检举");
                }
                if(accountLevel==3){
                    String streetId = systemUser.getStreetId();
                    List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, streetId)).stream().map(ComAct::getCommunityId).collect(Collectors.toList());
                    wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).or(wrapper1 ->wrapper1.in(Complaint::getSuperiorId,ids).eq(Complaint::getNowLevel,4));
                }
                if(accountLevel==4){
                wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel());
                }
            }else {
                wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel())
                        .eq(Complaint::getAssignPersonId,systemUser.getOneDepartmentId());
            }
        }
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        List<Complaint> complaints =complaintService.list(wrapper);
        // 第一部分数据
        AnalyticStatisticsOneVo analyticStatisticsOneVo = complaintService.analyticStatisticsOne(query,complaints,simpleDateFormat);
        AnalyticStatisticsOneVo analyticStatisticsOneVo = complaintService.analyticStatisticsOne(query,complaints,simpleDateFormat,systemUser.getAccountLevel());
        // 第二部分数据
        List<AnalyticStatisticsTwoVo> analyticStatisticsTwoVos =complaintService.analyticStatisticsTwo(query.getTime(),complaints,simpleDateFormat);
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/DepartmentController.java
@@ -8,6 +8,7 @@
import com.panzhihua.common.model.vos.west.SystemUserVo;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.westcommittee.model.dto.UpdateStatusDeptDto;
import com.panzhihua.westcommittee.model.entity.ComAct;
import com.panzhihua.westcommittee.model.entity.Department;
import com.panzhihua.westcommittee.model.entity.SystemUser;
import com.panzhihua.westcommittee.service.*;
@@ -101,26 +102,32 @@
    @ApiOperation(value = "获取单位列表", tags = {"西区纪委后台-单位管理"})
    @OperLog(operModul = "西区纪委后台",operType = 0, businessType = "获取单位列表")
    public R<List<Department>> getList(String name,Integer level,String code,int type){
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        if(level==null){
            List<Department> list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name));
            return  R.ok(list4);
        }else {
            if(loginUserInfoWest.getSystemRoleId()!=1){
                return  R.ok(new ArrayList<>());
            }
            level=loginUserInfoWest.getAccountLevel();
            type=2;
        }
            List<Department> list4=new ArrayList<>();
            if(level==2 && type==1){
                list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 2));
            }else if(level==2 && type==2){
                 list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).ge( Department::getTier, 2));
            }else  if(level==3 && type==1){
                list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3));
                list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, loginUserInfoWest.getStreetId()));
            }else if(level==3 && type==2){
                 list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).ge( Department::getTier, 3));
                List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, loginUserInfoWest.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList());
                list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, loginUserInfoWest.getStreetId())
                        .or(w->w.eq(Department::getTier,4).in(Department::getCommunityId,ids)));
            }else  if(level==4 && type==1){
                list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 4));
                list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 4).eq(Department::getCommunityId,loginUserInfoWest.getCommunityId()));
            }else if(level==4 && type==2){
                list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).ge(Department::getTier, 4));
                list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq(Department::getTier, 4).eq(Department::getCommunityId,loginUserInfoWest.getCommunityId()));
            }
            return R.ok(list4);
        }
    }
@@ -128,7 +135,22 @@
    @ApiOperation(value = "获取单位列表1", tags = {"西区纪委后台-单位管理"})
    @OperLog(operModul = "西区纪委后台",operType = 0, businessType = "获取单位列表")
    public R<Page<Department>> getDeptList(String name,int pageNum,int pageSize){
        Page<Department> list4 = departmentService.page(new Page<Department>(pageNum,pageSize),new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).or().eq(StringUtils.isNotEmpty(name),Department::getId,name));
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        if(loginUserInfoWest.getSystemRoleId()!=1){
            return  R.ok(new Page<>());
        }
        Integer accountLevel = loginUserInfoWest.getAccountLevel();
        Page<Department> list4 = null;
        if(accountLevel==2 ){
           list4 = departmentService.page(new Page<Department>(pageNum,pageSize),new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).or().eq(StringUtils.isNotEmpty(name),Department::getId,name).ge(Department::getTier,accountLevel));
        }else if(accountLevel==3){
            String streetId = loginUserInfoWest.getStreetId();
            List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, streetId)).stream().map(ComAct::getCommunityId).collect(Collectors.toList());
              list4 = departmentService.page(new Page<Department>(pageNum,pageSize),new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).or().eq(StringUtils.isNotEmpty(name),Department::getId,name).eq(Department::getTier,accountLevel).eq(Department::getStreetId,streetId)
                    .or(department -> department.and(department1 -> department1.eq(Department::getTier, 4).in(Department::getCommunityId, ids))));
        }else if(accountLevel==4){
             list4 = departmentService.page(new Page<Department>(pageNum,pageSize),new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).or().eq(StringUtils.isNotEmpty(name),Department::getId,name).eq(Department::getTier,4).eq(Department::getCommunityId,loginUserInfoWest.getCommunityId()));
        }
        for (Department department : list4.getRecords()) {
            int count = systemUserService.count(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getOneDepartmentId, department.getId()));
            department.setUserCount(count);
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/MgtComplaintController.java
@@ -4,17 +4,19 @@
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.LoginUserInfoVO;
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.dto.*;
import com.panzhihua.westcommittee.model.entity.Complaint;
import com.panzhihua.westcommittee.model.entity.ComplaintComment;
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.IComplaintCommentService;
import com.panzhihua.westcommittee.service.IComplaintService;
import com.panzhihua.westcommittee.service.IDepartmentService;
import com.panzhihua.westcommittee.service.ISystemUserService;
@@ -23,13 +25,18 @@
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import static cn.hutool.core.util.ObjectUtil.isNull;
/**
 * @author mitao
@@ -43,6 +50,7 @@
    private final IComplaintService complaintService;
    private final ISystemUserService systemUserService;
    private final IDepartmentService departmentService;
    private final IComplaintCommentService complaintCommentService;
    @PostMapping("/save")
    @ApiOperation(value = "录入诉求")
@@ -78,7 +86,11 @@
    @PostMapping("/assignComplain")
    @ApiOperation(value = "分配诉求")
    public R<?> assignComplain(@Valid@RequestBody AssignComplainDto dto) {
        complaintService.assignComplain(getLoginUserInfo(),dto.getComplainId(),dto.getDeptId(),dto.getRemark());
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
        loginUserInfoVO.setPhone(loginUserInfoWest.getPhone());
        loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId()));
        complaintService.assignComplain(loginUserInfoVO,dto.getComplainId(),dto.getDeptId(),dto.getRemark(),dto.getProblemType());
        return R.ok();
    }
@@ -94,11 +106,11 @@
    @ApiOperation("诉求详情")
    @GetMapping("/detail/{id}")
    public R<ComplaintVO> detail(@ApiParam(name = "id", value = "诉求id", required = true) @PathVariable("id") Long id) {
        return R.ok(complaintService.getDetailMgt(id));
    }
//    @ApiOperation("诉求详情")
//    @GetMapping("/detail/{id}")
//    public R<ComplaintVO> detail(@ApiParam(name = "id", value = "诉求id", required = true) @PathVariable("id") Long id) {
//        return R.ok(complaintService.getDetailMgt(id));
//    }
    @ApiOperation("导出")
    @PostMapping("/export")
    @SysLog(operatorCategory = "诉求导出",operId = 9)
@@ -128,7 +140,6 @@
    }
    @ApiOperation("社区问题单、问题处理单、协调通知单 下载")
    @GetMapping("/download-file/{id}/{type}")
    @SysLog(operatorCategory = "单导出",operId = 10)
@@ -141,4 +152,202 @@
            throw new RuntimeException(e);
        }
    }
    @ApiOperation("诉求详情")
    @GetMapping("/detail/{id}")
    public R<ComplaintVO> detail(Long id) {
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
        loginUserInfoVO.setPhone(loginUserInfoWest.getPhone());
        loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId()));
        return R.ok(complaintService.detail(id,loginUserInfoVO));
    }
    @PostMapping("/save-process")
    @ApiOperation("办理进度录入")
    public R<?> saveProcess(@Valid @RequestBody ComplaintProcessDTO dto){
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
        loginUserInfoVO.setPhone(loginUserInfoWest.getPhone());
        complaintService.saveProcess(dto,loginUserInfoVO);
        return R.ok();
    }
    @PostMapping("/save-result")
    @ApiOperation("办理结果录入")
    public R<?> saveResult(@RequestBody ComplaintCompletionDTO dto){
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
        loginUserInfoVO.setPhone(loginUserInfoWest.getPhone());
        loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId()));
        complaintService.saveResult(dto,loginUserInfoVO);
        return R.ok();
    }
    /**
     * 问题上报
     */
    @PostMapping("/report")
    @ApiOperation(value = "问题上报")
    public R<?> report(@RequestBody ComplaintReportDTO complaintReportDTO) {
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
        loginUserInfoVO.setPhone(loginUserInfoWest.getPhone());
        loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId()));
        complaintService.saveReport(complaintReportDTO, loginUserInfoVO);
        return R.ok();
    }
    /**
     * 延期申请
     */
    @PostMapping("/saveDelay")
    @ApiOperation(value = "延期申请")
    public R<?> saveDelay(@Valid @RequestBody ComplaintDelayDTO dto){
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
        loginUserInfoVO.setPhone(loginUserInfoWest.getPhone());
        loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId()));
        complaintService.saveDelay(dto, loginUserInfoVO);
        return R.ok();
    }
    /**
     * 延期审核
     */
    @PostMapping("/delayAudit")
    @ApiOperation(value = "延期审核")
    public R<?> delayAudit(@RequestBody ComplaintDelayAuditDTO dto) {
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
        loginUserInfoVO.setPhone(loginUserInfoWest.getPhone());
        loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId()));
        complaintService.delayAudit(dto, loginUserInfoVO);
        return R.ok();
    }
    /**
     * 上报审核
     */
    @PostMapping("/reportAudit")
    @ApiOperation(value = "问题上报审核并指派")
    public R<?> reportAudit(@RequestBody ComplaintReporAuditDTO dto) {
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
        loginUserInfoVO.setPhone(loginUserInfoWest.getPhone());
        loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId()));
        complaintService.reportAudit(dto, loginUserInfoVO);
        return R.ok();
    }
    @PostMapping("/setProblemType")
    @ApiOperation(value = "分配问题类型")
    public R<?> assignComplain(@Valid @RequestBody SetProblemTypeDto dto) {
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
        loginUserInfoVO.setPhone(loginUserInfoWest.getPhone());
        loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId()));
        // 判断是否管理员
        complaintService.setProblemType(loginUserInfoVO,dto);
        return R.ok();
    }
    /**
     * 评价诉求
     * @param complaintComment
     * @return
     */
    @PostMapping("/commentComplaint")
    @ApiOperation(value = "评价诉求")
    public R<?> commentComplaint(@RequestBody ComplaintComment complaintComment){
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
        loginUserInfoVO.setPhone(loginUserInfoWest.getPhone());
        loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId()));
        int count = complaintCommentService.count(new LambdaQueryWrapper<ComplaintComment>().eq(ComplaintComment::getComplaintId, complaintComment.getComplaintId())
                .eq(ComplaintComment::getDelFlag, 0));
        if(0 != count){
            return R.fail("不能重复评价");
        }
        Long userId = loginUserInfoVO.getUserId();
        complaintComment.setUserId(userId);
        complaintComment.setCreateTime(new Date());
        complaintComment.setCreateBy(userId);
        complaintComment.setUpdateBy(userId);
        complaintComment.setUpdateTime(new Date());
        complaintComment.setDelFlag(0);
        complaintCommentService.save(complaintComment);
        Complaint complaint = complaintService.getById(complaintComment.getComplaintId());
        complaint.setStatus(8);
        complaint.setCommentRate(complaintComment.getRate());
        complaintService.updateById(complaint);
        // 不满意 重新生成诉求
        if(complaintComment.getRate()==0){
            // 获取当前日期(年月日)
            String datePrefix = new SimpleDateFormat("yyyyMMdd").format(new Date());
            // 查询当前日期的最大流水号
            Complaint lastComplaint = complaintService.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 complaint1 = new Complaint();
            BeanUtils.copyProperties(complaint,complaint1);
            complaint1.setStatus(0);
            complaint1.setSerialNumber(serialNumber);
            complaint1.setAssignStatus(0);
            complaint1.setCreateTime(new Date());
            complaint1.setId(null);
            complaint1.setCompletionTime(null);
            complaint1.setCompletionUserId(null);
            complaint1.setCompletionUsername(null);
            complaint1.setCompletionUserPhone(null);
            complaint1.setCompletionImages(null);
            complaint1.setCompletionUserLevel(null);
            complaint1.setCompletionDescription(null);
            complaint1.setCompletionVideos(null);
            complaint1.setCompletionOtherDescription(null);
            complaint1.setRemark(null);
            complaint1.setNowLevelTime(new Date());
            complaint1.setNowLevelSms(0);
            complaint1.setRedispatch(1);
            complaintService.save(complaint1);
        }
        return R.ok();
    }
    /**
     * 上报撤回
     */
    @PostMapping("/revoke")
    @ApiOperation(value = "诉求上报撤回")
    public R<?> reportWithdraw(@RequestBody ComplaintReportWithdrawDTO dto) {
        SystemUserVo loginUserInfoWest = getLoginUserInfoWest();
        LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
        loginUserInfoVO.setPhone(loginUserInfoWest.getPhone());
        loginUserInfoVO.setUserId(Long.valueOf(loginUserInfoWest.getId()));
        complaintService.reportWithdraw(dto, loginUserInfoVO);
        return R.ok();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemMenuController.java
@@ -1,5 +1,6 @@
package com.panzhihua.westcommittee.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.interfaces.OperLog;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.westcommittee.model.entity.SystemMenu;
@@ -20,7 +21,7 @@
@Api
@RestController
@RequestMapping("/systemMenu")
public class SystemMenuController {
public class SystemMenuController extends BaseController {
    
    @Resource
    private ISystemMenuService systemMenuService;
@@ -29,6 +30,6 @@
    @ApiOperation(value = "获取菜单列表", tags = {"西区纪委后台-角色管理"})
    @OperLog(operModul = "西区纪委后台",operType = 0, businessType = "获取菜单列表")
    public R<List<SystemMenu>> getSystemMenuList(){
        return R.ok(systemMenuService.getSystemMenuList());
        return R.ok(systemMenuService.getSystemMenuList(getLoginUserInfoWest()));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemUserController.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.interfaces.OperLog;
import com.panzhihua.common.model.vos.LoginReturnVO;
@@ -119,34 +120,13 @@
        Set<String> collect1 = new HashSet<>();
        if(collect.size() > 0){
            LambdaQueryWrapper<SystemMenu> queryWrapper = new LambdaQueryWrapper<SystemMenu>().in(SystemMenu::getId, collect);
            switch (systemUser.getAccountLevel()){
                case 3:
            if(systemUser.getSystemRoleId()!=1){
                    queryWrapper.notIn(SystemMenu::getUrl, Arrays.asList("/system_setting/position_management", "/system_setting/position_management/add", "/system_setting/position_management/del",
                            "/system_setting/role_management", "/system_setting/role_management/add", "/system_setting/role_management/edit", "/system_setting/role_management/del",
                            "/work_order_transaction_management/work_order_item_configuration", "/work_order_transaction_management/work_order_item_configuration/save",
                            "/work_order_transaction_management/problem_type_management", "/work_order_transaction_management/problem_type_management/add",
                            "/work_order_transaction_management/problem_type_management/edit", "/work_order_transaction_management/problem_type_management/del", "/work_order_transaction_management/banner_management",
                            "/work_order_transaction_management/banner_management/add", "/work_order_transaction_management/banner_management/edit", "/work_order_transaction_management/banner_management/del"));
                    break;
                case 4:
                    queryWrapper.notIn(SystemMenu::getUrl, Arrays.asList("/system_setting/position_management", "/system_setting/position_management/add", "/system_setting/position_management/del",
                            "/system_setting/role_management", "/system_setting/role_management/add", "/system_setting/role_management/edit", "/system_setting/role_management/del",
                            "/work_order_transaction_management/work_order_item_configuration", "/work_order_transaction_management/work_order_item_configuration/save",
                            "/work_order_transaction_management/problem_type_management", "/work_order_transaction_management/problem_type_management/add",
                            "/work_order_transaction_management/problem_type_management/edit", "/work_order_transaction_management/problem_type_management/del", "/work_order_transaction_management/banner_management",
                            "/work_order_transaction_management/banner_management/add", "/work_order_transaction_management/banner_management/edit", "/work_order_transaction_management/banner_management/del"));
                    break;
                case 5:
                    queryWrapper.notIn(SystemMenu::getUrl, Arrays.asList("/system_setting/position_management", "/system_setting/position_management/add", "/system_setting/position_management/del",
                            "/system_setting/role_management", "/system_setting/role_management/add", "/system_setting/role_management/edit", "/system_setting/role_management/del",
                            "/system_setting/people_management", "/system_setting/people_management/add", "/system_setting/people_management/edit", "/system_setting/people_management/del",
                            "/system_setting/people_management/freeze", "/system_setting/unit_management", "/system_setting/people_management/detail", "/system_setting/unit_management/add",
                            "/system_setting/unit_management/edit", "/system_setting/unit_management/del", "/work_order_transaction_management/work_order_item_configuration",
                            "/work_order_transaction_management/work_order_item_configuration/save", "/work_order_transaction_management/problem_type_management",
                            "/work_order_transaction_management/problem_type_management/add", "/work_order_transaction_management/problem_type_management/edit",
                            "/work_order_transaction_management/problem_type_management/del", "/work_order_transaction_management/banner_management",
                            "/work_order_transaction_management/banner_management/add", "/work_order_transaction_management/banner_management/edit", "/work_order_transaction_management/banner_management/del"));
                    break;
                        "/work_order_transaction_management/banner_management/add", "/work_order_transaction_management/banner_management/edit", "/work_order_transaction_management/banner_management/del","/complaint/assign"));
            }
            List<SystemMenu> systemMenus = systemMenuService.list(queryWrapper);
            collect1 = systemMenus.stream().map(SystemMenu::getUrl).collect(Collectors.toSet());
@@ -196,6 +176,9 @@
    public R<IPage<SystemUserListVo>> list(SystemUserList query){
        Integer id = this.getLoginUserInfoWest().getId();
        SystemUser user = systemUserService.getById(id);
        if(user.getSystemRoleId()!=1){
            return R.ok(new Page<>());
        }
        IPage<SystemUserListVo> list = systemUserService.list(user, query);
        return R.ok(list);
    }
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/controller/ComplaintController.java
@@ -4,6 +4,7 @@
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.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.westcommittee.annotation.DistributedLock;
import com.panzhihua.westcommittee.model.dto.*;
@@ -17,6 +18,7 @@
import com.panzhihua.westcommittee.service.IComplaintService;
import com.panzhihua.westcommittee.service.IProblemTypeService;
import com.panzhihua.westcommittee.warpper.GetHouseAddressQuery;
import com.panzhihua.westcommittee.warpper.IdentityInformation;
import io.swagger.annotations.*;
import lombok.RequiredArgsConstructor;
import org.checkerframework.checker.units.qual.C;
@@ -126,10 +128,6 @@
    @PostMapping("/save-process")
    @ApiOperation("办理进度录入")
    public R<?> saveProcess(@Valid @RequestBody ComplaintProcessDTO dto){
        Complaint byId = complaintService.getById(dto.getComplaintId());
        if(byId.getAssignStatus()==0){
            return R.fail("该诉求未分配");
        }
        complaintService.saveProcess(dto,getLoginUserInfo());
        return R.ok();
    }
@@ -153,12 +151,6 @@
    @PostMapping("/report")
    @ApiOperation(value = "问题上报")
    public R<?> report(@RequestBody ComplaintReportDTO complaintReportDTO) {
        Complaint byId = complaintService.getById(complaintReportDTO.getComplaintId());
        if(byId.getAssignStatus()==0){
            return R.fail("该诉求未分配");
        }
        complaintService.saveReport(complaintReportDTO, getLoginUserInfo());
        return R.ok();
    }
@@ -180,10 +172,6 @@
    @PostMapping("/saveDelay")
    @ApiOperation(value = "延期申请")
    public R<?> saveDelay(@Valid @RequestBody ComplaintDelayDTO dto){
        Complaint byId = complaintService.getById(dto.getComplaintId());
        if(byId.getAssignStatus()==0){
            return R.fail("该诉求未分配");
        }
        complaintService.saveDelay(dto, getLoginUserInfo());
        return R.ok();
    }
@@ -237,11 +225,20 @@
    @ApiOperation(value = "分配诉求")
    public R<?> assignComplain(@Valid@RequestBody AssignComplainDto dto) {
        complaintService.assignComplain(getLoginUserInfo(),dto.getComplainId(),dto.getDeptId(),dto.getRemark());
        complaintService.assignComplain(getLoginUserInfo(),dto.getComplainId(),dto.getDeptId(),dto.getRemark(),dto.getProblemType());
        return R.ok();
    }
    @PostMapping("/setProblemType")
    @ApiOperation(value = "分配问题类型")
    public R<?> assignComplain(@Valid @RequestBody SetProblemTypeDto dto) {
        // 判断是否管理员
        complaintService.setProblemType(getLoginUserInfo(),dto);
        return R.ok();
    }
    /**
     * 评价诉求
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/controller/PartyMemberController.java
@@ -57,7 +57,7 @@
    public R<?> edit(@Valid @RequestBody PartyMemberApplicationRequest dto) {
        LoginUserInfoVO loginUserInfo = getLoginUserInfo();
        String phone = loginUserInfo.getPhone();
        PartyMember partyMember = partyMemberService.getOne(new LambdaUpdateWrapper<PartyMember>()
        PartyMember partyMember = partyMemberService.getOne(new LambdaQueryWrapper<PartyMember>()
                .eq(PartyMember::getPhone, phone));
        if (partyMember == null){
            return R.fail("请先完善党员信息");
@@ -77,7 +77,7 @@
    public R<?> detail() {
        LoginUserInfoVO loginUserInfo = getLoginUserInfo();
        String phone = loginUserInfo.getPhone();
        return R.ok(partyMemberService.getOne(new LambdaUpdateWrapper<PartyMember>()
        return R.ok(partyMemberService.getOne(new LambdaQueryWrapper<PartyMember>()
                .eq(PartyMember::getPhone, phone)
                .eq(PartyMember::getDelFlag, 0)));
    }
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/controller/StaticsController.java
@@ -1,15 +1,24 @@
package com.panzhihua.westcommittee.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
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.ComStreet;
import com.panzhihua.westcommittee.model.entity.Complaint;
import com.panzhihua.westcommittee.model.entity.SystemUser;
import com.panzhihua.westcommittee.model.query.AnalyticStatisticsQuery;
import com.panzhihua.westcommittee.model.query.AppStaticsQuery;
import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsFourVo;
import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsOneVo;
import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsThreeVo;
import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsTwoVo;
import com.panzhihua.westcommittee.model.vo.RegionVO;
import com.panzhihua.westcommittee.model.vo.*;
import com.panzhihua.westcommittee.service.IComActService;
import com.panzhihua.westcommittee.service.IComStreetService;
import com.panzhihua.westcommittee.service.IComplaintService;
import com.panzhihua.westcommittee.service.IdentityInformationService;
import com.panzhihua.westcommittee.service.impl.StaticsService;
import com.panzhihua.westcommittee.warpper.IdentityInformation;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -20,7 +29,10 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.stream.Collectors;
/**
 * @author mitao
@@ -32,6 +44,10 @@
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
public class StaticsController extends BaseController {
    private final StaticsService staticsService;
    private final IdentityInformationService identityInformationService;
    private final IComStreetService comStreetService;
    private final IComActService comActService;
    private final IComplaintService complaintService;
    @GetMapping("/region-tree")
    @ApiOperation("获取区域树")
@@ -63,4 +79,98 @@
        LoginUserInfoVO loginUserInfo = getLoginUserInfo();
        return R.ok(staticsService.queryStaticsPartFour(query,loginUserInfo));
    }
    @PostMapping("/data")
    @ApiOperation(value = "分析统计", tags = {"西区纪委小程序-分析统计"})
    public R<AnalyticStatisticsDataVo> data(@Valid @RequestBody AnalyticStatisticsQuery query){
        LoginUserInfoVO loginUserInfo = getLoginUserInfo();
        IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfo);
        SystemUser systemUser = identityInformation.getSystemUser();
        AnalyticStatisticsDataVo analyticStatisticsDataVo = new AnalyticStatisticsDataVo();
        if(systemUser==null || systemUser.getSystemRoleId()>2){
            return R.ok(analyticStatisticsDataVo);
        }
        Integer accountLevel = systemUser.getAccountLevel();
        LambdaQueryWrapper<Complaint> wrapper = new LambdaQueryWrapper<>();
        if(query.getDistrictCode()!=null){
            // 没有市权限 也没有该区权限
            if(accountLevel!=2){
                throw new ServiceException("没有该区县权限");
            }
            wrapper.eq(Complaint::getSuperiorId, query.getDistrictCode());
        }
        if(query.getStreetId()!=null){
            // 获取街道上一级查看是否有上级权限
            ComStreet comStreet = comStreetService.getById(query.getStreetId());
            if(comStreet==null){
                throw new ServiceException("没有该街道权限");
            }
            // 没有市级 上级区县  本级街道权限
            if(accountLevel==2 || (accountLevel==3 && systemUser.getDistrictsCode().equals(query.getDistrictCode().toString()))){
                wrapper.eq(Complaint::getSuperiorId, query.getStreetId());
            }else {
                throw new ServiceException("没有该街道权限");
            }
        }
        if(query.getCommunityId()!=null){
            ComAct comAct = comActService.getById(query.getCommunityId());
            if (comAct == null) {
                throw new ServiceException("没有该社区权限");
            }
            // 判断是否有上面的4个权限
            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("没有该社区权限");
            }
        }
        // 都为空 查他有的
        if(query.getCityCode()==null && query.getDistrictCode()==null && query.getStreetId()==null && query.getCommunityId()==null){
            if(systemUser.getSystemRoleId()==1 || systemUser.getSystemRoleId()==2){
                if(systemUser.getSystemRoleId()==1){
                    wrapper.ne(Complaint::getProblemType,"检举");
                }
                if(accountLevel==3){
                    String streetId = systemUser.getStreetId();
                    List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, streetId)).stream().map(ComAct::getCommunityId).collect(Collectors.toList());
                    wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).or(wrapper1 ->wrapper1.in(Complaint::getSuperiorId,ids).eq(Complaint::getNowLevel,4));
                }
                if(accountLevel==4){
                    wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel());
                }
            }else {
                wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel())
                        .eq(Complaint::getAssignPersonId,systemUser.getOneDepartmentId());
            }
        }
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        List<Complaint> complaints =complaintService.list(wrapper);
        // 第一部分数据
        AnalyticStatisticsOneVo analyticStatisticsOneVo = complaintService.analyticStatisticsOne(query,complaints,simpleDateFormat,systemUser.getAccountLevel());
        // 第二部分数据
        List<AnalyticStatisticsTwoVo> analyticStatisticsTwoVos =complaintService.analyticStatisticsTwo(query.getTime(),complaints,simpleDateFormat);
        // 第三部分数据
        List<AnalyticStatisticsThreeVo> analyticStatisticsThreeVos =complaintService.analyticStatisticsThree(query.getRank(), complaints);
        // 第四部分数据
        AnalyticStatisticsFourVo analyticStatisticsFourVos =complaintService.analyticStatisticsFour(complaints);
        analyticStatisticsDataVo.setAnalyticStatisticsOneVo(analyticStatisticsOneVo);
        analyticStatisticsDataVo.setAnalyticStatisticsTwoVos(analyticStatisticsTwoVos);
        analyticStatisticsDataVo.setAnalyticStatisticsThreeVos(analyticStatisticsThreeVos);
        analyticStatisticsDataVo.setAnalyticStatisticsFourVo(analyticStatisticsFourVos);
        return R.ok(analyticStatisticsDataVo);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/dao/ComplaintMapper.java
@@ -85,6 +85,8 @@
     */
    Page<ComplaintVO> pageList(Page<ComplaintVO> page, @Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo);
    List<ComplaintVO> pageListExport(@Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo);
    /**
     * 诉求列表
     * @param query
@@ -112,21 +114,20 @@
    Page<AppComplaintRejectVO> queryRejectRecordPage(Page<ComplaintVO> page, @Param("keyword") String keyword,
                                                     @Param("accountLevel") Integer accountLevel, @Param("targetId") Long targetId);
    List<Complaint> queryCompliantList(@Param("targetId") Long targetId, @Param("accountLevel") Integer accountLevel, @Param("loginUserInfo") LoginUserInfoVO loginUserInfo,  @Param("query")AppStaticsQuery query);
    List<Complaint> getStatusForList(@Param("ids") List<Long> ids);
    List<Complaint> getStatusForList(@Param("ids") List<Long> ids, @Param("level") Integer level);
    Page<ComplaintVO> selectComplaintPage3(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("accountLevel") Integer accountLevel, @Param("targetId") Long targetId);
    Page<ComplaintVO> selectComplaintPage3(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("accountLevel") Integer accountLevel, @Param("targetId") Long targetId, @Param("roleId") Integer roleId);
    Page<ComplaintVO> selectComplaintPage4(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("oneDepartmentId") Integer oneDepartmentId);
    Page<ComplaintVO> selectComplaintPage5(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query,  @Param("streetId") String streetId,@Param("ids") List<Long> ids);
    Page<ComplaintVO> selectComplaintPage5(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query,  @Param("streetId") String streetId,@Param("ids") List<Long> ids,@Param("roleId") Integer roleId);
    Page<ComplaintVO> selectComplaintPage6(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("communityId") Long communityId, @Param("ids") List<Integer> ids);
    Page<ComplaintVO> selectComplaintPage6(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("communityId") Long communityId, @Param("ids") List<Integer> ids,@Param("roleId") Integer roleId);
    Page<ComplaintVO> pageScreenList(@Param("page") Page<ComplaintVO> page, @Param("query") ScreenComplaintQuery query);
@@ -138,9 +139,18 @@
    Page<ComplaintVO> pageList1(Page<ComplaintVO> page, @Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo);
    List<ComplaintVO> pageList1Export(@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);
    List<ComplaintVO> pageList2Export( @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);
    List<ComplaintVO> pageList3Export(@Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo);
    List<Complaint> queryCompliantList(@Param("accountLevel") Integer accountLevel, @Param("systemRoleId") Integer systemRoleId, @Param("query") AppStaticsQuery query);
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/dao/SystemUserMapper.java
@@ -51,4 +51,6 @@
    String getCreateByIdPhone(@Param("createBy") Long createBy);
    IPage<SystemUserListVo> list1(@Param("page") Page page, @Param("user") SystemUser user, @Param("query") SystemUserList query, @Param("deptIds") List<Integer> deptIds);
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/enums/ComplaintExportEnum.java
@@ -10,7 +10,7 @@
    EXTENDED(1, "延期办理"),
    OVERDUE(2, "超时办理"),
    COMPLETED(3, "已办结"),
    REPORT_PENDING_AUDIT(4, "上报待审核"),
    REPORT_PENDING_AUDIT(5, "上报待审核"),
    FINISHED(8, "已办结");//用于导出枚举值映射,实际状态为已评论
    private final Integer code;
    private final String desc;
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/dto/AssignComplainDto.java
@@ -16,6 +16,10 @@
   @ApiModelProperty("部门id")
   @NotNull
   private Integer deptId;
   @ApiModelProperty("问题类型")
   private String problemType;
   @ApiModelProperty("备注")
   private String remark;
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/dto/ComplaintTimeout.java
@@ -13,6 +13,7 @@
    private Long superiorId;
    private Date closingTime;
    private String problemType;
    private Integer nowLevel;
    private Integer assignStatus;
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/dto/SetProblemTypeDto.java
New file
@@ -0,0 +1,20 @@
package com.panzhihua.westcommittee.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
@ApiModel("分配问题类型Dto")
public class SetProblemTypeDto {
    @ApiModelProperty("诉求id")
    @NotNull(message = "诉求id不能为空")
    private Long complaintId;
    @ApiModelProperty("问题类型")
    @NotBlank(message = "问题类型不能为空")
    private String problemType;
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/entity/Complaint.java
@@ -52,7 +52,6 @@
    @ApiModelProperty(value = "问题类型(事件类型)")
    @TableField("problem_type")
    @NotBlank(message = "问题类型不能为空")
    private String problemType;
    @ApiModelProperty(value = "群众姓名(诉求人)")
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/scheduled/ComplaintTasks.java
@@ -105,7 +105,7 @@
              );
        if(!complaintTimeoutList.isEmpty()) {
            // 后续当前不在发送
            // 当前不在发送
            complaintService.update(new LambdaUpdateWrapper<Complaint>().in(Complaint::getId, complaintTimeoutList.stream().map(ComplaintTimeout::getComplaintId).collect(Collectors.toList())).set(Complaint::getNowLevelSms, 1));
        }
@@ -127,7 +127,7 @@
            List<String> districtPhoneList1 = districtUserList.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList());
            collect.forEach(complaintTimeout -> {
                // 发送短信
                if(!districtPhoneList.isEmpty()){
                if(!districtPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){
                    AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList,complaintTimeout.getSerialNumber());
                }
                if(!districtPhoneList1.isEmpty()){
@@ -151,7 +151,7 @@
                        List<String> districtPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList());
                        List<String> districtPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList());
                        // 发送短信
                        if(!districtPhoneList2.isEmpty()){
                        if(!districtPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){
                            AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList2,complaintTimeout.getSerialNumber());
                        }
                        if(!districtPhoneList3.isEmpty()){
@@ -159,7 +159,7 @@
                        }
                    }else {
                        // 发送短信
                        if(!districtPhoneList.isEmpty()){
                        if(!districtPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){
                            AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList,complaintTimeout.getSerialNumber());
                        }
                        if(!districtPhoneList1.isEmpty()){
@@ -186,7 +186,7 @@
               List<String> streetPhoneList = streetUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList());
               List<String> streetPhoneList1 = streetUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList());
               // 发送短信
                if(!streetPhoneList.isEmpty()){
                if(!streetPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){
                    AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList,complaintTimeout.getSerialNumber());
                }
                if(!streetPhoneList1.isEmpty()){
@@ -206,7 +206,7 @@
                        List<String> streetPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList());
                        List<String> streetPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList());
                        // 发送短信
                        if(!streetPhoneList2.isEmpty()){
                        if(!streetPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){
                            AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList2,complaintTimeout.getSerialNumber());
                        }
                        if(!streetPhoneList3.isEmpty()){
@@ -216,7 +216,7 @@
                        List<String> streetPhoneList = streetUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList());
                        List<String> streetPhoneList1 = streetUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList());
                        // 发送短信
                        if(!streetPhoneList.isEmpty()){
                        if(!streetPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){
                            AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList,complaintTimeout.getSerialNumber());
                        }
                        if(!streetPhoneList1.isEmpty()){
@@ -235,6 +235,8 @@
        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)
@@ -244,7 +246,7 @@
                List<String> communityPhoneList1 = communityUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList());
                // 发送短信
                if(!communityPhoneList.isEmpty()){
                if(!communityPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){
                    AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList, complaintTimeout.getSerialNumber());
                }
                if(!communityPhoneList1.isEmpty()){
@@ -264,7 +266,7 @@
                        List<String> communityPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList());
                        List<String> communityPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList());
                        // 发送短信
                        if(!communityPhoneList2.isEmpty()){
                        if(!communityPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){
                            AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList2, complaintTimeout.getSerialNumber());
                        }
                        if(!communityPhoneList3.isEmpty()){
@@ -274,7 +276,7 @@
                        List<String> communityPhoneList = communityUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList());
                        List<String> communityPhoneList1 = communityUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList());
                        // 发送短信
                        if(!communityPhoneList.isEmpty()){
                        if(!communityPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举")){
                            AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList, complaintTimeout.getSerialNumber());
                        }
                        if(!communityPhoneList1.isEmpty()){
@@ -287,6 +289,10 @@
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/IComplaintService.java
@@ -50,6 +50,7 @@
     * @return
     */
    ComplaintVO detail(Long id, LoginUserInfoVO  loginUserInfoVO);
    /**
     * 保存办理进度
     *
@@ -184,7 +185,7 @@
     * @param query
     * @return
     */
    AnalyticStatisticsOneVo analyticStatisticsOne(AnalyticStatisticsQuery query,List<Complaint> complaints, SimpleDateFormat simpleDateFormat);
    AnalyticStatisticsOneVo analyticStatisticsOne(AnalyticStatisticsQuery query,List<Complaint> complaints, SimpleDateFormat simpleDateFormat,Integer level);
    /**
@@ -236,7 +237,7 @@
     * @param complainId
     * @param userId
     */
    void assignComplain(LoginUserInfoVO loginUserInfo, Long complainId, Integer userId,String remark);
    void assignComplain(LoginUserInfoVO loginUserInfo, Long complainId, Integer userId,String remark,String problemType);
    List<DispatchVO> getAllocationList(LoginUserInfoVO loginUserInfo);
@@ -260,4 +261,9 @@
    void saveComplaintAdmin(Complaint complaint, SystemUserVo loginUserInfoWest);
    void setProblemType(LoginUserInfoVO loginUserInfo, SetProblemTypeDto dto);
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/ISystemMenuService.java
@@ -1,6 +1,7 @@
package com.panzhihua.westcommittee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.vos.west.SystemUserVo;
import com.panzhihua.westcommittee.model.entity.SystemMenu;
import java.util.List;
@@ -15,5 +16,5 @@
     * 获取获取系统菜单列表
     * @return
     */
    List<SystemMenu> getSystemMenuList();
    List<SystemMenu> getSystemMenuList(SystemUserVo systemUserVo);
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/ComplaintServiceImpl.java
@@ -302,29 +302,29 @@
            page = baseMapper.selectComplaintPage2(page, query, accountLevel, targetId);
        } else if (accountLevel == 2) {
            // 西区单位  如果是西区单位,则只看自己上报的
            if (systemUser.getSystemRoleId() == 1) {
            if (systemUser.getSystemRoleId() == 1 || systemUser.getSystemRoleId() == 2) {
                // 是管理员 看所有的
                page = baseMapper.selectComplaintPage3(page, query, accountLevel, targetId);
                page = baseMapper.selectComplaintPage3(page, query, accountLevel, targetId,systemUser.getSystemRoleId() );
            } else {
                // 不是管理员 看到指派给我的单位的诉求
                page = baseMapper.selectComplaintPage4(page, query, systemUser.getOneDepartmentId());
            }
        } else if (accountLevel == 3) {
            // 街道 1
            if (systemUser.getSystemRoleId() == 1) {
            if (systemUser.getSystemRoleId() == 1 || systemUser.getSystemRoleId() == 2) {
                // 获取这个街道所管的社区id
                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);
                page = baseMapper.selectComplaintPage5(page, query, systemUser.getStreetId(), communityIds, systemUser.getSystemRoleId());
            } else {
                // 不是管理员 看指派给我的
                page = baseMapper.selectComplaintPage4(page, query, systemUser.getOneDepartmentId());
            }
        } else if (accountLevel == 4) {
            // 社区
            if (systemUser.getSystemRoleId() == 1) {
            if (systemUser.getSystemRoleId() == 1 || systemUser.getSystemRoleId() == 2) {
                // 是管理员
                page = baseMapper.selectComplaintPage6(page, query, systemUser.getCommunityId(), null);
                page = baseMapper.selectComplaintPage6(page, query, systemUser.getCommunityId(), null, systemUser.getSystemRoleId());
            } else {
                // 不是管理员 看到负责社区的所有诉求  和 上级下派来的诉求
                page = baseMapper.selectComplaintPage4(page, query, systemUser.getOneDepartmentId());
@@ -779,6 +779,10 @@
        }
        return detail;
    }
    @Override
@@ -1561,36 +1565,44 @@
     */
    @Override
    public Page<ComplaintVO> pageList(MgtComplaintQuery query, SystemUserVo loginUserInfo) {
        Page<ComplaintVO> complaintVOPage=new Page<>();
        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;
                complaintVOPage = baseMapper.pageList(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
            }else {
                Page<ComplaintVO> complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
                return complaintVOPage;
                complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
            }
        }
        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;
                complaintVOPage = baseMapper.pageList2(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo,communityIds);
            }else {
                Page<ComplaintVO> complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
                return complaintVOPage;
                complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
            }
        }
        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;
               complaintVOPage = baseMapper.pageList3(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
            }else {
                Page<ComplaintVO> complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
                complaintVOPage = baseMapper.pageList1(new Page<>(query.getPageNum(), query.getPageSize()), query, loginUserInfo);
            }
        }
        for (ComplaintVO record : complaintVOPage.getRecords()) {
            int count = complaintCommentService.count(new LambdaQueryWrapper<ComplaintComment>().eq(ComplaintComment::getComplaintId, record.getId()));
            if (count > 0) {
                record.setEvaluateButtonStatus(1);
            } else {
                if (record.getStatus() == 3 && loginUserInfo.getAccountLevel() == record.getNowLevel()) {
                    record.setEvaluateButtonStatus(0);
                } else {
                    record.setEvaluateButtonStatus(1);
                }
            }
        }
                return complaintVOPage;
            }
        }
        return new Page<>();
    }
    @Override
@@ -1630,7 +1642,32 @@
     */
    @Override
    public void export(MgtComplaintQuery query, SystemUserVo loginUserInfo) throws IOException {
        List<ComplaintVO> list = baseMapper.getList(query, loginUserInfo);
        List<ComplaintVO> list =null;
        if (loginUserInfo.getAccountLevel() == 2) {
            if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){
                list = baseMapper.pageListExport(query, loginUserInfo);
            }else {
                list = baseMapper.pageList1Export(query, loginUserInfo);
            }
        }
        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());
                list = baseMapper.pageList2Export(query, loginUserInfo,communityIds);
            }else {
                list = baseMapper.pageList1Export( query, loginUserInfo);
            }
        }
        if (loginUserInfo.getAccountLevel() == 4) {
            if(loginUserInfo.getSystemRoleId()==1 || loginUserInfo.getSystemRoleId()==2){
                list = baseMapper.pageList3Export(query, loginUserInfo);
            }else {
                list = baseMapper.pageList1Export( query, loginUserInfo);
            }
        }
        List<ComplaintExcel> complaintExcels = BeanUtil.copyToList(list, ComplaintExcel.class);
        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
        response.setCharacterEncoding("utf-8");
@@ -1641,7 +1678,10 @@
                .registerWriteHandler(new AutoColumnWidthStrategy())
                .doWrite(complaintExcels);
    }
//    ComplaintVO(reporter=何健豪, reporterId=1676144498628919300, superiorId2=510403, auditCreateBy=1892421828085837826, reporterLevel=2, reporterPhone=null, departmentName=西区-金江镇, reportTime=Tue Jun 03 15:06:01 CST 2025, comment=1111, nickname=null, phone=null, auditorName=null, auditorPhone=null, rejectReason=null, auditTime=null, complaintFlows=null, complaintProgresses=null, auditButtonStatus=null, withdrawButtonStatus=null, rate=null, complaintComment=null, listControlsButtonStatus=null, evaluateButtonStatus=0, voiceFileList=null, progressCount=null, assignmentCount=null, reportCount=null, remindStatus=0, remindTime=null, reportStr=自办, deptName=aa)
//    ComplaintVO(reporter=null, reporterId=null, superiorId2=null, auditCreateBy=null, reporterLevel=null, reporterPhone=null, departmentName=null, reportTime=null, comment=null, nickname=null, phone=null, auditorName=null, auditorPhone=null, rejectReason=null, auditTime=null, complaintFlows=null, complaintProgresses=null, auditButtonStatus=null, withdrawButtonStatus=null, rate=null, complaintComment=null, listControlsButtonStatus=null, evaluateButtonStatus=0, voiceFileList=null, progressCount=null, assignmentCount=null, reportCount=null, remindStatus=0, remindTime=null, reportStr=自办, deptName=aa)
//    ComplaintVO(reporter=刘, reporterId=1552661132500668416, superiorId2=510403, auditCreateBy=1892403820151992322, reporterLevel=2, reporterPhone=null, departmentName=西区-格里坪镇, reportTime=Fri Jun 27 10:04:18 CST 2025, comment=null, nickname=null, phone=null, auditorName=null, auditorPhone=null, rejectReason=null, auditTime=null, complaintFlows=null, complaintProgresses=null, auditButtonStatus=null, withdrawButtonStatus=null, rate=null, complaintComment=null, listControlsButtonStatus=null, evaluateButtonStatus=0, voiceFileList=null, progressCount=null, assignmentCount=null, reportCount=null, remindStatus=0, remindTime=null, reportStr=自办, deptName=null)
//    ComplaintVO(reporter=null, reporterId=null, superiorId2=null, auditCreateBy=null, reporterLevel=null, reporterPhone=null, departmentName=null, reportTime=null, comment=null, nickname=null, phone=null, auditorName=null, auditorPhone=null, rejectReason=null, auditTime=null, complaintFlows=null, complaintProgresses=null, auditButtonStatus=null, withdrawButtonStatus=null, rate=null, complaintComment=null, listControlsButtonStatus=null, evaluateButtonStatus=0, voiceFileList=null, progressCount=null, assignmentCount=null, reportCount=null, remindStatus=0, remindTime=null, reportStr=自办, deptName=aa)
    @Override
    public String downloadFile(Long id, Integer type, SystemUserVo loginUserInfo) throws IOException {
        Complaint complaint = baseMapper.getDetailBg(id);
@@ -1813,7 +1853,7 @@
    }
    @Override
    public AnalyticStatisticsOneVo analyticStatisticsOne(AnalyticStatisticsQuery query, List<Complaint> complaints, SimpleDateFormat simpleDateFormat) {
    public AnalyticStatisticsOneVo analyticStatisticsOne(AnalyticStatisticsQuery query, List<Complaint> complaints, SimpleDateFormat simpleDateFormat,Integer level) {
        String nowYearMonth;
        String lastYearMonth;
        int value = LocalDate.now().getMonth().getValue();
@@ -1835,7 +1875,7 @@
        if (CollUtil.isEmpty(ids)) {
            ids.add(0, -1L);
        }
        complaints = this.baseMapper.getStatusForList(ids);
        complaints = this.baseMapper.getStatusForList(ids,level);
        AnalyticStatisticsOneVo vo = new AnalyticStatisticsOneVo();
@@ -2050,42 +2090,11 @@
    @Override
    public List<Complaint> queryCompliantList(AppStaticsQuery query, LoginUserInfoVO loginUserInfo) {
        IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfo);
        Integer identity = identityInformation.getIdentity();
        PartyMember partyMember = identityInformation.getPartyMember();
        SystemUserLevel systemUserLevel = identityInformation.getSystemUserLevel();
        Long targetId = null;
        Integer accountLevel = 5;
        //党员,查询该党员
        if (identity.equals(1)) {
            targetId = partyMember.getId();
        } else if (identity.equals(2)) {
            //上级
            if (Objects.nonNull(query.getTier()) && query.getTier().equals(-1)) {
                accountLevel = systemUserLevel.getLevel();
                switch (systemUserLevel.getLevel()) {
                    case 1:
                        //市级
                        targetId = 510400L;
                        break;
                    case 2:
                        //区县级
                        targetId = Long.valueOf(systemUserLevel.getDistrictsCode());
                        break;
                    case 3:
                        //街道
                        targetId = Long.valueOf(systemUserLevel.getStreetId());
                        break;
                    case 4:
                        //社区
                        targetId = systemUserLevel.getCommunityId();
                        break;
        SystemUser systemUserLevel = identityInformation.getSystemUser();
        if(systemUserLevel.getSystemRoleId()==1 || systemUserLevel.getSystemRoleId()==2){
            return baseMapper.queryCompliantList(systemUserLevel.getAccountLevel(),systemUserLevel.getSystemRoleId(),query);
                }
            } else {
                targetId = Long.valueOf(query.getAreaId());
                accountLevel = query.getTier();
            }
        }
        return baseMapper.queryCompliantList(targetId, accountLevel, loginUserInfo, query);
        return null;
    }
@@ -2118,11 +2127,14 @@
    @Override
    public void assignComplain(LoginUserInfoVO loginUserInfo, Long complainId, Integer userId, String remark) {
    public void assignComplain(LoginUserInfoVO loginUserInfo, Long complainId, Integer userId, String remark, String problemType) {
        IdentityInformation currentIdentityInformation = identityInformationService.getCurrentIdentityInformation(loginUserInfo);
        if (currentIdentityInformation.getIdentity().equals(2)) {
            SystemUser systemUser = currentIdentityInformation.getSystemUser();
            Complaint complaint = baseMapper.selectById(complainId);
            if(StringUtils.isEmpty(complaint.getProblemType())){
                complaint.setProblemType(problemType);
            }
            if (systemUser.getSystemRoleId() != 1 || !complaint.getNowLevel().equals(systemUser.getAccountLevel())) {
                throw new ServiceException("你没有分配权限");
            }
@@ -2270,5 +2282,16 @@
        save(complaint);
    }
    @Override
    public void setProblemType(LoginUserInfoVO loginUserInfo, SetProblemTypeDto dto) {
        IdentityInformation currentIdentityInformation = identityInformationService.getCurrentIdentityInformation(loginUserInfo);
        if (currentIdentityInformation.getSystemUser().getSystemRoleId() != 1) {
            throw new ServiceException("无权限");
        }
        Complaint complaint = getById(dto.getComplaintId());
        complaint.setProblemType(dto.getProblemType());
        updateById(complaint);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/StaticsService.java
@@ -4,10 +4,7 @@
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.westcommittee.dao.SystemUserMapper;
import com.panzhihua.westcommittee.model.entity.ComAct;
import com.panzhihua.westcommittee.model.entity.ComStreet;
import com.panzhihua.westcommittee.model.entity.Complaint;
import com.panzhihua.westcommittee.model.entity.SystemUserLevel;
import com.panzhihua.westcommittee.model.entity.*;
import com.panzhihua.westcommittee.model.query.AppStaticsQuery;
import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsFourVo;
import com.panzhihua.westcommittee.model.vo.AnalyticStatisticsOneVo;
@@ -50,8 +47,8 @@
            return Collections.emptyList();
        }
        SystemUserLevel userLevel = currentIdentityInformation.getSystemUserLevel();
        Integer level = userLevel.getLevel();
        SystemUser userLevel = currentIdentityInformation.getSystemUser();
        Integer level = userLevel.getAccountLevel();
        switch (level) {
            case 1:
@@ -139,7 +136,7 @@
     */
    public AnalyticStatisticsOneVo queryStaticsPartOne(AppStaticsQuery query, LoginUserInfoVO loginUserInfo) {
        List<Complaint> complaints = complaintService.queryCompliantList(query,loginUserInfo);
        return  complaintService.analyticStatisticsOne(null, complaints, simpleDateFormat);
        return  complaintService.analyticStatisticsOne(null, complaints, simpleDateFormat,null);
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/SystemMenuServiceImpl.java
@@ -1,6 +1,7 @@
package com.panzhihua.westcommittee.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.vos.west.SystemUserVo;
import com.panzhihua.westcommittee.dao.SystemMenuMapper;
import com.panzhihua.westcommittee.model.entity.SystemMenu;
import com.panzhihua.westcommittee.service.ISystemMenuService;
@@ -18,9 +19,12 @@
    @Override
    public List<SystemMenu> getSystemMenuList() {
    public List<SystemMenu> getSystemMenuList(SystemUserVo systemUserVo) {
        List<SystemMenu> list = this.list();
        List<SystemMenu> collect = list.stream().filter(s->s.getParentId() == 0 && (s.getId()==1 || s.getId()==2)).collect(Collectors.toList());
        if(systemUserVo.getSystemRoleId()!=1){
            list = list.stream().filter(s->s.getId() != 1 || s.getId()!=2 || s.getId()!=3 || s.getId()!=35 || s.getId()!=61 || s.getId()!=62).collect(Collectors.toList());
        }
        List<SystemMenu> collect = list.stream().filter(s->s.getParentId() == 0 && s.getId() != 3 ).collect(Collectors.toList());
        for (SystemMenu systemMenu : collect) {
            build(systemMenu, list);
        }
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/SystemUserServiceImpl.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -32,6 +33,7 @@
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
 * @author zhibing.pu
@@ -58,8 +60,30 @@
        Page page = new Page<>();
        page.setCurrent(query.getPageNum());
        page.setSize(query.getPageSize());
        if(query.getDeptId()!=null || user.getAccountLevel()==2){
        IPage<SystemUserListVo> list = this.baseMapper.list(page, user, query);
        return list;
        }else {
            List<Integer> deptIds=new ArrayList<>();
            if(user.getAccountLevel()==3){
                List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, user.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList());
                List<Department> list = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getTier, 3).eq(Department::getStreetId, user.getStreetId())
                        .or(department -> department.and(department1 -> department1.eq(Department::getTier, 4).in(Department::getCommunityId, ids))));
                if(list.isEmpty()){
                    return new Page<>();
                }
                deptIds= list.stream().map(Department::getId).collect(Collectors.toList());
            }else if(user.getAccountLevel()==4){
                List<Department> list = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getTier, 4).eq(Department::getCommunityId, user.getCommunityId()));
                if(list.isEmpty()){
                    return new Page<>();
                }
                deptIds= list.stream().map(Department::getId).collect(Collectors.toList());
            }
            IPage<SystemUserListVo> list = this.baseMapper.list1(page, user, query,deptIds);
            return list;
        }
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/warpper/MgtComplaintQuery.java
@@ -53,4 +53,7 @@
    @ApiModelProperty(value = "处理人所属层级code")
    private String code;
    @ApiModelProperty("全部:不传,上报待审核:5,正在办理:0, 办结:3  -1 待分配")
    private Integer status;
}
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintAuditRecordMapper.xml
@@ -6,6 +6,7 @@
            SELECT
            id complaintId,
            description_title title,
            problem_type problemType,
            serial_number serialNumber,
            create_by,
            create_time,
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintMapper.xml
@@ -347,6 +347,138 @@
        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
        ) as t1 where 1=1
        <if test="query.status !=null">
            and t1.status = #{query.status}
        </if>
        <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="pageListExport" 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.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.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
        ) as t1 where 1=1
        <if test="query.status !=null">
            and t1.status = #{query.status}
        </if>
        <if test="query.name != null and query.name!=''">
            and t1.name = #{query.name}
        </if>
@@ -739,21 +871,7 @@
        FROM west_complaint sc
        LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1
        <where>
            <if test="1 == accountLevel">
                and sc.city_code = #{targetId}
            </if>
            <if test="2 == accountLevel">
                and (sc.districts_code = #{targetId} || sc.id in (select complaint_id from west_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId}))
            </if>
            <if test="3 == accountLevel">
                and (sc.street_id = #{targetId} || sc.id in (select complaint_id from west_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId}))
            </if>
            <if test="4 == accountLevel">
                and (sc.community_id = #{targetId} || sc.id in (select complaint_id from west_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId}))
            </if>
            <if test="5 == accountLevel">
                and (sc.party_member_id = #{targetId} || sc.id in (select complaint_id from west_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId}))
            </if>
             sc.now_level = #{accountLevel}
            <if test="query.timeType !=null">
                <choose>
                    <when test="query.timeType == 1">
@@ -785,9 +903,9 @@
        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 THEN 6
        WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 and sc.now_level =#{level} THEN 7
        WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 and sc.now_level =#{level} THEN 5
        WHEN sc.status = 0 and scar.audit_status = 2 and sc.now_level =#{level} THEN 6
        ELSE sc.status
        END AS status,
        sc.superior_type,
@@ -965,6 +1083,9 @@
        <if test="query.status !=null">
            and t1.status = #{query.status}
        </if>
        <if test="roleId !=2">
            and t1.problem_type != '检举'
        </if>
        ORDER BY t1.create_time DESC
    </select>
@@ -1040,6 +1161,9 @@
        ) as t1 where 1=1
        <if test="query.status !=null">
            and t1.status = #{query.status}
        </if>
        <if test="roleId !=2">
            and t1.problem_type != '检举'
        </if>
        ORDER BY t1.create_time DESC
@@ -1184,6 +1308,10 @@
        <if test="query.status !=null">
            and t1.status = #{query.status}
        </if>
        <if test="roleId !=2">
            and t1.problem_type != '检举'
        </if>
        ORDER BY t1.create_time DESC
    </select>
@@ -1474,6 +1602,9 @@
        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.status !=null">
            and t1.status = #{query.status}
        </if>
        <if test="query.name != null and query.name!=''">
            and t1.name = #{query.name}
        </if>
@@ -1602,6 +1733,400 @@
                              (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.status !=null">
            and t1.status = #{query.status}
        </if>
        <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="pageList1Export" 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="pageList2Export" 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.status !=null">
            and t1.status = #{query.status}
        </if>
        <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="pageList3Export" 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.status !=null">
            and t1.status = #{query.status}
        </if>
        <if test="query.name != null and query.name!=''">
            and t1.name = #{query.name}
        </if>
springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/SystemUserMapper.xml
@@ -54,5 +54,31 @@
    <select id="getCreateByIdPhone" resultType="java.lang.String">
        select phone from sys_user where user_id = #{createBy}
    </select>
    <select id="list1" resultType="com.panzhihua.westcommittee.warpper.SystemUserListVo">
        select distinct
        a.id,
        a.name,
        a.phone,
        f.`name` as systemPostName,
        g.`name` as systemRoleName,
        a.`status`,
        h.name departmentName
        from west_system_user a
        left join west_system_post f on (a.system_post_id = f.id)
        left join west_system_role g on (a.system_role_id = g.id)
        left join west_department h on (a.one_department_id = h.id)
        where a.`status` != 3
        <if test="null != query.name and '' != query.name">
            and a.name like CONCAT('%', #{query.name}, '%')
        </if>
        <if test="null != query.phone and '' != query.phone">
            and a.phone like CONCAT('%', #{query.phone}, '%')
        </if>
        <if test="null != query.systemRoleId">
            and a.system_role_id = #{query.systemRoleId}
        </if>
            and a.one_department_id in <foreach collection="deptIds" open="(" separator="," item="id" close=")">#{id}</foreach>
        order by a.create_time desc
    </select>
</mapper>