From 3d1070bad1bc119133a71f5c0b83b1ac8d4d0ed2 Mon Sep 17 00:00:00 2001 From: cheney <1251790704@qq.com> Date: Tue, 26 Dec 2023 16:26:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E7=BB=84=E7=BB=87=EF=BC=8C?= =?UTF-8?q?=E5=9B=A2=E9=98=9F=E5=86=85=E8=BD=AC=E8=AE=A9=E8=B6=85=E7=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformTeamAccountController.java | 67 +++++++------------ .../nakadai/entity/req/TransferTeamReq.java | 10 ++- .../entity/res/PlatformTeamAccountResp.java | 7 +- .../nakadai/entity/res/TeamAccountResp.java | 6 ++ .../mapper/xml/PlatformTeamAccountMapper.xml | 40 +++++------ .../service/PlatformTeamAccountService.java | 7 +- .../impl/PlatformTeamAccountServiceImpl.java | 34 +++++++--- .../users/entity/res/OrganizationInfo.java | 3 + .../users/mapper/xml/HrUserAccountMapper.xml | 5 +- .../impl/HrUserAccountServiceImpl.java | 2 +- 10 files changed, 100 insertions(+), 81 deletions(-) diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java index 4fb6eb1..be0d108 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java @@ -136,50 +136,35 @@ public class PlatformTeamAccountController { // return platformTeamAccountService.transferAdmin(transferAdminReq); // } -// @PostMapping("/transferTeam") -// @ApiOperation(value = "团队内转让超管") -// public R transferTeam(@RequestBody @Valid TransferTeamReq transferTeamReq) { -// return platformTeamAccountService.transferTeam(transferTeamReq); -// } - - -// @PostMapping("/delPartnerAccount") -// @ApiOperation(value = "删除合伙人") -// public R delPartnerAccount( -// @ApiParam(name = "accountId", value = "账号id") -// @RequestParam Integer accountId) { -// return platformTeamAccountService.delPartnerAccount(accountId); -// } + @PostMapping("/transferTeam") + @ApiOperation(value = "团队内转让超管") + public R transferTeam(@RequestBody @Valid TransferTeamReq transferTeamReq) { + return platformTeamAccountService.transferTeam(transferTeamReq); + } -// @GetMapping("/partnerRemoval") -// @ApiOperation(value = "移除团队") -// public R partnerRemoval( -// @ApiParam(name = "teamId", value = "团队id") -// @RequestParam String teamId, -// @ApiParam(name = "partnerId", value = "合伙人id") -// @RequestParam String partnerId) { -// PartnerClassification partnerClassification = partnerClassificationService.getById(teamId); -// if (partnerClassification.getIsTeam() == 1) { -// throw new CustomException(ExceptionEnum.PARTNER_REMOVAL); -// } -// PartnerAccount partnerAccount = platformTeamAccountService.getById(partnerId); -// //删除团队成员 -// partnerClassificationService.removeById(Integer.parseInt(teamId)); -// //同步删除该团队相关角色信息 -// partnerClassificationService.removeRole(teamId,partnerAccount.getAccountId()); -// return partnerTeamService.remove(new QueryWrapper(). -// eq("partner_id", partnerId). -// eq("classification_id", teamId)) ? R.ok() : R.error(); -// } - + @GetMapping("/removeOrganization") + @ApiOperation(value = "移除组织") + public R removeOrganization( + @ApiParam(name = "teamId", value = "团队id") + @RequestParam Integer teamId, + @ApiParam(name = "manageId", value = "组织id") + @RequestParam Integer manageId) { + PlatformTeamClassification teamClassification = platformTeamClassificationService.getById(teamId); + if (teamClassification.getIsTeam() == 1) { + throw new CustomException(ExceptionEnum.PARTNER_REMOVAL); + } + //删除团队成员 + platformTeamClassificationService.removeById(teamId); + //TODO 删除该团队相关角色信息 + platformTeamAccountService.removeById(manageId); + boolean remove = platformTeamService.remove(new QueryWrapper(). + eq("manage_id", manageId). + eq("classification_id", teamId)); + return remove ? R.ok() : R.error(); + } -// @ApiOperation(value = "查询合伙人账号信息") -// @PostMapping("/queryPartnerAccount") -// public R queryPartnerAccount(@RequestParam String phone) { -// return platformTeamAccountService.queryPartnerAccount(phone); -// } - @ApiOperation(value = "后台更新团队状态,禁用无法切换到该组织") + @ApiOperation(value = "后台更新团队状态,禁用无法查询到该组织") @PostMapping("/updateTeamStatus") public R updateTeamStatus( @RequestParam("teamId") @ApiParam(value = "团队id") Integer teamId, diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/req/TransferTeamReq.java b/nakadai/src/main/java/com/huoran/nakadai/entity/req/TransferTeamReq.java index 817f1d5..2e48fef 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/req/TransferTeamReq.java +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/req/TransferTeamReq.java @@ -11,12 +11,18 @@ import lombok.Data; @Data public class TransferTeamReq { - @ApiModelProperty(value = "管理员合伙人id") - private Integer adminPartnerId; + @ApiModelProperty(value = "管理员组织id") + private Integer adminManageId; + + @ApiModelProperty(value = "成员组织id") + private Integer memberManageId; @ApiModelProperty(value = "管理员团队id") private Integer adminTeamId; + @ApiModelProperty(value = "管理员合伙人id") + private Integer adminPartnerId; + @ApiModelProperty(value = "成员合伙人id") private Integer memberPartnerId; diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/res/PlatformTeamAccountResp.java b/nakadai/src/main/java/com/huoran/nakadai/entity/res/PlatformTeamAccountResp.java index ddc0794..249ced8 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/res/PlatformTeamAccountResp.java +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/res/PlatformTeamAccountResp.java @@ -82,8 +82,11 @@ public class PlatformTeamAccountResp { @ApiModelProperty(value = "商务经理ids") private List businessManagerIds; -// @ApiModelProperty(value = "团队信息") -// private PartnerClassification partnerClassificationList; + @ApiModelProperty(value = "加入时间") + private String joinTime; + + @ApiModelProperty(value = "是否认证") + private String authentication; @ApiModelProperty(value = "是否是团队") private String isTeam; diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/res/TeamAccountResp.java b/nakadai/src/main/java/com/huoran/nakadai/entity/res/TeamAccountResp.java index 090417d..39a882a 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/res/TeamAccountResp.java +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/res/TeamAccountResp.java @@ -95,4 +95,10 @@ public class TeamAccountResp { @ApiModelProperty(value = "团队名称") private String teamName; + @ApiModelProperty(value = "加入时间") + private String joinTime; + + @ApiModelProperty(value = "是否认证") + private String authentication; + } diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml index acba710..1a23524 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml @@ -68,24 +68,23 @@ c.parent_id, a.account_id, c.is_team, - ( - SELECT - u.user_name - FROM - hr_user_info u - INNER JOIN hr_user_account ua - WHERE - ua.user_id = u.user_id - AND a.account_id = ua.id - ) AS userName + u.user_name, + c.create_time as joinTime, + CASE + WHEN count(ai.id) > 0 THEN '已认证' + ELSE '未认证' + END as authentication FROM k_platform_team t INNER JOIN k_platform_team_classification c ON c.id = t.classification_id INNER JOIN k_platform_team_account a ON a.manage_id = t.manage_id + INNER join hr_user_account ua on ua.id = a.account_id + INNER JOIN hr_user_info u on ua.user_id = u.user_id + left join hr_user_authentication_information ai on ai.open_id = ua.app_open_id WHERE c.is_del = 0 and c.is_enable = 0 AND a.is_del = 0 and a.platform_id = #{platformId} - AND account_id = #{accountId} + AND a.account_id = #{accountId}