main 20240226
rong.liu 10 months ago
parent 0799fb99f3
commit a7dd58ab24
  1. 2
      common/src/main/java/com/huoran/common/utils/TokenUtils.java
  2. 4
      competition/src/main/java/com/huoran/competition/entity/vo/RegistrationNewInformationBroughtOutVO.java
  3. 3
      competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionRegistrationMapper.xml
  4. 9
      competition/src/main/java/com/huoran/competition/service/impl/CompetitionRegistrationServiceImpl.java
  5. 108
      nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java
  6. 23
      nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java
  7. 4
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/EnterpriseCertificationMapper.xml

@ -38,7 +38,7 @@ public class TokenUtils {
*/
public static String getIdByJwtToken(HttpServletRequest request) {
String jwtToken = request.getHeader("token");
System.out.println("------------------------------->>>TOKEN-------------"+jwtToken);
System.err.println("------------------------------->>>TOKEN-------------"+jwtToken);
if(StringUtils.isEmpty(jwtToken)) {
return "";
}

@ -42,6 +42,10 @@ public class RegistrationNewInformationBroughtOutVO {
@ApiModelProperty(value = "签到时间")
private String signInTime;
@ApiModelProperty(value = "团队id")
private Integer teamId;

@ -153,7 +153,8 @@
u.user_name,
a.id AS accountId,
c.classification_name AS organizationName,
( CASE ta.platform_id WHEN 6 THEN '供应商' WHEN 5 THEN '幼儿园' END ) AS platformId
( CASE ta.platform_id WHEN 6 THEN '供应商' WHEN 5 THEN '幼儿园' END ) AS platformId,
c.id AS teamId
FROM
nakadai.hr_user_account a
INNER JOIN nakadai.hr_user_info u ON u.user_id = a.user_id

@ -297,7 +297,14 @@ public class CompetitionRegistrationServiceImpl extends ServiceImpl<CompetitionR
@Override
public R getOrganizationalInformation(String phone, Integer accountId) {
return R.ok().put("data", baseMapper.getOrganizationalInformation(phone, accountId));
List<RegistrationNewInformationBroughtOutVO> voList=baseMapper.getOrganizationalInformation(phone, accountId);
if (!ObjectUtils.isEmpty(phone)){
if (voList.size() == 0){
return R.error("当前用户尚未注册,无法报名活动!");
}
}
return R.ok().put("data",voList );
}
@Override

@ -2,24 +2,29 @@ package com.huoran.nakadai.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.gson.Gson;
import com.huoran.common.entity.EnterpriseCertification;
import com.huoran.common.entity.UserAccount;
import com.huoran.common.entity.UserAuthenticationInformation;
import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils;
import com.huoran.nakadai.config.AliRealNameAuthenticationConfig;
import com.huoran.common.entity.EnterpriseCertification;
import com.huoran.nakadai.entity.PlatformTeam;
import com.huoran.nakadai.entity.PlatformTeamAccount;
import com.huoran.nakadai.entity.PlatformTeamClassification;
import com.huoran.nakadai.entity.UserInfo;
import com.huoran.common.entity.UserAuthenticationInformation;
import com.huoran.nakadai.entity.res.BusinessLicenseOCRResp;
import com.huoran.nakadai.entity.res.CreditCodeResp;
import com.huoran.nakadai.entity.res.IdCardOCRResp;
import com.huoran.nakadai.entity.res.RealNameAuthenticationResp;
import com.huoran.nakadai.service.EnterpriseCertificationService;
import com.huoran.nakadai.service.UserAuthenticationInformationService;
import com.huoran.nakadai.mapper.PlatformTeamClassificationMapper;
import com.huoran.nakadai.mapper.PlatformTeamMapper;
import com.huoran.nakadai.service.*;
import com.huoran.nakadai.utils.ali.FaceRecognitionAidUtil;
import com.huoran.nakadai.utils.ali.HttpUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import org.jetbrains.annotations.NotNull;
@ -48,6 +53,16 @@ public class AliRealNameAuthenticationController {
@Autowired
public EnterpriseCertificationService enterpriseCertificationService;
@Autowired
private PlatformTeamClassificationService platformTeamClassificationService;
@Autowired
public PlatformTeamAccountService platformTeamAccountService;
@Autowired
private PlatformTeamService platformTeamService;
@ApiOperation(value = "删除平台全部认证信息")
@PostMapping("/deletePlatformAuthenticationInformation")
public R deletePlatformAuthenticationInformation(@ApiParam(name = "openIds", value = "微信openId", required = true) @RequestBody List<String> openIds) {
@ -114,23 +129,12 @@ public class AliRealNameAuthenticationController {
userAuthenticationInformation.setCity(info.getCity());
userAuthenticationInformation.setCounty(info.getCounty());
/*QueryWrapper<HrUserAccount> accountQueryWrapper = new QueryWrapper<>();
accountQueryWrapper.eq("app_open_id", userAuthenticationInformation.getOpenId());
accountQueryWrapper.eq("platform_id", 7);*/
UserAccount userAccount = enterpriseCertificationService.queryAccountInformation(userAuthenticationInformation.getOpenId(), 7);
userAccount.setAccount(userAuthenticationInformation.getRealName());
/*userAccountService.updateById(userAccount);*/
enterpriseCertificationService.updateAccountInfo(userAccount);
/* UpdateWrapper<HrUserInfo> userInfoUpdateWrapper = new UpdateWrapper<>();
userInfoUpdateWrapper.set("user_name", userAuthenticationInformation.getRealName());
userInfoUpdateWrapper.eq("user_id", userAccount.getUserId());
userInfoService.update(new HrUserInfo(), userInfoUpdateWrapper);*/
UserInfo userInfo = new UserInfo();
userInfo.setUserName(userAuthenticationInformation.getRealName());
userInfo.setUserId(userAccount.getUserId());
@ -179,7 +183,6 @@ public class AliRealNameAuthenticationController {
}
} catch (Exception e) {
e.printStackTrace();
// ("营业执照图片验证失败,请重新再试!");
return R.error("营业执照图片验证失败,请重新再试!");
}
}
@ -211,7 +214,50 @@ public class AliRealNameAuthenticationController {
EnterpriseCertification certification = enterpriseCertificationService.getOne(queryWrapper);
if (certification == null) {
//通过后台删除组织信息的
return R.error("您已没有组织信息,请联系管理人员!");
/*return R.error("您已没有组织信息,请联系管理人员!");*/
//重新新增认证信息,且更改认证状态
enterpriseCertification.setAccountId(Integer.valueOf(accountId));
if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(), null, null))) {
return R.error("当前企业名称已存在!");
}
enterpriseCertification.setAuditStatus(1);
enterpriseCertification.setAuthenticationStatus(1);
enterpriseCertificationService.save(enterpriseCertification);
//新增团队信息
PlatformTeamAccount platformTeamAccount1 = platformTeamAccountService.getOne(new QueryWrapper<PlatformTeamAccount>().
eq("account_id", accountId).
eq("platform_id", enterpriseCertification.getPlatformSource()));
String teamName = "";
Integer classificationId = null;
if (platformTeamAccount1 == null) {
// 添加供应商/幼儿园信息
PlatformTeamAccount platformTeamAccount = new PlatformTeamAccount();
platformTeamAccount.setAccountId(Integer.valueOf(accountId));
platformTeamAccount.setPlatformId(Integer.valueOf(enterpriseCertification.getPlatformSource()));
platformTeamAccountService.save(platformTeamAccount);
// 添加所属供应商/幼儿园分类,分类为空直接新增团队
PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification();
platformTeamClassification.setIsTeam(1);
platformTeamClassification.setParentId(0);
platformTeamClassification.setLevel(1);
teamName = enterpriseCertification.getCompanyName();
classificationId = platformTeamClassification.getId();
platformTeamClassification.setClassificationName(teamName + "的团队");
boolean insert = platformTeamClassificationService.save(platformTeamClassification);
if (insert) {
PlatformTeam platformTeam = new PlatformTeam();
platformTeam.setManageId(platformTeamAccount.getManageId());
platformTeam.setClassificationId(platformTeamClassification.getId());
platformTeamService.save(platformTeam);
}
}
}
enterpriseCertification.setId(certification.getId());
try {
@ -220,8 +266,6 @@ public class AliRealNameAuthenticationController {
if (info.getStatus()) {
if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(), certification.getId(), enterpriseCertification.getOpenId()))) {
errorMsg = "企业名称已存在";
// (errorMsg);
return R.error(errorMsg);
}
@ -237,7 +281,6 @@ public class AliRealNameAuthenticationController {
}
} catch (Exception e) {
e.printStackTrace();
// (errorMsg);
return R.error(errorMsg);
}
@ -247,26 +290,11 @@ 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());*/
UserAccount userAccount1 = enterpriseCertificationService.queryAccountInformation(enterpriseCertification.getOpenId(),
Integer.valueOf(enterpriseCertification.getPlatformSource()));
UserAccount userAccount1 = enterpriseCertificationService.queryAccountInformation(enterpriseCertification.getOpenId(), Integer.valueOf(enterpriseCertification.getPlatformSource()));
// userAccountService.updateById(userAccount1);
userAccount1.setAccount(enterpriseCertification.getCompanyName());
enterpriseCertificationService.updateAccountInfo(userAccount1);
/* UpdateWrapper<HrUserInfo> userInfoUpdateWrapper = new UpdateWrapper<>();
userInfoUpdateWrapper.set("user_name", enterpriseCertification.getCompanyName());
userInfoUpdateWrapper.eq("user_id", userAccount1.getUserId());
userInfoService.update(new HrUserInfo(), userInfoUpdateWrapper);*/
/*UserInfo userInfo = new UserInfo();
userInfo.setUserName(enterpriseCertification.getCompanyName());
userInfo.setUserId(userAccount1.getUserId());
enterpriseCertificationService.updateUserInfo(userInfo);*/
//删除团队信息
// enterpriseCertificationService.deleteTeamInformation(enterpriseCertification.getAccountId());
return R.ok("提交成功,请等待审核!");
@ -274,7 +302,8 @@ public class AliRealNameAuthenticationController {
@ApiOperation(value = "统一社会信用代码认证(auditStatus给1,新增认证状态为待审核,用于个人认证幼儿园或供应商情况下)", response = CreditCodeResp.class)
@PostMapping("/organizationCertification")
public R organizationCertification(@RequestBody EnterpriseCertification enterpriseCertification, HttpServletRequest request) throws IOException {
public R organizationCertification (@RequestBody EnterpriseCertification
enterpriseCertification, HttpServletRequest request) throws IOException {
/*
String accountId = TokenUtils.getIdByJwtToken(request);
@ -285,7 +314,7 @@ public class AliRealNameAuthenticationController {
String method = "GET";
Map<String, String> headers = new HashMap<String, String>();
//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
headers.put("Authorization", "APPCODE " + "5a7f623d06724a4da5806c1fb0544e47");
headers.put("Authorization", "APPCODE " + "bd4ad25d0e41466eabb31d9baa16a79f");
Map<String, String> querys = new HashMap<String, String>();
querys.put("ComapnyName", enterpriseCertification.getCompanyName());
querys.put("CreditCode", enterpriseCertification.getCreditCode());
@ -315,8 +344,7 @@ public class AliRealNameAuthenticationController {
HrUserAccount userAccount = userAccountService.getOne(accountQueryWrapper);*/
UserAccount userAccount = enterpriseCertificationService.queryAccountInformation(enterpriseCertification.getOpenId(),
Integer.valueOf(enterpriseCertification.getPlatformSource()));
UserAccount userAccount = enterpriseCertificationService.queryAccountInformation(enterpriseCertification.getOpenId(), Integer.valueOf(enterpriseCertification.getPlatformSource()));
enterpriseCertificationService.deleteUserInformation(userAccount.getUserId());
enterpriseCertificationService.deleteAccountInformation(userAccount.getId());

@ -1,17 +1,16 @@
package com.huoran.nakadai.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.common.entity.EnterpriseCertification;
import com.huoran.common.entity.OrganizationInfo;
import com.huoran.common.entity.UserAccount;
import com.huoran.common.entity.UserAuthenticationInformation;
import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils;
import com.huoran.common.entity.EnterpriseCertification;
import com.huoran.nakadai.entity.req.EnterpriseCertificationLIstReq;
import com.huoran.nakadai.entity.vo.WxMssVo;
import com.huoran.nakadai.mapper.PlatformTeamAccountMapper;
import com.huoran.nakadai.service.EnterpriseCertificationService;
import com.huoran.nakadai.service.UserAuthenticationInformationService;
import com.huoran.nakadai.utils.WeChatUtil;
import io.swagger.annotations.Api;
@ -107,7 +106,8 @@ public class EnterpriseCertificationController {
String accountId = TokenUtils.getIdByJwtToken(request);
enterpriseCertification.setAccountId(Integer.valueOf(accountId));
if (!ObjectUtils.isEmpty(service.checkWhetherItExists(enterpriseCertification.getCompanyName(), null, null))) {
throw new RuntimeException("企业名称已存在");
/*throw new RuntimeException("企业名称已存在");*/
return R.error("企业名称已存在");
}
boolean addState = service.save(enterpriseCertification);
return addState ? R.ok() : R.error("新增失败");
@ -117,6 +117,23 @@ public class EnterpriseCertificationController {
@PostMapping("/update")
@ApiOperation(value = "修改", response = EnterpriseCertification.class)
public R update(@RequestBody @ApiParam(name = "企业实名认证信息记录对象", value = "传入json格式", required = true) EnterpriseCertification enterpriseCertification, HttpServletRequest request) {
//增加逻辑判断:然后后台改为通过的,此时审核状态为通过。如果又改回未认证的,那审核状态为未通过。(现在是会变为未提交)
//查询当前要更改前的企业认证信息(更改前)
/* auditStatus: 审核状态(0默认未提交 1.待审核,2.已通过,3.已驳回)*/
/* authenticationStatus: 认证状态(0默认未认证 1.认证中2.已认证)*/
EnterpriseCertification beforeChange = service.getById(enterpriseCertification.getId());
if (beforeChange.getAuthenticationStatus()==2&&beforeChange.getAuditStatus()==2){
//判断原数据为已通过已认证的状态下,通过后台编辑后更改为‘未认证’,此时审核状态应为为‘未通过’
if (enterpriseCertification.getAuthenticationStatus()==0&&enterpriseCertification.getAuditStatus()==0){
enterpriseCertification.setAuditStatus(3);
enterpriseCertification.setAuthenticationStatus(0);
}
}
boolean updateState = service.updateById(enterpriseCertification);
return updateState ? R.ok() : R.error("编辑失败");
}

@ -51,7 +51,7 @@
sc.classification_name as supplierClassificationName
FROM
hr_enterprise_certification c
INNER JOIN hr_user_account a ON a.id = c.account_id
INNER JOIN hr_user_account a ON a.app_open_id = c.open_id
INNER JOIN hr_user_info u ON u.user_id = a.user_id
LEFT JOIN hr_user_authentication_information info ON info.account_id = a.id
LEFT JOIN k_platform_team_account ta ON ta.account_id = a.id
@ -124,7 +124,7 @@
brief_introduction
FROM
hr_enterprise_certification c
INNER JOIN hr_user_account a ON a.id = c.account_id
INNER JOIN hr_user_account a ON a.app_open_id = c.open_id
INNER JOIN hr_user_info u ON u.user_id = a.user_id
LEFT JOIN hr_user_authentication_information info ON info.account_id = a.id
LEFT JOIN k_platform_team_account ta ON ta.account_id = a.id

Loading…
Cancel
Save