diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java index 942098d..e741d62 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/depsbncz/controller/DepsbnczController.java @@ -120,16 +120,19 @@ public class DepsbnczController extends JeecgController depsbnczs=depsbnczService.query().eq("annualid",annual.getId()).eq("depid",depiid).list(); - if (depsbnczs.size()>0){ + if (depiid == null || depiid.isEmpty()){ + return Result.error("请确定自己的单位信息是否完整"); + } + List depsbnczList =depsbnczService.query().eq("annualid",depsbncz.getAnnualid()).eq("depid",depiid).list(); + int a=0; + if (depsbnczList == null || depsbnczList.isEmpty()) { + + } else { + a=depsbnczList.size(); + } + if (a>0){ return Result.error("本年度已经添加过了"); }else { - depsbncz.setAnnualid(annual.getId()); depsbncz.setDepid(depiid); depsbnczService.save(depsbncz); return Result.OK("添加成功!"); @@ -146,6 +149,18 @@ public class DepsbnczController extends JeecgController edit(@RequestBody Depsbncz depsbncz) { + + List depsbnczList =depsbnczService.query().eq("annualid",depsbncz.getAnnualid()).eq("depid",depsbncz.getDepid()).list(); + int a=0; + if (depsbnczList == null || depsbnczList.isEmpty()) { + + } else { + a=depsbnczList.size(); + } + if (a>0){ + return Result.error("每年度仅可添加一次"); + } + depsbnczService.updateById(depsbncz); return Result.OK("编辑成功!"); } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java index 86d98f5..b26cfda 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java @@ -173,7 +173,12 @@ public class ExpertController extends JeecgController { //开始对比两个List获取相同部分,获取的交叉id就是需要的id List commonElements = userdepids.stream().filter(userbyrole::contains).collect(Collectors.toList()); //根据查询的userid去获取username - List sysUserList = sysUserService.query().in("id",commonElements).list(); + List sysUserList =new ArrayList<>(); + if(commonElements!=null && !commonElements.isEmpty()) { + sysUserList = sysUserService.query().in("id", commonElements).list(); + } else{ + return Result.error("目前没有专家注册。"); + } //根据查询的结果获取username的list List usernames = sysUserList.stream().map(SysUser::getUsername).collect(Collectors.toList()); diff --git a/jeecgboot-vue3/src/views/depsbncz/DepsbnczList.vue b/jeecgboot-vue3/src/views/depsbncz/DepsbnczList.vue index a9aa5ee..3407a05 100644 --- a/jeecgboot-vue3/src/views/depsbncz/DepsbnczList.vue +++ b/jeecgboot-vue3/src/views/depsbncz/DepsbnczList.vue @@ -4,6 +4,24 @@
+ + + + + + + + + + 查询 + 重置 + + {{ toggleSearchStatus ? '收起' : '展开' }} + + + + +
diff --git a/jeecgboot-vue3/src/views/depsbncz/components/DepsbnczForm.vue b/jeecgboot-vue3/src/views/depsbncz/components/DepsbnczForm.vue index b600b31..a275b60 100644 --- a/jeecgboot-vue3/src/views/depsbncz/components/DepsbnczForm.vue +++ b/jeecgboot-vue3/src/views/depsbncz/components/DepsbnczForm.vue @@ -4,6 +4,11 @@