Bläddra i källkod

预警通知修改

tags/24080901
WendyYang 7 månader sedan
förälder
incheckning
52a00b8243
4 ändrade filer med 57 tillägg och 57 borttagningar
  1. +34
    -40
      hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertInfoServiceImpl.java
  2. +6
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingCallOrMsgHelper.java
  3. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/YxtClientHelper.java
  4. +16
    -10
      hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/EarlyWarningManage.java

+ 34
- 40
hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertInfoServiceImpl.java Visa fil

@@ -24,7 +24,7 @@ import com.hz.pm.api.expert.model.cmd.*;
import com.hz.pm.api.expert.model.dto.*;
import com.hz.pm.api.expert.service.*;
import com.hz.pm.api.expert.utils.SensitiveModifySegmentUtils;
import com.hz.pm.api.meeting.helper.YxtCallOrSmsHelper;
import com.hz.pm.api.meeting.helper.YxtClientHelper;
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum;
import com.hz.pm.api.meta.model.ExpertRegionInfo;
import com.hz.pm.api.meta.model.entity.ExpertDictionary;
@@ -78,7 +78,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
private final IUserRoleService userRoleService;
private final IExpertSensitiveInfoModifyDetailRecordService iExpertSensitiveInfoModifyDetailRecordService;
private final IUserInfoService userInfoService;
private final YxtCallOrSmsHelper yxtCallOrSmsHelper;
private final YxtClientHelper yxtClientHelper;
private final IExpertGovBusinessStripService expertGovBusinessStripService;

@Value("${login.url:}")
@@ -101,7 +101,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {

ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId);

ExpertUserFullInfo saveExpertUserFullInfo = buildSaveExpertUserFullInfo(expertUserInfoDTO);
ExpertUserFullInfo saveExpertUserFullInfo = buildExpertUserFullInfo(expertUserInfoDTO);
if (Objects.nonNull(expertUserFullInfo)) {
// 专家信息审核通过之前,所有信息无需备份
iExpertUserFullInfoService.removeById(expertUserFullInfo.getId());
@@ -129,7 +129,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
iExpertTagService.saveBatch(saveExpertTagList);
}
// 保存所有专家字典字段
List<ExpertDictionary> saveExpertDictionaryList = buildSaveExpertDictionaryList(userId, expertDictionaryList);
List<ExpertDictionary> saveExpertDictionaryList = buildExpertDicts(userId, expertDictionaryList);
if (CollectionUtils.isNotEmpty(saveExpertDictionaryList)) {
iExpertDictionaryService.saveBatch(saveExpertDictionaryList);
}
@@ -141,14 +141,14 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
iExpertMetaApplyService.saveBatch(saveExpertIntentionWorkRegionApplyList);
}
// 保存所有专家回避单位
List<ExpertAvoidCompany> saveExpertAvoidCompanyList = buildSaveExpertAvoidCompanyList(userId, expertAvoidCompanyList);
List<ExpertAvoidCompany> saveExpertAvoidCompanyList = buildExpertAvoidCompany(userId, expertAvoidCompanyList);
if (CollectionUtils.isNotEmpty(saveExpertAvoidCompanyList)) {
iExpertAvoidCompanyService.saveBatch(saveExpertAvoidCompanyList);
}
}


private ExpertUserFullInfo buildSaveExpertUserFullInfo(ExpertUserFullInfoDTO expertUserInfoDTO) {
private ExpertUserFullInfo buildExpertUserFullInfo(ExpertUserFullInfoDTO expertUserInfoDTO) {
ExpertUserFullInfo expertUserFullInfo = new ExpertUserFullInfo();
if (Objects.nonNull(expertUserInfoDTO.getIsDingUser())) {
expertUserFullInfo.setIsDingUser(expertUserInfoDTO.getIsDingUser());
@@ -197,33 +197,35 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
}).collect(Collectors.toList());
}

private List<ExpertDictionary> buildSaveExpertDictionaryList(Long userId, List<ExpertDictionaryDTO> expertDictionaryList) {
if (CollectionUtils.isEmpty(expertDictionaryList)) {
return new ArrayList<>();
}
return expertDictionaryList.stream().map(r -> {
ExpertDictionary expertDictionary = new ExpertDictionary();
expertDictionary.setUserId(userId);
expertDictionary.setExpertInfoField(r.getExpertInfoField());
expertDictionary.setDictionaryCode(r.getDictionaryCode());
expertDictionary.setUpdateOn(LocalDateTime.now());
expertDictionary.setCreateOn(LocalDateTime.now());
return expertDictionary;
private List<ExpertDictionary> buildExpertDicts(Long userId, List<ExpertDictionaryDTO> exertDicts) {
if (CollectionUtils.isEmpty(exertDicts)) {
return Collections.emptyList();
}
LocalDateTime now = LocalDateTime.now();
return exertDicts.stream().map(r -> {
ExpertDictionary expertDict = new ExpertDictionary();
expertDict.setUserId(userId);
expertDict.setExpertInfoField(r.getExpertInfoField());
expertDict.setDictionaryCode(r.getDictionaryCode());
expertDict.setUpdateOn(now);
expertDict.setCreateOn(now);
return expertDict;
}).collect(Collectors.toList());
}


private List<ExpertAvoidCompany> buildSaveExpertAvoidCompanyList(Long userId, List<ExpertAvoidCompanyDTO> expertAvoidCompanyList) {
if (CollectionUtils.isEmpty(expertAvoidCompanyList)) {
return new ArrayList<>();
private List<ExpertAvoidCompany> buildExpertAvoidCompany(Long userId, List<ExpertAvoidCompanyDTO> avoidCompanies) {
if (CollectionUtils.isEmpty(avoidCompanies)) {
return Collections.emptyList();
}
return expertAvoidCompanyList.stream().map(r -> {
LocalDateTime now = LocalDateTime.now();
return avoidCompanies.stream().map(r -> {
ExpertAvoidCompany expertAvoidCompany = new ExpertAvoidCompany();
expertAvoidCompany.setCompanyName(r.getCompanyName());
expertAvoidCompany.setUserId(userId);
expertAvoidCompany.setCompanyUniqCode(r.getCompanyUniqCode());
expertAvoidCompany.setCreateOn(LocalDateTime.now());
expertAvoidCompany.setUpdateOn(LocalDateTime.now());
expertAvoidCompany.setCreateOn(now);
expertAvoidCompany.setUpdateOn(now);
return expertAvoidCompany;
}).collect(Collectors.toList());
}
@@ -239,15 +241,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {

List<ExpertDictionaryDTO> recommendedWayList = cmd.getRecommendedWay();
if (CollectionUtils.isNotEmpty(recommendedWayList)) {
List<ExpertDictionary> saveExpertDictionaryList = recommendedWayList.stream().map(r -> {
ExpertDictionary expertDictionary = new ExpertDictionary();
expertDictionary.setUserId(userId);
expertDictionary.setExpertInfoField(r.getExpertInfoField());
expertDictionary.setDictionaryCode(r.getDictionaryCode());
expertDictionary.setUpdateOn(LocalDateTime.now());
expertDictionary.setCreateOn(LocalDateTime.now());
return expertDictionary;
}).collect(Collectors.toList());
List<ExpertDictionary> saveExpertDictionaryList = buildExpertDicts(userId, recommendedWayList);
iExpertDictionaryService.saveBatch(saveExpertDictionaryList);
}

@@ -325,7 +319,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
Integer expertRegionLevel = cmd.getExpertRegionLevel();
Long expertUserId = cmd.getExpertUserId();

if (applyResult) {
if (Boolean.TRUE.equals(applyResult)) {
switch (applyTypeEnum) {
case EXPERT_INTENTION_JOIN: {
// 新增履职意向地
@@ -372,7 +366,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
ExpertUserFullInfo expertInfo = iExpertUserFullInfoService.getByUserId(expertUserId);
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail();
String content;
if (cmd.getApplyResult()) {
if (Boolean.TRUE.equals(cmd.getApplyResult())) {
// 修改专家状态为可用
// 账号启用
LambdaUpdateWrapper<UserInfo> userInfoUpdate = Wrappers.lambdaUpdate(UserInfo.class)
@@ -387,7 +381,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
List<ExpertDictionaryDTO> expertType = cmd.getExpertType();
if (CollUtil.isNotEmpty(expertType)) {
expertType.forEach(r -> r.setExpertInfoField(ExpertDictTypeEnum.EXPERT_TYPE.getKey()));
List<ExpertDictionary> saveExpertDictList = buildSaveExpertDictionaryList(expertUserId, expertType);
List<ExpertDictionary> saveExpertDictList = buildExpertDicts(expertUserId, expertType);
iExpertDictionaryService.saveBatch(saveExpertDictList);
}
// 补充专家 专家角色
@@ -410,7 +404,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
SendSmsContext smsCtx = new SendSmsContext();
smsCtx.setContent(content);
smsCtx.setReceiveNumber(expertInfo.getPhoneNo());
yxtCallOrSmsHelper.sendSms(smsCtx);
yxtClientHelper.sendSms(smsCtx);
}
}

@@ -464,7 +458,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
List<Long> applyIdList = new ArrayList<>();

ExpertUserFullInfo originalExpertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId);
ExpertUserFullInfo saveExpertUserFullInfo = buildSaveExpertUserFullInfo(expertUserInfoDTO);
ExpertUserFullInfo saveExpertUserFullInfo = buildExpertUserFullInfo(expertUserInfoDTO);
if (Objects.nonNull(originalExpertUserFullInfo)) {
saveExpertUserFullInfo.setId(originalExpertUserFullInfo.getId());
// 删除所有专家字典字段(需审核敏感字段不删除)
@@ -497,7 +491,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
iExpertUserFullInfoService.saveOrUpdate(saveExpertUserFullInfo);

// 保存所有专家字典字段
List<ExpertDictionary> saveExpertDictionaryList = buildSaveExpertDictionaryList(userId, expertDictionaryList);
List<ExpertDictionary> saveExpertDictionaryList = buildExpertDicts(userId, expertDictionaryList);
saveExpertDictionaryList = saveExpertDictionaryList
.stream().filter(r -> !ExpertUserInfoSensitiveFieldEnum.getSensitiveDictionaryList().contains(r.getExpertInfoField()))
.collect(Collectors.toList());
@@ -506,7 +500,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
}

// 保存所有专家回避单位
List<ExpertAvoidCompany> saveExpertAvoidCompanyList = buildSaveExpertAvoidCompanyList(userId, expertAvoidCompanyList);
List<ExpertAvoidCompany> saveExpertAvoidCompanyList = buildExpertAvoidCompany(userId, expertAvoidCompanyList);
if (CollectionUtils.isNotEmpty(saveExpertAvoidCompanyList)) {
// 删除回避单位
LambdaQueryWrapper<ExpertAvoidCompany> expertAvoidCompanyRemove = Wrappers.lambdaQuery(ExpertAvoidCompany.class)


+ 6
- 6
hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingCallOrMsgHelper.java Visa fil

@@ -48,7 +48,7 @@ import java.util.stream.Collectors;
public class MeetingCallOrMsgHelper {

private final IUserInfoService userInfoService;
private final YxtCallOrSmsHelper yxtCallOrSmsHelper;
private final YxtClientHelper yxtClientHelper;
private final INdWorkNoticeStagingService workNoticeStagingService;
private final IDingEmployeeInfoService dingEmployeeInfoService;
private final IDingOrganizationService dingOrganizationService;
@@ -102,7 +102,7 @@ public class MeetingCallOrMsgHelper {
SendSmsContext yxtContent = new SendSmsContext();
yxtContent.setContent(msgContent);
yxtContent.setReceiveNumber(info.getMobile());
yxtCallOrSmsHelper.sendSms(yxtContent);
yxtClientHelper.sendSms(yxtContent);
// 发送工作通知
if (info.getAccountId() != null) {
WorkNoticeInfo swn = getSendWorkNoticeInfo(info.getAccountId());
@@ -148,7 +148,7 @@ public class MeetingCallOrMsgHelper {
}
});
notifyService.saveBatch(notifies);
yxtCallOrSmsHelper.sendSms(yxtContents);
yxtClientHelper.sendSms(yxtContents);
workNoticeStagingService.addByWorkNotice(workingNotices, MsgTypeEnum.EXPERT_REVIEW);
}

@@ -164,7 +164,7 @@ public class MeetingCallOrMsgHelper {
context.setContent(content);
return context;
}).collect(Collectors.toList());
yxtCallOrSmsHelper.sendSms(contexts);
yxtClientHelper.sendSms(contexts);
}

/**
@@ -184,7 +184,7 @@ public class MeetingCallOrMsgHelper {
context.setReceiveNumber(w.getMobile());
return context;
});
String submitKey = yxtCallOrSmsHelper.submitCallTask(callContexts);
String submitKey = yxtClientHelper.submitCallTask(callContexts);
experts.forEach(w -> w.setSubmitKey(submitKey));
}

@@ -200,7 +200,7 @@ public class MeetingCallOrMsgHelper {
SendSmsContext yxtContent = new SendSmsContext();
yxtContent.setContent(msgContent);
yxtContent.setReceiveNumber(info.getMobile());
yxtCallOrSmsHelper.sendSms(yxtContent);
yxtClientHelper.sendSms(yxtContent);
// 发送工作通知
if (info.getAccountId() != null) {
WorkNoticeInfo swn = getSendWorkNoticeInfo(info.getAccountId());


hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/YxtCallOrSmsHelper.java → hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/YxtClientHelper.java Visa fil

@@ -24,7 +24,7 @@ import static com.ningdatech.yxt.model.cmd.SubmitTaskCallCmd.of;
*/
@Component
@AllArgsConstructor
public class YxtCallOrSmsHelper {
public class YxtClientHelper {

private final YxtClient yxtClient;


+ 16
- 10
hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/EarlyWarningManage.java Visa fil

@@ -2,7 +2,7 @@ package com.hz.pm.api.sys.manage;

import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.common.helper.UserInfoHelper;
import com.hz.pm.api.meeting.helper.YxtCallOrSmsHelper;
import com.hz.pm.api.meeting.helper.YxtClientHelper;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum;
import com.hz.pm.api.projectlib.model.enumeration.WarningFlowTypeEnum;
@@ -20,6 +20,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.Objects;
@@ -41,7 +42,7 @@ public class EarlyWarningManage {

private final IEarlyWarningRecordsService earlyWarningRecordsService;

private final YxtCallOrSmsHelper yxtCallOrSmsHelper;
private final YxtClientHelper yxtClientHelper;

private final INotifyService notifyService;

@@ -152,30 +153,32 @@ public class EarlyWarningManage {
SendSmsContext context = new SendSmsContext();
context.setReceiveNumber(user.getMobile());
context.setContent(content);
yxtCallOrSmsHelper.sendSms(context);
yxtClientHelper.sendSms(context);
}
}

/**
* 催办
*
* @param noticeMethod
* @param noticeContent
* @param adventTimeout
* @param userId
* @param project
* @param noticeMethod \
* @param noticeContent \
* @param adventTimeout \
* @param userId \
* @param project \
*/
@Transactional(rollbackFor = Exception.class)
public void urging(String noticeMethod, String noticeContent, Integer adventTimeout, Integer overTimeout,
Integer biz, LocalDateTime startTime, Long userId,
Project project, Integer ruleType, Integer noticeType,
String path, String batchEmployees, String nodeId) {
//1.存入 预警记录
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(userId);
WflowEarlyWarningRecords records = new WflowEarlyWarningRecords();
WflowEarlyWarningRecords records;
String content;

switch (WarningRuleTypeEnum.checkByCode(ruleType)) {
case PROCESS_WARNING:
records = new WflowEarlyWarningRecords();
if (Objects.isNull(noticeType)) {
content = convertContent(noticeContent, project.getProjectName(),
InstTypeEnum.getByCode(biz), overTimeout);
@@ -189,6 +192,7 @@ public class EarlyWarningManage {
records.setRuleType(WarningRuleTypeEnum.PROCESS_WARNING.getCode());
break;
case DECLARED_WARNING:
records = new WflowEarlyWarningRecords();
if (Objects.isNull(noticeType)) {
content = convertContent(noticeContent, project.getProjectName(),
WarningFlowTypeEnum.getByCode(biz), overTimeout);
@@ -202,6 +206,7 @@ public class EarlyWarningManage {
records.setRuleType(WarningRuleTypeEnum.DECLARED_WARNING.getCode());
break;
case OPERATION_WARNING:
records = new WflowEarlyWarningRecords();
if (Objects.isNull(noticeType)) {
content = convertContent(noticeContent, project.getProjectName(),
WarningOperationTypeEnum.getByCode(biz), overTimeout);
@@ -215,6 +220,7 @@ public class EarlyWarningManage {
records.setRuleType(WarningRuleTypeEnum.OPERATION_WARNING.getCode());
break;
case RENEWAL_FUND:
records = new WflowEarlyWarningRecords();
if (Objects.isNull(noticeType)) {
content = convertContent(noticeContent, project.getProjectName(), overTimeout);
} else if (noticeType.equals(WarningNoticeTypeEnum.ADVENT.getCode())) {
@@ -262,7 +268,7 @@ public class EarlyWarningManage {
SendSmsContext context = new SendSmsContext();
context.setReceiveNumber(user.getMobile());
context.setContent(content);
yxtCallOrSmsHelper.sendSms(context);
yxtClientHelper.sendSms(context);
}
}



Laddar…
Avbryt
Spara