-
@@ -284,16 +297,18 @@
+
+
diff --git a/web/src/views/xg/xgss/bzrfp/components/SelectiveAllocationDialog.vue b/web/src/views/xg/xgss/bzrfp/components/SelectiveAllocationDialog.vue
index 6d4aafe3..b340e212 100644
--- a/web/src/views/xg/xgss/bzrfp/components/SelectiveAllocationDialog.vue
+++ b/web/src/views/xg/xgss/bzrfp/components/SelectiveAllocationDialog.vue
@@ -7,6 +7,9 @@
可用床位选择
+ 男生楼
+ 女生楼
+ 混合楼
已选择
{{ selectedBeds.length }} 个床位
@@ -22,24 +25,74 @@
ref="bedTableRef"
:data="filteredBedList"
row-key="id"
- height="400"
+ height="330"
+ max-height="330"
+ :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
+ :expand-row-keys="expandRowKeys"
+ @expand-change="handleExpandChange"
+ :row-class-name="getRowClassName"
@selection-change="handleBedSelectionChange"
+ @select="handleRowSelection"
@select-all="handleBedSelectAll"
>
-
-
+
+
+
+
+ {{ scope.row.roomName }}
+
+
+
+
+
{{ scope.row.bedName }}
+
+
+
- 下铺
- 上铺
- 中铺
- 独立床
+
+ 下铺
+ 上铺
+ 中铺
+ 独立床
+
+
+ {{ scope.row.roomType === '1' ? '标准间' : scope.row.roomType === '2' ? '单人间' : '套间' }}
+
-
- 空闲
+
+
+ 空闲
+
+ —
+
+
+
+
+ {{ scope.row.studentName }}
+ —
+ —
+
+
+
+
+ {{ scope.row.studentNo }}
+ —
+ —
+
+
+
+
+
+ 男
+ 女
+
+ —
+ —
@@ -48,6 +101,31 @@
+
+
+
+
+
+ 班级:
+ {{ classInfo?.className || '未知班级' }}
+
+
+ 楼栋:
+ {{ props.buildingInfo?.label || '未选择楼栋' }}
+
+
+ 类型:
+ 男生楼
+ 女生楼
+ 混合楼
+ 未知类型
+
+
+
+
@@ -60,14 +138,19 @@
{{ selectedStudents.length }}
- {{ isMatched ? '✓ 数量匹配' : '✗ 数量不匹配' }}
+ {{ isMatched ? '✓ 床位充足' : '✗ 床位不足' }}
@@ -77,6 +160,9 @@
未分配学生选择
+ 仅男学生
+ 仅女学生
+ 男女混合
已选择 {{ selectedStudents.length }} 名学生
@@ -92,17 +178,19 @@
ref="studentTableRef"
:data="filteredStudentList"
row-key="id"
- height="400"
+ height="330"
+ max-height="330"
@selection-change="handleStudentSelectionChange"
@select-all="handleStudentSelectAll"
>
+
- 男
- 女
+ 男
+ 女
@@ -114,7 +202,9 @@
@@ -122,13 +212,17 @@
diff --git a/web/src/views/xg/xgss/ejxyfp/ejxyfp.vue b/web/src/views/xg/xgss/ejxyfp/ejxyfp.vue
index aed1499a..c282ee8f 100644
--- a/web/src/views/xg/xgss/ejxyfp/ejxyfp.vue
+++ b/web/src/views/xg/xgss/ejxyfp/ejxyfp.vue
@@ -197,6 +197,7 @@
:data="roomList"
row-key="id"
border
+ :height="tableMaxHeight"
:expand-row-keys="expandedRowKeys"
@expand-change="handleExpandChange"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
@@ -358,7 +359,7 @@
diff --git a/web/src/views/xg/xgss/xsssfpejxy/index.vue b/web/src/views/xg/xgss/xsssfpejxy/index.vue
index 81afec7c..521d752a 100644
--- a/web/src/views/xg/xgss/xsssfpejxy/index.vue
+++ b/web/src/views/xg/xgss/xsssfpejxy/index.vue
@@ -197,6 +197,7 @@
:data="roomList"
row-key="id"
border
+ :height="tableMaxHeight"
:expand-row-keys="expandedRowKeys"
@expand-change="handleExpandChange"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
@@ -356,7 +357,7 @@
From 4075b903cf041e8b7a5f336eb2c0dd0f8db5d38c Mon Sep 17 00:00:00 2001
From: zlwu <704541015@qq.com>
Date: Thu, 14 Aug 2025 23:34:15 +0800
Subject: [PATCH 22/55] =?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../XgDormBedStudentController.java | 51 ++
.../xg/service/IXgDormBedStudentService.java | 41 +
.../impl/XgDormBedStudentServiceImpl.java | 319 ++++++++
.../dormBedStudent/dormBedStudent/index.ts | 57 ++
web/src/views/xg/xgss/bzrfp/bzrfp.vue | 46 ++
.../bzrfp/components/BedTransferDialog.vue | 702 ++++++++++++++++++
6 files changed, 1216 insertions(+)
create mode 100644 web/src/views/xg/xgss/bzrfp/components/BedTransferDialog.vue
diff --git a/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/controller/XgDormBedStudentController.java b/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/controller/XgDormBedStudentController.java
index d36ae8e8..579cb845 100644
--- a/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/controller/XgDormBedStudentController.java
+++ b/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/controller/XgDormBedStudentController.java
@@ -270,4 +270,55 @@ public class XgDormBedStudentController extends BaseController {
return toAjax(xgDormBedStudentService.classTeacherStayawaySelectedBeds(bedIds, classId));
}
+ /**
+ * 班主任床位互换
+ * 将两个有学生的床位进行互换
+ */
+ @SaCheckPermission("dormBedStudent:dormBedStudent:edit")
+ @Log(title = "班主任床位互换", businessType = BusinessType.UPDATE)
+ @RepeatSubmit()
+ @PostMapping("/classTeacherExchangeBeds")
+ public R classTeacherExchangeBeds(@RequestParam Long sourceBedId,
+ @RequestParam Long targetBedId,
+ @RequestParam(required = false) Long classId) {
+ return toAjax(xgDormBedStudentService.classTeacherExchangeBeds(sourceBedId, targetBedId, classId));
+ }
+
+ /**
+ * 班主任床位移动
+ * 将学生从当前床位移动到指定的空闲床位
+ */
+ @SaCheckPermission("dormBedStudent:dormBedStudent:edit")
+ @Log(title = "班主任床位移动", businessType = BusinessType.UPDATE)
+ @RepeatSubmit()
+ @PostMapping("/classTeacherMoveBed")
+ public R classTeacherMoveBed(@RequestParam Long sourceBedId,
+ @RequestParam Long targetBedId,
+ @RequestParam(required = false) Long classId) {
+ return toAjax(xgDormBedStudentService.classTeacherMoveBed(sourceBedId, targetBedId, classId));
+ }
+
+ /**
+ * 获取班级所有已入住宿舍的学生床位信息
+ * 包含床位信息(校区名称、宿舍区名称、楼栋名称、房间名称、床位名称)
+ * 和学生信息(学生姓名、学号、性别)
+ */
+ @SaCheckPermission("dormBedStudent:dormBedStudent:list")
+ @GetMapping("/getClassOccupiedBedDetails")
+ public R> getClassOccupiedBedDetails(@RequestParam(required = false) Long classId) {
+ List
@@ -325,6 +337,7 @@ import ElMessageBox from 'element-plus/es/components/message-box/index';
// 引入子组件
import SelectiveAllocationDialog from './components/SelectiveAllocationDialog.vue';
+import BedTransferDialog from './components/BedTransferDialog.vue';
// 组件状态
const dormTreeRef = ref();
@@ -411,6 +424,14 @@ const selectiveAllocationDialog = reactive({
buildingInfo: undefined as DormBuildingTreeVO | undefined
});
+// 调宿对话框
+const bedTransferDialog = reactive({
+ visible: false,
+ title: '调宿管理',
+ selectedBed: undefined as any | undefined,
+ buildingInfo: undefined as DormBuildingTreeVO | undefined
+});
+
// 表格最大高度计算
const tableMaxHeight = computed(() => {
// 根据不同屏幕尺寸动态调整预留空间
@@ -814,6 +835,31 @@ const handleStayawayBeds = async () => {
}
};
+/** 调宿管理 */
+const handleBedTransfer = () => {
+ if (!selectedBuilding.value) {
+ ElMessage.warning('请先选择宿舍楼');
+ return;
+ }
+
+ // 获取选中的已分配床位
+ const selectedAllocatedBeds = selectedRows.value.filter((row) => row.isBed && row.studentId);
+
+ if (selectedAllocatedBeds.length === 0) {
+ ElMessage.warning('请先勾选要调宿的床位(必须是已分配学生的床位)!');
+ return;
+ }
+
+ if (selectedAllocatedBeds.length > 1) {
+ ElMessage.warning('调宿操作一次只能选择一个床位!');
+ return;
+ }
+
+ bedTransferDialog.selectedBed = selectedAllocatedBeds[0];
+ bedTransferDialog.buildingInfo = selectedBuilding.value;
+ bedTransferDialog.visible = true;
+};
+
/** 分配成功回调 */
const handleAllocationSuccess = () => {
// 清除缓存,确保数据刷新
diff --git a/web/src/views/xg/xgss/bzrfp/components/BedTransferDialog.vue b/web/src/views/xg/xgss/bzrfp/components/BedTransferDialog.vue
new file mode 100644
index 00000000..db1144ba
--- /dev/null
+++ b/web/src/views/xg/xgss/bzrfp/components/BedTransferDialog.vue
@@ -0,0 +1,702 @@
+
+
+
+
+
+
+
+
+
+
+ 学生姓名:
+ {{ props.selectedBed.studentName }}
+
+
+ 学号:
+ {{ props.selectedBed.studentNo }}
+
+
+ 性别:
+ 男
+ 女
+
+
+
+ 房间号:
+ {{ props.selectedBed.roomName }}
+
+
+ 床位号:
+ {{ props.selectedBed.bedName }}
+
+
+ 床位类型:
+ 下铺
+ 上铺
+ 中铺
+ 独立床
+
+
+
+
+
+
+
+
+
+
+
+
+ 床位互换
+ 与另一个有学生的床位互换
+
+
+
+ 移动床位
+ 移动到一个空闲的床位
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.roomName }}
+
+
+
+ {{ scope.row.bedName }}
+
+
+
+
+
+ {{ scope.row.campusName }}
+ —
+
+
+
+
+ {{ scope.row.buildingName }}
+ —
+
+
+
+
+
+ 下铺
+ 上铺
+ 中铺
+ 独立床
+
+
+ {{ scope.row.roomType === '1' ? '标准间' : scope.row.roomType === '2' ? '单人间' : '套间' }}
+
+
+
+
+
+
+ 男生
+ 女生
+ 混合
+
+
+ 男生楼
+ 女生楼
+ 混合楼
+
+
+
+
+
+
+ 已分配
+ 空闲
+
+ —
+
+
+
+
+ {{ scope.row.studentName }}
+ —
+ —
+
+
+
+
+ {{ scope.row.studentNo }}
+ —
+ —
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 7a4881592ae94e4f0e3687b9b43647d26cd24184 Mon Sep 17 00:00:00 2001
From: zlwu <704541015@qq.com>
Date: Fri, 15 Aug 2025 11:47:26 +0800
Subject: [PATCH 23/55] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../XgDormBedStudentController.java | 12 +-
.../xg/mapper/XgDormBedStudentMapper.java | 129 ++++++
.../xg/service/IXgDormBedStudentService.java | 12 +-
.../impl/XgDormBedStudentServiceImpl.java | 416 +++++++++++-------
.../dormBedStudent/dormBedStudent/index.ts | 14 +-
.../bzrfp/components/BedTransferDialog.vue | 6 +-
6 files changed, 398 insertions(+), 191 deletions(-)
diff --git a/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/controller/XgDormBedStudentController.java b/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/controller/XgDormBedStudentController.java
index 579cb845..2e0cf2bf 100644
--- a/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/controller/XgDormBedStudentController.java
+++ b/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/controller/XgDormBedStudentController.java
@@ -272,16 +272,16 @@ public class XgDormBedStudentController extends BaseController {
/**
* 班主任床位互换
- * 将两个有学生的床位进行互换
+ * 将两个学生的床位进行互换
*/
@SaCheckPermission("dormBedStudent:dormBedStudent:edit")
@Log(title = "班主任床位互换", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PostMapping("/classTeacherExchangeBeds")
- public R
classTeacherExchangeBeds(@RequestParam Long sourceBedId,
- @RequestParam Long targetBedId,
+ public R classTeacherExchangeBeds(@RequestParam Long sourceStudentId,
+ @RequestParam Long targetStudentId,
@RequestParam(required = false) Long classId) {
- return toAjax(xgDormBedStudentService.classTeacherExchangeBeds(sourceBedId, targetBedId, classId));
+ return toAjax(xgDormBedStudentService.classTeacherExchangeBeds(sourceStudentId, targetStudentId, classId));
}
/**
@@ -292,10 +292,10 @@ public class XgDormBedStudentController extends BaseController {
@Log(title = "班主任床位移动", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PostMapping("/classTeacherMoveBed")
- public R classTeacherMoveBed(@RequestParam Long sourceBedId,
+ public R classTeacherMoveBed(@RequestParam Long sourceStudentId,
@RequestParam Long targetBedId,
@RequestParam(required = false) Long classId) {
- return toAjax(xgDormBedStudentService.classTeacherMoveBed(sourceBedId, targetBedId, classId));
+ return toAjax(xgDormBedStudentService.classTeacherMoveBed(sourceStudentId, targetBedId, classId));
}
/**
diff --git a/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/mapper/XgDormBedStudentMapper.java b/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/mapper/XgDormBedStudentMapper.java
index 3ab6e5b4..6cf61846 100644
--- a/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/mapper/XgDormBedStudentMapper.java
+++ b/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/mapper/XgDormBedStudentMapper.java
@@ -3,6 +3,11 @@ package org.dromara.xg.mapper;
import org.dromara.xg.domain.XgDormBedStudent;
import org.dromara.xg.domain.vo.XgDormBedStudentVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
/**
* 床位学生分配关系Mapper接口
@@ -12,4 +17,128 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
*/
public interface XgDormBedStudentMapper extends BaseMapperPlus {
+ /**
+ * 查询班级已入住床位详情(通过SQL关联查询,按楼栋、房间、床位排序)
+ *
+ * @param classId 班级ID
+ * @return 班级已入住床位详情列表
+ */
+ @Select("""
+ SELECT
+ bs.bed_id,
+ bs.student_id,
+ bs.class_id,
+ bs.college_id,
+
+ -- 床位信息
+ b.bed_name,
+ b.bed_type,
+ b.bed_code,
+
+ -- 房间信息
+ r.id as room_id,
+ r.room_name,
+ r.room_code,
+
+ -- 楼栋信息
+ building.id as building_id,
+ building.building_name,
+ building.building_code,
+ building.building_type,
+
+ -- 宿舍区信息
+ area.id as area_id,
+ area.area_name,
+
+ -- 校区信息
+ campus.id as campus_id,
+ campus.campus_name,
+
+ -- 学生信息
+ s.student_no,
+ s.name as student_name,
+ s.gender,
+ s.phone,
+ s.id_card
+
+ FROM xg_dorm_bed_student bs
+ INNER JOIN xg_dorm_bed b ON bs.bed_id = b.id AND b.deleted = '0'
+ INNER JOIN xg_dorm_room r ON b.room_id = r.id AND r.deleted = '0'
+ INNER JOIN xg_dorm_building building ON r.building_id = building.id AND building.deleted = '0'
+ INNER JOIN xg_dorm_area area ON building.area_id = area.id AND area.deleted = '0'
+ INNER JOIN xg_dorm_campus campus ON area.campus_id = campus.id AND campus.deleted = '0'
+ INNER JOIN xg_student_msg s ON bs.student_id = s.id AND s.deleted = 0
+
+ WHERE bs.class_id = #{classId}
+ AND bs.student_id IS NOT NULL
+ AND bs.status = '0'
+ AND bs.deleted = '0'
+ AND s.student_status = '1'
+
+ ORDER BY
+ campus.campus_name,
+ area.area_name,
+ building.building_code,
+ r.room_code,
+ b.bed_code
+ """)
+ List