This commit is contained in:
zhuchunyun 2024-08-31 13:43:21 +08:00
parent 0150bdb84f
commit d9bf8bc801
12 changed files with 435 additions and 24 deletions

View File

@ -107,6 +107,15 @@ public class HitCompetitionStudentInfoController extends BaseController {
public AjaxResult getStudentInfoByStuId(@PathVariable("studentId") String studentId){
return success(hitCompetitionStudentInfoService.selectHitCompetitionStudentInfoByStuId(studentId));
}
/**
* 获取当前用户信息
* @return
*/
@GetMapping("/getStudentInfo")
public AjaxResult getStudentInfo(){
return success(hitCompetitionStudentInfoService.getStudentInfo());
}
/**
* 根据学校及赛区查询队友信息
* @param schoolName division

View File

@ -31,11 +31,12 @@ public class HitRegistrationTeachInfoController extends BaseController
/**
* 查询教师信息列表
*/
@PreAuthorize("@ss.hasPermi('HitRegistrationTeachInfo:HitRegistrationTeachInfo:list')")
@GetMapping("/list")
public TableDataInfo list(HitRegistrationTeachInfo hitRegistrationTeachInfo)
{
startPage();
List<HitRegistrationTeachInfo> list = hitRegistrationTeachInfoService.selectHitRegistrationTeachInfoList(hitRegistrationTeachInfo);
return getDataTable(list);
}

View File

@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -61,6 +62,10 @@ public class HitCompetitionStudentInfo implements Serializable {
@ApiModelProperty(value = "所属赛区")
private String division;
@TableField(exist = false)
private String divisionLabel;
@ApiModelProperty(value = "手机号")
private String phoneNumber;
@ -97,6 +102,7 @@ public class HitCompetitionStudentInfo implements Serializable {
private String updateBy;
@TableField(exist = false)
private String year;
@TableField(exist = false)
private HitRegistrationTeachInfo ldTeacherInfo;
}

View File

@ -70,6 +70,7 @@ public interface IHitCompetitionStudentInfoService extends IService<HitCompetiti
* @return
*/
HitCompetitionStudentInfo selectHitCompetitionStudentInfoByStuId(String studentId);
HitCompetitionStudentInfo getStudentInfo();
/**
* 根据学校名称和组别查询队友信息

View File

@ -17,6 +17,7 @@ import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysDictDataService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -47,6 +48,8 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl<HitCompeti
private HitTeamsMapper hitTeamsMapper;
@Autowired
private SysUserMapper sysUserMapper;
@Autowired
private ISysDictDataService sysDictDataService;
@ -140,12 +143,40 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl<HitCompeti
LambdaQueryWrapper<HitCompetitionStudentInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(HitCompetitionStudentInfo::getStudentId, studentId);
HitCompetitionStudentInfo hitCompetitionStudentInfo = hitCompetitionStudentInfoMapper.selectOne(queryWrapper);
if (hitCompetitionStudentInfo == null) {
String com_region = sysDictDataService.selectDictLabel("com_region", hitCompetitionStudentInfo.getDivision());
hitCompetitionStudentInfo.setDivisionLabel(com_region);
if (ObjectUtils.isEmpty(hitCompetitionStudentInfo) ) {
return new HitCompetitionStudentInfo();
}
return hitCompetitionStudentInfo;
}
@Override
public HitCompetitionStudentInfo getStudentInfo() {
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
//获取当前用户信息信息
SysUser user = SecurityUtils.getLoginUser().getUser();
LambdaQueryWrapper<HitCompetitionStudentInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(HitCompetitionStudentInfo::getUserId, user.getUserId());
queryWrapper.likeRight(HitCompetitionStudentInfo::getCreateTime, year);
HitCompetitionStudentInfo hitCompetitionStudentInfo = hitCompetitionStudentInfoMapper.selectOne(queryWrapper);
String com_region = sysDictDataService.selectDictLabel("com_region", hitCompetitionStudentInfo.getDivision());
hitCompetitionStudentInfo.setDivisionLabel(com_region);
if (ObjectUtils.isEmpty(hitCompetitionStudentInfo) ) {
return new HitCompetitionStudentInfo();
}
//根据学校查询领队老师
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);
hitCompetitionStudentInfo.setLdTeacherInfo(hitRegistrationTeachInfo);
return hitCompetitionStudentInfo;
}
@Override
public List<HitCompetitionStudentInfo> selectTeamMateBySchoolNameAndDivision(String schoolName, String division) {
//获取当前学生信息信息

View File

@ -1,5 +1,7 @@
package com.ruoyi.cms.service.impl;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -65,6 +67,11 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac
*/
@Override
public List<HitRegistrationTeachInfo> selectHitRegistrationTeachInfoList(HitRegistrationTeachInfo hitRegistrationTeachInfo) {
//获取当前年份
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy");
String currentYear = LocalDate.now().format(formatter);
hitRegistrationTeachInfo.setYear(currentYear);
return hitRegistrationTeachInfoMapper.selectHitRegistrationTeachInfoList(hitRegistrationTeachInfo);
}

View File

@ -32,7 +32,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectHitRegistrationTeachInfoList" parameterType="com.ruoyi.common.core.domain.HitRegistrationTeachInfo" resultMap="HitRegistrationTeachInfoResult">
select * from hit_registration_teach_info
<where>
<if test="hitRegId != null "> and hit_reg_id = #{hitRegId}</if>
<if test="teacherName != null and teacherName != ''"> and teacher_name like concat('%', #{teacherName}, '%')</if>
@ -42,7 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="teacherSchool != null and teacherSchool != ''"> and teacher_school = #{teacherSchool}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="year != null and year != ''"> and create_time like concat(#{year},'%') </if>
</where>
order by create_time desc
</select>
<select id="selectHitRegistrationTeachInfoById" parameterType="Long" resultMap="HitRegistrationTeachInfoResult">

View File

@ -1,6 +1,7 @@
package com.ruoyi.common.core.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
@ -70,6 +71,8 @@ public class HitRegistrationTeachInfo extends BaseEntity
private String SampleAddress;
//审核状态0待审核1审核通过2审核拒绝
private String status;
@TableField(exist = false)
private String year;
public String getSampleAddress() {
return SampleAddress;
@ -226,4 +229,12 @@ public class HitRegistrationTeachInfo extends BaseEntity
public void setUserId(Long userId) {
this.userId = userId;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询教师信息列表
export function listHitRegistrationTeachInfo(query) {
return request({
url: '/HitRegistrationTeachInfo/HitRegistrationTeachInfo/list',
method: 'get',
params: query
})
}
// 查询教师信息详细
export function getHitRegistrationTeachInfo(id) {
return request({
url: '/HitRegistrationTeachInfo/HitRegistrationTeachInfo/' + id,
method: 'get'
})
}
// 新增教师信息
export function addHitRegistrationTeachInfo(data) {
return request({
url: '/HitRegistrationTeachInfo/HitRegistrationTeachInfo',
method: 'post',
data: data
})
}
// 修改教师信息
export function updateHitRegistrationTeachInfo(data) {
return request({
url: '/HitRegistrationTeachInfo/HitRegistrationTeachInfo',
method: 'put',
data: data
})
}
// 删除教师信息
export function delHitRegistrationTeachInfo(id) {
return request({
url: '/HitRegistrationTeachInfo/HitRegistrationTeachInfo/' + id,
method: 'delete'
})
}

View File

@ -19,8 +19,7 @@ export function register(data){
//根据学号查询学生信息
export function getStudentInfoByStuId(studentId) {
// 直接将 studentId 插入到 URL 路径中
const url = `/system/hit_stu_info/${studentId}`;
const url = `/system/hit_stu_info/getStudentInfo`;
// 发送 GET 请求
return request({
url: url,

View File

@ -0,0 +1,301 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="教师姓名" prop="teacherName">
<el-input
v-model="queryParams.teacherName"
placeholder="请输入教师姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="teacherNumber">
<el-input
v-model="queryParams.teacherNumber"
placeholder="请输入教师手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</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>
</el-form-item>
</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"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="HitRegistrationTeachInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="教师姓名" align="center" prop="teacherName" />
<el-table-column label="教师职务" align="center" prop="teacherJob" />
<el-table-column label="教师手机号" align="center" prop="teacherNumber" />
<el-table-column label="教师email" align="center" prop="teacherEmail" />
<el-table-column label="教师所在系及专业" align="center" prop="teacherSchool" />
<el-table-column label="类型" align="center" prop="type" >
<template slot-scope="scope">
<div v-if="scope.row.type==0">指导老师</div>
<div v-else>领队老师</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<div v-if="scope.row.status==0">待审核</div>
<div style="color:green" v-else-if="scope.row.status==1">审核通过</div>
<div style="color:red" v-else>审核拒绝</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
v-if="scope.row.status==0"
@click="auditRecord(scope.row,1)"
>通过</el-button>
<el-button
size="mini"
type="text"
v-if="scope.row.status==0"
@click="auditRecord(scope.row,1)"
>拒绝</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改教师信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="教师姓名" prop="teacherName">
<el-input v-model="form.teacherName" placeholder="请输入教师姓名" />
</el-form-item>
<el-form-item label="教师职务" prop="teacherJob">
<el-input v-model="form.teacherJob" placeholder="请输入教师职务" />
</el-form-item>
<el-form-item label="教师手机号" prop="teacherNumber">
<el-input v-model="form.teacherNumber" placeholder="请输入教师手机号" />
</el-form-item>
<el-form-item label="教师email" prop="teacherEmail">
<el-input v-model="form.teacherEmail" placeholder="请输入教师email" />
</el-form-item>
<el-form-item label="教师所在系及专业" prop="teacherSchool">
<el-input v-model="form.teacherSchool" placeholder="请输入教师所在系及专业" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listHitRegistrationTeachInfo, getHitRegistrationTeachInfo, delHitRegistrationTeachInfo, addHitRegistrationTeachInfo, updateHitRegistrationTeachInfo } from "@/api/hit/teacherInfo";
export default {
name: "HitRegistrationTeachInfo",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
HitRegistrationTeachInfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
teacherName: null,
teacherNumber: null,
type: null
},
//
form: {},
//
rules: {
teacherName: [
{ required: true, message: "教师姓名不能为空", trigger: "blur" }
],
teacherJob: [
{ required: true, message: "教师职务不能为空", trigger: "blur" }
],
teacherNumber: [
{ required: true, message: "教师手机号不能为空", trigger: "blur" }
],
teacherEmail: [
{ required: true, message: "教师email不能为空", trigger: "blur" }
],
teacherSchool: [
{ required: true, message: "教师所在系及专业不能为空", trigger: "blur" }
],
delFlag: [
{ required: true, message: "逻辑删除0未删除1真删除不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询教师信息列表 */
getList() {
this.loading = true;
listHitRegistrationTeachInfo(this.queryParams).then(response => {
this.HitRegistrationTeachInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
hitRegId: null,
teacherName: null,
teacherJob: null,
teacherNumber: null,
teacherEmail: null,
teacherSchool: null,
remark: null,
delFlag: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
type: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加教师信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getHitRegistrationTeachInfo(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改教师信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateHitRegistrationTeachInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addHitRegistrationTeachInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
auditRecord(data,status){
data.status = status
updateHitRegistrationTeachInfo(data).then(response => {
this.$modal.msgSuccess("成功");
this.getList();
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除教师信息编号为"' + ids + '"的数据项?').then(function() {
return delHitRegistrationTeachInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('HitRegistrationTeachInfo/HitRegistrationTeachInfo/export', {
...this.queryParams
}, `HitRegistrationTeachInfo_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -90,11 +90,17 @@
初赛成绩{{ signUpForm.trialsScore }}
<el-form ref="form" :model="preliminaryForm" label-width="80px">
<el-form-item label="赛区">
<el-input v-model="preliminaryForm.division"></el-input>
<el-input v-model="preliminaryForm.divisionLabel"></el-input>
</el-form-item>
<el-form-item label="学校">
<el-input v-model="preliminaryForm.schoolName"></el-input>
</el-form-item>
<el-form-item label="领队老师">
<el-select v-model="preliminaryForm.leaderTeacher" placeholder="请选择领队老师">
<el-option v-for="item in teacherList" :key="item.id" :label="item.teacherName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="团队名称">
<el-input v-model="preliminaryForm.teamName"></el-input>
</el-form-item>
@ -110,12 +116,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="领队老师">
<el-select v-model="preliminaryForm.leaderTeacher" placeholder="请选择领队老师">
<el-option v-for="item in teacherList" :key="item.id" :label="item.teacherName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="指导老师1">
<el-select v-model="preliminaryForm.teacherOne" placeholder="请选择指导老师">
<el-option v-for="item in teacherList" :key="item.id" :label="item.teacherName" :value="item.id">
@ -324,7 +325,6 @@ export default {
loadUserInfo() {
if(getToken()){
getHomeUserInfo().then(response => {
this.signUpForm.studentId = response.data.userName;
this.preliminaryForm.division = response.data.division;
this.preliminaryForm.schoolName = response.data.schoolName;
@ -349,8 +349,8 @@ export default {
},
updateSignUpForm(data) {
this.preliminaryForm.division = data.division;
this.preliminaryForm.divisionLabel = data.divisionLabel;
this.preliminaryForm.schoolName = data.schoolName;
this.active = 1;
if(data.id== null){