Browse Source

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

tags/24080901
PoffyZhang 1 year ago
parent
commit
5ae097ac57
7 changed files with 42 additions and 22 deletions
  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 View File

@@ -44,6 +44,7 @@ import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -80,6 +81,9 @@ public class ExpertManage {
private final VerifyCodeCheckHelper verifyCodeCheckHelper; private final VerifyCodeCheckHelper verifyCodeCheckHelper;
private final CachePlusOps cachePlusOps; 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_EXPIRED_DURATION = Duration.ofDays(3);
private static final Duration REGISTER_GEN_DURATION = Duration.ofMinutes(30); 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) ExpertUserFullInfo one = iExpertUserFullInfoService.getOne(Wrappers.lambdaQuery(ExpertUserFullInfo.class)
.eq(ExpertUserFullInfo::getPhoneNo, phoneNo)); .eq(ExpertUserFullInfo::getPhoneNo, phoneNo));
if (Objects.nonNull(one)) {
if (Objects.nonNull(one) && !one.getUserId().equals(userInfo.getId())) {
throw new BizException("该手机号已被专家注册,请确认后再填写"); throw new BizException("该手机号已被专家注册,请确认后再填写");
} }
return userInfo.getId(); return userInfo.getId();
@@ -225,7 +229,7 @@ public class ExpertManage {
String verificationCode = request.getVerificationCode(); String verificationCode = request.getVerificationCode();
String phoneNo = request.getBasicInfo().getPhoneNo(); String phoneNo = request.getBasicInfo().getPhoneNo();
//校验 专家验证码 //校验 专家验证码
if (false) {
if (expertRegistrationVerifyCodeCheck) {
verifyCodeCheckHelper.verification(VerificationCodeType.EXPERT_REGISTER, phoneNo, verificationCode); verifyCodeCheckHelper.verification(VerificationCodeType.EXPERT_REGISTER, phoneNo, verificationCode);
} }
assemblerAndGenerateExpert(request, null); assemblerAndGenerateExpert(request, null);


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/constant/ExpertAuditMsgTemplate.java View File

@@ -13,11 +13,11 @@ public interface ExpertAuditMsgTemplate {
/** /**
* 【丽水市大数据局】尊敬的xxx专家您好,您提交的专家入库申请未通过,如有疑问请联系xxx确认。 * 【丽水市大数据局】尊敬的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。 * 【丽水市大数据局】尊敬的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 View File

@@ -1,11 +1,13 @@
package com.ningdatech.pmapi.expert.service; 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.ningdatech.pmapi.expert.entity.ExpertAvoidCompany;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;


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

@@ -56,6 +56,8 @@ import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; 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; import static com.ningdatech.yxt.model.cmd.SendSmsCmd.SendSmsContext;


/** /**
@@ -104,13 +106,9 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
// 专家信息审核通过之前,所有信息无需备份 // 专家信息审核通过之前,所有信息无需备份
iExpertUserFullInfoService.removeById(expertUserFullInfo.getId()); 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) LambdaQueryWrapper<ExpertMetaApply> expertMetaApplyRemove = Wrappers.lambdaQuery(ExpertMetaApply.class)
@@ -119,9 +117,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
.eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.N.name()); .eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.N.name());
iExpertMetaApplyService.remove(expertMetaApplyRemove); iExpertMetaApplyService.remove(expertMetaApplyRemove);
// 删除回避单位 // 删除回避单位
LambdaQueryWrapper<ExpertAvoidCompany> expertAvoidCompanyRemove = Wrappers.lambdaQuery(ExpertAvoidCompany.class)
.eq(ExpertAvoidCompany::getUserId, userId);
iExpertAvoidCompanyService.remove(expertAvoidCompanyRemove);
iExpertAvoidCompanyService.removeByUserId(userId);
} }
saveExpertUserFullInfo.setUserId(userId); saveExpertUserFullInfo.setUserId(userId);
saveExpertUserFullInfo.setExpertAccountStatus(ExpertAccountStatusEnum.APPLYING.getKey()); saveExpertUserFullInfo.setExpertAccountStatus(ExpertAccountStatusEnum.APPLYING.getKey());
@@ -402,7 +398,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
Long expertUserId = cmd.getExpertUserId(); Long expertUserId = cmd.getExpertUserId();
ExpertUserFullInfo expertInfo = iExpertUserFullInfoService.getByUserId(expertUserId); ExpertUserFullInfo expertInfo = iExpertUserFullInfoService.getByUserId(expertUserId);
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); UserInfoDetails userDetail = LoginUserUtil.loginUserDetail();
String smsContent;
String content;
if (cmd.getApplyResult()) { if (cmd.getApplyResult()) {
// 修改专家状态为可用 // 修改专家状态为可用
expertInfo.setExpertAccountStatus(ExpertAccountStatusEnum.AVAILABLE.getKey()); expertInfo.setExpertAccountStatus(ExpertAccountStatusEnum.AVAILABLE.getKey());
@@ -436,15 +432,15 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
userRoleService.save(saveUserRole); 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 { } else {
expertInfo.setUserInfoStep(ExpertUserInfoStepEnum.INFORMATION_TO_BE_SUBMITTED.getKey()); 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); iExpertUserFullInfoService.saveOrUpdate(expertInfo);
if (PhoneUtil.isMobile(expertInfo.getPhoneNo())) { if (PhoneUtil.isMobile(expertInfo.getPhoneNo())) {
SendSmsContext smsCtx = new SendSmsContext(); SendSmsContext smsCtx = new SendSmsContext();
smsCtx.setContent(smsContent);
smsCtx.setContent(content);
smsCtx.setReceiveNumber(expertInfo.getPhoneNo()); smsCtx.setReceiveNumber(expertInfo.getPhoneNo());
yxtCallOrSmsHelper.sendSms(smsCtx); yxtCallOrSmsHelper.sendSms(smsCtx);
} }


+ 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; 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.constant.DictExpertInfoTypeEnum;
import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary;
import com.baomidou.mybatisplus.extension.service.IService;


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


/** /**
* <p> * <p>
* 服务类
* 服务类
* </p> * </p>
* *
* @author Liuxinxin * @author Liuxinxin
@@ -28,4 +29,8 @@ public interface IExpertDictionaryService extends IService<ExpertDictionary> {
**/ **/
List<ExpertDictionary> listByUserId(Collection<Long> userIds, DictExpertInfoTypeEnum dictType); 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; 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.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.meta.model.entity.ExpertTag;


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

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





Loading…
Cancel
Save