|
|
@@ -24,7 +24,7 @@ import com.hz.pm.api.expert.model.cmd.*; |
|
|
|
import com.hz.pm.api.expert.model.dto.*; |
|
|
|
import com.hz.pm.api.expert.service.*; |
|
|
|
import com.hz.pm.api.expert.utils.SensitiveModifySegmentUtils; |
|
|
|
import com.hz.pm.api.meeting.helper.YxtCallOrSmsHelper; |
|
|
|
import com.hz.pm.api.meeting.helper.YxtClientHelper; |
|
|
|
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; |
|
|
|
import com.hz.pm.api.meta.model.ExpertRegionInfo; |
|
|
|
import com.hz.pm.api.meta.model.entity.ExpertDictionary; |
|
|
@@ -78,7 +78,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
private final IUserRoleService userRoleService; |
|
|
|
private final IExpertSensitiveInfoModifyDetailRecordService iExpertSensitiveInfoModifyDetailRecordService; |
|
|
|
private final IUserInfoService userInfoService; |
|
|
|
private final YxtCallOrSmsHelper yxtCallOrSmsHelper; |
|
|
|
private final YxtClientHelper yxtClientHelper; |
|
|
|
private final IExpertGovBusinessStripService expertGovBusinessStripService; |
|
|
|
|
|
|
|
@Value("${login.url:}") |
|
|
@@ -101,7 +101,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
|
|
|
|
ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId); |
|
|
|
|
|
|
|
ExpertUserFullInfo saveExpertUserFullInfo = buildSaveExpertUserFullInfo(expertUserInfoDTO); |
|
|
|
ExpertUserFullInfo saveExpertUserFullInfo = buildExpertUserFullInfo(expertUserInfoDTO); |
|
|
|
if (Objects.nonNull(expertUserFullInfo)) { |
|
|
|
// 专家信息审核通过之前,所有信息无需备份 |
|
|
|
iExpertUserFullInfoService.removeById(expertUserFullInfo.getId()); |
|
|
@@ -129,7 +129,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
iExpertTagService.saveBatch(saveExpertTagList); |
|
|
|
} |
|
|
|
// 保存所有专家字典字段 |
|
|
|
List<ExpertDictionary> saveExpertDictionaryList = buildSaveExpertDictionaryList(userId, expertDictionaryList); |
|
|
|
List<ExpertDictionary> saveExpertDictionaryList = buildExpertDicts(userId, expertDictionaryList); |
|
|
|
if (CollectionUtils.isNotEmpty(saveExpertDictionaryList)) { |
|
|
|
iExpertDictionaryService.saveBatch(saveExpertDictionaryList); |
|
|
|
} |
|
|
@@ -141,14 +141,14 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
iExpertMetaApplyService.saveBatch(saveExpertIntentionWorkRegionApplyList); |
|
|
|
} |
|
|
|
// 保存所有专家回避单位 |
|
|
|
List<ExpertAvoidCompany> saveExpertAvoidCompanyList = buildSaveExpertAvoidCompanyList(userId, expertAvoidCompanyList); |
|
|
|
List<ExpertAvoidCompany> saveExpertAvoidCompanyList = buildExpertAvoidCompany(userId, expertAvoidCompanyList); |
|
|
|
if (CollectionUtils.isNotEmpty(saveExpertAvoidCompanyList)) { |
|
|
|
iExpertAvoidCompanyService.saveBatch(saveExpertAvoidCompanyList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ExpertUserFullInfo buildSaveExpertUserFullInfo(ExpertUserFullInfoDTO expertUserInfoDTO) { |
|
|
|
private ExpertUserFullInfo buildExpertUserFullInfo(ExpertUserFullInfoDTO expertUserInfoDTO) { |
|
|
|
ExpertUserFullInfo expertUserFullInfo = new ExpertUserFullInfo(); |
|
|
|
if (Objects.nonNull(expertUserInfoDTO.getIsDingUser())) { |
|
|
|
expertUserFullInfo.setIsDingUser(expertUserInfoDTO.getIsDingUser()); |
|
|
@@ -197,33 +197,35 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
private List<ExpertDictionary> buildSaveExpertDictionaryList(Long userId, List<ExpertDictionaryDTO> expertDictionaryList) { |
|
|
|
if (CollectionUtils.isEmpty(expertDictionaryList)) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
return expertDictionaryList.stream().map(r -> { |
|
|
|
ExpertDictionary expertDictionary = new ExpertDictionary(); |
|
|
|
expertDictionary.setUserId(userId); |
|
|
|
expertDictionary.setExpertInfoField(r.getExpertInfoField()); |
|
|
|
expertDictionary.setDictionaryCode(r.getDictionaryCode()); |
|
|
|
expertDictionary.setUpdateOn(LocalDateTime.now()); |
|
|
|
expertDictionary.setCreateOn(LocalDateTime.now()); |
|
|
|
return expertDictionary; |
|
|
|
private List<ExpertDictionary> buildExpertDicts(Long userId, List<ExpertDictionaryDTO> exertDicts) { |
|
|
|
if (CollectionUtils.isEmpty(exertDicts)) { |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
return exertDicts.stream().map(r -> { |
|
|
|
ExpertDictionary expertDict = new ExpertDictionary(); |
|
|
|
expertDict.setUserId(userId); |
|
|
|
expertDict.setExpertInfoField(r.getExpertInfoField()); |
|
|
|
expertDict.setDictionaryCode(r.getDictionaryCode()); |
|
|
|
expertDict.setUpdateOn(now); |
|
|
|
expertDict.setCreateOn(now); |
|
|
|
return expertDict; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private List<ExpertAvoidCompany> buildSaveExpertAvoidCompanyList(Long userId, List<ExpertAvoidCompanyDTO> expertAvoidCompanyList) { |
|
|
|
if (CollectionUtils.isEmpty(expertAvoidCompanyList)) { |
|
|
|
return new ArrayList<>(); |
|
|
|
private List<ExpertAvoidCompany> buildExpertAvoidCompany(Long userId, List<ExpertAvoidCompanyDTO> avoidCompanies) { |
|
|
|
if (CollectionUtils.isEmpty(avoidCompanies)) { |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
return expertAvoidCompanyList.stream().map(r -> { |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
return avoidCompanies.stream().map(r -> { |
|
|
|
ExpertAvoidCompany expertAvoidCompany = new ExpertAvoidCompany(); |
|
|
|
expertAvoidCompany.setCompanyName(r.getCompanyName()); |
|
|
|
expertAvoidCompany.setUserId(userId); |
|
|
|
expertAvoidCompany.setCompanyUniqCode(r.getCompanyUniqCode()); |
|
|
|
expertAvoidCompany.setCreateOn(LocalDateTime.now()); |
|
|
|
expertAvoidCompany.setUpdateOn(LocalDateTime.now()); |
|
|
|
expertAvoidCompany.setCreateOn(now); |
|
|
|
expertAvoidCompany.setUpdateOn(now); |
|
|
|
return expertAvoidCompany; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
@@ -239,15 +241,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
|
|
|
|
List<ExpertDictionaryDTO> recommendedWayList = cmd.getRecommendedWay(); |
|
|
|
if (CollectionUtils.isNotEmpty(recommendedWayList)) { |
|
|
|
List<ExpertDictionary> saveExpertDictionaryList = recommendedWayList.stream().map(r -> { |
|
|
|
ExpertDictionary expertDictionary = new ExpertDictionary(); |
|
|
|
expertDictionary.setUserId(userId); |
|
|
|
expertDictionary.setExpertInfoField(r.getExpertInfoField()); |
|
|
|
expertDictionary.setDictionaryCode(r.getDictionaryCode()); |
|
|
|
expertDictionary.setUpdateOn(LocalDateTime.now()); |
|
|
|
expertDictionary.setCreateOn(LocalDateTime.now()); |
|
|
|
return expertDictionary; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
List<ExpertDictionary> saveExpertDictionaryList = buildExpertDicts(userId, recommendedWayList); |
|
|
|
iExpertDictionaryService.saveBatch(saveExpertDictionaryList); |
|
|
|
} |
|
|
|
|
|
|
@@ -325,7 +319,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
Integer expertRegionLevel = cmd.getExpertRegionLevel(); |
|
|
|
Long expertUserId = cmd.getExpertUserId(); |
|
|
|
|
|
|
|
if (applyResult) { |
|
|
|
if (Boolean.TRUE.equals(applyResult)) { |
|
|
|
switch (applyTypeEnum) { |
|
|
|
case EXPERT_INTENTION_JOIN: { |
|
|
|
// 新增履职意向地 |
|
|
@@ -372,7 +366,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
ExpertUserFullInfo expertInfo = iExpertUserFullInfoService.getByUserId(expertUserId); |
|
|
|
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); |
|
|
|
String content; |
|
|
|
if (cmd.getApplyResult()) { |
|
|
|
if (Boolean.TRUE.equals(cmd.getApplyResult())) { |
|
|
|
// 修改专家状态为可用 |
|
|
|
// 账号启用 |
|
|
|
LambdaUpdateWrapper<UserInfo> userInfoUpdate = Wrappers.lambdaUpdate(UserInfo.class) |
|
|
@@ -387,7 +381,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
List<ExpertDictionaryDTO> expertType = cmd.getExpertType(); |
|
|
|
if (CollUtil.isNotEmpty(expertType)) { |
|
|
|
expertType.forEach(r -> r.setExpertInfoField(ExpertDictTypeEnum.EXPERT_TYPE.getKey())); |
|
|
|
List<ExpertDictionary> saveExpertDictList = buildSaveExpertDictionaryList(expertUserId, expertType); |
|
|
|
List<ExpertDictionary> saveExpertDictList = buildExpertDicts(expertUserId, expertType); |
|
|
|
iExpertDictionaryService.saveBatch(saveExpertDictList); |
|
|
|
} |
|
|
|
// 补充专家 专家角色 |
|
|
@@ -410,7 +404,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
SendSmsContext smsCtx = new SendSmsContext(); |
|
|
|
smsCtx.setContent(content); |
|
|
|
smsCtx.setReceiveNumber(expertInfo.getPhoneNo()); |
|
|
|
yxtCallOrSmsHelper.sendSms(smsCtx); |
|
|
|
yxtClientHelper.sendSms(smsCtx); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -464,7 +458,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
List<Long> applyIdList = new ArrayList<>(); |
|
|
|
|
|
|
|
ExpertUserFullInfo originalExpertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId); |
|
|
|
ExpertUserFullInfo saveExpertUserFullInfo = buildSaveExpertUserFullInfo(expertUserInfoDTO); |
|
|
|
ExpertUserFullInfo saveExpertUserFullInfo = buildExpertUserFullInfo(expertUserInfoDTO); |
|
|
|
if (Objects.nonNull(originalExpertUserFullInfo)) { |
|
|
|
saveExpertUserFullInfo.setId(originalExpertUserFullInfo.getId()); |
|
|
|
// 删除所有专家字典字段(需审核敏感字段不删除) |
|
|
@@ -497,7 +491,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
iExpertUserFullInfoService.saveOrUpdate(saveExpertUserFullInfo); |
|
|
|
|
|
|
|
// 保存所有专家字典字段 |
|
|
|
List<ExpertDictionary> saveExpertDictionaryList = buildSaveExpertDictionaryList(userId, expertDictionaryList); |
|
|
|
List<ExpertDictionary> saveExpertDictionaryList = buildExpertDicts(userId, expertDictionaryList); |
|
|
|
saveExpertDictionaryList = saveExpertDictionaryList |
|
|
|
.stream().filter(r -> !ExpertUserInfoSensitiveFieldEnum.getSensitiveDictionaryList().contains(r.getExpertInfoField())) |
|
|
|
.collect(Collectors.toList()); |
|
|
@@ -506,7 +500,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
} |
|
|
|
|
|
|
|
// 保存所有专家回避单位 |
|
|
|
List<ExpertAvoidCompany> saveExpertAvoidCompanyList = buildSaveExpertAvoidCompanyList(userId, expertAvoidCompanyList); |
|
|
|
List<ExpertAvoidCompany> saveExpertAvoidCompanyList = buildExpertAvoidCompany(userId, expertAvoidCompanyList); |
|
|
|
if (CollectionUtils.isNotEmpty(saveExpertAvoidCompanyList)) { |
|
|
|
// 删除回避单位 |
|
|
|
LambdaQueryWrapper<ExpertAvoidCompany> expertAvoidCompanyRemove = Wrappers.lambdaQuery(ExpertAvoidCompany.class) |
|
|
|