dzx 8 mesi fa
parent
commit
7e7f7abe48

+ 5 - 28
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java

@@ -7,33 +7,21 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.exception.MyException;
-import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
-import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.banding.dto.ChangeClassDto;
 import com.xjrsoft.module.banding.dto.StudentDto;
 import com.xjrsoft.module.banding.entity.BandingTaskClass;
 import com.xjrsoft.module.banding.entity.BandingTaskClassStudent;
 import com.xjrsoft.module.banding.mapper.BandingTaskClassMapper;
 import com.xjrsoft.module.banding.mapper.BandingTaskClassStudentMapper;
-import com.xjrsoft.module.banding.mapper.BandingTaskMapper;
 import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
 import com.xjrsoft.module.base.entity.BaseSemester;
-import com.xjrsoft.module.base.mapper.BaseMajorSetMapper;
-import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseSemesterService;
-import com.xjrsoft.module.organization.service.IUserRoleRelationService;
-import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import com.xjrsoft.module.student.entity.StudentReportPlan;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
-import com.xjrsoft.module.student.mapper.BaseClassMajorSetMapper;
-import com.xjrsoft.module.student.service.IBaseNewStudentService;
-import com.xjrsoft.module.student.service.IBaseStudentFamilyService;
-import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
-import com.xjrsoft.module.student.service.IBaseStudentService;
+import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
 import com.xjrsoft.module.student.service.IStudentReportPlanService;
-import com.xjrsoft.module.student.service.IStudentReportRecordService;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -54,23 +42,10 @@ import java.util.List;
 @AllArgsConstructor
 public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<BandingTaskClassStudentMapper, BandingTaskClassStudent> implements IBandingTaskClassStudentService {
     private final BandingTaskClassMapper taskClassMapper;
-    private final BandingTaskMapper bandingTaskMapper;
-    private final IBaseNewStudentService newStudentService;
-
-    private final IBaseClassService classService;
-    private final BaseClassMajorSetMapper classMajorSetMapper;
-    private final CommonPropertiesConfig propertiesConfig;
-    private final IUserService userService;
-    private final IUserRoleRelationService roleRelationService;
-    private final IBaseStudentSchoolRollService schoolRollService;
-    private final IBaseStudentService studentService;
-    private final IBaseStudentFamilyService familyService;
-    private final BaseMajorSetMapper majorSetMapper;
-    private final RedisUtil redisUtil;
 
     private final IStudentReportPlanService reportPlanService;
     private final IBaseSemesterService semesterService;
-    private final IStudentReportRecordService reportRecordService;
+    private final StudentReportRecordMapper reportRecordMapper;
 
     @Override
     public Boolean add(BandingTaskClassStudent bandingTaskClass) {
@@ -146,7 +121,9 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
         }
 
         if(!insertList.isEmpty()){
-            reportRecordService.saveBatch(insertList);
+            for (StudentReportRecord studentReportRecord : insertList) {
+                reportRecordMapper.insert(studentReportRecord);
+            }
         }
 
 

+ 11 - 14
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java

@@ -59,12 +59,12 @@ import com.xjrsoft.module.student.entity.EnrollmentPlan;
 import com.xjrsoft.module.student.entity.StudentReportPlan;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
 import com.xjrsoft.module.student.mapper.BaseClassMajorSetMapper;
+import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
 import com.xjrsoft.module.student.service.IBaseNewStudentService;
 import com.xjrsoft.module.student.service.IBaseStudentFamilyService;
 import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
 import com.xjrsoft.module.student.service.IBaseStudentService;
 import com.xjrsoft.module.student.service.IStudentReportPlanService;
-import com.xjrsoft.module.student.service.IStudentReportRecordService;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -112,7 +112,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
     private final IBaseGradeService gradeService;
     private final BaseMajorSetMapper majorSetMapper;
     private final RedisUtil redisUtil;
-    private final IStudentReportRecordService reportRecordService;
+    private final StudentReportRecordMapper reportRecordMapper;
 
     private final IStudentReportPlanService reportPlanService;
     private final IBaseSemesterService semesterService;
@@ -778,20 +778,17 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
 
 
         //将新生数据初始化到报到表中
-        List<StudentReportRecord> insertList = new ArrayList<>();
         for (BaseNewStudent student : updateList) {
-            insertList.add(
-                    new StudentReportRecord(){{
-                        setCreateDate(new Date());
-                        setCreateUserId(StpUtil.getLoginIdAsLong());
-                        setUserId(student.getId());
-                        setBandingTaskId(dto.getBandingTaskId());
-                        setDeleteMark(DeleteMark.NODELETE.getCode());
-                        setEnabledMark(EnabledMark.ENABLED.getCode());
-                    }}
-            );
+            reportRecordMapper.insert(new StudentReportRecord(){{
+                setCreateDate(new Date());
+                setCreateUserId(StpUtil.getLoginIdAsLong());
+                setUserId(student.getId());
+                setBandingTaskId(dto.getBandingTaskId());
+                setDeleteMark(DeleteMark.NODELETE.getCode());
+                setEnabledMark(EnabledMark.ENABLED.getCode());
+            }});
         }
-        reportRecordService.saveBatch(insertList);
+
 
 
         bandingTask.setStatus(1);

+ 30 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentReportPlanController.java

@@ -5,6 +5,7 @@ import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.exception.MyException;
@@ -12,6 +13,8 @@ import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.TreeUtil;
+import com.xjrsoft.module.banding.entity.BandingTask;
+import com.xjrsoft.module.banding.service.IBandingTaskService;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.service.IBaseClassService;
@@ -64,10 +67,12 @@ public class StudentReportPlanController {
     private final IStudentReportPlanService studentReportPlanService;
     private final IBaseSemesterService semesterService;
     private final IBaseClassService classService;
+    private final IBandingTaskService taskService;
 
     @GetMapping(value = "/page")
     @ApiOperation(value="学生报到计划列表(分页)")
     @SaCheckPermission("studentreportplan:detail")
+    @XjrLog(value="学生报到计划列表(分页)")
     public RT<PageOutput<StudentReportPlanPageVo>> page(@Valid StudentReportPlanPageDto dto){
         Page<StudentReportPlanPageVo> page = studentReportPlanService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         PageOutput<StudentReportPlanPageVo> pageOutput = ConventPage.getPageOutput(page, StudentReportPlanPageVo.class);
@@ -77,6 +82,7 @@ public class StudentReportPlanController {
     @GetMapping(value = "/info")
     @ApiOperation(value="根据id查询学生报到计划信息")
     @SaCheckPermission("studentreportplan:detail")
+    @XjrLog(value="根据id查询学生报到计划信息")
     public RT<StudentReportPlanVo> info(@RequestParam Long id){
         StudentReportPlan studentReportPlan = studentReportPlanService.getByIdDeep(id);
         if (studentReportPlan == null) {
@@ -99,6 +105,7 @@ public class StudentReportPlanController {
     @PostMapping
     @ApiOperation(value = "新增学生报到计划")
     @SaCheckPermission("studentreportplan:add")
+    @XjrLog(value="新增学生报到计划")
     public RT<Boolean> add(@Valid @RequestBody AddStudentReportPlanDto dto){
         StudentReportPlan studentReportPlan = BeanUtil.toBean(dto, StudentReportPlan.class);
         boolean isSuccess = studentReportPlanService.add(studentReportPlan);
@@ -108,6 +115,7 @@ public class StudentReportPlanController {
     @PutMapping
     @ApiOperation(value = "修改学生报到计划")
     @SaCheckPermission("studentreportplan:edit")
+    @XjrLog(value="修改学生报到计划")
     public RT<Boolean> update(@Valid @RequestBody UpdateStudentReportPlanDto dto){
 
         StudentReportPlan studentReportPlan = BeanUtil.toBean(dto, StudentReportPlan.class);
@@ -118,6 +126,7 @@ public class StudentReportPlanController {
     @DeleteMapping
     @ApiOperation(value = "删除学生报到计划")
     @SaCheckPermission("studentreportplan:delete")
+    @XjrLog(value="删除学生报到计划")
     public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
         return RT.ok(studentReportPlanService.delete(ids));
 
@@ -126,6 +135,7 @@ public class StudentReportPlanController {
     @PostMapping(value = "/change-status")
     @ApiOperation(value="修改状态")
     @SaCheckPermission("classroom:detail")
+    @XjrLog(value="修改状态")
     public RT<Boolean> changeStatus(@Valid @RequestBody StudentReportPlanStatusDto dto) throws Exception {
         StudentReportPlan reportPlan = studentReportPlanService.getByIdDeep(dto.getId());
         if(reportPlan == null){
@@ -180,6 +190,7 @@ public class StudentReportPlanController {
     @GetMapping(value = "/tree")
     @ApiOperation(value="学期计划树")
     @SaCheckPermission("studentreportplan:detail")
+    @XjrLog(value="学期计划树")
     public RT<List<StudentReportPlanTreeVo>> tree(){
         List<Integer> statusList = new ArrayList<>();
         statusList.add(1);statusList.add(2);
@@ -224,4 +235,23 @@ public class StudentReportPlanController {
         List<StudentReportPlanTreeVo> treeVoList = TreeUtil.build(resultList);
         return RT.ok(treeVoList);
     }
+
+    @GetMapping(value = "/try-reading-plan")
+    @ApiOperation(value="根据分班任务id查询试读报到计划信息")
+    @SaCheckPermission("bandingrule:try-reading-plan")
+    @XjrLog(value="根据分班任务id查询试读报到计划信息")
+    public RT<StudentReportPlanVo> tryReadingPlan(@RequestParam Long bandingTaskId){
+        BandingTask bandingTask = taskService.getById(bandingTaskId);
+        BaseSemester semester = semesterService.getCurrentSemester();
+        StudentReportPlan plan = studentReportPlanService.getOne(
+                new QueryWrapper<StudentReportPlan>().lambda()
+                        .eq(StudentReportPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(StudentReportPlan::getSemesterId, semester.getId())
+                        .eq(StudentReportPlan::getName, bandingTask.getName())
+        );
+        if (plan == null) {
+            return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(plan, StudentReportPlanVo.class));
+    }
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentTryReadingReportController.java

@@ -11,12 +11,15 @@ import com.xjrsoft.common.enums.RoleCodeEnum;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.module.banding.entity.BandingRule;
 import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
+import com.xjrsoft.module.banding.vo.BandingRuleVo;
 import com.xjrsoft.module.student.dto.ChangeBandingStatusDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportSignDto;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
 import com.xjrsoft.module.student.service.IStudentReportRecordService;
+import com.xjrsoft.module.student.vo.StudentReportPlanVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordExcelVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
 import io.swagger.annotations.Api;
@@ -27,6 +30,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
@@ -150,4 +154,5 @@ public class StudentTryReadingReportController {
         return RT.fileStream(bot.toByteArray(), fileName);
     }
 
+
 }

+ 7 - 6
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportPlanServiceImpl.java

@@ -1,6 +1,5 @@
 package com.xjrsoft.module.student.service.impl;
 
-import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -8,7 +7,6 @@ import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
-import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.service.IUserService;
@@ -20,9 +18,9 @@ import com.xjrsoft.module.student.entity.StudentReportPlanClassRelation;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
 import com.xjrsoft.module.student.mapper.StudentReportPlanClassRelationMapper;
 import com.xjrsoft.module.student.mapper.StudentReportPlanMapper;
+import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
 import com.xjrsoft.module.student.service.IBaseStudentService;
 import com.xjrsoft.module.student.service.IStudentReportPlanService;
-import com.xjrsoft.module.student.service.IStudentReportRecordService;
 import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
 import com.xjrsoft.module.student.vo.StudentReportPlanPageVo;
 import lombok.AllArgsConstructor;
@@ -53,7 +51,7 @@ public class StudentReportPlanServiceImpl extends MPJBaseServiceImpl<StudentRepo
 
     private final IBaseStudentService studentService;
 
-    private final IStudentReportRecordService reportRecordService;
+    private final StudentReportRecordMapper reportRecordMapper;
 
     private final IUserService userService;
 
@@ -162,13 +160,16 @@ public class StudentReportPlanServiceImpl extends MPJBaseServiceImpl<StudentRepo
                 );
             }
 
-            long count = reportRecordService.count(
+            long count = reportRecordMapper.selectCount(
                     new QueryWrapper<StudentReportRecord>().lambda()
                             .eq(StudentReportRecord::getStudentReportPlanId, studentReportPlan.getId())
             );
 
             if(!insertList.isEmpty() && count == 0){
-                reportRecordService.saveBatch(insertList);
+                for (StudentReportRecord studentReportRecord : insertList) {
+                    reportRecordMapper.insert(studentReportRecord);
+                }
+
                 Set<String> studentUserIds = studentList.stream().map(BaseStudentUserPageVo::getId).collect(Collectors.toSet());
                 //发布后,将学生的状态改为不正常
                 List<BaseStudent> baseStudents = studentService.list(