From 81ab756cc45dfa3470f5d65283d933d89921e608 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Fri, 22 Dec 2023 14:50:43 +0800 Subject: [PATCH] commit --- .../AliRealNameAuthenticationController.java | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java b/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java index d060fa4..dd5e1a3 100644 --- a/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java +++ b/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java @@ -25,6 +25,7 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.http.HttpResponse; import org.apache.http.util.EntityUtils; +import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.*; @@ -225,7 +226,9 @@ public class AliRealNameAuthenticationController { } enterpriseCertificationService.updateById(enterpriseCertification); - return R.ok("提交成功,请等待审核!"); + + //更改二次验证的组织信息 + return changeTeamInformation(enterpriseCertification); } else { errorMsg = info.getReason(); return R.error().put("message", info.getReason()); @@ -239,6 +242,22 @@ public class AliRealNameAuthenticationController { } + @NotNull + private R changeTeamInformation(@RequestBody EnterpriseCertification enterpriseCertification) { + enterpriseCertification.setSubmitTime(new Date()); + QueryWrapper accountQueryWrapper1 = new QueryWrapper<>(); + accountQueryWrapper1.eq("app_open_id", enterpriseCertification.getOpenId()); + accountQueryWrapper1.eq("platform_id", enterpriseCertification.getPlatformSource()); + HrUserAccount userAccount1 = userAccountService.getOne(accountQueryWrapper1); + userAccount1.setAccount(enterpriseCertification.getCompanyName()); + userAccountService.updateById(userAccount1); + UpdateWrapper userInfoUpdateWrapper = new UpdateWrapper<>(); + userInfoUpdateWrapper.set("user_name", enterpriseCertification.getCompanyName()); + userInfoUpdateWrapper.eq("user_id", userAccount1.getUserId()); + userInfoService.update(new HrUserInfo(), userInfoUpdateWrapper); + return R.ok("提交成功,请等待审核!"); + } + @ApiOperation(value = "统一社会信用代码认证(auditStatus给1,新增认证状态为待审核,用于个人认证幼儿园或供应商情况下)", response = CreditCodeResp.class) @PostMapping("/organizationCertification") public R organizationCertification(@RequestBody EnterpriseCertification enterpriseCertification, HttpServletRequest request) throws IOException { @@ -271,19 +290,7 @@ public class AliRealNameAuthenticationController { enterpriseCertificationService.save(enterpriseCertification); //更改二次验证的组织信息 - enterpriseCertification.setSubmitTime(new Date()); - QueryWrapper accountQueryWrapper1 = new QueryWrapper<>(); - accountQueryWrapper1.eq("app_open_id", enterpriseCertification.getOpenId()); - accountQueryWrapper1.eq("platform_id", enterpriseCertification.getPlatformSource()); - HrUserAccount userAccount1 = userAccountService.getOne(accountQueryWrapper1); - userAccount1.setAccount(enterpriseCertification.getCompanyName()); - userAccountService.updateById(userAccount1); - UpdateWrapper userInfoUpdateWrapper = new UpdateWrapper<>(); - userInfoUpdateWrapper.set("user_name", enterpriseCertification.getCompanyName()); - userInfoUpdateWrapper.eq("user_id", userAccount1.getUserId()); - userInfoService.update(new HrUserInfo(), userInfoUpdateWrapper); - - return R.ok("提交成功,请等待审核!"); + return changeTeamInformation(enterpriseCertification); } else { errorMsg = info.getReason();