From 522015271c9ed7aa408ae9b8778ecb08fb68e1e5 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Fri, 22 Dec 2023 14:16:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=8C=E6=AC=A1?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=90=8E=E6=9B=B4=E6=94=B9=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AliRealNameAuthenticationController.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 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 9a619cd..b74d434 100644 --- a/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java +++ b/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java @@ -269,6 +269,20 @@ public class AliRealNameAuthenticationController { return R.error(errorMsg); } 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("提交成功,请等待审核!"); } else { errorMsg = info.getReason(); @@ -282,10 +296,6 @@ public class AliRealNameAuthenticationController { userInfoService.removeById(userAccount.getUserId()); userAccountService.removeById(userAccount); - - // - - return R.error().put("message", info.getReason()); } } catch (Exception e) { From 999d9eec22ad14469b076868227162ed58e7af28 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Fri, 22 Dec 2023 14:45:04 +0800 Subject: [PATCH 2/3] commit --- .../controller/AliRealNameAuthenticationController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 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 b74d434..d060fa4 100644 --- a/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java +++ b/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java @@ -201,7 +201,7 @@ public class AliRealNameAuthenticationController { String method = "GET"; Map headers = new HashMap(); //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105 - headers.put("Authorization", "APPCODE " + AliRealNameAuthenticationConfig.ALI_API_APPCODE); + headers.put("Authorization", "APPCODE " + "5a7f623d06724a4da5806c1fb0544e47"); Map querys = new HashMap(); querys.put("ComapnyName", enterpriseCertification.getCompanyName()); querys.put("CreditCode", enterpriseCertification.getCreditCode()); @@ -210,7 +210,7 @@ public class AliRealNameAuthenticationController { String errorMsg = ""; //查询认证id QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("account_id", accountId); + queryWrapper.eq("open_id", enterpriseCertification.getOpenId()); EnterpriseCertification certification = enterpriseCertificationService.getOne(queryWrapper); enterpriseCertification.setId(certification.getId()); try { @@ -252,7 +252,7 @@ public class AliRealNameAuthenticationController { String method = "GET"; Map headers = new HashMap(); //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105 - headers.put("Authorization", "APPCODE " + AliRealNameAuthenticationConfig.ALI_API_APPCODE); + headers.put("Authorization", "APPCODE " +"5a7f623d06724a4da5806c1fb0544e47"); Map querys = new HashMap(); querys.put("ComapnyName", enterpriseCertification.getCompanyName()); querys.put("CreditCode", enterpriseCertification.getCreditCode()); From 81ab756cc45dfa3470f5d65283d933d89921e608 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Fri, 22 Dec 2023 14:50:43 +0800 Subject: [PATCH 3/3] 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();