@@ -1,5 +1,6 @@ | |||
package com.ningdatech.pmapi.expert.manage; | |||
import cn.hutool.core.collection.CollUtil; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.file.entity.vo.result.AttachFileVo; | |||
@@ -82,16 +83,13 @@ public class ExpertManage { | |||
expertMetaApplyManage.autoPassExpertApply(userId); | |||
// 增加用户专家角色 | |||
Role expertRole = iRoleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getCode, RoleEnum.EXPERT.name())); | |||
UserRole expertUserRole = iUserRoleService.getOne(Wrappers.lambdaQuery(UserRole.class) | |||
.eq(UserRole::getRoleId, expertRole.getId()).eq(UserRole::getUserId, userId)); | |||
if (Objects.isNull(expertUserRole)) { | |||
expertUserRole = new UserRole(); | |||
expertUserRole.setUserId(userId); | |||
expertUserRole.setRoleId(expertRole.getId()); | |||
expertUserRole.setCreateBy(-1L); | |||
expertUserRole.setCreateOn(LocalDateTime.now()); | |||
iUserRoleService.save(expertUserRole); | |||
Role role = iRoleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getCode, RoleEnum.EXPERT.name())); | |||
UserRole expertRole = iUserRoleService.getOne(userId, role.getId()); | |||
if (Objects.isNull(expertRole)) { | |||
expertRole = new UserRole(); | |||
expertRole.setUserId(userId); | |||
expertRole.setRoleId(role.getId()); | |||
iUserRoleService.save(expertRole); | |||
} | |||
} | |||
@@ -113,13 +111,13 @@ public class ExpertManage { | |||
expertRecommendProofSaveCmd.setRecommendationProofFileIdList(recommendProofFile.stream().map(FileBasicInfo::getFileId).collect(Collectors.toList())); | |||
} | |||
List<ExpertDictionaryDTO> recommendedWayDictionaryDTOList = new ArrayList<>(); | |||
if (CollectionUtils.isNotEmpty(recommendedWay)) { | |||
recommendedWayDictionaryDTOList = recommendedWay.stream().map(r -> { | |||
if (CollUtil.isNotEmpty(recommendedWay)) { | |||
recommendedWay.forEach(r -> { | |||
ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO(); | |||
expertDictionaryDTO.setDictionaryCode(r.getDictionaryCode()); | |||
expertDictionaryDTO.setExpertInfoField(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey()); | |||
return expertDictionaryDTO; | |||
}).collect(Collectors.toList()); | |||
recommendedWayDictionaryDTOList.add(expertDictionaryDTO); | |||
}); | |||
} | |||
expertRecommendProofSaveCmd.setRecommendedWay(recommendedWayDictionaryDTOList); | |||
expertRecommendProofSaveCmd.setUserId(expertUserId); | |||
@@ -146,10 +144,10 @@ public class ExpertManage { | |||
UserInfo userInfo = iUserInfoService.getUserInfoByPhoneNo(phoneNo); | |||
if (Objects.isNull(userInfo)) { | |||
userInfo = UserInfo.builder() | |||
// .accountId(dingEmployeeInfo.getAccountId()) | |||
//.accountId(dingEmployeeInfo.getAccountId()) | |||
.username(basicInfo.getName()) | |||
.realName(basicInfo.getName()) | |||
// .employeeCode(dingEmployeeInfo.getEmployeeCode()) | |||
//.employeeCode(dingEmployeeInfo.getEmployeeCode()) | |||
.available(UserAvailableEnum.DISABLE.name()) | |||
.mobile(phoneNo) | |||
.createBy(operatorId) | |||
@@ -49,10 +49,7 @@ import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import java.time.LocalDateTime; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Objects; | |||
import java.util.*; | |||
import java.util.stream.Collectors; | |||
/** | |||
@@ -66,25 +63,16 @@ public class ExpertMetaApplyManage { | |||
private final IExpertMetaApplyService iMetaApplyService; | |||
private final IExpertDictionaryService expertDictionaryService; | |||
// private final IExpertAdminManageService ExpertAdminManageService; | |||
private final RegionCacheHelper regionCacheHelper; | |||
private final IExpertUserFullInfoService userFullInfoService; | |||
private final DictionaryCache dictionaryCache; | |||
private final ExpertInfoService expertInfoService; | |||
private final UserInfoHelper userInfoHelper; | |||
private final RegionLimitHelper regionLimitHelper; | |||
private final ExpertUserInfoHelper expertUserInfoHelper; | |||
private final ExpertAdminManageService expertAdminManageService; | |||
private final IExpertDictionaryService iExpertDictionaryService; | |||
public PageVo<ExpertApplyMetaVO> metaApplyListQuery(MetaApplyListQuery req) { | |||
Long expertAdminUserId = LoginUserUtil.getUserId(); | |||
// 筛选符合专家类型的用户id | |||
@@ -596,11 +584,13 @@ public class ExpertMetaApplyManage { | |||
*/ | |||
@Transactional(rollbackFor = Exception.class) | |||
public void autoPassExpertApply(Long expertUserId) { | |||
List<ExpertMetaApply> expertIntentionJoinApplyList = iMetaApplyService.list(Wrappers.lambdaQuery(ExpertMetaApply.class) | |||
final List<String> applyTypes = Arrays.asList(ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey(), | |||
ExpertApplyTypeEnum.EXPERT_STORAGE.getKey()); | |||
LambdaQueryWrapper<ExpertMetaApply> query = Wrappers.lambdaQuery(ExpertMetaApply.class) | |||
.eq(ExpertMetaApply::getUserId, expertUserId) | |||
.in(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey(), ExpertApplyTypeEnum.EXPERT_STORAGE.getKey()) | |||
.eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey())); | |||
.in(ExpertMetaApply::getApplyType, applyTypes) | |||
.eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()); | |||
List<ExpertMetaApply> expertIntentionJoinApplyList = iMetaApplyService.list(query); | |||
for (ExpertMetaApply expertMetaApply : expertIntentionJoinApplyList) { | |||
MetaApplyResultRequest applyResult = new MetaApplyResultRequest(); | |||
applyResult.setApplyId(expertMetaApply.getId()); | |||
@@ -34,7 +34,10 @@ import com.ningdatech.pmapi.sys.model.entity.UserRole; | |||
import com.ningdatech.pmapi.sys.service.IRoleService; | |||
import com.ningdatech.pmapi.sys.service.IUserRoleService; | |||
import com.ningdatech.pmapi.sys.service.impl.UserRoleServiceImpl; | |||
import com.ningdatech.pmapi.user.constant.UserAvailableEnum; | |||
import com.ningdatech.pmapi.user.entity.UserInfo; | |||
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum; | |||
import com.ningdatech.pmapi.user.service.IUserInfoService; | |||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | |||
import com.ningdatech.yxt.utils.JSONUtils; | |||
import lombok.RequiredArgsConstructor; | |||
@@ -65,6 +68,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||
private final IRoleService roleService; | |||
private final IUserRoleService userRoleService; | |||
private final IExpertSensitiveInfoModifyDetailRecordService iExpertSensitiveInfoModifyDetailRecordService; | |||
private final IUserInfoService userInfoService; | |||
/** | |||
@@ -390,6 +394,11 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||
expertUserFullInfo.setRemark(cmd.getRemark()); | |||
expertUserFullInfo.setRegionCode(cmd.getJoinRegionCode()); | |||
expertUserFullInfo.setRegionLevel(cmd.getJoinRegionLevel()); | |||
// 账号启用 | |||
LambdaUpdateWrapper<UserInfo> userInfoUpdate = Wrappers.lambdaUpdate(UserInfo.class) | |||
.eq(UserInfo::getId,expertUserId) | |||
.set(UserInfo::getAvailable, UserAvailableEnum.ENABLE); | |||
userInfoService.update(userInfoUpdate); | |||
// 保存所有专家标签字段 | |||
List<ExpertTag> saveExpertTagList = buildSaveExpertTagList(expertUserId, cmd.getOther()); | |||