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 72f51ff..b900d2a 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 @@ -349,15 +349,18 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService if (ObjectUtils.isEmpty(hitRegInfoUser1)) { throw new RuntimeException("您并未参加战队"); } + if (ObjectUtil.isNotEmpty(hitRegInfoUser1.getType()) && !hitRegInfoUser1.getType().equals("1")) { + throw new RuntimeException("请由学生修改"); + } - HitRegInfo hitRegInfo1 = hitRegInfoMapper.selectOne(new LambdaQueryWrapper() - .eq(HitRegInfo::getId, hitRegInfoUser1.getRegId()) - .last("limit 1")); +// HitRegInfo hitRegInfo1 = hitRegInfoMapper.selectOne(new LambdaQueryWrapper() +// .eq(HitRegInfo::getId, hitRegInfoUser1.getRegId()) +// .last("limit 1")); //判断当前登陆人是否是领队老师,如果是查询该老师学校下的战队 - HitRegistrationTeachInfo teacherInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(userId); - if (teacherInfo != null && teacherInfo.getType().equals("1")) { - hitRegInfo.setSchoolName(teacherInfo.getSchoolName()); - } +// HitRegistrationTeachInfo teacherInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(userId); +// if (teacherInfo != null && teacherInfo.getType().equals("1")) { +// hitRegInfo.setSchoolName(teacherInfo.getSchoolName()); +// } PageUtils.startPage(); // List hitRegInfos = hitRegInfoMapper.selectHitRegInfoList(hitRegInfo); List hitRegInfos = hitRegInfoMapper.selectList(new LambdaQueryWrapper() 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 32577d7..44528eb 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 @@ -206,6 +206,8 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac sysUser.setRoleIds(new Long[]{103L}); regFlag = userService.insertUser(sysUser)>0; } else { + //指导老师 + sysUser.setRoleIds(new Long[]{2L}); regFlag= userService.registerUser(sysUser); } if (!regFlag) { diff --git a/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue b/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue index a1fed06..e75d902 100644 --- a/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue +++ b/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue @@ -302,21 +302,24 @@ export default { } } this.HitRegistrationStudentInfoList[i].competitionName = "" - const arr = this.splitStringToArray(this.HitRegistrationStudentInfoList[i].competition) - const arr2 = [] - //循环arr - for (let k = 0; k < arr.length; k++) { - //判断当前登录用户是否是指导老师 - if (arr[k] == "1") { - arr2.push('化验赛') - // this.HitRegistrationStudentInfoList[0].competitionName += "化验赛" - } else if (arr[k] == "2") { - arr2.push('虚拟赛') - // this.HitRegistrationStudentInfoList[0].competitionName += ",虚拟赛" - } - } - this.HitRegistrationStudentInfoList[i].competitionName = this.arrayToString(arr2); + //判断this.HitRegistrationStudentInfoList[i].competition不为空 + if (this.HitRegistrationStudentInfoList[i].competition != null) { + const arr = this.splitStringToArray(this.HitRegistrationStudentInfoList[i].competition) + const arr2 = [] + // 循环arr + for (let k = 0; k < arr.length; k++) { + //判断当前登录用户是否是指导老师 + if (arr[k] == "1") { + arr2.push('化验赛') + // this.HitRegistrationStudentInfoList[0].competitionName += "化验赛" + } else if (arr[k] == "2") { + arr2.push('虚拟赛') + // this.HitRegistrationStudentInfoList[0].competitionName += ",虚拟赛" + } + } + this.HitRegistrationStudentInfoList[i].competitionName = this.arrayToString(arr2); + } } console.log("this.HitRegistrationStudentInfoList", this.HitRegistrationStudentInfoList)