فهرست منبع

学生提交申请信息V7.5

平常心 5 ماه پیش
والد
کامیت
364f4e611c

+ 3 - 0
yudao-module-as/yudao-module-as-api/src/main/java/cn/iocoder/yudao/module/as/enums/ErrorCodeConstants.java

@@ -16,4 +16,7 @@ public interface ErrorCodeConstants {
     ErrorCode AIDING_STUDENTS_IMPORT_LIST_STUDENT_CODE_NOT_EXISTS = new ErrorCode(2_009_000_008,  "系统中不存在该学生学号");
 
 
+    ErrorCode STUDENT_INFO_EXISTS = new ErrorCode(2_009_000_009,  "学生信息已存在");
+    ErrorCode CLASS_DISCUSSION_INFO_EXISTS = new ErrorCode(2_009_000_010,  "班级材料已存在");
+
 }

+ 25 - 9
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentspersonmanage/AidingStudentsPersonManageServiceImpl.java

@@ -21,7 +21,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.util.*;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
+import static cn.iocoder.yudao.module.as.enums.ErrorCodeConstants.*;
 
 /**
  * @autor WoVoM
@@ -73,6 +76,15 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
      */
     @Override
     public void uploadAidingStudentsManage(AidingStudentPersonManageInfoRespVO uploadVO) {
+        // 0.检查数据库是否已经存在该信息
+        AidingStudentsPersonManageDO user1 = aidingStudentsPersonManageMapper
+                .selectOne(new LambdaQueryWrapper<AidingStudentsPersonManageDO>()
+                        .eq(AidingStudentsPersonManageDO::getManageId, uploadVO.getManageId())
+                        .eq(AidingStudentsPersonManageDO::getCollegeManageId, uploadVO.getCollegeManageId())
+                        .eq(AidingStudentsPersonManageDO::getStudentSno, uploadVO.getStudentSno()));
+        if(user1 != null){
+            throw exception(STUDENT_INFO_EXISTS);
+        }
         // 1.获取当前登录的用户表
         AidingStudentsPersonManageDO aDo = BeanUtils.toBean(uploadVO, AidingStudentsPersonManageDO.class);
         AdminUserRespDTO user =  adminUserApi.getUser(getLoginUser().getId());
@@ -95,10 +107,10 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
      */
     @Override
     public AidingStudentPersonManageInfoRespVO checkAidingStudentsManage() {
-        AdminUserRespDTO Loginuser =  adminUserApi.getUser(getLoginUser().getId());
-        AidingStudentsPersonManageDO user = aidingStudentsPersonManageMapper
-                .selectOne(AidingStudentsPersonManageDO::getStudentSno, Loginuser.getStudentId());
-        return BeanUtils.toBean(user, AidingStudentPersonManageInfoRespVO.class);
+        return BeanUtils
+                .toBean(aidingStudentsPersonManageMapper
+                .selectOne(AidingStudentsPersonManageDO::getStudentSno, adminUserApi.getUser(getLoginUser().getId()).getStudentId())
+                        , AidingStudentPersonManageInfoRespVO.class);
     }
 
     /**
@@ -107,10 +119,7 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
      */
     @Override
     public void editAidingStudentsManage(AidingStudentPersonManageInfoRespVO uploadVO) {
-        AidingStudentsPersonManageDO aDo = new AidingStudentsPersonManageDO();
-         aDo = BeanUtils.toBean(uploadVO, AidingStudentsPersonManageDO.class);
-         aDo.setRejectNotes("");
-         aidingStudentsPersonManageMapper.updateById(aDo);
+         aidingStudentsPersonManageMapper.updateById(BeanUtils.toBean(uploadVO, AidingStudentsPersonManageDO.class));
     }
 
     /**
@@ -225,7 +234,6 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
                 updateWrapper.set(AidingStudentsPersonManageDO::getCollegeSuggestionDifficultType, id.getCollegeSuggestionDifficultType());
             else if (id.getSchoolSuggestionDifficultType() != null)
                 updateWrapper.set(AidingStudentsPersonManageDO::getSchoolSuggestionDifficultType, id.getSchoolSuggestionDifficultType());
-            else;
             aidingStudentsPersonManageMapper.update(null, updateWrapper);
         }
     }
@@ -236,6 +244,14 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
      */
     @Override
     public void uploadResultAidingStudentsManage(AidingStudentPersonManageInfoPageReqVO classuploadVO) {
+        AidingStudentPersonManageEvaluationResultDO aidingStudentPersonManageEvaluationResultDO = aidingStudentPersonManageEvaluationResultMapper
+                .selectOne(new LambdaQueryWrapper<AidingStudentPersonManageEvaluationResultDO>()
+                        .eq(AidingStudentPersonManageEvaluationResultDO::getCollegeManageId, classuploadVO.getCollegeManageId())
+                        .eq(AidingStudentPersonManageEvaluationResultDO::getManageId, classuploadVO.getManageId())
+                        .eq(AidingStudentPersonManageEvaluationResultDO::getClassName, classuploadVO.getClassName()));
+        if(aidingStudentPersonManageEvaluationResultDO != null){
+            throw exception(CLASS_DISCUSSION_INFO_EXISTS);
+        }
         AidingStudentPersonManageEvaluationResultDO ado = new AidingStudentPersonManageEvaluationResultDO();
         org.springframework.beans.BeanUtils.copyProperties(classuploadVO,ado);
         ado.setStatus(1);