From c988d487db0808b5e6add68f92ada04efe4bfae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Sun, 10 Nov 2024 09:08:02 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ExpprojectController.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/controller/ExpprojectController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/controller/ExpprojectController.java index 7ccdf64..b07adf5 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/controller/ExpprojectController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/controller/ExpprojectController.java @@ -2,7 +2,9 @@ package org.jeecg.modules.demo.expproject.controller; import java.io.UnsupportedEncodingException; import java.io.IOException; +import java.math.BigInteger; import java.net.URLDecoder; +import java.security.SecureRandom; import java.util.*; import java.util.stream.Collectors; @@ -141,11 +143,16 @@ public class ExpprojectController { public Result add(@RequestBody ExpprojectPage expprojectPage) { Expproject expproject = new Expproject(); BeanUtils.copyProperties(expprojectPage, expproject); - if (expproject.getNeedexp()>=expprojectPage.getExpandproList().size()) { + if (!expprojectPage.getExpandproList().isEmpty()) { + if (expproject.getNeedexp() >= expprojectPage.getExpandproList().size()) { + expprojectService.saveMain(expproject, expprojectPage.getExpandproList()); + return Result.OK("添加成功!"); + } else { + return Result.error("确定项目专家数量"); + } + }else { expprojectService.saveMain(expproject, expprojectPage.getExpandproList()); return Result.OK("添加成功!"); - }else { - return Result.error("确定项目专家数量"); } } @@ -241,9 +248,10 @@ public class ExpprojectController { List usernamelist = expandproService.getusernamelist(); Collections.shuffle(usernamelist); List randomUsers = getRandomUsers(usernamelist, a); - Expandpro expandpro =new Expandpro(); + List expertList = expertService.query().in("seusername",randomUsers).list(); for (int i=0;i