2
0

2 Commits a6a5b88f47 ... 5fd0042068

Autor SHA1 Mensagem Data
  “wuzhen” 5fd0042068 fix(dorm): 班主任床位分配页去掉退宿选中床位按钮 há 1 mês atrás
  “wuzhen” 64f805cca4 fix(dorm): 点名请假仅认审批完成,并修正点名时间时区 há 1 mês atrás

+ 2 - 1
backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/IXgStudentLeaveService.java

@@ -69,7 +69,8 @@ public interface IXgStudentLeaveService {
     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
     /**
-     * 根据学生ID列表和检查日期查询学生请假信息
+     * 根据学生ID列表和检查日期查询已审批结束的请假信息。
+     * 审批中(waiting)、草稿、退回、撤销不返回,宿舍点名和卫生检查因此不显示请假。
      *
      * @param studentIds 学生ID列表
      * @param checkDate  检查日期

+ 3 - 0
backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgDormRollCallServiceImpl.java

@@ -252,6 +252,9 @@ public class XgDormRollCallServiceImpl implements IXgDormRollCallService {
             } catch (Exception ignored) {
             }
         }
+
+        // 点名时间以服务端本地时间为准。前端 toISOString() 会提交 UTC,北京时间会少 8 小时。
+        bo.setCheckDate(new Date());
     }
 
     @Override

+ 4 - 3
backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgStudentLeaveServiceImpl.java

@@ -613,7 +613,8 @@ public class XgStudentLeaveServiceImpl implements IXgStudentLeaveService {
     }
 
     /**
-     * 根据学生ID列表和检查日期查询学生请假信息
+     * 根据学生ID列表和检查日期查询已审批结束的请假信息。
+     * 仅 approval_status = finish 且检查时间落在请假区间内的记录会返回。
      *
      * @param studentIds 学生ID列表
      * @param checkDate 检查日期
@@ -627,8 +628,8 @@ public class XgStudentLeaveServiceImpl implements IXgStudentLeaveService {
 
         LambdaQueryWrapper<XgStudentLeave> lqw = Wrappers.lambdaQuery();
         lqw.in(XgStudentLeave::getStudentId, studentIds);
-        // 查询审核状态为"waiting"(待审核)或"finish"(已完成)的请假记录
-        lqw.in(XgStudentLeave::getApprovalStatus, "waiting", "finish");
+        // 宿舍点名、卫生检查等状态展示:审批未结束不视为请假,仅 finish(审批全部结束)
+        lqw.eq(XgStudentLeave::getApprovalStatus, BusinessStatusEnum.FINISH.getStatus());
         // 检查日期在请假时间段内
         lqw.le(XgStudentLeave::getStartTime, checkDate);
         lqw.ge(XgStudentLeave::getEndTime, checkDate);

+ 6 - 1
mobile/src/pages/xgss/ssdm/components/RoomRollCallPopup.vue

@@ -267,6 +267,11 @@ export default {
             }
         },
 
+        formatLocalDateTime(date) {
+            const pad = (n) => String(n).padStart(2, '0');
+            return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
+        },
+
         async handleSubmit() {
             if (!this.buildingId || !this.roomId) {
                 uni.showToast({ title: '缺少必要参数', icon: 'none' });
@@ -296,7 +301,7 @@ export default {
 
                 const submitData = {
                     batchNo: this.batchNo,
-                    checkDate: new Date().toISOString().slice(0, 19).replace('T', ' '),
+                    checkDate: this.formatLocalDateTime(new Date()),
                     buildingId: this.buildingId,
                     roomId: this.roomId,
                     roomName: this.roomName,

+ 0 - 1
web/src/views/xg/xgss/bzrfp/bzrfp.vue

@@ -99,7 +99,6 @@
                   <!-- <el-button type="success" icon="UserFilled" size="small" @click="handleRandomAllocation">随机分配</el-button>
                   <el-button type="info" icon="Sort" size="small" @click="handleStudentNoAllocation">按学号分配</el-button> -->
                   <el-button type="warning" icon="RefreshLeft" size="small" @click="handleRecallBeds">收回选中床位</el-button>
-                  <el-button type="danger" icon="House" size="small" @click="handleStayawayBeds">退宿选中床位</el-button>
                   <el-button type="info" icon="Switch" size="small" @click="handleBedTransfer">调宿</el-button>
                 </el-col>
                 <el-col :span="12" style="text-align: right">

+ 2 - 1
web/src/views/xg/xgss/dormRollCall/dormRollCall/RoomRollCallPopup.vue

@@ -47,6 +47,7 @@ import { submitRollCall } from '@/api/xg/xgss/dormRollCall/dormRollCall/index';
 import { DormRollCallDetailForm, DormRollCallForm } from '@/api/xg/xgss/dormRollCall/dormRollCall/types';
 import { getRoomStudents } from '@/api/xg/xgss/dormBedStudent/dormBedStudent/index';
 import request from '@/utils/request';
+import { parseTime } from '@/utils/ruoyi';
 
 console.log('[点名调试] RoomRollCallPopup 组件已加载');
 
@@ -251,7 +252,7 @@ const handleSubmit = async () => {
 
     const submitData: DormRollCallForm = {
       batchNo: props.batchNo,
-      checkDate: new Date().toISOString().slice(0, 19).replace('T', ' '),
+      checkDate: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
       buildingId: props.buildingId,
       roomId: props.roomId,
       roomName: props.roomName,