From 101192fd84bb38911ea7bc84c21cfe2b9ba378c7 Mon Sep 17 00:00:00 2001
From: ZQN <364596817@qq.com>
Date: 星期二, 25 六月 2024 14:25:30 +0800
Subject: [PATCH] 审批修改

---
 project-enforce/src/main/java/com/project/enforce/service/impl/EnforceComplaintLogServiceImpl.java |   52 ++++++++++++++++++++++++++++++----------------------
 1 files changed, 30 insertions(+), 22 deletions(-)

diff --git a/project-enforce/src/main/java/com/project/enforce/service/impl/EnforceComplaintLogServiceImpl.java b/project-enforce/src/main/java/com/project/enforce/service/impl/EnforceComplaintLogServiceImpl.java
index 3e7842c..691350c 100644
--- a/project-enforce/src/main/java/com/project/enforce/service/impl/EnforceComplaintLogServiceImpl.java
+++ b/project-enforce/src/main/java/com/project/enforce/service/impl/EnforceComplaintLogServiceImpl.java
@@ -18,6 +18,7 @@
 import com.project.enforce.mapper.EnforceComplaintLogMapper;
 import com.project.enforce.service.IEnforceComplaintLogService;
 import com.project.system.service.ISysDeptService;
+import com.project.system.service.ISysUserService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -37,6 +38,7 @@
 public class EnforceComplaintLogServiceImpl extends ServiceImpl<EnforceComplaintLogMapper, EnforceComplaintLog> implements IEnforceComplaintLogService {
 
     private final ISysDeptService deptService;
+    private final ISysUserService userService;
 
 
     @Override//鍒楄〃鏌ヨ
@@ -92,10 +94,14 @@
             vos.add(new OrderNodeVo("鍙戣捣鎶曡瘔",order.getCompanyUser(),order.getComplaintTime(), null));
         }
         if (order.getInTime()!=null){
-            vos.add(new OrderNodeVo("鍝嶅簲鎶曡瘔",order.getInUser(),order.getInTime(), null));
+            vos.add(new OrderNodeVo("澶勭悊涓�",order.getInUser(),order.getInTime(), null));
         }
         if (order.getResultTime()!=null){
-            vos.add(new OrderNodeVo("鎶曡瘔缁撴灉",order.getExecuteUser(),order.getResultTime(), order.getComplaintResult()));
+            if (order.getComplaintStatus()==-1){
+                vos.add(new OrderNodeVo("宸查┏鍥�",order.getExecuteUser(),order.getResultTime(), order.getComplaintResult()));
+            } else {
+                vos.add(new OrderNodeVo("宸插姙缁�",order.getExecuteUser(),order.getResultTime(), order.getComplaintResult()));
+            }
         }
         return vos;
     }
@@ -104,7 +110,7 @@
     @Transactional
     public Boolean inComplaint(ComplaintResultBo bo)
     {
-        SysUser loginUser = SecurityUtils.getLoginUser().getUser();
+        SysUser loginUser = userService.selectUserById(SecurityUtils.getUserId());
         return this.update(lu()
                 .set(EnforceComplaintLog::getInId,loginUser.getUserId())
                 .set(EnforceComplaintLog::getInUser,loginUser.getNickName())
@@ -121,11 +127,12 @@
         if (StringUtils.isEmpty(bo.getResult())){
             throw new BaseException("璇峰~鍐欏鐞嗙粨鏋�");
         }
-        SysUser loginUser = SecurityUtils.getLoginUser().getUser();
+        SysUser loginUser = userService.selectUserById(SecurityUtils.getUserId());
         return this.update(lu()
                 .set(EnforceComplaintLog::getResultId,loginUser.getUserId())
                 .set(EnforceComplaintLog::getResultUser,loginUser.getNickName())
                 .set(EnforceComplaintLog::getResultTime, DateUtils.getNowDate())
+                .set(EnforceComplaintLog::getComplaintStatus, bo.getComplaintStatus())
                 .set(EnforceComplaintLog::getComplaintResult, bo.getResult())
                 .eq(EnforceComplaintLog::getId, bo.getId())
         );
@@ -140,25 +147,26 @@
         if (StringUtils.isEmpty(entity.getExecuteDeptName()) && entity.getExecuteDeptName()!=null){
             entity.setExecuteDeptName(deptService.getDeptAllName(entity.getExecuteDeptId()));
         }
-        if (entity.getCompanyId()==null
-                || StringUtils.isEmpty(entity.getCompanyName())
-                || StringUtils.isEmpty(entity.getCompanyUser())
-                || StringUtils.isEmpty(entity.getCompanyPhone())
-        ){
-            throw new BaseException("鎶曡瘔浼佷笟涓嶈兘涓虹┖锛�");
-        }
-        if (entity.getExecuteDeptId() == null
-                || StringUtils.isEmpty(entity.getExecuteDeptName())
-        ){
-            throw new BaseException("鎶曡瘔鍗曚綅涓嶈兘涓虹┖锛�");
-        }
-        if (StringUtils.isEmpty(entity.getComplaintType())){
-            throw new BaseException("璇烽�夋嫨瑕佹姇璇夌被鍨嬶紒");
-        }
-        if (StringUtils.isEmpty(entity.getComplaintReason())){
-            throw new BaseException("璇峰~鍐欐姇璇夊唴瀹癸紒");
-        }
         if (entity.getId()==null){
+            if (entity.getCompanyId()==null
+                    || StringUtils.isEmpty(entity.getCompanyName())
+                    || StringUtils.isEmpty(entity.getCompanyUser())
+                    || StringUtils.isEmpty(entity.getCompanyPhone())
+            ){
+                throw new BaseException("鎶曡瘔浼佷笟涓嶈兘涓虹┖锛�");
+            }
+            if (entity.getExecuteDeptId() == null
+                    || StringUtils.isEmpty(entity.getExecuteDeptName())
+            ){
+                throw new BaseException("鎶曡瘔鍗曚綅涓嶈兘涓虹┖锛�");
+            }
+            if (StringUtils.isEmpty(entity.getComplaintType())){
+                throw new BaseException("璇烽�夋嫨瑕佹姇璇夌被鍨嬶紒");
+            }
+            if (StringUtils.isEmpty(entity.getComplaintReason())){
+                throw new BaseException("璇峰~鍐欐姇璇夊唴瀹癸紒");
+            }
+
             if (entity.getOrderId()!=null){ //鎵ф硶鍗曟姇璇�
                 int count = this.count(lq().eq(EnforceComplaintLog::getOrderId, entity.getOrderId()));
                 if (count >0){

--
Gitblit v1.9.1