瀏覽代碼

Merge branch 'master' of http://git.ningdatech.com/liushuai/project-management into 20230913_project_declared_new

master
PoffyZhang 1 年之前
父節點
當前提交
5ae097ac57
共有 7 個文件被更改,包括 42 次插入22 次删除
  1. +6
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java
  2. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/constant/ExpertAuditMsgTemplate.java
  3. +7
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertAvoidCompanyService.java
  4. +9
    -13
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java
  5. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java
  6. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertTagService.java
  7. +4
    -0
      pmapi/src/main/resources/application-dev.yml

+ 6
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java 查看文件

@@ -44,6 +44,7 @@ import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -80,6 +81,9 @@ public class ExpertManage {
private final VerifyCodeCheckHelper verifyCodeCheckHelper;
private final CachePlusOps cachePlusOps;

@Value("${expert-registration.verify-code.check:true}")
private Boolean expertRegistrationVerifyCodeCheck;

private static final Duration REGISTER_EXPIRED_DURATION = Duration.ofDays(3);
private static final Duration REGISTER_GEN_DURATION = Duration.ofMinutes(30);

@@ -209,7 +213,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();
@@ -225,7 +229,7 @@ public class ExpertManage {
String verificationCode = request.getVerificationCode();
String phoneNo = request.getBasicInfo().getPhoneNo();
//校验 专家验证码
if (false) {
if (expertRegistrationVerifyCodeCheck) {
verifyCodeCheckHelper.verification(VerificationCodeType.EXPERT_REGISTER, phoneNo, verificationCode);
}
assemblerAndGenerateExpert(request, null);


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/constant/ExpertAuditMsgTemplate.java 查看文件

@@ -13,11 +13,11 @@ public interface ExpertAuditMsgTemplate {
/**
* 【丽水市大数据局】尊敬的xxx专家您好,您提交的专家入库申请未通过,如有疑问请联系xxx确认。
*/
String EXPERT_AUDIT_PASS_MSG = "尊敬的%s专家您好,您提交的专家入库申请未通过,如有疑问请联系%s「%s」确认。";
String EXPERT_AUDIT_FAIL = "尊敬的%s专家您好,您提交的专家入库申请未通过,如有疑问请联系%s「%s」确认。";

/**
* 【丽水市大数据局】尊敬的xxx专家您好,您提交的专家入库申请已通过,请登录http://60.188.225.145/login查看,如有疑问请联系xxx。
*/
String EXPERT_AUDIT_FAIL_MSG = "尊敬的%s专家您好,您提交的专家入库申请已通过,请登录%s查看,如有疑问请联系%s「%s」。";
String EXPERT_AUDIT_PASS = "尊敬的%s专家您好,您提交的专家入库申请已通过,请登录%s查看,如有疑问请联系%s「%s」。";

}

+ 7
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertAvoidCompanyService.java 查看文件

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

}

+ 9
- 13
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java 查看文件

@@ -56,6 +56,8 @@ import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

import static com.ningdatech.pmapi.expert.model.constant.ExpertAuditMsgTemplate.EXPERT_AUDIT_FAIL;
import static com.ningdatech.pmapi.expert.model.constant.ExpertAuditMsgTemplate.EXPERT_AUDIT_PASS;
import static com.ningdatech.yxt.model.cmd.SendSmsCmd.SendSmsContext;

/**
@@ -104,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)
@@ -119,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());
@@ -402,7 +398,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
Long expertUserId = cmd.getExpertUserId();
ExpertUserFullInfo expertInfo = iExpertUserFullInfoService.getByUserId(expertUserId);
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail();
String smsContent;
String content;
if (cmd.getApplyResult()) {
// 修改专家状态为可用
expertInfo.setExpertAccountStatus(ExpertAccountStatusEnum.AVAILABLE.getKey());
@@ -436,15 +432,15 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
userRoleService.save(saveUserRole);
}
}
smsContent = String.format(ExpertAuditMsgTemplate.EXPERT_AUDIT_PASS_MSG, expertInfo.getExpertName(), userDetail.getRealName(), userDetail.getMobile());
content = String.format(EXPERT_AUDIT_PASS, expertInfo.getExpertName(), loginUrl, userDetail.getRealName(), userDetail.getMobile());
} else {
expertInfo.setUserInfoStep(ExpertUserInfoStepEnum.INFORMATION_TO_BE_SUBMITTED.getKey());
smsContent = String.format(ExpertAuditMsgTemplate.EXPERT_AUDIT_FAIL_MSG, expertInfo.getExpertName(), loginUrl, userDetail.getRealName(), userDetail.getMobile());
content = String.format(EXPERT_AUDIT_FAIL, expertInfo.getExpertName(), userDetail.getRealName(), userDetail.getMobile());
}
iExpertUserFullInfoService.saveOrUpdate(expertInfo);
if (PhoneUtil.isMobile(expertInfo.getPhoneNo())) {
SendSmsContext smsCtx = new SendSmsContext();
smsCtx.setContent(smsContent);
smsCtx.setContent(content);
smsCtx.setReceiveNumber(expertInfo.getPhoneNo());
yxtCallOrSmsHelper.sendSms(smsCtx);
}


+ 7
- 2
pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java 查看文件

@@ -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 查看文件

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

}

+ 4
- 0
pmapi/src/main/resources/application-dev.yml 查看文件

@@ -240,5 +240,9 @@ login:
url: http://lspm.ningdatech.com/login
web:
url: http://lspm.ningdatech.com
# 专家报名验证码校验
expert-registration:
verify-code:
check: false



Loading…
取消
儲存