From 10a9dd7bf0b0d0b44aee8cf2c390e7685641020b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Fri, 30 Aug 2024 10:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=90=8D=E5=AF=BC=E5=85=A5=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnualCompPointController.java | 95 +++++++++---------- .../entity/AnnualCompPointMb.java | 30 ++---- 2 files changed, 51 insertions(+), 74 deletions(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java index 5b2b5c14..fe1ba6b9 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java @@ -53,6 +53,8 @@ import org.jeecg.modules.demo.expscore.service.IExpScoreService; import org.jeecg.modules.demo.score_management.entity.ScoreManagement; import org.jeecg.modules.demo.scorepersion.entity.ScorePersion; import org.jeecg.modules.demo.scorepersion.service.IScorePersionService; +import org.jeecg.modules.demo.seteacher.entity.Seteacher; +import org.jeecg.modules.demo.seteacher.service.ISeteacherService; import org.jeecg.modules.demo.upfile_persion.entity.UpfilePersion; import org.jeecg.modules.demo.upfile_persion.service.IUpfilePersionService; import org.jeecg.modules.system.entity.SysDict; @@ -114,6 +116,8 @@ public class AnnualCompPointController extends JeecgController qw1 = new QueryWrapper<>(); qw1.eq("work_no", list.get(k).getStudentcode()); - List listsys1 = sysUserService.list(qw1); - tm.setUserId(listsys1.get(0).getId()); + SysUser listsys1 = sysUserService.getOne(qw1); + tm.setUserId(listsys1.getId()); tm.setCaptain("0"); teamManagementService.save(tm); //开始处理指导老师数据 @@ -1133,39 +1137,33 @@ public class AnnualCompPointController extends JeecgController teachertypelist = Arrays.asList(teachertypes); List teacherNamelist = Arrays.asList(teacherNames); - List teacherXllist = Arrays.asList(teacherXls); - List teacherZclist = Arrays.asList(teacherZcs); - List teacherZysList = Arrays.asList(teacherZys); - List teacherYjfxlist = Arrays.asList(teacherYjfxs); - List teacherPhonelist = Arrays.asList(teacherPhone); + List teauserwork = Arrays.asList(teacherXls); + List userbyworkonList = sysUserService.query().eq("work_no",teauserwork).list(); + List UserIDS= userbyworkonList.stream() + .map(SysUser::getId) // 提取每个 SysUser 的 id + .collect(Collectors.toList()); // 收集结果到 List + List seteacherList =seteacherService.query().in("user_id",UserIDS).list(); for (int c =0;c qw1 = new QueryWrapper<>(); qw1.eq("work_no",teamworknolist.get(a)); - List listsys1 = sysUserService.list(qw1); - tm.setUserId(listsys1.get(a).getId()); + SysUser listsys1 = sysUserService.getOne(qw1); + tm.setUserId(listsys1.getId()); if (a==0) { tm.setCaptain("1"); } @@ -1229,41 +1227,34 @@ public class AnnualCompPointController extends JeecgController teachertypelist = Arrays.asList(teachertypes); List teacherNamelist = Arrays.asList(teacherNames); - List teacherXllist = Arrays.asList(teacherXls); - List teacherZclist = Arrays.asList(teacherZcs); - List teacherZysList = Arrays.asList(teacherZys); - List teacherYjfxlist = Arrays.asList(teacherYjfxs); - List teacherPhonelist = Arrays.asList(teacherPhone); + //创建指导老师工号的成字符串数组 + String[] teacherXls1 = list.get(k).getTeacherUserworkon().split("%"); + List teauserwork1 = Arrays.asList(teacherXls1); + List userbyworkonList = sysUserService.query().in("work_no",teauserwork1).list(); + List UserIDS= userbyworkonList.stream() + .map(SysUser::getId) // 提取每个 SysUser 的 id + .collect(Collectors.toList()); // 收集结果到 List + List seteacherList =seteacherService.query().in("user_id",UserIDS).list(); for (int c =0;c