luofl
2025-03-18 d6fbbe9d1b6b1304f37221c8d11a3299a800bcbb
bug修改
6个文件已修改
1个文件已添加
322 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/MgtPartyMemberController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/HomeController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IdentityInformationService.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java 197 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/IdentityInformationServiceImpl.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/warpper/IdentityInformation.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/MgtPartyMemberController.java
@@ -6,9 +6,9 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo;
import com.panzhihua.sangeshenbian.model.entity.PartyMember;
import com.panzhihua.sangeshenbian.warpper.PartyMemberImportFailedVO;
import com.panzhihua.sangeshenbian.service.IPartyMemberService;
import com.panzhihua.sangeshenbian.warpper.PartyMemberDTO;
import com.panzhihua.sangeshenbian.warpper.PartyMemberImportFailedVO;
import com.panzhihua.sangeshenbian.warpper.PartyMemberQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -16,15 +16,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
@@ -115,7 +107,7 @@
    }
    @ApiOperation("校验手机号是否注册党员")
    @GetMapping("/verify/{phone}")
    public R<Boolean> verify(@ApiParam(name = "phone",value = "电话号码",required = true) String phone){
    public R<Boolean> verify(@ApiParam(name = "phone",value = "电话号码",required = true) @PathVariable("phone") String phone){
        return R.ok(partyMemberService.verifyPartyMemberByPhone(phone));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/HomeController.java
@@ -8,7 +8,6 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.redis.RedisUtils;
import com.panzhihua.sangeshenbian.model.entity.Banner;
import com.panzhihua.sangeshenbian.model.entity.Department;
import com.panzhihua.sangeshenbian.model.entity.PartyMember;
import com.panzhihua.sangeshenbian.model.entity.SystemUser;
import com.panzhihua.sangeshenbian.model.query.BasePage;
@@ -17,11 +16,12 @@
import com.panzhihua.sangeshenbian.model.vo.PartyCardInfoVO;
import com.panzhihua.sangeshenbian.service.*;
import com.panzhihua.sangeshenbian.utils.BaiduMapUtil;
import com.panzhihua.sangeshenbian.warpper.IdentityInformation;
import com.panzhihua.sangeshenbian.warpper.IdentityInformationVO;
import com.panzhihua.sangeshenbian.warpper.PermissionsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
@@ -118,7 +118,9 @@
    @ApiOperation("获取身份信息")
    public R<IdentityInformationVO> getIdentityInfo() {
        LoginUserInfoVO loginUserInfo = getLoginUserInfo();
        IdentityInformationVO identityInformationVO = identityInformationService.getIdentityInformationVO(loginUserInfo);
        IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfo);
        IdentityInformationVO identityInformationVO = new IdentityInformationVO();
        BeanUtils.copyProperties(identityInformation, identityInformationVO);
        return R.ok(identityInformationVO);
    }
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IdentityInformationService.java
@@ -1,7 +1,7 @@
package com.panzhihua.sangeshenbian.service;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.sangeshenbian.warpper.IdentityInformationVO;
import com.panzhihua.sangeshenbian.warpper.IdentityInformation;
public interface IdentityInformationService {
@@ -10,5 +10,10 @@
     * @param loginUserInfo 登录用户信息
     * @return 身份信息
     */
    IdentityInformationVO getIdentityInformationVO(LoginUserInfoVO loginUserInfo);
    IdentityInformation getIdentityInformation(LoginUserInfoVO loginUserInfo);
//
//    /**
//     * 获取当前选中的身份信息
//     */
//    IdentityInformation getCurrentIdentityInformation(LoginUserInfoVO loginUserInfo);
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java
@@ -7,38 +7,26 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo;
import com.panzhihua.common.redis.RedisUtils;
import com.panzhihua.sangeshenbian.dao.ComplaintMapper;
import com.panzhihua.sangeshenbian.enums.ProcessStatusEnum;
import com.panzhihua.sangeshenbian.enums.RateEnum;
import com.panzhihua.sangeshenbian.model.dto.ComplaintCompletionDTO;
import com.panzhihua.sangeshenbian.model.dto.ComplaintProcessDTO;
import com.panzhihua.sangeshenbian.model.entity.Complaint;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.sangeshenbian.enums.ReportTypeEnum;
import com.panzhihua.sangeshenbian.model.dto.*;
import com.panzhihua.sangeshenbian.model.entity.*;
import com.panzhihua.sangeshenbian.enums.ProcessStatusEnum;
import com.panzhihua.sangeshenbian.dao.ComplaintMapper;
import com.panzhihua.sangeshenbian.model.entity.ComplaintFlow;
import com.panzhihua.sangeshenbian.model.entity.ComplaintProgress;
import com.panzhihua.sangeshenbian.model.entity.SystemUser;
import com.panzhihua.sangeshenbian.model.excel.ComplaintExcel;
import com.panzhihua.sangeshenbian.model.excel.PartyMemberExcel;
import com.panzhihua.sangeshenbian.model.query.BasePage;
import com.panzhihua.sangeshenbian.model.query.ComplaintQuery;
import com.panzhihua.sangeshenbian.model.vo.ComplaintTodoVO;
import com.panzhihua.sangeshenbian.service.IComplaintFlowService;
import com.panzhihua.sangeshenbian.service.IComplaintProgressService;
import com.panzhihua.sangeshenbian.service.IComplaintService;
import com.panzhihua.sangeshenbian.model.vo.ComplaintVO;
import com.panzhihua.sangeshenbian.model.vo.DispatchVO;
import com.panzhihua.sangeshenbian.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.sangeshenbian.model.vo.ComplaintVO;
import com.panzhihua.sangeshenbian.service.ISystemUserService;
import com.panzhihua.sangeshenbian.utils.FileUtil;
import com.panzhihua.sangeshenbian.warpper.IdentityInformationVO;
import com.panzhihua.sangeshenbian.warpper.IdentityInformation;
import com.panzhihua.sangeshenbian.warpper.MgtComplaintQuery;
import com.panzhihua.sangeshenbian.warpper.PermissionsVO;
import lombok.RequiredArgsConstructor;
@@ -51,13 +39,7 @@
import java.io.IOException;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
import static cn.hutool.core.util.ObjectUtil.isNull;
@@ -86,7 +68,6 @@
    private final HttpServletResponse response;
    private final IPartyMemberService partyMemberService;
    private final IdentityInformationService identityInformationService;
    private final RedisUtils redisUtils;
    @Override
    public void saveComplaint(Complaint complaint, LoginUserInfoVO loginUserInfoVO) {
@@ -112,14 +93,17 @@
        // 设置流水号
        complaint.setSerialNumber(serialNumber);
        Optional<SystemUser> systemUserOpt = systemUserService.getSystemUserAdminByPhone(loginUserInfoVO.getPhone());
        Integer accountLevel = 5;
        //获取当前身份
        IdentityInformationVO identityInformationVO = identityInformationService.getIdentityInformationVO(loginUserInfoVO);
        IdentityInformation identityInformationVO = identityInformationService.getIdentityInformation(loginUserInfoVO);
        //1=党员,2=管理员
        SystemUser systemUser = identityInformationVO.getSystemUser();
        List<PermissionsVO> permissions = identityInformationVO.getPermissions();
        if (permissions.isEmpty()) {
            throw new ServiceException("请先完善个人信息");
        }
        Integer identity = identityInformationVO.getIdentity();
        if (systemUserOpt.isPresent() && null != identity && identity == 2) {
            SystemUser systemUser = systemUserOpt.get();
        if (identity == 2) {
            accountLevel = systemUser.getAccountLevel();
            switch (accountLevel) {
                case 1:
@@ -192,11 +176,6 @@
        save(complaint);
    }
    /**
     * @param query
     * @param loginUserInfoVO
     * @return
     */
    @Override
    public Page<ComplaintVO> complaintList(ComplaintQuery query, LoginUserInfoVO loginUserInfoVO) {
        Page<ComplaintVO> page = new Page<>(query.getPageNum(), query.getPageSize());
@@ -205,7 +184,11 @@
        Long targetId = null;
        Integer accountLevel = 5;
        //获取当前身份,1=党员,2=管理员
        Integer identity = (Integer) redisUtils.get("identity:" + loginUserInfoVO.getPhone());
        IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfoVO);
        if (CollectionUtil.isEmpty(identityInformation.getPermissions())){
            throw new ServiceException("请先完善个人信息");
        }
        Integer identity = identityInformation.getIdentity();
        //上级
        if (systemUserByPhone.isPresent() && null != identity && identity == 2) {
            SystemUser systemUser = systemUserByPhone.get();
@@ -241,18 +224,15 @@
        //查询对应诉求
        //page = baseMapper.selectComplaintPage(page, query, targetId, isSuperior);
        page = baseMapper.selectComplaintPage1(page, query, accountLevel, targetId);
        page.getRecords().forEach(s->{
            buttonPermission(s, systemUserByPhone);
        });
        page.getRecords().forEach(s-> buttonPermission(s, systemUserByPhone, loginUserInfoVO));
        return page;
    }
    
    
    /**
     * 列表按钮权限
     * @param vo
     */
    public void buttonPermission(ComplaintVO vo, Optional<SystemUser> systemUserByPhone){
    public void buttonPermission(ComplaintVO vo, Optional<SystemUser> systemUserByPhone, LoginUserInfoVO loginUserInfo){
        vo.setListControlsButtonStatus(1);
        vo.setEvaluateButtonStatus(1);
        vo.setAuditButtonStatus(1);
@@ -387,8 +367,8 @@
            String targetId = "";
            Integer accountLevel = 5;
            //获取当前身份,1=党员,2=管理员
            Integer identity = (Integer) redisUtils.get("identity:" + systemUser.getPhone());
            if(2 == identity){
            IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfo);
            if(2 == identityInformation.getIdentity()){
                accountLevel = systemUser.getAccountLevel();
                switch (accountLevel) {
                    case 1:
@@ -455,7 +435,11 @@
        String targetId = "";
        Integer accountLevel = 5;
        //获取当前身份,1=党员,2=管理员
        Integer identity = (Integer) redisUtils.get("identity:" + loginUserInfoVO.getPhone());
        IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfoVO);
        if (CollectionUtil.isEmpty(identityInformation.getPermissions())){
            throw new ServiceException("身份信息异常");
        }
        Integer identity = identityInformation.getIdentity();
        //上级
        if (systemUserByPhone.isPresent() && identity == 2) {
            SystemUser systemUser = systemUserByPhone.get();
@@ -509,7 +493,7 @@
//        }
    
    
        buttonPermission(detail, systemUserByPhone);
        buttonPermission(detail, systemUserByPhone, loginUserInfoVO);
        
        
//        //已办结,显示评价按钮
@@ -585,18 +569,20 @@
                .ne(SystemUser::getStatus, 3)
                .last("LIMIT 1"));
        IdentityInformationVO identityInformationVO = identityInformationService.getIdentityInformationVO(loginUserInfoVO);
        IdentityInformation identityInformationVO = identityInformationService.getIdentityInformation(loginUserInfoVO);
        if (CollectionUtil.isEmpty(identityInformationVO.getPermissions())) {
            throw new ServiceException("请先完成认证");
        }
        Long superiorId;
        int reportType;
        if (adminUser == null) {
        if (identityInformationVO.getIdentity() == 1) {
            PartyMember partyMember = partyMemberService.getPartyMemberByPhone(phone);
            superiorId = partyMember.getCommunityId();
            reportType = 4;
        } else {
        } else if (identityInformationVO.getIdentity() == 2) {
            int accountLevel = adminUser.getAccountLevel(); // 改为基本类型
            if (accountLevel == 1) {
                throw new ServiceException("市级账号,无法上报!");
@@ -616,6 +602,8 @@
                // 处理未预期的账号等级
                throw new ServiceException("未知的账号等级");
            }
        }else {
            throw new ServiceException("未知的账号等级");
        }
        Complaint complaint = getById(dto.getComplaintId());
@@ -651,17 +639,16 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveDispatch(ComplaintDispatch dto, LoginUserInfoVO loginUserInfoVO) {
        String phone = loginUserInfoVO.getPhone();
        SystemUser adminUser = systemUserService.getOne(new LambdaQueryWrapper<SystemUser>()
                .eq(SystemUser::getPhone, phone)
                .eq(SystemUser::getIsAdmin, 1)
                .ne(SystemUser::getStatus, 3)
                .last("LIMIT 1"));
        if (adminUser == null) {
        IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfoVO);
        List<PermissionsVO> permissions = identityInformation.getPermissions();
        if (CollectionUtil.isEmpty(permissions)) {
            throw new ServiceException("请先完成认证");
        }
        if (identityInformation.getIdentity() != 2) {
            throw new ServiceException("无权下派");
        }
        SystemUser adminUser = identityInformation.getSystemUser();
        int accountLevel = adminUser.getAccountLevel(); // 改为基本类型
        if (accountLevel == 4) {
            throw new ServiceException("社区账号,无法下派!");
@@ -669,18 +656,16 @@
        accountLevel++;
        Complaint complaint = getById(dto.getComplaintId());
        updateById(complaint);
        //查询当前单位审核记录表数据
        //查询上报审核记录
        ComplaintAuditRecord complaintAuditRecord = complaintAuditRecordService.lambdaQuery()
                .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId())
                .eq(ComplaintAuditRecord::getAuditType, 0)
                .eq(ComplaintAuditRecord::getLatestFlag, true)
                .eq(ComplaintAuditRecord::getReportType, adminUser.getAccountLevel())
                .last("LIMIT 1").one();
//        ComplaintAuditRecord complaintAuditRecord = complaintAuditRecordService.lambdaQuery()
//                .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId())
//                .eq(ComplaintAuditRecord::getAuditType, 0)
//                .eq(ComplaintAuditRecord::getLatestFlag, true)
//                .eq(ComplaintAuditRecord::getReportType, adminUser.getAccountLevel())
//                .last("LIMIT 1").one();
        // 添加流转记录
        complaintFlowService.createFlow(complaintAuditRecord, 1,loginUserInfoVO.getUserId());
//        complaintFlowService.createFlow(complaintAuditRecord, 1,loginUserInfoVO.getUserId());
        // 标记最新
        complaintAuditRecordService.update(new LambdaUpdateWrapper<ComplaintAuditRecord>()
                .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId())
@@ -700,17 +685,43 @@
        record.setSuperiorId(dto.getDispatchId());
        record.setSort(count + 1);
        complaintAuditRecordService.save(record);
        ComplaintAuditRecord complaintAuditRecord = new ComplaintAuditRecord();
        complaintAuditRecord.setComplaintId(complaint.getId());
        complaintAuditRecord.setReportType(adminUser.getAccountLevel());
        Long superiorId = null;
        switch (adminUser.getAccountLevel()) {
            case 1:
                superiorId = 510400L;//默认市级
                break;
            case 2:
                superiorId = Long.parseLong(adminUser.getDistrictsCode());
                break;
            case 3:
                superiorId = Long.parseLong(adminUser.getStreetId());
                break;
            case 4:
                superiorId = adminUser.getCommunityId();
                break;
        }
        complaintAuditRecord.setSuperiorId(superiorId);
        complaintFlowService.createFlow(complaintAuditRecord, 1,loginUserInfoVO.getUserId());
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void reportAudit(ComplaintReporAuditDTO complaintReporAuditDTO, LoginUserInfoVO loginUserInfoVO) {
        Optional<SystemUser> systemUserByPhone = systemUserService.getSystemUserAdminByPhone(loginUserInfoVO.getPhone());
        if (!systemUserByPhone.isPresent()) {
        IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfoVO);
        List<PermissionsVO> permissions = identityInformation.getPermissions();
        if (CollectionUtil.isEmpty(permissions)) {
            throw new ServiceException("请先完成认证");
        }
        SystemUser systemUser = identityInformation.getSystemUser();
        if (systemUser == null || identityInformation.getIdentity() != 2) {
            throw new ServiceException("无权审核");
        }
        SystemUser systemUser = systemUserByPhone.get();
        Long superiorId = 0L;
        switch (systemUser.getAccountLevel()) {
            case 1:
@@ -756,8 +767,8 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveDelay(ComplaintDelayDTO dto, LoginUserInfoVO loginUserInfoVO) {
        IdentityInformationVO identityInformationVO = identityInformationService.getIdentityInformationVO(loginUserInfoVO);
        List<PermissionsVO> permissions = identityInformationVO.getPermissions();
        IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfoVO);
        List<PermissionsVO> permissions = identityInformation.getPermissions();
        if (CollectionUtil.isEmpty(permissions)){
            throw new ServiceException("请先完成认证");
@@ -766,14 +777,14 @@
        SystemUser systemUser = systemUserService.getSystemUserAdminByPhone(loginUserInfoVO.getPhone()).orElse(null);
        Long superiorId;
        int reportType;
        if (identityInformationVO.getIdentity() == 1) {
        if (identityInformation.getIdentity() == 1) {
            PartyMember partyMember = partyMemberService.getPartyMemberByPhone(loginUserInfoVO.getPhone());
            superiorId = partyMember.getCommunityId();
            if (Objects.isNull(superiorId)) {
                throw new ServiceException("延期申请失败,请绑定社区");
            }
            reportType = ReportTypeEnum.COMMUNITY.getCode();
        } else if (identityInformationVO.getIdentity() == 2){
        } else if (identityInformation.getIdentity() == 2 && systemUser!=null){
            int accountLevel = systemUser.getAccountLevel(); // 改为基本类型
            if (accountLevel == 1) {
                throw new ServiceException("市级账号,无法延期申请!");
@@ -822,7 +833,16 @@
    @Override
    public void delayAudit(ComplaintDelayAuditDTO dto, LoginUserInfoVO loginUserInfoVO) {
        SystemUser systemUser = systemUserService.getSystemUserAdminByPhone(loginUserInfoVO.getPhone()).orElse(null);
        IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfoVO);
        List<PermissionsVO> permissions = identityInformation.getPermissions();
        if (CollectionUtil.isEmpty(permissions)){
            throw new ServiceException("请先完成认证");
        }
        SystemUser systemUser = identityInformation.getSystemUser();
        if (identityInformation.getIdentity() != 2 || systemUser == null){
            throw new ServiceException("无权审核");
        }
        int accountLevel = systemUser.getAccountLevel(); // 改为基本类型
        Long superiorId;
        // 使用基本类型比较并补充默认分支
@@ -875,14 +895,11 @@
    @Override
    public List<DispatchVO> getDispatchList(LoginUserInfoVO loginUserInfoVO) {
        String phone = loginUserInfoVO.getPhone();
        SystemUser adminUser = systemUserService.getOne(new LambdaQueryWrapper<SystemUser>()
                .eq(SystemUser::getPhone, phone)
                .eq(SystemUser::getIsAdmin, 1)
                .ne(SystemUser::getStatus, 3)
                .last("LIMIT 1"));
        IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfoVO);
        if (adminUser == null) {
        SystemUser adminUser = identityInformation.getSystemUser();
        if (adminUser == null || identityInformation.getIdentity() != 2) {
            throw new ServiceException("无权下派");
        }
        int accountLevel = adminUser.getAccountLevel(); // 改为基本类型
@@ -935,12 +952,16 @@
     */
    @Override
    public Page<ComplaintTodoVO> getTodoList(BasePage basePage, LoginUserInfoVO loginUserInfo) {
        Optional<SystemUser> systemUserByPhone = systemUserService.getSystemUserAdminByPhone(loginUserInfo.getPhone());
        IdentityInformation identityInformation = identityInformationService.getIdentityInformation(loginUserInfo);
        List<PermissionsVO> permissions = identityInformation.getPermissions();
        SystemUser systemUser = identityInformation.getSystemUser();
        if (permissions.isEmpty()) {
            throw new ServiceException("无权限");
        }
        String targetId = "";
        int isSuperior = 0;
        //上级
        if (systemUserByPhone.isPresent()) {
            SystemUser systemUser = systemUserByPhone.get();
        if (identityInformation.getIdentity() == 2) {
            Integer accountLevel = systemUser.getAccountLevel();
            switch (accountLevel) {
                case 1:
@@ -953,7 +974,7 @@
                    break;
                case 3:
                    //街道
                    targetId = systemUser.getStreetId().toString();
                    targetId = systemUser.getStreetId();
                    break;
                case 4:
                    //社区
@@ -965,8 +986,7 @@
            //党员
            targetId = loginUserInfo.getUserId().toString();
        }
        Page<ComplaintTodoVO> page = baseMapper.getTodoList(new Page<>(basePage.getPageNum(), basePage.getPageSize()), targetId, isSuperior);
        return page;
        return baseMapper.getTodoList(new Page<>(basePage.getPageNum(), basePage.getPageSize()), targetId, isSuperior);
    }
    /**
@@ -1003,7 +1023,10 @@
        List<ComplaintProgress> complaintProgresses = complaintProgressService.lambdaQuery().eq(ComplaintProgress::getComplaintId, id).orderByAsc(ComplaintProgress::getCreateTime).list();
        complaintVO.setComplaintProgresses(complaintProgresses);
        //查询诉求流转记录
        List<ComplaintFlow> complaintFlows = complaintFlowService.lambdaQuery().eq(ComplaintFlow::getComplaintId, id).orderByAsc(ComplaintFlow::getCreateTime).list();
        List<ComplaintFlow> complaintFlows = complaintFlowService.lambdaQuery()
                .eq(ComplaintFlow::getComplaintId, id)
                .orderByDesc(ComplaintFlow::getCreateTime)
                .list();
        complaintVO.setComplaintFlows(complaintFlows);
        //查询评价
        ComplaintComment comment = complaintCommentService.lambdaQuery().eq(ComplaintComment::getComplaintId, id).last("LIMIT 1").one();
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/IdentityInformationServiceImpl.java
@@ -8,7 +8,7 @@
import com.panzhihua.sangeshenbian.service.IPartyMemberService;
import com.panzhihua.sangeshenbian.service.ISystemUserService;
import com.panzhihua.sangeshenbian.service.IdentityInformationService;
import com.panzhihua.sangeshenbian.warpper.IdentityInformationVO;
import com.panzhihua.sangeshenbian.warpper.IdentityInformation;
import com.panzhihua.sangeshenbian.warpper.PermissionsVO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -23,7 +23,7 @@
    private final IPartyMemberService partyMemberService;
    private final RedisUtils redisUtils;
    @Override
    public IdentityInformationVO getIdentityInformationVO(LoginUserInfoVO loginUserInfo) {
    public IdentityInformation getIdentityInformation(LoginUserInfoVO loginUserInfo) {
        // 获取党员信息
        PartyMember partyMember = partyMemberService.getOne(new LambdaQueryWrapper<PartyMember>()
                .eq(PartyMember::getPhone, loginUserInfo.getPhone())
@@ -34,7 +34,9 @@
        // 获取身份
        Integer identity = (Integer) redisUtils.get("identity:" + loginUserInfo.getPhone());
        List<PermissionsVO> permissions = new ArrayList<>();
        IdentityInformationVO identityInformationVO = new IdentityInformationVO();
        IdentityInformation identityInformationVO = new IdentityInformation();
        identityInformationVO.setPartyMember(partyMember);
        identityInformationVO.setSystemUser(systemUser);
        // 获取提示内容是否确认
        Integer isConfirm = (Integer) redisUtils.get("confirmContent:" + loginUserInfo.getPhone());
@@ -87,15 +89,16 @@
            PermissionsVO adminPermissions = new PermissionsVO();
            adminPermissions.setIdentity(2);
            adminPermissions.setIsFrozen(systemUser.getStatus() == 2);
            if (accountLevel == 1){
                adminPermissions.setName(String.format("%s%s%s%s%s", "攀枝花市",districts, street, community, "管理员"));
            }if (accountLevel == 2) {
                adminPermissions.setName(String.format("%s%s%s%s", districts, street, community, "管理员"));
            if (accountLevel == 1) {
                adminPermissions.setName(String.format("%s%s", "攀枝花市", "管理员"));
            }
            if (accountLevel == 2) {
                adminPermissions.setName(String.format("%s%s", districts, "管理员"));
            } else if (accountLevel == 3) {
                adminPermissions.setIdentity(2);
                adminPermissions.setName(String.format("%s%s%s",  street, community, "管理员"));
                adminPermissions.setName(String.format("%s%s%s", districts, street, "管理员"));
            } else if (accountLevel == 4) {
                adminPermissions.setName(String.format("%s%s",   community, "管理员"));
                adminPermissions.setName(String.format("%s%s%s%s", districts, street, community, "管理员"));
                adminPermissions.setIdentity(2);
            }
            permissions.add(adminPermissions);
@@ -103,4 +106,19 @@
        identityInformationVO.setPermissions(permissions);
        return identityInformationVO;
    }
//    @Override
//    public IdentityInformation getCurrentIdentityInformation(LoginUserInfoVO loginUserInfo) {
//        if (identity == null && systemUser != null) {
//            identityInformationVO.setIdentity(2);
//            redisUtils.set("identity:" + loginUserInfo.getPhone(), 2);
//        }else if (identity == null && partyMember != null){
//            identityInformationVO.setIdentity(1);
//            redisUtils.set("identity:" + loginUserInfo.getPhone(), 1);
//        }
//        else {
//            identityInformationVO.setIdentity(identity);
//        }
//        return null;
//    }
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/warpper/IdentityInformation.java
New file
@@ -0,0 +1,52 @@
package com.panzhihua.sangeshenbian.warpper;
import com.panzhihua.sangeshenbian.model.entity.PartyMember;
import com.panzhihua.sangeshenbian.model.entity.SystemUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("身份信息对象")
public class IdentityInformation {
    /**
     * 当前身份: 1=党员,2=管理员
     */
    private Integer identity;
    /**
     * 是否冻结
     */
    private Boolean isFrozen;
    /**
     * 是否确认提示内容
     */
    private Boolean isConfirmContent;
    /**
     * 是否确认党员信息
     */
    private Boolean isConfirm;
    /**
     * 是否认证党员信息
     */
    private Boolean isPartymember;
    /**
     * 审核状态:0:待审核 1:审核通过 2:审核不通过
     */
    private Integer auditStatus;
    /**
     * 权限列表
     */
    private List<PermissionsVO> permissions;
    private SystemUser systemUser;
    private PartyMember partyMember;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml
@@ -128,7 +128,7 @@
                and (sc.districts_code = #{targetId} || sc.id in (select complaint_id from sgsb_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 = #{streetId} || sc.id in (select complaint_id from sgsb_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId}))
                and (sc.street_id = #{targetId} || sc.id in (select complaint_id from sgsb_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 sgsb_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId}))
@@ -140,7 +140,7 @@
                AND sc.status IN(0,1,2) and scar.audit_status = 0
            </if>
            <if test="query.type!=null and query.type == 1">
                AND sc.status IN(0,1,2) and scar.audit_status != 0
                AND sc.status IN(0,1,2) OR (sc.status IN(0,1,2) and scar.audit_status != 0)
            </if>
            <if test="query.type!=null and query.type == 2">
                AND sc.status = 3
@@ -489,7 +489,7 @@
                                scar.department_name,
                                scar.department_id
                         FROM sgsb_complaint sc
                                  INNER JOIN sgsb_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1
                                  LEFT JOIN sgsb_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1
                     ) AS t
        WHERE t.id = #{id}
        GROUP BY t.id