Merge remote-tracking branch 'origin/main' into main

main
rong.liu 11 months ago
commit 9fcc42adc1
  1. 2
      common/src/main/java/com/huoran/common/exception/ExceptionEnum.java
  2. 67
      nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java
  3. 10
      nakadai/src/main/java/com/huoran/nakadai/entity/req/TransferTeamReq.java
  4. 7
      nakadai/src/main/java/com/huoran/nakadai/entity/res/PlatformTeamAccountResp.java
  5. 6
      nakadai/src/main/java/com/huoran/nakadai/entity/res/TeamAccountResp.java
  6. 40
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml
  7. 7
      nakadai/src/main/java/com/huoran/nakadai/service/PlatformTeamAccountService.java
  8. 48
      nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java
  9. 3
      users/src/main/java/com/huoran/users/entity/res/OrganizationInfo.java
  10. 5
      users/src/main/java/com/huoran/users/mapper/xml/HrUserAccountMapper.xml
  11. 2
      users/src/main/java/com/huoran/users/service/impl/HrUserAccountServiceImpl.java

@ -60,6 +60,8 @@ public enum ExceptionEnum {
DATA_PLATFORM_ACCOUNT_AVALIABLE_FAIL(10022, "当前用户所在的院校在数据平台的可用账号数量不足,是否继续!"),
INVITATION_CODE_EXPIRED(10023, "邀请码已失效"),
USER_ALREADY_EXISTS_GROUP(10024, "用户已存在该组织"),
USER_ALREADY_EXISTS_OTHER_GROUP(10024, "无法受邀加入该平台组织,账号已在其他平台存在组织信息!"),
CANT_JOIN_TEAM(10025, "无法加入自己的团队"),
CANNOT_ADDED_REPEATEDLY(10026, "该用户已经是团队管理员,无法重复添加!"),
DEFAULT_ROLE_NOTEXIST(10027, "默认角色不存在"),

@ -136,50 +136,35 @@ public class PlatformTeamAccountController {
// return platformTeamAccountService.transferAdmin(transferAdminReq);
// }
// @PostMapping("/transferTeam")
// @ApiOperation(value = "团队内转让超管")
// public R transferTeam(@RequestBody @Valid TransferTeamReq transferTeamReq) {
// return platformTeamAccountService.transferTeam(transferTeamReq);
// }
// @PostMapping("/delPartnerAccount")
// @ApiOperation(value = "删除合伙人")
// public R delPartnerAccount(
// @ApiParam(name = "accountId", value = "账号id")
// @RequestParam Integer accountId) {
// return platformTeamAccountService.delPartnerAccount(accountId);
// }
@PostMapping("/transferTeam")
@ApiOperation(value = "团队内转让超管")
public R transferTeam(@RequestBody @Valid TransferTeamReq transferTeamReq) {
return platformTeamAccountService.transferTeam(transferTeamReq);
}
// @GetMapping("/partnerRemoval")
// @ApiOperation(value = "移除团队")
// public R partnerRemoval(
// @ApiParam(name = "teamId", value = "团队id")
// @RequestParam String teamId,
// @ApiParam(name = "partnerId", value = "合伙人id")
// @RequestParam String partnerId) {
// PartnerClassification partnerClassification = partnerClassificationService.getById(teamId);
// if (partnerClassification.getIsTeam() == 1) {
// throw new CustomException(ExceptionEnum.PARTNER_REMOVAL);
// }
// PartnerAccount partnerAccount = platformTeamAccountService.getById(partnerId);
// //删除团队成员
// partnerClassificationService.removeById(Integer.parseInt(teamId));
// //同步删除该团队相关角色信息
// partnerClassificationService.removeRole(teamId,partnerAccount.getAccountId());
// return partnerTeamService.remove(new QueryWrapper<PartnerTeam>().
// eq("partner_id", partnerId).
// eq("classification_id", teamId)) ? R.ok() : R.error();
// }
@GetMapping("/removeOrganization")
@ApiOperation(value = "移除组织")
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);
}
//删除团队成员
platformTeamClassificationService.removeById(teamId);
//TODO 删除该团队相关角色信息
platformTeamAccountService.removeById(manageId);
boolean remove = platformTeamService.remove(new QueryWrapper<PlatformTeam>().
eq("manage_id", manageId).
eq("classification_id", teamId));
return remove ? R.ok() : R.error();
}
// @ApiOperation(value = "查询合伙人账号信息")
// @PostMapping("/queryPartnerAccount")
// public R queryPartnerAccount(@RequestParam String phone) {
// return platformTeamAccountService.queryPartnerAccount(phone);
// }
@ApiOperation(value = "后台更新团队状态,禁用无法切换到该组织")
@ApiOperation(value = "后台更新团队状态,禁用无法查询到该组织")
@PostMapping("/updateTeamStatus")
public R updateTeamStatus(
@RequestParam("teamId") @ApiParam(value = "团队id") Integer teamId,

@ -11,12 +11,18 @@ import lombok.Data;
@Data
public class TransferTeamReq {
@ApiModelProperty(value = "管理员合伙人id")
private Integer adminPartnerId;
@ApiModelProperty(value = "管理员组织id")
private Integer adminManageId;
@ApiModelProperty(value = "成员组织id")
private Integer memberManageId;
@ApiModelProperty(value = "管理员团队id")
private Integer adminTeamId;
@ApiModelProperty(value = "管理员合伙人id")
private Integer adminPartnerId;
@ApiModelProperty(value = "成员合伙人id")
private Integer memberPartnerId;

@ -82,8 +82,11 @@ public class PlatformTeamAccountResp {
@ApiModelProperty(value = "商务经理ids")
private List<Integer> businessManagerIds;
// @ApiModelProperty(value = "团队信息")
// private PartnerClassification partnerClassificationList;
@ApiModelProperty(value = "加入时间")
private String joinTime;
@ApiModelProperty(value = "是否认证")
private String authentication;
@ApiModelProperty(value = "是否是团队")
private String isTeam;

@ -95,4 +95,10 @@ public class TeamAccountResp {
@ApiModelProperty(value = "团队名称")
private String teamName;
@ApiModelProperty(value = "加入时间")
private String joinTime;
@ApiModelProperty(value = "是否认证")
private String authentication;
}

@ -68,24 +68,23 @@
c.parent_id,
a.account_id,
c.is_team,
(
SELECT
u.user_name
FROM
hr_user_info u
INNER JOIN hr_user_account ua
WHERE
ua.user_id = u.user_id
AND a.account_id = ua.id
) AS userName
u.user_name,
c.create_time as joinTime,
CASE
WHEN count(ai.id) > 0 THEN '已认证'
ELSE '未认证'
END as authentication
FROM
k_platform_team t
INNER JOIN k_platform_team_classification c ON c.id = t.classification_id
INNER JOIN k_platform_team_account a ON a.manage_id = t.manage_id
INNER join hr_user_account ua on ua.id = a.account_id
INNER JOIN hr_user_info u on ua.user_id = u.user_id
left join hr_user_authentication_information ai on ai.open_id = ua.app_open_id
WHERE
c.is_del = 0 and c.is_enable = 0
AND a.is_del = 0 and a.platform_id = #{platformId}
AND account_id = #{accountId}
AND a.account_id = #{accountId}
</select>
<select id="selectTeamIdByClassificationId" resultType="java.lang.Integer">
SELECT
@ -124,16 +123,19 @@
pc.classification_name as teamName,
pc.id as partnerClassificationId,
pc.is_team,
u.user_avatars,pc.parent_id
u.user_avatars,pc.parent_id,
pc.create_time as joinTime,
CASE
WHEN count(ai.id) > 0 THEN '已认证'
ELSE '未认证'
END as authentication
FROM
k_platform_team_account hpa
left join k_platform_team pt on hpa.manage_id = pt.manage_id
left JOIN k_platform_team_classification pc ON pt.classification_id = pc.id
left JOIN acl_user_role ur on ur.is_del = 0 AND ur.team_id = pc.id and ur.account_id = hpa.account_id
left JOIN acl_role r ON r.id = ur.role_id
left JOIN hr_user_account a ON a.id = hpa.account_id
left JOIN hr_user_info u ON u.user_id = a.user_id
inner join k_platform_team pt on hpa.manage_id = pt.manage_id
inner JOIN k_platform_team_classification pc ON pt.classification_id = pc.id
inner JOIN hr_user_account a ON a.id = hpa.account_id
inner JOIN hr_user_info u ON u.user_id = a.user_id
left join hr_user_authentication_information ai on ai.open_id = a.app_open_id
WHERE a.is_del = 0
AND u.is_del = 0 and pc.is_del = 0
<if test="req.keyWord != '' and req.keyWord != null">

@ -3,10 +3,7 @@ package com.huoran.nakadai.service;
import com.huoran.common.response.R;
import com.huoran.nakadai.entity.PlatformTeamAccount;
import com.baomidou.mybatisplus.extension.service.IService;
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 javax.servlet.http.HttpServletResponse;
import java.util.Map;
@ -34,4 +31,6 @@ public interface PlatformTeamAccountService extends IService<PlatformTeamAccount
R pagePlatformTeamAccountList(PlatformTeamAccountListReq req);
R inviteJoinOrganization(InviteJoinInfo inviteJoinInfo);
R transferTeam(TransferTeamReq transferTeamReq);
}

@ -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();
}
}

@ -26,4 +26,7 @@ public class OrganizationInfo {
@ApiModelProperty("团队启用禁用")
private Integer isEnable;
@ApiModelProperty("组织id")
private Integer manageId;
}

@ -1107,11 +1107,12 @@
pt.classification_id AS teamId,
ta.account_id,
tc.is_enable,
ec.audit_status
ec.audit_status,
ta.manage_id
FROM
hr_enterprise_certification ec
INNER JOIN hr_user_account hu ON hu.app_open_id = ec.open_id
AND ec.platform_source = hu.platform_id
AND ec.platform_source = hu.platform_id and hu.is_del = 0
INNER JOIN k_platform_team_account ta ON ta.account_id = hu.id
INNER JOIN k_platform_team pt ON ta.manage_id = pt.manage_id
INNER JOIN k_platform_team_classification tc ON tc.id = pt.classification_id and tc.is_del = 0

@ -418,7 +418,7 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H
List<HrUserAccount> userAccountList = hrUserAccountMapper.selectList(new QueryWrapper<HrUserAccount>()
.eq("app_open_id", openId));
if (userAccountList.size() == 0){
res.setStatus(false);
res.setStatus(true);
res.setMessage("用户不存在,请先重新登录注册!");
return res;
}

Loading…
Cancel
Save