Browse Source

修复专家报名申请多次失败

master
WendyYang 1 year ago
parent
commit
92577d2c0e
5 changed files with 25 additions and 15 deletions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java
  2. +7
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertAvoidCompanyService.java
  3. +3
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java
  4. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java
  5. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertTagService.java

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

@@ -209,7 +209,7 @@ public class ExpertManage {
}
ExpertUserFullInfo one = iExpertUserFullInfoService.getOne(Wrappers.lambdaQuery(ExpertUserFullInfo.class)
.eq(ExpertUserFullInfo::getPhoneNo, phoneNo));
if (Objects.nonNull(one)) {
if (Objects.nonNull(one) && !one.getUserId().equals(userInfo.getId())) {
throw new BizException("该手机号已被专家注册,请确认后再填写");
}
return userInfo.getId();


+ 7
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertAvoidCompanyService.java View File

@@ -1,11 +1,13 @@
package com.ningdatech.pmapi.expert.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* <p>
* 服务类
* 服务类
* </p>
*
* @author Liuxinxin
@@ -13,4 +15,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IExpertAvoidCompanyService extends IService<ExpertAvoidCompany> {

default void removeByUserId(Long userId) {
remove(Wrappers.lambdaQuery(ExpertAvoidCompany.class).eq(ExpertAvoidCompany::getUserId, userId));
}

}

+ 3
- 9
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java View File

@@ -106,13 +106,9 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
// 专家信息审核通过之前,所有信息无需备份
iExpertUserFullInfoService.removeById(expertUserFullInfo.getId());
// 删除所有专家标签字段
LambdaQueryWrapper<ExpertTag> expertTagRemove = Wrappers.lambdaQuery(ExpertTag.class)
.eq(ExpertTag::getUserId, userId);
iExpertTagService.remove(expertTagRemove);
iExpertTagService.removeByUserId(userId);
// 删除所有专家字典字段
LambdaQueryWrapper<ExpertDictionary> expertDictionaryRemove = Wrappers.lambdaQuery(ExpertDictionary.class)
.eq(ExpertDictionary::getUserId, userId);
iExpertDictionaryService.remove(expertDictionaryRemove);
iExpertDictionaryService.removeByUserId(userId);
// 删除所有专家履职意向申请
// 补充审核逻辑
LambdaQueryWrapper<ExpertMetaApply> expertMetaApplyRemove = Wrappers.lambdaQuery(ExpertMetaApply.class)
@@ -121,9 +117,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
.eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.N.name());
iExpertMetaApplyService.remove(expertMetaApplyRemove);
// 删除回避单位
LambdaQueryWrapper<ExpertAvoidCompany> expertAvoidCompanyRemove = Wrappers.lambdaQuery(ExpertAvoidCompany.class)
.eq(ExpertAvoidCompany::getUserId, userId);
iExpertAvoidCompanyService.remove(expertAvoidCompanyRemove);
iExpertAvoidCompanyService.removeByUserId(userId);
}
saveExpertUserFullInfo.setUserId(userId);
saveExpertUserFullInfo.setExpertAccountStatus(ExpertAccountStatusEnum.APPLYING.getKey());


+ 7
- 2
pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java View File

@@ -1,15 +1,16 @@
package com.ningdatech.pmapi.meta.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum;
import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Collection;
import java.util.List;

/**
* <p>
* 服务类
* 服务类
* </p>
*
* @author Liuxinxin
@@ -28,4 +29,8 @@ public interface IExpertDictionaryService extends IService<ExpertDictionary> {
**/
List<ExpertDictionary> listByUserId(Collection<Long> userIds, DictExpertInfoTypeEnum dictType);

default void removeByUserId(Long userId) {
this.remove(Wrappers.lambdaQuery(ExpertDictionary.class).eq(ExpertDictionary::getUserId, userId));
}

}

+ 7
- 2
pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertTagService.java View File

@@ -1,11 +1,12 @@
package com.ningdatech.pmapi.meta.service;

import com.ningdatech.pmapi.meta.model.entity.ExpertTag;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.meta.model.entity.ExpertTag;

/**
* <p>
* 服务类
* 服务类
* </p>
*
* @author Liuxinxin
@@ -13,4 +14,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IExpertTagService extends IService<ExpertTag> {

default void removeByUserId(Long userId) {
remove(Wrappers.lambdaQuery(ExpertTag.class).eq(ExpertTag::getUserId, userId));
}

}

Loading…
Cancel
Save