From f0f00e9ba8a755e4317e029d73b69a92ad9f9df1 Mon Sep 17 00:00:00 2001
From: kongzy <kongzy>
Date: 星期六, 14 九月 2024 17:02:41 +0800
Subject: [PATCH] update

---
 exam-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterPeriodServiceImpl.java |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/exam-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterPeriodServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterPeriodServiceImpl.java
index 07bd4f0..b70b3fe 100644
--- a/exam-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterPeriodServiceImpl.java
+++ b/exam-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterPeriodServiceImpl.java
@@ -101,12 +101,15 @@
         if(currentUser.getUserType().equals(UserTypeEnum.STUDENT.getCode())){
             throw new ApiException("没有权限操作");
         }
-        if(!currentUser.getCompanyId().equals(courseChapterPeriod.getCompanyId())){
+        if(courseChapterPeriod.getCompanyId()!=null&&!currentUser.getCompanyId().equals(courseChapterPeriod.getCompanyId())){
             throw new ApiException("没有权限操作其他企业课程");
         }
         int state=courseMapper.selectCourseState(courseChapterPeriod.getCourseId());
         if(state== ApproveStatusEnum.APPROVED.getCode()){
-            throw new ApiException("已审批的课程不能再修改");
+            throw new ApiException("已审批的课程不能再操作");
+        }
+        if(state== ApproveStatusEnum.APPROVING.getCode()){
+            throw new ApiException("待审批的课程不能再操作");
         }
     }
 

--
Gitblit v1.9.2