|
@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollUtil;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.winhc.common.enums.CodeMsg;
|
|
|
|
+import com.winhc.common.exception.CommonException;
|
|
import com.winhc.common.model.base.VOPage;
|
|
import com.winhc.common.model.base.VOPage;
|
|
import com.winhc.repal.constant.Constant;
|
|
import com.winhc.repal.constant.Constant;
|
|
import com.winhc.repal.entity.*;
|
|
import com.winhc.repal.entity.*;
|
|
@@ -56,6 +58,9 @@ public class RepalGroupServiceImpl extends ServiceImpl<RepalGroupMapper, RepalGr
|
|
@Autowired
|
|
@Autowired
|
|
private RepalVipService repalVipService;
|
|
private RepalVipService repalVipService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ThirdPartyAccountService thirdPartyAccountService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public Boolean initGroup(InitGroupDTO dto) {
|
|
public Boolean initGroup(InitGroupDTO dto) {
|
|
@@ -68,8 +73,15 @@ public class RepalGroupServiceImpl extends ServiceImpl<RepalGroupMapper, RepalGr
|
|
LOGGER.info("已经属于组织成员了, userId:[{}]", dto.getUserId());
|
|
LOGGER.info("已经属于组织成员了, userId:[{}]", dto.getUserId());
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
+ // 查第三方组织id
|
|
|
|
+ ThirdPartyAccount account = thirdPartyAccountService.getOne(Wrappers.lambdaQuery(ThirdPartyAccount.class)
|
|
|
|
+ .eq(ThirdPartyAccount::getUserId, dto.getUserId())
|
|
|
|
+ .eq(ThirdPartyAccount::getDeleted, DeletedStatusEnum.NORMAL.getCode()));
|
|
|
|
+ if (Objects.isNull(account)) {
|
|
|
|
+ throw new CommonException(CodeMsg.FAILED, "账号不存在");
|
|
|
|
+ }
|
|
RepalGroup repalGroup = this.getOne(Wrappers.lambdaQuery(RepalGroup.class)
|
|
RepalGroup repalGroup = this.getOne(Wrappers.lambdaQuery(RepalGroup.class)
|
|
- .eq(RepalGroup::getUserId, dto.getUserId())
|
|
|
|
|
|
+ .eq(RepalGroup::getThirdGroupId, account.getGroupId())
|
|
.eq(RepalGroup::getDeleted, DeletedStatusEnum.NORMAL.getCode()));
|
|
.eq(RepalGroup::getDeleted, DeletedStatusEnum.NORMAL.getCode()));
|
|
if (Objects.isNull(repalGroup)) {
|
|
if (Objects.isNull(repalGroup)) {
|
|
// 先初始化组织
|
|
// 先初始化组织
|
|
@@ -77,6 +89,7 @@ public class RepalGroupServiceImpl extends ServiceImpl<RepalGroupMapper, RepalGr
|
|
repalGroup.setGroupName(dto.getGroupName());
|
|
repalGroup.setGroupName(dto.getGroupName());
|
|
repalGroup.setUserId(dto.getUserId());
|
|
repalGroup.setUserId(dto.getUserId());
|
|
repalGroup.setGroupExt(dto.getGroupExt());
|
|
repalGroup.setGroupExt(dto.getGroupExt());
|
|
|
|
+ repalGroup.setThirdGroupId(account.getGroupId());
|
|
this.save(repalGroup);
|
|
this.save(repalGroup);
|
|
repalGroupMemberService.addGroupMember(dto.getUserId(), userExt.getUserName(), repalGroup.getId(), 1L, RoleTypeEnum.SYSTEM.getCode());
|
|
repalGroupMemberService.addGroupMember(dto.getUserId(), userExt.getUserName(), repalGroup.getId(), 1L, RoleTypeEnum.SYSTEM.getCode());
|
|
// 初始化4个角色
|
|
// 初始化4个角色
|