Merge remote-tracking branch 'origin/main'

main
cheney 11 months ago
commit 46541bf37a
  1. 35
      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 io.swagger.annotations.ApiParam;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -201,7 +202,7 @@ public class AliRealNameAuthenticationController {
String method = "GET"; String method = "GET";
Map<String, String> headers = new HashMap<String, String>(); Map<String, String> headers = new HashMap<String, String>();
//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105 //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
headers.put("Authorization", "APPCODE " + AliRealNameAuthenticationConfig.ALI_API_APPCODE); headers.put("Authorization", "APPCODE " + "5a7f623d06724a4da5806c1fb0544e47");
Map<String, String> querys = new HashMap<String, String>(); Map<String, String> querys = new HashMap<String, String>();
querys.put("ComapnyName", enterpriseCertification.getCompanyName()); querys.put("ComapnyName", enterpriseCertification.getCompanyName());
querys.put("CreditCode", enterpriseCertification.getCreditCode()); querys.put("CreditCode", enterpriseCertification.getCreditCode());
@ -210,7 +211,7 @@ public class AliRealNameAuthenticationController {
String errorMsg = ""; String errorMsg = "";
//查询认证id //查询认证id
QueryWrapper<EnterpriseCertification> queryWrapper = new QueryWrapper<>(); QueryWrapper<EnterpriseCertification> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("account_id", accountId); queryWrapper.eq("open_id", enterpriseCertification.getOpenId());
EnterpriseCertification certification = enterpriseCertificationService.getOne(queryWrapper); EnterpriseCertification certification = enterpriseCertificationService.getOne(queryWrapper);
enterpriseCertification.setId(certification.getId()); enterpriseCertification.setId(certification.getId());
try { try {
@ -225,7 +226,9 @@ public class AliRealNameAuthenticationController {
} }
enterpriseCertificationService.updateById(enterpriseCertification); enterpriseCertificationService.updateById(enterpriseCertification);
return R.ok("提交成功,请等待审核!");
//更改二次验证的组织信息
return changeTeamInformation(enterpriseCertification);
} else { } else {
errorMsg = info.getReason(); errorMsg = info.getReason();
return R.error().put("message", 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<HrUserAccount> 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<HrUserInfo> 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) @ApiOperation(value = "统一社会信用代码认证(auditStatus给1,新增认证状态为待审核,用于个人认证幼儿园或供应商情况下)", response = CreditCodeResp.class)
@PostMapping("/organizationCertification") @PostMapping("/organizationCertification")
public R organizationCertification(@RequestBody EnterpriseCertification enterpriseCertification, HttpServletRequest request) throws IOException { public R organizationCertification(@RequestBody EnterpriseCertification enterpriseCertification, HttpServletRequest request) throws IOException {
@ -252,7 +271,7 @@ public class AliRealNameAuthenticationController {
String method = "GET"; String method = "GET";
Map<String, String> headers = new HashMap<String, String>(); Map<String, String> headers = new HashMap<String, String>();
//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105 //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
headers.put("Authorization", "APPCODE " + AliRealNameAuthenticationConfig.ALI_API_APPCODE); headers.put("Authorization", "APPCODE " +"5a7f623d06724a4da5806c1fb0544e47");
Map<String, String> querys = new HashMap<String, String>(); Map<String, String> querys = new HashMap<String, String>();
querys.put("ComapnyName", enterpriseCertification.getCompanyName()); querys.put("ComapnyName", enterpriseCertification.getCompanyName());
querys.put("CreditCode", enterpriseCertification.getCreditCode()); querys.put("CreditCode", enterpriseCertification.getCreditCode());
@ -269,7 +288,9 @@ public class AliRealNameAuthenticationController {
return R.error(errorMsg); return R.error(errorMsg);
} }
enterpriseCertificationService.save(enterpriseCertification); enterpriseCertificationService.save(enterpriseCertification);
return R.ok("提交成功,请等待审核!");
//更改二次验证的组织信息
return changeTeamInformation(enterpriseCertification);
} else { } else {
errorMsg = info.getReason(); errorMsg = info.getReason();
@ -282,10 +303,6 @@ public class AliRealNameAuthenticationController {
userInfoService.removeById(userAccount.getUserId()); userInfoService.removeById(userAccount.getUserId());
userAccountService.removeById(userAccount); userAccountService.removeById(userAccount);
//
return R.error().put("message", info.getReason()); return R.error().put("message", info.getReason());
} }
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save