Преглед на файлове

1、社保导入模块调整
2、成绩录入调整
3、系统消息接口增加创建时间返回

dzx преди 1 месец
родител
ревизия
1e1908cb2b

+ 8 - 0
src/main/java/com/xjrsoft/module/system/vo/SystemUpdateMessageVo.java

@@ -1,8 +1,12 @@
 package com.xjrsoft.module.system.vo;
 
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.Date;
+
 /**
 * @title: 系统消息表单出参
 * @Author brealinxx
@@ -47,5 +51,9 @@ public class SystemUpdateMessageVo {
     private String createUserName;
 
 
+    @ApiModelProperty("创建时间")
+    private Date createDate;
+
+
 
 }

+ 16 - 0
src/main/java/com/xjrsoft/module/xycxedu/controller/ExamSubjectScoreController.java

@@ -3,6 +3,7 @@ package com.xjrsoft.module.xycxedu.controller;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.dev33.satoken.stp.StpUtil;
 import com.alibaba.excel.support.ExcelTypeEnum;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.model.result.RT;
@@ -88,6 +89,21 @@ public class ExamSubjectScoreController {
             subjectScore.setClassRanking(dto.getClassRanking());
             subjectScore.setGradeRanking(dto.getGradeRanking());
             scoreService.updateById(subjectScore);
+
+            if(dto.getScore() == null || dto.getGradeRanking() == null || dto.getClassRanking() == null){
+                UpdateWrapper<ExamSubjectScore> updateWrapper = new UpdateWrapper<>();
+                updateWrapper.eq("id", dto.getId());
+                if(dto.getScore() == null){
+                    updateWrapper.setSql("score = null");
+                }
+                if(dto.getClassRanking() == null){
+                    updateWrapper.setSql("class_ranking = null");
+                }
+                if(dto.getGradeRanking() == null){
+                    updateWrapper.setSql("grade_ranking = null");
+                }
+                scoreService.update(subjectScore, updateWrapper);
+            }
         }
 
         return RT.ok(true);

+ 27 - 1
src/main/java/com/xjrsoft/module/xycxedu/service/impl/ExamSubjectScoreEnterServiceImpl.java

@@ -12,7 +12,9 @@ import com.xjrsoft.common.enums.ArchivesStatusEnum;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseCourseSubject;
+import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseCourseSubjectService;
 import com.xjrsoft.module.generator.entity.ImportConfig;
 import com.xjrsoft.module.organization.entity.User;
@@ -72,6 +74,8 @@ public class ExamSubjectScoreEnterServiceImpl extends MPJBaseServiceImpl<ExamSub
     private final IUserService userService;
     private final IExamSubjectScoreService scoreService;
 
+    private final IBaseClassService classService;
+
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -139,11 +143,33 @@ public class ExamSubjectScoreEnterServiceImpl extends MPJBaseServiceImpl<ExamSub
 
     @Override
     public Boolean save(AddExamSubjectScoreEnterDto dto) {
+        BaseCourseSubject courseSubject = courseSubjectService.getById(dto.getCourseSubjectId());
+
+
+        List<String> classNames = new ArrayList<>();
+        for (Long classId : dto.getClassIds()) {
+            List<ExamSubjectScoreEnter> list = this.list(
+                    new QueryWrapper<ExamSubjectScoreEnter>().lambda()
+                            .eq(ExamSubjectScoreEnter::getSemesterId, dto.getSemesterId())
+                            .eq(ExamSubjectScoreEnter::getExamPlanId, dto.getExamPlanId())
+                            .eq(ExamSubjectScoreEnter::getCourseSubjectId, dto.getCourseSubjectId())
+                            .like(ExamSubjectScoreEnter::getClassIds, classId)
+                            .eq(ExamSubjectScoreEnter::getDeleteMark, DeleteMark.NODELETE.getCode())
+            );
+            if(!list.isEmpty()){
+                User user = userService.getById(list.get(0).getCreateUserId());
+                BaseClass aClass = classService.getById(classId);
+                classNames.add(aClass.getName() + "的" + courseSubject.getName() + "已被" + user.getName() + "添加");
+            }
+        }
+        if(!classNames.isEmpty()){
+            String messgae = classNames.toString().replace("[", "").replace("]", "").replace(", ", ";");
+            throw new MyException(messgae + ",不能重复添加");
+        }
         ExamSubjectScoreEnter examSubjectScoreEnter = BeanUtil.toBean(dto, ExamSubjectScoreEnter.class);
         examSubjectScoreEnter.setCreateDate(new Date());
         String classIds = dto.getClassIds().toString().replace("[", "").replace("]", "").replace(" ", "");
         examSubjectScoreEnter.setClassIds(classIds);
-        BaseCourseSubject courseSubject = courseSubjectService.getById(examSubjectScoreEnter.getCourseSubjectId());
         examSubjectScoreEnter.setCoursename(courseSubject.getName());
         boolean isSuccess = this.save(examSubjectScoreEnter);
         List<User> userList = userService.list(