From f4195efe59bbc627563a9380704dc2372661c08d Mon Sep 17 00:00:00 2001 From: "DESKTOP-G8BCEP0\\HP" <2037158277@qq.com> Date: Wed, 25 Aug 2021 11:11:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=90=E5=91=98=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MemberProjectController.java | 53 ---------------- .../xkrs/service/MemberProjectService.java | 28 --------- .../impl/MemberProjectServiceImpl.java | 62 ------------------- 3 files changed, 143 deletions(-) diff --git a/src/main/java/com/xkrs/controller/MemberProjectController.java b/src/main/java/com/xkrs/controller/MemberProjectController.java index e775a47..b737917 100644 --- a/src/main/java/com/xkrs/controller/MemberProjectController.java +++ b/src/main/java/com/xkrs/controller/MemberProjectController.java @@ -50,59 +50,6 @@ public class MemberProjectController { } } - /** - * 负责人对成员进行允许和拒绝的操作 - * @param map - * @param token - * @return - */ - @PostMapping("/memberOperateByPrincipal") - @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") - public String memberOperateByPrincipal(@RequestBody Map map,@RequestHeader(value="Authorization") String token){ - String projectNumber = (String) map.get("projectNumber"); - String keepType = (String) map.get("keepType"); - Integer userId = (Integer) map.get("userId"); - // 获取区域信息 - Locale locale = LocaleContextHolder.getLocale(); - // 验证token - String tokenUserName = TokenUtil.getTokenUserName(token); - SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); - if(sysUserByUserName == null){ - return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); - } - if("1".equals(keepType)){ - memberProjectService.memberByAllow(projectNumber,userId); - return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"已允许加入",locale); - }else { - memberProjectService.memberByRefuse(projectNumber,userId); - return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"已拒绝加入",locale); - } - } - - /** - * 查询成员的加入申请 - * @param projectNumber - * @param token - * @return - */ - @GetMapping("/selectMemberApplication") - @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") - public String selectMemberApplication(@RequestParam("projectNumber") String projectNumber,@RequestHeader(value="Authorization") String token){ - // 获取区域信息 - Locale locale = LocaleContextHolder.getLocale(); - // 验证token - String tokenUserName = TokenUtil.getTokenUserName(token); - SysUserEntity sysUserByUserName = sysUserService.getSysUserByUserName(tokenUserName); - if(sysUserByUserName == null){ - return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); - } - List memberApplicationVos = memberProjectService.selectMemberApplication(projectNumber); - if(memberApplicationVos == null || memberApplicationVos.size() == 0){ - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有任何加入的申请",locale); - } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS,memberApplicationVos,locale); - } - /** * 查询该项目加入的成员的信息 * @param projectNumber diff --git a/src/main/java/com/xkrs/service/MemberProjectService.java b/src/main/java/com/xkrs/service/MemberProjectService.java index c79a005..e593d5a 100644 --- a/src/main/java/com/xkrs/service/MemberProjectService.java +++ b/src/main/java/com/xkrs/service/MemberProjectService.java @@ -26,27 +26,6 @@ public interface MemberProjectService { */ String memberDropOut(String projectNumber,String token); - /** - * 成员被允许加入 - * @param projectNumber - * @param userId - */ - void memberByAllow(String projectNumber,Integer userId); - - /** - * 成员被拒绝加入 - * @param projectNumber - * @param userId - */ - void memberByRefuse(String projectNumber,Integer userId); - - /** - * 查询成员的加入申请 - * @param projectNumber - * @return - */ - List selectMemberApplication(String projectNumber); - /** * 查询加入的成员的信息 * @param projectNumber @@ -60,11 +39,4 @@ public interface MemberProjectService { * @return */ List selectProjectNumberByMemberId(Integer userId); - - /** - * 查询待审核的项目的编号 - * @param userId - * @return - */ - List selectProjectNumberByMemberIds(Integer userId); } diff --git a/src/main/java/com/xkrs/service/impl/MemberProjectServiceImpl.java b/src/main/java/com/xkrs/service/impl/MemberProjectServiceImpl.java index cacd048..16c3b68 100644 --- a/src/main/java/com/xkrs/service/impl/MemberProjectServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/MemberProjectServiceImpl.java @@ -112,53 +112,6 @@ public class MemberProjectServiceImpl implements MemberProjectService { return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"退出成功",locale); } - - - // -----------------------------------------------------------------------------------------* - /** - * 成员被允许加入 - * @param projectNumber - * @param userId - */ - @Transactional(rollbackOn = Exception.class) - @Override - public void memberByAllow(String projectNumber,Integer userId) { - WorkHourRecord workHourRecord = new WorkHourRecord(); - workHourRecord.setWorkContent("优化"); - workHourRecord.setWorkHour(0); - workHourRecord.setUserId(userId); - workHourRecord.setProjectNumber(projectNumber); - workHourRecord.setColor("1"); - workHourRecord.setSubmitTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); - workHourRecordDao.save(workHourRecord); - memberProjectDao.updateApplicationType("1",projectNumber); - memberProjectDao.updateJoinTime(DateTimeUtil.dateTimeToString(LocalDateTime.now()),projectNumber); - } - - /** - * 成员被拒绝加入 - * @param projectNumber - * @param userId - */ - @Transactional(rollbackOn = Exception.class) - @Override - public void memberByRefuse(String projectNumber,Integer userId) { - memberProjectDao.updateApplicationType("2",projectNumber); - } - - /** - * 查询成员的加入申请 - * @param projectNumber - * @return - */ - @Override - public List selectMemberApplication(String projectNumber) { - return memberProjectDao.selectMemberApplication(projectNumber); - } - //-----------------------------------------------------------------------------------------* - - - /** * 查询加入的成员的信息 * @param projectNumber @@ -180,19 +133,4 @@ public class MemberProjectServiceImpl implements MemberProjectService { } - - - //------------------------------------------------------------------------------* - /** - * 查询待审核项目的编号 - * @param userId - * @return - */ - @Override - public List selectProjectNumberByMemberIds(Integer userId) { - return memberProjectDao.selectProjectNumberByMemberId(userId,"0"); - } - //-----------------------------------------------------------------------------* - - }