完成指导老师确认组队

This commit is contained in:
许允枞 2024-09-11 13:49:59 +08:00
parent 6b18b0a2e6
commit d5a65f01e9
9 changed files with 182 additions and 175 deletions

View File

@ -102,4 +102,12 @@ public class HitRegInfoUserController extends BaseController
{
return toAjax(hitRegInfoUserService.deleteHitRegInfoUserByIds(ids));
}
/**
* 根据用户id查询报名相关信息
*/
@GetMapping("/selectByUserId/{id}")
public AjaxResult selectByUserId(@PathVariable Long id) {
return success(hitRegInfoUserService.selectByUserId(id));
}
}

View File

@ -4,7 +4,6 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;

View File

@ -68,4 +68,11 @@ public interface IHitRegInfoUserService
* @return 结果
*/
public int deleteHitRegInfoUserByRegId(Long regId);
/**
* 根据用户id查询报名相关信息
* @param id
* @return
*/
HitRegInfoUser selectByUserId(Long id);
}

View File

@ -183,7 +183,7 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl<HitCompeti
String com_region = sysDictDataService.selectDictLabel("com_region", hitCompetitionStudentInfo.getDivision());
hitCompetitionStudentInfo.setDivisionLabel(com_region);
//根据学校查询领队老师
LambdaQueryWrapper<HitRegistrationTeachInfo> queryWrapper1 =new LambdaQueryWrapper<>();
LambdaQueryWrapper<HitRegistrationTeachInfo> queryWrapper1 =new LambdaQueryWrapper<>();
queryWrapper1.eq(HitRegistrationTeachInfo::getSchoolName,hitCompetitionStudentInfo.getSchoolName())
.likeRight(HitRegistrationTeachInfo::getCreateTime, year).eq(HitRegistrationTeachInfo::getType,1).eq(HitRegistrationTeachInfo::getStatus,1);
HitRegistrationTeachInfo hitRegistrationTeachInfo = hitRegistrationTeachInfoMapper.selectOne(queryWrapper1);

View File

@ -103,7 +103,7 @@ public class HitRegInfoUserServiceImpl implements IHitRegInfoUserService
for (HitRegInfoUser regInfoUser : hitRegInfoUsers) {
if (regInfoUser.getType().equals("2")){
SysUser sysUser = sysUserService.selectUserById(regInfoUser.getUserId());
if (sysUser.getUserType().equals("3")){
if ("3".equals(sysUser.getUserType())){
//将hitRegInfoUsers删除掉当前老师
hitRegInfoUsers.remove(regInfoUser);
}
@ -150,4 +150,17 @@ public class HitRegInfoUserServiceImpl implements IHitRegInfoUserService
queryWrapper.eq(HitRegInfoUser::getRegId,regId);
return hitRegInfoUserMapper.delete(queryWrapper);
}
/**
* 根据用户id查询报名相关信息
*
* @param id
* @return
*/
@Override
public HitRegInfoUser selectByUserId(Long id) {
LambdaQueryWrapper<HitRegInfoUser> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(HitRegInfoUser::getUserId,id);
return hitRegInfoUserMapper.selectOne(queryWrapper);
}
}

View File

@ -203,7 +203,11 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac
//领队老师
sysUser.setRoleIds(new Long[]{102L});
regFlag = userService.insertUser(sysUser)>0;
}else {
} else if (user.getUserType().equals("02")) {
//指导老师
sysUser.setRoleIds(new Long[]{103L});
regFlag = userService.insertUser(sysUser)>0;
} else {
regFlag= userService.registerUser(sysUser);
}
if (!regFlag) {

View File

@ -48,3 +48,10 @@ export function getHitRegistrationTeachInfoByUserId(id) {
method: 'get'
})
}
// 根据用户id查询教师信息
export function selectByUserId(id) {
return request({
url: '/system/hitRegUser/selectByUserId/' + id,
method: 'get'
})
}

View File

@ -2,48 +2,23 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="110px">
<el-form-item label="学校名称" prop="schoolName">
<el-input
v-model="queryParams.schoolName"
placeholder="请输入学校名称"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.schoolName" placeholder="请输入学校名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="学院名称" prop="collegeName">
<el-input
v-model="queryParams.collegeName"
placeholder="请输入学院名称"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.collegeName" placeholder="请输入学院名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="所属赛区" prop="division">
<el-input
v-model="queryParams.division"
placeholder="请输入所属赛区"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.division" placeholder="请输入所属赛区" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="团队名称" prop="teamName">
<el-input
v-model="queryParams.teamName"
placeholder="请输入团队名称"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.teamName" placeholder="请输入团队名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="大赛年份" prop="competitionYear">
<el-select v-model="queryParams.createTime" placeholder="请选择">
<el-option <el-option v-for="item in yearList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="大赛年份" prop="competitionYear">
<el-select v-model="queryParams.createTime" placeholder="请选择">
<el-option
<el-option
v-for="item in yearList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置刷新</el-button>
@ -51,18 +26,18 @@
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['hit:hitRegistrationStudentInfo:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['hit:hitRegistrationStudentInfo:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
@ -73,60 +48,58 @@
>导出</el-button>
</el-col>-->
<el-col :span="1.5">
<el-switch
v-model="registerStatus"
@change="updateRegisterStatus"
active-value="1"
inactive-value="0"
active-text="开启报名"
inactive-text="关闭报名">
<el-switch v-model="registerStatus" @change="updateRegisterStatus" active-value="1" inactive-value="0"
active-text="开启报名" inactive-text="关闭报名">
</el-switch>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table style="width: 100%; table-layout: auto" v-loading="loading" :data="HitRegistrationStudentInfoList" @selection-change="handleSelectionChange">
<el-table style="width: 100%; table-layout: auto" v-loading="loading" :data="HitRegistrationStudentInfoList"
@selection-change="handleSelectionChange">
<el-table-column type="expand">
<template slot-scope="props">
<el-descriptions :title="'领队老师'" style="margin-left: 10%" >
<el-descriptions-item label="老师姓名">{{props.row.ldTeacher.teacherName}}</el-descriptions-item>
<el-descriptions-item label="老师职务">{{props.row.ldTeacher.teacherJob}}</el-descriptions-item>
<el-descriptions-item label="老师手机号">{{props.row.ldTeacher.teacherNumber}}</el-descriptions-item>
<el-descriptions-item label="老师邮箱">{{props.row.ldTeacher.teacherEmail}}</el-descriptions-item>
<el-descriptions-item label="老师所在系及专业">{{props.row.ldTeacher.teacherSchool}}</el-descriptions-item>
<el-descriptions :title="'领队老师'" style="margin-left: 10%">
<el-descriptions-item label="老师姓名">{{ props.row.ldTeacher.teacherName }}</el-descriptions-item>
<el-descriptions-item label="老师职务">{{ props.row.ldTeacher.teacherJob }}</el-descriptions-item>
<el-descriptions-item label="老师手机号">{{ props.row.ldTeacher.teacherNumber }}</el-descriptions-item>
<el-descriptions-item label="老师邮箱">{{ props.row.ldTeacher.teacherEmail }}</el-descriptions-item>
<el-descriptions-item label="老师所在系及专业">{{ props.row.ldTeacher.teacherSchool }}</el-descriptions-item>
</el-descriptions>
<el-descriptions :title="'指导老师'+(index)" v-for="(item, index) in props.row.zdTeacher" style="margin-left: 10%" >
<el-descriptions-item label="老师姓名">{{item.teacherName}}</el-descriptions-item>
<el-descriptions-item label="老师职务">{{item.teacherJob}}</el-descriptions-item>
<el-descriptions-item label="老师手机号">{{item.teacherNumber}}</el-descriptions-item>
<el-descriptions-item label="老师邮箱">{{item.teacherEmail}}</el-descriptions-item>
<el-descriptions-item label="老师所在系及专业">{{item.teacherSchool}}</el-descriptions-item>
<el-descriptions :title="'指导老师' + (index)" v-for="(item, index) in props.row.zdTeacher"
style="margin-left: 10%">
<el-descriptions-item label="老师姓名">{{ item.teacherName }}</el-descriptions-item>
<el-descriptions-item label="老师职务">{{ item.teacherJob }}</el-descriptions-item>
<el-descriptions-item label="老师手机号">{{ item.teacherNumber }}</el-descriptions-item>
<el-descriptions-item label="老师邮箱">{{ item.teacherEmail }}</el-descriptions-item>
<el-descriptions-item label="老师所在系及专业">{{ item.teacherSchool }}</el-descriptions-item>
</el-descriptions>
<el-descriptions :title="'学生信息'+(index+1)" v-for="(item, index) in props.row.studentUserss" style="margin-left: 10%">
<el-descriptions :title="'学生信息' + (index + 1)" v-for="(item, index) in props.row.studentUserss"
style="margin-left: 10%">
<!-- <el-descriptions-item label="比赛名称">{{props.row.competitionName}}</el-descriptions-item>-->
<el-descriptions-item label="学生姓名">{{item.stuName}}</el-descriptions-item>
<el-descriptions-item label="学生性别">{{item.sex}}</el-descriptions-item>
<el-descriptions-item label="学生专业">{{item.major}}</el-descriptions-item>
<el-descriptions-item label="学生手机号">{{item.phoneNumber}}</el-descriptions-item>
<el-descriptions-item label="学生姓名">{{ item.stuName }}</el-descriptions-item>
<el-descriptions-item label="学生性别">{{ item.sex }}</el-descriptions-item>
<el-descriptions-item label="学生专业">{{ item.major }}</el-descriptions-item>
<el-descriptions-item label="学生手机号">{{ item.phoneNumber }}</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
<!-- <el-table-column label="比赛名称" align="center" prop="competitionName" />-->
<el-table-column label="大赛年份" align="center" prop="year" >
<!-- <el-table-column label="比赛名称" align="center" prop="competitionName" />-->
<el-table-column label="大赛年份" align="center" prop="year">
<template slot-scope="props">
{{props.row.createTime.substring(0,4)}}
{{ props.row.createTime.substring(0, 4) }}
</template>
</el-table-column>
<el-table-column label="所属赛区" align="center" prop="division" />
<el-table-column label="所属赛区" align="center" prop="division" />
<el-table-column label="学校名称" align="center" prop="schoolName" />
<el-table-column label="院系名称" align="center" prop="collegeName" />
<el-table-column label="团队名称" align="center" prop="teamName" />
<el-table-column label="盲样邮寄地址" align="center" prop="sampleAddress" />
<el-table-column label="收件人" align="center" prop="sampleConcat" />
<el-table-column label="联系电话" align="center" prop="sampleAddress" />
<el-table-column label="附件" align="center" prop="uploadFile" >
<el-table-column label="团队名称" align="center" prop="teamName" />
<el-table-column label="盲样邮寄地址" align="center" prop="sampleAddress" />
<el-table-column label="收件人" align="center" prop="sampleConcat" />
<el-table-column label="联系电话" align="center" prop="sampleAddress" />
<el-table-column label="附件" align="center" prop="uploadFile">
<template slot-scope="props">
<el-link :href="`${baseUrl}${props.row.uploadFile}`" type="primary" :underline="false" target="_blank">
<span class="el-icon-document"> 下载 </span>
@ -134,94 +107,63 @@
</template>
</el-table-column>
<el-table-column label="报名时间" align="center" prop="createTime" >
<el-table-column label="报名时间" align="center" prop="createTime">
<template slot-scope="props">
{{props.row.createTime.substring(0,11)}}
{{ props.row.createTime.substring(0, 11) }}
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="auditStatus" >
<el-table-column label="审核状态" align="center" prop="auditStatus" v-if="techerType != '0'">
<template slot-scope="props">
<div v-if="props.row.auditStatus=='0'" style="color:#007bff;"> 待审核</div>
<div v-if="props.row.auditStatus=='1'" style="color:green;"> 通过</div>
<div v-if="props.row.auditStatus=='2'" style="color:red;"> 拒绝</div>
<div v-if="props.row.auditStatus == '0'" style="color:#007bff;"> 待审核</div>
<div v-if="props.row.auditStatus == '1'" style="color:green;"> 通过</div>
<div v-if="props.row.auditStatus == '2'" style="color:red;"> 拒绝</div>
</template>
</el-table-column>
<el-table-column label="确认状态" align="center" v-if="techerType == '0' && zdTeacherList.includes(userId)" >
<template >
<div v-if="registrationInformation.status == '0'" style="color:#007bff;"> 待确认</div>
<div v-if="registrationInformation.status == '1'" style="color:green;"> 已通过</div>
<div v-if="registrationInformation.status == '2'" style="color:red;"> 已拒绝</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-popconfirm
title="确定当前操作?"
v-if="scope.row.auditStatus=='0'||scope.row.auditStatus=='2'"
@confirm="auditData(scope.row,'1')"
>
<el-button
size="mini"
type="text"
slot="reference"
>通过</el-button>
<el-popconfirm title="确定当前操作?"
v-if="techerType != '0' && scope.row.auditStatus == '0' || scope.row.auditStatus == '2'"
@confirm="auditData(scope.row, '1')">
<el-button size="mini" type="text" slot="reference">通过</el-button>
</el-popconfirm>
<el-popconfirm
title="确定当前操作?"
style="margin-left: 10px"
v-if="techerType != '1' && scope.row.auditStatus=='0'||scope.row.auditStatus=='1'"
@confirm="auditData(scope.row,'2')"
>
<el-button
size="mini"
type="text"
slot="reference"
>拒绝</el-button>
<el-popconfirm title="确定当前操作?" style="margin-left: 10px"
v-if="techerType != '0' && scope.row.auditStatus == '0' || scope.row.auditStatus == '1'"
@confirm="auditData(scope.row, '2')">
<el-button size="mini" type="text" slot="reference">拒绝</el-button>
</el-popconfirm>
<!-- 指导老师 -->
<el-popconfirm title="确定当前操作?" v-if="techerType == '0' && zdTeacherList.includes(userId)"
@confirm="submitData(1)">
<el-button size="mini" type="text" slot="reference">同意</el-button>
</el-popconfirm>
<el-popconfirm title="确定当前操作?" style="margin-left: 10px"
v-if="techerType == '0' && zdTeacherList.includes(userId)" @confirm="submitData(2)">
<el-button size="mini" type="text" slot="reference">拒绝</el-button>
</el-popconfirm>
<!-- 指导老师 -->
<el-popconfirm
title="确定当前操作?"
v-if="techerType == '1'"
@confirm="submitData(scope.row,'1')"
>
<el-button
size="mini"
type="text"
slot="reference"
>通过</el-button>
</el-popconfirm>
<el-popconfirm
title="确定当前操作?"
style="margin-left: 10px"
v-if="scope.row.auditStatus=='0'||scope.row.auditStatus=='1'"
@confirm="submitData(scope.row,'2')"
>
<el-button
size="mini"
type="text"
slot="reference"
>拒绝</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</template>
@ -235,8 +177,9 @@ import {
updateHitRegistrationStudentInfo,
getTeachInfoByIds
} from "@/api/hit/registrationStudentInfo";
import {selectBaseInfo, editStatus} from '@/api/cms/baseInfo'
import {getHitRegistrationTeachInfoByUserId} from '@/api/hit/teacherInfo'
import { selectBaseInfo, editStatus } from '@/api/cms/baseInfo'
import { getHitRegistrationTeachInfoByUserId, selectByUserId } from '@/api/hit/teacherInfo'
import { editRegUser } from '@/api/officialWebsite/registerStudent'
export default {
name: "HitRegistrationStudentInfo",
@ -245,13 +188,13 @@ export default {
return {
yearList: [],
baseUrl: process.env.VUE_APP_BASE_API,
registerStatus:"",
leaderTeachList:[],
guideTeachList:[],
registerStatus: "",
leaderTeachList: [],
guideTeachList: [],
//
loading: true,
//id
userId:'',
userId: '',
//
ids: [],
//
@ -261,7 +204,7 @@ export default {
//
showSearch: true,
//
techerType:0,
techerType: 0,
//
total: 0,
//
@ -270,6 +213,9 @@ export default {
title: "",
//
open: false,
zdTeacherList: [],
//
registrationInformation: {},
//
queryParams: {
pageNum: 1,
@ -285,7 +231,7 @@ export default {
teamName: null,
leaderIds: null,
guideIds: null,
teachName:null,
teachName: null,
createTime: null
},
//
@ -326,11 +272,10 @@ export default {
})
this.yearList = this.years();
// id
// this.userId = user.state.user.userId
console.log('当前登陆人id',this.$store);
console.log('当前登陆人id', this.$store);
this.userId = this.$store.state.user.id
this.getTeachInfoByIds(this.$store.state.user.id)
// const teacher = this.getTeachInfoByIds(this.userId)
// console.log('',teacher);
this.fetchRegistrationInformation()
},
methods: {
/** 查询报名信息列表 */
@ -338,19 +283,42 @@ export default {
this.loading = true;
listHitRegistrationStudentInfo(this.queryParams).then(response => {
this.HitRegistrationStudentInfoList = response.rows;
//
if (this.HitRegistrationStudentInfoList.length == 0) {
this.loading = false;
}
console.log("报名信息", this.HitRegistrationStudentInfoList);
this.zdTeacherList = this.HitRegistrationStudentInfoList[0].zdTeacher.map(teacher => teacher.userId);
this.total = response.total;
this.loading = false;
});
},
//
getTeachInfoByIds(id){
getTeachInfoByIds(id) {
getHitRegistrationTeachInfoByUserId(id).then(res => {
console.log('当前老师类型',res.data.type);
console.log('当前老师类型', res.data.type);
this.techerType = res.data.type
})
},
//
submitData(status) {
this.registrationInformation.status = status
console.log("这是提交的信息", this.registrationInformation)
editRegUser(this.registrationInformation).then(res => {
this.$modal.msgSuccess("成功")
this.fetchRegistrationInformation()
})
this.getList();
},
//
fetchRegistrationInformation() {
selectByUserId(this.userId).then(res => {
this.registrationInformation = res.data
console.log("这是获取的信息", data)
})
},
//
cancel() {
this.open = false;
@ -393,7 +361,7 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
@ -412,7 +380,7 @@ export default {
this.title = "修改报名信息";
});
},
auditData(data,status){
auditData(data, status) {
data.auditStatus = status
updateHitRegistrationStudentInfo(data).then(response => {
this.$modal.msgSuccess("成功");
@ -443,12 +411,12 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除报名信息编号为"' + ids + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除报名信息编号为"' + ids + '"的数据项?').then(function () {
return delHitRegistrationStudentInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
@ -456,21 +424,21 @@ export default {
...this.queryParams
}, `HitRegistrationStudentInfo_${new Date().getTime()}.xlsx`)
},
getTeachInfo(row){
if (row.leaderIds !== null && row.leaderIds.length !== 0){
getTeachInfo(row) {
if (row.leaderIds !== null && row.leaderIds.length !== 0) {
getTeachInfoByIds(row.leaderIds).then(res => {
this.leaderTeachList = res.data
})
}
if (row.guideIds !== null && row.guideIds.length !== 0){
if (row.guideIds !== null && row.guideIds.length !== 0) {
getTeachInfoByIds(row.guideIds).then(res => {
this.guideTeachList = res.data
})
}
},
updateRegisterStatus(){
updateRegisterStatus() {
editStatus(this.registerStatus).then(res => {
if (res.code === 200 ){
if (res.code === 200) {
this.$modal.msgSuccess(this.registerStatus === "1" ? "报名已开启" : "报名已关闭")
}
})
@ -496,10 +464,12 @@ export default {
.demo-table-expand {
font-size: 0;
}
.demo-table-expand label {
width: 90px;
color: #99a9bf;
}
.demo-table-expand .el-form-item {
margin-right: 0;
margin-bottom: 0;

View File

@ -27,7 +27,6 @@
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['system:user:import']"
>导入</el-button>
</el-col>