From 0150bdb84fdd8210fcd8883c9ebf0d9bc3598949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=84=89=E5=BF=AB=E7=9A=84=E5=A4=A7=E7=A6=8F?= <8790092+honest_zcy@user.noreply.gitee.com> Date: Fri, 30 Aug 2024 23:50:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cms/domain/HitCompetitionStudentInfo.java | 4 + .../HitRegistrationTeachInfoMapper.java | 7 + .../HitCompetitionStudentInfoServiceImpl.java | 14 + .../HitRegistrationTeachInfoServiceImpl.java | 2 + .../cms/HitCompetitionStudentInfoMapper.xml | 6 +- .../cms/HitRegistrationTeachInfoMapper.xml | 15 +- .../core/domain/HitRegistrationTeachInfo.java | 11 +- ruoyi-ui/src/api/hit/stuInfo.js | 44 +++ ruoyi-ui/src/views/hit/stuInfo/index.vue | 366 ++++++++++++++++++ .../officialWebsite/Components/header.vue | 8 +- .../src/views/officialWebsite/competition.vue | 54 ++- 11 files changed, 505 insertions(+), 26 deletions(-) create mode 100644 ruoyi-ui/src/api/hit/stuInfo.js create mode 100644 ruoyi-ui/src/views/hit/stuInfo/index.vue diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java index 49e07db..ae4f1bd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java @@ -43,6 +43,8 @@ public class HitCompetitionStudentInfo implements Serializable { @ApiModelProperty(value = "学生姓名") private String stuName; + //用户主键 + private Long userId; @ApiModelProperty(value = "学号") private String studentId; @@ -93,6 +95,8 @@ public class HitCompetitionStudentInfo implements Serializable { @ApiModelProperty(value = "更新人") private String updateBy; + @TableField(exist = false) + private String year; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/mapper/HitRegistrationTeachInfoMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/mapper/HitRegistrationTeachInfoMapper.java index e764bd1..7cc5727 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/mapper/HitRegistrationTeachInfoMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/mapper/HitRegistrationTeachInfoMapper.java @@ -20,6 +20,13 @@ public interface HitRegistrationTeachInfoMapper extends BaseMapper selectHitCompetitionStudentInfoList(HitCompetitionStudentInfo hitCompetitionStudentInfo) { + Calendar calendar = Calendar.getInstance(); + int year = calendar.get(Calendar.YEAR); + hitCompetitionStudentInfo.setYear(String.valueOf(year)); + //当前教师的学校 + LoginUser loginUser = SecurityUtils.getLoginUser(); + HitRegistrationTeachInfo hitRegistrationTeachInfo = hitRegistrationTeachInfoMapper.selectHitRegistrationTeachInfoByUserId(loginUser.getUserId()); + if(ObjectUtils.isNotEmpty(hitRegistrationTeachInfo)){ + hitCompetitionStudentInfo.setSchoolName(hitRegistrationTeachInfo.getSchoolName()); + } return hitCompetitionStudentInfoMapper.selectHitCompetitionStudentInfoList(hitCompetitionStudentInfo); } @@ -81,6 +93,8 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl + @@ -32,7 +33,7 @@ @@ -74,6 +76,7 @@ update_time, update_by, student_id, + user_id, #{hitRegId}, @@ -94,6 +97,7 @@ #{updateTime}, #{updateBy}, #{studentId}, + #{userId}, diff --git a/ruoyi-admin/src/main/resources/mapper/cms/HitRegistrationTeachInfoMapper.xml b/ruoyi-admin/src/main/resources/mapper/cms/HitRegistrationTeachInfoMapper.xml index fb5af6f..13c278e 100644 --- a/ruoyi-admin/src/main/resources/mapper/cms/HitRegistrationTeachInfoMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/cms/HitRegistrationTeachInfoMapper.xml @@ -23,14 +23,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select id, hit_reg_id, teacher_name, teacher_job, teacher_number, teacher_email, teacher_school, remark, del_flag, create_time, create_by, update_time, update_by, type,status from hit_registration_teach_info + select id, hit_reg_id, user_id,teacher_name, teacher_job, teacher_number, teacher_email, teacher_school, remark, del_flag, create_time, create_by, update_time, update_by, type,status from hit_registration_teach_info + insert into hit_registration_teach_info @@ -69,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" school_name, division, related_accounts, + user_id, @@ -90,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{schoolName}, #{division}, #{relatedAccounts}, - + #{userId}, @@ -110,6 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time = #{updateTime}, update_by = #{updateBy}, status = #{status}, + user_id = #{userId}, where id = #{id} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/HitRegistrationTeachInfo.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/HitRegistrationTeachInfo.java index 3b1d33e..1d5c496 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/HitRegistrationTeachInfo.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/HitRegistrationTeachInfo.java @@ -24,7 +24,8 @@ public class HitRegistrationTeachInfo extends BaseEntity /** 报名主键 */ @Excel(name = "报名主键") private Long hitRegId; - + //用户主键 + private Long userId; /** 教师姓名 */ @Excel(name = "教师姓名") private String teacherName; @@ -217,4 +218,12 @@ public class HitRegistrationTeachInfo extends BaseEntity public void setStatus(String status) { this.status = status; } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } } diff --git a/ruoyi-ui/src/api/hit/stuInfo.js b/ruoyi-ui/src/api/hit/stuInfo.js new file mode 100644 index 0000000..96d9768 --- /dev/null +++ b/ruoyi-ui/src/api/hit/stuInfo.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询大赛学生列表 +export function listInfo(query) { + return request({ + url: '/system/hit_stu_info/list', + method: 'get', + params: query + }) +} + +// 查询大赛学生详细 +export function getInfo(id) { + return request({ + url: '/system/hit_stu_info/' + id, + method: 'get' + }) +} + +// 新增大赛学生 +export function addInfo(data) { + return request({ + url: '/system/hit_stu_info', + method: 'post', + data: data + }) +} + +// 修改大赛学生 +export function updateInfo(data) { + return request({ + url: '/system/hit_stu_info', + method: 'put', + data: data + }) +} + +// 删除大赛学生 +export function delInfo(id) { + return request({ + url: '/system/hit_stu_info/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/hit/stuInfo/index.vue b/ruoyi-ui/src/views/hit/stuInfo/index.vue new file mode 100644 index 0000000..a0b829d --- /dev/null +++ b/ruoyi-ui/src/views/hit/stuInfo/index.vue @@ -0,0 +1,366 @@ + + + diff --git a/ruoyi-ui/src/views/officialWebsite/Components/header.vue b/ruoyi-ui/src/views/officialWebsite/Components/header.vue index d1d91c0..dc5c6ef 100644 --- a/ruoyi-ui/src/views/officialWebsite/Components/header.vue +++ b/ruoyi-ui/src/views/officialWebsite/Components/header.vue @@ -30,11 +30,11 @@ -
+
注册
-
+
{{ currentUser }} @@ -157,7 +157,7 @@ import { getBaseInfo, getTab } from '@/api/gw/home' import { getCodeImg ,register} from "@/api/login"; import Cookies from "js-cookie"; import { encrypt, decrypt } from '@/utils/jsencrypt' - +import { getToken } from "@/utils/auth"; export default { dicts: ["sys_user_sex", "school_name","com_region"], data() { @@ -270,7 +270,7 @@ export default { this.tabindex = this.msg this.getCode(); this.getCookie(); // 页面加载完毕调用 - this.isLoggedIn = localStorage.getItem('isLoggedIn') === 'true'; // 检查 localStorage 中的登录状态 + this.isLoggedIn = getToken()?true:false; // 检查 localStorage 中的登录状态 if (this.isLoggedIn) { this.loadUserInfo(); } diff --git a/ruoyi-ui/src/views/officialWebsite/competition.vue b/ruoyi-ui/src/views/officialWebsite/competition.vue index 1defaa3..2405cff 100644 --- a/ruoyi-ui/src/views/officialWebsite/competition.vue +++ b/ruoyi-ui/src/views/officialWebsite/competition.vue @@ -34,9 +34,20 @@
+ + + + + + + + + @@ -45,18 +56,14 @@ - - - + - - - + @@ -65,8 +72,8 @@ - - + + @@ -76,7 +83,7 @@
-
成绩未出,耐心等待
+
个人选拔赛成绩未出,请耐心等待
很遗憾,个人选拔赛未通过,您的个人成绩为 : {{ signUpForm.trialsScore }}
@@ -199,6 +206,7 @@ import headers from '@/views/officialWebsite/Components/header.vue' import PageUtil from '@/views/officialWebsite/Components/page' import { addTeacher, register, getStudentInfoByStuId, getTeamMateInfo, getTeacherInfo, PreliminaryRegistration ,getTeamMate,agreeTeam,refuseTeam} from '@/api/officialWebsite/registerStudent' import { getTab, getbanner } from '@/api/gw/home' +import { getToken } from "@/utils/auth"; export default { components: { headers, @@ -271,11 +279,14 @@ export default { major: [ { required: true, message: "专业名称不能为空", trigger: "blur" } ], - StudentIdCard: [ + studentIdCard: [ { required: true, message: "学生证不能为空", trigger: "blur" } ], phoneNumber: [ { required: true, message: "手机号不能为空", trigger: "blur" } + ], + email: [ + { required: true, message: "邮箱不能为空", trigger: "blur" } ] }, @@ -311,13 +322,16 @@ export default { methods: { //用户信息 loadUserInfo() { - getHomeUserInfo().then(response => { + if(getToken()){ + getHomeUserInfo().then(response => { + + this.signUpForm.studentId = response.data.userName; + this.preliminaryForm.division = response.data.division; + this.preliminaryForm.schoolName = response.data.schoolName; + this.fetchRegistrationInformation() + }) + } - this.signUpForm.studentId = response.data.userName; - this.preliminaryForm.division = response.data.division; - this.preliminaryForm.schoolName = response.data.schoolName; - this.fetchRegistrationInformation() - }) }, //根据学号查询学生报名信息 fetchRegistrationInformation() { @@ -455,7 +469,13 @@ export default { } }, toRegister() { - if (this.registerStatus === '1') this.currentActive = 6; + if(!getToken()){ + this.$modal.msgWarning("报名请先登录系统!") + + }else{ + if (this.registerStatus === '1') this.currentActive = 6; + } + }, downloadFile(fileName) { console.log("尝试下载文件...");