|
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.util.RandomUtil; |
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.huoran.common.constant.SMSTemplate; |
|
|
|
@ -17,10 +18,7 @@ import com.huoran.common.utils.JwtUtils; |
|
|
|
|
import com.huoran.common.utils.MD5; |
|
|
|
|
import com.huoran.common.utils.TokenUtils; |
|
|
|
|
import com.huoran.nakadai.entity.*; |
|
|
|
|
import com.huoran.nakadai.entity.req.AccountRegisterReq; |
|
|
|
|
import com.huoran.nakadai.entity.req.AppletCallbackReq; |
|
|
|
|
import com.huoran.nakadai.entity.req.InviteJoinInfo; |
|
|
|
|
import com.huoran.nakadai.entity.req.PlatformTeamAccountListReq; |
|
|
|
|
import com.huoran.nakadai.entity.req.*; |
|
|
|
|
import com.huoran.nakadai.entity.res.PartnerAccountResp; |
|
|
|
|
import com.huoran.nakadai.entity.res.PlatformTeamAccountResp; |
|
|
|
|
import com.huoran.nakadai.entity.res.TeamAccountResp; |
|
|
|
@ -137,6 +135,7 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco |
|
|
|
|
public R kindergartenWeChatApplication(AppletCallbackReq appletCallbackReq) { |
|
|
|
|
Map<String, Object> data = new HashedMap<String, Object>(); |
|
|
|
|
UserAccount userAccount = baseMapper.selectAccountByOpenId(appletCallbackReq.getOpenId(), appletCallbackReq.getPlatformId()); |
|
|
|
|
//该平台已经注册
|
|
|
|
|
if (userAccount != null){ |
|
|
|
|
data.put("registerId", userAccount.getId()); |
|
|
|
|
data.put("openId", appletCallbackReq.getOpenId()); |
|
|
|
@ -283,12 +282,7 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco |
|
|
|
|
public R getTeamsByPlatformId(String accountId, Integer platformId) { |
|
|
|
|
List<TeamAccountResp> teamsByPlatformId = baseMapper.getTeamsByPlatformId(accountId,platformId); |
|
|
|
|
teamsByPlatformId.forEach(teamAccountResp -> { |
|
|
|
|
PlatformTeamClassification platformTeamClassification; |
|
|
|
|
if (teamAccountResp.getIsTeam().equals("0")){ |
|
|
|
|
platformTeamClassification = platformTeamClassificationMapper.getParentInformationBasedOnChild(teamAccountResp.getClassificationId()); |
|
|
|
|
}else { |
|
|
|
|
platformTeamClassification = platformTeamClassificationMapper.selectById(teamAccountResp.getClassificationId()); |
|
|
|
|
} |
|
|
|
|
PlatformTeamClassification platformTeamClassification = platformTeamClassificationMapper.getParentInformationBasedOnChild(teamAccountResp.getClassificationId()); |
|
|
|
|
teamAccountResp.setPlatformTeamClassificationList(platformTeamClassification); |
|
|
|
|
}); |
|
|
|
|
return R.ok().put("data", teamsByPlatformId); |
|
|
|
@ -334,9 +328,21 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco |
|
|
|
|
} |
|
|
|
|
//验证手机验证码
|
|
|
|
|
if (inviteJoinInfo.getCode().equals(value)) { |
|
|
|
|
if (inviteJoinInfo.getPlatformId()==5){ |
|
|
|
|
// 查询邀请用户其他平台是否存在账号
|
|
|
|
|
UserAccount userAccount = baseMapper.selectAccount(inviteJoinInfo.getPhone(),"6"); |
|
|
|
|
if (userAccount != null) { |
|
|
|
|
throw new CustomException(ExceptionEnum.USER_ALREADY_EXISTS_OTHER_GROUP); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
UserAccount userAccount = baseMapper.selectAccount(inviteJoinInfo.getPhone(),"5"); |
|
|
|
|
if (userAccount != null) { |
|
|
|
|
throw new CustomException(ExceptionEnum.USER_ALREADY_EXISTS_OTHER_GROUP); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询邀请用户是否存在账号
|
|
|
|
|
UserAccount userAccount = baseMapper.selectAccount(inviteJoinInfo.getPlatformId().toString(), inviteJoinInfo.getPhone()); |
|
|
|
|
UserAccount userAccount = baseMapper.selectAccount(inviteJoinInfo.getPhone(),inviteJoinInfo.getPlatformId().toString()); |
|
|
|
|
|
|
|
|
|
Integer manageId ; |
|
|
|
|
//邀请人为成员且账号存在,则直接拉入该团队,不可重复拉入
|
|
|
|
@ -412,4 +418,24 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco |
|
|
|
|
} |
|
|
|
|
throw new CustomException(ExceptionEnum.CODE_ERROR); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R transferTeam(TransferTeamReq transferTeamReq) { |
|
|
|
|
Integer adminManageId = transferTeamReq.getAdminManageId(); |
|
|
|
|
Integer memberManageId = transferTeamReq.getMemberManageId(); |
|
|
|
|
Integer adminTeamId = transferTeamReq.getAdminTeamId(); |
|
|
|
|
Integer memberTeamId = transferTeamReq.getMemberTeamId(); |
|
|
|
|
|
|
|
|
|
//转移团队
|
|
|
|
|
platformTeamMapper.update(new PlatformTeam(),new UpdateWrapper<PlatformTeam>(). |
|
|
|
|
eq("manage_id",adminManageId).eq("classification_id",adminTeamId). |
|
|
|
|
set("classification_id",memberTeamId)); |
|
|
|
|
|
|
|
|
|
platformTeamMapper.update(new PlatformTeam(),new UpdateWrapper<PlatformTeam>(). |
|
|
|
|
eq("manage_id",memberManageId).eq("classification_id",memberTeamId). |
|
|
|
|
set("classification_id",adminTeamId)); |
|
|
|
|
|
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|