|
|
@@ -17,13 +17,15 @@ import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; |
|
|
|
import com.ningdatech.pmapi.expert.model.cmd.ExpertRecommendProofSaveCmd; |
|
|
|
import com.ningdatech.pmapi.expert.model.dto.ExpertDictionaryDTO; |
|
|
|
import com.ningdatech.pmapi.expert.model.dto.ExpertFullInfoAllDTO; |
|
|
|
import com.ningdatech.pmapi.expert.model.req.ExpertRegistrationRequest; |
|
|
|
import com.ningdatech.pmapi.expert.model.req.ExpertUserBasicInfoSubmitRequest; |
|
|
|
import com.ningdatech.pmapi.expert.model.req.MetaApplyResultRequest; |
|
|
|
import com.ningdatech.pmapi.expert.model.vo.ExpertFullInfoVO; |
|
|
|
import com.ningdatech.pmapi.expert.service.ExpertInfoService; |
|
|
|
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; |
|
|
|
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; |
|
|
|
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; |
|
|
|
import com.ningdatech.pmapi.sms.constant.VerificationCodeType; |
|
|
|
import com.ningdatech.pmapi.sms.helper.VerifyCodeCheckHelper; |
|
|
|
import com.ningdatech.pmapi.sys.model.entity.Role; |
|
|
|
import com.ningdatech.pmapi.sys.model.entity.UserRole; |
|
|
|
import com.ningdatech.pmapi.sys.service.IRoleService; |
|
|
@@ -63,62 +65,20 @@ public class ExpertManage { |
|
|
|
private final ExpertMetaApplyManage expertMetaApplyManage; |
|
|
|
private final IUserRoleService iUserRoleService; |
|
|
|
private final IRoleService iRoleService; |
|
|
|
private final VerifyCodeCheckHelper verifyCodeCheckHelper; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 填写基本信息,只有专家自己可用 |
|
|
|
* 专家管理员新增专家 |
|
|
|
* |
|
|
|
* @param req / |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void expertBasicInfoSubmit(ExpertUserBasicInfoSubmitRequest req) { |
|
|
|
// 用户id |
|
|
|
ExpertBasicInfo basicInfo = req.getBasicInfo(); |
|
|
|
Long userId = generateOrGetUserId(basicInfo); |
|
|
|
|
|
|
|
// 校验区域编码合法性 校验履职意向编码合法性 |
|
|
|
ExpertRegionInfo expertRegionInfo = basicInfo.getExpertRegionInfo(); |
|
|
|
expertManageHelper.expertRegionInfoCheck(expertRegionInfo); |
|
|
|
List<ExpertRegionInfo> expertIntentionWorkRegions = basicInfo.getExpertIntentionWorkRegions(); |
|
|
|
for (ExpertRegionInfo expertIntentionWorkRegion : expertIntentionWorkRegions) { |
|
|
|
expertManageHelper.expertRegionInfoCheck(expertIntentionWorkRegion); |
|
|
|
} |
|
|
|
ExpertEduInfo eduInfo = req.getEduInfo(); |
|
|
|
ExpertJobInfo jobInfo = req.getJobInfo(); |
|
|
|
ExpertProfessionalInfo professionalInfo = req.getProfessionalInfo(); |
|
|
|
// 校验标签字段 |
|
|
|
expertManageHelper.tagFieldCheck(professionalInfo, basicInfo); |
|
|
|
// 校验字典字段 |
|
|
|
expertManageHelper.dictionaryFieldCheck(basicInfo, eduInfo, jobInfo); |
|
|
|
// 判断专家提交状态,判断是否可以进行此操作 |
|
|
|
ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId); |
|
|
|
|
|
|
|
boolean submitBasicInfoStatusEnable = Objects.isNull(expertUserFullInfo) |
|
|
|
|| (ExpertAccountStatusEnum.APPLYING.getKey().equals(expertUserFullInfo.getExpertAccountStatus()) |
|
|
|
&& !ExpertUserInfoStepEnum.EVIDENCE_HAS_BEEN_SUBMITTED.getKey().equals(expertUserFullInfo.getUserInfoStep())); |
|
|
|
if (submitBasicInfoStatusEnable) { |
|
|
|
// 新建 保存 |
|
|
|
ExpertFullInfoSaveCmd expertFullInfoSaveCmd = ExpertInfoCmdAssembler |
|
|
|
.buildExpertFullInfoSaveCmd(userId, basicInfo, eduInfo, jobInfo, professionalInfo); |
|
|
|
expertInfoService.saveExpertInfo(expertFullInfoSaveCmd); |
|
|
|
} |
|
|
|
|
|
|
|
ExpertRecommendInfo recommendInfo = req.getRecommendInfo(); |
|
|
|
// 推荐证明材料 |
|
|
|
List<DictionaryFieldInfo> recommendedWay = recommendInfo.getRecommendedWay(); |
|
|
|
// 推荐方式 |
|
|
|
List<FileBasicInfo> recommendProofFile = recommendInfo.getRecommendationProofFile(); |
|
|
|
Long applyId = expertRecommendProofSubmit(recommendedWay, recommendProofFile, userId); |
|
|
|
|
|
|
|
// 批量通过专家管理员审核 |
|
|
|
MetaApplyResultRequest applyResult = new MetaApplyResultRequest(); |
|
|
|
applyResult.setApplyId(applyId); |
|
|
|
applyResult.setAuditOpinion("同意"); |
|
|
|
applyResult.setApplyResult(true); |
|
|
|
expertMetaApplyManage.metaApplyResult(applyResult); |
|
|
|
|
|
|
|
// 批量通过专家履职意向审核 |
|
|
|
expertMetaApplyManage.autoPassExpertIntentionApply(userId); |
|
|
|
Long userId = assemblerAndGenerateExpert(req); |
|
|
|
// 批量通过专家入库审核/专家履职意向审核 |
|
|
|
expertMetaApplyManage.autoPassExpertApply(userId); |
|
|
|
|
|
|
|
// 增加用户专家角色 |
|
|
|
Role expertRole = iRoleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getCode, RoleEnum.EXPERT.name())); |
|
|
@@ -205,4 +165,63 @@ public class ExpertManage { |
|
|
|
} |
|
|
|
return userInfo.getId(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 社会专家报名 需要校验手机号 |
|
|
|
* |
|
|
|
* @param request |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void expertRegistration(ExpertRegistrationRequest request) { |
|
|
|
String verificationCode = request.getVerificationCode(); |
|
|
|
String phoneNo = request.getBasicInfo().getPhoneNo(); |
|
|
|
//校验 专家验证码 |
|
|
|
if (false) { |
|
|
|
verifyCodeCheckHelper.verification(VerificationCodeType.EXPERT_REGISTER, phoneNo, verificationCode); |
|
|
|
} |
|
|
|
assemblerAndGenerateExpert(request); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Long assemblerAndGenerateExpert(ExpertUserBasicInfoSubmitRequest req) { |
|
|
|
ExpertBasicInfo basicInfo = req.getBasicInfo(); |
|
|
|
Long userId = generateOrGetUserId(basicInfo); |
|
|
|
|
|
|
|
// 校验区域编码合法性 校验履职意向编码合法性 |
|
|
|
ExpertRegionInfo expertRegionInfo = basicInfo.getExpertRegionInfo(); |
|
|
|
expertManageHelper.expertRegionInfoCheck(expertRegionInfo); |
|
|
|
List<ExpertRegionInfo> expertIntentionWorkRegions = basicInfo.getExpertIntentionWorkRegions(); |
|
|
|
for (ExpertRegionInfo expertIntentionWorkRegion : expertIntentionWorkRegions) { |
|
|
|
expertManageHelper.expertRegionInfoCheck(expertIntentionWorkRegion); |
|
|
|
} |
|
|
|
ExpertEduInfo eduInfo = req.getEduInfo(); |
|
|
|
ExpertJobInfo jobInfo = req.getJobInfo(); |
|
|
|
ExpertProfessionalInfo professionalInfo = req.getProfessionalInfo(); |
|
|
|
// 校验标签字段 |
|
|
|
expertManageHelper.tagFieldCheck(professionalInfo, basicInfo); |
|
|
|
// 校验字典字段 |
|
|
|
expertManageHelper.dictionaryFieldCheck(basicInfo, eduInfo, jobInfo); |
|
|
|
// 判断专家提交状态,判断是否可以进行此操作 |
|
|
|
ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId); |
|
|
|
|
|
|
|
boolean submitBasicInfoStatusEnable = Objects.isNull(expertUserFullInfo) |
|
|
|
|| (ExpertAccountStatusEnum.APPLYING.getKey().equals(expertUserFullInfo.getExpertAccountStatus()) |
|
|
|
&& !ExpertUserInfoStepEnum.EVIDENCE_HAS_BEEN_SUBMITTED.getKey().equals(expertUserFullInfo.getUserInfoStep())); |
|
|
|
if (submitBasicInfoStatusEnable) { |
|
|
|
// 新建 保存 |
|
|
|
ExpertFullInfoSaveCmd expertFullInfoSaveCmd = ExpertInfoCmdAssembler |
|
|
|
.buildExpertFullInfoSaveCmd(userId, basicInfo, eduInfo, jobInfo, professionalInfo); |
|
|
|
expertInfoService.saveExpertInfo(expertFullInfoSaveCmd); |
|
|
|
} |
|
|
|
|
|
|
|
ExpertRecommendInfo recommendInfo = req.getRecommendInfo(); |
|
|
|
// 推荐证明材料 |
|
|
|
List<DictionaryFieldInfo> recommendedWay = recommendInfo.getRecommendedWay(); |
|
|
|
// 推荐方式 |
|
|
|
List<FileBasicInfo> recommendProofFile = recommendInfo.getRecommendationProofFile(); |
|
|
|
expertRecommendProofSubmit(recommendedWay, recommendProofFile, userId); |
|
|
|
return userId; |
|
|
|
} |
|
|
|
|
|
|
|
} |