Sfoglia il codice sorgente

Merge branch 'pre'

dzx 1 anno fa
parent
commit
1dc4baf90c
24 ha cambiato i file con 611 aggiunte e 58 eliminazioni
  1. 9 4
      src/main/java/com/xjrsoft/module/base/controller/WhitelistManagementController.java
  2. 3 0
      src/main/java/com/xjrsoft/module/base/dto/WhitelistManagementPageDto.java
  3. 72 29
      src/main/java/com/xjrsoft/module/databoard/controller/DatadetailController.java
  4. 1 1
      src/main/java/com/xjrsoft/module/databoard/vo/DurationVo.java
  5. 2 2
      src/main/java/com/xjrsoft/module/form/service/impl/FormExecuteServiceImpl.java
  6. 62 0
      src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java
  7. 52 11
      src/main/java/com/xjrsoft/module/student/controller/StudentReportRecordController.java
  8. 18 1
      src/main/java/com/xjrsoft/module/student/dto/BaseNewStudentPageDto.java
  9. 29 0
      src/main/java/com/xjrsoft/module/student/dto/DeleteNewStudentDto.java
  10. 5 1
      src/main/java/com/xjrsoft/module/student/dto/StudentReportRecordPageDto.java
  11. 3 0
      src/main/java/com/xjrsoft/module/student/entity/BaseNewStudent.java
  12. 3 0
      src/main/java/com/xjrsoft/module/student/mapper/BaseNewStudentMapper.java
  13. 7 0
      src/main/java/com/xjrsoft/module/student/mapper/StudentReportRecordMapper.java
  14. 5 0
      src/main/java/com/xjrsoft/module/student/service/IBaseNewStudentService.java
  15. 5 0
      src/main/java/com/xjrsoft/module/student/service/IStudentReportRecordService.java
  16. 54 0
      src/main/java/com/xjrsoft/module/student/service/impl/BaseNewStudentServiceImpl.java
  17. 9 1
      src/main/java/com/xjrsoft/module/student/service/impl/StudentReportRecordServiceImpl.java
  18. 69 0
      src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentExportVo.java
  19. 10 0
      src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentPageVo.java
  20. 3 0
      src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordPageVo.java
  21. 3 0
      src/main/resources/mapper/base/WhitelistManagement.xml
  22. 177 1
      src/main/resources/mapper/student/BaseNewStudentMapper.xml
  23. 9 6
      src/main/resources/mapper/student/StudentReportRecordMapper.xml
  24. 1 1
      src/test/java/com/xjrsoft/module/oa/service/impl/NewsServiceImplTest.java

+ 9 - 4
src/main/java/com/xjrsoft/module/base/controller/WhitelistManagementController.java

@@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
 import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
@@ -17,6 +18,7 @@ import com.xjrsoft.module.base.entity.WhitelistManagement;
 import com.xjrsoft.module.base.service.IWhitelistManagementService;
 import com.xjrsoft.module.base.vo.WhitelistManagementPageVo;
 import com.xjrsoft.module.base.vo.WhitelistManagementVo;
+import com.xjrsoft.module.room.entity.RoomBed;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -107,11 +109,14 @@ public class WhitelistManagementController {
     @SaCheckPermission("whitelistmanagement:add")
     public RT<Boolean> setTemporary(@Valid @RequestBody List<Long> ids){
         List<WhitelistManagement> list = whitelistManagementService.listByIds(ids);
-        for (WhitelistManagement whitelistManagement : list) {
-            whitelistManagement.setIsTemporary(0);
+        for (WhitelistManagement el : list) {
+            UpdateWrapper<WhitelistManagement> updateWrapper = new UpdateWrapper<>();
+            updateWrapper.eq("id", el.getId());
+            updateWrapper.setSql("end_time = null");
+            updateWrapper.setSql("is_temporary = 0");
+            whitelistManagementService.update(el, updateWrapper);
         }
-        boolean updated = whitelistManagementService.updateBatchById(list);
-        return RT.ok(updated);
+        return RT.ok(true);
     }
 
     @PutMapping

+ 3 - 0
src/main/java/com/xjrsoft/module/base/dto/WhitelistManagementPageDto.java

@@ -37,4 +37,7 @@ public class WhitelistManagementPageDto extends PageInput {
 
     @ApiModelProperty("就读方式")
     private String readWay;
+
+    @ApiModelProperty("是否临时性的(1:是 0:否)")
+    private Integer isTemporary;
 }

+ 72 - 29
src/main/java/com/xjrsoft/module/databoard/controller/DatadetailController.java

@@ -20,6 +20,7 @@ import com.xjrsoft.module.databoard.vo.DurationVo;
 import com.xjrsoft.module.databoard.vo.HealthItemCountVo;
 import com.xjrsoft.module.databoard.vo.HealthStatisticsDetailVo;
 import com.xjrsoft.module.databoard.vo.ItemCountAmountVo;
+import com.xjrsoft.module.databoard.vo.ItemCountRatioVo;
 import com.xjrsoft.module.databoard.vo.ItemCountVo;
 import com.xjrsoft.module.databoard.vo.ItemDoubleVo;
 import com.xjrsoft.module.databoard.vo.ProcessStatisticsDetailVo;
@@ -52,10 +53,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.Duration;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.Period;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
@@ -92,6 +96,14 @@ public class DatadetailController {
         if(dto.getUserId() != null){
             instanceQuery.variableValueEquals(WorkflowConstant.PROCESS_START_USER_ID_KEY, dto.getUserId());
         }
+        LocalDateTime startTime = null;
+        LocalDateTime endTime = null;
+        if(dto.getStartDate() != null){
+            startTime = dto.getStartDate().atStartOfDay();
+        }
+        if(dto.getEndDate() != null){
+            endTime = dto.getEndDate().atStartOfDay().plusDays(1).plusNanos(-1);
+        }
         if (!ObjectUtil.isNull(dto.getStartDate())) {
             instanceQuery.startedAfter(WorkFlowUtil.getStartOfDay(dto.getStartDate()));
         }
@@ -101,6 +113,8 @@ public class DatadetailController {
 
         List<WorkflowExtra> workflowExtras = extraService.list(
                 new MPJLambdaWrapper<WorkflowExtra>()
+                        .between((startTime != null && endTime != null), WorkflowExtra::getLaunchTime, startTime, endTime)
+                        .select(WorkflowExtra::getId)
                         .select(WorkflowExtra.class, x -> VoToColumnUtil.fieldsToColumns(WorkflowExtra.class).contains(x.getProperty()))
                         .leftJoin(WorkflowSchema.class, WorkflowSchema::getId, WorkflowExtra::getSchemaId)
                         .leftJoin(DictionaryDetail.class, DictionaryDetail::getId, WorkflowSchema::getCategory)
@@ -124,7 +138,7 @@ public class DatadetailController {
         List<WorkflowExtra> completeCountList = new ArrayList<>();
         for (HistoricProcessInstance historicProcessInstance : finished) {
             workflowExtras.stream()
-                    .filter(e -> e.getProcessId().equals(historicProcessInstance.getId()))
+                    .filter(e -> e.getProcessId().equals(historicProcessInstance.getId()) && e.getEndTime() != null)
                     .max(Comparator.comparing(WorkflowExtra::getStartTime))
                     .ifPresent(e -> {
                         completeCountList.add(e);
@@ -167,28 +181,17 @@ public class DatadetailController {
         result.setDistributionList(distributionList);
         List<DurationVo> durationList = new ArrayList<>();
 
-        List<Duration> timeDifferences = new ArrayList<>();
+        List<Long> secondList = new ArrayList<>();
         completeCountList.stream().filter(el -> el.getEndTime() != null && el.getStartTime() != null).forEach(el -> {
-            Duration diff = Duration.between(el.getEndTime(), el.getStartTime());
-            timeDifferences.add(diff);
+            Duration diff = Duration.between(el.getStartTime(), el.getEndTime());
+            secondList.add(diff.getSeconds());
         });
 
-        int zeroHour = 0;
-        int oneHour = 0;
-        int fourHour = 0;
-        int eightHour = 0;
-        for (Duration timeDifference : timeDifferences) {
-            long seconds = timeDifference.getSeconds();
-            if(seconds < 3600){
-                zeroHour ++;
-            }else if(seconds < 14400){
-                oneHour ++;
-            }else if(seconds < 28800){
-                fourHour ++;
-            }else{
-                eightHour ++;
-            }
-        }
+        long zeroHour = secondList.stream().filter(x -> x < 3600L).count();
+        long oneHour = secondList.stream().filter(x -> x < 14400L && x >= 3600L).count();
+        long fourHour = secondList.stream().filter(x -> x < 28800L && x >= 14400L).count();
+        long eightHour = secondList.stream().filter(x -> x >= 28800L).count();
+
         DurationVo zeroVo = new DurationVo();
         zeroVo.setDuration("0-1h");
         zeroVo.setCount(zeroHour);
@@ -556,11 +559,22 @@ public class DatadetailController {
     @SaCheckPermission("datadetail:detail")
     public RT<SubscriptionStatisticsDetailVo> subscriptionStatistics(@Valid StatisticsDetailDto dto) {
         SubscriptionStatisticsDetailVo result = new SubscriptionStatisticsDetailVo();
+        LocalDateTime startTime = null;
+        LocalDateTime endTime = null;
+        if(dto.getStartDate() != null){
+            startTime = dto.getStartDate().atStartOfDay();
+        }
+        if(dto.getEndDate() != null){
+            endTime = dto.getEndDate().atStartOfDay().plusDays(1).plusNanos(-1);
+        }
         List<WfSubscription> list = subscriptionService.list(
                 new QueryWrapper<WfSubscription>().lambda()
-                        .between((dto.getStartDate() != null && dto.getEndDate() != null), WfSubscription::getShenQingRiQi4752, dto.getStartDate(), dto.getEndDate())
+                        .between((startTime != null && endTime != null), WfSubscription::getShenQingRiQi4752, startTime, endTime)
         );
-        double totalAmount = list.stream().filter(x -> x.getTotalAmount() != null).mapToDouble(WfSubscription::getTotalAmount).sum();
+
+        result.setAllCount(list.size());
+
+        double totalAmount = list.stream().filter(x -> x.getTotalAmount() != null && x.getStatus() == 1).mapToDouble(WfSubscription::getTotalAmount).sum();
         result.setTotalAmount(totalAmount);
 
         int adoptCount = list.stream().filter(x -> x.getStatus() == 1).collect(Collectors.toList()).size();
@@ -569,14 +583,14 @@ public class DatadetailController {
         int pendingCount = list.stream().filter(x -> x.getStatus() == null || x.getStatus() == 0).collect(Collectors.toList()).size();
         result.setPendingCount(pendingCount);
 
-        String sql = "SELECT IFNULL(t3.name, '未填写') AS item,COUNT(t1.id) AS a_count,SUM(t1.amount) as a_sum FROM wf_subscription_list t1" +
+        String sql = "SELECT IFNULL(t3.name, '未填写') AS item,COUNT(t1.id) AS a_count,SUM(t1.estimated_unit_price * t1.amount) as a_sum FROM wf_subscription_list t1" +
                 " INNER JOIN wf_subscription t2 ON t1.parent_id = t2.id" +
                 " LEFT JOIN xjr_dictionary_detail t3 ON t1.item_type = t3.code" +
                 " AND t3.item_id = 1752140413593518081" +
                 " WHERE t2.status = 1";
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-        if(dto.getStartDate() != null && dto.getEndDate() != null){
-            sql += " and t2.shen_qing_ri_qi4752 between '" + dto.getStartDate().format(formatter) + "' and '" + dto.getEndDate().format(formatter) + "'";
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        if(startTime != null && endTime != null){
+            sql += " and t2.shen_qing_ri_qi4752 between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
         }
         sql += " GROUP BY t3.name";
         List<Map<String, Object>> datalist = SqlRunnerAdapter.db().selectList(sql);
@@ -600,12 +614,12 @@ public class DatadetailController {
         result.setCategoryCountList(categoryCountList);
         result.setCategoryAmountList(categoryAmountList);
 
-        sql = "SELECT IFNULL(t3.name, '未填写') AS item,COUNT(t1.id) AS a_count,SUM(t1.amount) as a_sum FROM wf_subscription_list t1" +
+        sql = "SELECT IFNULL(t3.name, '未填写') AS item,COUNT(t1.id) AS a_count,SUM(t1.estimated_unit_price * t1.amount) as a_sum FROM wf_subscription_list t1" +
             " INNER JOIN wf_subscription t2 ON t1.parent_id = t2.id" +
             " LEFT JOIN xjr_department t3 ON t2.application_department = t3.id" +
             " WHERE t2.status = 1";
-        if(dto.getStartDate() != null && dto.getEndDate() != null){
-            sql += " and t2.shen_qing_ri_qi4752 between '" + dto.getStartDate().format(formatter) + "' and '" + dto.getEndDate().format(formatter) + "'";
+        if(startTime != null && endTime != null){
+            sql += " and t2.shen_qing_ri_qi4752 between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
         }
         sql += " GROUP BY t3.name";
         datalist = SqlRunnerAdapter.db().selectList(sql);
@@ -643,6 +657,35 @@ public class DatadetailController {
             courseCountList.add(listVo);
         }
         result.setCourseCountList(courseCountList);
+        
+        sql = "SELECT count(*) FROM course_table t1" +
+            " INNER JOIN base_teacher t2 ON t1.teacher_id = t2.user_id" +
+            " INNER JOIN xjr_user_dept_relation t3 ON t2.user_id = t3.user_id" +
+            " INNER JOIN xjr_department t4 ON t4.id = t3.dept_id" +
+            " WHERE t4.delete_mark = 0 AND t2.delete_mark = 0" +
+            " AND t4.is_major = 1";
+        long allCourseCount = SqlRunnerAdapter.db().selectCount(sql);
+        sql = "SELECT name,(" +
+            " SELECT COUNT(*) FROM course_table t1" +
+            " INNER JOIN base_teacher t2 ON t1.teacher_id = t2.user_id" +
+            " INNER JOIN xjr_user_dept_relation t3 ON t2.user_id = t3.user_id" +
+            " WHERE t3.dept_id = xjr_department.id" +
+            " ) AS course_count FROM xjr_department WHERE is_major = 1";
+        list = SqlRunnerAdapter.db().selectList(sql);
+        List<ItemCountRatioVo> deptCourseList = new ArrayList<>();
+        for (Map<String, Object> objectMap : list) {
+            int courseCount = Integer.parseInt(objectMap.get("course_count").toString());
+            //计算出勤率
+            BigDecimal divide = BigDecimal.valueOf(courseCount).divide(BigDecimal.valueOf(allCourseCount), 4, RoundingMode.HALF_UP);
+            deptCourseList.add(
+                    new ItemCountRatioVo() {{
+                        setItem(objectMap.get("name").toString());
+                        setCount(courseCount);
+                        setRatio(divide.doubleValue());
+                    }}
+            );
+        }
+        result.setDeptCourseList(deptCourseList);
         return RT.ok(result);
     }
 

+ 1 - 1
src/main/java/com/xjrsoft/module/databoard/vo/DurationVo.java

@@ -22,6 +22,6 @@ public class DurationVo {
     * 完成总数
     */
     @ApiModelProperty("数量")
-    private Integer count;
+    private Long count;
 
 }

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

@@ -1010,7 +1010,7 @@ public class FormExecuteServiceImpl implements IFormExecuteService {
                     if (childTableConfig.isPresent()) {
                         //删除子表单数据
                         // 查询是否有子表数据,如果有就删除,没有返回
-                        long count = SqlRunnerAdapter.db().selectCount("select * from " + tableMap.getKey() + " where " + childTableConfig.get().getRelationField() + " = " + keyValue2);
+                        long count = SqlRunnerAdapter.db().selectCount("select count(*) from " + tableMap.getKey() + " where " + childTableConfig.get().getRelationField() + " = " + keyValue2);
 
                         if (count > 0) {
                             Entity childDeleteWhere = Entity.create(tableMap.getKey()).set(childTableConfig.get().getRelationField(), keyValue2);
@@ -1297,7 +1297,7 @@ public class FormExecuteServiceImpl implements IFormExecuteService {
                         //删除子表单数据
                         String keyValuesStr = "(" + keyValue + ")";
 
-                        long count = SqlRunnerAdapter.db().selectCount("select * from " + childTableConfig.get().getTableName() + " where " + childTableConfig.get().getRelationField() + " in " + keyValuesStr);
+                        long count = SqlRunnerAdapter.db().selectCount("select count(*) from " + childTableConfig.get().getTableName() + " where " + childTableConfig.get().getRelationField() + " in " + keyValuesStr);
                         if (count > 0) {
                             Entity childDeleteWhere = Entity.create(tableMap.getKey()).set(childTableConfig.get().getRelationField(), keyValue);
                             result = SqlRunnerAdapter.db().dynamicDelete(childTableConfig.get().getTableName(), childDeleteWhere);

+ 62 - 0
src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java

@@ -4,6 +4,9 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.dev33.satoken.secure.BCrypt;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.support.ExcelTypeEnum;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -13,9 +16,12 @@ import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.RedisUtil;
+import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.config.CommonPropertiesConfig;
+import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.entity.BaseUserStudent;
 import com.xjrsoft.module.base.entity.WhitelistManagement;
+import com.xjrsoft.module.base.service.IBaseSemesterService;
 import com.xjrsoft.module.base.service.IBaseUserStudentService;
 import com.xjrsoft.module.base.service.IWhitelistManagementService;
 import com.xjrsoft.module.organization.entity.User;
@@ -25,11 +31,13 @@ import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.student.dto.ActiveAccountDto;
 import com.xjrsoft.module.student.dto.AddBaseNewStudentDto;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
+import com.xjrsoft.module.student.dto.DeleteNewStudentDto;
 import com.xjrsoft.module.student.dto.UpdateBaseNewStudentDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.entity.BaseStudentFamilyMember;
 import com.xjrsoft.module.student.service.IBaseNewStudentService;
 import com.xjrsoft.module.student.service.IBaseStudentFamilyMemberService;
+import com.xjrsoft.module.student.vo.BaseNewStudentExportVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentScoreExcelVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentTreeVo;
@@ -39,6 +47,7 @@ import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
 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;
@@ -50,6 +59,7 @@ import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.validation.Valid;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
@@ -79,6 +89,7 @@ public class BaseNewStudentController {
     private final RedisUtil redisUtil;
     private final IBaseUserStudentService userStudentService;
     private final CommonPropertiesConfig propertiesConfig;
+    private final IBaseSemesterService semesterService;
     @GetMapping(value = "/page")
     @ApiOperation(value="新生维护信息列表(分页)")
     @SaCheckPermission("basenewstudent:detail")
@@ -89,6 +100,29 @@ public class BaseNewStudentController {
         return RT.ok(pageOutput);
     }
 
+    @GetMapping(value = "/report-page")
+    @ApiOperation(value="新生报到(分页)")
+    @SaCheckPermission("basenewstudent:detail")
+    public RT<PageOutput<BaseNewStudentPageVo>> reportPage(@Valid BaseNewStudentPageDto dto){
+        List<String> roleList = StpUtil.getRoleList();
+        if(roleList.contains("CLASSTE") && roleList.contains("TEACHER") && 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());
+            }
+        }
+        Page<BaseNewStudentPageVo> page = baseNewStudentService.getReportPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<BaseNewStudentPageVo> pageOutput = ConventPage.getPageOutput(page, BaseNewStudentPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
     @GetMapping(value = "/tree")
     @ApiOperation(value="新生维护信息树")
     @SaCheckPermission("basenewstudent:detail")
@@ -161,8 +195,16 @@ public class BaseNewStudentController {
     @SaCheckPermission("basenewstudent:delete")
     public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
         return RT.ok(baseNewStudentService.removeBatchByIds(ids));
+    }
 
+    @DeleteMapping("deleteByUserIds")
+    @ApiOperation(value = "删除新生(保留新生信息,删除基础信息)")
+    @SaCheckPermission("basenewstudent:delete")
+    public RT<Boolean> deleteByUserIds(@Valid @RequestBody DeleteNewStudentDto dto){
+        return RT.ok(baseNewStudentService.deleteByUserIds(dto));
     }
+
+
     @PostMapping("/import")
     @ApiOperation(value = "导入")
     public RT<List<Map<String, String>>> importData(@RequestParam Long treeId, @RequestParam MultipartFile file) throws IOException {
@@ -310,4 +352,24 @@ public class BaseNewStudentController {
         return RT.ok(true);
     }
 
+    @GetMapping("/report-export")
+    @ApiOperation(value = "导出")
+    public ResponseEntity<byte[]> exportData(@Valid BaseNewStudentPageDto dto) {
+        List<BaseNewStudentPageVo> reportList = baseNewStudentService.getReportList(dto);
+        List<BaseNewStudentExportVo> exportVos = new ArrayList<>();
+
+        for (BaseNewStudentPageVo el : reportList) {
+            BaseNewStudentExportVo vo = BeanUtil.toBean(el, BaseNewStudentExportVo.class);
+            if(el.getIsAdjust() == 1){
+                vo.setReportStatus("是");
+            }else if(el.getIsAdjust() == 0){
+                vo.setReportStatus("否");
+            }
+        }
+        ByteArrayOutputStream bot = new ByteArrayOutputStream();
+        EasyExcel.write(bot, BaseNewStudentExportVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(exportVos);
+
+        return RT.fileStream(bot.toByteArray(), "RoomBed" + ExcelTypeEnum.XLSX.getValue());
+    }
+
 }

+ 52 - 11
src/main/java/com/xjrsoft/module/student/controller/StudentReportRecordController.java

@@ -6,6 +6,7 @@ import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 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.xjrsoft.common.enums.EnrollTypeEnum;
 import com.xjrsoft.common.enums.GenderDictionaryEnum;
 import com.xjrsoft.common.enums.StudyStatusEnum;
@@ -146,12 +147,20 @@ public class StudentReportRecordController {
     @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);
+        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());
+            }
+        }
+        if(dto.getTeacherId() == null){
+            dto.setTeacherId(StpUtil.getLoginIdAsLong());
+        }
+        Page<StudentReportRecordPageVo> page = studentReportRecordService.getMobilePage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         PageOutput<StudentReportRecordPageVo> pageOutput = ConventPage.getPageOutput(page, StudentReportRecordPageVo.class);
         return RT.ok(pageOutput);
     }
@@ -173,6 +182,16 @@ public class StudentReportRecordController {
                 dto.setBaseSemesterId(semesterList.get(0).getId());
             }
         }
+        if(dto.getGradeId() == null){
+            LambdaQueryWrapper<BaseGrade> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper
+                    .orderByDesc(BaseGrade::getTitle)
+                    .select(BaseGrade.class,x -> VoToColumnUtil.fieldsToColumns(BaseGrade.class).contains(x.getProperty()));
+            List<BaseGrade> gradeList = gradeService.list(queryWrapper);
+            if(!gradeList.isEmpty()){
+                dto.setGradeId(gradeList.get(0).getId());
+            }
+        }
         StudentReportRecordStatisticsVo statisticsVo = studentReportRecordService.getClassStatistics(dto);
         if(statisticsVo == null){
             statisticsVo = new StudentReportRecordStatisticsVo();
@@ -214,11 +233,27 @@ public class StudentReportRecordController {
         statisticsVo.setArrivedMaleCount(dataList.stream().filter(x -> x.getReportTime() != null && GenderDictionaryEnum.MALE.getCode().equals(x.getGender())).count());
         statisticsVo.setArrivedFemaleCount(dataList.stream().filter(x -> x.getReportTime() != null && GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender())).count());
 
-        statisticsVo.setStayMaleCount(dataList.stream().filter(x -> GenderDictionaryEnum.MALE.getCode().equals(x.getGender()) && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatus())).count());
-        statisticsVo.setStayFemaleCount(dataList.stream().filter(x -> GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender()) && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatus())).count());
-        statisticsVo.setNotStayMaleCount(dataList.stream().filter(x -> GenderDictionaryEnum.MALE.getCode().equals(x.getGender()) && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatus())).count());
-        statisticsVo.setNotStayFemaleCount(dataList.stream().filter(x -> GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender()) && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatus())).count());
-        Map<String, List<StudentReportRecordStatisticsListVo>> graduatedUniversityMap = dataList.stream().collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getGraduatedUniversity));
+        statisticsVo.setStayMaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.MALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatus())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setStayFemaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatus())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setNotStayMaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.MALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatus())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setNotStayFemaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatus())
+                        && x.getReportTime() != null
+        ).count());
+        Map<String, List<StudentReportRecordStatisticsListVo>> graduatedUniversityMap = dataList.stream().filter(x -> x.getReportTime() != null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getGraduatedUniversity));
         List<ItemCountVo> graduatedUniversityList = new ArrayList<>();
         for (String graduatedUniversity : graduatedUniversityMap.keySet()) {
             graduatedUniversityList.add(
@@ -229,6 +264,12 @@ public class StudentReportRecordController {
             );
         }
         statisticsVo.setGraduatedUniversityList(graduatedUniversityList);
+
+        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);
     }
 

+ 18 - 1
src/main/java/com/xjrsoft/module/student/dto/BaseNewStudentPageDto.java

@@ -36,7 +36,6 @@ public class BaseNewStudentPageDto extends PageInput {
     @ApiModelProperty("第二志愿")
     private String secondAmbition;
 
-
     @ApiModelProperty("添加时间-开始")
     private LocalDateTime startDate;
 
@@ -60,4 +59,22 @@ public class BaseNewStudentPageDto extends PageInput {
 
     @ApiModelProperty("树id")
     private Long treeId;
+
+    @ApiModelProperty("班主任id")
+    private Long teacherId;
+
+    @ApiModelProperty("班级id")
+    private Long classId;
+
+    @ApiModelProperty("就读方式")
+    private String stduyStatus;
+
+    @ApiModelProperty("学期id")
+    private Long baseSemesterId;
+
+    @ApiModelProperty("是否已报到(1:是 0:否)")
+    private Integer isReport;
+
+    @ApiModelProperty("学生来源")
+    private String source;
 }

+ 29 - 0
src/main/java/com/xjrsoft/module/student/dto/DeleteNewStudentDto.java

@@ -0,0 +1,29 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+* @title: 删除新生
+* @Author fanxp
+* @Date: 2023-11-14
+* @Version 1.0
+*/
+@Data
+public class DeleteNewStudentDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("新生信息id")
+    private List<Long> ids;
+
+    @ApiModelProperty("学生userIds")
+    private List<Long> userIds;
+
+    @ApiModelProperty("删除原因")
+    private String deleteReason;
+}

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

@@ -1,6 +1,7 @@
 package com.xjrsoft.module.student.dto;
 
 import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -14,6 +15,9 @@ import lombok.EqualsAndHashCode;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class StudentReportRecordPageDto extends PageInput {
+    @ApiModelProperty("学期id")
+    private Long baseSemesterId;
 
-
+    @ApiModelProperty("教师id")
+    private Long teacherId;
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/entity/BaseNewStudent.java

@@ -166,4 +166,7 @@ public class BaseNewStudent implements Serializable {
      */
     @ApiModelProperty("第二志愿")
     private Long secondAmbitionId;
+
+    @ApiModelProperty("删除原因(用于新生删除功能)")
+    private String deleteReason;
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseNewStudentMapper.java

@@ -25,6 +25,9 @@ public interface BaseNewStudentMapper extends MPJBaseMapper<BaseNewStudent> {
 
     Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
 
+    Page<BaseNewStudentPageVo> getReportPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
+
+    List<BaseNewStudentPageVo> getReportList(@Param("dto") BaseNewStudentPageDto dto);
     List<EnrollmentPlanTreeVo> getEnrollmentPlanList();
 
     List<EnrollmentPlanGradeVo> getGradeList();

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

@@ -1,8 +1,13 @@
 package com.xjrsoft.module.student.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.room.dto.RoomPageDto;
+import com.xjrsoft.module.room.vo.RoomPageVo;
+import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
+import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import org.apache.ibatis.annotations.Mapper;
@@ -23,4 +28,6 @@ public interface StudentReportRecordMapper extends MPJBaseMapper<StudentReportRe
 
     List<StudentReportRecordStatisticsListVo> getStatisticsDataList(@Param("dto") StudentReportRecordStatisticsDto dto);
 
+    Page<StudentReportRecordPageVo> getMobilePage(Page<StudentReportRecordPageVo> page, @Param("dto") StudentReportRecordPageDto dto);
+
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/student/service/IBaseNewStudentService.java

@@ -5,6 +5,7 @@ import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.banding.vo.IdManyCountVo;
 import com.xjrsoft.module.outint.vo.IdCountVo;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
+import com.xjrsoft.module.student.dto.DeleteNewStudentDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentScoreExcelVo;
@@ -27,7 +28,9 @@ public interface IBaseNewStudentService extends MPJBaseService<BaseNewStudent> {
 
     Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
 
+    Page<BaseNewStudentPageVo> getReportPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
 
+    List<BaseNewStudentPageVo> getReportList(BaseNewStudentPageDto dto);
     List<EnrollmentPlanTreeVo> getEnrollmentPlanList();
 
     List<EnrollmentPlanGradeVo> getGradeList();
@@ -39,4 +42,6 @@ public interface IBaseNewStudentService extends MPJBaseService<BaseNewStudent> {
     List<IdCountVo> getMajorStudent(Long gradeId, String enrollType, Integer index);
 
     List<IdManyCountVo> getMajorStudentCount(Long bandingTaskId);
+
+    Boolean deleteByUserIds(DeleteNewStudentDto dto);
 }

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

@@ -1,8 +1,11 @@
 package com.xjrsoft.module.student.service;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
+import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import org.apache.ibatis.annotations.Param;
@@ -25,4 +28,6 @@ public interface IStudentReportRecordService extends MPJBaseService<StudentRepor
 
 
     Boolean removeByUserId(List<Long> ids);
+
+    Page<StudentReportRecordPageVo> getMobilePage(Page<StudentReportRecordPageVo> page, StudentReportRecordPageDto dto);
 }

+ 54 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseNewStudentServiceImpl.java

@@ -12,11 +12,21 @@ import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.banding.vo.IdManyCountVo;
 import com.xjrsoft.module.base.entity.BaseMajorSet;
 import com.xjrsoft.module.base.service.IBaseMajorSetService;
+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.student.dto.BaseNewStudentPageDto;
+import com.xjrsoft.module.student.dto.DeleteNewStudentDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.entity.BaseStudent;
+import com.xjrsoft.module.student.entity.BaseStudentFamily;
+import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.mapper.BaseNewStudentMapper;
 import com.xjrsoft.module.student.service.IBaseNewStudentService;
+import com.xjrsoft.module.student.service.IBaseStudentFamilyService;
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
+import com.xjrsoft.module.student.service.IBaseStudentService;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentScoreExcelVo;
 import com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo;
@@ -49,10 +59,24 @@ public class BaseNewStudentServiceImpl extends MPJBaseServiceImpl<BaseNewStudent
 
     private final DictionarydetailMapper dictionarydetailMapper;
     private final IBaseMajorSetService majorSetService;
+    private final IUserService userService;
+    private final IBaseStudentService studentService;
+    private final IBaseStudentSchoolRollService rollService;
+    private final IBaseStudentFamilyService familyService;
+    private final IUserRoleRelationService roleRelationService;
     @Override
     public Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto) {
         return this.baseMapper.getPage(page, dto);
     }
+    @Override
+    public Page<BaseNewStudentPageVo> getReportPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto) {
+        return this.baseMapper.getReportPage(page, dto);
+    }
+
+    @Override
+    public List<BaseNewStudentPageVo> getReportList(BaseNewStudentPageDto dto) {
+        return this.baseMapper.getReportList(dto);
+    }
 
     @Override
     public List<EnrollmentPlanTreeVo> getEnrollmentPlanList() {
@@ -258,6 +282,36 @@ public class BaseNewStudentServiceImpl extends MPJBaseServiceImpl<BaseNewStudent
         return this.baseMapper.getMajorStudentCount(bandingTaskId);
     }
 
+    @Override
+    public Boolean deleteByUserIds(DeleteNewStudentDto dto) {
+        List<BaseNewStudent> studentList = this.baseMapper.selectBatchIds(dto.getIds());
+        for (BaseNewStudent student : studentList) {
+            student.setDeleteReason(dto.getDeleteReason());
+            student.setModifyDate(new Date());
+        }
+        this.updateBatchById(studentList);
+
+        userService.deleteBatch(dto.getUserIds());
+        studentService.remove(
+                new QueryWrapper<BaseStudent>().lambda()
+                        .in(BaseStudent::getUserId, dto.getUserIds())
+        );
+        rollService.remove(
+                new QueryWrapper<BaseStudentSchoolRoll>().lambda()
+                .in(BaseStudentSchoolRoll::getUserId, dto.getUserIds())
+        );
+        familyService.remove(
+                new QueryWrapper<BaseStudentFamily>().lambda()
+                        .in(BaseStudentFamily::getUserId, dto.getUserIds())
+        );
+
+        roleRelationService.remove(
+                new QueryWrapper<UserRoleRelation>().lambda()
+                        .in(UserRoleRelation::getUserId, dto.getUserIds())
+        );
+        return true;
+    }
+
     /**
      * 检查必填字段是否为空
      */

+ 9 - 1
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportRecordServiceImpl.java

@@ -1,11 +1,14 @@
 package com.xjrsoft.module.student.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 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.StudentReportRecordPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import lombok.AllArgsConstructor;
@@ -35,8 +38,13 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
     @Override
     public Boolean removeByUserId(List<Long> ids) {
         this.baseMapper.delete(
-                new QueryWrapper<StudentReportRecord>().lambda().in(StudentReportRecord::getUserId, ids)
+            new QueryWrapper<StudentReportRecord>().lambda().in(StudentReportRecord::getUserId, ids)
         );
         return true;
     }
+
+    @Override
+    public Page<StudentReportRecordPageVo> getMobilePage(Page<StudentReportRecordPageVo> page, StudentReportRecordPageDto dto) {
+        return this.baseMapper.getMobilePage(page, dto);
+    }
 }

+ 69 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentExportVo.java

@@ -0,0 +1,69 @@
+package com.xjrsoft.module.student.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.time.LocalDate;
+
+/**
+* @title: 新生维护信息分页列表出参
+* @Author dzx
+* @Date: 2024-06-27
+* @Version 1.0
+*/
+@Data
+public class BaseNewStudentExportVo {
+
+    @ExcelProperty("班级名称")
+    @ApiModelProperty("班级名称")
+    private String className;
+
+    @ExcelProperty("班主任")
+    @ApiModelProperty("班主任")
+    private String teacherName;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生姓名")
+    @ApiModelProperty("学生姓名")
+    private String name;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("性别")
+    @ApiModelProperty("性别中文")
+    private String genderCn;
+    /**
+    * 身份证号
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("身份证号")
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("手机号")
+    @ApiModelProperty("手机号")
+    private String mobile;
+
+    @ExcelProperty("家长联系电话")
+    @ApiModelProperty("家长联系电话")
+    private String familyMobile;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学生来源")
+    @ApiModelProperty("学生来源")
+    private String sourceCn;
+
+    @ExcelProperty("就读方式")
+    @ApiModelProperty("就读方式")
+    private String stduyStatusCn;
+
+    @ExcelProperty("报到状态")
+    private String reportStatus;
+
+    @ExcelProperty("报到时间")
+    @ApiModelProperty("报到时间")
+    private LocalDate reportTime;
+
+}

+ 10 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentPageVo.java

@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.Date;
 
 /**
@@ -163,4 +164,13 @@ public class BaseNewStudentPageVo {
     @ExcelProperty("班主任")
     @ApiModelProperty("班主任")
     private String teacherName;
+
+    @ApiModelProperty("学生userId")
+    private Long userId;
+
+    @ApiModelProperty("报到时间")
+    private LocalDate reportTime;
+
+    @ApiModelProperty("是否已报到(1:是 0:否)")
+    private Integer isReport;
 }

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

@@ -44,4 +44,7 @@ public class StudentReportRecordPageVo {
     @ApiModelProperty("是否已报到(1:是 0:否)")
     private Integer isReport;
 
+    @ApiModelProperty("毕业学校")
+    private String graduatedUniversity;
+
 }

+ 3 - 0
src/main/resources/mapper/base/WhitelistManagement.xml

@@ -32,6 +32,9 @@
         <if test="dto.classId != null">
             AND t3.id = #{dto.classId}
         </if>
+        <if test="dto.isTemporary != null">
+            AND t.is_temporary = #{dto.isTemporary}
+        </if>
     </select>
 
     <select id="getName" resultType="java.lang.String">

+ 177 - 1
src/main/resources/mapper/student/BaseNewStudentMapper.xml

@@ -6,7 +6,7 @@
     <select id="getPage" parameterType="com.xjrsoft.module.student.dto.BaseNewStudentPageDto" 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,t1.source,t5.name as source_cn,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,t11.name AS class_name,t12.name AS teacher_name FROM base_new_student t1
+        t8.name as second_ambition,t1.is_adjust,t1.status,ifnull(t11.name,t1.delete_reason) AS class_name,t12.name AS teacher_name FROM base_new_student t1
         LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
         LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
         LEFT JOIN xjr_dictionary_detail t5 ON t1.source = t5.code AND t5.item_id = 2023000000000000028
@@ -74,6 +74,182 @@
             </if>
         </if>
     </select>
+    <select id="getReportPage" parameterType="com.xjrsoft.module.student.dto.BaseNewStudentPageDto" 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.family_mobile,
+        t1.score,t1.graduate_class,t1.source,t5.name as source_cn,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,ifnull(t11.name,t1.delete_reason) AS class_name,t12.name AS teacher_name ,t13.report_time,
+        t9.id as user_id,(select count(*) from student_report_record where user_id = t9.id
+                                                                       and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) as is_report FROM base_new_student t1
+        LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
+        LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
+        LEFT JOIN xjr_dictionary_detail t5 ON t1.source = t5.code AND t5.item_id = 2023000000000000028
+        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
+        LEFT JOIN xjr_user t9 ON t1.credential_number = t9.credential_number AND t9.delete_mark = 0
+        LEFT JOIN base_student_school_roll t10 ON t9.id = t10.user_id AND t10.delete_mark = 0
+        LEFT JOIN base_class t11 ON t10.class_id = t11.id
+        LEFT JOIN xjr_user t12 ON t11.teacher_id = t12.id
+        LEFT JOIN student_report_record t13 ON t9.id = t13.user_id
+        and t13.base_semester_id = #{dto.baseSemesterId} and t13.delete_mark = 0
+        WHERE t1.delete_mark = 0 and (t1.delete_reason is null or t1.delete_reason = '')
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            and t1.credential_number like concat('%', #{dto.credentialNumber}, '%')
+        </if>
+        <if test="dto.graduateSchool != null and dto.graduateSchool != ''">
+            and t1.graduate_school like concat('%', #{dto.graduateSchool}, '%')
+        </if>
+        <if test="dto.isImportScore != null">
+            <if test="dto.isImportScore == 1">
+                and t1.score is not null
+            </if>
+            <if test="dto.isImportScore == 0">
+                and t1.score is null
+            </if>
+        </if>
+        <if test="dto.firstAmbition != null and dto.firstAmbition != ''">
+            and t1.first_ambition = #{dto.firstAmbition}
+        </if>
+        <if test="dto.secondAmbition != null and dto.secondAmbition != ''">
+            and t1.second_ambition = #{dto.secondAmbition}
+        </if>
+
+        <if test="dto.startDate != null and dto.endDate != null">
+            AND t13.report_time between #{dto.startDate} and #{dto.endDate}
+        </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            AND t1.gender = #{dto.gender}
+        </if>
+        <if test="dto.status != null">
+            AND t1.status = #{dto.status}
+        </if>
+        <if test="dto.isAdjust != null">
+            AND t1.is_adjust = #{dto.isAdjust}
+        </if>
+        <if test="dto.teacherId != null">
+            AND t11.teacher_id = #{dto.teacherId}
+        </if>
+        <if test="dto.classId != null">
+            AND t11.id = #{dto.classId}
+        </if>
+        <if test="dto.isReport != null">
+            AND (select count(*) from student_report_record where user_id = t9.id and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) = #{dto.isReport}
+        </if>
+        <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
+            AND t10.stduy_status = #{dto.stduyStatus}
+        </if>
+        <if test="dto.source != null and dto.source != ''">
+            AND t1.source = #{dto.source}
+        </if>
+        <if test="dto.enrollmentPlanId != null">
+            AND t1.enrollment_plan_id = #{dto.enrollmentPlanId}
+        </if>
+        <if test="dto.treeId != null and dto.treeType != null">
+            <if test="dto.treeType == 1">
+                AND t4.grade_id = #{dto.treeId}
+            </if>
+            <if test="dto.treeType == 2">
+                AND t4.enroll_type = #{dto.treeId}
+            </if>
+        </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 == 'ascend'">
+                order by t1.score asc
+            </if>
+        </if>
+    </select>
+
+    <select id="getReportList" parameterType="com.xjrsoft.module.student.dto.BaseNewStudentPageDto" 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.family_mobile,
+        t1.score,t1.graduate_class,t1.source,t5.name as source_cn,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,ifnull(t11.name,t1.delete_reason) AS class_name,t12.name AS teacher_name ,t13.report_time,
+        t9.id as user_id,(select count(*) from student_report_record where user_id = t1.id and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) as is_report FROM base_new_student t1
+        LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
+        LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
+        LEFT JOIN xjr_dictionary_detail t5 ON t1.source = t5.code AND t5.item_id = 2023000000000000028
+        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
+        LEFT JOIN xjr_user t9 ON t1.credential_number = t9.credential_number AND t9.delete_mark = 0
+        LEFT JOIN base_student_school_roll t10 ON t9.id = t10.user_id AND t10.delete_mark = 0
+        LEFT JOIN base_class t11 ON t10.class_id = t11.id
+        LEFT JOIN xjr_user t12 ON t11.teacher_id = t12.id
+        LEFT JOIN student_report_record t13 ON t9.id = t13.user_id and t13.base_semester_id = #{dto.baseSemesterId} and t13.delete_mark = 0
+        WHERE t1.delete_mark = 0
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            and t1.credential_number like concat('%', #{dto.credentialNumber}, '%')
+        </if>
+        <if test="dto.graduateSchool != null and dto.graduateSchool != ''">
+            and t1.graduate_school like concat('%', #{dto.graduateSchool}, '%')
+        </if>
+        <if test="dto.isImportScore != null">
+            <if test="dto.isImportScore == 1">
+                and t1.score is not null
+            </if>
+            <if test="dto.isImportScore == 0">
+                and t1.score is null
+            </if>
+        </if>
+        <if test="dto.firstAmbition != null and dto.firstAmbition != ''">
+            and t1.first_ambition = #{dto.firstAmbition}
+        </if>
+        <if test="dto.secondAmbition != null and dto.secondAmbition != ''">
+            and t1.second_ambition = #{dto.secondAmbition}
+        </if>
+
+        <if test="dto.startDate != null and dto.endDate != null">
+            AND t13.report_time between #{dto.startDate} and #{dto.endDate}
+        </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            AND t1.gender = #{dto.gender}
+        </if>
+        <if test="dto.status != null">
+            AND t1.status = #{dto.status}
+        </if>
+        <if test="dto.isAdjust != null">
+            AND t1.is_adjust = #{dto.isAdjust}
+        </if>
+        <if test="dto.teacherId != null">
+            AND t11.teacher_id = #{dto.teacherId}
+        </if>
+        <if test="dto.classId != null">
+            AND t11.id = #{dto.classId}
+        </if>
+        <if test="dto.isReport != null">
+            AND (select count(*) from student_report_record where user_id = t1.id and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) = #{dto.isReport}
+        </if>
+        <if test="dto.stduyStatus != null">
+            AND t10.stduy_status = #{dto.stduyStatus}
+        </if>
+        <if test="dto.enrollmentPlanId != null">
+            AND t1.enrollment_plan_id = #{dto.enrollmentPlanId}
+        </if>
+        <if test="dto.treeId != null and dto.treeType != null">
+            <if test="dto.treeType == 1">
+                AND t4.grade_id = #{dto.treeId}
+            </if>
+            <if test="dto.treeType == 2">
+                AND t4.enroll_type = #{dto.treeId}
+            </if>
+        </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 == 'ascend'">
+                order by t1.score asc
+            </if>
+        </if>
+    </select>
     <select id="getEnrollmentPlanList" resultType="com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo">
         SELECT t1.enroll_type, t2.name AS enroll_type_cn,t3.name AS grade_name, t3.id as grade_id,t1.id FROM enrollment_plan t1
         LEFT JOIN xjr_dictionary_detail t2 ON t1.enroll_type = t2.code AND t2.item_id = 2023000000000000027

+ 9 - 6
src/main/resources/mapper/student/StudentReportRecordMapper.xml

@@ -33,19 +33,22 @@
         ) AS arrived_count
         FROM base_class t1
         INNER JOIN xjr_user t2 ON t1.teacher_id = t2.id
-        WHERE t1.delete_mark = 0
+        WHERE t1.delete_mark = 0 and t1.grade_id = #{dto.gradeId}
         AND t1.teacher_id = #{dto.teacherId}
     </select>
-    <select id="getClassStatistics" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto"
+    <select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordPageDto"
             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,
-        (select count(*) from student_report_record where user_id = t1.id and base_semester_id = #{dto.baseSemesterId}) as is_report FROM xjr_user t1
+        SELECT t1.id as user_id,t1.name,t1.credential_number,t1.mobile,t4.name AS stduy_status_cn,t5.telephone AS parent_mobile,t2.graduated_university,
+        (select count(*) from student_report_record where user_id = t1.id and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) as is_report 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
         WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
-        AND t2.class_id = #{dto.teacherId}
+        AND t3.teacher_id = #{dto.teacherId}
+        <if test="dto.keyword != null and dto.keyword != ''">
+            and t1.name like concat('%', #{dto.keyword},'%')
+        </if>
         ORDER BY t1.create_date DESC, t2.create_date DESC,t3.create_date DESC
     </select>
     <select id="getStatisticsDataList" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto"
@@ -54,7 +57,7 @@
             INNER JOIN xjr_user t2 ON t1.credential_number = t2.credential_number
             INNER JOIN enrollment_plan t3 ON t3.id = t1.enrollment_plan_id
             INNER JOIN base_student_school_roll t4 ON t4.user_id = t2.id
-            LEFT JOIN student_report_record t5 ON t2.id = t5.user_id
+            LEFT JOIN student_report_record t5 ON t2.id = t5.user_id and t5.delete_mark = 0
             WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
             AND t3.grade_id = #{dto.gradeId} AND t3.enroll_type = #{dto.enrollType}
     </select>

+ 1 - 1
src/test/java/com/xjrsoft/module/oa/service/impl/NewsServiceImplTest.java

@@ -51,7 +51,7 @@ class NewsServiceImplTest {
         JSONObject data = new JSONObject();
 
         JSONObject data1 = new JSONObject();
-        data1.put("value", "关于调整2024年秋季学期开学及召开教职工大会的通知");
+        data1.put("value", "关于调整2024年秋季学期开学及召开教");
         data.put("thing23", data1);
 
         JSONObject data2 = new JSONObject();