From 31409fdfb7b56f2feb1a6e45e31371669c72b723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Mon, 11 Nov 2024 09:02:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DepsbnczController.java | 31 +++++++++++----- .../expert/controller/ExpertController.java | 7 +++- .../src/views/depsbncz/DepsbnczList.vue | 18 ++++++++++ .../depsbncz/components/DepsbnczForm.vue | 7 ++++ .../src/views/expert/admin/ExpertList.vue | 23 +++++------- .../src/views/expert/adminback/ExpertList.vue | 23 +++++------- .../src/views/expert/county/ExpertList.vue | 23 ++++++------ .../src/views/expert/firm/ExpertList.vue | 29 +++++---------- .../src/views/expert/self/ExpertList.vue | 35 +------------------ .../src/views/expert/selfback/ExpertList.vue | 35 +------------------ 10 files changed, 94 insertions(+), 137 deletions(-) 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 @@