@@ -17,9 +17,9 @@ import java.time.LocalDateTime; | |||
* @author Liuxinxin | |||
* @since 2023-03-01 | |||
*/ | |||
@TableName("expert_meta_apply") | |||
@ApiModel(value = "ExpertMetaApply对象", description = "") | |||
@Data | |||
@TableName("expert_meta_apply") | |||
@ApiModel(value = "ExpertMetaApply对象") | |||
public class ExpertMetaApply implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@@ -74,7 +74,6 @@ public class ExpertMetaApplyManage { | |||
private final IExpertDictionaryService iExpertDictionaryService; | |||
public PageVo<ExpertApplyMetaVO> metaApplyListQuery(MetaApplyListQuery req) { | |||
Long expertAdminUserId = LoginUserUtil.getUserId(); | |||
// 筛选符合专家类型的用户id | |||
List<Long> filterExpertTypeUserIdList = null; | |||
DictionaryFieldInfo expertType = req.getExpertType(); | |||
@@ -129,7 +128,6 @@ public class ExpertMetaApplyManage { | |||
Long applyId = req.getApplyId(); | |||
ExpertMetaApply expertMetaApply = iMetaApplyService.getById(applyId); | |||
Long userId = LoginUserUtil.getUserId(); | |||
// 校验专家管理员区域权限,是否可以审核当前专家申请 | |||
// permissionCheckHelper.operationPermissionsCheck(userId, expertMetaApply.getUserId()); | |||
String applyStatus = expertMetaApply.getApplyStatus(); | |||
@@ -186,7 +184,6 @@ public class ExpertMetaApplyManage { | |||
break; | |||
} | |||
Long expertUserId = expertMetaApply.getUserId(); | |||
String auditOpinion = req.getAuditOpinion(); | |||
// 发送审核结果短信 | |||
// sendApplyResultNotify(applyType, applyResult, auditOpinion, expertUserId); | |||
@@ -276,13 +273,11 @@ public class ExpertMetaApplyManage { | |||
private void buildIntentionApplyDisplayVO(MetaApplyResultVo metaApplyResultVo, ExpertMetaApply metaApply, ExpertApplyTypeEnum applyTypeEnum) { | |||
String regionCode = metaApply.getRegionCode(); | |||
Integer regionLevel = metaApply.getRegionLevel(); | |||
// String unionPathStr = regionCache.getUnionPathStr(regionCode, regionLevel); | |||
MetaApplyResultVo.IntentionApplyDisplayVO intentionApplyDisplayVO = new MetaApplyResultVo.IntentionApplyDisplayVO(); | |||
intentionApplyDisplayVO.setExpertApplyId(metaApply.getId()); | |||
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); | |||
expertRegionInfo.setRegionCode(regionCode); | |||
expertRegionInfo.setRegionLevel(regionLevel); | |||
// expertRegionInfo.setRegionName(unionPathStr); | |||
switch (applyTypeEnum) { | |||
case EXPERT_INTENTION_LEAVE: { | |||
intentionApplyDisplayVO.setReduceExpertRegion(expertRegionInfo); | |||
@@ -298,30 +293,6 @@ public class ExpertMetaApplyManage { | |||
metaApplyResultVo.setIntentionApplyDisplayVo(intentionApplyDisplayVO); | |||
} | |||
// private void buildInfoModifyApplyDisplayVO(MetaApplyResultVo metaApplyResultVo, ExpertMetaApply infoModifyApply) { | |||
// InfoModifyApplyDisplayVO infoModifyApplyDisplayVo = new InfoModifyApplyDisplayVO(); | |||
// if (Objects.nonNull(infoModifyApply)) { | |||
// Long metaApplyId = infoModifyApply.getId(); | |||
// LambdaQueryWrapper<ExpertSensitiveInfoModifyDetailRecord> eq = Wrappers.lambdaQuery(ExpertSensitiveInfoModifyDetailRecord.class) | |||
// .eq(ExpertSensitiveInfoModifyDetailRecord::getMetaApplyId, metaApplyId); | |||
// ExpertSensitiveInfoModifyDetailRecord one = iExpertSensitiveInfoModifyDetailRecordService.getOne(eq); | |||
// String originalJson = null; | |||
// if (StringUtils.isNotBlank(one.getOriginalJson())) { | |||
// originalJson = GzipUtils.uncompress(one.getOriginalJson()); | |||
// } | |||
// List<SensitiveModifySegment> sensitiveModifySegments = JSONUtils.parseArray(originalJson, SensitiveModifySegment.class); | |||
// | |||
// infoModifyApplyDisplayVo.setExpertApplyId(metaApplyId); | |||
// List<InfoModifyApplyDisplayVO.InfoModifyApplyDisplayValue> displayValueList = new ArrayList<>(); | |||
// for (SensitiveModifySegment segment : sensitiveModifySegments) { | |||
// InfoModifyApplyDisplayVO.InfoModifyApplyDisplayValue displayValue = sensitiveModifySegmentParser.getDisplayValue(segment); | |||
// displayValueList.add(displayValue); | |||
// } | |||
// infoModifyApplyDisplayVo.setInfoModifyApplyDisplayValueList(displayValueList); | |||
// metaApplyResultVo.setInfoModifyApplyDisplayVo(infoModifyApplyDisplayVo); | |||
// } | |||
// } | |||
private String applyTypeTrans(ExpertApplyTypeEnum applyTypeEnum) { | |||
switch (applyTypeEnum) { | |||
case EXPERT_INTENTION_JOIN: | |||
@@ -1,6 +1,7 @@ | |||
package com.ningdatech.pmapi.expert.service.impl; | |||
import cn.hutool.core.collection.CollUtil; | |||
import cn.hutool.core.util.PhoneUtil; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
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.bo.ExpertInfoSensitiveFieldCheckBO; | |||
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.service.*; | |||
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.ExpertTagEnum; | |||
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.service.IRoleService; | |||
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.entity.UserInfo; | |||
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.util.LoginUserUtil; | |||
import com.ningdatech.yxt.utils.JSONUtils; | |||
import lombok.RequiredArgsConstructor; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
@@ -51,6 +55,8 @@ import java.util.*; | |||
import java.util.function.Function; | |||
import java.util.stream.Collectors; | |||
import static com.ningdatech.yxt.model.cmd.SendSmsCmd.SendSmsContext; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/22 下午4:39 | |||
@@ -69,7 +75,10 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||
private final IUserRoleService userRoleService; | |||
private final IExpertSensitiveInfoModifyDetailRecordService iExpertSensitiveInfoModifyDetailRecordService; | |||
private final IUserInfoService userInfoService; | |||
private final YxtCallOrSmsHelper yxtCallOrSmsHelper; | |||
@Value("${login.url:}") | |||
private String loginUrl; | |||
/** | |||
* 用户第一次申请修改,仅在专家用户状态为applying 状态时调用 | |||
@@ -387,16 +396,18 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||
@Transactional(rollbackFor = Exception.class) | |||
public void expertStorageDeal(ExpertStorageDealCmd cmd) { | |||
Long expertUserId = cmd.getExpertUserId(); | |||
ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(expertUserId); | |||
ExpertUserFullInfo expertInfo = iExpertUserFullInfoService.getByUserId(expertUserId); | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
String smsContent; | |||
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) | |||
.eq(UserInfo::getId,expertUserId) | |||
.eq(UserInfo::getId, expertUserId) | |||
.set(UserInfo::getAvailable, UserAvailableEnum.ENABLE); | |||
userInfoService.update(userInfoUpdate); | |||
@@ -421,10 +432,18 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||
userRoleService.save(saveUserRole); | |||
} | |||
} | |||
smsContent = String.format(ExpertAuditMsgTemplate.EXPERT_AUDIT_PASS_MSG, expertInfo.getExpertName(), userDetail.getRealName(), userDetail.getMobile()); | |||
} 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); | |||
} | |||
@@ -32,6 +32,7 @@ public class UserInfoConvertor { | |||
userInfoDetails.setOrganizationName(userFullInfo.getOrganizationName()); | |||
userInfoDetails.setEmpPosUnitCode(userFullInfo.getEmpPosUnitCode()); | |||
userInfoDetails.setEmpPosUnitName(userFullInfo.getEmpPosUnitName()); | |||
userInfoDetails.setMobile(userFullInfo.getMobile()); | |||
return userInfoDetails; | |||
} | |||
@@ -73,6 +73,9 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails { | |||
private String empPosUnitName; | |||
private String mobile; | |||
/** | |||
* 获取用户权限 | |||
* | |||
@@ -253,5 +253,6 @@ hostname: iZbp13nwyvib53j4j1p2xoZ | |||
login: | |||
phone-verify-code: | |||
skip: true | |||
url: http://lspm.ningdatech.com/login | |||
@@ -255,3 +255,4 @@ hostname: iZ6mx01asxnsmennpzoxooZ | |||
login: | |||
phone-verify-code: | |||
skip: true | |||
url: http://60.188.225.145:8080/login |
@@ -255,3 +255,4 @@ hostname: iZ6mx01gyeodd80imxd2gbZ | |||
login: | |||
phone-verify-code: | |||
skip: true | |||
url: http://60.188.225.145/login |