Forráskód Böngészése

Merge remote-tracking branch 'origin/dev' into dev

大数据与最优化研究所 3 hónapja
szülő
commit
ea088cdeb9
76 módosított fájl, 2377 hozzáadás és 57 törlés
  1. 2 1
      src/main/java/com/xjrsoft/module/activity/controller/ActivityEnrollController.java
  2. 12 1
      src/main/java/com/xjrsoft/module/activity/controller/ActivityInfoController.java
  3. 5 0
      src/main/java/com/xjrsoft/module/activity/dto/ActivityInfoPageDto.java
  4. 5 0
      src/main/java/com/xjrsoft/module/activity/mapper/ActivityEnrollRangeMapper.java
  5. 19 0
      src/main/java/com/xjrsoft/module/activity/service/IActivityEnrollRangeService.java
  6. 26 0
      src/main/java/com/xjrsoft/module/activity/service/impl/ActivityEnrollRangeServiceImpl.java
  7. 3 0
      src/main/java/com/xjrsoft/module/activity/vo/ActivityInfoPageVo.java
  8. 2 4
      src/main/java/com/xjrsoft/module/banding/controller/BandingTaskClassController.java
  9. 25 1
      src/main/java/com/xjrsoft/module/banding/controller/BandingTaskMajorConditionController.java
  10. 6 1
      src/main/java/com/xjrsoft/module/banding/dto/BandingTaskClassPageDto.java
  11. 7 1
      src/main/java/com/xjrsoft/module/banding/dto/BandingTaskMajorConditionListDto.java
  12. 0 1
      src/main/java/com/xjrsoft/module/banding/dto/ChangeClassDto.java
  13. 18 4
      src/main/java/com/xjrsoft/module/banding/dto/StudentDto.java
  14. 3 3
      src/main/java/com/xjrsoft/module/banding/mapper/BandingTaskClassStudentMapper.java
  15. 5 0
      src/main/java/com/xjrsoft/module/banding/mapper/BandingTaskMajorConditionMapper.java
  16. 3 2
      src/main/java/com/xjrsoft/module/banding/service/IBandingTaskClassStudentService.java
  17. 4 1
      src/main/java/com/xjrsoft/module/banding/service/IBandingTaskMajorConditionService.java
  18. 0 1
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassServiceImpl.java
  19. 10 5
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java
  20. 7 0
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskMajorConditionServiceImpl.java
  21. 1 1
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java
  22. 0 2
      src/main/java/com/xjrsoft/module/banding/vo/BandingTaskClassSureListVo.java
  23. 0 3
      src/main/java/com/xjrsoft/module/banding/vo/BandingTaskPageVo.java
  24. 258 0
      src/main/java/com/xjrsoft/module/courseTable/controller/SecondCourseController.java
  25. 75 0
      src/main/java/com/xjrsoft/module/courseTable/dto/AddSecondCourseDto.java
  26. 37 0
      src/main/java/com/xjrsoft/module/courseTable/dto/AddSecondCourseEnrollDto.java
  27. 42 0
      src/main/java/com/xjrsoft/module/courseTable/dto/AddSecondCourseEnrollRangeDto.java
  28. 50 0
      src/main/java/com/xjrsoft/module/courseTable/dto/AddSecondCourseTimeDto.java
  29. 25 0
      src/main/java/com/xjrsoft/module/courseTable/dto/SecondCourseEnrollPageDto.java
  30. 31 0
      src/main/java/com/xjrsoft/module/courseTable/dto/SecondCoursePageDto.java
  31. 24 0
      src/main/java/com/xjrsoft/module/courseTable/dto/UpdateSecondCourseDto.java
  32. 26 0
      src/main/java/com/xjrsoft/module/courseTable/dto/UserEnrollDto.java
  33. 137 0
      src/main/java/com/xjrsoft/module/courseTable/entity/SecondCourse.java
  34. 89 0
      src/main/java/com/xjrsoft/module/courseTable/entity/SecondCourseEnroll.java
  35. 94 0
      src/main/java/com/xjrsoft/module/courseTable/entity/SecondCourseEnrollRange.java
  36. 100 0
      src/main/java/com/xjrsoft/module/courseTable/entity/SecondCourseTime.java
  37. 16 0
      src/main/java/com/xjrsoft/module/courseTable/mapper/SecondCourseEnrollMapper.java
  38. 16 0
      src/main/java/com/xjrsoft/module/courseTable/mapper/SecondCourseEnrollRangeMapper.java
  39. 32 0
      src/main/java/com/xjrsoft/module/courseTable/mapper/SecondCourseMapper.java
  40. 16 0
      src/main/java/com/xjrsoft/module/courseTable/mapper/SecondCourseTimeMapper.java
  41. 54 0
      src/main/java/com/xjrsoft/module/courseTable/service/ISecondCourseService.java
  42. 205 0
      src/main/java/com/xjrsoft/module/courseTable/service/impl/SecondCourseServiceImpl.java
  43. 43 0
      src/main/java/com/xjrsoft/module/courseTable/vo/SecondCourseEnrollExcelVo.java
  44. 43 0
      src/main/java/com/xjrsoft/module/courseTable/vo/SecondCourseEnrollRangeVo.java
  45. 54 0
      src/main/java/com/xjrsoft/module/courseTable/vo/SecondCourseEnrollVo.java
  46. 69 0
      src/main/java/com/xjrsoft/module/courseTable/vo/SecondCoursePageVo.java
  47. 51 0
      src/main/java/com/xjrsoft/module/courseTable/vo/SecondCourseTimeVo.java
  48. 87 0
      src/main/java/com/xjrsoft/module/courseTable/vo/SecondCourseVo.java
  49. 2 0
      src/main/java/com/xjrsoft/module/form/controller/FormExecuteController.java
  50. 11 2
      src/main/java/com/xjrsoft/module/form/service/impl/FormExecuteServiceImpl.java
  51. 128 0
      src/main/java/com/xjrsoft/module/job/ProcessTimeoutAlertTask.java
  52. 1 0
      src/main/java/com/xjrsoft/module/liteflow/node/ImportStudentFaceNode.java
  53. 2 0
      src/main/java/com/xjrsoft/module/liteflow/node/ImportTeacherFaceNode.java
  54. 4 1
      src/main/java/com/xjrsoft/module/personnel/mapper/StundentFaceProcessMapper.java
  55. 4 0
      src/main/java/com/xjrsoft/module/personnel/mapper/TeacherFaceProcessMapper.java
  56. 2 0
      src/main/java/com/xjrsoft/module/personnel/service/IStundentFaceProcessService.java
  57. 2 0
      src/main/java/com/xjrsoft/module/personnel/service/ITeacherFaceProcessService.java
  58. 5 0
      src/main/java/com/xjrsoft/module/personnel/service/impl/StundentFaceProcessServiceImpl.java
  59. 5 0
      src/main/java/com/xjrsoft/module/personnel/service/impl/TeacherFaceProcessServiceImpl.java
  60. 1 1
      src/main/java/com/xjrsoft/module/student/controller/BaseStudentScholarshipApplicantController.java
  61. 14 3
      src/main/java/com/xjrsoft/module/textbook/controller/TextbookController.java
  62. 1 1
      src/main/java/com/xjrsoft/module/textbook/dto/AddTextbookDto.java
  63. 44 0
      src/main/java/com/xjrsoft/module/workflow/entity/WorkflowAlertRecord.java
  64. 20 0
      src/main/java/com/xjrsoft/module/workflow/mapper/WorkflowAlertRecordMapper.java
  65. 17 0
      src/main/java/com/xjrsoft/module/workflow/service/IWorkflowAlertRecordService.java
  66. 20 0
      src/main/java/com/xjrsoft/module/workflow/service/impl/WorkflowAlertRecordServiceImpl.java
  67. 13 0
      src/main/resources/mapper/activity/ActivityEnrollRangeMapper.xml
  68. 7 1
      src/main/resources/mapper/activity/ActivityInfoMapper.xml
  69. 29 5
      src/main/resources/mapper/banding/BandingTaskClassMapper.xml
  70. 72 6
      src/main/resources/mapper/banding/BandingTaskClassStudentMapper.xml
  71. 15 1
      src/main/resources/mapper/banding/BandingTaskMajorConditionMapper.xml
  72. 60 0
      src/main/resources/mapper/courseTable/SecondCourseMapper.xml
  73. 3 3
      src/main/resources/mapper/organization/UserMapper.xml
  74. 2 1
      src/main/resources/mapper/textbook/TextbookMapper.xml
  75. 3 0
      src/main/resources/mapper/xycxedu/ExamSubjectScoreMappper.xml
  76. 53 0
      src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

+ 2 - 1
src/main/java/com/xjrsoft/module/activity/controller/ActivityEnrollController.java

@@ -21,7 +21,6 @@ import com.xjrsoft.module.activity.entity.ActivityEnroll;
 import com.xjrsoft.module.activity.service.IActivityEnrollService;
 import com.xjrsoft.module.activity.vo.ActivityEnrollExcelVo;
 import com.xjrsoft.module.activity.vo.ActivityEnrollPageVo;
-import com.xjrsoft.module.banding.vo.BandingTaskClassExcelVo;
 import com.xjrsoft.module.concat.service.IXjrUserService;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import io.swagger.annotations.Api;
@@ -40,6 +39,7 @@ import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -166,6 +166,7 @@ public class ActivityEnrollController {
         }
         ActivityEnroll activityEnroll = new ActivityEnroll() {{
             setUserId(StpUtil.getLoginIdAsLong());
+            setCreateDate(new Date());
             setActivityInfoId(dto.getActivityInfoId());
         }};
         boolean save = activityEnrollService.save(activityEnroll);

+ 12 - 1
src/main/java/com/xjrsoft/module/activity/controller/ActivityInfoController.java

@@ -20,11 +20,14 @@ import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.module.activity.dto.ActivityEnrollExportDto;
 import com.xjrsoft.module.activity.dto.ActivityEnrollPageDto;
 import com.xjrsoft.module.activity.dto.ActivityInfoPageDto;
+import com.xjrsoft.module.activity.dto.AddActivityEnrollRangeDto;
 import com.xjrsoft.module.activity.dto.AddActivityInfoDto;
 import com.xjrsoft.module.activity.dto.ChangeStatusDto;
 import com.xjrsoft.module.activity.dto.UpdateActivityInfoDto;
 import com.xjrsoft.module.activity.entity.ActivityEnroll;
+import com.xjrsoft.module.activity.entity.ActivityEnrollRange;
 import com.xjrsoft.module.activity.entity.ActivityInfo;
+import com.xjrsoft.module.activity.service.IActivityEnrollRangeService;
 import com.xjrsoft.module.activity.service.IActivityEnrollService;
 import com.xjrsoft.module.activity.service.IActivityInfoService;
 import com.xjrsoft.module.activity.vo.ActivityEnrollPageVo;
@@ -77,7 +80,7 @@ public class ActivityInfoController {
     private final IXjrUserService xjrUserService;
     private final IFileService fileService;
     private final IActivityEnrollService enrollService;
-
+    private final IActivityEnrollRangeService rangeService;
 
     @GetMapping(value = "/page")
     @ApiOperation(value="活动信息列表(分页)")
@@ -204,6 +207,14 @@ public class ActivityInfoController {
     @ApiOperation(value="移动端活动信息列表(分页)")
     @SaCheckPermission("activityinfo:detail")
     public RT<PageOutput<ActivityInfoPageVo>> mobilePage(@Valid ActivityInfoPageDto dto){
+        AddActivityEnrollRangeDto rangeDto = new AddActivityEnrollRangeDto();
+        if(dto.getLoginUserId() == null){
+            dto.setLoginUserId(StpUtil.getLoginIdAsLong());
+        }
+
+        rangeDto.setUserId(dto.getLoginUserId());
+        List<Long> activityInfoIds = rangeService.getActivityInfoIds(rangeDto);
+        dto.setActivityInfoIds(activityInfoIds);
         dto.setIsEffective(1);
         Page<ActivityInfoPageVo> page = activityInfoService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
 

+ 5 - 0
src/main/java/com/xjrsoft/module/activity/dto/ActivityInfoPageDto.java

@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.List;
+
 
 /**
 * @title: 活动信息分页查询入参
@@ -36,4 +38,7 @@ public class ActivityInfoPageDto extends PageInput {
 
     @ApiModelProperty("状态(0:未发布 1:报名中 2:报名结束 3:活动结束)")
     private Integer status;
+
+    @ApiModelProperty("活动ids")
+    private List<Long> activityInfoIds;
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/activity/mapper/ActivityEnrollRangeMapper.java

@@ -1,8 +1,12 @@
 package com.xjrsoft.module.activity.mapper;
 
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.activity.dto.AddActivityEnrollRangeDto;
 import com.xjrsoft.module.activity.entity.ActivityEnrollRange;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
 * @title: 活动报名范围
@@ -13,4 +17,5 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface ActivityEnrollRangeMapper extends MPJBaseMapper<ActivityEnrollRange> {
 
+    List<Long> getActivityInfoIds(@Param("dto") AddActivityEnrollRangeDto dto);
 }

+ 19 - 0
src/main/java/com/xjrsoft/module/activity/service/IActivityEnrollRangeService.java

@@ -0,0 +1,19 @@
+package com.xjrsoft.module.activity.service;
+
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.activity.dto.AddActivityEnrollRangeDto;
+import com.xjrsoft.module.activity.entity.ActivityEnrollRange;
+
+import java.util.List;
+
+/**
+* @title: 活动信息
+* @Author dzx
+* @Date: 2024-07-19
+* @Version 1.0
+*/
+
+public interface IActivityEnrollRangeService extends MPJBaseService<ActivityEnrollRange> {
+
+    List<Long> getActivityInfoIds(AddActivityEnrollRangeDto dto);
+}

+ 26 - 0
src/main/java/com/xjrsoft/module/activity/service/impl/ActivityEnrollRangeServiceImpl.java

@@ -0,0 +1,26 @@
+package com.xjrsoft.module.activity.service.impl;
+
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.activity.dto.AddActivityEnrollRangeDto;
+import com.xjrsoft.module.activity.entity.ActivityEnrollRange;
+import com.xjrsoft.module.activity.mapper.ActivityEnrollRangeMapper;
+import com.xjrsoft.module.activity.service.IActivityEnrollRangeService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+* @title: 活动信息
+* @Author dzx
+* @Date: 2024-07-19
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class ActivityEnrollRangeServiceImpl extends MPJBaseServiceImpl<ActivityEnrollRangeMapper, ActivityEnrollRange> implements IActivityEnrollRangeService {
+    @Override
+    public List<Long> getActivityInfoIds(AddActivityEnrollRangeDto dto) {
+        return this.baseMapper.getActivityInfoIds(dto);
+    }
+}

+ 3 - 0
src/main/java/com/xjrsoft/module/activity/vo/ActivityInfoPageVo.java

@@ -52,6 +52,9 @@ public class ActivityInfoPageVo {
     */
     @ApiModelProperty("组织部门(xjr_department)")
     private Long orgId;
+
+    @ApiModelProperty("组织部门名称")
+    private String orgCn;
     /**
     * 报名结束时间
     */

+ 2 - 4
src/main/java/com/xjrsoft/module/banding/controller/BandingTaskClassController.java

@@ -5,7 +5,6 @@ import cn.hutool.core.bean.BeanUtil;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.support.ExcelTypeEnum;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.utils.VoToColumnUtil;
@@ -28,7 +27,6 @@ import com.xjrsoft.module.banding.vo.BandingTaskClassPageVo;
 import com.xjrsoft.module.banding.vo.BandingTaskClassStudentListVo;
 import com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo;
 import com.xjrsoft.module.banding.vo.BandingTaskClassVo;
-import com.xjrsoft.module.room.entity.RoomBed;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -252,7 +250,7 @@ public class BandingTaskClassController {
     @ApiOperation(value = "满足学生")
     @SaCheckPermission("bandingTaskClass:satisfy-student")
     public RT<List<BaseNewStudentPageDto>> satisfyStudent(@Valid StudentDto dto){
-        List<BaseNewStudentPageDto> list = classStudentService.satisfyStudent(dto.getBandingTaskClassId());
+        List<BaseNewStudentPageDto> list = classStudentService.satisfyStudent(dto);
         return RT.ok(list);
     }
 
@@ -260,7 +258,7 @@ public class BandingTaskClassController {
     @ApiOperation(value = "剩余学生")
     @SaCheckPermission("bandingTaskClass:surplus-student")
     public RT<List<BaseNewStudentPageDto>> surplusStudent(@Valid StudentDto dto){
-        List<BaseNewStudentPageDto> list = classStudentService.surplusStudent(dto.getBandingTaskClassId());
+        List<BaseNewStudentPageDto> list = classStudentService.surplusStudent(dto);
         return RT.ok(list);
     }
 

+ 25 - 1
src/main/java/com/xjrsoft/module/banding/controller/BandingTaskMajorConditionController.java

@@ -2,10 +2,15 @@ package com.xjrsoft.module.banding.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.module.banding.dto.BandingTaskClassPageDto;
 import com.xjrsoft.module.banding.dto.BandingTaskMajorConditionListDto;
 import com.xjrsoft.module.banding.dto.SaveMajorConditionDto;
+import com.xjrsoft.module.banding.entity.BandingTask;
 import com.xjrsoft.module.banding.service.IBandingTaskMajorConditionService;
+import com.xjrsoft.module.banding.service.IBandingTaskService;
 import com.xjrsoft.module.banding.vo.BandingTaskMajorConditionListVo;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.service.IBaseNewStudentService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -16,7 +21,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
 * @title: 新生分班任务
@@ -32,11 +40,27 @@ public class BandingTaskMajorConditionController {
 
 
     private final IBandingTaskMajorConditionService conditionService;
-
+    private final IBandingTaskService taskService;
+    private final IBaseNewStudentService newStudentService;
     @GetMapping(value = "/list")
     @ApiOperation(value="专业限制条件列表")
     @SaCheckPermission("bandingtaskmajorcondition:detail")
     public RT<List<BandingTaskMajorConditionListVo>> page(@Valid BandingTaskMajorConditionListDto dto){
+        BandingTask bandingTask = taskService.getById(dto.getBandingTaskId());
+
+        BandingTaskClassPageDto dto2 = new BandingTaskClassPageDto(){{
+            setBandingTaskId(bandingTask.getId());
+            setEnrollType(bandingTask.getEnrollType());
+            setGradeId(bandingTask.getGradeId());
+        }};
+        List<BaseNewStudent> studentMajorId = conditionService.getStudentMajorId(dto2);
+        List<Long> majorIds = new ArrayList<>();
+        Set<Long> collect = studentMajorId.stream().filter(x -> x.getFirstAmbition() != null).map(BaseNewStudent::getFirstAmbition).collect(Collectors.toSet());
+        majorIds.addAll(collect.stream().collect(Collectors.toList()));
+
+        Set<Long> collect2 = studentMajorId.stream().filter(x -> x.getSecondAmbition() != null).map(BaseNewStudent::getSecondAmbition).collect(Collectors.toSet());
+        majorIds.addAll(collect2.stream().collect(Collectors.toList()));
+        dto.setMajorIds(majorIds);
         List<BandingTaskMajorConditionListVo> page = conditionService.getList(dto);
         return RT.ok(page);
     }

+ 6 - 1
src/main/java/com/xjrsoft/module/banding/dto/BandingTaskClassPageDto.java

@@ -1,6 +1,5 @@
 package com.xjrsoft.module.banding.dto;
 
-import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -24,4 +23,10 @@ public class BandingTaskClassPageDto{
 
     @ApiModelProperty("招生类型")
     private String enrollType;
+
+    @ApiModelProperty("班级名称")
+    private String name;
+
+    @ApiModelProperty("专业方向名称")
+    private String majorSetName;
 }

+ 7 - 1
src/main/java/com/xjrsoft/module/banding/dto/BandingTaskMajorConditionListDto.java

@@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.math.BigDecimal;
+import java.util.List;
 
 
 /**
@@ -20,4 +20,10 @@ public class BandingTaskMajorConditionListDto {
     @ApiModelProperty("任务id")
     private Long bandingTaskId;
 
+    @ApiModelProperty("专业id")
+    private List<Long> majorIds;
+
+    @ApiModelProperty("专业方向名称")
+    private String majorSetName;
+
 }

+ 0 - 1
src/main/java/com/xjrsoft/module/banding/dto/ChangeClassDto.java

@@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
-import java.math.BigDecimal;
 import java.util.List;
 
 

+ 18 - 4
src/main/java/com/xjrsoft/module/banding/dto/StudentDto.java

@@ -1,11 +1,9 @@
 package com.xjrsoft.module.banding.dto;
 
+import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.io.Serializable;
-import java.util.List;
-
 
 /**
 * @title: 调整班级
@@ -14,7 +12,7 @@ import java.util.List;
 * @Version 1.0
 */
 @Data
-public class StudentDto implements Serializable {
+public class StudentDto extends PageInput {
 
     private static final long serialVersionUID = 1L;
 
@@ -22,4 +20,20 @@ public class StudentDto implements Serializable {
     @ApiModelProperty("班级id")
     private Long bandingTaskClassId;
 
+    @ApiModelProperty("姓名")
+    private String name;
+
+    @ApiModelProperty("性别-字典")
+    private String gender;
+
+    @ApiModelProperty("身份证")
+    private String credentialNumber;
+
+    @ApiModelProperty("专业方向id")
+    private Long majorSetId;
+
+
+    @ApiModelProperty("任务id")
+    private Long bandingTaskId;
+
 }

+ 3 - 3
src/main/java/com/xjrsoft/module/banding/mapper/BandingTaskClassStudentMapper.java

@@ -1,7 +1,7 @@
 package com.xjrsoft.module.banding.mapper;
 
 import com.github.yulichang.base.MPJBaseMapper;
-import com.xjrsoft.module.banding.entity.BandingTaskClass;
+import com.xjrsoft.module.banding.dto.StudentDto;
 import com.xjrsoft.module.banding.entity.BandingTaskClassStudent;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import org.apache.ibatis.annotations.Mapper;
@@ -18,7 +18,7 @@ import java.util.List;
 @Mapper
 public interface BandingTaskClassStudentMapper extends MPJBaseMapper<BandingTaskClassStudent> {
 
-    List<BaseNewStudentPageDto> satisfyStudent(@Param("bandingTaskClassId") Long bandingTaskClassId);
+    List<BaseNewStudentPageDto> satisfyStudent(@Param("dto") StudentDto dto);
 
-    List<BaseNewStudentPageDto> surplusStudent(@Param("taskClass") BandingTaskClass taskClass);
+    List<BaseNewStudentPageDto> surplusStudent(@Param("dto") StudentDto dto);
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/banding/mapper/BandingTaskMajorConditionMapper.java

@@ -1,9 +1,11 @@
 package com.xjrsoft.module.banding.mapper;
 
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.banding.dto.BandingTaskClassPageDto;
 import com.xjrsoft.module.banding.dto.BandingTaskMajorConditionListDto;
 import com.xjrsoft.module.banding.entity.BandingTaskMajorCondition;
 import com.xjrsoft.module.banding.vo.BandingTaskMajorConditionListVo;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -19,4 +21,7 @@ import java.util.List;
 public interface BandingTaskMajorConditionMapper extends MPJBaseMapper<BandingTaskMajorCondition> {
 
     List<BandingTaskMajorConditionListVo> getList(@Param("dto") BandingTaskMajorConditionListDto dto);
+
+
+    List<BaseNewStudent> getStudentMajorId(@Param("dto") BandingTaskClassPageDto dto);
 }

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

@@ -2,6 +2,7 @@ package com.xjrsoft.module.banding.service;
 
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.banding.dto.ChangeClassDto;
+import com.xjrsoft.module.banding.dto.StudentDto;
 import com.xjrsoft.module.banding.entity.BandingTaskClassStudent;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 
@@ -45,9 +46,9 @@ public interface IBandingTaskClassStudentService extends MPJBaseService<BandingT
     Boolean removeStudent(ChangeClassDto dto);
 
 
-    List<BaseNewStudentPageDto> satisfyStudent(Long bandingTaskClassId);
+    List<BaseNewStudentPageDto> satisfyStudent(StudentDto dto);
 
-    List<BaseNewStudentPageDto> surplusStudent(Long bandingTaskClassId);
+    List<BaseNewStudentPageDto> surplusStudent(StudentDto dto);
 
 
     Boolean insertStudent(ChangeClassDto dto);

+ 4 - 1
src/main/java/com/xjrsoft/module/banding/service/IBandingTaskMajorConditionService.java

@@ -1,11 +1,12 @@
 package com.xjrsoft.module.banding.service;
 
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.banding.dto.BandingTaskClassPageDto;
 import com.xjrsoft.module.banding.dto.BandingTaskMajorConditionListDto;
 import com.xjrsoft.module.banding.dto.SaveMajorConditionDto;
 import com.xjrsoft.module.banding.entity.BandingTaskMajorCondition;
 import com.xjrsoft.module.banding.vo.BandingTaskMajorConditionListVo;
-import org.apache.ibatis.annotations.Param;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
 
 import java.util.List;
 
@@ -27,4 +28,6 @@ public interface IBandingTaskMajorConditionService extends MPJBaseService<Bandin
 
 
     List<BandingTaskMajorConditionListVo> getList(BandingTaskMajorConditionListDto dto);
+
+    List<BaseNewStudent> getStudentMajorId(BandingTaskClassPageDto dto);
 }

+ 0 - 1
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassServiceImpl.java

@@ -25,7 +25,6 @@ import com.xjrsoft.module.base.service.IBaseClassroomService;
 import com.xjrsoft.module.base.service.IBaseMajorSetService;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.service.IUserService;
-import com.xjrsoft.module.room.entity.RoomBed;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
 import com.xjrsoft.module.system.entity.DictionaryItem;
 import com.xjrsoft.module.system.mapper.DictionarydetailMapper;

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

@@ -12,6 +12,7 @@ import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.banding.dto.BandingTaskClassStudentPageDto;
 import com.xjrsoft.module.banding.dto.ChangeClassDto;
+import com.xjrsoft.module.banding.dto.StudentDto;
 import com.xjrsoft.module.banding.entity.BandingTask;
 import com.xjrsoft.module.banding.entity.BandingTaskClass;
 import com.xjrsoft.module.banding.entity.BandingTaskClassStudent;
@@ -289,14 +290,18 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
     }
 
     @Override
-    public List<BaseNewStudentPageDto> satisfyStudent(Long bandingTaskClassId) {
-        return this.baseMapper.satisfyStudent(bandingTaskClassId);
+    public List<BaseNewStudentPageDto> satisfyStudent(StudentDto dto) {
+        BandingTaskClass taskClass = taskClassMapper.selectById(dto.getBandingTaskClassId());
+        dto.setBandingTaskId(taskClass.getBandingTaskId());
+        return this.baseMapper.satisfyStudent(dto);
     }
 
     @Override
-    public List<BaseNewStudentPageDto> surplusStudent(Long bandingTaskClassId) {
-        BandingTaskClass taskClass = taskClassMapper.selectById(bandingTaskClassId);
-        return this.baseMapper.surplusStudent(taskClass);
+    public List<BaseNewStudentPageDto> surplusStudent(StudentDto dto) {
+        BandingTaskClass taskClass = taskClassMapper.selectById(dto.getBandingTaskClassId());
+        dto.setMajorSetId(taskClass.getMajorSetId());
+        dto.setBandingTaskId(taskClass.getBandingTaskId());
+        return this.baseMapper.surplusStudent(dto);
     }
 
     @Override

+ 7 - 0
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskMajorConditionServiceImpl.java

@@ -2,6 +2,7 @@ package com.xjrsoft.module.banding.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.banding.dto.BandingTaskClassPageDto;
 import com.xjrsoft.module.banding.dto.BandingTaskMajorConditionDto;
 import com.xjrsoft.module.banding.dto.BandingTaskMajorConditionListDto;
 import com.xjrsoft.module.banding.dto.SaveMajorConditionDto;
@@ -9,6 +10,7 @@ import com.xjrsoft.module.banding.entity.BandingTaskMajorCondition;
 import com.xjrsoft.module.banding.mapper.BandingTaskMajorConditionMapper;
 import com.xjrsoft.module.banding.service.IBandingTaskMajorConditionService;
 import com.xjrsoft.module.banding.vo.BandingTaskMajorConditionListVo;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
@@ -72,4 +74,9 @@ public class BandingTaskMajorConditionServiceImpl extends MPJBaseServiceImpl<Ban
     public List<BandingTaskMajorConditionListVo> getList(BandingTaskMajorConditionListDto dto) {
         return this.baseMapper.getList(dto);
     }
+
+    @Override
+    public List<BaseNewStudent> getStudentMajorId(BandingTaskClassPageDto dto) {
+        return this.baseMapper.getStudentMajorId(dto);
+    }
 }

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

@@ -33,6 +33,7 @@ import com.xjrsoft.module.banding.service.IBandingTaskMajorConditionService;
 import com.xjrsoft.module.banding.service.IBandingTaskService;
 import com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo;
 import com.xjrsoft.module.banding.vo.BandingTaskPageVo;
+import com.xjrsoft.module.banding.vo.IdManyCountVo;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseMajorSet;
 import com.xjrsoft.module.base.mapper.BaseMajorSetMapper;
@@ -42,7 +43,6 @@ import com.xjrsoft.module.organization.entity.UserRoleRelation;
 import com.xjrsoft.module.organization.service.IUserRoleRelationService;
 import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.outint.vo.IdCountVo;
-import com.xjrsoft.module.banding.vo.IdManyCountVo;
 import com.xjrsoft.module.student.entity.BaseClassMajorSet;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.entity.BaseStudent;

+ 0 - 2
src/main/java/com/xjrsoft/module/banding/vo/BandingTaskClassSureListVo.java

@@ -3,8 +3,6 @@ package com.xjrsoft.module.banding.vo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.math.BigDecimal;
-
 /**
 * @title: 新生分班任务分页列表出参
 * @Author dzx

+ 0 - 3
src/main/java/com/xjrsoft/module/banding/vo/BandingTaskPageVo.java

@@ -1,12 +1,9 @@
 package com.xjrsoft.module.banding.vo;
 
-import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.write.style.ContentStyle;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.util.Date;
-
 /**
 * @title: 新生分班任务分页列表出参
 * @Author dzx

+ 258 - 0
src/main/java/com/xjrsoft/module/courseTable/controller/SecondCourseController.java

@@ -0,0 +1,258 @@
+package com.xjrsoft.module.courseTable.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.support.ExcelTypeEnum;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
+import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.activity.dto.ChangeStatusDto;
+import com.xjrsoft.module.courseTable.dto.UserEnrollDto;
+import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.base.service.IBaseClassService;
+import com.xjrsoft.module.concat.service.IXjrUserService;
+import com.xjrsoft.module.courseTable.dto.AddSecondCourseDto;
+import com.xjrsoft.module.courseTable.dto.SecondCourseEnrollPageDto;
+import com.xjrsoft.module.courseTable.dto.SecondCoursePageDto;
+import com.xjrsoft.module.courseTable.dto.UpdateSecondCourseDto;
+import com.xjrsoft.module.courseTable.entity.SecondCourse;
+import com.xjrsoft.module.courseTable.service.ISecondCourseService;
+import com.xjrsoft.module.courseTable.vo.SecondCourseEnrollExcelVo;
+import com.xjrsoft.module.courseTable.vo.SecondCourseEnrollRangeVo;
+import com.xjrsoft.module.courseTable.vo.SecondCourseEnrollVo;
+import com.xjrsoft.module.courseTable.vo.SecondCoursePageVo;
+import com.xjrsoft.module.courseTable.vo.SecondCourseVo;
+import com.xjrsoft.module.organization.entity.Department;
+import com.xjrsoft.module.organization.service.IDepartmentService;
+import com.xjrsoft.module.system.entity.File;
+import com.xjrsoft.module.system.service.IFileService;
+import com.xjrsoft.module.teacher.entity.XjrUser;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+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;
+import java.io.ByteArrayOutputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+* @title: 第二课堂
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/courseTable" + "/secondCourse")
+@Api(value = "/courseTable"  + "/secondCourse",tags = "第二课堂代码")
+@AllArgsConstructor
+public class SecondCourseController {
+
+
+    private final ISecondCourseService secondCourseService;
+    private final IBaseClassService classService;
+    private final IDepartmentService departmentService;
+    private final IXjrUserService xjrUserService;
+    private final IFileService fileService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="第二课堂列表(分页)")
+    @SaCheckPermission("secondcourse:detail")
+    public RT<PageOutput<SecondCoursePageVo>> page(@Valid SecondCoursePageDto dto){
+        if(dto.getUserId() == null){
+            dto.setUserId(StpUtil.getLoginIdAsLong());
+        }
+        Page<SecondCoursePageVo> page = secondCourseService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        for (SecondCoursePageVo record : page.getRecords()) {
+            if(record.getEnrollStatus() > 0){
+                record.setEnrollStatus(1);
+            }
+            if(record.getCoverId() != null){
+                File file = fileService.getOne(
+                        new QueryWrapper<File>().lambda()
+                                .select(File::getId)
+                                .select(File.class, x -> VoToColumnUtil.fieldsToColumns(File.class).contains(x.getProperty()))
+                                .eq(File::getFolderId, record.getCoverId())
+                );
+                record.setCoverUrl(file.getFileUrl());
+            }
+        }
+        PageOutput<SecondCoursePageVo> pageOutput = ConventPage.getPageOutput(page, SecondCoursePageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询第二课堂信息")
+    @SaCheckPermission("secondcourse:detail")
+    public RT<SecondCourseVo> info(@RequestParam Long id){
+        SecondCourse secondCourse = secondCourseService.getByIdDeep(id);
+        if (secondCourse == null) {
+           return RT.error("找不到此数据!");
+        }
+        SecondCourseVo courseVo = BeanUtil.toBean(secondCourse, SecondCourseVo.class);
+        if(secondCourse.getEnrollRange() != null && !"".equals(secondCourse.getEnrollRange())){
+            JsonParser parser = new JsonParser();
+            JsonArray asJsonArray = parser.parse(secondCourse.getEnrollRange()).getAsJsonArray();
+            List<SecondCourseEnrollRangeVo> list = new ArrayList<>();
+            for (JsonElement jsonElement : asJsonArray) {
+                SecondCourseEnrollRangeVo relationDto = JSONUtil.toBean(jsonElement.getAsJsonObject().toString(), SecondCourseEnrollRangeVo.class);
+                if(relationDto.getUserId() != null){
+                    XjrUser xjrUser = xjrUserService.getById(relationDto.getUserId());
+                    if(xjrUser != null){
+                        relationDto.setName(xjrUser.getName());
+                    }
+                }else if(relationDto.getDeptId() != null){
+                    Department department = departmentService.getById(relationDto.getDeptId());
+                    if(department != null){
+                        relationDto.setName(department.getName());
+                    }
+
+                }else if(relationDto.getClassId() != null){
+                    BaseClass aClass = classService.getById(relationDto.getClassId());
+                    if(aClass != null){
+                        relationDto.setName(aClass.getName());
+                    }
+                }
+                list.add(relationDto);
+            }
+            courseVo.setSecondCourseEnrollRangeList(list);
+        }
+        if(secondCourse.getCoverId() != null){
+            File file = fileService.getOne(
+                    new QueryWrapper<File>().lambda()
+                            .select(File::getId)
+                            .select(File.class, x -> VoToColumnUtil.fieldsToColumns(File.class).contains(x.getProperty()))
+                            .eq(File::getFolderId, secondCourse.getCoverId())
+            );
+            courseVo.setCoverUrl(file.getFileUrl());
+        }
+
+        Integer enrollCount = secondCourseService.getEnrollCount(secondCourse.getId());
+        courseVo.setEnrollCount(enrollCount);
+        return RT.ok(courseVo);
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增第二课堂")
+    @SaCheckPermission("secondcourse:add")
+    public RT<Boolean> add(@Valid @RequestBody AddSecondCourseDto dto){
+        boolean isSuccess = secondCourseService.add(dto);
+        return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改第二课堂")
+    @SaCheckPermission("secondcourse:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateSecondCourseDto dto){
+
+        return RT.ok(secondCourseService.update(dto));
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除第二课堂")
+    @SaCheckPermission("secondcourse:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(secondCourseService.delete(ids));
+    }
+
+    @PostMapping(value = "/change-status")
+    @ApiOperation(value="修改状态")
+    @SaCheckPermission("officebuild:detail")
+    public RT<Boolean> changeStatus(@Valid @RequestBody ChangeStatusDto dto) throws Exception {
+        SecondCourse secondCourse = secondCourseService.getById(dto.getId());
+        if(secondCourse == null){
+            throw new MyException("未能找到数据");
+        }
+        secondCourse.setStatus(dto.getStatus());
+        secondCourseService.updateById(secondCourse);
+        return RT.ok(true);
+    }
+
+    @GetMapping(value = "/enroll-page")
+    @ApiOperation(value="报名表")
+    @SaCheckPermission("secondcourse:detail")
+    public RT<PageOutput<SecondCourseEnrollVo>> enrollPage(@Valid SecondCourseEnrollPageDto dto){
+        Page<SecondCourseEnrollVo> enrollPage = secondCourseService.getEnrollPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        for (SecondCourseEnrollVo record : enrollPage.getRecords()) {
+            if(record.getStudentId() != null){
+                record.setRoleId(3L);
+            }else if(record.getTeacherId() != null){
+                record.setRoleId(2L);
+            }
+        }
+
+        PageOutput<SecondCourseEnrollVo> pageOutput = ConventPage.getPageOutput(enrollPage, SecondCourseEnrollVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @PostMapping("/export-query")
+    @ApiOperation(value = "导出列表")
+    public ResponseEntity<byte[]> exportData(@Valid @RequestBody SecondCourseEnrollPageDto dto) {
+        List<SecondCourseEnrollVo> enrollList = secondCourseService.getEnrollList(dto);
+        List<SecondCourseEnrollExcelVo> list = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
+        for (SecondCourseEnrollVo listVo : enrollList) {
+            list.add(new SecondCourseEnrollExcelVo(){{
+                setName(listVo.getName());
+                setMobile(listVo.getMobile());
+                if(listVo.getTeacherId() != null){
+                    setRoleType("教师");
+                }
+                if(listVo.getStudentId() != null){
+                    setRoleType("学生");
+                }
+                setUserName(listVo.getUserName());
+                setCreateDate(sdf.format(listVo.getCreateDate()));
+            }});
+        }
+
+        ByteArrayOutputStream bot = new ByteArrayOutputStream();
+        EasyExcel.write(bot, SecondCourseEnrollExcelVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(list);
+
+        return RT.fileStream(bot.toByteArray(), "enroll" + ExcelTypeEnum.XLSX.getValue());
+    }
+
+
+    @PostMapping(value = "/enroll")
+    @ApiOperation(value="报名")
+    @SaCheckPermission("secondcourse:detail")
+    public RT<Boolean> enroll(@Valid UserEnrollDto dto){
+        Boolean enroll = secondCourseService.enroll(dto);
+        return RT.ok(enroll);
+    }
+
+    @GetMapping(value = "/my-enroll-page")
+    @ApiOperation(value="我的报名记录(分页)")
+    @SaCheckPermission("secondcourse:detail")
+    public RT<PageOutput<SecondCoursePageVo>> myEnrollList(@Valid SecondCoursePageDto dto){
+        if(dto.getUserId() == null){
+            dto.setUserId(StpUtil.getLoginIdAsLong());
+        }
+
+        Page<SecondCoursePageVo> page = secondCourseService.getMyPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<SecondCoursePageVo> pageOutput = ConventPage.getPageOutput(page, SecondCoursePageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+}

+ 75 - 0
src/main/java/com/xjrsoft/module/courseTable/dto/AddSecondCourseDto.java

@@ -0,0 +1,75 @@
+package com.xjrsoft.module.courseTable.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+
+/**
+* @title: 第二课堂
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+public class AddSecondCourseDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 学期id
+    */
+    @ApiModelProperty("学期id")
+    private Long baseSemesterId;
+    /**
+    * 课程名称
+    */
+    @ApiModelProperty("课程名称")
+    private String name;
+    /**
+    * 课程主要内容
+    */
+    @ApiModelProperty("课程主要内容")
+    private String content;
+    /**
+    * 开课地点
+    */
+    @ApiModelProperty("开课地点")
+    private String place;
+    /**
+    * 讲课老师
+    */
+    @ApiModelProperty("讲课老师")
+    private String teacherName;
+    /**
+    * 封面图片
+    */
+    @ApiModelProperty("封面图片")
+    private Long coverId;
+    /**
+    * 参与范围
+    */
+    @ApiModelProperty("参与范围")
+    private String enrollRange;
+    /**
+    * 状态(0:未发布 1:进行中 2:已结束)
+    */
+    @ApiModelProperty("状态(0:未发布 1:进行中 2:已结束)")
+    private Integer status;
+
+    /**
+    * secondCourseTime
+    */
+    @ApiModelProperty("secondCourseTime子表")
+    private List<AddSecondCourseTimeDto> secondCourseTimeList;
+    /**
+    * secondCourseEnrollRange
+    */
+    @ApiModelProperty("secondCourseEnrollRange子表")
+    private List<AddSecondCourseEnrollRangeDto> secondCourseEnrollRangeList;
+
+
+}

+ 37 - 0
src/main/java/com/xjrsoft/module/courseTable/dto/AddSecondCourseEnrollDto.java

@@ -0,0 +1,37 @@
+package com.xjrsoft.module.courseTable.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+
+/**
+* @title: 第二课堂报名表
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+public class AddSecondCourseEnrollDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 第二课堂id
+    */
+    @ApiModelProperty("第二课堂id")
+    private Long secondCourseId;
+    /**
+    * 用户id
+    */
+    @ApiModelProperty("用户id")
+    private Long userId;
+    /**
+    * 状态
+    */
+    @ApiModelProperty("状态")
+    private Long status;
+
+}

+ 42 - 0
src/main/java/com/xjrsoft/module/courseTable/dto/AddSecondCourseEnrollRangeDto.java

@@ -0,0 +1,42 @@
+package com.xjrsoft.module.courseTable.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+
+/**
+* @title: 第二课堂参与范围
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+public class AddSecondCourseEnrollRangeDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 第二课堂id
+    */
+    @ApiModelProperty("第二课堂id")
+    private Long secondCourseId;
+    /**
+    * 班级id
+    */
+    @ApiModelProperty("班级id")
+    private Long classId;
+    /**
+    * 部门id
+    */
+    @ApiModelProperty("部门id")
+    private Long deptId;
+    /**
+    * 用户id
+    */
+    @ApiModelProperty("用户id")
+    private Long userId;
+
+}

+ 50 - 0
src/main/java/com/xjrsoft/module/courseTable/dto/AddSecondCourseTimeDto.java

@@ -0,0 +1,50 @@
+package com.xjrsoft.module.courseTable.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+import java.time.LocalTime;
+import java.util.Date;
+
+
+
+/**
+* @title: 第二课堂开课时间
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+public class AddSecondCourseTimeDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 第二课堂id
+    */
+    @ApiModelProperty("第二课堂id")
+    private Long secondCourseId;
+    /**
+    * 上课日期
+    */
+    @ApiModelProperty("上课日期")
+    private String classTime;
+    /**
+    * 时段(1=上午 2=下午 3=晚上)
+    */
+    @ApiModelProperty("时段(1=上午 2=下午 3=晚上)")
+    private Integer timePeriod;
+    /**
+    * 开始时间
+    */
+    @ApiModelProperty("开始时间")
+    private LocalTime startTime;
+    /**
+    * 结束时间
+    */
+    @ApiModelProperty("结束时间")
+    private LocalTime endTime;
+
+}

+ 25 - 0
src/main/java/com/xjrsoft/module/courseTable/dto/SecondCourseEnrollPageDto.java

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.courseTable.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+/**
+* @title: 第二课堂分页查询入参
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class SecondCourseEnrollPageDto extends PageInput {
+
+        @ApiModelProperty("课程id")
+        private Long secondCourseId;
+
+        @ApiModelProperty("用户类型")
+        private Long roleId;
+
+}

+ 31 - 0
src/main/java/com/xjrsoft/module/courseTable/dto/SecondCoursePageDto.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.courseTable.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+/**
+* @title: 第二课堂分页查询入参
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class SecondCoursePageDto extends PageInput {
+
+        @ApiModelProperty("学期id")
+        private Long semesterId;
+
+        @ApiModelProperty("课程名称")
+        private String name;
+
+        @ApiModelProperty("状态")
+        private Integer status;
+
+        @ApiModelProperty("用户id")
+        private Long userId;
+
+}

+ 24 - 0
src/main/java/com/xjrsoft/module/courseTable/dto/UpdateSecondCourseDto.java

@@ -0,0 +1,24 @@
+package com.xjrsoft.module.courseTable.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+
+/**
+* @title: 第二课堂
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+public class UpdateSecondCourseDto extends AddSecondCourseDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+}

+ 26 - 0
src/main/java/com/xjrsoft/module/courseTable/dto/UserEnrollDto.java

@@ -0,0 +1,26 @@
+package com.xjrsoft.module.courseTable.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+* @title: 活动信息
+* @Author dzx
+* @Date: 2024-07-19
+* @Version 1.0
+*/
+@Data
+public class UserEnrollDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("课程id")
+    private Long id;
+    /**
+    */
+    @ApiModelProperty("手机号")
+    private String mobile;
+}

+ 137 - 0
src/main/java/com/xjrsoft/module/courseTable/entity/SecondCourse.java

@@ -0,0 +1,137 @@
+package com.xjrsoft.module.courseTable.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.github.yulichang.annotation.EntityMapping;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+* @title: 第二课堂
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+@TableName("second_course")
+@ApiModel(value = "second_course", description = "第二课堂")
+public class SecondCourse implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+    * 修改日期
+    */
+    @ApiModelProperty("修改日期")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 有效标记
+    */
+    @ApiModelProperty("有效标记")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+    * 学期id
+    */
+    @ApiModelProperty("学期id")
+    private Long baseSemesterId;
+    /**
+    * 课程名称
+    */
+    @ApiModelProperty("课程名称")
+    private String name;
+    /**
+    * 课程主要内容
+    */
+    @ApiModelProperty("课程主要内容")
+    private String content;
+    /**
+    * 开课地点
+    */
+    @ApiModelProperty("开课地点")
+    private String place;
+    /**
+    * 讲课老师
+    */
+    @ApiModelProperty("讲课老师")
+    private String teacherName;
+    /**
+    * 封面图片
+    */
+    @ApiModelProperty("封面图片")
+    private Long coverId;
+    /**
+    * 参与范围
+    */
+    @ApiModelProperty("参与范围")
+    private String enrollRange;
+    /**
+    * 状态(0:未发布 1:进行中 2:已结束)
+    */
+    @ApiModelProperty("状态(0:未发布 1:进行中 2:已结束)")
+    private Integer status;
+
+    /**
+    * secondCourseTime
+    */
+    @ApiModelProperty("secondCourseTime子表")
+    @TableField(exist = false)
+    @EntityMapping(thisField = "id", joinField = "secondCourseId")
+    private List<SecondCourseTime> secondCourseTimeList;
+    /**
+    * secondCourseEnrollRange
+    */
+    @ApiModelProperty("secondCourseEnrollRange子表")
+    @TableField(exist = false)
+    @EntityMapping(thisField = "id", joinField = "secondCourseId")
+    private List<SecondCourseEnrollRange> secondCourseEnrollRangeList;
+    /**
+    * secondCourseEnroll
+    */
+    @ApiModelProperty("secondCourseEnroll子表")
+    @TableField(exist = false)
+    @EntityMapping(thisField = "id", joinField = "secondCourseId")
+    private List<SecondCourseEnroll> secondCourseEnrollList;
+
+}

+ 89 - 0
src/main/java/com/xjrsoft/module/courseTable/entity/SecondCourseEnroll.java

@@ -0,0 +1,89 @@
+package com.xjrsoft.module.courseTable.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+* @title: 第二课堂报名表
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+@TableName("second_course_enroll")
+@ApiModel(value = "second_course_enroll", description = "第二课堂报名表")
+public class SecondCourseEnroll implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+    * 修改日期
+    */
+    @ApiModelProperty("修改日期")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 有效标记
+    */
+    @ApiModelProperty("有效标记")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+    * 第二课堂id
+    */
+    @ApiModelProperty("第二课堂id")
+    private Long secondCourseId;
+    /**
+    * 用户id
+    */
+    @ApiModelProperty("用户id")
+    private Long userId;
+    /**
+    * 状态
+    */
+    @ApiModelProperty("状态")
+    private Long status;
+
+
+}

+ 94 - 0
src/main/java/com/xjrsoft/module/courseTable/entity/SecondCourseEnrollRange.java

@@ -0,0 +1,94 @@
+package com.xjrsoft.module.courseTable.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+* @title: 第二课堂参与范围
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+@TableName("second_course_enroll_range")
+@ApiModel(value = "second_course_enroll_range", description = "第二课堂参与范围")
+public class SecondCourseEnrollRange implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+    * 修改日期
+    */
+    @ApiModelProperty("修改日期")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 有效标记
+    */
+    @ApiModelProperty("有效标记")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+    * 第二课堂id
+    */
+    @ApiModelProperty("第二课堂id")
+    private Long secondCourseId;
+    /**
+    * 班级id
+    */
+    @ApiModelProperty("班级id")
+    private Long classId;
+    /**
+    * 部门id
+    */
+    @ApiModelProperty("部门id")
+    private Long deptId;
+    /**
+    * 用户id
+    */
+    @ApiModelProperty("用户id")
+    private Long userId;
+
+
+}

+ 100 - 0
src/main/java/com/xjrsoft/module/courseTable/entity/SecondCourseTime.java

@@ -0,0 +1,100 @@
+package com.xjrsoft.module.courseTable.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalTime;
+import java.util.Date;
+
+
+/**
+* @title: 第二课堂开课时间
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+@TableName("second_course_time")
+@ApiModel(value = "second_course_time", description = "第二课堂开课时间")
+public class SecondCourseTime implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+    * 修改日期
+    */
+    @ApiModelProperty("修改日期")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 有效标记
+    */
+    @ApiModelProperty("有效标记")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+    * 第二课堂id
+    */
+    @ApiModelProperty("第二课堂id")
+    private Long secondCourseId;
+    /**
+    * 上课日期
+    */
+    @ApiModelProperty("上课日期")
+    private String classTime;
+    /**
+    * 时段(1=上午 2=下午 3=晚上)
+    */
+    @ApiModelProperty("时段(1=上午 2=下午 3=晚上)")
+    private Integer timePeriod;
+    /**
+    * 开始时间
+    */
+    @ApiModelProperty("开始时间")
+    private LocalTime startTime;
+    /**
+    * 结束时间
+    */
+    @ApiModelProperty("结束时间")
+    private LocalTime endTime;
+
+
+}

+ 16 - 0
src/main/java/com/xjrsoft/module/courseTable/mapper/SecondCourseEnrollMapper.java

@@ -0,0 +1,16 @@
+package com.xjrsoft.module.courseTable.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.courseTable.entity.SecondCourseEnroll;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 第二课堂报名表
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Mapper
+public interface SecondCourseEnrollMapper extends MPJBaseMapper<SecondCourseEnroll> {
+
+}

+ 16 - 0
src/main/java/com/xjrsoft/module/courseTable/mapper/SecondCourseEnrollRangeMapper.java

@@ -0,0 +1,16 @@
+package com.xjrsoft.module.courseTable.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.courseTable.entity.SecondCourseEnrollRange;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 第二课堂参与范围
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Mapper
+public interface SecondCourseEnrollRangeMapper extends MPJBaseMapper<SecondCourseEnrollRange> {
+
+}

+ 32 - 0
src/main/java/com/xjrsoft/module/courseTable/mapper/SecondCourseMapper.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.courseTable.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.courseTable.dto.SecondCourseEnrollPageDto;
+import com.xjrsoft.module.courseTable.dto.SecondCoursePageDto;
+import com.xjrsoft.module.courseTable.entity.SecondCourse;
+import com.xjrsoft.module.courseTable.vo.SecondCourseEnrollVo;
+import com.xjrsoft.module.courseTable.vo.SecondCoursePageVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+* @title: 第二课堂
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Mapper
+public interface SecondCourseMapper extends MPJBaseMapper<SecondCourse> {
+
+    Page<SecondCoursePageVo> getPage(Page<SecondCoursePageVo> page, @Param("dto") SecondCoursePageDto dto);
+
+    Page<SecondCourseEnrollVo> getEnrollPage(Page<SecondCourseEnrollVo> page, @Param("dto") SecondCourseEnrollPageDto dto);
+
+    List<SecondCourseEnrollVo> getEnrollList(@Param("dto") SecondCourseEnrollPageDto dto);
+
+
+    Page<SecondCoursePageVo> getMyPage(Page<SecondCoursePageVo> page, @Param("dto") SecondCoursePageDto dto);
+}

+ 16 - 0
src/main/java/com/xjrsoft/module/courseTable/mapper/SecondCourseTimeMapper.java

@@ -0,0 +1,16 @@
+package com.xjrsoft.module.courseTable.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.courseTable.entity.SecondCourseTime;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 第二课堂开课时间
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Mapper
+public interface SecondCourseTimeMapper extends MPJBaseMapper<SecondCourseTime> {
+
+}

+ 54 - 0
src/main/java/com/xjrsoft/module/courseTable/service/ISecondCourseService.java

@@ -0,0 +1,54 @@
+package com.xjrsoft.module.courseTable.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.courseTable.dto.UserEnrollDto;
+import com.xjrsoft.module.courseTable.dto.AddSecondCourseDto;
+import com.xjrsoft.module.courseTable.dto.SecondCourseEnrollPageDto;
+import com.xjrsoft.module.courseTable.dto.SecondCoursePageDto;
+import com.xjrsoft.module.courseTable.dto.UpdateSecondCourseDto;
+import com.xjrsoft.module.courseTable.entity.SecondCourse;
+import com.xjrsoft.module.courseTable.vo.SecondCourseEnrollVo;
+import com.xjrsoft.module.courseTable.vo.SecondCoursePageVo;
+
+import java.util.List;
+
+/**
+* @title: 第二课堂
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+
+public interface ISecondCourseService extends MPJBaseService<SecondCourse> {
+    /**
+    * 新增
+    */
+    Boolean add(AddSecondCourseDto dto);
+
+    /**
+    * 更新
+    */
+    Boolean update(UpdateSecondCourseDto dto);
+
+    /**
+    * 删除
+    *
+    * @param ids
+    * @return
+    */
+    Boolean delete(List<Long> ids);
+
+
+    Page<SecondCoursePageVo> getPage(Page<SecondCoursePageVo> page, SecondCoursePageDto dto);
+
+    Integer getEnrollCount(Long secondCourseId);
+
+    Page<SecondCourseEnrollVo> getEnrollPage(Page<SecondCourseEnrollVo> page, SecondCourseEnrollPageDto dto);
+
+    List<SecondCourseEnrollVo> getEnrollList( SecondCourseEnrollPageDto dto);
+
+    Boolean enroll(UserEnrollDto dto);
+
+    Page<SecondCoursePageVo> getMyPage(Page<SecondCoursePageVo> page, SecondCoursePageDto dto);
+}

+ 205 - 0
src/main/java/com/xjrsoft/module/courseTable/service/impl/SecondCourseServiceImpl.java

@@ -0,0 +1,205 @@
+package com.xjrsoft.module.courseTable.service.impl;
+
+import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.module.concat.service.IXjrUserService;
+import com.xjrsoft.module.courseTable.dto.UserEnrollDto;
+import com.xjrsoft.module.courseTable.dto.AddSecondCourseDto;
+import com.xjrsoft.module.courseTable.dto.SecondCourseEnrollPageDto;
+import com.xjrsoft.module.courseTable.dto.SecondCoursePageDto;
+import com.xjrsoft.module.courseTable.dto.UpdateSecondCourseDto;
+import com.xjrsoft.module.courseTable.entity.SecondCourse;
+import com.xjrsoft.module.courseTable.entity.SecondCourseEnroll;
+import com.xjrsoft.module.courseTable.entity.SecondCourseEnrollRange;
+import com.xjrsoft.module.courseTable.entity.SecondCourseTime;
+import com.xjrsoft.module.courseTable.mapper.SecondCourseEnrollMapper;
+import com.xjrsoft.module.courseTable.mapper.SecondCourseEnrollRangeMapper;
+import com.xjrsoft.module.courseTable.mapper.SecondCourseMapper;
+import com.xjrsoft.module.courseTable.mapper.SecondCourseTimeMapper;
+import com.xjrsoft.module.courseTable.service.ISecondCourseService;
+import com.xjrsoft.module.courseTable.vo.SecondCourseEnrollVo;
+import com.xjrsoft.module.courseTable.vo.SecondCoursePageVo;
+import com.xjrsoft.module.teacher.entity.XjrUser;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+* @title: 第二课堂
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class SecondCourseServiceImpl extends MPJBaseServiceImpl<SecondCourseMapper, SecondCourse> implements ISecondCourseService {
+    private final SecondCourseMapper courseMapper;
+
+    private final SecondCourseTimeMapper courseTimeMapper;
+    private final SecondCourseEnrollRangeMapper enrollRangeMapper;
+    private final SecondCourseEnrollMapper enrollMapper;
+    private final IXjrUserService xjrUserService;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean add(AddSecondCourseDto dto) {
+        SecondCourse secondCourse = BeanUtil.toBean(dto, SecondCourse.class);
+        secondCourse.setEnrollRange(JSONUtil.toJsonStr(dto.getSecondCourseEnrollRangeList()));
+        courseMapper.insert(secondCourse);
+        if(secondCourse.getSecondCourseEnrollList() != null){
+            for (SecondCourseTime secondCourseTime : secondCourse.getSecondCourseTimeList()) {
+                secondCourseTime.setSecondCourseId(secondCourse.getId());
+                courseTimeMapper.insert(secondCourseTime);
+            }
+        }
+        if(secondCourse.getSecondCourseEnrollRangeList() != null){
+            for (SecondCourseEnrollRange secondCourseEnrollRange : secondCourse.getSecondCourseEnrollRangeList()) {
+                secondCourseEnrollRange.setSecondCourseId(secondCourse.getId());
+                enrollRangeMapper.insert(secondCourseEnrollRange);
+            }
+        }
+
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean update(UpdateSecondCourseDto dto) {
+        SecondCourse secondCourse = BeanUtil.toBean(dto, SecondCourse.class);
+        secondCourse.setEnrollRange(JSONUtil.toJsonStr(dto.getSecondCourseEnrollRangeList()));
+        courseMapper.updateById(secondCourse);
+        //********************************* SecondCourseTime  增删改  开始 *******************************************/
+        {
+            // 查出所有子级的id
+            List<SecondCourseTime> secondCourseTimeList = courseTimeMapper.selectList(Wrappers.lambdaQuery(SecondCourseTime.class).eq(SecondCourseTime::getSecondCourseId, secondCourse.getId()).select(SecondCourseTime::getId));
+            List<Long> secondCourseTimeIds = secondCourseTimeList.stream().map(SecondCourseTime::getId).collect(Collectors.toList());
+            //原有子表单 没有被删除的主键
+            List<Long> secondCourseTimeOldIds = secondCourse.getSecondCourseTimeList().stream().map(SecondCourseTime::getId).filter(Objects::nonNull).collect(Collectors.toList());
+            //找到需要删除的id
+            List<Long> secondCourseTimeRemoveIds = secondCourseTimeIds.stream().filter(item -> !secondCourseTimeOldIds.contains(item)).collect(Collectors.toList());
+
+            for (SecondCourseTime secondCourseTime : secondCourse.getSecondCourseTimeList()) {
+                //如果不等于空则修改
+                if (secondCourseTime.getId() != null) {
+                    courseTimeMapper.updateById(secondCourseTime);
+                }
+                //如果等于空 则新增
+                else {
+                    //已经不存在的id 删除
+                    secondCourseTime.setSecondCourseId(secondCourse.getId());
+                    courseTimeMapper.insert(secondCourseTime);
+                }
+            }
+            //已经不存在的id 删除
+            if(!secondCourseTimeRemoveIds.isEmpty()){
+                courseTimeMapper.deleteBatchIds(secondCourseTimeRemoveIds);
+            }
+        }
+        //********************************* SecondCourseTime  增删改  结束 *******************************************/
+
+        //********************************* SecondCourseEnrollRange  增删改  开始 *******************************************/
+        {
+            // 查出所有子级的id
+            List<SecondCourseEnrollRange> secondCourseEnrollRangeList = enrollRangeMapper.selectList(Wrappers.lambdaQuery(SecondCourseEnrollRange.class).eq(SecondCourseEnrollRange::getSecondCourseId, secondCourse.getId()).select(SecondCourseEnrollRange::getId));
+            List<Long> secondCourseEnrollRangeIds = secondCourseEnrollRangeList.stream().map(SecondCourseEnrollRange::getId).collect(Collectors.toList());
+            //原有子表单 没有被删除的主键
+            List<Long> secondCourseEnrollRangeOldIds = secondCourse.getSecondCourseEnrollRangeList().stream().map(SecondCourseEnrollRange::getId).filter(Objects::nonNull).collect(Collectors.toList());
+            //找到需要删除的id
+            List<Long> secondCourseEnrollRangeRemoveIds = secondCourseEnrollRangeIds.stream().filter(item -> !secondCourseEnrollRangeOldIds.contains(item)).collect(Collectors.toList());
+
+            for (SecondCourseEnrollRange secondCourseEnrollRange : secondCourse.getSecondCourseEnrollRangeList()) {
+                //如果不等于空则修改
+                if (secondCourseEnrollRange.getId() != null) {
+                    enrollRangeMapper.updateById(secondCourseEnrollRange);
+                }
+                //如果等于空 则新增
+                else {
+                    //已经不存在的id 删除
+                    secondCourseEnrollRange.setSecondCourseId(secondCourse.getId());
+                    enrollRangeMapper.insert(secondCourseEnrollRange);
+                }
+            }
+            //已经不存在的id 删除
+            if(!secondCourseEnrollRangeRemoveIds.isEmpty()){
+                enrollRangeMapper.deleteBatchIds(secondCourseEnrollRangeRemoveIds);
+            }
+        }
+        //********************************* SecondCourseEnrollRange  增删改  结束 *******************************************/
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(List<Long> ids) {
+        courseMapper.deleteBatchIds(ids);
+        courseTimeMapper.delete(Wrappers.lambdaQuery(SecondCourseTime.class).in(SecondCourseTime::getSecondCourseId, ids));
+        enrollRangeMapper.delete(Wrappers.lambdaQuery(SecondCourseEnrollRange.class).in(SecondCourseEnrollRange::getSecondCourseId, ids));
+        enrollMapper.delete(Wrappers.lambdaQuery(SecondCourseEnroll.class).in(SecondCourseEnroll::getSecondCourseId, ids));
+
+        return true;
+    }
+
+    @Override
+    public Page<SecondCoursePageVo> getPage(Page<SecondCoursePageVo> page, SecondCoursePageDto dto) {
+        return this.baseMapper.getPage(page, dto);
+    }
+
+    @Override
+    public Integer getEnrollCount(Long secondCourseId) {
+        Long count = enrollMapper.selectCount(
+                new QueryWrapper<SecondCourseEnroll>().lambda()
+                        .eq(SecondCourseEnroll::getSecondCourseId, secondCourseId)
+        );
+        return count.intValue();
+    }
+
+    @Override
+    public Page<SecondCourseEnrollVo> getEnrollPage(Page<SecondCourseEnrollVo> page, SecondCourseEnrollPageDto dto) {
+        return this.baseMapper.getEnrollPage(page, dto);
+    }
+
+    @Override
+    public List<SecondCourseEnrollVo> getEnrollList(SecondCourseEnrollPageDto dto) {
+        return this.baseMapper.getEnrollList(dto);
+    }
+
+    @Override
+    public Boolean enroll(UserEnrollDto dto) {
+        List<SecondCourseEnroll> enrollList = enrollMapper.selectList(
+                new QueryWrapper<SecondCourseEnroll>().lambda()
+                        .eq(SecondCourseEnroll::getUserId, StpUtil.getLoginIdAsLong())
+                        .eq(SecondCourseEnroll::getSecondCourseId, dto.getId())
+        );
+        if(!enrollList.isEmpty()){
+            throw  new MyException("已报名,无需重复报名");
+        }
+        SecondCourseEnroll enroll = new SecondCourseEnroll() {{
+            setUserId(StpUtil.getLoginIdAsLong());
+            setSecondCourseId(dto.getId());
+        }};
+        enrollMapper.insert(enroll);
+
+        XjrUser xjrUser = xjrUserService.getById(StpUtil.getLoginIdAsLong());
+        if(StrUtil.isNotEmpty(dto.getMobile()) && !dto.getMobile().equals(xjrUser.getMobile())){
+            xjrUser.setMobile(dto.getMobile());
+            xjrUserService.updateById(xjrUser);
+        }
+        return true;
+    }
+
+    @Override
+    public Page<SecondCoursePageVo> getMyPage(Page<SecondCoursePageVo> page, SecondCoursePageDto dto) {
+        return this.baseMapper.getMyPage(page, dto);
+    }
+}

+ 43 - 0
src/main/java/com/xjrsoft/module/courseTable/vo/SecondCourseEnrollExcelVo.java

@@ -0,0 +1,43 @@
+package com.xjrsoft.module.courseTable.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+* @title: 第二课堂报名表表单出参
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+public class SecondCourseEnrollExcelVo {
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("用户类型")
+    @ApiModelProperty("用户类型")
+    private String roleType;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("姓名")
+    @ApiModelProperty("姓名")
+    private String name;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("用户名")
+    @ApiModelProperty("用户名")
+    private String userName;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("手机号")
+    @ApiModelProperty("手机号")
+    private String mobile;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("报名时间")
+    @ApiModelProperty("报名时间")
+    private String createDate;
+
+}

+ 43 - 0
src/main/java/com/xjrsoft/module/courseTable/vo/SecondCourseEnrollRangeVo.java

@@ -0,0 +1,43 @@
+package com.xjrsoft.module.courseTable.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 第二课堂参与范围表单出参
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+public class SecondCourseEnrollRangeVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+    /**
+    * 第二课堂id
+    */
+    @ApiModelProperty("第二课堂id")
+    private Long secondCourseId;
+    /**
+    * 班级id
+    */
+    @ApiModelProperty("班级id")
+    private Long classId;
+    /**
+    * 部门id
+    */
+    @ApiModelProperty("部门id")
+    private Long deptId;
+    /**
+    * 用户id
+    */
+    @ApiModelProperty("用户id")
+    private Long userId;
+
+    @ApiModelProperty("名称")
+    private String name;
+}

+ 54 - 0
src/main/java/com/xjrsoft/module/courseTable/vo/SecondCourseEnrollVo.java

@@ -0,0 +1,54 @@
+package com.xjrsoft.module.courseTable.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 第二课堂报名表表单出参
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+public class SecondCourseEnrollVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+
+
+    @ApiModelProperty("用户id")
+    private Long userId;
+    /**
+    * 状态
+    */
+    @ApiModelProperty("状态")
+    private Long status;
+
+    @ApiModelProperty("姓名")
+    private String name;
+
+    @ApiModelProperty("教师表id")
+    private Long teacherId;
+
+    @ApiModelProperty("学生表id")
+    private Long studentId;
+
+    @ApiModelProperty("用户名")
+    private String userName;
+
+    @ApiModelProperty("手机号")
+    private String mobile;
+
+    @ApiModelProperty("角色id")
+    private Long roleId;
+
+    @ApiModelProperty("报名时间")
+    private Date createDate;
+
+
+}

+ 69 - 0
src/main/java/com/xjrsoft/module/courseTable/vo/SecondCoursePageVo.java

@@ -0,0 +1,69 @@
+package com.xjrsoft.module.courseTable.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 第二课堂分页列表出参
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+public class SecondCoursePageVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private String id;
+
+    @ApiModelProperty("学期名称")
+    private String semesterName;
+    /**
+    * 课程名称
+    */
+    @ApiModelProperty("课程名称")
+    private String name;
+    /**
+    * 课程主要内容
+    */
+    @ApiModelProperty("课程主要内容")
+    private String content;
+    /**
+    * 开课地点
+    */
+    @ApiModelProperty("开课地点")
+    private String place;
+    /**
+    * 讲课老师
+    */
+    @ApiModelProperty("讲课老师")
+    private String teacherName;
+
+    /**
+    * 参与范围
+    */
+    @ApiModelProperty("参与范围")
+    private String enrollRange;
+    /**
+    * 状态(0:未发布 1:进行中 2:已结束)
+    */
+    @ApiModelProperty("状态(0:未发布 1:进行中 2:已结束)")
+    private Integer status;
+
+    @ApiModelProperty("报名人数")
+    private Integer enrollCount;
+
+    @ApiModelProperty("是否报名(0:否 1:是)")
+    private Integer enrollStatus;
+
+    @ApiModelProperty("封面id")
+    private Long coverId;
+
+    @ApiModelProperty("封面url")
+    private String coverUrl;
+
+}

+ 51 - 0
src/main/java/com/xjrsoft/module/courseTable/vo/SecondCourseTimeVo.java

@@ -0,0 +1,51 @@
+package com.xjrsoft.module.courseTable.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalTime;
+import java.util.Date;
+
+/**
+* @title: 第二课堂开课时间表单出参
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+public class SecondCourseTimeVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+    /**
+    * 第二课堂id
+    */
+    @ApiModelProperty("第二课堂id")
+    private Long secondCourseId;
+    /**
+    * 上课日期
+    */
+    @ApiModelProperty("上课日期")
+    private String classTime;
+    /**
+    * 时段(1=上午 2=下午 3=晚上)
+    */
+    @ApiModelProperty("时段(1=上午 2=下午 3=晚上)")
+    private Integer timePeriod;
+    /**
+    * 开始时间
+    */
+    @ApiModelProperty("开始时间")
+    private LocalTime startTime;
+    /**
+    * 结束时间
+    */
+    @ApiModelProperty("结束时间")
+    private LocalTime endTime;
+
+
+
+}

+ 87 - 0
src/main/java/com/xjrsoft/module/courseTable/vo/SecondCourseVo.java

@@ -0,0 +1,87 @@
+package com.xjrsoft.module.courseTable.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+* @title: 第二课堂表单出参
+* @Author dzx
+* @Date: 2024-07-29
+* @Version 1.0
+*/
+@Data
+public class SecondCourseVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+    /**
+    * 学期id
+    */
+    @ApiModelProperty("学期id")
+    private Long baseSemesterId;
+    /**
+    * 课程名称
+    */
+    @ApiModelProperty("课程名称")
+    private String name;
+    /**
+    * 课程主要内容
+    */
+    @ApiModelProperty("课程主要内容")
+    private String content;
+    /**
+    * 开课地点
+    */
+    @ApiModelProperty("开课地点")
+    private String place;
+    /**
+    * 讲课老师
+    */
+    @ApiModelProperty("讲课老师")
+    private String teacherName;
+    /**
+    * 封面图片
+    */
+    @ApiModelProperty("封面图片")
+    private Long coverId;
+    /**
+    * 参与范围
+    */
+    @ApiModelProperty("参与范围")
+    private String enrollRange;
+    /**
+    * 状态(0:未发布 1:进行中 2:已结束)
+    */
+    @ApiModelProperty("状态(0:未发布 1:进行中 2:已结束)")
+    private Integer status;
+
+
+    /**
+    * secondCourseTime
+    */
+    @ApiModelProperty("secondCourseTime子表")
+    private List<SecondCourseTimeVo> secondCourseTimeList;
+    /**
+    * secondCourseEnrollRange
+    */
+    @ApiModelProperty("secondCourseEnrollRange子表")
+    private List<SecondCourseEnrollRangeVo> secondCourseEnrollRangeList;
+    /**
+    * secondCourseEnroll
+    */
+    @ApiModelProperty("secondCourseEnroll子表")
+    private List<SecondCourseEnrollVo> secondCourseEnrollList;
+
+    @ApiModelProperty("封面图片地址")
+    private String coverUrl;
+
+
+    @ApiModelProperty("报名人数")
+    private Integer enrollCount;
+
+}

+ 2 - 0
src/main/java/com/xjrsoft/module/form/controller/FormExecuteController.java

@@ -276,6 +276,8 @@ public class FormExecuteController {
                             dateTime = ((Date) value).toLocalDate().atStartOfDay();
                         } else if (value instanceof Timestamp) {
                             dateTime = ((Timestamp)value).toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+                        }else if(value instanceof LocalDateTime){
+                            dateTime = (LocalDateTime)value;
                         }
                         value = LocalDateTimeUtil.format(dateTime, format);
                     } else if ((StrUtil.equalsIgnoreCase(ComponentTypeConstant.TIME, componentType)

+ 11 - 2
src/main/java/com/xjrsoft/module/form/service/impl/FormExecuteServiceImpl.java

@@ -776,7 +776,7 @@ public class FormExecuteServiceImpl implements IFormExecuteService {
                             //删除子表单数据
                             Entity childDeleteWhere = Entity.create(tableConfig.getTableName()).
                                     set(childTableConfig.get().getRelationField(), keyValues);
-                            Boolean result = SqlRunnerAdapter.db().dynamicDelete(tableName, childDeleteWhere);
+                            Boolean result = SqlRunnerAdapter.db().dynamicDelete(childTableConfig.get().getTableName(), childDeleteWhere);
                             if (!result) {
                                 throw new MyException("删除数据失败");
                             }
@@ -888,6 +888,11 @@ public class FormExecuteServiceImpl implements IFormExecuteService {
 
     @Transactional
     public Long insertFormData(Map<String, Object> formData, FormTemplate template) {
+        for (Map.Entry<String, Object> entry : formData.entrySet()) {
+            if (entry.getValue().toString().isEmpty()) {
+                entry.setValue(null);
+            }
+        }
         String formJson = template.getFormJson();
         //自定义表单配置
         FormDesignConfig formDesignConfig = JSONUtil.toBean(formJson, FormDesignConfig.class);
@@ -917,7 +922,6 @@ public class FormExecuteServiceImpl implements IFormExecuteService {
             List<String> autoCodeList = new ArrayList<>();
             // 处理字段值
             Map<String, Object> toSaveFormData = handleFormDataForSave(formData, formDesignConfig, tableName, autoCodeList);
-
             //formData 默认插入雪花Id主键
             if (pk.isPresent()) {
                 formData.put(pk.get().getName(), keyValue);
@@ -1007,6 +1011,11 @@ public class FormExecuteServiceImpl implements IFormExecuteService {
 
             // 处理字段值
             formData = handleFormDataForSave(formData, formDesignConfig, tableName, null);
+            for (Map.Entry<String, Object> entry : formData.entrySet()) {
+                if (entry.getValue().toString().isEmpty()) {
+                    entry.setValue(null);
+                }
+            }
 
             //此时的formData 已经是剔除了子表单数据了
             entity.putAll(formData);

+ 128 - 0
src/main/java/com/xjrsoft/module/job/ProcessTimeoutAlertTask.java

@@ -0,0 +1,128 @@
+package com.xjrsoft.module.job;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
+import com.xjrsoft.module.oa.utils.SendMessageUtil;
+import com.xjrsoft.module.workflow.entity.WorkflowAlertRecord;
+import com.xjrsoft.module.workflow.entity.WorkflowSchema;
+import com.xjrsoft.module.workflow.service.IWorkflowAlertRecordService;
+import com.xjrsoft.module.workflow.service.IWorkflowSchemaService;
+import lombok.extern.slf4j.Slf4j;
+import org.camunda.bpm.engine.HistoryService;
+import org.camunda.bpm.engine.history.HistoricProcessInstance;
+import org.camunda.bpm.engine.history.HistoricProcessInstanceQuery;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.time.Duration;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.stream.Collectors;
+
+/**
+ * 流程未处理提醒申请人
+ */
+@Component
+@Slf4j
+public class ProcessTimeoutAlertTask {
+
+    @Autowired
+    private HistoryService historyService;
+
+    @Autowired
+    private IWorkflowSchemaService schemaService;
+
+    @Autowired
+    private IWorkflowAlertRecordService alertRecordService;
+    @Scheduled(cron = "0 0 * * * ?")
+    public void execute() {
+        doExecute();
+    }
+
+    public void doExecute(){
+        LocalDateTime now = LocalDateTime.now();
+        try {
+            HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery().unfinished();
+
+            List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.list();
+
+            List<String> processIds = historicProcessInstances.stream().map(HistoricProcessInstance::getId).collect(Collectors.toList());
+
+            if(!processIds.isEmpty()){
+                //获取所有未完成流程的所有节点
+                String uncloseProcessIdStr = processIds.stream()
+                        .map(entity -> "'" + entity + "'")
+                        .collect(Collectors.joining(","));
+                String listWorkflowExtraSql = "select * " +
+                        "from xjr_workflow_extra "
+                        + "where process_id in (" + uncloseProcessIdStr + ") and end_time is null;";
+                List<Map<String, Object>> workflowExtraList = SqlRunnerAdapter.db().selectList(listWorkflowExtraSql);
+
+                JsonParser parser = new JsonParser();
+                DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                Map<String, StringBuilder> message = new HashMap<>();
+                List<WorkflowAlertRecord> recordList = new ArrayList<>();
+                for (Map<String, Object> el : workflowExtraList) {
+                    WorkflowSchema schema = schemaService.getById(el.get("schema_id").toString());
+                    JsonObject jsonContent = parser.parse(schema.getJsonContent()).getAsJsonObject();
+                    JsonObject timeoutRemidConfig = jsonContent.get("processConfig").getAsJsonObject().get("timeoutRemidConfig").getAsJsonObject();
+                    if(!timeoutRemidConfig.get("enabled").getAsBoolean()){
+                        continue;
+                    }
+                    String startUserId = el.get("start_user_id").toString();
+                    List<WorkflowAlertRecord> record = alertRecordService.list(
+                            new QueryWrapper<WorkflowAlertRecord>().lambda()
+                                    .eq(WorkflowAlertRecord::getUserId, Long.parseLong(startUserId))
+                                    .eq(WorkflowAlertRecord::getProcessId, Long.parseLong(el.get("process_id").toString()))
+                                    .eq(WorkflowAlertRecord::getType, 1)
+                                    .orderByDesc(WorkflowAlertRecord::getSendTime)
+                    );
+                    WorkflowAlertRecord alertRecord = record.get(0);
+                    Duration lastBetween = Duration.between(alertRecord.getSendTime(), now);
+                    long lasttime = Math.abs(lastBetween.getSeconds());
+
+                    LocalDateTime startTime = LocalDateTime.parse(el.get("start_time").toString(), formatter);
+                    Duration between = Duration.between(startTime, now);
+                    long abs = Math.abs(between.getSeconds());
+                    int hour = timeoutRemidConfig.get("hour").getAsInt() * 60 * 60;
+                    int interval = timeoutRemidConfig.get("interval").getAsInt() * 60 * 60;
+                    if(abs >= hour && lasttime >= interval){
+                        //对未结束的流程节点进行处理,通知下一个节点需要处理的人
+
+                        if(message.containsKey(startUserId)){
+                            message.get(startUserId).append(",").append(el.get("process_name").toString());
+                        }else {
+                            message.put(startUserId, new StringBuilder(el.get("process_name").toString()));
+                        }
+                        recordList.add(
+                                new WorkflowAlertRecord(){{
+                                    setProcessId(Long.parseLong(el.get("process_id").toString()));
+                                    setUserId(Long.parseLong(startUserId));
+                                    setProcessName(el.get("process_name").toString());
+                                    setType(1);
+                                    setSendTime(now);
+                                }}
+                        );
+                    }
+                }
+                if(!recordList.isEmpty()){
+                    alertRecordService.saveBatch(recordList);
+                }
+
+                CompletableFuture.runAsync(() -> {
+                    SendMessageUtil.sendWorkflowUnapprovedWx(message);
+                });
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), "定时提醒流程未处理");
+        }
+    }
+}

+ 1 - 0
src/main/java/com/xjrsoft/module/liteflow/node/ImportStudentFaceNode.java

@@ -41,6 +41,7 @@ public class ImportStudentFaceNode extends NodeComponent {
             String result = FaceImportUtil.ImportStudentFace(hikvisionDataMapper.getStudentHikvisionId(dataObj.getUserId()), fileUrl);
             dataObj.setHikvisionResult(result);
             stundentFaceProcessService.updateById(dataObj);
+            stundentFaceProcessService.clearHistory(dataObj);
         }
     }
 }

+ 2 - 0
src/main/java/com/xjrsoft/module/liteflow/node/ImportTeacherFaceNode.java

@@ -44,6 +44,8 @@ public class ImportTeacherFaceNode extends NodeComponent {
             String reslut = FaceImportUtil.ImportTeacherFace(hikvisionDataMapper.getTeacherHikvisionId(dataObj.getUserId()), fileUrl);
             dataObj.setHikvisionResult(reslut);
             teacherFaceProcessService.updateById(dataObj);
+
+            teacherFaceProcessService.clearHistory(dataObj);
         }
     }
 }

+ 4 - 1
src/main/java/com/xjrsoft/module/personnel/mapper/StundentFaceProcessMapper.java

@@ -3,6 +3,8 @@ package com.xjrsoft.module.personnel.mapper;
 import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Update;
 
 /**
 * @title: 学生人脸信息审核
@@ -12,5 +14,6 @@ import org.apache.ibatis.annotations.Mapper;
 */
 @Mapper
 public interface StundentFaceProcessMapper extends MPJBaseMapper<StundentFaceProcess> {
-
+    @Update("UPDATE stundent_face_process SET delete_mark = 1 WHERE delete_mark = 0 AND user_id = #{dto.userId} and id != #{dto.id}")
+    Boolean clearHistory(@Param("dto") StundentFaceProcess process);
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/personnel/mapper/TeacherFaceProcessMapper.java

@@ -3,6 +3,8 @@ package com.xjrsoft.module.personnel.mapper;
 import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.personnel.entity.TeacherFaceProcess;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Update;
 
 /**
 * @title: 人脸信息审核
@@ -13,4 +15,6 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface TeacherFaceProcessMapper extends MPJBaseMapper<TeacherFaceProcess> {
 
+    @Update("UPDATE teacher_face_process SET delete_mark = 1 WHERE delete_mark = 0 AND user_id = #{dto.userId} and id != #{dto.id}")
+    Boolean clearHistory(@Param("dto") TeacherFaceProcess process);
 }

+ 2 - 0
src/main/java/com/xjrsoft/module/personnel/service/IStundentFaceProcessService.java

@@ -19,4 +19,6 @@ public interface IStundentFaceProcessService extends MPJBaseService<StundentFace
     Boolean removeByIds(List<Long> ids);
 
     Boolean nsUploadFace(AddFaceManagementDto dto, MultipartFile file);
+
+    Boolean clearHistory(StundentFaceProcess process);
 }

+ 2 - 0
src/main/java/com/xjrsoft/module/personnel/service/ITeacherFaceProcessService.java

@@ -15,4 +15,6 @@ import java.util.List;
 public interface ITeacherFaceProcessService extends MPJBaseService<TeacherFaceProcess> {
 
     Boolean removeByIds(List<Long> ids);
+
+    Boolean clearHistory(TeacherFaceProcess process);
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/personnel/service/impl/StundentFaceProcessServiceImpl.java

@@ -147,4 +147,9 @@ public class StundentFaceProcessServiceImpl extends MPJBaseServiceImpl<StundentF
         this.save(studentFace);
         return true;
     }
+
+    @Override
+    public Boolean clearHistory(StundentFaceProcess process) {
+        return this.baseMapper.clearHistory(process);
+    }
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/personnel/service/impl/TeacherFaceProcessServiceImpl.java

@@ -90,4 +90,9 @@ public class TeacherFaceProcessServiceImpl extends MPJBaseServiceImpl<TeacherFac
         }
         return true;
     }
+
+    @Override
+    public Boolean clearHistory(TeacherFaceProcess process) {
+        return this.baseMapper.clearHistory(process);
+    }
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/student/controller/BaseStudentScholarshipApplicantController.java

@@ -139,7 +139,7 @@ public class BaseStudentScholarshipApplicantController {
             .eq(ObjectUtil.isNotNull(dto.getBaseStudentScholarshipCategoryId()),BaseStudentScholarshipApplicant::getBaseStudentScholarshipCategoryId, dto.getBaseStudentScholarshipCategoryId())
             .eq(ObjectUtil.isNotNull(dto.getSemesterId()), BaseStudentScholarshipApplicant::getBaseSemesterId, dto.getSemesterId())
             .eq(BaseStudentScholarshipApplicant::getStatus, 1)
-            .eq(BaseStudentScholarshipApplicant::getReviewStatus, 0)
+            .ne(BaseStudentScholarshipApplicant::getReviewStatus, 1)
         );
         List<ScholarshipApplicantOptionVo> voList = BeanUtil.copyToList(applicantList, ScholarshipApplicantOptionVo.class);
         return RT.ok(voList);

+ 14 - 3
src/main/java/com/xjrsoft/module/textbook/controller/TextbookController.java

@@ -37,8 +37,14 @@ import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.text.ParseException;
+import java.text.ParsePosition;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.ZoneId;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -239,8 +245,11 @@ public class TextbookController {
     @PostMapping
     @ApiOperation(value = "新增教材管理")
     @SaCheckPermission("textbook:add")
-    public RT<Boolean> add(@Valid @RequestBody AddTextbookDto dto){
+    public RT<Boolean> add(@Valid @RequestBody AddTextbookDto dto) throws ParseException {
+        String publishingDateStr = dto.getPublishingDate();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Textbook textbook = BeanUtil.toBean(dto, Textbook.class);
+        textbook.setPublishingDate(sdf.parse(publishingDateStr));
         boolean isSuccess = textbookService.add(textbook);
         return RT.ok(isSuccess);
     }
@@ -248,9 +257,11 @@ public class TextbookController {
     @PutMapping
     @ApiOperation(value = "修改教材管理")
     @SaCheckPermission("textbook:edit")
-    public RT<Boolean> update(@Valid @RequestBody UpdateTextbookDto dto){
-
+    public RT<Boolean> update(@Valid @RequestBody UpdateTextbookDto dto) throws ParseException {
+        String publishingDateStr = dto.getPublishingDate();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Textbook textbook = BeanUtil.toBean(dto, Textbook.class);
+        textbook.setPublishingDate(sdf.parse(publishingDateStr ));
         return RT.ok(textbookService.update(textbook));
 
     }

+ 1 - 1
src/main/java/com/xjrsoft/module/textbook/dto/AddTextbookDto.java

@@ -141,7 +141,7 @@ public class AddTextbookDto implements Serializable {
 
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty("出版日期")
-    private LocalDate publishingDate;
+    private String publishingDate;
 
     @ApiModelProperty("分类号")
     private String category;

+ 44 - 0
src/main/java/com/xjrsoft/module/workflow/entity/WorkflowAlertRecord.java

@@ -0,0 +1,44 @@
+package com.xjrsoft.module.workflow.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ *  流程提醒记录表
+ * </p>
+ *
+ * @author tzx
+ * @since 2022-10-11
+ */
+@TableName("xjr_workflow_alert_record")
+@ApiModel(value = "WorkflowAlertRecord对象", description = "")
+@Data
+public class WorkflowAlertRecord implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("id")
+    private Long id;
+
+    @ApiModelProperty("提醒时间")
+    private LocalDateTime sendTime;
+
+    @ApiModelProperty("被提醒人id")
+    private Long userId;
+
+    @ApiModelProperty("流程名称")
+    private String processName;
+
+    @ApiModelProperty("进程id")
+    private Long processId;
+
+    @ApiModelProperty("提醒类别(1:超时提醒...)")
+    private Integer type;
+
+}

+ 20 - 0
src/main/java/com/xjrsoft/module/workflow/mapper/WorkflowAlertRecordMapper.java

@@ -0,0 +1,20 @@
+package com.xjrsoft.module.workflow.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.workflow.entity.WorkflowAlertRecord;
+import com.xjrsoft.module.workflow.entity.WorkflowExtra;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author tzx
+ * @since 2022-10-11
+ */
+@Mapper
+public interface WorkflowAlertRecordMapper extends MPJBaseMapper<WorkflowAlertRecord> {
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/workflow/service/IWorkflowAlertRecordService.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.workflow.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xjrsoft.module.workflow.entity.WorkflowAlertRecord;
+import com.xjrsoft.module.workflow.entity.WorkflowExtra;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author tzx
+ * @since 2022-10-11
+ */
+public interface IWorkflowAlertRecordService extends IService<WorkflowAlertRecord> {
+
+}

+ 20 - 0
src/main/java/com/xjrsoft/module/workflow/service/impl/WorkflowAlertRecordServiceImpl.java

@@ -0,0 +1,20 @@
+package com.xjrsoft.module.workflow.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xjrsoft.module.workflow.entity.WorkflowAlertRecord;
+import com.xjrsoft.module.workflow.mapper.WorkflowAlertRecordMapper;
+import com.xjrsoft.module.workflow.service.IWorkflowAlertRecordService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author tzx
+ * @since 2022-10-11
+ */
+@Service
+public class WorkflowAlertRecordServiceImpl extends ServiceImpl<WorkflowAlertRecordMapper, WorkflowAlertRecord> implements IWorkflowAlertRecordService {
+
+}

+ 13 - 0
src/main/resources/mapper/activity/ActivityEnrollRangeMapper.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xjrsoft.module.activity.mapper.ActivityEnrollRangeMapper">
+    <select id="getActivityInfoIds" parameterType="com.xjrsoft.module.activity.dto.AddActivityEnrollRangeDto" resultType="java.lang.Long">
+        SELECT activity_info_id FROM activity_enroll_range WHERE delete_mark = 0 AND (
+                user_id = #{dto.userId}
+                OR class_id IN (SELECT class_id FROM base_student_school_roll WHERE delete_mark = 0 AND user_id = #{dto.userId})
+                OR dept_id IN (SELECT dept_id FROM xjr_user_dept_relation WHERE user_id = #{dto.userId})
+        ) AND activity_info_id IS NOT NULL
+    </select>
+</mapper>

+ 7 - 1
src/main/resources/mapper/activity/ActivityInfoMapper.xml

@@ -6,7 +6,7 @@
     <select id="getPage" parameterType="com.xjrsoft.module.activity.dto.ActivityInfoPageDto" resultType="com.xjrsoft.module.activity.vo.ActivityInfoPageVo">
         SELECT t1.id,t2.name AS type_cn,t3.company_name AS enterprise_name,t1.name,t1.place,t1.start_date,t1.end_date,
         t1.type, t4.name AS org_name, t1.enroll_end_time, t1.duty_person,t1.duty_person_mobile, t1.cover_file_id,
-        t1.enroll_range, t1.status,t1.content,t1.category,t4.name as org_name,t1.org_id,
+        t1.enroll_range, t1.status,t1.content,t1.category,t4.name as org_cn,t1.org_id,
         (SELECT COUNT(*) FROM activity_enroll WHERE delete_mark = 0 AND activity_info_id = t1.id) as enroll_count FROM activity_info t1
         LEFT JOIN xjr_dictionary_detail t2 ON t1.type = t2.code
         LEFT JOIN company_coop t3 ON t1.enterprise_id = t3.id
@@ -30,6 +30,12 @@
         <if test="dto.status != null ">
             and t1.status = #{dto.status}
         </if>
+        <if test="dto.activityInfoIds != null and dto.activityInfoIds.size() > 0">
+            and t1.id in
+            <foreach item="id" index="index" collection="dto.activityInfoIds" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        </if>
     </select>
     <select id="getMyPage" parameterType="com.xjrsoft.module.activity.dto.ActivityInfoPageDto" resultType="com.xjrsoft.module.activity.vo.ActivityInfoPageVo">
         SELECT t1.id,t2.name AS type_cn,t3.company_name AS enterprise_name,t1.name,t1.place,t1.start_date,t1.end_date,

+ 29 - 5
src/main/resources/mapper/banding/BandingTaskClassMapper.xml

@@ -34,6 +34,13 @@
         LEFT JOIN banding_task_major_condition t5 ON t1.major_set_id = t5.major_set_id AND t5.delete_mark = 0
         AND t5.banding_task_id = #{dto.bandingTaskId}
         WHERE t1.delete_mark = 0 and t1.banding_task_id = #{dto.bandingTaskId}
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name},'%')
+        </if>
+        <if test="dto.majorSetName != null and dto.majorSetName != ''">
+            and t2.name like concat('%', #{dto.majorSetName},'%')
+        </if>
+        ORDER BY t1.sort_code IS NULL, t1.sort_code ASC
     </select>
 
     <select id="getClassSure" parameterType="com.xjrsoft.module.banding.dto.BandingTaskClassPageDto" resultType="com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo">
@@ -107,14 +114,31 @@
         <if test="dto.className != null and dto.className != ''">
             AND t3.name like concat('%', #{dto.className}, '%')
         </if>
-        <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
-            <if test="dto.order == 'descend'">
-                order by t1.score desc
-            </if>
+        <if test="dto.order != null">
             <if test="dto.order == 'ascend'">
-                order by t1.score asc
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height asc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight asc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score asc
+                </if>
+            </if>
+            <if test="dto.order == 'descend'">
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height desc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight desc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score desc
+                </if>
             </if>
         </if>
+
     </select>
 
     <select id="getMajorClassCount" resultType="com.xjrsoft.module.outint.vo.IdCountVo">

+ 72 - 6
src/main/resources/mapper/banding/BandingTaskClassStudentMapper.xml

@@ -3,7 +3,7 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xjrsoft.module.banding.mapper.BandingTaskClassStudentMapper">
-    <select id="satisfyStudent" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
+    <select id="satisfyStudent" parameterType="com.xjrsoft.module.banding.dto.StudentDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
         SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
         t1.score,t1.graduate_class,t6.name as source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name as first_ambition,
         t8.name as second_ambition,t1.is_adjust,t1.status FROM base_new_student t1
@@ -14,10 +14,43 @@
         LEFT JOIN enrollment_plan t4 ON t1.enrollment_plan_id = t4.id
         LEFT JOIN base_major_set t7 ON t1.first_ambition = t7.id
         LEFT JOIN base_major_set t8 ON t1.second_ambition = t8.id
-        WHERE t1.delete_mark = 0 AND t5.delete_mark = 0 AND t5.banding_task_class_id = #{bandingTaskClassId}
+        WHERE t1.delete_mark = 0 AND t5.delete_mark = 0 AND t5.banding_task_class_id = #{dto.bandingTaskClassId}
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name},'%')
+        </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            and t1.gender = #{dto.gender}
+        </if>
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            and t1.credential_number like concat('%', #{dto.credentialNumber},'%')
+        </if>
+        <if test="dto.order != null">
+            <if test="dto.order == 'ascend'">
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height asc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight asc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score asc
+                </if>
+            </if>
+            <if test="dto.order == 'descend'">
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height desc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight desc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score desc
+                </if>
+            </if>
+        </if>
     </select>
 
-    <select id="surplusStudent" parameterType="com.xjrsoft.module.banding.entity.BandingTaskClass" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
+    <select id="surplusStudent" parameterType="com.xjrsoft.module.banding.dto.StudentDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
         SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
         t1.score,t1.graduate_class,t6.name as source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name as first_ambition,
         t8.name as second_ambition,t1.is_adjust,t1.status FROM base_new_student t1
@@ -28,11 +61,44 @@
         LEFT JOIN xjr_dictionary_detail t6 ON t1.source = t6.code AND t6.item_id = 2023000000000000028
         LEFT JOIN base_major_set t7 ON t1.first_ambition = t7.id
         LEFT JOIN base_major_set t8 ON t1.second_ambition = t8.id
-        WHERE t1.delete_mark = 0 AND t5.id = #{taskClass.bandingTaskId}
-        AND (t1.first_ambition_id = #{taskClass.majorSetId} or t1.second_ambition_id = #{taskClass.majorSetId})
+        WHERE t1.delete_mark = 0 AND t5.id = #{dto.bandingTaskId}
+        AND (t1.first_ambition_id = #{dto.majorSetId} or t1.second_ambition_id = #{dto.majorSetId})
             and t1.id not in (SELECT new_student_id FROM banding_task_class_student c1
             INNER JOIN banding_task_class c2 ON c1.banding_task_class_id = c2.id
-            WHERE c1.delete_mark = 0 AND c2.delete_mark = 0 AND c2.banding_task_id = #{taskClass.bandingTaskId}
+            WHERE c1.delete_mark = 0 AND c2.delete_mark = 0 AND c2.banding_task_id = #{dto.bandingTaskId}
         )
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name},'%')
+        </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            and t1.gender = #{dto.gender}
+        </if>
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            and t1.credential_number like concat('%', #{dto.credentialNumber},'%')
+        </if>
+        <if test="dto.order != null">
+            <if test="dto.order == 'ascend'">
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height asc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight asc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score asc
+                </if>
+            </if>
+            <if test="dto.order == 'descend'">
+                <if test="dto.field != null and dto.field == 'height'">
+                    order by t1.height desc
+                </if>
+                <if test="dto.field != null and dto.field == 'weight'">
+                    order by t1.weight desc
+                </if>
+                <if test="dto.field != null and dto.field != '' and dto.field == 'score'">
+                    order by t1.score desc
+                </if>
+            </if>
+        </if>
     </select>
 </mapper>

+ 15 - 1
src/main/resources/mapper/banding/BandingTaskMajorConditionMapper.xml

@@ -8,6 +8,20 @@
         SELECT t1.id, t.id AS major_set_id, t.name AS major_set_name,t1.banding_task_id,t1.height,t1.score, t1.sort_code FROM base_major_set t
         LEFT JOIN banding_task_major_condition t1 ON t1.major_set_id = t.id and t1.banding_task_id = #{dto.bandingTaskId} and t1.delete_mark = 0
         WHERE t.delete_mark = 0
+        <if test="dto.majorIds != null and !dto.majorIds.isEmpty()">
+            and t.id in
+            <foreach item="id" index="index" collection="dto.majorIds" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        </if>
+        <if test="dto.majorSetName != null and dto.majorSetName != ''">
+            and t.name like concat('%', #{dto.majorSetName},'%')
+        </if>
+    </select>
+    <select id="getStudentMajorId" parameterType="com.xjrsoft.module.banding.dto.BandingTaskClassPageDto" resultType="com.xjrsoft.module.student.entity.BaseNewStudent">
+        SELECT t1.* FROM base_new_student t1
+        INNER JOIN enrollment_plan t2 ON  t1.enrollment_plan_id = t2.id
+        WHERE t1.delete_mark = 0
+        AND t2.enroll_type = #{dto.enrollType} and t2.grade_id = #{dto.gradeId}
     </select>
-
 </mapper>

+ 60 - 0
src/main/resources/mapper/courseTable/SecondCourseMapper.xml

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xjrsoft.module.courseTable.mapper.SecondCourseMapper">
+    <select id="getPage" parameterType="com.xjrsoft.module.courseTable.dto.SecondCoursePageDto" resultType="com.xjrsoft.module.courseTable.vo.SecondCoursePageVo">
+        SELECT t1.id,t2.name AS semester_name,t1.name,t1.place,t1.content,t1.teacher_name,t1.status,
+        (SELECT COUNT(*) FROM second_course_enroll WHERE delete_mark = 0 AND second_course_id = t1.id) AS enroll_count,
+        ifnull((SELECT COUNT(*) FROM second_course_enroll WHERE delete_mark = 0 AND second_course_id = t1.id and user_id = #{dto.userId}), 0) AS enroll_status FROM second_course t1
+        LEFT JOIN base_semester t2 ON t1.base_semester_id = t2.id
+        WHERE t1.delete_mark = 0
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.semesterId != null">
+            and t1.base_semester_id = #{dto.semesterId}
+        </if>
+        <if test="dto.status != null">
+            and t1.status = #{dto.status}
+        </if>
+    </select>
+    <select id="getEnrollPage" parameterType="com.xjrsoft.module.courseTable.dto.SecondCourseEnrollPageDto" resultType="com.xjrsoft.module.courseTable.vo.SecondCourseEnrollVo">
+        SELECT t1.id,t1.status,t2.name,t1.create_date,t2.user_name,t2.mobile,t1.user_id,
+        (SELECT id FROM base_teacher WHERE user_id = t1.user_id) AS teacher_id,
+        (SELECT id FROM base_student WHERE user_id = t1.user_id) AS student_id FROM second_course_enroll t1
+        INNER JOIN xjr_user t2 ON t1.user_id = t2.id
+        WHERE t1.delete_mark = 0 AND t1.second_course_id = #{dto.secondCourseId}
+    </select>
+    <select id="getEnrollList" parameterType="com.xjrsoft.module.courseTable.dto.SecondCourseEnrollPageDto" resultType="com.xjrsoft.module.courseTable.vo.SecondCourseEnrollVo">
+        SELECT t1.id,t1.status,t2.name,t1.create_date,t2.user_name,t2.mobile,t1.user_id,
+        (SELECT id FROM base_teacher WHERE user_id = t1.user_id) AS teacher_id,
+        (SELECT id FROM base_student WHERE user_id = t1.user_id) AS student_id FROM second_course_enroll t1
+        INNER JOIN xjr_user t2 ON t1.user_id = t2.id
+        WHERE t1.delete_mark = 0 AND t1.second_course_id = #{dto.secondCourseId}
+        <if test="dto.roleId != null">
+            <if test="dto.roleId == 2">
+                and (select id from base_teacher where user_id = t1.user_id) is not null
+            </if>
+            <if test="dto.roleId == 3">
+                and (SELECT id FROM base_student WHERE user_id = t1.user_id) is not null
+            </if>
+        </if>
+    </select>
+    <select id="getMyPage" parameterType="com.xjrsoft.module.courseTable.dto.SecondCoursePageDto" resultType="com.xjrsoft.module.courseTable.vo.SecondCoursePageVo">
+        SELECT t1.id,t2.name AS semester_name,t1.name,t1.place,t1.content,t1.teacher_name,t1.status,
+        (SELECT COUNT(*) FROM second_course_enroll WHERE delete_mark = 0 AND second_course_id = t1.id) AS enroll_count FROM second_course t1
+        LEFT JOIN base_semester t2 ON t1.base_semester_id = t2.id
+        LEFT JOIN second_course_enroll t3 ON t1.id = t3.second_course_id
+        WHERE t1.delete_mark = 0 and t3.user_id = #{dto.userId}
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.semesterId != null">
+            and t1.base_semester_id = #{dto.semesterId}
+        </if>
+        <if test="dto.status != null">
+            and t1.status = #{dto.status}
+        </if>
+    </select>
+</mapper>

+ 3 - 3
src/main/resources/mapper/organization/UserMapper.xml

@@ -19,16 +19,16 @@
         SELECT t1.id, t1.name as student_name, t1.enabled_mark, t1.credential_number, t4.name AS class_name,t1.mobile,
         (SELECT name FROM base_student_family_member WHERE delete_mark = 0 AND user_id = t1.id ORDER BY create_date ASC LIMIT 0,1) as parent_name,
         (SELECT mobile FROM base_student_family_member WHERE delete_mark = 0 AND user_id = t1.id ORDER BY create_date ASC LIMIT 0,1) as parent_mobile,
-        t1.gender,t4.id as class_id, t4.teacher_id,t5.name as teacher_name,t5.user_name as teacher_user_name,t5.mobile as teacher_mobile,t5.name as classroom_name
+        t1.gender,t4.id as class_id, t4.teacher_id,t6.name as teacher_name,t6.user_name as teacher_user_name,t6.mobile as teacher_mobile,t5.name as classroom_name
         FROM xjr_user t1
         INNER JOIN base_student t2 ON t1.id = t2.user_id
         INNER JOIN base_student_school_roll t3 ON t1.id = t3.user_id
         INNER JOIN base_class t4 ON t4.id = t3.class_id
         left join base_classroom t5 on t4.classroom_id = t5.id
-        left join xjr_user t5 on t4.teacher_id = t5.id
+        left join xjr_user t6 on t4.teacher_id = t6.id
         WHERE t1.delete_mark = 0
         <if test="dto.keyword != null and dto.keyword != ''">
-            AND (t1.name = #{dto.keyword} OR t1.credential_number = #{dto.keyword})
+            AND (t1.name like concat('%', #{dto.keyword}, '%') OR t1.credential_number like concat('%', #{dto.keyword}, '%'))
         </if>
         <if test="dto.userId != null">
             AND t1.id = #{dto.userId}

+ 2 - 1
src/main/resources/mapper/textbook/TextbookMapper.xml

@@ -14,7 +14,7 @@
         LEFT JOIN base_class c2 ON c1.class_id = c2.id
         WHERE c1.textbook_id = t1.id) AS use_class,
         t6.name AS use_grade,t1.version,
-        t1.use_type,t1.publishing_date,t1.is_secd,t1.category,t1.plan_batch,t1.work_total_count
+        t1.use_type,t1.publishing_date,t1.is_secd,t1.category,t1.plan_batch,t1.work_total_count,t8.name as textbook_category
         FROM textbook t1
         LEFT JOIN subject_group t2 ON t1.subject_group_id = t2.id
         LEFT JOIN base_semester t3 ON t1.base_semester_id = t3.id
@@ -22,6 +22,7 @@
         LEFT JOIN xjr_dictionary_detail t5 ON t1.textbook_type = t5.code AND t5.item_id = 1739209191193636865
         LEFT JOIN base_grade t6 ON t1.grade_id = t6.id
         LEFT JOIN xjr_dictionary_detail t7 ON t1.is_textbook_plan = t7.code AND t7.item_id = 1737360269850038273
+        LEFT JOIN xjr_dictionary_detail t8 ON t1.textbook_category = t8.code
         WHERE t1.delete_mark = 0
         <if test="dto.textbookType != null and dto.textbookType != ''">
             and t1.textbook_type = #{dto.textbookType}

+ 3 - 0
src/main/resources/mapper/xycxedu/ExamSubjectScoreMappper.xml

@@ -35,6 +35,9 @@
         <if test="dto.semesterId != null">
             and t3.id = #{dto.semesterId}
         </if>
+        <if test="dto.milexamname != null and dto.milexamname != ''">
+            and t1.milexamname like concat('%', #{dto.milexamname}, '%')
+        </if>
         <if test="dto.startDate != null and dto.endDate != null">
             and t1.sdate between #{dto.startDate} and #{dto.endDate}
         </if>

+ 53 - 0
src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

@@ -3551,4 +3551,57 @@ public class FreeMarkerGeneratorTest {
 
         apiGeneratorService.generateCodes(params);
     }
+
+    @Test
+    public void gcSecondCourse() throws IOException {
+        List<TableConfig> tableConfigs = new ArrayList<>();
+        TableConfig mainTable = new TableConfig();
+        mainTable.setTableName("second_course");//init_sql中的表名
+        mainTable.setIsMain(true);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        tableConfigs.add(mainTable);
+
+        mainTable = new TableConfig();
+        mainTable.setTableName("second_course_time");//init_sql中的表名
+        mainTable.setIsMain(false);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        mainTable.setRelationField("second_course_id");//设置外键
+        mainTable.setRelationTableField(GlobalConstant.DEFAULT_PK);//设置外键
+        tableConfigs.add(mainTable);
+
+        mainTable = new TableConfig();
+        mainTable.setTableName("second_course_enroll_range");//init_sql中的表名
+        mainTable.setIsMain(false);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        mainTable.setRelationField("second_course_id");//设置外键
+        mainTable.setRelationTableField(GlobalConstant.DEFAULT_PK);//设置外键
+        tableConfigs.add(mainTable);
+
+        mainTable = new TableConfig();
+        mainTable.setTableName("second_course_enroll");//init_sql中的表名
+        mainTable.setIsMain(false);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        mainTable.setRelationField("second_course_id");//设置外键
+        mainTable.setRelationTableField(GlobalConstant.DEFAULT_PK);//设置外键
+        tableConfigs.add(mainTable);
+
+
+        ApiGenerateCodesDto params = new ApiGenerateCodesDto();
+        params.setAuthor("dzx");//作者名称
+        params.setPackageName("courseTable");//包名
+        params.setTableConfigs(tableConfigs);
+        params.setPage(true);//是否生成分页接口
+        params.setImport(false);//是否生成导入接口
+        params.setExport(false);//是否生成导出接口
+        params.setOutMainDir(true);//是否生成在主目录,前期测试可设置成false
+        params.setDs(ds);
+
+        IApiGeneratorService apiGeneratorService = new ApiGeneratorServiceImpl();
+
+        apiGeneratorService.generateCodes(params);
+    }
 }