From 0eee3a2fa0a82ef3b362a7ad182dd9da37d0a0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Sat, 21 Sep 2024 13:49:15 +0800 Subject: [PATCH] =?UTF-8?q?9.21=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cms/service/IHitRegInfoUserService.java | 2 +- .../impl/HitRegInfoUserServiceImpl.java | 14 ++-- .../resources/mapper/system/SysUserMapper.xml | 3 +- .../classes/mapper/system/SysUserMapper.xml | 3 +- .../hit/registrationStudentInfo/index.vue | 70 +++++++++++-------- .../src/views/officialWebsite/competition.vue | 8 ++- 6 files changed, 61 insertions(+), 39 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoUserService.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoUserService.java index 0fe8e06..570fb97 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoUserService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoUserService.java @@ -74,5 +74,5 @@ public interface IHitRegInfoUserService * @param id * @return */ - HitRegInfoUser selectByUserId(Long id); + List selectByUserId(Long id); } 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 86342e0..217b3d3 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 @@ -1,7 +1,9 @@ package com.ruoyi.cms.service.impl; +import java.util.ArrayList; import java.util.List; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.cms.domain.HitRegInfo; @@ -99,17 +101,19 @@ public class HitRegInfoUserServiceImpl implements IHitRegInfoUserService .in(HitRegInfoUser::getType, "1","2") .eq(HitRegInfoUser::getStatus,"0"); List hitRegInfoUsers = hitRegInfoUserMapper.selectList(queryWrapper); + List hitList = new ArrayList<>(); //判断里面是否有指导老师,并且也是领队老师 for (HitRegInfoUser regInfoUser : hitRegInfoUsers) { + hitList.add(regInfoUser); if ("2".equals(regInfoUser.getType())){ SysUser sysUser = sysUserService.selectUserById(regInfoUser.getUserId()); if ("03".equals(sysUser.getUserType())){ //将hitRegInfoUsers删除掉当前老师 - hitRegInfoUsers.remove(regInfoUser); + hitList.remove(regInfoUser); } } } - if (CollectionUtil.isEmpty(hitRegInfoUsers)){ + if (CollectionUtil.isEmpty(hitList)){ //代表全部通过 Long regId = hitRegInfoUser.getRegId(); HitRegInfo hitRegInfo = hitRegInfoService.selectHitRegInfoById(regId); @@ -158,9 +162,9 @@ public class HitRegInfoUserServiceImpl implements IHitRegInfoUserService * @return */ @Override - public HitRegInfoUser selectByUserId(Long id) { + public List selectByUserId(Long id) { LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(HitRegInfoUser::getUserId,id).last("limit 1"); - return hitRegInfoUserMapper.selectOne(queryWrapper); + queryWrapper.eq(HitRegInfoUser::getUserId,id); + return hitRegInfoUserMapper.selectList(queryWrapper); } } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 385f3a0..ab30efa 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, + select u.user_id, u.dept_id,u.user_type, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark , d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u diff --git a/ruoyi-system/target/classes/mapper/system/SysUserMapper.xml b/ruoyi-system/target/classes/mapper/system/SysUserMapper.xml index 385f3a0..ab30efa 100644 --- a/ruoyi-system/target/classes/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/target/classes/mapper/system/SysUserMapper.xml @@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, + select u.user_id, u.dept_id,u.user_type, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark , d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u diff --git a/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue b/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue index dbb49c5..a8be6b2 100644 --- a/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue +++ b/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue @@ -112,45 +112,42 @@ {{ props.row.createTime.substring(0, 11) }} - + + - - -