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