Kaynağa Gözat

Merge branch 'pre'

dzx 1 yıl önce
ebeveyn
işleme
676383228a
21 değiştirilmiş dosya ile 354 ekleme ve 70 silme
  1. 12 0
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java
  2. 14 1
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java
  3. 13 0
      src/main/java/com/xjrsoft/module/base/vo/BaseClassPageVo.java
  4. 24 20
      src/main/java/com/xjrsoft/module/concat/controller/ConcatController.java
  5. 3 0
      src/main/java/com/xjrsoft/module/courseTable/entity/CourseTable.java
  6. 4 0
      src/main/java/com/xjrsoft/module/courseTable/mapper/CourseTableMapper.java
  7. 4 0
      src/main/java/com/xjrsoft/module/courseTable/service/ICourseTableService.java
  8. 14 1
      src/main/java/com/xjrsoft/module/courseTable/service/impl/CourseTableServiceImpl.java
  9. 25 46
      src/main/java/com/xjrsoft/module/oa/controller/NewsController.java
  10. 26 0
      src/main/java/com/xjrsoft/module/organization/dto/DownloadFileDto.java
  11. 48 0
      src/main/java/com/xjrsoft/module/schedule/controller/ScheduleController.java
  12. 23 0
      src/main/java/com/xjrsoft/module/schedule/dto/ClassOptionDto.java
  13. 24 0
      src/main/java/com/xjrsoft/module/schedule/dto/ScheduleWeekDto.java
  14. 19 0
      src/main/java/com/xjrsoft/module/schedule/vo/ClassOptionVo.java
  15. 3 0
      src/main/java/com/xjrsoft/module/schedule/vo/CourseDetailVo.java
  16. 8 0
      src/main/java/com/xjrsoft/module/schedule/vo/CourseTableVo.java
  17. 24 0
      src/main/java/com/xjrsoft/module/schedule/vo/ScheduleWeekVo.java
  18. 3 0
      src/main/java/com/xjrsoft/module/student/dto/StudentReportRecordPageDto.java
  19. 31 0
      src/main/java/com/xjrsoft/module/system/controller/FileController.java
  20. 26 1
      src/main/resources/mapper/base/BaseClass.xml
  21. 6 1
      src/main/resources/mapper/courseTable/CourseTable.xml

+ 12 - 0
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java

@@ -3,12 +3,15 @@ package com.xjrsoft.module.banding.service.impl;
 import cn.dev33.satoken.secure.BCrypt;
 import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.ArchivesStatusEnum;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.enums.RoleEnum;
 import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.banding.dto.BandingTaskClassStudentPageDto;
 import com.xjrsoft.module.banding.dto.ChangeClassDto;
@@ -53,6 +56,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
 /**
@@ -77,6 +81,7 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
     private final IBaseStudentService studentService;
     private final IBaseStudentFamilyService familyService;
     private final BaseMajorSetMapper majorSetMapper;
+    private final RedisUtil redisUtil;
     @Override
     public Boolean add(BandingTaskClassStudent bandingTaskClass) {
         bandingTaskClass.setCreateDate(new Date());
@@ -278,6 +283,13 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
                     familyService.save(studentFamily);
                 }
             }
+            CompletableFuture.runAsync(() -> {
+                List<User> userList = userService.list();
+                redisUtil.set(GlobalConstant.USER_CACHE_KEY, userList);
+
+                List<UserRoleRelation> userRoleRelationList = roleRelationService.list(Wrappers.lambdaQuery(UserRoleRelation.class));
+                redisUtil.set(GlobalConstant.USER_ROLE_RELATION_CACHE_KEY, userRoleRelationList);
+            });
         }
         return true;
     }

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

@@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.ArchivesStatusEnum;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.enums.GenderDictionaryEnum;
 import com.xjrsoft.common.enums.RoleEnum;
 import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.banding.dto.AutomaticBandingTaskDto;
@@ -41,6 +43,7 @@ import com.xjrsoft.module.base.mapper.BaseMajorSetMapper;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseGradeService;
 import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.entity.UserDeptRelation;
 import com.xjrsoft.module.organization.entity.UserRoleRelation;
 import com.xjrsoft.module.organization.service.IUserRoleRelationService;
 import com.xjrsoft.module.organization.service.IUserService;
@@ -72,6 +75,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Random;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
 /**
@@ -101,7 +105,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
     private final IBaseStudentFamilyService familyService;
     private final IBaseGradeService gradeService;
     private final BaseMajorSetMapper majorSetMapper;
-
+    private final RedisUtil redisUtil;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -687,6 +691,15 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
         bandingTask.setStatus(1);
         bandingTask.setModifyDate(new Date());
         Boolean isSuccess = this.update(bandingTask);
+
+        CompletableFuture.runAsync(() -> {
+            List<User> userList = userService.list();
+            redisUtil.set(GlobalConstant.USER_CACHE_KEY, userList);
+
+            List<UserRoleRelation> userRoleRelationList = roleRelationService.list(Wrappers.lambdaQuery(UserRoleRelation.class));
+            redisUtil.set(GlobalConstant.USER_ROLE_RELATION_CACHE_KEY, userRoleRelationList);
+        });
+
         return isSuccess;
     }
 

+ 13 - 0
src/main/java/com/xjrsoft/module/base/vo/BaseClassPageVo.java

@@ -37,9 +37,22 @@ public class BaseClassPageVo {
     @ApiModelProperty("男生人数")
     private Integer maleCout;
 
+    @ApiModelProperty("男生住校数量")
+    private Integer maleStayCount;
+
+    @ApiModelProperty("男生走读数量")
+    private Integer maleNotStayCount;
+
+
     @ApiModelProperty("女生人数")
     private Integer femaleCount;
 
+    @ApiModelProperty("女生住校数量")
+    private Integer femaleStayCount;
+
+    @ApiModelProperty("女生走读数量")
+    private Integer femaleNotStayCount;
+
     @ApiModelProperty("住校数量")
     private Integer stayCount;
 

+ 24 - 20
src/main/java/com/xjrsoft/module/concat/controller/ConcatController.java

@@ -3,16 +3,12 @@ package com.xjrsoft.module.concat.controller;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.github.yulichang.wrapper.MPJLambdaWrapper;
-import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.model.result.RT;
-import com.xjrsoft.common.utils.TreeUtil;
+import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
 import com.xjrsoft.module.concat.dto.ConcatTreeDto;
-import com.xjrsoft.module.concat.service.IXjrUserService;
 import com.xjrsoft.module.concat.vo.ConcatTreeVo;
 import com.xjrsoft.module.organization.entity.Department;
 import com.xjrsoft.module.organization.service.IDepartmentService;
-import com.xjrsoft.module.teacher.entity.XjrUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -22,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Objects;
+import java.util.Map;
 
 /**
 * @title: 通讯录
@@ -35,7 +31,6 @@ import java.util.Objects;
 @Api(value = "/concat"  + "/concat",tags = "通讯录")
 @AllArgsConstructor
 public class ConcatController {
-    private final IXjrUserService xjrUserService;
     private final IDepartmentService departmentService;
 
 
@@ -61,21 +56,30 @@ public class ConcatController {
                 }}
             );
         }
-        MPJLambdaWrapper<XjrUser> wrapper = new MPJLambdaWrapper<>();
-        wrapper.leftJoin("xjr_user_dept_relation t2 on t.id = t2.user_id")
-                .like("t5.hierarchy", parentId)
-                .leftJoin("xjr_user_role_relation t3 ON t.id = t3.user_id")
-                .leftJoin("xjr_role t4 ON t4.id = t3.role_id")
-                .leftJoin("xjr_department t5 ON t2.dept_id = t5.id")
-                .eq("t4.id", 2)
-                .eq(StrUtil.isNotEmpty(dto.getName()), XjrUser::getName, dto.getName())
-                .eq(StrUtil.isNotEmpty(dto.getMobile()), XjrUser::getMobile, dto.getMobile());
-        List<XjrUser> userList = xjrUserService.selectJoinList(XjrUser.class, wrapper);
-        for (XjrUser user : userList) {
+        String sql = "SELECT t1.name, t1.mobile,t2.dept_id FROM xjr_user t1" +
+                " LEFT JOIN xjr_user_dept_relation t2 ON t1.id = t2.user_id" +
+                " LEFT JOIN xjr_user_role_relation t3 ON t1.id = t3.user_id" +
+                " LEFT JOIN xjr_department t5 ON t2.dept_id = t5.id" +
+                " WHERE t1.delete_mark = 0" +
+                " AND t3.role_id = 2";
+        if(dto.getDeptId() != null){
+            sql += " AND t5.hierarchy LIKE '%" + dto.getDeptId() + "%'";
+        }else if(!StrUtil.isNotEmpty(dto.getName())){
+            sql += " AND t5.id = " + parentId;
+        }
+        if(StrUtil.isNotEmpty(dto.getName())){
+            concatList = new ArrayList<>();
+            sql += "AND (t1.mobile = '%" + dto.getName() + "%' OR t1.name LIKE '%" + dto.getName() + "%')";
+        }
+        List<Map<String, Object>> userList = SqlRunnerAdapter.db().selectList(sql);
+        if(StrUtil.isNotEmpty(dto.getName())){
+            concatList = new ArrayList<>();
+        }
+        for (Map<String, Object> user : userList) {
             concatList.add(
                     new ConcatTreeVo(){{
-                        setName(user.getName());
-                        setMobile(user.getMobile());
+                        setName(user.get("name").toString());
+                        setMobile(user.get("mobile").toString());
                         setType(2);
                     }}
             );

+ 3 - 0
src/main/java/com/xjrsoft/module/courseTable/entity/CourseTable.java

@@ -92,4 +92,7 @@ public class CourseTable implements Serializable {
     @ApiModelProperty("上课日期")
     private LocalDate scheduleDate;
 
+    @ApiModelProperty("调课顶课(顶课:course_substitute 调课:course_exchange)")
+    private String adjustType;
+
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/courseTable/mapper/CourseTableMapper.java

@@ -1,7 +1,9 @@
 package com.xjrsoft.module.courseTable.mapper;
 
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.schedule.dto.ClassOptionDto;
 import com.xjrsoft.module.courseTable.entity.CourseTable;
+import com.xjrsoft.module.schedule.vo.ClassOptionVo;
 import com.xjrsoft.module.schedule.dto.CourseTableAdjustDto;
 import com.xjrsoft.module.schedule.dto.CourseTableDto;
 import com.xjrsoft.module.schedule.vo.CourseDetailVo;
@@ -24,4 +26,6 @@ public interface CourseTableMapper extends MPJBaseMapper<CourseTable> {
     List<CourseDetailVo> getList(@Param("dto") CourseTableDto dto);
 
     List<CourseListVo> getAdjustList(@Param("dto") CourseTableAdjustDto dto);
+
+    List<ClassOptionVo> getClassListByTeacherId(@Param("dto") ClassOptionDto dto);
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/courseTable/service/ICourseTableService.java

@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.xjrsoft.module.courseTable.dto.ClassListDto;
 import com.xjrsoft.module.courseTable.entity.CourseTable;
 import com.xjrsoft.module.courseTable.vo.ClassListVo;
+import com.xjrsoft.module.schedule.dto.ClassOptionDto;
 import com.xjrsoft.module.schedule.dto.CourseTableDto;
 import com.xjrsoft.module.schedule.dto.ScheduleWeekExportQueryDto;
 import com.xjrsoft.module.schedule.entity.WfCourseAdjust;
+import com.xjrsoft.module.schedule.vo.ClassOptionVo;
 import com.xjrsoft.module.schedule.vo.CourseListVo;
 import com.xjrsoft.module.schedule.vo.CourseTableVo;
 
@@ -43,4 +45,6 @@ public interface ICourseTableService extends IService<CourseTable> {
     Boolean adjustCourse(WfCourseAdjust courseAdjust) throws Exception;
 
     ByteArrayOutputStream listScheduleWeekExportQuery(ScheduleWeekExportQueryDto dto);
+
+    List<ClassOptionVo> getClassListByTeacherId(ClassOptionDto dto);
 }

+ 14 - 1
src/main/java/com/xjrsoft/module/courseTable/service/impl/CourseTableServiceImpl.java

@@ -42,12 +42,14 @@ import com.xjrsoft.module.courseTable.mapper.ClassTimeMapper;
 import com.xjrsoft.module.courseTable.mapper.CourseTableMapper;
 import com.xjrsoft.module.courseTable.service.ICourseTableService;
 import com.xjrsoft.module.courseTable.vo.ClassListVo;
+import com.xjrsoft.module.schedule.dto.ClassOptionDto;
 import com.xjrsoft.module.schedule.dto.CourseTableAdjustDto;
 import com.xjrsoft.module.schedule.dto.CourseTableDto;
 import com.xjrsoft.module.schedule.dto.ScheduleWeekExportQueryDto;
 import com.xjrsoft.module.schedule.entity.WfCourseAdjust;
 import com.xjrsoft.module.schedule.mapper.CourseTableBakMapper;
 import com.xjrsoft.module.schedule.util.ScheduleUtil;
+import com.xjrsoft.module.schedule.vo.ClassOptionVo;
 import com.xjrsoft.module.schedule.vo.CourseDetailVo;
 import com.xjrsoft.module.schedule.vo.CourseListVo;
 import com.xjrsoft.module.schedule.vo.CourseTableVo;
@@ -224,6 +226,8 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
                     if (now.isAfter(startDate) && now.isBefore(endDate)) {
                         tableVo.setWeek("第" + (i + 1) + "周");
                     }
+                    tableVo.setStartDate(startDate.toLocalDate());
+                    tableVo.setEndDate(endDate.toLocalDate());
                 }
             } else {
                 LocalDateTime startDate = startDateTime.plusDays((dto.getWeek() - 1) * 6).withHour(0).withMinute(0).withSecond(0).withNano(0);
@@ -231,6 +235,8 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
                 dto.setStartDate(startDate);
                 dto.setEndDate(endDate);
                 tableVo.setWeek("第" + dto.getWeek() + "周");
+                tableVo.setStartDate(startDate.toLocalDate());
+                tableVo.setEndDate(endDate.toLocalDate());
             }
 
         }
@@ -351,6 +357,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
             courseTable.setWeek(swapCourseTableBak.getWeek());
             courseTable.setWeeks(swapCourseTableBak.getWeeks());
             courseTable.setWeeksCn(swapCourseTableBak.getWeeksCn());
+            courseTable.setAdjustType(courseAdjust.getAdjustType());
             courseTableMapper.updateById(courseTable);
 
             swapCourseTable.setScheduleDate(courseTableBak.getScheduleDate());
@@ -359,13 +366,14 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
             swapCourseTable.setWeek(courseTableBak.getWeek());
             swapCourseTable.setWeeks(courseTableBak.getWeeks());
             swapCourseTable.setWeeksCn(courseTableBak.getWeeksCn());
+            swapCourseTable.setAdjustType(courseAdjust.getAdjustType());
             courseTableMapper.updateById(swapCourseTable);
             //提交调课接口
             sendExchange(courseTableBak, swapCourseTableBak, courseAdjust);
 
         } else if (CourseAdjustTypeEnum.courseSubstitute.getCode().equals(courseAdjust.getAdjustType())) {
             CourseTable courseTable = courseTableMapper.selectById(courseAdjust.getCourseId());
-
+            courseTable.setAdjustType(courseAdjust.getAdjustType());
             courseTable.setTeacherId(courseAdjust.getExchangeTeacherId());
             courseTableMapper.updateById(courseTable);
             //提交顶课接口
@@ -391,6 +399,11 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
         return outputStream;
     }
 
+    @Override
+    public List<ClassOptionVo> getClassListByTeacherId(ClassOptionDto dto) {
+        return this.baseMapper.getClassListByTeacherId(dto);
+    }
+
     private CourseTableVo getCourseTableVo(ScheduleWeekExportQueryDto dto) {
         CourseTableDto courseTableDto = new CourseTableDto();
         BeanUtils.copyProperties(dto, courseTableDto);

+ 25 - 46
src/main/java/com/xjrsoft/module/oa/controller/NewsController.java

@@ -350,13 +350,14 @@ public class NewsController {
 
             //新闻
             if(typeId == 1){
-                Long notReadCount = newsService.count(Wrappers.<News>query().lambda()
-                        .eq(News::getTypeId, typeId)
-                        .eq(News::getStatus, 2)
-                        .gt(News::getSendEndDate, LocalDateTime.now())
-                        .eq(News::getWfStatus, 1)
-                        .notInSql(News::getId, "select distinct news_id from xjr_oa_news_relation where read_mark = 1 and user_id = " + StpUtil.getLoginIdAsLong()));
-
+                Long notReadCount = newsService.count(
+                        MPJWrappers.<News>lambdaJoin()
+                                .leftJoin(NewsRelation.class, NewsRelation::getNewsId, News::getId)
+                                .eq(News::getStatus, 2)
+                                .eq(NewsRelation::getUserId, StpUtil.getLoginIdAsLong())
+                                .eq(News::getTypeId, typeId)
+                                .eq(NewsRelation::getReadMark, 0)
+                );
                 newsCountTypeVo.setTypeId(typeId);
                 newsCountTypeVo.setTotal(notReadCount);
 
@@ -373,32 +374,25 @@ public class NewsController {
             //公告
             if(typeId == 2){
                 //公告发给全体的
-                Long notReadCountProclamationToAll = newsService.count(Wrappers.<News>query().lambda()
-                        .eq(News::getTypeId, 2)
-                        .eq(News::getStatus, 2)
-                        .eq(News::getSendRange, 1)
-                        .notInSql(News::getId, "select distinct news_id from xjr_oa_news_relation where read_mark = 1 and user_id = " + StpUtil.getLoginIdAsLong())
-                        .and(wp -> wp.gt(News::getSendEndDate, LocalDateTime.now())
-                                .or()
-                                .isNull(News::getSendEndDate)));
+                Long notReadCountProclamation = newsService.count(
+                        MPJWrappers.<News>lambdaJoin()
+                                .leftJoin(NewsRelation.class, NewsRelation::getNewsId, News::getId)
+                                .eq(News::getStatus, 2)
+                                .eq(NewsRelation::getUserId, StpUtil.getLoginIdAsLong())
+                                .eq(News::getTypeId, typeId)
+                                .eq(NewsRelation::getReadMark, 0)
+                );
 
                 News newsAll = newsService.getOne(Wrappers.<News>query().lambda()
                         .eq(News::getTypeId, 2)
                         .eq(News::getStatus, 2)
                         .eq(News::getSendRange, 1)
-                        //.notInSql(News::getId, "select distinct news_id from xjr_oa_news_relation where read_mark = 1 and user_id = " + StpUtil.getLoginIdAsLong())
                         .and(wp -> wp.gt(News::getSendEndDate, LocalDateTime.now())
                                 .or()
                                 .isNull(News::getSendEndDate))
                         .orderByDesc(News::getReleaseTime)
                         .last("limit 1"));
 
-                //公告发给非全体的
-                Long notReadCountProclamation = newsRelationService.count(Wrappers.<NewsRelation>query().lambda()
-                        .eq(NewsRelation::getReadMark, 0)
-                        .eq(NewsRelation::getUserId, StpUtil.getLoginIdAsLong())
-                        .inSql(NewsRelation::getNewsId, "select id from xjr_oa_news where delete_mark = 0 and type_id = 2 and (send_range = 2 or send_range = 3) AND (send_end_date > '" + LocalDateTime.now() + "' OR send_end_date IS NULL)"));
-
                 MPJLambdaWrapper<News> queryNews = new MPJLambdaWrapper<>();
                 queryNews
                         .leftJoin(NewsRelation.class, NewsRelation::getNewsId, News::getId)
@@ -432,7 +426,7 @@ public class NewsController {
                 }
 
                 newsCountTypeVo.setTypeId(typeId);
-                newsCountTypeVo.setTotal(notReadCountProclamationToAll + notReadCountProclamation);
+                newsCountTypeVo.setTotal(notReadCountProclamation);
             }
 
             if (news != null) {
@@ -465,28 +459,13 @@ public class NewsController {
     @GetMapping("/unread-count")
     @ApiOperation(value = "获取登录人未读消息数量")
     public RT<Long> unreadCount() {
-        Long notReadCountNews = newsService.count(Wrappers.<News>query().lambda()
-                .eq(News::getTypeId, 1)
-                .eq(News::getStatus, 2)
-                .gt(News::getSendEndDate, LocalDateTime.now())
-                .eq(News::getWfStatus, 1)
-                .notInSql(News::getId, "select distinct news_id from xjr_oa_news_relation where read_mark = 1 and user_id = " + StpUtil.getLoginIdAsLong()));
-
-        //公告发给全体的
-        Long notReadCountProclamationToAll = newsService.count(Wrappers.<News>query().lambda()
-                .eq(News::getTypeId, 2)
-                .eq(News::getStatus, 2)
-                .eq(News::getSendRange, 1)
-                .notInSql(News::getId, "select distinct news_id from xjr_oa_news_relation where read_mark = 1 and user_id = " + StpUtil.getLoginIdAsLong())
-                .and(wp -> wp.gt(News::getSendEndDate, LocalDateTime.now())
-                        .or()
-                        .isNull(News::getSendEndDate)));
-
-        //公告发给非全体的
-        Long notReadCountProclamation = newsRelationService.count(Wrappers.<NewsRelation>query().lambda()
-                .eq(NewsRelation::getReadMark, 0)
-                .eq(NewsRelation::getUserId, StpUtil.getLoginIdAsLong())
-                .inSql(NewsRelation::getNewsId, "select id from xjr_oa_news where delete_mark = 0 and type_id = 2 and status = 2 and (send_range = 2 or send_range = 3) AND (send_end_date > '" + LocalDateTime.now() + "' OR send_end_date IS NULL)"));
+        Long notReadCountNews = newsService.count(
+            MPJWrappers.<News>lambdaJoin()
+            .leftJoin(NewsRelation.class, NewsRelation::getNewsId, News::getId)
+            .eq(News::getStatus, 2)
+                    .eq(NewsRelation::getUserId, StpUtil.getLoginIdAsLong())
+            .eq(NewsRelation::getReadMark, 0)
+        );
 
         //公告发给非全体的
         long systemUpdateMessageCount = systemUpdateMessageService.count(
@@ -498,7 +477,7 @@ public class NewsController {
                         .eq(SystemUpdateMessageNotice::getStatus, 0)
         );
 
-        Long notReadCount = notReadCountNews + notReadCountProclamationToAll + notReadCountProclamation + systemUpdateMessageCount;
+        Long notReadCount = notReadCountNews + systemUpdateMessageCount;
         return RT.ok(notReadCount);
     }
 

+ 26 - 0
src/main/java/com/xjrsoft/module/organization/dto/DownloadFileDto.java

@@ -0,0 +1,26 @@
+package com.xjrsoft.module.organization.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @title: AddUserDto
+ * @Author tzx
+ * @Date: 2022/4/4 17:11
+ * @Version 1.0
+ */
+@Data
+public class DownloadFileDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    @ApiModelProperty("文件路径")
+    private String fileUrl;
+
+    @ApiModelProperty("文件名字")
+    private String fileName;
+
+}

+ 48 - 0
src/main/java/com/xjrsoft/module/schedule/controller/ScheduleController.java

@@ -18,15 +18,19 @@ import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.service.IBaseSemesterService;
 import com.xjrsoft.module.courseTable.entity.CourseTable;
 import com.xjrsoft.module.courseTable.service.ICourseTableService;
+import com.xjrsoft.module.schedule.dto.ClassOptionDto;
 import com.xjrsoft.module.schedule.dto.CourseTableAdjustDto;
 import com.xjrsoft.module.schedule.dto.CourseTableDto;
 import com.xjrsoft.module.schedule.dto.CourseTablePreCheckDto;
+import com.xjrsoft.module.schedule.dto.ScheduleWeekDto;
 import com.xjrsoft.module.schedule.dto.ScheduleWeekExportQueryDto;
 import com.xjrsoft.module.schedule.entity.CourseReceiveMsg;
 import com.xjrsoft.module.schedule.service.ICourseReceiveMsgService;
 import com.xjrsoft.module.schedule.util.ScheduleUtil;
+import com.xjrsoft.module.schedule.vo.ClassOptionVo;
 import com.xjrsoft.module.schedule.vo.CourseListVo;
 import com.xjrsoft.module.schedule.vo.CourseTableVo;
+import com.xjrsoft.module.schedule.vo.ScheduleWeekVo;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
 import com.xjrsoft.module.teacher.entity.BaseTeacher;
@@ -51,6 +55,7 @@ import java.time.Duration;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -308,4 +313,47 @@ public class ScheduleController {
             return RT.error(e.getMessage());
         }
     }
+
+    @GetMapping(value = "/week-list")
+    @ApiOperation(value="获取周次列表")
+    @SaCheckPermission("room:detail")
+    public RT<List<ScheduleWeekVo>> weekList(@Valid ScheduleWeekDto dto){
+        List<BaseSemester> semesterList = semesterService.list(new QueryWrapper<BaseSemester>().lambda().orderByDesc(BaseSemester::getStartDate));
+        BaseSemester baseSemester = semesterList.get(0);
+        if(dto.getSemesterId() != null){
+            baseSemester = semesterService.getById(dto.getSemesterId());
+        }
+        LocalDateTime startDateTime = LocalDateTime.ofInstant(baseSemester.getStartDate().toInstant(), ZoneId.systemDefault());
+        LocalDateTime endDateTime = LocalDateTime.ofInstant(baseSemester.getEndDate().toInstant(), ZoneId.systemDefault());
+        Duration between = Duration.between(startDateTime, endDateTime);
+        long days = between.toDays();
+        int weeks = (int) Math.ceil((double) days / 7);
+        List<ScheduleWeekVo> result = new ArrayList<>();
+        for (int i = 0; i < weeks; i++) {
+            LocalDateTime startDate = startDateTime.plusDays(i * 6).withHour(0).withMinute(0).withSecond(0).withNano(0);
+            LocalDateTime endDate = startDateTime.plusDays((i + 1) * 6).withHour(23).withMinute(59).withSecond(59).withNano(9999);
+            int week = i + 1;
+            result.add(
+                    new ScheduleWeekVo(){{
+                        setWeek(week);
+                        setWeekCn("第" + week + "周");
+                        setStartDate(startDate.toLocalDate());
+                        setEndDate(endDate.toLocalDate());
+                    }}
+            );
+        }
+
+        return RT.ok(result);
+    }
+
+    @GetMapping(value = "/class-list")
+    @ApiOperation(value="根据课表获取教师所教班级")
+    @SaCheckPermission("room:detail")
+    public RT<List<ClassOptionVo>> classList(@Valid ClassOptionDto dto){
+        if(dto.getUserId() == null){
+            dto.setUserId(StpUtil.getLoginIdAsLong());
+        }
+        List<ClassOptionVo> result = courseTableService.getClassListByTeacherId(dto);
+        return RT.ok(result);
+    }
 }

+ 23 - 0
src/main/java/com/xjrsoft/module/schedule/dto/ClassOptionDto.java

@@ -0,0 +1,23 @@
+package com.xjrsoft.module.schedule.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+* @title: 寝室
+* @Author dzx
+* @Date: 2023-12-27
+* @Version 1.0
+*/
+@Data
+public class ClassOptionDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("教师id")
+    private Long userId;
+
+}

+ 24 - 0
src/main/java/com/xjrsoft/module/schedule/dto/ScheduleWeekDto.java

@@ -0,0 +1,24 @@
+package com.xjrsoft.module.schedule.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+
+/**
+* @title: 寝室
+* @Author dzx
+* @Date: 2023-12-27
+* @Version 1.0
+*/
+@Data
+public class ScheduleWeekDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("学期管理")
+    private Long semesterId;
+
+}

+ 19 - 0
src/main/java/com/xjrsoft/module/schedule/vo/ClassOptionVo.java

@@ -0,0 +1,19 @@
+package com.xjrsoft.module.schedule.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author dzx
+ * @date 2024/1/29
+ */
+@Data
+public class ClassOptionVo {
+
+    @ApiModelProperty("班级id")
+    private Long id;
+
+    @ApiModelProperty("班级名称")
+    private String name;
+
+}

+ 3 - 0
src/main/java/com/xjrsoft/module/schedule/vo/CourseDetailVo.java

@@ -35,4 +35,7 @@ public class CourseDetailVo {
 
     @ApiModelProperty("上课日期")
     private LocalDate scheduleDate;
+
+    @ApiModelProperty("调课顶课(顶课:course_substitute 调课:course_exchange)")
+    private String adjustType;
 }

+ 8 - 0
src/main/java/com/xjrsoft/module/schedule/vo/CourseTableVo.java

@@ -4,6 +4,8 @@ import com.xjrsoft.module.courseTable.entity.ClassTime;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -33,4 +35,10 @@ public class CourseTableVo {
 
     @ApiModelProperty("第几周")
     private String week;
+
+    @ApiModelProperty("开始时间")
+    private LocalDate startDate;
+
+    @ApiModelProperty("结束时间")
+    private LocalDate endDate;
 }

+ 24 - 0
src/main/java/com/xjrsoft/module/schedule/vo/ScheduleWeekVo.java

@@ -0,0 +1,24 @@
+package com.xjrsoft.module.schedule.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDate;
+
+/**
+ * 周课表导出
+ */
+@Data
+public class ScheduleWeekVo {
+    @ApiModelProperty("周次(数字)")
+    private Integer week;
+
+    @ApiModelProperty("周次-中文(第几周)")
+    private String weekCn;
+
+    @ApiModelProperty("开始时间")
+    private LocalDate startDate;
+
+    @ApiModelProperty("结束时间")
+    private LocalDate endDate;
+}

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

@@ -24,4 +24,7 @@ public class StudentReportRecordPageDto extends PageInput {
 
     @ApiModelProperty("年级id")
     private Long gradeId;
+
+    @ApiModelProperty("班级id")
+    private Long classId;
 }

+ 31 - 0
src/main/java/com/xjrsoft/module/system/controller/FileController.java

@@ -19,6 +19,7 @@ import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.UploadUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.config.OSSConfig;
+import com.xjrsoft.module.organization.dto.DownloadFileDto;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.oss.factory.OssFactory;
 import com.xjrsoft.module.system.dto.FileDownloadDto;
@@ -45,6 +46,10 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
 import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.List;
@@ -243,4 +248,30 @@ public class FileController {
         }
         return RT.fileStream(resultBtyeAry_temp, encodedFileName + ".zip");
     }
+
+    @GetMapping("/downloadFile")
+    @ApiOperation(value = "按照上传文件名下载文件")
+    public ResponseEntity<byte[]> downloadFile(@Valid DownloadFileDto dto){
+        try {
+            URL url = new URL(dto.getFileUrl());
+            URLConnection conn = url.openConnection();
+            InputStream in = conn.getInputStream();
+            
+            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+            byte[] buffer = new byte[1024];
+            int bytesRead;
+            while ((bytesRead = in.read(buffer)) != -1) {
+                outputStream.write(buffer, 0, bytesRead);
+            }
+            byte[] byteArray = outputStream.toByteArray();
+            in.close();
+            outputStream.close();
+
+            String[] split = dto.getFileUrl().split("\\.");
+            String fileSuffiex = split[split.length - 1];
+            return RT.fileStream(byteArray, dto.getFileName() + "." + fileSuffiex);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
 }

+ 26 - 1
src/main/resources/mapper/base/BaseClass.xml

@@ -11,6 +11,18 @@
         WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
         AND a1.gender = 'SB10001' AND a2.class_id = t1.id
         AND a2.archives_status = 'FB2901') AS male_cout,
+
+        (SELECT COUNT(DISTINCT(a1.id)) FROM xjr_user a1
+        LEFT 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 AND a2.stduy_status = 'FB3002'
+        AND a2.archives_status = 'FB2901' AND a1.gender = 'SB10001') AS male_stay_count,
+        (SELECT COUNT(DISTINCT(a1.id)) FROM xjr_user a1
+        LEFT 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 AND a2.stduy_status = 'FB3001'
+        AND a2.archives_status = 'FB2901' AND a1.gender = 'SB10001') AS male_not_stay_count,
+
         (SELECT COUNT(DISTINCT(a1.id)) FROM xjr_user a1
         LEFT JOIN base_student_school_roll a2 ON a1.id = a2.user_id
         WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
@@ -20,12 +32,25 @@
         LEFT 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 AND a2.stduy_status = 'FB3002'
+        AND a2.archives_status = 'FB2901' AND a1.gender = 'SB10002') AS female_stay_count,
+        (SELECT COUNT(DISTINCT(a1.id)) FROM xjr_user a1
+        LEFT 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 AND a2.stduy_status = 'FB3001'
+        AND a2.archives_status = 'FB2901' AND a1.gender = 'SB10002') AS female_not_stay_count,
+        <!--
+        (SELECT COUNT(DISTINCT(a1.id)) FROM xjr_user a1
+        LEFT 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 AND a2.stduy_status = 'FB3002'
         AND a2.archives_status = 'FB2901') AS stay_count,
         (SELECT COUNT(DISTINCT(a1.id)) FROM xjr_user a1
         LEFT 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 AND a2.stduy_status = 'FB3001'
-        AND a2.archives_status = 'FB2901') AS not_stay_count,t7.name AS org_name,
+        AND a2.archives_status = 'FB2901') AS not_stay_count,
+        -->
+        t7.name AS org_name,
         t8.name as major_set_name,t1.major_set_id FROM base_class t1
         LEFT JOIN xjr_user t2 ON t1.teacher_id = t2.id
         LEFT JOIN xjr_dictionary_detail t3 ON t3.code = t1.enroll_type AND t3.item_id = 2023000000000000027

+ 6 - 1
src/main/resources/mapper/courseTable/CourseTable.xml

@@ -4,7 +4,7 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xjrsoft.module.courseTable.mapper.CourseTableMapper">
     <select id="getList" parameterType="com.xjrsoft.module.schedule.dto.CourseTableDto" resultType="com.xjrsoft.module.schedule.vo.CourseDetailVo">
-        SELECT t1.course_name, t2.name AS teacher_name,CONCAT(t4.name,t3.name) AS classroom_name,t1.weeks,t1.time_period,t1.time_number,t5.name as class_name,t1.schedule_date FROM course_table t1
+        SELECT t1.course_name, t2.name AS teacher_name,CONCAT(t4.name,t3.name) AS classroom_name,t1.weeks,t1.time_period,t1.time_number,t5.name as class_name,t1.schedule_date,t1.adjust_type FROM course_table t1
         LEFT JOIN xjr_user t2 ON t1.teacher_id = t2.id
         LEFT JOIN base_classroom t3 ON t1.site_id = t3.id
         LEFT JOIN base_office_build t4 ON t3.office_build_id = t4.id
@@ -58,4 +58,9 @@
             and t1.class_id = #{dto.classId}
         </if>
     </select>
+    <select id="getClassListByTeacherId" parameterType="com.xjrsoft.module.schedule.dto.ClassOptionDto" resultType="com.xjrsoft.module.schedule.vo.ClassOptionVo">
+        SELECT id,name FROM base_class WHERE delete_mark = 0 AND id IN (
+            SELECT DISTINCT class_id FROM course_table WHERE teacher_id = #{dto.userId}
+        )
+    </select>
 </mapper>