From 5d0bb9f5a750ca5d0c365bcacf02ffe35d3be9d1 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Tue, 9 Jan 2024 17:03:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AliRealNameAuthenticationController.java | 8 +++- .../EnterpriseCertificationController.java | 1 + .../PlatformTeamAccountController.java | 46 +++++++++++-------- .../EnterpriseCertificationServiceImpl.java | 2 +- 4 files changed, 34 insertions(+), 23 deletions(-) diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java index b94767a..45a0a76 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java @@ -7,8 +7,8 @@ import com.huoran.common.response.R; import com.huoran.common.utils.TokenUtils; import com.huoran.nakadai.config.AliRealNameAuthenticationConfig; import com.huoran.nakadai.entity.EnterpriseCertification; -import com.huoran.nakadai.entity.UserInfo; 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.CreditCodeResp; import com.huoran.nakadai.entity.res.IdCardOCRResp; @@ -208,6 +208,10 @@ public class AliRealNameAuthenticationController { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("open_id", enterpriseCertification.getOpenId()); EnterpriseCertification certification = enterpriseCertificationService.getOne(queryWrapper); + if (certification == null) { + //通过后台删除组织信息的 + return R.error("您已没有组织信息,请联系管理人员!"); + } enterpriseCertification.setId(certification.getId()); try { HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys); @@ -280,7 +284,7 @@ public class AliRealNameAuthenticationController { String method = "GET"; Map headers = new HashMap(); //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105 - headers.put("Authorization", "APPCODE " +"5a7f623d06724a4da5806c1fb0544e47"); + headers.put("Authorization", "APPCODE " + "5a7f623d06724a4da5806c1fb0544e47"); Map querys = new HashMap(); querys.put("ComapnyName", enterpriseCertification.getCompanyName()); querys.put("CreditCode", enterpriseCertification.getCreditCode()); diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java index 632b7b8..c0af77c 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java @@ -186,6 +186,7 @@ public class EnterpriseCertificationController { accountQueryWrapper1.eq("platform_id",enterpriseCertification.getPlatformSource()); HrUserAccount userAccount = userAccountService.getOne(accountQueryWrapper1);*/ + //删除团队表 UserAccount userAccount = service.queryAccountInformation(enterpriseCertification.getOpenId(), Integer.valueOf(enterpriseCertification.getPlatformSource())); service.deleteAccountInformation(userAccount.getId()); diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java index 6b18fed..2582061 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java @@ -10,6 +10,7 @@ import com.huoran.common.utils.TokenUtils; import com.huoran.nakadai.entity.PlatformTeam; import com.huoran.nakadai.entity.PlatformTeamAccount; import com.huoran.nakadai.entity.PlatformTeamClassification; +import com.huoran.nakadai.entity.SupplierClassificationConfig; import com.huoran.nakadai.entity.req.*; import com.huoran.nakadai.entity.res.PartnerAccountResp; import com.huoran.nakadai.entity.res.PlatformTeamAccountResp; @@ -154,9 +155,7 @@ public class PlatformTeamAccountController { @GetMapping("/removeOrganization") @ApiOperation(value = "移除组织") - public R removeOrganization( - @ApiParam(name = "teamId", value = "团队id") @RequestParam Integer teamId, - @ApiParam(name = "manageId", value = "组织id") @RequestParam Integer manageId) { + public R removeOrganization(@ApiParam(name = "teamId", value = "团队id") @RequestParam Integer teamId, @ApiParam(name = "manageId", value = "组织id") @RequestParam Integer manageId) { PlatformTeamClassification teamClassification = platformTeamClassificationService.getById(teamId); if (teamClassification.getIsTeam() == 1) { throw new CustomException(ExceptionEnum.PARTNER_REMOVAL); @@ -180,8 +179,8 @@ public class PlatformTeamAccountController { PlatformTeam platformTeam = platformTeamService.getOne(new QueryWrapper().eq("classification_id", teamId)); PlatformTeamAccount platformTeamAccount = platformTeamAccountService.getById(platformTeam.getManageId()); int status = 1; - if (isEnable==1){ - status=0; + if (isEnable == 1) { + status = 0; } platformTeamClassificationService.updateByAccountId(platformTeamAccount.getAccountId(), status); return update ? R.ok() : R.error(); @@ -189,15 +188,13 @@ public class PlatformTeamAccountController { @ApiOperation(value = "用户列表更新账号状态,禁用整个账号禁止登录,不管是哪个端,哪个组织") @PostMapping("/updateAccountStatus") - public R updateAccountStatus( - @RequestParam("openId") @ApiParam(value = "openId") String openId, - @RequestParam("isEnable") @ApiParam(value = "是否禁用(1->启用,0->禁用)") Integer isEnable) { + public R updateAccountStatus(@RequestParam("openId") @ApiParam(value = "openId") String openId, @RequestParam("isEnable") @ApiParam(value = "是否禁用(1->启用,0->禁用)") Integer isEnable) { //根据openId查询账号详情List List userAccountList = platformTeamClassificationService.selectAccountList(openId); for (UserAccount userAccount : userAccountList) { //更新账号信息 platformTeamClassificationService.updateByAccountId(userAccount.getId(), isEnable); - if (Integer.parseInt(userAccount.getPlatformId())!=7){ + if (Integer.parseInt(userAccount.getPlatformId()) != 7) { //查询账号绑定的组织信息 List platformTeamAccounts = platformTeamAccountService.list(new QueryWrapper().eq("account_id", userAccount.getId())); for (PlatformTeamAccount platformTeamAccount : platformTeamAccounts) { @@ -206,8 +203,8 @@ public class PlatformTeamAccountController { PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification(); platformTeamClassification.setId(platformTeam.getClassificationId()); int status = 1; - if (isEnable==1){ - status=0; + if (isEnable == 1) { + status = 0; } platformTeamClassification.setIsEnable(status); //更新账号绑定的组织信息 @@ -257,21 +254,30 @@ public class PlatformTeamAccountController { Integer accountId = platformTeamService.getAccountIdByTeamId(teamInfo.getId()); - //删除原有分类重新新增分类配置信息 - supplierClassificationConfigService.deleteByAccountId(accountId); - //设置分类配置信息中的accountId - teamInfo.getSupplierClassificationConfigs().forEach(config -> config.setAccountId(accountId)); - //新增分类配置信息 - supplierClassificationConfigService.saveBatch(teamInfo.getSupplierClassificationConfigs()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("account_id", accountId); + //删除供应商原有分类重新新增分类配置信息 + List classificationConfigs = supplierClassificationConfigService.list(queryWrapper); + if (!classificationConfigs.isEmpty()){ + supplierClassificationConfigService.remove(queryWrapper); + } - boolean update = platformTeamClassificationService.updateById(platformTeamClassification); - return update ?R.ok():R.error(); - } + if (teamInfo.getSupplierClassificationConfigs()!=null) { + 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 = "查询团队信息") diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/EnterpriseCertificationServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/EnterpriseCertificationServiceImpl.java index 5a834fb..b3acd23 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/EnterpriseCertificationServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/EnterpriseCertificationServiceImpl.java @@ -68,7 +68,7 @@ public class EnterpriseCertificationServiceImpl extends ServiceImpl 0; + return baseMapper.updateAccountInformation(accountId) > 0; } @Override