main
rong.liu 11 months ago
parent 97d5da6a85
commit 5d0bb9f5a7
  1. 8
      nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java
  2. 1
      nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java
  3. 44
      nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java
  4. 2
      nakadai/src/main/java/com/huoran/nakadai/service/impl/EnterpriseCertificationServiceImpl.java

@ -7,8 +7,8 @@ import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils; import com.huoran.common.utils.TokenUtils;
import com.huoran.nakadai.config.AliRealNameAuthenticationConfig; import com.huoran.nakadai.config.AliRealNameAuthenticationConfig;
import com.huoran.nakadai.entity.EnterpriseCertification; import com.huoran.nakadai.entity.EnterpriseCertification;
import com.huoran.nakadai.entity.UserInfo;
import com.huoran.nakadai.entity.UserAuthenticationInformation; import com.huoran.nakadai.entity.UserAuthenticationInformation;
import com.huoran.nakadai.entity.UserInfo;
import com.huoran.nakadai.entity.res.BusinessLicenseOCRResp; import com.huoran.nakadai.entity.res.BusinessLicenseOCRResp;
import com.huoran.nakadai.entity.res.CreditCodeResp; import com.huoran.nakadai.entity.res.CreditCodeResp;
import com.huoran.nakadai.entity.res.IdCardOCRResp; import com.huoran.nakadai.entity.res.IdCardOCRResp;
@ -208,6 +208,10 @@ public class AliRealNameAuthenticationController {
QueryWrapper<EnterpriseCertification> queryWrapper = new QueryWrapper<>(); QueryWrapper<EnterpriseCertification> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("open_id", enterpriseCertification.getOpenId()); queryWrapper.eq("open_id", enterpriseCertification.getOpenId());
EnterpriseCertification certification = enterpriseCertificationService.getOne(queryWrapper); EnterpriseCertification certification = enterpriseCertificationService.getOne(queryWrapper);
if (certification == null) {
//通过后台删除组织信息的
return R.error("您已没有组织信息,请联系管理人员!");
}
enterpriseCertification.setId(certification.getId()); enterpriseCertification.setId(certification.getId());
try { try {
HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys); HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys);
@ -280,7 +284,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 " +"5a7f623d06724a4da5806c1fb0544e47"); 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());

@ -186,6 +186,7 @@ public class EnterpriseCertificationController {
accountQueryWrapper1.eq("platform_id",enterpriseCertification.getPlatformSource()); accountQueryWrapper1.eq("platform_id",enterpriseCertification.getPlatformSource());
HrUserAccount userAccount = userAccountService.getOne(accountQueryWrapper1);*/ HrUserAccount userAccount = userAccountService.getOne(accountQueryWrapper1);*/
//删除团队表
UserAccount userAccount = service.queryAccountInformation(enterpriseCertification.getOpenId(), Integer.valueOf(enterpriseCertification.getPlatformSource())); UserAccount userAccount = service.queryAccountInformation(enterpriseCertification.getOpenId(), Integer.valueOf(enterpriseCertification.getPlatformSource()));
service.deleteAccountInformation(userAccount.getId()); service.deleteAccountInformation(userAccount.getId());

@ -10,6 +10,7 @@ import com.huoran.common.utils.TokenUtils;
import com.huoran.nakadai.entity.PlatformTeam; import com.huoran.nakadai.entity.PlatformTeam;
import com.huoran.nakadai.entity.PlatformTeamAccount; import com.huoran.nakadai.entity.PlatformTeamAccount;
import com.huoran.nakadai.entity.PlatformTeamClassification; import com.huoran.nakadai.entity.PlatformTeamClassification;
import com.huoran.nakadai.entity.SupplierClassificationConfig;
import com.huoran.nakadai.entity.req.*; import com.huoran.nakadai.entity.req.*;
import com.huoran.nakadai.entity.res.PartnerAccountResp; import com.huoran.nakadai.entity.res.PartnerAccountResp;
import com.huoran.nakadai.entity.res.PlatformTeamAccountResp; import com.huoran.nakadai.entity.res.PlatformTeamAccountResp;
@ -154,9 +155,7 @@ public class PlatformTeamAccountController {
@GetMapping("/removeOrganization") @GetMapping("/removeOrganization")
@ApiOperation(value = "移除组织") @ApiOperation(value = "移除组织")
public R removeOrganization( public R removeOrganization(@ApiParam(name = "teamId", value = "团队id") @RequestParam Integer teamId, @ApiParam(name = "manageId", value = "组织id") @RequestParam Integer manageId) {
@ApiParam(name = "teamId", value = "团队id") @RequestParam Integer teamId,
@ApiParam(name = "manageId", value = "组织id") @RequestParam Integer manageId) {
PlatformTeamClassification teamClassification = platformTeamClassificationService.getById(teamId); PlatformTeamClassification teamClassification = platformTeamClassificationService.getById(teamId);
if (teamClassification.getIsTeam() == 1) { if (teamClassification.getIsTeam() == 1) {
throw new CustomException(ExceptionEnum.PARTNER_REMOVAL); throw new CustomException(ExceptionEnum.PARTNER_REMOVAL);
@ -180,8 +179,8 @@ public class PlatformTeamAccountController {
PlatformTeam platformTeam = platformTeamService.getOne(new QueryWrapper<PlatformTeam>().eq("classification_id", teamId)); PlatformTeam platformTeam = platformTeamService.getOne(new QueryWrapper<PlatformTeam>().eq("classification_id", teamId));
PlatformTeamAccount platformTeamAccount = platformTeamAccountService.getById(platformTeam.getManageId()); PlatformTeamAccount platformTeamAccount = platformTeamAccountService.getById(platformTeam.getManageId());
int status = 1; int status = 1;
if (isEnable==1){ if (isEnable == 1) {
status=0; status = 0;
} }
platformTeamClassificationService.updateByAccountId(platformTeamAccount.getAccountId(), status); platformTeamClassificationService.updateByAccountId(platformTeamAccount.getAccountId(), status);
return update ? R.ok() : R.error(); return update ? R.ok() : R.error();
@ -189,15 +188,13 @@ public class PlatformTeamAccountController {
@ApiOperation(value = "用户列表更新账号状态,禁用整个账号禁止登录,不管是哪个端,哪个组织") @ApiOperation(value = "用户列表更新账号状态,禁用整个账号禁止登录,不管是哪个端,哪个组织")
@PostMapping("/updateAccountStatus") @PostMapping("/updateAccountStatus")
public R updateAccountStatus( public R updateAccountStatus(@RequestParam("openId") @ApiParam(value = "openId") String openId, @RequestParam("isEnable") @ApiParam(value = "是否禁用(1->启用,0->禁用)") Integer isEnable) {
@RequestParam("openId") @ApiParam(value = "openId") String openId,
@RequestParam("isEnable") @ApiParam(value = "是否禁用(1->启用,0->禁用)") Integer isEnable) {
//根据openId查询账号详情List //根据openId查询账号详情List
List<UserAccount> userAccountList = platformTeamClassificationService.selectAccountList(openId); List<UserAccount> userAccountList = platformTeamClassificationService.selectAccountList(openId);
for (UserAccount userAccount : userAccountList) { for (UserAccount userAccount : userAccountList) {
//更新账号信息 //更新账号信息
platformTeamClassificationService.updateByAccountId(userAccount.getId(), isEnable); platformTeamClassificationService.updateByAccountId(userAccount.getId(), isEnable);
if (Integer.parseInt(userAccount.getPlatformId())!=7){ if (Integer.parseInt(userAccount.getPlatformId()) != 7) {
//查询账号绑定的组织信息 //查询账号绑定的组织信息
List<PlatformTeamAccount> platformTeamAccounts = platformTeamAccountService.list(new QueryWrapper<PlatformTeamAccount>().eq("account_id", userAccount.getId())); List<PlatformTeamAccount> platformTeamAccounts = platformTeamAccountService.list(new QueryWrapper<PlatformTeamAccount>().eq("account_id", userAccount.getId()));
for (PlatformTeamAccount platformTeamAccount : platformTeamAccounts) { for (PlatformTeamAccount platformTeamAccount : platformTeamAccounts) {
@ -206,8 +203,8 @@ public class PlatformTeamAccountController {
PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification(); PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification();
platformTeamClassification.setId(platformTeam.getClassificationId()); platformTeamClassification.setId(platformTeam.getClassificationId());
int status = 1; int status = 1;
if (isEnable==1){ if (isEnable == 1) {
status=0; status = 0;
} }
platformTeamClassification.setIsEnable(status); platformTeamClassification.setIsEnable(status);
//更新账号绑定的组织信息 //更新账号绑定的组织信息
@ -257,21 +254,30 @@ public class PlatformTeamAccountController {
Integer accountId = platformTeamService.getAccountIdByTeamId(teamInfo.getId()); Integer accountId = platformTeamService.getAccountIdByTeamId(teamInfo.getId());
//删除原有分类重新新增分类配置信息
supplierClassificationConfigService.deleteByAccountId(accountId);
//设置分类配置信息中的accountId
teamInfo.getSupplierClassificationConfigs().forEach(config -> config.setAccountId(accountId));
//新增分类配置信息 QueryWrapper<SupplierClassificationConfig> queryWrapper = new QueryWrapper<>();
supplierClassificationConfigService.saveBatch(teamInfo.getSupplierClassificationConfigs()); queryWrapper.eq("account_id", accountId);
//删除供应商原有分类重新新增分类配置信息
List<SupplierClassificationConfig> classificationConfigs = supplierClassificationConfigService.list(queryWrapper);
if (!classificationConfigs.isEmpty()){
supplierClassificationConfigService.remove(queryWrapper);
}
boolean update = platformTeamClassificationService.updateById(platformTeamClassification); if (teamInfo.getSupplierClassificationConfigs()!=null) {
return update ?R.ok():R.error(); for (SupplierClassificationConfig config : teamInfo.getSupplierClassificationConfigs()) {
//获取teamInfo.getSupplierClassificationConfigs()第一个账号id
config.setAccountId(accountId);
}
//新增分类配置信息
supplierClassificationConfigService.saveBatch(teamInfo.getSupplierClassificationConfigs());
} }
boolean update = platformTeamClassificationService.updateById(platformTeamClassification);
return update ? R.ok() : R.error();
}
@ApiOperation(value = "查询团队信息") @ApiOperation(value = "查询团队信息")

@ -68,7 +68,7 @@ public class EnterpriseCertificationServiceImpl extends ServiceImpl<EnterpriseCe
@Override @Override
public boolean deleteAccountInformation(Integer accountId) { public boolean deleteAccountInformation(Integer accountId) {
return baseMapper.deleteTeamInformation(accountId) > 0; return baseMapper.updateAccountInformation(accountId) > 0;
} }
@Override @Override

Loading…
Cancel
Save