From 5d566e491ab9510c57a5f64885d273c2d6948ffe Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期二, 18 三月 2025 10:08:45 +0800
Subject: [PATCH] Merge remote-tracking branch '喜望/dev-2.0' into dev-2.0

---
 springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java |   78 +++++++++++++++++++++++++++++----------
 1 files changed, 58 insertions(+), 20 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 1d92b49..f22c644 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
@@ -499,21 +499,26 @@
                 detail.setAuditButtonStatus(0);
             }
         }
-        //已办结,显示评价按钮
-        int count = complaintCommentService.count(new LambdaQueryWrapper<ComplaintComment>().eq(ComplaintComment::getComplaintId, detail.getId()).eq(ComplaintComment::getDelFlag, 0));
-        if(detail.getStatus() == 3 && 0 == count){
-            if(systemUserByPhone.isPresent()){
-                SystemUser systemUser = systemUserByPhone.get();
-                Integer isAdmin = systemUser.getIsAdmin();
-                if(accountLevel.compareTo(detail.getReportType()) == 0 && ((accountLevel != 5 && 1 == isAdmin) || accountLevel == 5)){
-                    detail.setEvaluateButtonStatus(0);
-                }
-            }else{
-                if(detail.getReportType() == 5){
-                    detail.setEvaluateButtonStatus(0);
-                }
-            }
-        }
+    
+    
+        buttonPermission(detail, systemUserByPhone);
+        
+        
+//        //已办结,显示评价按钮
+//        int count = complaintCommentService.count(new LambdaQueryWrapper<ComplaintComment>().eq(ComplaintComment::getComplaintId, detail.getId()).eq(ComplaintComment::getDelFlag, 0));
+//        if(detail.getStatus() == 3 && 0 == count){
+//            if(systemUserByPhone.isPresent()){
+//                SystemUser systemUser = systemUserByPhone.get();
+//                Integer isAdmin = systemUser.getIsAdmin();
+//                if(accountLevel.compareTo(detail.getReportType()) == 0 && ((accountLevel != 5 && 1 == isAdmin) || accountLevel == 5)){
+//                    detail.setEvaluateButtonStatus(0);
+//                }
+//            }else{
+//                if(detail.getReportType() == 5){
+//                    detail.setEvaluateButtonStatus(0);
+//                }
+//            }
+//        }
         return detail;
     }
 
@@ -1010,10 +1015,43 @@
             throw new ServiceException("该诉求不存在");
         }
          //查询社区信息
-        BcRegion region = bcRegionService.getDistrictByCode(complaint.getDistrictsCode().toString());
-        ComStreet street = comStreetService.getById(complaint.getStreetId().toString());
-        ComAct act = comActService.getById(complaint.getCommunityId());
-        String community = region.getRegionName() +"-"+ street.getName() + "-"+ act.getName();
+        Integer reportType = complaint.getReportType();
+        String community = "";
+        switch (reportType){
+            case 1:
+                community = "攀枝花市";
+                break;
+            case 2:
+                BcRegion region = bcRegionService.getDistrictByCode(complaint.getDistrictsCode().toString());
+                if (Objects.nonNull(region)) {
+                    community = region.getRegionName();
+                }
+                break;
+            case 3:
+                ComStreet street = comStreetService.getById(complaint.getStreetId().toString());
+                if (Objects.nonNull(street)) {
+                    BcRegion district = bcRegionService.getDistrictByCode(street.getAreaCode().toString());
+                    community = Objects.nonNull(district) ? district.getRegionName() + "-" + street.getName() : street.getName();
+                }
+                break;
+            case 4:
+                ComAct act = comActService.getById(complaint.getCommunityId());
+                if (Objects.nonNull(act)) {
+                    ComStreet street2 = comStreetService.getById(complaint.getStreetId().toString());
+                    BcRegion district = bcRegionService.getDistrictByCode(act.getAreaCode());
+                    community = Objects.nonNull(district) && Objects.nonNull(street2)? district.getRegionName() + "-" + street2.getName() + "-" + act.getName() : act.getName();
+                }
+                break;
+            case 5:
+                ComAct act2 = comActService.getById(complaint.getCommunityId());
+                if (Objects.nonNull(act2)) {
+                    ComStreet street2 = comStreetService.getById(complaint.getStreetId().toString());
+                    BcRegion district = bcRegionService.getDistrictByCode(act2.getAreaCode());
+                    community = Objects.nonNull(district) && Objects.nonNull(street2)? district.getRegionName() + "-" + street2.getName() + "-" + act2.getName() : act2.getName();
+                }
+                break;
+        }
+
         PartyMember partyMember = null;
         if (Objects.nonNull(complaint.getPartyMemberId())){
              partyMember = partyMemberService.getById(complaint.getPartyMemberId());
@@ -1037,7 +1075,7 @@
         map.put("community", community);
         map.put("problemType", complaint.getProblemType());
         map.put("descriptionContent", complaint.getDescriptionContent());
-        map.put("reportType", ReportTypeEnum.fromCode(complaint.getReportType()).getDescription());
+        map.put("reportType", ReportTypeEnum.fromCode(reportType).getDescription());
         map.put("partyOrganization",Objects.nonNull(partyMember)? partyMember.getPartyOrganization() : "");
         map.put("name", complaint.getName());
         map.put("contactNumber", complaint.getContactNumber());

--
Gitblit v1.7.1