From 5011ebf747ddfa41840b352c9e39cf369a8f047c Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期三, 26 十一月 2025 16:22:34 +0800
Subject: [PATCH] 情况汇总
---
multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExStudentServiceImpl.java | 37 +++++++++++++++++++++----------------
1 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExStudentServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExStudentServiceImpl.java
index ff0174e..ace23ab 100644
--- a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExStudentServiceImpl.java
+++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExStudentServiceImpl.java
@@ -118,7 +118,9 @@
@Override
public int insertStudent(ExStudent student) {
SysUser currentUser= SecurityUtils.getLoginUser().getUser();
- student.setCompanyId(currentUser.getCompanyId());
+ if (student.getCompanyId()==null){
+ student.setCompanyId(currentUser.getCompanyId());
+ }
checkUserAllowed(student);
if(!checkPhoneUnique(student)){
throw new ApiException("手机号已存在");
@@ -126,18 +128,18 @@
if(!checkIdNoUnique(student)){
throw new ApiException("身份证号已存在");
}
- if(currentUser.getUserType().equals(UserTypeEnum.COMPANY_USER.getCode())){
- if(student.getCreateId()==null){
- throw new ApiException("部门id为空");
- }
- }else if(currentUser.getUserType().equals(UserTypeEnum.DEPART_USER.getCode())){
- student.setCreateId(currentUser.getId());
- }else{//当前用户为车间级用户
- if(currentUser.getParentId()==null){
- throw new ApiException("当前用户部门id为空");
- }
- student.setCreateId(currentUser.getParentId());
- }
+// if(currentUser.getUserType().equals(UserTypeEnum.COMPANY_USER.getCode())){
+//// if(student.getCreateId()==null){
+//// throw new ApiException("部门id为空");
+//// }
+// }else if(currentUser.getUserType().equals(UserTypeEnum.DEPART_USER.getCode())){
+// student.setCreateId(currentUser.getId());
+// }else{//当前用户为车间级用户
+// if(currentUser.getParentId()==null){
+// throw new ApiException("当前用户部门id为空");
+// }
+// student.setCreateId(currentUser.getParentId());
+// }
student.setPassword(SecurityUtils.encryptPassword(Base64.decodeStr(student.getPassword())));
int row=baseMapper.insert(student);
if(row<0){
@@ -276,8 +278,11 @@
if(paperStudentList.size()>0){
trainRecordVOList.addAll(paperStudentList.stream().map(item -> {
TrainRecordVO trainRecordVO=new TrainRecordVO();
+ trainRecordVO.setPaperStudentId(item.getId());
trainRecordVO.setStudentId(item.getStudentId());
trainRecordVO.setTrainType(2);
+ trainRecordVO.setPassed(item.getPassed());
+ trainRecordVO.setNumber(item.getNumber());
trainRecordVO.setName(item.getExamPaper().getName());
trainRecordVO.setCreateTime(item.getCreateTime());
trainRecordVO.setCompanyId(item.getCompanyId());
@@ -330,7 +335,7 @@
public void checkUserAllowed(ExStudent student) {
SysUser currentUser= SecurityUtils.getLoginUser().getUser();
if(student.getId()!=null){
- if(currentUser.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode())){
+ if(currentUser.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode()) || currentUser.getUserType().equals(UserTypeEnum.COMPANY_ADMIN.getCode())){
return;
}
if(currentUser.getUserType().equals(UserTypeEnum.STUDENT.getCode()) ){
@@ -341,8 +346,8 @@
}
}
}else{
- if(currentUser.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode())){
- throw new ApiException("系统管理员没有权限操作");
+ if(currentUser.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode()) || currentUser.getUserType().equals(UserTypeEnum.COMPANY_ADMIN.getCode())){
+ return;
}
if(currentUser.getUserType().equals(UserTypeEnum.STUDENT.getCode())){
throw new ApiException("没有权限操作");
--
Gitblit v1.9.2