|
|
@ -135,11 +135,13 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R kindergartenWeChatApplication(AppletCallbackReq appletCallbackReq) { |
|
|
|
public R kindergartenWeChatApplication(AppletCallbackReq appletCallbackReq) { |
|
|
|
|
|
|
|
Map<String, Object> data = new HashedMap<String, Object>(); |
|
|
|
UserAccount userAccount = baseMapper.selectAccountByOpenId(appletCallbackReq.getOpenId(), appletCallbackReq.getPlatformId()); |
|
|
|
UserAccount userAccount = baseMapper.selectAccountByOpenId(appletCallbackReq.getOpenId(), appletCallbackReq.getPlatformId()); |
|
|
|
if (userAccount != null){ |
|
|
|
if (userAccount != null){ |
|
|
|
return R.error("该用户已存在"); |
|
|
|
data.put("registerId", userAccount.getId()); |
|
|
|
|
|
|
|
data.put("openId", appletCallbackReq.getOpenId()); |
|
|
|
|
|
|
|
return R.ok().put("data",data); |
|
|
|
} |
|
|
|
} |
|
|
|
Map<String, Object> data = new HashedMap<String, Object>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (appletCallbackReq.getPhone()!= null){ |
|
|
|
if (appletCallbackReq.getPhone()!= null){ |
|
|
|
UserAccount userAccountByPhone = baseMapper.selectAccount(appletCallbackReq.getPhone(),appletCallbackReq.getPlatformId().toString()); |
|
|
|
UserAccount userAccountByPhone = baseMapper.selectAccount(appletCallbackReq.getPhone(),appletCallbackReq.getPlatformId().toString()); |
|
|
@ -202,6 +204,12 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco |
|
|
|
addUserInfo(personalUserName, 7, appletCallbackReq.getOpenId(), appletCallbackReq.getPhone()); |
|
|
|
addUserInfo(personalUserName, 7, appletCallbackReq.getOpenId(), appletCallbackReq.getPhone()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PlatformTeamAccount platformTeamAccount1 = baseMapper.selectOne(new QueryWrapper<PlatformTeamAccount>(). |
|
|
|
|
|
|
|
eq("account_id", accountId). |
|
|
|
|
|
|
|
eq("platform_id", appletCallbackReq.getPlatformId())); |
|
|
|
|
|
|
|
String teamName = ""; |
|
|
|
|
|
|
|
Integer classificationId = null; |
|
|
|
|
|
|
|
if (platformTeamAccount1 == null){ |
|
|
|
// 添加供应商/幼儿园信息
|
|
|
|
// 添加供应商/幼儿园信息
|
|
|
|
PlatformTeamAccount platformTeamAccount = new PlatformTeamAccount(); |
|
|
|
PlatformTeamAccount platformTeamAccount = new PlatformTeamAccount(); |
|
|
|
platformTeamAccount.setAccountId(accountId); |
|
|
|
platformTeamAccount.setAccountId(accountId); |
|
|
@ -213,13 +221,13 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco |
|
|
|
platformTeamClassification.setIsTeam(1); |
|
|
|
platformTeamClassification.setIsTeam(1); |
|
|
|
platformTeamClassification.setParentId(1); |
|
|
|
platformTeamClassification.setParentId(1); |
|
|
|
platformTeamClassification.setLevel(1); |
|
|
|
platformTeamClassification.setLevel(1); |
|
|
|
String teamName = ""; |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(appletCallbackReq.getOrganizationName())){ |
|
|
|
if (StringUtils.isNotBlank(appletCallbackReq.getOrganizationName())){ |
|
|
|
teamName = appletCallbackReq.getOrganizationName(); |
|
|
|
teamName = appletCallbackReq.getOrganizationName(); |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
teamName = userName + "的团队"; |
|
|
|
teamName = userName + "的团队"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
classificationId = platformTeamClassification.getId(); |
|
|
|
platformTeamClassification.setClassificationName(teamName); |
|
|
|
platformTeamClassification.setClassificationName(teamName); |
|
|
|
int insert = platformTeamClassificationMapper.insert(platformTeamClassification); |
|
|
|
int insert = platformTeamClassificationMapper.insert(platformTeamClassification); |
|
|
|
if (insert > 0) { |
|
|
|
if (insert > 0) { |
|
|
@ -228,7 +236,17 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco |
|
|
|
platformTeam.setClassificationId(platformTeamClassification.getId()); |
|
|
|
platformTeam.setClassificationId(platformTeamClassification.getId()); |
|
|
|
platformTeamMapper.insert(platformTeam); |
|
|
|
platformTeamMapper.insert(platformTeam); |
|
|
|
} |
|
|
|
} |
|
|
|
data.put("teamId",platformTeamClassification.getId()); |
|
|
|
}else { |
|
|
|
|
|
|
|
List<PlatformTeam> platformTeamList = platformTeamMapper.selectList(new QueryWrapper<PlatformTeam>() |
|
|
|
|
|
|
|
.eq("manage_id", platformTeamAccount1.getManageId())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PlatformTeamClassification platformTeamClassification = platformTeamClassificationMapper.selectOne(new QueryWrapper<PlatformTeamClassification>(). |
|
|
|
|
|
|
|
eq("is_team", 1). |
|
|
|
|
|
|
|
in("id", platformTeamList.stream().map(PlatformTeam::getClassificationId).collect(Collectors.toList()))); |
|
|
|
|
|
|
|
classificationId = platformTeamClassification.getId(); |
|
|
|
|
|
|
|
teamName = platformTeamClassification.getClassificationName(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
data.put("teamId",classificationId); |
|
|
|
data.put("teamName",teamName); |
|
|
|
data.put("teamName",teamName); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -265,7 +283,12 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco |
|
|
|
public R getTeamsByPlatformId(String accountId, Integer platformId) { |
|
|
|
public R getTeamsByPlatformId(String accountId, Integer platformId) { |
|
|
|
List<TeamAccountResp> teamsByPlatformId = baseMapper.getTeamsByPlatformId(accountId,platformId); |
|
|
|
List<TeamAccountResp> teamsByPlatformId = baseMapper.getTeamsByPlatformId(accountId,platformId); |
|
|
|
teamsByPlatformId.forEach(teamAccountResp -> { |
|
|
|
teamsByPlatformId.forEach(teamAccountResp -> { |
|
|
|
PlatformTeamClassification platformTeamClassification = platformTeamClassificationMapper.getParentInformationBasedOnChild(teamAccountResp.getClassificationId()); |
|
|
|
PlatformTeamClassification platformTeamClassification; |
|
|
|
|
|
|
|
if (teamAccountResp.getIsTeam().equals("0")){ |
|
|
|
|
|
|
|
platformTeamClassification = platformTeamClassificationMapper.getParentInformationBasedOnChild(teamAccountResp.getClassificationId()); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
platformTeamClassification = platformTeamClassificationMapper.selectById(teamAccountResp.getClassificationId()); |
|
|
|
|
|
|
|
} |
|
|
|
teamAccountResp.setPlatformTeamClassificationList(platformTeamClassification); |
|
|
|
teamAccountResp.setPlatformTeamClassificationList(platformTeamClassification); |
|
|
|
}); |
|
|
|
}); |
|
|
|
return R.ok().put("data", teamsByPlatformId); |
|
|
|
return R.ok().put("data", teamsByPlatformId); |
|
|
|