|
|
|
@ -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); |
|
|
|
@ -189,9 +188,7 @@ 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<UserAccount> userAccountList = platformTeamClassificationService.selectAccountList(openId); |
|
|
|
|
for (UserAccount userAccount : userAccountList) { |
|
|
|
@ -257,14 +254,25 @@ public class PlatformTeamAccountController { |
|
|
|
|
|
|
|
|
|
Integer accountId = platformTeamService.getAccountIdByTeamId(teamInfo.getId()); |
|
|
|
|
|
|
|
|
|
//删除原有分类重新新增分类配置信息
|
|
|
|
|
supplierClassificationConfigService.deleteByAccountId(accountId); |
|
|
|
|
//设置分类配置信息中的accountId
|
|
|
|
|
teamInfo.getSupplierClassificationConfigs().forEach(config -> config.setAccountId(accountId)); |
|
|
|
|
|
|
|
|
|
QueryWrapper<SupplierClassificationConfig> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("account_id", accountId); |
|
|
|
|
//删除供应商原有分类重新新增分类配置信息
|
|
|
|
|
List<SupplierClassificationConfig> classificationConfigs = supplierClassificationConfigService.list(queryWrapper); |
|
|
|
|
|
|
|
|
|
if (!classificationConfigs.isEmpty()){ |
|
|
|
|
supplierClassificationConfigService.remove(queryWrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (teamInfo.getSupplierClassificationConfigs()!=null) { |
|
|
|
|
for (SupplierClassificationConfig config : teamInfo.getSupplierClassificationConfigs()) { |
|
|
|
|
//获取teamInfo.getSupplierClassificationConfigs()第一个账号id
|
|
|
|
|
config.setAccountId(accountId); |
|
|
|
|
} |
|
|
|
|
//新增分类配置信息
|
|
|
|
|
supplierClassificationConfigService.saveBatch(teamInfo.getSupplierClassificationConfigs()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean update = platformTeamClassificationService.updateById(platformTeamClassification); |
|
|
|
@ -272,8 +280,6 @@ public class PlatformTeamAccountController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "查询团队信息") |
|
|
|
|
@GetMapping("/queryTeamInfo") |
|
|
|
|
public R queryTeamInfo(@ApiParam(value = "团队id") @RequestParam("teamId") Integer teamId) { |
|
|
|
|