From 9abc6588d464269024d3e680b98cfd71e2acc84e Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: Wed, 29 Apr 2026 13:14:15 +0800
Subject: [PATCH] 新增修改部分限制
---
multi-framework/src/main/java/com/gkhy/exam/framework/aspectj/LogAspect.java | 15 ++++++-
multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterServiceImpl.java | 14 +++---
multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseServiceImpl.java | 29 +++++++-------
multi-system/src/main/resources/mapper/system/ExCourseMapper.xml | 3 +
multi-system/src/main/java/com/gkhy/exam/system/domain/ExCourse.java | 8 ++++
multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterPeriodServiceImpl.java | 14 +++---
multi-system/src/main/resources/mapper/system/ExPhaseStudentMapper.xml | 2
multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCoursePhaseServiceImpl.java | 16 ++++---
8 files changed, 61 insertions(+), 40 deletions(-)
diff --git a/multi-framework/src/main/java/com/gkhy/exam/framework/aspectj/LogAspect.java b/multi-framework/src/main/java/com/gkhy/exam/framework/aspectj/LogAspect.java
index 6170c38..d4ce823 100644
--- a/multi-framework/src/main/java/com/gkhy/exam/framework/aspectj/LogAspect.java
+++ b/multi-framework/src/main/java/com/gkhy/exam/framework/aspectj/LogAspect.java
@@ -6,6 +6,7 @@
import cn.hutool.extra.servlet.ServletUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
+import com.alibaba.fastjson2.JSONWriter;
import com.alibaba.fastjson2.filter.SimplePropertyPreFilter;
import com.gkhy.exam.common.annotation.Log;
import com.gkhy.exam.common.domain.entity.SysUser;
@@ -268,13 +269,21 @@
webLog.put("method",request.getMethod());
Object params=getParameter(method, joinPoint.getArgs());
- webLog.put("parameter",params);
+ if (params != null) {
+ if (params instanceof MultipartFile || params.toString().contains("MultipartFile")) {
+ webLog.put("parameter", "文件上传接口,参数不打印");
+ } else {
+ webLog.put("parameter", params);
+ }
+ } else {
+ webLog.put("parameter", params);
+ }
webLog.put("uri",request.getRequestURI());
webLog.put("url",requestURL.toString());
if(user!=null) {
webLog.put("userName", user.getName());
}
- log.info(webLog.toString());
+ log.info(JSON.toJSONString(webLog, JSONWriter.Feature.IgnoreErrorGetter));
Object result = joinPoint.proceed();
if (result == null) {
//如果切到了 没有返回类型的void方法,这里直接返回
@@ -283,7 +292,7 @@
long endTime = System.currentTimeMillis();
webLog.put("result",StringUtils.sub(JSON.toJSONString(result),0,2000));
webLog.put("spendTime",endTime - startTime);
- log.info(webLog.toString());
+ log.info(JSON.toJSONString(webLog, JSONWriter.Feature.IgnoreErrorGetter));
return result;
}
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/domain/ExCourse.java b/multi-system/src/main/java/com/gkhy/exam/system/domain/ExCourse.java
index 0c993d9..2bb7f78 100644
--- a/multi-system/src/main/java/com/gkhy/exam/system/domain/ExCourse.java
+++ b/multi-system/src/main/java/com/gkhy/exam/system/domain/ExCourse.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.gkhy.exam.common.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
@@ -15,6 +16,8 @@
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
+
+import java.time.LocalDateTime;
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
@@ -107,5 +110,10 @@
@TableField(exist = false)
private Long period;
+ @ApiModelProperty(value = "截止时间")
+ @TableField("stop_time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ private LocalDateTime stopTime;
+
}
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterPeriodServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterPeriodServiceImpl.java
index b70b3fe..0ea2b17 100644
--- a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterPeriodServiceImpl.java
+++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterPeriodServiceImpl.java
@@ -104,13 +104,13 @@
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("已审批的课程不能再操作");
- }
- if(state== ApproveStatusEnum.APPROVING.getCode()){
- throw new ApiException("待审批的课程不能再操作");
- }
+// int state=courseMapper.selectCourseState(courseChapterPeriod.getCourseId());
+// if(state== ApproveStatusEnum.APPROVED.getCode()){
+// throw new ApiException("已审批的课程不能再操作");
+// }
+// if(state== ApproveStatusEnum.APPROVING.getCode()){
+// throw new ApiException("待审批的课程不能再操作");
+// }
}
}
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterServiceImpl.java
index e74deb4..b60d4b7 100644
--- a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterServiceImpl.java
+++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterServiceImpl.java
@@ -149,13 +149,13 @@
if(courseChapter.getCompanyId()!=null&&!currentUser.getCompanyId().equals(courseChapter.getCompanyId())){
throw new ApiException("没有权限操作其他企业课程");
}
- int state=courseMapper.selectCourseState(courseChapter.getCourseId());
- if(state==ApproveStatusEnum.APPROVED.getCode()){
- throw new ApiException("已审批的课程不能再操作");
- }
- if(state==ApproveStatusEnum.APPROVING.getCode()){
- throw new ApiException("待审批的课程不能再操作");
- }
+// int state=courseMapper.selectCourseState(courseChapter.getCourseId());
+// if(state==ApproveStatusEnum.APPROVED.getCode()){
+// throw new ApiException("已审批的课程不能再操作");
+// }
+// if(state==ApproveStatusEnum.APPROVING.getCode()){
+// throw new ApiException("待审批的课程不能再操作");
+// }
}
}
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCoursePhaseServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCoursePhaseServiceImpl.java
index 202ca2c..c387078 100644
--- a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCoursePhaseServiceImpl.java
+++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCoursePhaseServiceImpl.java
@@ -108,13 +108,15 @@
if(coursePhase.getCompanyId()!=null&&!currentUser.getCompanyId().equals(coursePhase.getCompanyId())){
throw new ApiException("没有权限操作其他企业批次");
}
- int level=coursePhase.getLevel();
- if((level==1 ||level==4) && currentUser.getUserType()>UserTypeEnum.COMPANY_USER.getCode()){
- throw new ApiException("当前账户无权限新增公司级批次");
- }
- if(level==2 && currentUser.getUserType()>UserTypeEnum.DEPART_USER.getCode()){
- throw new ApiException("当前账户无权限新增事业部级级批次");
- }
+// int level=coursePhase.getLevel();
+// if((level==1 ||level==4) && (currentUser.getUserType().equals(UserTypeEnum.COMPANY_USER.getCode())
+// || currentUser.getUserType().equals(UserTypeEnum.COMPANY_ADMIN.getCode())
+// || currentUser.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode()) ) ){
+// throw new ApiException("当前账户无权限新增公司级批次");
+// }
+// if(level==2 && currentUser.getUserType()>UserTypeEnum.DEPART_USER.getCode()){
+// throw new ApiException("当前账户无权限新增事业部级级批次");
+// }
}
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseServiceImpl.java
index 682e92b..12406f9 100644
--- a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseServiceImpl.java
+++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseServiceImpl.java
@@ -76,11 +76,12 @@
}
checkUserAllowed(course);
if(SecurityUtils.getLoginUser().getUser().getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode())){
- course.setState(ApproveStatusEnum.APPROVED.getCode());
course.setPrivatize(PrivatizeEnum.PUBLIC.getCode());
- }else{
- course.setState(ApproveStatusEnum.TEMPORARY.getCode());
}
+// else{
+// course.setState(ApproveStatusEnum.TEMPORARY.getCode());
+// }
+ course.setState(ApproveStatusEnum.APPROVED.getCode());
int row =baseMapper.insert(course);
if(row<1){
throw new ApiException("新增课程失败");
@@ -112,14 +113,14 @@
if(!currentUser.getCompanyId().equals(course.getCompanyId())){
throw new ApiException("没有权限操作其他企业课程");
}
- if(course.getId()!=null){
- if(course.getState().equals(ApproveStatusEnum.APPROVING.getCode())){
- throw new ApiException("课程待审批状态不能再操作");
- }
- if(course.getState().equals(ApproveStatusEnum.APPROVED.getCode())){
- throw new ApiException("已审批的课程不能再操作");
- }
- }
+// if(course.getId()!=null){
+// if(course.getState().equals(ApproveStatusEnum.APPROVING.getCode())){
+// throw new ApiException("课程待审批状态不能再操作");
+// }
+// if(course.getState().equals(ApproveStatusEnum.APPROVED.getCode())){
+// throw new ApiException("已审批的课程不能再操作");
+// }
+// }
}
@Override
@@ -163,9 +164,9 @@
if(!currentUser.getCompanyId().equals(dbCourse.getCompanyId())){
throw new ApiException("没有权限操作其他企业课程");
}
- if(dbCourse.getState().equals(ApproveStatusEnum.APPROVED.getCode())){
- throw new ApiException("已审批的课程不能再操作");
- }
+// if(dbCourse.getState().equals(ApproveStatusEnum.APPROVED.getCode())){
+// throw new ApiException("已审批的课程不能再操作");
+// }
}
if(StringUtils.isBlank(course.getMessage())){
course.setMessage("");
diff --git a/multi-system/src/main/resources/mapper/system/ExCourseMapper.xml b/multi-system/src/main/resources/mapper/system/ExCourseMapper.xml
index 679b397..3c22dc6 100644
--- a/multi-system/src/main/resources/mapper/system/ExCourseMapper.xml
+++ b/multi-system/src/main/resources/mapper/system/ExCourseMapper.xml
@@ -13,6 +13,7 @@
<result property="delFlag" column="del_flag" />
<result property="companyId" column="company_id" />
<result property="privatize" column="privatize" />
+ <result property="stopTime" column="stop_time" />
<result property="message" column="message" />
<result property="version" column="version" />
<result property="createBy" column="create_by" />
@@ -27,7 +28,7 @@
<sql id="selectCourseVo">
select a.id, a.name, a.category_id, a.status, a.logo,a.sort,a.introduce,a.state,a.company_id,a.message,
- a.privatize,a.version, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,b.name as company_name,c.name as category_name
+ a.privatize,a.stop_time,a.version, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,b.name as company_name,c.name as category_name
from ex_course a
left join sys_company b on b.id=a.company_id
left join sys_category c on c.id=a.category_id
diff --git a/multi-system/src/main/resources/mapper/system/ExPhaseStudentMapper.xml b/multi-system/src/main/resources/mapper/system/ExPhaseStudentMapper.xml
index af249de..180dc2f 100644
--- a/multi-system/src/main/resources/mapper/system/ExPhaseStudentMapper.xml
+++ b/multi-system/src/main/resources/mapper/system/ExPhaseStudentMapper.xml
@@ -66,7 +66,7 @@
and b.phone like concat('%',#{studentPhone},'%')
</if>
<if test="studentId!=null">
- and a.student_id=#{studentId}
+ and a.student_id=#{studentId} and (d.stop_time is null or d.stop_time > now())
</if>
</where>
order by a.id desc
--
Gitblit v1.9.2