dzx hace 9 meses
padre
commit
3ec4e213ce

+ 3 - 2
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java

@@ -766,7 +766,6 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                         .eq(StudentReportPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
                         .eq(StudentReportPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
                         .eq(StudentReportPlan::getSemesterId, semester.getId())
-                        .eq(StudentReportPlan::getBandingTaskId, dto.getBandingTaskId())
                         .eq(StudentReportPlan::getCategory, 2)
         );
         if(plan == null){
@@ -774,7 +773,9 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                 setName(bandingTask.getName());
                 setCategory(2);
                 setSemesterId(semester.getId());
-                setBandingTaskId(dto.getBandingTaskId());
+                setBandingTaskId(dto.getId());
+                setCreateDate(new Date());
+                setCreateUserId(StpUtil.getLoginIdAsLong());
             }};
 
             reportPlanService.save(plan);

+ 12 - 1
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.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
@@ -13,6 +14,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.common.utils.VoToColumnUtil;
+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;
@@ -242,7 +245,15 @@ public class StudentReportPlanController {
     @SaCheckPermission("bandingrule:try-reading-plan")
     @XjrLog(value="根据分班任务id查询试读报到计划信息")
     public RT<StudentReportPlanVo> tryReadingPlan(@RequestParam Long id){
-        EnrollmentPlan plan = enrollmentPlanService.getById(id);
+        EnrollmentPlan enrollmentPlan = enrollmentPlanService.getById(id);
+        StudentReportPlan plan = studentReportPlanService.getOne(
+                new MPJLambdaWrapper<StudentReportPlan>()
+                        .select(StudentReportPlan::getId)
+                        .select(StudentReportPlan.class, x -> VoToColumnUtil.fieldsToColumns(StudentReportPlan.class).contains(x.getProperty()))
+                        .innerJoin(BandingTask.class, BandingTask::getId, StudentReportPlan::getBandingTaskId)
+                        .eq(BandingTask::getEnrollType, enrollmentPlan.getEnrollType())
+                        .eq(BandingTask::getGradeId, enrollmentPlan.getGradeId())
+        );
         if (plan == null) {
             return RT.error("找不到此数据!");
         }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportPlanServiceImpl.java

@@ -74,6 +74,9 @@ public class StudentReportPlanServiceImpl extends MPJBaseServiceImpl<StudentRepo
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean update(StudentReportPlan studentReportPlan) {
+        if(studentReportPlan.getCategory() == 2){
+            studentReportPlan.setStatus(1);
+        }
         planMapper.updateById(studentReportPlan);
         //********************************* StudentReportPlanClassRelation  增删改  开始 *******************************************/
         {

+ 5 - 1
src/main/resources/mapper/student/StudentReportRecordMapper.xml

@@ -238,8 +238,9 @@
         LEFT JOIN banding_task t10 ON t5.banding_task_id = t10.id
         LEFT JOIN base_grade t4 ON t10.grade_id = t4.id
         LEFT JOIN enrollment_plan t11 ON t11.id = t3.enrollment_plan_id
+        LEFT JOIN student_report_plan t12 ON t12.id = t1.student_report_plan_id
         WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1
-        and t11.status = 1
+        and t12.status = 1
         and t3.enrollment_plan_id = #{dto.enrollmentPlanId}
         <if test="dto.keyword != null and dto.keyword != ''">
             and t1.name like concat('%', #{dto.keyword},'%')
@@ -297,7 +298,10 @@
         LEFT JOIN xjr_dictionary_detail t9 ON t3.stduy_status = t9.code
         LEFT JOIN banding_task t10 ON t5.banding_task_id = t10.id
         LEFT JOIN base_grade t4 ON t10.grade_id = t4.id
+        LEFT JOIN enrollment_plan t11 ON t11.id = t3.enrollment_plan_id
+        LEFT JOIN student_report_plan t12 ON t12.id = t1.student_report_plan_id
         WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1
+        and t12.status = 1
         and t3.enrollment_plan_id = #{dto.enrollmentPlanId}
         <if test="dto.keyword != null and dto.keyword != ''">
             and t1.name like concat('%', #{dto.keyword},'%')