|
@@ -1,6 +1,7 @@ |
|
|
package com.ningdatech.pmapi.expert.service.impl; |
|
|
package com.ningdatech.pmapi.expert.service.impl; |
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
|
|
import cn.hutool.core.util.PhoneUtil; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
@@ -19,9 +20,11 @@ import com.ningdatech.pmapi.expert.model.SensitiveModifySegment; |
|
|
import com.ningdatech.pmapi.expert.model.TagFieldInfo; |
|
|
import com.ningdatech.pmapi.expert.model.TagFieldInfo; |
|
|
import com.ningdatech.pmapi.expert.model.bo.ExpertInfoSensitiveFieldCheckBO; |
|
|
import com.ningdatech.pmapi.expert.model.bo.ExpertInfoSensitiveFieldCheckBO; |
|
|
import com.ningdatech.pmapi.expert.model.cmd.*; |
|
|
import com.ningdatech.pmapi.expert.model.cmd.*; |
|
|
|
|
|
import com.ningdatech.pmapi.expert.model.constant.ExpertAuditMsgTemplate; |
|
|
import com.ningdatech.pmapi.expert.model.dto.*; |
|
|
import com.ningdatech.pmapi.expert.model.dto.*; |
|
|
import com.ningdatech.pmapi.expert.service.*; |
|
|
import com.ningdatech.pmapi.expert.service.*; |
|
|
import com.ningdatech.pmapi.expert.utils.SensitiveModifySegmentUtils; |
|
|
import com.ningdatech.pmapi.expert.utils.SensitiveModifySegmentUtils; |
|
|
|
|
|
import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; |
|
|
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; |
|
|
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; |
|
|
import com.ningdatech.pmapi.meta.constant.ExpertTagEnum; |
|
|
import com.ningdatech.pmapi.meta.constant.ExpertTagEnum; |
|
|
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; |
|
|
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; |
|
@@ -33,16 +36,17 @@ import com.ningdatech.pmapi.sys.model.entity.Role; |
|
|
import com.ningdatech.pmapi.sys.model.entity.UserRole; |
|
|
import com.ningdatech.pmapi.sys.model.entity.UserRole; |
|
|
import com.ningdatech.pmapi.sys.service.IRoleService; |
|
|
import com.ningdatech.pmapi.sys.service.IRoleService; |
|
|
import com.ningdatech.pmapi.sys.service.IUserRoleService; |
|
|
import com.ningdatech.pmapi.sys.service.IUserRoleService; |
|
|
import com.ningdatech.pmapi.sys.service.impl.UserRoleServiceImpl; |
|
|
|
|
|
import com.ningdatech.pmapi.user.constant.UserAvailableEnum; |
|
|
import com.ningdatech.pmapi.user.constant.UserAvailableEnum; |
|
|
import com.ningdatech.pmapi.user.entity.UserInfo; |
|
|
import com.ningdatech.pmapi.user.entity.UserInfo; |
|
|
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum; |
|
|
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum; |
|
|
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
import com.ningdatech.pmapi.user.service.IUserInfoService; |
|
|
import com.ningdatech.pmapi.user.service.IUserInfoService; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.yxt.utils.JSONUtils; |
|
|
import com.ningdatech.yxt.utils.JSONUtils; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
@@ -51,6 +55,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.yxt.model.cmd.SendSmsCmd.SendSmsContext; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @author liuxinxin |
|
|
* @author liuxinxin |
|
|
* @date 2022/7/22 下午4:39 |
|
|
* @date 2022/7/22 下午4:39 |
|
@@ -69,7 +75,10 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
private final IUserRoleService userRoleService; |
|
|
private final IUserRoleService userRoleService; |
|
|
private final IExpertSensitiveInfoModifyDetailRecordService iExpertSensitiveInfoModifyDetailRecordService; |
|
|
private final IExpertSensitiveInfoModifyDetailRecordService iExpertSensitiveInfoModifyDetailRecordService; |
|
|
private final IUserInfoService userInfoService; |
|
|
private final IUserInfoService userInfoService; |
|
|
|
|
|
private final YxtCallOrSmsHelper yxtCallOrSmsHelper; |
|
|
|
|
|
|
|
|
|
|
|
@Value("${login.url:}") |
|
|
|
|
|
private String loginUrl; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用户第一次申请修改,仅在专家用户状态为applying 状态时调用 |
|
|
* 用户第一次申请修改,仅在专家用户状态为applying 状态时调用 |
|
@@ -387,16 +396,18 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void expertStorageDeal(ExpertStorageDealCmd cmd) { |
|
|
public void expertStorageDeal(ExpertStorageDealCmd cmd) { |
|
|
Long expertUserId = cmd.getExpertUserId(); |
|
|
Long expertUserId = cmd.getExpertUserId(); |
|
|
ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(expertUserId); |
|
|
|
|
|
|
|
|
ExpertUserFullInfo expertInfo = iExpertUserFullInfoService.getByUserId(expertUserId); |
|
|
|
|
|
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); |
|
|
|
|
|
String smsContent; |
|
|
if (cmd.getApplyResult()) { |
|
|
if (cmd.getApplyResult()) { |
|
|
// 修改专家状态为可用 |
|
|
// 修改专家状态为可用 |
|
|
expertUserFullInfo.setExpertAccountStatus(ExpertAccountStatusEnum.AVAILABLE.getKey()); |
|
|
|
|
|
expertUserFullInfo.setRemark(cmd.getRemark()); |
|
|
|
|
|
expertUserFullInfo.setRegionCode(cmd.getJoinRegionCode()); |
|
|
|
|
|
expertUserFullInfo.setRegionLevel(cmd.getJoinRegionLevel()); |
|
|
|
|
|
|
|
|
expertInfo.setExpertAccountStatus(ExpertAccountStatusEnum.AVAILABLE.getKey()); |
|
|
|
|
|
expertInfo.setRemark(cmd.getRemark()); |
|
|
|
|
|
expertInfo.setRegionCode(cmd.getJoinRegionCode()); |
|
|
|
|
|
expertInfo.setRegionLevel(cmd.getJoinRegionLevel()); |
|
|
// 账号启用 |
|
|
// 账号启用 |
|
|
LambdaUpdateWrapper<UserInfo> userInfoUpdate = Wrappers.lambdaUpdate(UserInfo.class) |
|
|
LambdaUpdateWrapper<UserInfo> userInfoUpdate = Wrappers.lambdaUpdate(UserInfo.class) |
|
|
.eq(UserInfo::getId,expertUserId) |
|
|
|
|
|
|
|
|
.eq(UserInfo::getId, expertUserId) |
|
|
.set(UserInfo::getAvailable, UserAvailableEnum.ENABLE); |
|
|
.set(UserInfo::getAvailable, UserAvailableEnum.ENABLE); |
|
|
userInfoService.update(userInfoUpdate); |
|
|
userInfoService.update(userInfoUpdate); |
|
|
|
|
|
|
|
@@ -421,10 +432,18 @@ 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()); |
|
|
} else { |
|
|
} else { |
|
|
expertUserFullInfo.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()); |
|
|
|
|
|
} |
|
|
|
|
|
iExpertUserFullInfoService.saveOrUpdate(expertInfo); |
|
|
|
|
|
if (PhoneUtil.isMobile(expertInfo.getPhoneNo())) { |
|
|
|
|
|
SendSmsContext smsCtx = new SendSmsContext(); |
|
|
|
|
|
smsCtx.setContent(smsContent); |
|
|
|
|
|
smsCtx.setReceiveNumber(expertInfo.getPhoneNo()); |
|
|
|
|
|
yxtCallOrSmsHelper.sendSms(smsCtx); |
|
|
} |
|
|
} |
|
|
iExpertUserFullInfoService.saveOrUpdate(expertUserFullInfo); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|