Browse Source

fix 新增专家的时候履职意向没有自动审核通过

tags/24080901
niohe·erbao 1 year ago
parent
commit
77ae44c50a
3 changed files with 26 additions and 1 deletions
  1. +7
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java
  2. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java
  3. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java

+ 7
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java View File

@@ -37,8 +37,14 @@ 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("/basic-info-submit")
@ApiOperation("填写基本信息接口(专家报名使用))")
@ApiOperation("专家管理员新增专家)")
public void expertBasicInfoSubmit(@Valid @RequestBody ExpertUserBasicInfoSubmitRequest request) {
expertManage.expertBasicInfoSubmit(request);
}


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java View File

@@ -117,6 +117,9 @@ public class ExpertManage {
applyResult.setApplyResult(true);
expertMetaApplyManage.metaApplyResult(applyResult);

// 批量通过专家履职意向审核
expertMetaApplyManage.autoPassExpertIntentionApply(userId);

// 增加用户专家角色
Role expertRole = iRoleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getCode, RoleEnum.EXPERT.name()));
UserRole expertUserRole = iUserRoleService.getOne(Wrappers.lambdaQuery(UserRole.class)


+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java View File

@@ -590,4 +590,20 @@ public class ExpertMetaApplyManage {
expertIntentionApplyDealCmd.setExpertRegionLevel(expertMetaApply.getRegionLevel());
return expertIntentionApplyDealCmd;
}

public void autoPassExpertIntentionApply(Long expertUserId) {
List<ExpertMetaApply> expertIntentionJoinApplyList = iMetaApplyService.list(Wrappers
.lambdaQuery(ExpertMetaApply.class)
.eq(ExpertMetaApply::getUserId, expertUserId)
.eq(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey())
.eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()));

for (ExpertMetaApply expertMetaApply : expertIntentionJoinApplyList) {
MetaApplyResultRequest applyResult = new MetaApplyResultRequest();
applyResult.setApplyId(expertMetaApply.getId());
applyResult.setAuditOpinion("同意");
applyResult.setApplyResult(true);
metaApplyResult(applyResult);
}
}
}

Loading…
Cancel
Save