diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitCompetitionStudentInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitCompetitionStudentInfoController.java index dbcb9dd..b70cd80 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitCompetitionStudentInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitCompetitionStudentInfoController.java @@ -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 util = new ExcelUtil(HitCompetitionStudentInfo.class); List 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); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java index 3c6b066..a258799 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java @@ -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; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationStudentInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationStudentInfoController.java index 194c01d..48cad6b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationStudentInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationStudentInfoController.java @@ -69,6 +69,7 @@ public class HitRegistrationStudentInfoController extends BaseController return success(hitRegistrationStudentInfoService.selectHitRegistrationStudentInfoById(id)); } + /** * 新增报名信息 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationTeachInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationTeachInfoController.java index 2e977ab..30679b7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationTeachInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationTeachInfoController.java @@ -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)); + } + /** * 新增教师信息 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/vo/HitRegInfoVo.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/vo/HitRegInfoVo.java new file mode 100644 index 0000000..dfa18c7 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/vo/HitRegInfoVo.java @@ -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; + private String isZdteacher; + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java index 3cb19ed..3e6e2e6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java @@ -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 selectHitRegInfoList(HitRegInfo hitRegInfo); +// public HitRegInfoVo selectHitRegInfoListC(HitRegInfo hitRegInfo); /** * 新增报名信息 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationStudentInfoService.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationStudentInfoService.java index 403b336..ab33555 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationStudentInfoService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationStudentInfoService.java @@ -19,6 +19,8 @@ public interface IHitRegistrationStudentInfoService */ public HitRegistrationStudentInfo selectHitRegistrationStudentInfoById(Long id); + + /** * 查询报名信息列表 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationTeachInfoService.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationTeachInfoService.java index 545bbd7..aa9dd6d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationTeachInfoService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationTeachInfoService.java @@ -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); + /** * 查询教师信息列表 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java index 0fed593..7e4fb64 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java @@ -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 hitRegInfos = hitRegInfoMapper.selectHitRegInfoList(hitRegInfo); + for (HitRegInfo regInfo : hitRegInfos) { + HitRegInfoUser hitRegInfoUser =new HitRegInfoUser(); + hitRegInfoUser.setRegId(regInfo.getId()); + List 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; + } + /** * 新增报名信息 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoUserServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoUserServiceImpl.java index 7682ae4..63907cd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoUserServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoUserServiceImpl.java @@ -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 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 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(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationStudentInfoServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationStudentInfoServiceImpl.java index 5b8f10e..79291ab 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationStudentInfoServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationStudentInfoServiceImpl.java @@ -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); } + + /** * 查询报名信息列表 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java index c45b0c1..4a1bddf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java @@ -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 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 = "手机号码格式不正确"; diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index b78e34d..1dfff41 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -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: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 04f7916..6649b08 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -74,8 +74,8 @@ spring: # 数据库索引 database: 9 # 密码 -# password: 123456 - password: + password: 123456 +# password: # 连接超时时间 timeout: 10s lettuce: diff --git a/ruoyi-admin/target/classes/application-druid.yml b/ruoyi-admin/target/classes/application-druid.yml index 9bd9feb..1dfff41 100644 --- a/ruoyi-admin/target/classes/application-druid.yml +++ b/ruoyi-admin/target/classes/application-druid.yml @@ -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: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/target/classes/application.yml b/ruoyi-admin/target/classes/application.yml index be57f0c..6649b08 100644 --- a/ruoyi-admin/target/classes/application.yml +++ b/ruoyi-admin/target/classes/application.yml @@ -75,6 +75,7 @@ spring: database: 9 # 密码 password: 123456 +# password: # 连接超时时间 timeout: 10s lettuce: diff --git a/ruoyi-ui/src/api/hit/teacherInfo.js b/ruoyi-ui/src/api/hit/teacherInfo.js index 6047e4f..dcba935 100644 --- a/ruoyi-ui/src/api/hit/teacherInfo.js +++ b/ruoyi-ui/src/api/hit/teacherInfo.js @@ -42,3 +42,9 @@ export function delHitRegistrationTeachInfo(id) { method: 'delete' }) } +export function getHitRegistrationTeachInfoByUserId(id) { + return request({ + url: '/HitRegistrationTeachInfo/HitRegistrationTeachInfo/byUserId/' + id, + method: 'get' + }) +} diff --git a/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue b/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue index 6208427..6e43336 100644 --- a/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue +++ b/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue @@ -167,7 +167,7 @@ 拒绝 + + + + + + + 通过 + + + + 拒绝 + + + @@ -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; diff --git a/ruoyi-ui/src/views/officialWebsite/competition.vue b/ruoyi-ui/src/views/officialWebsite/competition.vue index 4fe8983..44e458b 100644 --- a/ruoyi-ui/src/views/officialWebsite/competition.vue +++ b/ruoyi-ui/src/views/officialWebsite/competition.vue @@ -124,9 +124,9 @@
- - 化验赛 - 虚拟赛 + + 化验赛 + 虚拟赛
@@ -181,7 +181,7 @@ - + @@ -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 => {