From 8478119ad7fd1e8846713fc04d7c8753ae8f90ae Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Fri, 22 Dec 2023 17:52:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BC=81=E4=B8=9A=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E4=BF=A1=E6=81=AF=E7=9A=84=E5=90=8C=E6=97=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=A0=E9=99=A4=E5=9B=A2=E9=98=9F=E3=80=81=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E3=80=81=E8=B4=A6=E6=88=B7=E4=BF=A1=E6=81=AF=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterpriseCertificationController.java | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java b/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java index d8723f6..1e7d52a 100644 --- a/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java +++ b/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java @@ -1,11 +1,16 @@ package com.huoran.users.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.huoran.common.response.R; import com.huoran.common.utils.TokenUtils; import com.huoran.users.entity.EnterpriseCertification; +import com.huoran.users.entity.HrUserAccount; +import com.huoran.users.entity.HrUserInfo; import com.huoran.users.entity.req.EnterpriseCertificationLIstReq; import com.huoran.users.service.EnterpriseCertificationService; +import com.huoran.users.service.IHrUserAccountService; +import com.huoran.users.service.IHrUserInfoService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -34,6 +39,12 @@ public class EnterpriseCertificationController { @Autowired public EnterpriseCertificationService service; + @Autowired + public IHrUserAccountService userAccountService; + + @Autowired + public IHrUserInfoService userInfoService; + /** * 由前台申请认证后才有后台认证记录,认证状态有 待审核、已通过、未驳回三种状态,没有未提交这种状态 @@ -98,8 +109,7 @@ public class EnterpriseCertificationController { @PostMapping("/informationAudit") @ApiOperation(value = "信息审核", response = EnterpriseCertification.class) - public R informationAudit(@ApiParam(name = "auditStatus", value = "审核状态(2.通过,3.不通过)", required = true) @RequestParam Integer auditStatus, - @ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { + public R informationAudit(@ApiParam(name = "auditStatus", value = "审核状态(2.通过,3.不通过)", required = true) @RequestParam Integer auditStatus, @ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { // String accountId = TokenUtils.getIdByJwtToken(request); EnterpriseCertification enterpriseCertification = new EnterpriseCertification(); @@ -124,6 +134,28 @@ public class EnterpriseCertificationController { @PostMapping("/batchDeletion") @ApiOperation(value = "批量删除", response = EnterpriseCertification.class) public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestBody List ids) { + + for (Integer id : ids) { + // + + EnterpriseCertification enterpriseCertification = service.getById(id); + + //删除企业认证后同步删除团队、用户、账户信息 + + + //删除账号表 + QueryWrapper accountQueryWrapper1 = new QueryWrapper<>(); + accountQueryWrapper1.eq("id", enterpriseCertification.getAccountId()); + HrUserAccount userAccount = userAccountService.getOne(accountQueryWrapper1); + userAccountService.removeById(userAccount); + + //删除用户表 + userInfoService.removeById(userAccount.getUserId()); + + //删除团队信息表 + service.deleteTeamInformation(enterpriseCertification.getAccountId()); + } + boolean delState = service.removeByIds(ids); return delState ? R.ok() : R.error("删除失败"); }