From 0c9a434ca2d0521d726f9539ba0f6b2dfb52841c Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期五, 23 五月 2025 22:40:06 +0800
Subject: [PATCH] bug修改

---
 springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java |   15 ++++++++-------
 springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml                                      |   15 ++++++++-------
 springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java   |    8 ++++----
 springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/StaticsService.java         |    6 +++---
 4 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java
index c8469d3..5e16562 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java
@@ -258,16 +258,16 @@
         //page = baseMapper.selectComplaintPage(page, query, targetId, isSuperior);
         page = baseMapper.selectComplaintPage1(page, query, accountLevel, targetId);
 
-        for (ComplaintVO s : page.getRecords()) {
+     /*   for (ComplaintVO s : page.getRecords()) {
             buttonPermission(s, systemUserByPhone, loginUserInfoVO);
             Integer auditButtonStatus = s.getAuditButtonStatus();
 
             Long reporterId = s.getReporterId();
             Long superiorId = s.getSuperiorId2();
             if (!targetId.equals(reporterId) && !targetId.equals(superiorId) && (s.getStatus() == 5)) {
-//                s.setStatus(0);
+                s.setStatus(0);
             }
-        }
+        }*/
         return page;
     }
 
@@ -1496,7 +1496,7 @@
         vo.setPostponeTransactTotal(postponeTransactTotal);
 
         // 已办结
-        int completeTransactTotal = (int) complaints.stream().filter(e -> e.getStatus() == 3).count();
+        int completeTransactTotal = (int) complaints.stream().filter(e -> e.getStatus() == 3 || e.getStatus() == 8).count();
         vo.setCompleteTransactTotal(completeTransactTotal);
 
         // 超时办理总量
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java
index 68af4ae..b283e13 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java
@@ -50,6 +50,7 @@
     private final IComActService comActService;
     private final RedisUtils redisUtils;
     private final ISystemUserLevelService systemUserLevelService;
+    private final IdentityInformationService identityInformationService;
     /**
      * 党员分页查询列表
      *
@@ -369,22 +370,22 @@
         if (adminUser == null){
             throw new ServiceException("无权审核");
         }
-
+        IdentityInformation identityInformation = identityInformationService.getCurrentIdentityInformation(loginUserInfo);
         Integer identity = (Integer) redisUtils.get("identity:" + loginUserInfo.getPhone());
-        if(identity != null && identity != 2){
+        if(identityInformation.getIdentity() != 2){
             throw new ServiceException("请切换至管理员身份");
         }
-
-        int accountLevel = adminUser.getAccountLevel();
+        SystemUserLevel systemUserLevel = identityInformation.getSystemUserLevel();
+        int accountLevel = systemUserLevel.getLevel();
         Long communityId = null;
         String streetId = null;
         String districtsCode = null;
         if (accountLevel == ReportTypeEnum.COMMUNITY.getCode()) {
-            communityId = adminUser.getCommunityId();
+            communityId = systemUserLevel.getCommunityId();
         } else if (accountLevel == ReportTypeEnum.STREET.getCode()) {
-            streetId = adminUser.getStreetId();
+            streetId = systemUserLevel.getStreetId();
         } else if (accountLevel == ReportTypeEnum.DISTRICT.getCode()) {
-            districtsCode = adminUser.getDistrictsCode();
+            districtsCode = systemUserLevel.getDistrictsCode();
         } else if(accountLevel != ReportTypeEnum.CITY.getCode()){
             throw new ServiceException("无权审核:未知等级");
         }
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/StaticsService.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/StaticsService.java
index 03ce775..1817567 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/StaticsService.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/StaticsService.java
@@ -157,13 +157,13 @@
             Date start = null;
             switch (query.getTimeType()) {
                 case 2:
-                    start = DateUtils.addDay(now, -15);
+                    start = DateUtils.addDay(now, -14);
                     break;
                 case 3:
-                    start = DateUtils.addDay(now, -30);
+                    start = DateUtils.addDay(now, -29);
                     break;
                 default:
-                    start = DateUtils.addDay(now, -7);
+                    start = DateUtils.addDay(now, -6);
                     break;
             }
             //格式化
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml
index bdbae87..ccceed4 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml
@@ -88,7 +88,7 @@
         sc.videos,
         CASE
         /* 当诉求是当前用户处理的,显示正常状态 */
-        WHEN (scar.superior_id = #{targetId} OR scar.create_by = #{query.userId}) THEN
+        WHEN (scar.superior_id = #{targetId} OR scar.reporter_id = #{targetId}) THEN
             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
@@ -152,16 +152,16 @@
                 and (sc.party_member_id = #{targetId} OR 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="query.type!=null and query.type == 0">
-                AND (scar.superior_id = #{targetId} or scar.create_by = #{query.userId})
+                AND (scar.superior_id = #{targetId} or scar.reporter_id = #{targetId})
                 AND sc.status IN(0,1,2) and scar.audit_status = 0
             </if>
             <if test="query.type!=null and query.type == 1">
                 AND (
                 /* 如果是当前用户处理的诉求,正常显示正在办理的诉求 */
-                ((scar.superior_id = #{targetId} OR scar.create_by = #{query.userId}) AND (sc.status IN(0,1,2) AND scar.audit_status NOT IN (0,2)))
+                ((scar.superior_id = #{targetId} OR scar.reporter_id = #{targetId}) AND (sc.status IN(0,1,2) AND scar.audit_status NOT IN (0,2)))
                 OR
                 /* 如果不是当前用户处理的诉求,只要不是已办结(3)或已评价(8)的都算作正在办理 */
-                ((scar.superior_id != #{targetId} AND scar.create_by != #{query.userId} OR scar.superior_id IS NULL) AND sc.status NOT IN(3,8))
+                ((scar.superior_id != #{targetId} AND  scar.reporter_id = #{targetId} OR scar.superior_id IS NULL) AND sc.status NOT IN(3,8))
                 )
             </if>
             <if test="query.type!=null and query.type == 2">
@@ -575,6 +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
@@ -656,7 +657,7 @@
                or sc.name like concat('%',#{keyword},'%')or sc.report_user_name like concat('%',#{keyword},'%'))
             </if>
         </where>
-        ORDER BY sc.create_time, scar.create_time DESC
+        ORDER BY sc.create_time DESC, scar.create_time DESC
     </select>
     <select id="queryCompliantList" resultType="com.panzhihua.sangeshenbian.model.entity.Complaint">
         SELECT sc.id,
@@ -792,8 +793,8 @@
         sc.handling_day,
         sc.comment_rate
         FROM sgsb_complaint sc
-        LEFT JOIN sgsb_complaint_audit_record scar ON scar.complaint_id = sc.id
-        where scar.audit_status!=1 and  sc.id in
+        LEFT JOIN sgsb_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1
+        where sc.id in
         <foreach item="item" collection="ids" index="index" close=")" open="(" separator=",">
             #{item}
         </foreach>

--
Gitblit v1.7.1