From 984d2de95301976dd967856630d6ed65acbeb2aa Mon Sep 17 00:00:00 2001 From: Gitea Date: Thu, 11 Jul 2024 09:35:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=96=E9=A1=B9=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AwardPersionController.java | 128 ++++---- .../views/awardpersion/AwardPersionList.vue | 42 ++- .../views/awardpersion/AwardPersionList1.vue | 284 ++++++++++++++++++ 3 files changed, 393 insertions(+), 61 deletions(-) create mode 100644 jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList1.vue diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java index 7e633940..638dcb14 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java @@ -40,11 +40,10 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.modules.demo.comp.entity.Comp; import org.jeecg.modules.demo.comp.service.ICompService; +import org.jeecg.modules.demo.scorepersion.entity.ScorePersion; +import org.jeecg.modules.system.entity.SysRole; import org.jeecg.modules.system.entity.SysUser; -import org.jeecg.modules.system.entity.SysUserDepart; -import org.jeecg.modules.system.service.ISysDepartService; -import org.jeecg.modules.system.service.ISysUserDepartService; -import org.jeecg.modules.system.service.ISysUserService; +import org.jeecg.modules.system.service.*; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -92,9 +91,11 @@ public class AwardPersionController extends JeecgController queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); - queryWrappercomp.like("comp_admin",user.getUsername()); - List list = compService.list(queryWrappercomp); - List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); - QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); - queryWrapperAnnual.in(ids.size()!=0,"compid",ids); - List listAnnual = annualCompService.list(queryWrapperAnnual); - List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); - queryWrapper.in(annualIds.size()!=0,"annal_comp",annualIds); + List sysRoleList = sysUserRoleService.getUserRoleByUserId(user.getId()); + if(sysRoleList.get(0).getId().equals("1724327596426760194")){ + //学生(上传证书和查询)(根据学号查询筛选) + Page page = new Page(pageNo, pageSize); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); + queryWrapper.eq("studentcode",user.getUsername()); + IPage pageList = awardPersionService.page(page, queryWrapper); + return Result.OK(pageList); + }else if(sysRoleList.get(0).getId().equals("1693451972151386114")){ + //组委会(全部都可以)(根据比赛负责人查询比赛id筛选) + Comp comp = new Comp(); + QueryWrapper queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); + queryWrappercomp.like("comp_admin",user.getUsername()); + List list = compService.list(queryWrappercomp); + List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); + queryWrapperAnnual.in(ids.size()!=0,"compid",ids); + List listAnnual = annualCompService.list(queryWrapperAnnual); + List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); + queryWrapper.in(annualIds.size()!=0,"annal_comp",annualIds); - AnnualCompPoint annualCompPoint = new AnnualCompPoint(); - QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); - queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds); - queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 - List listacp = annualCompPointService.list(queryWrapperacp); - List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); - queryWrapper.in(acpIds.size()!=0,"annual_comp_p",acpIds); + AnnualCompPoint annualCompPoint = new AnnualCompPoint(); + QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); + queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds); + queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 + List listacp = annualCompPointService.list(queryWrapperacp); + List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); + queryWrapper.in(acpIds.size()!=0,"annual_comp_p",acpIds); + + Page page = new Page(pageNo, pageSize); + IPage pageList = awardPersionService.page(page, queryWrapper); + return Result.OK(pageList); + }else if(sysRoleList.get(0).getId().equals("1693452352310517762")){ + //学院(上传和查询)(根据部门查询数据,该学院下所有学生的获奖信息) + Page page = new Page(pageNo, pageSize); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); + queryWrapper.eq("studentorg",sysDepartService.queryDepartsByUsername(user.getUsername()).get(0).getOrgCode()); + IPage pageList = awardPersionService.page(page, queryWrapper); + return Result.OK(pageList); + }else { + //学校和超级管理员(全部都可以)(查全部数据) + Page page = new Page(pageNo, pageSize); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); + IPage pageList = awardPersionService.page(page, queryWrapper); + return Result.OK(pageList); + } - Page page = new Page(pageNo, pageSize); - IPage pageList = awardPersionService.page(page, queryWrapper); - return Result.OK(pageList); } @@ -204,10 +230,7 @@ public class AwardPersionController extends JeecgController queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap()); - queryWrappersud.eq("user_id",sysUser.getId()); - awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); + awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode()); awardPersionService.save(awardPersion); AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP()); annualCompPoint.setIsPj(1); @@ -217,15 +240,16 @@ public class AwardPersionController extends JeecgController queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap()); - queryWrappersud.eq("user_id",sysUser.getId()); - awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); + awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode()); awardPersionService.save(awardPersion); AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP()); annualCompPoint.setIsPj(1); annualCompPointService.updateById(annualCompPoint); return Result.OK("添加成功!"); +/* SysUserDepart sysUserDepart = new SysUserDepart(null,null); + QueryWrapper queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap()); + queryWrappersud.eq("user_id",sysUser.getId()); + awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());*/ } } @@ -270,20 +294,14 @@ public class AwardPersionController extends JeecgController queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap()); - queryWrappersud.eq("user_id",sysUser.getId()); - awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); + awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode()); awardPersionService.updateById(awardPersion); return Result.OK("编辑成功!"); }else { SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion.setStudentname(sysUser.getRealname()); awardPersion.setStudentcode(sysUser.getUsername()); - SysUserDepart sysUserDepart = new SysUserDepart(null,null); - QueryWrapper queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap()); - queryWrappersud.eq("user_id",sysUser.getId()); - awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); + awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode()); awardPersionService.updateById(awardPersion); return Result.OK("编辑成功!"); } @@ -482,10 +500,7 @@ public class AwardPersionController extends JeecgController listtm1 = teamManagementService.list(queryWrappertm1); SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId()); - SysUserDepart sysUserDepart = new SysUserDepart(null,null); - QueryWrapper queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, request.getParameterMap()); - queryWrappersud.eq("user_id",sysUser.getId()); - list.get(i).setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); + list.get(i).setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode()); if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){ list.get(i).setAwardsort(1); list.get(i).setAwardid(listaca.get(0).getId()); @@ -517,10 +532,7 @@ public class AwardPersionController extends JeecgController queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, request.getParameterMap()); - queryWrappersud.eq("user_id",sysUser.getId()); - list.get(i).setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode()); + list.get(i).setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode()); if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){ list.get(i).setAwardsort(1); list.get(i).setAwardid(listaca.get(0).getId()); @@ -587,4 +599,18 @@ public class AwardPersionController extends JeecgController sczs(@RequestBody AwardPersion awardPersion,HttpServletRequest req) { + awardPersionService.updateById(awardPersion); + return Result.OK("成功!"); + } + } diff --git a/jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue b/jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue index 4383f5d9..47f03ad3 100644 --- a/jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue +++ b/jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue @@ -54,7 +54,7 @@ @@ -92,6 +93,7 @@ import { downloadFile } from '/@/utils/common/renderUtils'; import AwardPersionModal from './components/AwardPersionModal.vue' import AwardPersionModal1 from './components/AwardPersionModal1.vue' + import AwardPersionModal2 from './components/AwardPersionModal2.vue' import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue'; import {collectScore} from "/@/views/annualCompPoint/committee/AnnualCompPoint.api"; @@ -101,6 +103,7 @@ const toggleSearchStatus = ref(false); const registerModal = ref(); const registerModal1 = ref(); + const registerModal2 = ref(); //注册table数据 const { prefixCls, tableContext, onExportXls, onImportXls,onExportXlsMb } = useListPage({ tableProps: { @@ -181,6 +184,14 @@ await deleteOne({ id: record.id }, handleSuccess); } + /** + * 上传证书事件 + */ + async function sczs(record) { + registerModal2.value.disableSubmit = false; + registerModal2.value.add(record); + } + /** * 批量删除事件 */ @@ -206,16 +217,27 @@ * 操作栏 */ function getTableAction(record) { - return [ - { + const actions = []; + actions.unshift({ + label: '上传证书', + onClick: sczs.bind(null, record), + }); + actions.unshift({ label: '编辑', onClick: handleEdit.bind(null, record), - }, - // { - // label: '个人能力量化', - // onClick: handlePersonalAbilityEvaluation.bind(null, record), - // }, - ]; + }); + actions.unshift({ + label: '详情', + onClick: handleDetail.bind(null, record), + }); + actions.unshift({ + label: '删除', + popConfirm: { + title: '是否确认删除', + confirm: handleDelete.bind(null, record), + } + }); + return actions; } /** @@ -232,7 +254,7 @@ title: '是否确认删除', confirm: handleDelete.bind(null, record), } - } + }, ] } diff --git a/jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList1.vue b/jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList1.vue new file mode 100644 index 00000000..6da922bd --- /dev/null +++ b/jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList1.vue @@ -0,0 +1,284 @@ + + + + +