mitao
2025-05-23 2838eaf14edc8a4ec054aaa90c6619498145d8ea
bug修改
3个文件已修改
44 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/SuperviseService.java 35 ●●●●● 补丁 | 查看 | 原始文档 | 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/service/impl/PartyMemberServiceImpl.java
@@ -371,8 +371,7 @@
            throw new ServiceException("无权审核");
        }
        IdentityInformation identityInformation = identityInformationService.getCurrentIdentityInformation(loginUserInfo);
        Integer identity = (Integer) redisUtils.get("identity:" + loginUserInfo.getPhone());
        if(identityInformation.getIdentity() != 2){
        if(identityInformation.getIdentity().equals(2)){
            throw new ServiceException("请切换至管理员身份");
        }
        SystemUserLevel systemUserLevel = identityInformation.getSystemUserLevel();
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/SuperviseService.java
@@ -1,19 +1,29 @@
package com.panzhihua.sangeshenbian.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.sangeshenbian.dao.ComplaintMapper;
import com.panzhihua.sangeshenbian.dao.ComplaintRejectMapper;
import com.panzhihua.sangeshenbian.model.entity.ComplaintAuditRecord;
import com.panzhihua.sangeshenbian.model.entity.ComplaintProgress;
import com.panzhihua.sangeshenbian.model.entity.SystemUserLevel;
import com.panzhihua.sangeshenbian.model.query.SuperviseQuery;
import com.panzhihua.sangeshenbian.model.vo.AppComplaintRejectVO;
import com.panzhihua.sangeshenbian.model.vo.ComplaintVO;
import com.panzhihua.sangeshenbian.service.IComplaintAuditRecordService;
import com.panzhihua.sangeshenbian.service.IComplaintProgressService;
import com.panzhihua.sangeshenbian.service.IdentityInformationService;
import com.panzhihua.sangeshenbian.warpper.IdentityInformation;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * @author mitao
@@ -24,6 +34,8 @@
public class SuperviseService {
    private final IdentityInformationService identityInformationService;
    private final ComplaintMapper complaintMapper;
    private final IComplaintAuditRecordService complaintAuditRecordService;
    private final IComplaintProgressService complaintProgressService;
    public Page<ComplaintVO> queryProcessingRecordPage(SuperviseQuery query, LoginUserInfoVO loginUserInfo) {
        IdentityInformation currentIdentityInformation = identityInformationService.getCurrentIdentityInformation(loginUserInfo);
@@ -52,7 +64,28 @@
                targetId = systemUserLevel.getCommunityId();
                break;
        }
        return complaintMapper.queryProcessingRecordPage(new Page<>(query.getPageNum(), query.getPageSize()), query.getKeyword(), accountLevel, targetId);
        Page<ComplaintVO> page = complaintMapper.queryProcessingRecordPage(new Page<>(query.getPageNum(), query.getPageSize()), query.getKeyword(), accountLevel, targetId);
        //查询上报下派记录
        List<Long> complaintIds = page.getRecords().stream().map(ComplaintVO::getId).collect(Collectors.toList());
        List<ComplaintAuditRecord> list = complaintAuditRecordService.lambdaQuery()
                .in(ComplaintAuditRecord::getComplaintId, complaintIds)
                .in(ComplaintAuditRecord::getAuditType, 2, 3).list();
        Map<Long, List<ComplaintAuditRecord>> auditRecordListMap = new HashMap<>();
        if (CollUtil.isNotEmpty(list)) {
            auditRecordListMap = list.stream().collect(Collectors.groupingBy(ComplaintAuditRecord::getComplaintId));
        }
        //查询办理进度
        List<ComplaintProgress> complaintProgressList = complaintProgressService.lambdaQuery().in(ComplaintProgress::getComplaintId, complaintIds).list();
        Map<Long, List<ComplaintProgress>> complaintProgressListMap = complaintProgressList.stream().collect(Collectors.groupingBy(ComplaintProgress::getComplaintId));
        Map<Long, List<ComplaintAuditRecord>> finalAuditRecordListMap = auditRecordListMap;
        page.getRecords().forEach(item->{
            List<ComplaintAuditRecord> auditList = finalAuditRecordListMap.getOrDefault(item.getId(), CollUtil.newArrayList());
            item.setReportCount((int) auditList.stream().filter(auditRecord -> auditRecord.getAuditType().equals(2)).count());
            item.setAssignmentCount((int) auditList.stream().filter(auditRecord -> auditRecord.getAuditType().equals(3)).count());
            List<ComplaintProgress> progressList = complaintProgressListMap.getOrDefault(item.getId(), CollUtil.newArrayList());
            item.setProgressCount(progressList.size());
        });
        return page;
    }
    public Page<AppComplaintRejectVO> queryRejectRecordPage(SuperviseQuery query, LoginUserInfoVO loginUserInfo) {
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml
@@ -575,10 +575,7 @@
        scar.superior_id superiorId2,
        scar.department_name,
        scar.department_id,
        scar.auditor_name,
        (SELECT COUNT(*) FROM sgsb_complaint_progress WHERE complaint_id = sc.id) AS progress_count,
        (SELECT COUNT(*) FROM sgsb_complaint_audit_record WHERE complaint_id = sc.id AND audit_type = 3 AND audit_status = 1) AS assignment_count,
        (SELECT COUNT(*) FROM sgsb_complaint_audit_record WHERE complaint_id = sc.id AND audit_type = 2 AND audit_status = 1) AS report_count
        scar.auditor_name
        FROM sgsb_complaint sc
        LEFT JOIN sgsb_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1
        <where>
@@ -625,6 +622,7 @@
        scar.auditor_phone,
        scar.apply_phone AS reporterPhone,
        scar.audit_time,
        scar.auditor_name,
        sc.serial_number,
        sc.latitude,
        sc.longitude,