소스 검색

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

大数据与最优化研究所 2 달 전
부모
커밋
765cdedcc5

+ 23 - 1
src/main/java/com/xjrsoft/module/room/controller/RoomBedAdjustController.java

@@ -17,6 +17,7 @@ import com.xjrsoft.module.room.service.IRoomBedService;
 import com.xjrsoft.module.room.vo.AdjustBedClassPageVo;
 import com.xjrsoft.module.room.vo.AdjustBedStudentPageVo;
 import com.xjrsoft.module.room.vo.NoBedStudentPageVo;
+import com.xjrsoft.module.room.vo.TeacherRoomListVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -86,10 +87,11 @@ public class RoomBedAdjustController {
         List<BaseClass> classList = baseClassService.list(
                 new QueryWrapper<BaseClass>().lambda().eq(BaseClass::getTeacherId, teacherId)
         );
-        if(roleList.size() == 2 && roleList.contains("CLASSTE") && roleList.contains("TEACHER")){
+        if(roleList.size() == 2 && roleList.contains("CLASSTE") && roleList.contains("TEACHER") && dto.getRoomId() != null){
             if(classList != null && !classList.isEmpty()){
                 dto.setClassId(classList.get(0).getId());
             }
+            //dto.setIsTeacher(1);
         }
         List<AdjustBedStudentPageVo> result = roomBedService.getBedStudetInfo(dto);
         if (result == null) {
@@ -149,4 +151,24 @@ public class RoomBedAdjustController {
         Boolean result = roomBedService.adjustBedBatch(dto);
         return RT.ok(result);
     }
+
+    @GetMapping("/teacher-room-list")
+    @ApiOperation(value = "班主任查看寝室")
+    @SaCheckPermission("roomBedAdjust:edit")
+    public RT<List<TeacherRoomListVo>> roomList(@Valid AdjustBedPageDto dto){
+        List<String> roleList = StpUtil.getRoleList();
+
+        long teacherId = StpUtil.getLoginIdAsLong();
+        List<BaseClass> classList = baseClassService.list(
+                new QueryWrapper<BaseClass>().lambda().eq(BaseClass::getTeacherId, teacherId)
+        );
+        if(roleList.size() == 2 && roleList.contains("CLASSTE") && roleList.contains("TEACHER") && dto.getRoomId() != null){
+            if(classList != null && !classList.isEmpty()){
+                dto.setClassId(classList.get(0).getId());
+            }
+            //dto.setIsTeacher(1);
+        }
+        List<TeacherRoomListVo> teacherRoomList = roomBedService.getTeacherRoomList(dto);
+        return RT.ok(teacherRoomList);
+    }
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/room/dto/AdjustBedPageDto.java

@@ -40,5 +40,8 @@ public class AdjustBedPageDto extends PageInput {
     @ApiModelProperty("寝室id")
     public Long roomId;
 
+    @ApiModelProperty("是否是班主任(1:是,0:否)")
+    public Integer isTeacher;
+
 
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/room/mapper/RoomBedMapper.java

@@ -22,6 +22,7 @@ import com.xjrsoft.module.room.vo.RoomBedInfoVo;
 import com.xjrsoft.module.room.vo.RoomBedPageVo;
 import com.xjrsoft.module.room.vo.RoomBedVo;
 import com.xjrsoft.module.room.vo.StudentPayStatusVo;
+import com.xjrsoft.module.room.vo.TeacherRoomListVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -146,4 +147,6 @@ public interface RoomBedMapper extends MPJBaseMapper<RoomBed> {
 
     String getRoomNameByStudentUserId(Long id);
 
+    List<TeacherRoomListVo> getTeacherRoomList(@Param("dto") AdjustBedPageDto dto);
+
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/room/service/IRoomBedService.java

@@ -18,6 +18,8 @@ import com.xjrsoft.module.room.vo.DistributeRoomBedPageVo;
 import com.xjrsoft.module.room.vo.NoBedStudentPageVo;
 import com.xjrsoft.module.room.vo.RoomBedExcelVo;
 import com.xjrsoft.module.room.vo.RoomBedPageVo;
+import com.xjrsoft.module.room.vo.TeacherRoomListVo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -109,4 +111,6 @@ public interface IRoomBedService extends MPJBaseService<RoomBed> {
 
 
     String getRoomNameByStudentUserId(Long id);
+
+    List<TeacherRoomListVo> getTeacherRoomList(AdjustBedPageDto dto);
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/room/service/impl/RoomBedServiceImpl.java

@@ -43,6 +43,7 @@ import com.xjrsoft.module.room.vo.RoomBedPageVo;
 import com.xjrsoft.module.room.vo.RoomClassCountVo;
 import com.xjrsoft.module.room.vo.RoomClassExistentVo;
 import com.xjrsoft.module.room.vo.StudentPayStatusVo;
+import com.xjrsoft.module.room.vo.TeacherRoomListVo;
 import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.mapper.BaseStudentMapper;
@@ -674,4 +675,9 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
         return roomBedMapper.getRoomNameByStudentUserId(id);
     }
 
+    @Override
+    public List<TeacherRoomListVo> getTeacherRoomList(AdjustBedPageDto dto) {
+        return this.roomBedMapper.getTeacherRoomList(dto);
+    }
+
 }

+ 31 - 0
src/main/java/com/xjrsoft/module/room/vo/TeacherRoomListVo.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.room.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 寝室床位表单出参
+* @Author dzx
+* @Date: 2023-12-27
+* @Version 1.0
+*/
+@Data
+public class TeacherRoomListVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("寝室id")
+    private Long id;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("寝室名称")
+    private String roomName;
+
+    @ApiModelProperty("楼栋名称")
+    private String buildName;
+
+
+
+}

+ 1 - 1
src/main/java/com/xjrsoft/module/system/dto/AddMenuDto.java

@@ -46,7 +46,7 @@ public class AddMenuDto implements Serializable {
     private String iconUrl;
 
     @NotNull(message = "菜单地址不能为空!")
-    @Length(max = 100,message = "菜单地址不能大于100个字符!")
+    @Length(max = 500,message = "菜单地址不能大于500个字符!")
     @ApiModelProperty("地址")
     private String path;
 

+ 1 - 1
src/main/java/com/xjrsoft/module/system/dto/UpdateMenuDto.java

@@ -50,7 +50,7 @@ public class UpdateMenuDto implements Serializable {
     private String iconUrl;
 
     @NotNull(message = "菜单地址不能为空!")
-    @Length(max = 100,message = "菜单地址不能大于100个字符!")
+    @Length(max = 500,message = "菜单地址不能大于500个字符!")
     @ApiModelProperty("地址")
     private String path;
 

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

@@ -106,7 +106,7 @@
         SELECT COUNT(t1.id) FROM course_table t1
         INNER JOIN course_table_bak t2 ON t1.schedule_date = t2.schedule_date
         AND t1.time_number = t2.time_number
-        AND t1.time_period = t2.time_number
+        AND t1.time_period = t2.time_period
         WHERE t2.wf_course_adjust_id = #{dto.wfCourseAdjustId}
         AND t1.teacher_id LIKE concat('%', #{dto.teacherId},'%') AND t1.adjust_type IS NULL;
     </select>

+ 34 - 8
src/main/resources/mapper/room/RoomBedMapper.xml

@@ -337,10 +337,10 @@
         WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
         <if test="dto.isEmptyRoom != null">
             <if test="dto.isEmptyRoom == 1">
-                and t2.bed_count = (SELECT COUNT(*) FROM room_bed WHERE delete_mark = 0 AND student_user_id IS NULL AND is_check_in = 0 AND room_id = t2.id)
+                and t2.bed_count = (SELECT COUNT(*) FROM room_bed WHERE delete_mark = 0 AND student_user_id IS NULL AND room_id = t2.id)
             </if>
             <if test="dto.isEmptyRoom == 0">
-                and t2.bed_count != (SELECT COUNT(*) FROM room_bed WHERE delete_mark = 0 AND student_user_id IS NULL AND is_check_in = 0 AND room_id = t2.id)
+                and t2.bed_count != (SELECT COUNT(*) FROM room_bed WHERE delete_mark = 0 AND student_user_id IS NULL AND room_id = t2.id)
             </if>
         </if>
         <if test="dto.roomName != null">
@@ -358,12 +358,16 @@
         <if test="dto.floorNumber != null">
             and t2.floor_number = #{dto.floorNumber}
         </if>
-        <if test="dto.classId != null">
-            AND t2.id IN (
-            SELECT DISTINCT c1.room_id FROM room_bed c1
-            INNER JOIN base_student_school_roll c2 ON c1.student_user_id = c2.user_id
-            WHERE c2.class_id = #{dto.classId}
-            )
+        <if test="dto.isTeacher != null">
+            <if test="dto.classId != null">
+                AND (t2.id IN (
+                SELECT DISTINCT c1.room_id FROM room_bed c1
+                INNER JOIN base_student_school_roll c2 ON c1.student_user_id = c2.user_id
+                WHERE c2.class_id = #{dto.classId}
+                ) or
+                t2.bed_count != (SELECT COUNT(*) FROM room_bed WHERE delete_mark = 0 AND student_user_id IS not NULL AND room_id = t2.id)
+                )
+            </if>
         </if>
         <if test="dto.buildId != null">
             and t3.id = #{dto.buildId}
@@ -425,4 +429,26 @@
         WHERE t1.delete_mark = 0 AND t1.delete_mark = 0
         AND t2.student_user_id = #{id}
     </select>
+
+    <select id="getTeacherRoomList" parameterType="com.xjrsoft.module.room.dto.AdjustBedPageDto" resultType="com.xjrsoft.module.room.vo.TeacherRoomListVo">
+        SELECT DISTINCT t2.id,t3.name as build_name,t2.room_name FROM room_bed t1
+        LEFT JOIN room t2 ON t1.room_id = t2.id
+        LEFT JOIN base_office_build t3 ON t2.office_build_id = t3.id
+        LEFT JOIN xjr_user t4 ON t1.student_user_id = t4.id
+        LEFT JOIN xjr_dictionary_detail t5 ON t2.gender = t5.code AND t5.item_id = 2023000000000000004
+        LEFT JOIN base_student_school_roll t7 ON t4.id = t7.user_id
+        LEFT JOIN base_class t8 ON t7.class_id = t8.id
+        LEFT JOIN base_grade t9 ON t7.grade_id = t9.id
+        LEFT JOIN xjr_user t10 ON t8.teacher_id = t10.id
+        WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
+        <if test="dto.classId != null">
+            AND (t2.id IN (
+                SELECT DISTINCT c1.room_id FROM room_bed c1
+                INNER JOIN base_student_school_roll c2 ON c1.student_user_id = c2.user_id
+                WHERE c2.class_id = #{dto.classId}
+            ) OR
+                t2.bed_count != (SELECT COUNT(*) FROM room_bed WHERE delete_mark = 0 AND student_user_id IS not NULL AND room_id = t2.id)
+            )
+        </if>
+    </select>
 </mapper>