更新部分功能

This commit is contained in:
许允枞 2024-09-11 09:28:32 +08:00
parent 23ba188b30
commit 6b18b0a2e6
19 changed files with 206 additions and 27 deletions

View File

@ -182,13 +182,10 @@ public class HitCompetitionStudentInfoController extends BaseController {
}
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
public AjaxResult importData(MultipartFile file) throws Exception
{
ExcelUtil<HitCompetitionStudentInfo> util = new ExcelUtil<HitCompetitionStudentInfo>(HitCompetitionStudentInfo.class);
List<HitCompetitionStudentInfo> hitList = util.importExcel(file.getInputStream());
logger.info("导入数据:"+hitList);
String operName = getUsername();
// String message = userService.importUser(hitList, updateSupport, operName);
String message = hitCompetitionStudentInfoService.importData(hitList);
return success(message);
}

View File

@ -2,6 +2,8 @@ package com.ruoyi.cms.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.cms.domain.vo.HitRegInfoVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -69,6 +69,7 @@ public class HitRegistrationStudentInfoController extends BaseController
return success(hitRegistrationStudentInfoService.selectHitRegistrationStudentInfoById(id));
}
/**
* 新增报名信息
*/

View File

@ -64,6 +64,13 @@ public class HitRegistrationTeachInfoController extends BaseController
return success(hitRegistrationTeachInfoService.selectHitRegistrationTeachInfoById(id));
}
@GetMapping(value = "/byUserId/{id}")
public AjaxResult getInfoByUserId(@PathVariable("id") Long id)
{
logger.info("接收到的用户id{}", id);
return success(hitRegistrationTeachInfoService.selectHitRegistrationTeachInfoByUseryId(id));
}
/**
* 新增教师信息
*/

View File

@ -0,0 +1,32 @@
package com.ruoyi.cms.domain.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.cms.domain.HitCompetitionStudentInfo;
import com.ruoyi.cms.domain.HitRegInfo;
import com.ruoyi.cms.domain.HitRegInfoUser;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 报名信息对象 hit_reg_info
*
* @author zcy
* @date 2024-08-20
*/
@Data
public class HitRegInfoVo extends BaseEntity
{
private List<HitRegInfo> hitRegInfo;
private String isZdteacher;
}

View File

@ -2,6 +2,7 @@ package com.ruoyi.cms.service;
import java.util.List;
import com.ruoyi.cms.domain.HitRegInfo;
import com.ruoyi.cms.domain.vo.HitRegInfoVo;
/**
* 报名信息Service接口
@ -26,6 +27,7 @@ public interface IHitRegInfoService
* @return 报名信息集合
*/
public List<HitRegInfo> selectHitRegInfoList(HitRegInfo hitRegInfo);
// public HitRegInfoVo selectHitRegInfoListC(HitRegInfo hitRegInfo);
/**
* 新增报名信息

View File

@ -19,6 +19,8 @@ public interface IHitRegistrationStudentInfoService
*/
public HitRegistrationStudentInfo selectHitRegistrationStudentInfoById(Long id);
/**
* 查询报名信息列表
*

View File

@ -1,5 +1,6 @@
package com.ruoyi.cms.service;
import com.ruoyi.cms.domain.HitRegistrationStudentInfo;
import com.ruoyi.common.core.domain.HitRegistrationTeachInfo;
import com.ruoyi.common.core.domain.model.RegisterBody;
import org.springframework.web.bind.annotation.RequestBody;
@ -22,6 +23,13 @@ public interface IHitRegistrationTeachInfoService
*/
public HitRegistrationTeachInfo selectHitRegistrationTeachInfoById(Long id);
/**
* 根据用户id获取教师信息
* @param id
* @return
*/
public HitRegistrationTeachInfo selectHitRegistrationTeachInfoByUseryId(Long id);
/**
* 查询教师信息列表
*

View File

@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.cms.domain.*;
import com.ruoyi.cms.domain.vo.HitRegInfoVo;
import com.ruoyi.cms.mapper.*;
import com.ruoyi.cms.service.ICmsContentService;
import com.ruoyi.cms.service.IHitCompetitionStudentInfoService;
@ -109,6 +110,44 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService
return hitRegInfos;
}
public HitRegInfoVo selectHitRegInfoListC(HitRegInfo hitRegInfo)
{
Long userId = SecurityUtils.getLoginUser().getUserId();
//判断当前登陆人是否是领队老师如果是查询该老师学校下的战队
HitRegistrationTeachInfo teacherInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(userId);
if (teacherInfo != null && teacherInfo.getType().equals("1")) {
hitRegInfo.setSchoolName(teacherInfo.getSchoolName());
}
List<HitRegInfo> hitRegInfos = hitRegInfoMapper.selectHitRegInfoList(hitRegInfo);
for (HitRegInfo regInfo : hitRegInfos) {
HitRegInfoUser hitRegInfoUser =new HitRegInfoUser();
hitRegInfoUser.setRegId(regInfo.getId());
List<HitRegInfoUser> hitRegInfoUsers = regInfoUserService.selectHitRegInfoUserList(hitRegInfoUser);
for (HitRegInfoUser regInfoUser : hitRegInfoUsers) {
switch (regInfoUser.getType()) {
case "3": {
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId());
regInfo.setLdTeacher(hitRegistrationTeachInfo);
break;
}
case "2": {
HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId());
regInfo.getZdTeacher().add(hitRegistrationTeachInfo);
break;
}
case "1":
HitCompetitionStudentInfo studentInfo = hitCompetitionStudentInfoMapper.selectHitCompetitionStudentInfoByUserId(regInfoUser.getUserId());
regInfo.getStudentUserss().add(studentInfo);
break;
}
}
}
HitRegInfoVo hitRegInfoVo = new HitRegInfoVo();
hitRegInfoVo.setHitRegInfo(hitRegInfos);
return hitRegInfoVo;
}
/**
* 新增报名信息
*

View File

@ -9,7 +9,9 @@ import com.ruoyi.cms.domain.HitRegInfoUser;
import com.ruoyi.cms.mapper.HitRegInfoUserMapper;
import com.ruoyi.cms.service.IHitRegInfoService;
import com.ruoyi.cms.service.IHitRegInfoUserService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -28,6 +30,8 @@ public class HitRegInfoUserServiceImpl implements IHitRegInfoUserService
private HitRegInfoUserMapper hitRegInfoUserMapper;
@Autowired
private IHitRegInfoService hitRegInfoService;
@Autowired
private ISysUserService sysUserService;
/**
* 查询报名相关人员信息
@ -90,9 +94,21 @@ public class HitRegInfoUserServiceImpl implements IHitRegInfoUserService
hitRegInfoUserMapper.updateHitRegInfoUser(hitRegInfoUser);
LambdaQueryWrapper<HitRegInfoUser> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(HitRegInfoUser::getRegId,hitRegInfoUser.getRegId())
.eq(HitRegInfoUser::getType,"1")
// .eq(HitRegInfoUser::getType,"1")
//需要指导老师也确认一下
.in(HitRegInfoUser::getType, "1","2")
.eq(HitRegInfoUser::getStatus,"0");
List<HitRegInfoUser> hitRegInfoUsers = hitRegInfoUserMapper.selectList(queryWrapper);
//判断里面是否有指导老师并且也是领队老师
for (HitRegInfoUser regInfoUser : hitRegInfoUsers) {
if (regInfoUser.getType().equals("2")){
SysUser sysUser = sysUserService.selectUserById(regInfoUser.getUserId());
if (sysUser.getUserType().equals("3")){
//将hitRegInfoUsers删除掉当前老师
hitRegInfoUsers.remove(regInfoUser);
}
}
}
if (CollectionUtil.isEmpty(hitRegInfoUsers)){
//代表全部通过
Long regId = hitRegInfoUser.getRegId();

View File

@ -1,6 +1,8 @@
package com.ruoyi.cms.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -32,6 +34,8 @@ public class HitRegistrationStudentInfoServiceImpl implements IHitRegistrationSt
return hitRegistrationStudentInfoMapper.selectHitRegistrationStudentInfoById(id);
}
/**
* 查询报名信息列表
*

View File

@ -5,6 +5,7 @@ import java.time.format.DateTimeFormatter;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.cms.domain.HitRegistrationStudentInfo;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.UserConstants;
@ -61,6 +62,18 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac
return hitRegistrationTeachInfoMapper.selectHitRegistrationTeachInfoById(id);
}
/**
* 根据用户id获取教师信息
* @param id
* @return
*/
@Override
public HitRegistrationTeachInfo selectHitRegistrationTeachInfoByUseryId(Long id) {
LambdaQueryWrapper<HitRegistrationTeachInfo> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(HitRegistrationTeachInfo::getUserId,id);
HitRegistrationTeachInfo hitRegistrationTeachInfo = hitRegistrationTeachInfoMapper.selectOne(queryWrapper);
return hitRegistrationTeachInfo;
}
/**
* 查询教师信息列表
*
@ -166,7 +179,6 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac
if (captchaEnabled) {
validateCaptcha(username, user.getCode(), user.getUuid());
}
boolean validPhoneNumber = isValidPhoneNumber(username);
if (!validPhoneNumber) {
msg = "手机号码格式不正确";

View File

@ -6,12 +6,12 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://61.156.90.46:3360/hgd_website?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&allowMultiQueries=true
# url: jdbc:mysql://localhost:3306/hgd_website?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&allowMultiQueries=true
username: obrhgd
# username: root
password: Obr7890&*()
# password: 123456
# url: jdbc:mysql://61.156.90.46:3360/hgd_website?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&allowMultiQueries=true
url: jdbc:mysql://localhost:3306/hgd_website?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&allowMultiQueries=true
# username: obrhgd
username: root
# password: Obr7890&*()
password: 123456
# 从库数据源
slave:
# 从数据源开关/默认关闭

View File

@ -74,8 +74,8 @@ spring:
# 数据库索引
database: 9
# 密码
# password: 123456
password:
password: 123456
# password:
# 连接超时时间
timeout: 10s
lettuce:

View File

@ -12,10 +12,6 @@ spring:
username: root
# password: Obr7890&*()
password: 123456
# master:
# url: jdbc:mysql://localhost:3306/ry-cms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: root
# 从库数据源
slave:
# 从数据源开关/默认关闭

View File

@ -75,6 +75,7 @@ spring:
database: 9
# 密码
password: 123456
# password:
# 连接超时时间
timeout: 10s
lettuce:

View File

@ -42,3 +42,9 @@ export function delHitRegistrationTeachInfo(id) {
method: 'delete'
})
}
export function getHitRegistrationTeachInfoByUserId(id) {
return request({
url: '/HitRegistrationTeachInfo/HitRegistrationTeachInfo/byUserId/' + id,
method: 'get'
})
}

View File

@ -167,7 +167,7 @@
<el-popconfirm
title="确定当前操作?"
style="margin-left: 10px"
v-if="scope.row.auditStatus=='0'||scope.row.auditStatus=='1'"
v-if="techerType != '1' && scope.row.auditStatus=='0'||scope.row.auditStatus=='1'"
@confirm="auditData(scope.row,'2')"
>
<el-button
@ -176,6 +176,39 @@
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>
@ -203,6 +236,7 @@ import {
getTeachInfoByIds
} from "@/api/hit/registrationStudentInfo";
import {selectBaseInfo, editStatus} from '@/api/cms/baseInfo'
import {getHitRegistrationTeachInfoByUserId} from '@/api/hit/teacherInfo'
export default {
name: "HitRegistrationStudentInfo",
@ -216,6 +250,8 @@ export default {
guideTeachList:[],
//
loading: true,
//id
userId:'',
//
ids: [],
//
@ -224,6 +260,8 @@ export default {
multiple: true,
//
showSearch: true,
//
techerType:0,
//
total: 0,
//
@ -287,6 +325,12 @@ export default {
this.registerStatus = res.data.registerStatus
})
this.yearList = this.years();
// id
// this.userId = user.state.user.userId
console.log('当前登陆人id',this.$store);
this.getTeachInfoByIds(this.$store.state.user.id)
// const teacher = this.getTeachInfoByIds(this.userId)
// console.log('',teacher);
},
methods: {
/** 查询报名信息列表 */
@ -294,11 +338,19 @@ export default {
this.loading = true;
listHitRegistrationStudentInfo(this.queryParams).then(response => {
this.HitRegistrationStudentInfoList = response.rows;
console.log("报名信息", this.HitRegistrationStudentInfoList);
this.total = response.total;
this.loading = false;
});
},
//
getTeachInfoByIds(id){
getHitRegistrationTeachInfoByUserId(id).then(res => {
console.log('当前老师类型',res.data.type);
this.techerType = res.data.type
})
},
//
cancel() {
this.open = false;

View File

@ -124,8 +124,8 @@
</div>
<div class="d-s">
<el-form-item label="赛事" prop="competition">
<el-checkbox-group v-model="preliminaryForm.competition" @change="onCompetition">
<el-checkbox label="1">化验赛</el-checkbox>
<el-checkbox-group v-model="preliminaryForm.competition">
<el-checkbox label="1">化验赛</el-checkbox>
<el-checkbox label="2">虚拟赛</el-checkbox>
</el-checkbox-group>
</el-form-item>
@ -181,7 +181,7 @@
</el-form-item>
</div>
<el-form-item v-if="!preliminaryForm.competition.includes('1')" label="盲样邮寄地址" prop="sampleAddress">
<el-form-item v-if="preliminaryForm.competition.includes('1')" label="盲样邮寄地址" prop="sampleAddress">
<el-input v-model="preliminaryForm.sampleAddress"></el-input>
</el-form-item>
<el-form-item label="附件" prop="uploadFile">
@ -472,9 +472,9 @@ export default {
this.fetchRegistrationInformation()
})
},
onCompetition(){
console.log("这是复选框点击事件", this.preliminaryForm.competition);
// if(this.preliminaryForm.competition)
//
arrayToString(arr) {
return arr.join(',');
},
//
loadUserInfo() {
@ -493,7 +493,7 @@ export default {
getStudentInfoByStuId(this.signUpForm.studentId)
.then(response => {
this.preliminaryForm = response.data;
this.preliminaryForm.competition=["1"]
this.preliminaryForm.competition = ["1"]
this.updateSignUpForm(response.data);
@ -627,6 +627,8 @@ export default {
},
//
preliminarySubmit() {
this.preliminaryForm.competition = this.arrayToString(this.preliminaryForm.competition);
console.log("个人选拔赛报名",this.preliminaryForm);
this.$refs["form"].validate(valid => {
if (valid) {
PreliminaryRegistration(this.preliminaryForm).then(res => {