Просмотр исходного кода

新生报到模块,查询接口

dzx 1 год назад
Родитель
Сommit
4b8e444524
32 измененных файлов с 623 добавлено и 61 удалено
  1. 0 1
      src/main/java/com/xjrsoft/module/student/controller/BaseStudentDevelopmentController.java
  2. 0 1
      src/main/java/com/xjrsoft/module/student/controller/BaseStudentScholarshipApplicantController.java
  3. 11 13
      src/main/java/com/xjrsoft/module/student/controller/StudentConsumeDateController.java
  4. 151 0
      src/main/java/com/xjrsoft/module/student/controller/StudentReportRecordController.java
  5. 0 1
      src/main/java/com/xjrsoft/module/student/dto/AddBaseStudentDevelopmentDto.java
  6. 0 1
      src/main/java/com/xjrsoft/module/student/dto/AddBaseStudentScholarshipReleaseDto.java
  7. 1 5
      src/main/java/com/xjrsoft/module/student/dto/AddStudentConsumeDateDto.java
  8. 38 0
      src/main/java/com/xjrsoft/module/student/dto/AddStudentReportRecordDto.java
  9. 0 4
      src/main/java/com/xjrsoft/module/student/dto/StudentConsumeDatePageDto.java
  10. 19 0
      src/main/java/com/xjrsoft/module/student/dto/StudentReportRecordPageDto.java
  11. 23 0
      src/main/java/com/xjrsoft/module/student/dto/StudentReportRecordStatisticsDto.java
  12. 0 8
      src/main/java/com/xjrsoft/module/student/dto/UpdateStudentConsumeDateDto.java
  13. 24 0
      src/main/java/com/xjrsoft/module/student/dto/UpdateStudentReportRecordDto.java
  14. 2 5
      src/main/java/com/xjrsoft/module/student/entity/StudentConsumeDate.java
  15. 89 0
      src/main/java/com/xjrsoft/module/student/entity/StudentReportRecord.java
  16. 0 1
      src/main/java/com/xjrsoft/module/student/mapper/StudentConsumeDateMapper.java
  17. 21 0
      src/main/java/com/xjrsoft/module/student/mapper/StudentReportRecordMapper.java
  18. 0 1
      src/main/java/com/xjrsoft/module/student/service/IBaseStudentDevelopmentService.java
  19. 0 1
      src/main/java/com/xjrsoft/module/student/service/IBaseStudentSchoolRollService.java
  20. 0 3
      src/main/java/com/xjrsoft/module/student/service/IStudentConsumeDateService.java
  21. 18 0
      src/main/java/com/xjrsoft/module/student/service/IStudentReportRecordService.java
  22. 0 1
      src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentScholarshipReleaseServiceImpl.java
  23. 0 6
      src/main/java/com/xjrsoft/module/student/service/impl/StudentConsumeDateServiceImpl.java
  24. 25 0
      src/main/java/com/xjrsoft/module/student/service/impl/StudentReportRecordServiceImpl.java
  25. 0 5
      src/main/java/com/xjrsoft/module/student/vo/StudentConsumeDatePageVo.java
  26. 0 3
      src/main/java/com/xjrsoft/module/student/vo/StudentConsumeDateVo.java
  27. 43 0
      src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordPageVo.java
  28. 41 0
      src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordStatisticsVo.java
  29. 40 0
      src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordVo.java
  30. 0 1
      src/main/java/com/xjrsoft/module/student/vo/WhitelistInfoVo.java
  31. 52 0
      src/main/resources/mapper/student/StudentReportRecordMapper.xml
  32. 25 0
      src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

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

@@ -3,7 +3,6 @@ package com.xjrsoft.module.student.controller;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.db.Entity;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.model.result.RT;

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

@@ -4,7 +4,6 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.toolkit.MPJWrappers;

+ 11 - 13
src/main/java/com/xjrsoft/module/student/controller/StudentConsumeDateController.java

@@ -1,38 +1,36 @@
 package com.xjrsoft.module.student.controller;
 
+import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.yulichang.toolkit.MPJWrappers;
-import com.xjrsoft.common.constant.GlobalConstant;
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
-import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.utils.VoToColumnUtil;
-import com.xjrsoft.module.asset.entity.WfAssetManage;
 import com.xjrsoft.module.student.dto.AddStudentConsumeDateDto;
-import com.xjrsoft.module.student.dto.UpdateStudentConsumeDateDto;
-import cn.dev33.satoken.annotation.SaCheckPermission;
-
 import com.xjrsoft.module.student.dto.StudentConsumeDatePageDto;
-import com.xjrsoft.module.student.entity.BaseStudentScholarshipCategory;
+import com.xjrsoft.module.student.dto.UpdateStudentConsumeDateDto;
 import com.xjrsoft.module.student.entity.StudentConsumeDate;
 import com.xjrsoft.module.student.service.IStudentConsumeDateService;
 import com.xjrsoft.module.student.vo.StudentConsumeDatePageVo;
-
 import com.xjrsoft.module.student.vo.StudentConsumeDateVo;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.*;
+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 javax.validation.constraints.NotNull;
 import java.util.List;
 
 /**

+ 151 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentReportRecordController.java

@@ -0,0 +1,151 @@
+package com.xjrsoft.module.student.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+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.base.entity.BaseSemester;
+import com.xjrsoft.module.base.service.IBaseSemesterService;
+import com.xjrsoft.module.student.dto.AddStudentReportRecordDto;
+import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
+import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
+import com.xjrsoft.module.student.dto.UpdateStudentReportRecordDto;
+import com.xjrsoft.module.student.entity.StudentReportRecord;
+import com.xjrsoft.module.student.service.IStudentReportRecordService;
+import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
+import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
+import com.xjrsoft.module.student.vo.StudentReportRecordVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+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.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.List;
+
+/**
+* @title: 学生报到记录表
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/student" + "/studentReportRecord")
+@Api(value = "/student"  + "/studentReportRecord",tags = "学生报到记录表代码")
+@AllArgsConstructor
+public class StudentReportRecordController {
+
+
+    private final IStudentReportRecordService studentReportRecordService;
+    private final IBaseSemesterService semesterService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="学生报到记录表列表(分页)")
+    @SaCheckPermission("studentreportrecord:detail")
+    public RT<PageOutput<StudentReportRecordPageVo>> page(@Valid StudentReportRecordPageDto dto){
+
+        LambdaQueryWrapper<StudentReportRecord> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper
+                    .orderByDesc(StudentReportRecord::getId)
+                .select(StudentReportRecord.class,x -> VoToColumnUtil.fieldsToColumns(StudentReportRecordPageVo.class).contains(x.getProperty()));
+        IPage<StudentReportRecord> page = studentReportRecordService.page(ConventPage.getPage(dto), queryWrapper);
+        PageOutput<StudentReportRecordPageVo> pageOutput = ConventPage.getPageOutput(page, StudentReportRecordPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询学生报到记录表信息")
+    @SaCheckPermission("studentreportrecord:detail")
+    public RT<StudentReportRecordVo> info(@RequestParam Long id){
+        StudentReportRecord studentReportRecord = studentReportRecordService.getById(id);
+        if (studentReportRecord == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(studentReportRecord, StudentReportRecordVo.class));
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增学生报到记录表")
+    @SaCheckPermission("studentreportrecord:add")
+    public RT<Boolean> add(@Valid @RequestBody AddStudentReportRecordDto dto){
+        StudentReportRecord studentReportRecord = BeanUtil.toBean(dto, StudentReportRecord.class);
+        boolean isSuccess = studentReportRecordService.save(studentReportRecord);
+    return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改学生报到记录表")
+    @SaCheckPermission("studentreportrecord:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateStudentReportRecordDto dto){
+
+        StudentReportRecord studentReportRecord = BeanUtil.toBean(dto, StudentReportRecord.class);
+        return RT.ok(studentReportRecordService.updateById(studentReportRecord));
+
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除学生报到记录表")
+    @SaCheckPermission("studentreportrecord:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(studentReportRecordService.removeBatchByIds(ids));
+
+    }
+
+    @GetMapping(value = "/mobile-page")
+    @ApiOperation(value="班主任查询(分页)")
+    @SaCheckPermission("studentreportrecord:detail")
+    public RT<PageOutput<StudentReportRecordPageVo>> mobilePage(@Valid StudentReportRecordPageDto dto){
+
+        LambdaQueryWrapper<StudentReportRecord> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper
+                .orderByDesc(StudentReportRecord::getId)
+                .select(StudentReportRecord.class,x -> VoToColumnUtil.fieldsToColumns(StudentReportRecordPageVo.class).contains(x.getProperty()));
+        IPage<StudentReportRecord> page = studentReportRecordService.page(ConventPage.getPage(dto), queryWrapper);
+        PageOutput<StudentReportRecordPageVo> pageOutput = ConventPage.getPageOutput(page, StudentReportRecordPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/class-statistics")
+    @ApiOperation(value="班级统计(分页)")
+    @SaCheckPermission("studentreportrecord:detail")
+    public RT<StudentReportRecordStatisticsVo> classStatistics(@Valid StudentReportRecordStatisticsDto dto){
+        if(dto.getTeacherId() == null){
+            dto.setTeacherId(StpUtil.getLoginIdAsLong());
+        }
+        if(dto.getBaseSemesterId() == null){
+            LambdaQueryWrapper<BaseSemester> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper
+                    .orderByDesc(BaseSemester::getStartDate)
+                    .select(BaseSemester.class,x -> VoToColumnUtil.fieldsToColumns(BaseSemester.class).contains(x.getProperty()));
+            List<BaseSemester> semesterList = semesterService.list(queryWrapper);
+            if(!semesterList.isEmpty()){
+                dto.setBaseSemesterId(semesterList.get(0).getId());
+            }
+        }
+        StudentReportRecordStatisticsVo statisticsVo = studentReportRecordService.getClassStatistics(dto);
+        long notArrivedCount = statisticsVo.getAllCount() - statisticsVo.getArrivedCount();
+        statisticsVo.setNotArrivedCount(notArrivedCount);
+        BigDecimal divide = BigDecimal.ZERO;
+        if( statisticsVo.getAllCount() != 0){
+            divide = BigDecimal.valueOf(statisticsVo.getArrivedCount()).divide(BigDecimal.valueOf(statisticsVo.getAllCount()), 4, RoundingMode.HALF_UP);
+        }
+        statisticsVo.setReportRate(divide.doubleValue());
+        return RT.ok(statisticsVo);
+    }
+
+}

+ 0 - 1
src/main/java/com/xjrsoft/module/student/dto/AddBaseStudentDevelopmentDto.java

@@ -5,7 +5,6 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.time.LocalDate;
-import java.util.Date;
 
 
 

+ 0 - 1
src/main/java/com/xjrsoft/module/student/dto/AddBaseStudentScholarshipReleaseDto.java

@@ -5,7 +5,6 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.time.LocalDate;
-import java.util.Date;
 
 
 

+ 1 - 5
src/main/java/com/xjrsoft/module/student/dto/AddStudentConsumeDateDto.java

@@ -2,13 +2,9 @@ package com.xjrsoft.module.student.dto;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonFormat;
 
-import java.time.LocalTime;
-import java.time.LocalDateTime;
+import java.io.Serializable;
 import java.math.BigDecimal;
-import java.util.List;
 import java.util.Date;
 
 

+ 38 - 0
src/main/java/com/xjrsoft/module/student/dto/AddStudentReportRecordDto.java

@@ -0,0 +1,38 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+
+/**
+* @title: 学生报到记录表
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@Data
+public class AddStudentReportRecordDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 学生id
+    */
+    @ApiModelProperty("学生id")
+    private Long userId;
+    /**
+    * 报到时间
+    */
+    @ApiModelProperty("报到时间")
+    private Date reportTime;
+    /**
+    * 所属学期
+    */
+    @ApiModelProperty("所属学期")
+    private Long baseSemesterId;
+
+}

+ 0 - 4
src/main/java/com/xjrsoft/module/student/dto/StudentConsumeDatePageDto.java

@@ -5,12 +5,8 @@ import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import org.springframework.format.annotation.DateTimeFormat;
 
-import java.time.LocalTime;
 import java.time.LocalDateTime;
-import java.math.BigDecimal;
-import java.util.Date;
 
 
 /**

+ 19 - 0
src/main/java/com/xjrsoft/module/student/dto/StudentReportRecordPageDto.java

@@ -0,0 +1,19 @@
+package com.xjrsoft.module.student.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+/**
+* @title: 学生报到记录表分页查询入参
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class StudentReportRecordPageDto extends PageInput {
+
+
+}

+ 23 - 0
src/main/java/com/xjrsoft/module/student/dto/StudentReportRecordStatisticsDto.java

@@ -0,0 +1,23 @@
+package com.xjrsoft.module.student.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+/**
+* @title: 学生报到记录表分页查询入参
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class StudentReportRecordStatisticsDto extends PageInput {
+    @ApiModelProperty("班主人id(不传则查询当前登录者的)")
+    private Long teacherId;
+
+    @ApiModelProperty("学期id(不传查询最新一学期的)")
+    private Long baseSemesterId;
+}

+ 0 - 8
src/main/java/com/xjrsoft/module/student/dto/UpdateStudentConsumeDateDto.java

@@ -2,14 +2,6 @@ package com.xjrsoft.module.student.dto;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import java.io.Serializable;
-
-import java.time.LocalTime;
-import java.time.LocalDateTime;
-import java.math.BigDecimal;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import java.util.List;
-import java.util.Date;
 
 
 

+ 24 - 0
src/main/java/com/xjrsoft/module/student/dto/UpdateStudentReportRecordDto.java

@@ -0,0 +1,24 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+
+/**
+* @title: 学生报到记录表
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@Data
+public class UpdateStudentReportRecordDto extends AddStudentReportRecordDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+}

+ 2 - 5
src/main/java/com/xjrsoft/module/student/entity/StudentConsumeDate.java

@@ -2,18 +2,15 @@ package com.xjrsoft.module.student.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.baomidou.mybatisplus.annotation.TableId;
-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.time.LocalTime;
-import java.time.LocalDateTime;
 import java.math.BigDecimal;
-import java.util.List;
 import java.util.Date;
 
 

+ 89 - 0
src/main/java/com/xjrsoft/module/student/entity/StudentReportRecord.java

@@ -0,0 +1,89 @@
+package com.xjrsoft.module.student.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-08-28
+* @Version 1.0
+*/
+@Data
+@TableName("student_report_record")
+@ApiModel(value = "student_report_record", description = "学生报到记录表")
+public class StudentReportRecord 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 userId;
+    /**
+    * 报到时间
+    */
+    @ApiModelProperty("报到时间")
+    private Date reportTime;
+    /**
+    * 所属学期
+    */
+    @ApiModelProperty("所属学期")
+    private Long baseSemesterId;
+
+
+}

+ 0 - 1
src/main/java/com/xjrsoft/module/student/mapper/StudentConsumeDateMapper.java

@@ -1,6 +1,5 @@
 package com.xjrsoft.module.student.mapper;
 
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.student.entity.StudentConsumeDate;
 import org.apache.ibatis.annotations.Mapper;

+ 21 - 0
src/main/java/com/xjrsoft/module/student/mapper/StudentReportRecordMapper.java

@@ -0,0 +1,21 @@
+package com.xjrsoft.module.student.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
+import com.xjrsoft.module.student.entity.StudentReportRecord;
+import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+* @title: 学生报到记录表
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@Mapper
+public interface StudentReportRecordMapper extends MPJBaseMapper<StudentReportRecord> {
+
+    StudentReportRecordStatisticsVo getClassStatistics(@Param("dto") StudentReportRecordStatisticsDto dto);
+
+}

+ 0 - 1
src/main/java/com/xjrsoft/module/student/service/IBaseStudentDevelopmentService.java

@@ -3,7 +3,6 @@ package com.xjrsoft.module.student.service;
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.student.entity.BaseStudentDevelopment;
 import com.xjrsoft.module.student.vo.BaseStudentDevelopmentVo;
-import org.apache.ibatis.annotations.Param;
 
 /**
 * @title: 学生去向登记

+ 0 - 1
src/main/java/com/xjrsoft/module/student/service/IBaseStudentSchoolRollService.java

@@ -12,7 +12,6 @@ import com.xjrsoft.module.student.vo.BaseStudentInfoPageDataVo;
 import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
 import com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo;
 import com.xjrsoft.module.student.vo.MobileClassStatisticsVo;
-import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 

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

@@ -1,10 +1,7 @@
 package com.xjrsoft.module.student.service;
 
-import com.baomidou.mybatisplus.extension.service.IService;
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.student.entity.StudentConsumeDate;
-import lombok.Data;
-import java.util.List;
 
 /**
 * @title: 学生消费数据

+ 18 - 0
src/main/java/com/xjrsoft/module/student/service/IStudentReportRecordService.java

@@ -0,0 +1,18 @@
+package com.xjrsoft.module.student.service;
+
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
+import com.xjrsoft.module.student.entity.StudentReportRecord;
+import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
+
+/**
+* @title: 学生报到记录表
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+
+public interface IStudentReportRecordService extends MPJBaseService<StudentReportRecord> {
+
+    StudentReportRecordStatisticsVo getClassStatistics(StudentReportRecordStatisticsDto dto);
+}

+ 0 - 1
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentScholarshipReleaseServiceImpl.java

@@ -3,7 +3,6 @@ package com.xjrsoft.module.student.service.impl;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
-import com.xjrsoft.module.room.entity.RoomBed;
 import com.xjrsoft.module.student.dto.BaseStudentScholarshipReleasePageDto;
 import com.xjrsoft.module.student.entity.BaseStudentScholarshipApplicant;
 import com.xjrsoft.module.student.entity.BaseStudentScholarshipRelease;

+ 0 - 6
src/main/java/com/xjrsoft/module/student/service/impl/StudentConsumeDateServiceImpl.java

@@ -1,17 +1,11 @@
 package com.xjrsoft.module.student.service.impl;
 
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.xjrsoft.module.student.entity.StudentConsumeDate;
 import com.xjrsoft.module.student.mapper.StudentConsumeDateMapper;
 import com.xjrsoft.module.student.service.IStudentConsumeDateService;
 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;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 
 /**
 * @title: 学生消费数据

+ 25 - 0
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportRecordServiceImpl.java

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.student.service.impl;
+
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
+import com.xjrsoft.module.student.entity.StudentReportRecord;
+import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
+import com.xjrsoft.module.student.service.IStudentReportRecordService;
+import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+* @title: 学生报到记录表
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentReportRecordMapper, StudentReportRecord> implements IStudentReportRecordService {
+    @Override
+    public StudentReportRecordStatisticsVo getClassStatistics(StudentReportRecordStatisticsDto dto) {
+        return this.baseMapper.getClassStatistics(dto);
+    }
+}

+ 0 - 5
src/main/java/com/xjrsoft/module/student/vo/StudentConsumeDatePageVo.java

@@ -1,13 +1,8 @@
 package com.xjrsoft.module.student.vo;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import com.xjrsoft.common.annotation.Trans;
-import com.xjrsoft.common.enums.TransType;
-import java.time.LocalTime;
-import java.time.LocalDateTime;
 import java.math.BigDecimal;
 import java.util.Date;
 

+ 0 - 3
src/main/java/com/xjrsoft/module/student/vo/StudentConsumeDateVo.java

@@ -3,10 +3,7 @@ package com.xjrsoft.module.student.vo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.time.LocalTime;
-import java.time.LocalDateTime;
 import java.math.BigDecimal;
-import java.util.List;
 import java.util.Date;
 
 /**

+ 43 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordPageVo.java

@@ -0,0 +1,43 @@
+package com.xjrsoft.module.student.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 学生报到记录表分页列表出参
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@Data
+public class StudentReportRecordPageVo {
+
+
+    /**
+    * 学生id
+    */
+    @ApiModelProperty("学生id")
+    private Long userId;
+    /**
+    * 报到时间
+    */
+    @ApiModelProperty("学生姓名")
+    private String name;
+    /**
+    * 所属学期
+    */
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
+
+    @ApiModelProperty("身份证号")
+    private String mobile;
+
+    @ApiModelProperty("就读方式")
+    private String stduyStatusCn;
+
+    @ApiModelProperty("家长电话")
+    private String parentMobile;
+
+}

+ 41 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordStatisticsVo.java

@@ -0,0 +1,41 @@
+package com.xjrsoft.module.student.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+* @title: 学生报到记录表表单出参
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@Data
+public class StudentReportRecordStatisticsVo {
+
+
+    @ApiModelProperty("班级名称")
+    private String className;
+
+    @ApiModelProperty("班主任")
+    private String teacherName;
+
+    @ApiModelProperty("报到率")
+    private Double reportRate;
+
+    @ApiModelProperty("总人数")
+    private Long allCount;
+
+    @ApiModelProperty("男生人数")
+    private Long maleCount;
+
+    @ApiModelProperty("女生人数")
+    private Long femaleCount;
+
+    @ApiModelProperty("已到人数")
+    private Long arrivedCount;
+
+    @ApiModelProperty("未到人数")
+    private Long notArrivedCount;
+
+}

+ 40 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordVo.java

@@ -0,0 +1,40 @@
+package com.xjrsoft.module.student.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 学生报到记录表表单出参
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@Data
+public class StudentReportRecordVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+    /**
+    * 学生id
+    */
+    @ApiModelProperty("学生id")
+    private Long userId;
+    /**
+    * 报到时间
+    */
+    @ApiModelProperty("报到时间")
+    private Date reportTime;
+    /**
+    * 所属学期
+    */
+    @ApiModelProperty("所属学期")
+    private Long baseSemesterId;
+
+
+
+}

+ 0 - 1
src/main/java/com/xjrsoft/module/student/vo/WhitelistInfoVo.java

@@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.time.LocalDate;
-import java.time.LocalDateTime;
 
 /**
 * @title: 专业分类表表单出参

+ 52 - 0
src/main/resources/mapper/student/StudentReportRecordMapper.xml

@@ -0,0 +1,52 @@
+<?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.student.mapper.StudentReportRecordMapper">
+    <select id="getClassStatistics" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto"
+            resultType="com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo">
+        SELECT t1.name AS class_name,t2.name AS teacher_name,
+        (
+        SELECT COUNT(*) FROM xjr_user a1
+        INNER JOIN base_student_school_roll a2 ON a1.id = a2.user_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
+        AND a2.class_id = t1.id
+        ) AS all_count,
+        (
+        SELECT COUNT(*) FROM xjr_user a1
+        INNER JOIN base_student_school_roll a2 ON a1.id = a2.user_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
+        AND a1.gender = 'SB10001' AND a2.class_id = t1.id
+        ) AS male_count,
+        (
+        SELECT COUNT(*) FROM xjr_user a1
+        INNER JOIN base_student_school_roll a2 ON a1.id = a2.user_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
+        AND a1.gender = 'SB10002' AND a2.class_id = t1.id
+        ) AS female_count,
+        (
+        SELECT COUNT(*) FROM xjr_user a1
+        INNER JOIN base_student_school_roll a2 ON a1.id = a2.user_id
+        INNER JOIN student_report_record a3 ON a1.id = a3.user_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
+        AND a2.class_id = t1.id AND a3.base_semester_id = #{dto.baseSemesterId} AND a3.report_time IS NOT NULL
+        ) AS arrived_count
+        FROM base_class t1
+        INNER JOIN xjr_user t2 ON t1.teacher_id = t2.id
+        WHERE t1.delete_mark = 0
+        AND t1.teacher_id = #{dto.teacherId}
+    </select>
+    <select id="getClassStatistics" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto"
+            resultType="com.xjrsoft.module.student.vo.StudentReportRecordPageVo">
+        SELECT t1.id as user_id,t1.name,t1.credential_number,t1.mobile,t4.name AS stduy_status_cn,t5.telephone AS parent_mobile FROM xjr_user t1
+        INNER JOIN base_student_school_roll t2 ON t1.id = t2.user_id
+        INNER JOIN base_class t3 ON t2.class_id = t3.id
+        LEFT JOIN xjr_dictionary_detail t4 ON t2.stduy_status = t4.code
+        LEFT JOIN base_student_family t5 ON t5.user_id = t1.id
+        LEFT JOIN student_report_record t6 ON t1.id = t6.user_id
+        AND t6.base_semester_id = #{dto.baseSemesterId}
+        WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
+        AND t2.class_id = #{dto.teacherId}
+        ORDER BY t1.create_date DESC, t2.create_date DESC,t3.create_date DESC
+    </select>
+</mapper>

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

@@ -3717,4 +3717,29 @@ public class FreeMarkerGeneratorTest {
 
         apiGeneratorService.generateCodes(params);
     }
+
+    @Test
+    public void gcStudentReportRecord() throws IOException {
+        List<TableConfig> tableConfigs = new ArrayList<>();
+        TableConfig mainTable = new TableConfig();
+        mainTable.setTableName("student_report_record");//init_sql中的表名
+        mainTable.setIsMain(true);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        tableConfigs.add(mainTable);
+
+        ApiGenerateCodesDto params = new ApiGenerateCodesDto();
+        params.setAuthor("dzx");//作者名称
+        params.setPackageName("student");//包名
+        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);
+    }
 }