From ba7ec450a7538f69f31fbc09a978a6d476d2a939 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期六, 01 三月 2025 00:16:27 +0800
Subject: [PATCH] bug修改

---
 springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 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 a0f18af..714a7b6 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
@@ -441,9 +441,16 @@
         updateById(complaint);
         Long superiorOrgId = complaint.getSuperiorId();
         Integer superiorType = complaint.getSuperiorType();
-
+        //查询当前单位审核记录表数据
+        //查询上报审核记录
+        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(dto.getComplaintId(), superiorOrgId, superiorType, 1, loginUserInfoVO.getUserId());
+        complaintFlowService.createFlow(complaintAuditRecord, 1,loginUserInfoVO.getUserId());
 
         // 标记最新
         complaintAuditRecordService.update(new LambdaUpdateWrapper<ComplaintAuditRecord>()
@@ -499,6 +506,12 @@
                 .eq(ComplaintAuditRecord::getReportType, systemUser.getAccountLevel())
                 .eq(ComplaintAuditRecord::getSuperiorId, superiorId)
                 .last("LIMIT 1").one();
+        ComplaintAuditRecord lowLevelRecord = complaintAuditRecordService.lambdaQuery()
+                .eq(ComplaintAuditRecord::getComplaintId, complaintReporAuditDTO.getId())
+                .eq(ComplaintAuditRecord::getAuditType, 2)
+                .eq(ComplaintAuditRecord::getLatestFlag, true)
+                .eq(ComplaintAuditRecord::getReportType, systemUser.getAccountLevel()+1)
+                .last("LIMIT 1").one();
         if (Objects.isNull(complaintAuditRecord)) {
             throw new ServiceException("上报申请记录不存在");
         }
@@ -531,14 +544,8 @@
             record.setSuperiorId(superiorId);
             record.setSort(count + 1);
             complaintAuditRecordService.save(record);
-
-
-            if (Objects.nonNull(complaint.getSuperiorId())) {
-                complaintFlowService.createFlow(complaintAuditRecord.getComplaintId(), complaint.getSuperiorId(), complaint.getSuperiorType(), 0, loginUserInfoVO.getUserId());
-            } else {
-                complaintFlowService.createFlow(complaintAuditRecord.getComplaintId(), complaint.getCreateBy(), complaint.getReportType(), 0, loginUserInfoVO.getUserId());
-            }
-
+            //创建流程
+            complaintFlowService.createFlow(lowLevelRecord ,0, loginUserInfoVO.getUserId());
         } else {
 
             switch (systemUser.getAccountLevel() + 1) {

--
Gitblit v1.7.1