From 76fada3a517b0aed64cbb26053525c887199b2a2 Mon Sep 17 00:00:00 2001 From: wuzhen <52326163@qq.com> Date: Thu, 21 Aug 2025 21:56:04 +0800 Subject: [PATCH 1/2] wuzhen update --- .../JcbtWorkStudyApplicationController.java | 13 + .../JcbtWorkStudyPositionController.java | 60 ++- .../JcbtWorkStudyApplicationMapper.java | 2 + .../IJcbtWorkStudyApplicationService.java | 6 + .../JcbtWorkStudyApplicationServiceImpl.java | 8 + .../jcbt/JcbtWorkStudyApplicationMapper.xml | 6 + mobile/src/pages.json | 496 ++++++++++-------- mobile/src/pages/index/index.vue | 24 +- web/src/api/jcbt/workStudyPosition.ts | 10 + .../views/jcbt/workstudy/Position/index.vue | 14 + web/src/views/zsjy/internship/daily/index.vue | 2 +- 11 files changed, 404 insertions(+), 237 deletions(-) diff --git a/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/controller/JcbtWorkStudyApplicationController.java b/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/controller/JcbtWorkStudyApplicationController.java index 286cbd5e..f0eae6fc 100644 --- a/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/controller/JcbtWorkStudyApplicationController.java +++ b/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/controller/JcbtWorkStudyApplicationController.java @@ -347,4 +347,17 @@ public class JcbtWorkStudyApplicationController extends BaseController { } } + /** + * 获取学生已申请岗位列表 + */ + @Operation(summary = "获取学生已申请岗位列表") + @GetMapping("/student/status") + @SaCheckPermission("jcbt:workStudyApplication:query") + public R> getStudentApplicationStatus() { + + Map statusMap = workStudyApplicationService.getStudentApplicationStatus(); + return R.ok(statusMap); + + } + } diff --git a/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/controller/JcbtWorkStudyPositionController.java b/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/controller/JcbtWorkStudyPositionController.java index 46642275..9911de77 100644 --- a/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/controller/JcbtWorkStudyPositionController.java +++ b/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/controller/JcbtWorkStudyPositionController.java @@ -416,10 +416,64 @@ public class JcbtWorkStudyPositionController extends BaseController { /** * 获取当前用户所在学院ID - * TODO: 实现获取当前用户学院ID的逻辑 + * 通过查询学生信息或用户部门信息获取 */ private Long getCurrentUserCollegeId() { - // 临时返回固定值,实际应该从用户信息中获取 - return 1L; + try { + // 获取当前登录用户ID + Long userId = LoginHelper.getUserId(); + if (userId == null) { + log.warn("用户未登录"); + return null; + } + + // 首先尝试通过学生信息获取学院ID + try { + XgStudentMsgVo studentInfo = xgStudentMsgService.queryByUserId(userId); + if (studentInfo != null && studentInfo.getCollegeId() != null) { + log.debug("通过学生信息获取学院ID: {}", studentInfo.getCollegeId()); + return Long.parseLong(studentInfo.getCollegeId()); + } + } catch (Exception e) { + log.debug("通过学生信息获取学院ID失败,可能用户不是学生: {}", e.getMessage()); + } + + // 如果不是学生用户,通过用户部门信息获取学院ID + try { + Long deptId = LoginHelper.getDeptId(); + if (deptId != null) { + log.debug("通过部门信息获取学院ID: {}", deptId); + return deptId; + } + } catch (Exception e) { + log.debug("通过部门信息获取学院ID失败: {}", e.getMessage()); + } + + // 尝试通过部门类别获取学院信息 + try { + String deptCategory = LoginHelper.getDeptCategory(); + String deptName = LoginHelper.getDeptName(); + log.debug("用户部门信息 - 部门名称: {}, 部门类别: {}", deptName, deptCategory); + + // 如果部门类别是学院类型,则使用部门ID作为学院ID + if ("college".equals(deptCategory) || "学院".equals(deptCategory)) { + Long deptId = LoginHelper.getDeptId(); + if (deptId != null) { + log.info("根据部门类别确认为学院用户,学院ID: {}", deptId); + return deptId; + } + } + } catch (Exception e) { + log.debug("通过部门类别获取学院ID失败: {}", e.getMessage()); + } + + log.warn("无法获取用户 {} 的学院信息,用户ID: {}, 部门ID: {}, 部门名称: {}", + userId, userId, LoginHelper.getDeptId(), LoginHelper.getDeptName()); + return null; + + } catch (Exception e) { + log.error("获取当前用户学院ID失败", e); + return null; + } } } diff --git a/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/mapper/JcbtWorkStudyApplicationMapper.java b/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/mapper/JcbtWorkStudyApplicationMapper.java index 26c9310c..6ed6bec4 100644 --- a/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/mapper/JcbtWorkStudyApplicationMapper.java +++ b/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/mapper/JcbtWorkStudyApplicationMapper.java @@ -24,4 +24,6 @@ public interface JcbtWorkStudyApplicationMapper extends BaseMapperPlus selectApplicationStatus(@Param("positionId") Long positionId, @Param("userId") Long userId); + Map selectApplicationStatusByStudentId(@Param("studentId") Long studentId); + } diff --git a/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/service/IJcbtWorkStudyApplicationService.java b/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/service/IJcbtWorkStudyApplicationService.java index 0634aa09..79822bb7 100644 --- a/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/service/IJcbtWorkStudyApplicationService.java +++ b/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/service/IJcbtWorkStudyApplicationService.java @@ -164,4 +164,10 @@ public interface IJcbtWorkStudyApplicationService { */ Map getPositionApplicationStatistics(Long positionId); + /** + * 获取学生已申请岗位列表 + * + * @return 学生已申请岗位列表 + */ + Map getStudentApplicationStatus(); } diff --git a/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/service/impl/JcbtWorkStudyApplicationServiceImpl.java b/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/service/impl/JcbtWorkStudyApplicationServiceImpl.java index 8f9ac03d..7f6d8dca 100644 --- a/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/service/impl/JcbtWorkStudyApplicationServiceImpl.java +++ b/backend/ruoyi-modules/ruoyi-jcbt/src/main/java/org/dromara/jcbt/service/impl/JcbtWorkStudyApplicationServiceImpl.java @@ -529,4 +529,12 @@ public class JcbtWorkStudyApplicationServiceImpl implements IJcbtWorkStudyApplic return statistics; } + /** + * 获取学生已申请岗位列表 + */ + @Override + public Map getStudentApplicationStatus() { + Long studentId = LoginHelper.getUserId(); + return baseMapper.selectApplicationStatusByStudentId(studentId); + } } diff --git a/backend/ruoyi-modules/ruoyi-jcbt/src/main/resources/mapper/jcbt/JcbtWorkStudyApplicationMapper.xml b/backend/ruoyi-modules/ruoyi-jcbt/src/main/resources/mapper/jcbt/JcbtWorkStudyApplicationMapper.xml index 0672aa62..8aad3aa3 100644 --- a/backend/ruoyi-modules/ruoyi-jcbt/src/main/resources/mapper/jcbt/JcbtWorkStudyApplicationMapper.xml +++ b/backend/ruoyi-modules/ruoyi-jcbt/src/main/resources/mapper/jcbt/JcbtWorkStudyApplicationMapper.xml @@ -133,4 +133,10 @@ AND deleted = 0 + + diff --git a/mobile/src/pages.json b/mobile/src/pages.json index 731fcf5e..2cacf5e5 100644 --- a/mobile/src/pages.json +++ b/mobile/src/pages.json @@ -1,233 +1,265 @@ -{ - "easycom": { - "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" - }, - "pages": [ - { - "path": "pages/login/index", - "style": { - "navigationBarTitleText": "登录", - "navigationStyle": "custom" - } - }, - { - "path": "pages/index/index", - "style": { - "navigationBarTitleText": "杭州第一技师学院智慧校园", - "navigationStyle": "custom" - } - }, - { - "path": "pages/task/myDocument", - "style": { - "navigationBarTitleText": "我发起的", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/task/allTaskWaiting", - "style": { - "navigationBarTitleText": "我的待办", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/task/taskWaiting", - "style": { - "navigationBarTitleText": "我的待办", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/task/taskFinish", - "style": { - "navigationBarTitleText": "我的已办", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/task/taskCopyList", - "style": { - "navigationBarTitleText": "抄送我的", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xg/xsjcxx/xsjcxx/index", - "style": { - "navigationBarTitleText": "学生个人信息", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xg/xsjcxx/xsws/index", - "style": { - "navigationBarTitleText": "学生信息完善", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xg/xsjcxx/xsws/stuMsgDialog", - "style": { - "navigationBarTitleText": "信息完善", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xg/xsjcxx/xsws/stuMsgDetailDialog", - "style": { - "navigationBarTitleText": "提交历史", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xg/xsjcxx/xsqj/leave/index", - "style": { - "navigationBarTitleText": "学生请假", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xg/xsjcxx/xsqj/leaveEdit/index", - "style": { - "navigationBarTitleText": "请假申请", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xg/xsjcxx/xsqj/cancelLeaveEdit/index", - "style": { - "navigationBarTitleText": "学生销假", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/wechat/js-sdk-test", - "style": { - "navigationBarTitleText": "微信JS-SDK测试", - "navigationStyle": "custom" - } - }, - { - "path": "pages/internship/index", - "style": { - "navigationBarTitleText": "实习打卡", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/visit/index", - "style": { - "navigationBarTitleText": "班主任走访", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/visit/add", - "style": { - "navigationBarTitleText": "新增走访", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/visit/detail", - "style": { - "navigationBarTitleText": "走访详情", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/visit/edit", - "style": { - "navigationBarTitleText": "编辑走访", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xgss/sswj/grsswj", - "style": { - "navigationBarTitleText": "宿舍违纪", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xgss/sswj/sswjDetail", - "style": { - "navigationBarTitleText": "违纪详情", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xgss/wsjc/wsjc", - "style": { - "navigationBarTitleText": "宿舍卫生检查", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xgss/wsjc/wsjcAdd", - "style": { - "navigationBarTitleText": "新增宿舍卫生检查", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xgss/wsjc/wsjcDetail", - "style": { - "navigationBarTitleText": "宿舍卫生检查详情", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xgss/xssswsjc/xssswsjc", - "style": { - "navigationBarTitleText": "宿舍卫生检查", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/xgss/xssswsjc/xssswsjcDetail", - "style": { - "navigationBarTitleText": "宿舍卫生检查详情", - "navigationBarBackgroundColor": "#0051d9", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/enrollment/index", - "style": { - "navigationBarTitleText": "新生报名登记", - "navigationStyle": "custom" - } - } - ], - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "智慧校园", - "navigationBarBackgroundColor": "#0051d9", - "backgroundColor": "#F8F8F8" - } +{ + "easycom": { + "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" + }, + "pages": [ + { + "path": "pages/login/index", + "style": { + "navigationBarTitleText": "登录", + "navigationStyle": "custom" + } + }, + { + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "杭州第一技师学院智慧校园", + "navigationStyle": "custom" + } + }, + { + "path": "pages/task/myDocument", + "style": { + "navigationBarTitleText": "我发起的", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/task/allTaskWaiting", + "style": { + "navigationBarTitleText": "我的待办", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/task/taskWaiting", + "style": { + "navigationBarTitleText": "我的待办", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/task/taskFinish", + "style": { + "navigationBarTitleText": "我的已办", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/task/taskCopyList", + "style": { + "navigationBarTitleText": "抄送我的", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xg/xsjcxx/xsjcxx/index", + "style": { + "navigationBarTitleText": "学生个人信息", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xg/xsjcxx/xsws/index", + "style": { + "navigationBarTitleText": "学生信息完善", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xg/xsjcxx/xsws/stuMsgDialog", + "style": { + "navigationBarTitleText": "信息完善", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xg/xsjcxx/xsws/stuMsgDetailDialog", + "style": { + "navigationBarTitleText": "提交历史", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xg/xsjcxx/xsqj/leave/index", + "style": { + "navigationBarTitleText": "学生请假", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xg/xsjcxx/xsqj/leaveEdit/index", + "style": { + "navigationBarTitleText": "请假申请", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xg/xsjcxx/xsqj/cancelLeaveEdit/index", + "style": { + "navigationBarTitleText": "学生销假", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/wechat/js-sdk-test", + "style": { + "navigationBarTitleText": "微信JS-SDK测试", + "navigationStyle": "custom" + } + }, + { + "path": "pages/internship/index", + "style": { + "navigationBarTitleText": "实习打卡", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/visit/index", + "style": { + "navigationBarTitleText": "班主任走访", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/visit/add", + "style": { + "navigationBarTitleText": "新增走访", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/visit/detail", + "style": { + "navigationBarTitleText": "走访详情", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/visit/edit", + "style": { + "navigationBarTitleText": "编辑走访", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xgss/sswj/grsswj", + "style": { + "navigationBarTitleText": "宿舍违纪", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xgss/sswj/sswjDetail", + "style": { + "navigationBarTitleText": "违纪详情", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xgss/wsjc/wsjc", + "style": { + "navigationBarTitleText": "宿舍卫生检查", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xgss/wsjc/wsjcAdd", + "style": { + "navigationBarTitleText": "新增宿舍卫生检查", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xgss/wsjc/wsjcDetail", + "style": { + "navigationBarTitleText": "宿舍卫生检查详情", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xgss/xssswsjc/xssswsjc", + "style": { + "navigationBarTitleText": "宿舍卫生检查", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/xgss/xssswsjc/xssswsjcDetail", + "style": { + "navigationBarTitleText": "宿舍卫生检查详情", + "navigationBarBackgroundColor": "#0051d9", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/enrollment/index", + "style": { + "navigationBarTitleText": "新生报名登记", + "navigationStyle": "custom" + } + }, + { + "path": "pages/workStudy/index", + "style": { + "navigationBarTitleText": "勤工俭学", + "navigationBarBackgroundColor": "#1890ff", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/workStudy/detail", + "style": { + "navigationBarTitleText": "岗位详情", + "navigationBarBackgroundColor": "#1890ff", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/workStudy/apply", + "style": { + "navigationBarTitleText": "申请岗位", + "navigationBarBackgroundColor": "#1890ff", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/workStudy/applicationDetail", + "style": { + "navigationBarTitleText": "申请详情", + "navigationBarBackgroundColor": "#1890ff", + "navigationBarTextStyle": "white" + } + } + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "智慧校园", + "navigationBarBackgroundColor": "#0051d9", + "backgroundColor": "#F8F8F8" + } } \ No newline at end of file diff --git a/mobile/src/pages/index/index.vue b/mobile/src/pages/index/index.vue index c1f34640..0e3c0c08 100644 --- a/mobile/src/pages/index/index.vue +++ b/mobile/src/pages/index/index.vue @@ -220,6 +220,20 @@ /> + + + + @@ -645,7 +659,8 @@ export default { this.hasPermi(['student:internship:list']) || this.hasPermi(['student:dorm:violation:list']) || this.hasPermi(['student:visit:list']) || - this.hasPermi(['student:dorm:hygiene:list']) + this.hasPermi(['student:dorm:hygiene:list']) || + this.hasPermi(['student:workstudy:list']) ); }, @@ -880,6 +895,13 @@ export default { }); }, + // 跳转到勤工俭学页面 + gotoWorkStudy() { + uni.navigateTo({ + url: '/pages/workStudy/index', + }); + }, + // 图片加载成功处理 handleImageLoad(event) { console.log('✅ 轮播图片加载成功:', event.detail); diff --git a/web/src/api/jcbt/workStudyPosition.ts b/web/src/api/jcbt/workStudyPosition.ts index 9d3b2216..1af4be77 100644 --- a/web/src/api/jcbt/workStudyPosition.ts +++ b/web/src/api/jcbt/workStudyPosition.ts @@ -244,6 +244,16 @@ export function resumePosition(id: string | number) { }); } +/** + * 开启岗位招录 + */ +export function startRecruiting(id: string | number) { + return request({ + url: `/jcbt/workStudyPosition/startRecruiting/${id}`, + method: 'put' + }); +} + /** * 取消岗位 */ diff --git a/web/src/views/jcbt/workstudy/Position/index.vue b/web/src/views/jcbt/workstudy/Position/index.vue index e9e70f4e..9d3e4c8d 100644 --- a/web/src/views/jcbt/workstudy/Position/index.vue +++ b/web/src/views/jcbt/workstudy/Position/index.vue @@ -228,6 +228,13 @@ > 发布岗位 + + 开启招录 + - + + + + + @@ -141,7 +156,8 @@ - + +
岗位详情页面开发中...
@@ -149,12 +165,17 @@ - + /> --> +
申请表单页面开发中...
+
@@ -162,10 +183,14 @@