Kaynağa Gözat

新增社会专家报名入口

tags/24080901
niohe·erbao 1 yıl önce
ebeveyn
işleme
dcda52a9bf
7 değiştirilmiş dosya ile 127 ekleme ve 61 silme
  1. +6
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java
  2. +67
    -48
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java
  3. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java
  4. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertRegistrationRequest.java
  5. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/sms/constant/VerificationCodeType.java
  6. +6
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sms/constant/VoiceSmsTemplateConst.java
  7. +13
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/sms/manage/SmsManage.java

+ 6
- 5
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java Dosyayı Görüntüle

@@ -6,6 +6,7 @@ import com.ningdatech.pmapi.expert.manage.ExpertAdminManage;
import com.ningdatech.pmapi.expert.manage.ExpertManage;
import com.ningdatech.pmapi.expert.model.ExpertAdminExpertManageQuery;
import com.ningdatech.pmapi.expert.model.req.AdminExpertBasicInfoModifyRequest;
import com.ningdatech.pmapi.expert.model.req.ExpertRegistrationRequest;
import com.ningdatech.pmapi.expert.model.req.ExpertUserBasicInfoSubmitRequest;
import com.ningdatech.pmapi.expert.model.req.GetZzdInfoRequest;
import com.ningdatech.pmapi.expert.model.vo.ExpertAdminExpertManageListVO;
@@ -37,11 +38,11 @@ public class ExpertController {
private final ExpertManage expertManage;
private final ExpertAdminManage expertAdminManage;

// @PostMapping("/basic-info-submit")
// @ApiOperation("专家管理员新增专家)")
// public void expertBasicInfoSubmit(@Valid @RequestBody ExpertUserBasicInfoSubmitRequest request) {
// expertManage.expertBasicInfoSubmit(request);
// }
@PostMapping("/registration")
@ApiOperation("社会专家报名")
public void expertRegistration(@Valid @RequestBody ExpertRegistrationRequest request) {
expertManage.expertRegistration(request);
}

@PostMapping("/basic-info-submit")
@ApiOperation("专家管理员新增专家)")


+ 67
- 48
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java Dosyayı Görüntüle

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

}

+ 7
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java Dosyayı Görüntüle

@@ -591,11 +591,16 @@ public class ExpertMetaApplyManage {
return expertIntentionApplyDealCmd;
}

public void autoPassExpertIntentionApply(Long expertUserId) {
/**
* 专家管理员 新增专家使用使用
* @param expertUserId
*/
@Transactional(rollbackFor = Exception.class)
public void autoPassExpertApply(Long expertUserId) {
List<ExpertMetaApply> expertIntentionJoinApplyList = iMetaApplyService.list(Wrappers
.lambdaQuery(ExpertMetaApply.class)
.eq(ExpertMetaApply::getUserId, expertUserId)
.eq(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey())
.in(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey(), ExpertApplyTypeEnum.EXPERT_STORAGE.getKey())
.eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()));

for (ExpertMetaApply expertMetaApply : expertIntentionJoinApplyList) {


+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertRegistrationRequest.java Dosyayı Görüntüle

@@ -0,0 +1,21 @@
package com.ningdatech.pmapi.expert.model.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
* @author liuxinxin
* @date 2022/7/25 下午2:21
*/
@Data
@ApiModel(value = "ExpertUserBasicInfoSubmitRequest", description = "社会专家报名接口")
public class ExpertRegistrationRequest extends ExpertUserBasicInfoSubmitRequest {

@NotBlank(message = "手机验证码不能为空")
@ApiModelProperty("手机验证码")
private String verificationCode;

}

+ 7
- 2
pmapi/src/main/java/com/ningdatech/pmapi/sms/constant/VerificationCodeType.java Dosyayı Görüntüle

@@ -20,9 +20,14 @@ import java.util.stream.Stream;
public enum VerificationCodeType {

/**
* 用户注册
* 用户登陆
*/
LOGIN("用户登录", 1, 5, 10);
LOGIN("用户登录", 1, 5, 10),

/**
* 社会专家注册
*/
EXPERT_REGISTER("社会专家注册", 1, 5, 10);

@ApiModelProperty(value = "描述")
private String desc;


+ 6
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sms/constant/VoiceSmsTemplateConst.java Dosyayı Görüntüle

@@ -13,7 +13,12 @@ public interface VoiceSmsTemplateConst {
/**
* 短信登陆验证码
*/
String SMS_LOGIN_TEMPLATE = "验证码:%s(有效期为%s分钟),请勿泄露给他人,如非本人操作,请忽略此信息。";
String SMS_COMMON_TEMPLATE = "验证码:%s(有效期为%s分钟),请勿泄露给他人,如非本人操作,请忽略此信息。";

/**
* 社会专家报名
*/
String EXPERT_REGISTER = "专家报名验证码:%s(有效期为%s分钟),请勿泄露给他人,如非本人操作,请忽略此信息。";

/**
* 专家电话通知语音模版


+ 13
- 3
pmapi/src/main/java/com/ningdatech/pmapi/sms/manage/SmsManage.java Dosyayı Görüntüle

@@ -66,16 +66,26 @@ public class SmsManage {
// 创建短信内容
SendSmsCmd sendSmsCmd = new SendSmsCmd();
switch (verificationCodeTypeEnum) {
case LOGIN:
case LOGIN: {
SendSmsCmd.SendSmsContext sendSmsContext = new SendSmsCmd.SendSmsContext();
sendSmsContext.setReceiveNumber(request.getMobile());
sendSmsContext.setContent(String.format(VoiceSmsTemplateConst.SMS_LOGIN_TEMPLATE, code, verificationCodeTypeEnum.getExpireTime()));
sendSmsContext.setContent(String.format(VoiceSmsTemplateConst.SMS_COMMON_TEMPLATE, code, verificationCodeTypeEnum.getExpireTime()));
sendSmsCmd.setContextList(Collections.singletonList(sendSmsContext));
sendSmsCmd.setSmsSignEnum(YxtSmsSignEnum.ZJS_ELECTRONIC_EXPERT_LIB);
break;
}
break;
case EXPERT_REGISTER: {
SendSmsCmd.SendSmsContext sendSmsContext = new SendSmsCmd.SendSmsContext();
sendSmsContext.setReceiveNumber(request.getMobile());
sendSmsContext.setContent(String.format(VoiceSmsTemplateConst.EXPERT_REGISTER, code, verificationCodeTypeEnum.getExpireTime()));
sendSmsCmd.setContextList(Collections.singletonList(sendSmsContext));
sendSmsCmd.setSmsSignEnum(YxtSmsSignEnum.ZJS_ELECTRONIC_EXPERT_LIB);
}
break;
default:
throw new IllegalArgumentException("非法的短信发送类型");
}

// 发送 短信
yxtClient.submitSmsTask(sendSmsCmd);
log.info("send verificationCode mobile = {},code = {}", request.getMobile(), code);


Yükleniyor…
İptal
Kaydet