|
|
@ -6,7 +6,9 @@ import com.huoran.common.exception.CustomException; |
|
|
|
import com.huoran.common.exception.ExceptionEnum; |
|
|
|
import com.huoran.common.exception.ExceptionEnum; |
|
|
|
import com.huoran.common.response.R; |
|
|
|
import com.huoran.common.response.R; |
|
|
|
import com.huoran.common.utils.TokenUtils; |
|
|
|
import com.huoran.common.utils.TokenUtils; |
|
|
|
|
|
|
|
import com.huoran.nakadai.entity.HrUserAccount; |
|
|
|
import com.huoran.nakadai.entity.PlatformTeam; |
|
|
|
import com.huoran.nakadai.entity.PlatformTeam; |
|
|
|
|
|
|
|
import com.huoran.nakadai.entity.PlatformTeamAccount; |
|
|
|
import com.huoran.nakadai.entity.PlatformTeamClassification; |
|
|
|
import com.huoran.nakadai.entity.PlatformTeamClassification; |
|
|
|
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; |
|
|
@ -149,7 +151,9 @@ public class PlatformTeamAccountController { |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/removeOrganization") |
|
|
|
@GetMapping("/removeOrganization") |
|
|
|
@ApiOperation(value = "移除组织") |
|
|
|
@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); |
|
|
|
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); |
|
|
@ -162,16 +166,56 @@ public class PlatformTeamAccountController { |
|
|
|
return remove ? R.ok() : R.error(); |
|
|
|
return remove ? R.ok() : R.error(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "后台更新团队状态,禁用无法查询到该组织") |
|
|
|
@ApiOperation(value = "用户详情更新团队状态,禁用无法查询到该组织,同步禁用用户账号") |
|
|
|
@PostMapping("/updateTeamStatus") |
|
|
|
@PostMapping("/updateTeamStatus") |
|
|
|
public R updateTeamStatus(@RequestParam("teamId") @ApiParam(value = "团队id") Integer teamId, @RequestParam("isEnable") @ApiParam(value = "是否禁用(1->禁用,0->启用)") Integer isEnable) { |
|
|
|
public R updateTeamStatus(@RequestParam("teamId") @ApiParam(value = "团队id") Integer teamId, @RequestParam("isEnable") @ApiParam(value = "是否禁用(1->禁用,0->启用)") Integer isEnable) { |
|
|
|
PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification(); |
|
|
|
PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification(); |
|
|
|
platformTeamClassification.setId(teamId); |
|
|
|
platformTeamClassification.setId(teamId); |
|
|
|
platformTeamClassification.setIsEnable(isEnable); |
|
|
|
platformTeamClassification.setIsEnable(isEnable); |
|
|
|
boolean update = platformTeamClassificationService.updateById(platformTeamClassification); |
|
|
|
boolean update = platformTeamClassificationService.updateById(platformTeamClassification); |
|
|
|
|
|
|
|
//查询组织平台账号
|
|
|
|
|
|
|
|
PlatformTeam platformTeam = platformTeamService.getOne(new QueryWrapper<PlatformTeam>().eq("classification_id", teamId)); |
|
|
|
|
|
|
|
PlatformTeamAccount platformTeamAccount = platformTeamAccountService.getById(platformTeam.getManageId()); |
|
|
|
|
|
|
|
int status = 1; |
|
|
|
|
|
|
|
if (isEnable==1){ |
|
|
|
|
|
|
|
status=0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
platformTeamClassificationService.updateByAccountId(platformTeamAccount.getAccountId(), status); |
|
|
|
return update ? R.ok() : R.error(); |
|
|
|
return update ? R.ok() : R.error(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "用户列表更新账号状态,禁用整个账号禁止登录,不管是哪个端,哪个组织") |
|
|
|
|
|
|
|
@PostMapping("/updateAccountStatus") |
|
|
|
|
|
|
|
public R updateAccountStatus( |
|
|
|
|
|
|
|
@RequestParam("openId") @ApiParam(value = "openId") String openId, |
|
|
|
|
|
|
|
@RequestParam("isEnable") @ApiParam(value = "是否禁用(1->禁用,0->启用)") Integer isEnable) { |
|
|
|
|
|
|
|
//根据openId查询账号详情List
|
|
|
|
|
|
|
|
List<HrUserAccount> userAccountList = platformTeamClassificationService.selectAccountList(openId); |
|
|
|
|
|
|
|
for (HrUserAccount userAccount : userAccountList) { |
|
|
|
|
|
|
|
int status = 1; |
|
|
|
|
|
|
|
if (isEnable==1){ |
|
|
|
|
|
|
|
status=0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//更新账号信息
|
|
|
|
|
|
|
|
platformTeamClassificationService.updateByAccountId(userAccount.getId(), status); |
|
|
|
|
|
|
|
if (Integer.parseInt(userAccount.getPlatformId())!=7){ |
|
|
|
|
|
|
|
//查询账号绑定的组织信息
|
|
|
|
|
|
|
|
List<PlatformTeamAccount> platformTeamAccounts = platformTeamAccountService.list(new QueryWrapper<PlatformTeamAccount>().eq("account_id", userAccount.getId())); |
|
|
|
|
|
|
|
for (PlatformTeamAccount platformTeamAccount : platformTeamAccounts) { |
|
|
|
|
|
|
|
//查询组织平台账号
|
|
|
|
|
|
|
|
PlatformTeam platformTeam = platformTeamService.getOne(new QueryWrapper<PlatformTeam>().eq("manage_id", platformTeamAccount.getManageId())); |
|
|
|
|
|
|
|
PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification(); |
|
|
|
|
|
|
|
platformTeamClassification.setId(platformTeam.getClassificationId()); |
|
|
|
|
|
|
|
platformTeamClassification.setIsEnable(isEnable); |
|
|
|
|
|
|
|
//更新账号绑定的组织信息
|
|
|
|
|
|
|
|
platformTeamClassificationService.updateById(platformTeamClassification); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return R.ok(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//================================以下接口为小程序调用===================================
|
|
|
|
//================================以下接口为小程序调用===================================
|
|
|
|
@ApiOperation(value = "幼教产品微信小程序回调登录") |
|
|
|
@ApiOperation(value = "幼教产品微信小程序回调登录") |
|
|
|
@PostMapping("/weChatAppletCallbackByKindergarten") |
|
|
|
@PostMapping("/weChatAppletCallbackByKindergarten") |
|
|
|