Merge branch 'feature/REQ-1073' into 'pre'
Feature/req 1073 See merge request universal/infrastructure/backend/msg-center-plat!26
This commit is contained in:
commit
f640a140fb
@ -19,6 +19,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -41,6 +42,8 @@ public class PendingMessageBizConfig {
|
||||
|
||||
private Map<MsgTempBizCategoryEnum, String> categoryIcon;
|
||||
|
||||
private Map<MsgTempBizCategoryEnum, String> categoryJumpUrl;
|
||||
|
||||
public List<MsgTempBizCategoryConfig> tempCategoriesConfig() {
|
||||
return Arrays.stream(MsgTempBizCategoryEnum.values())
|
||||
.map(this::build)
|
||||
@ -48,10 +51,11 @@ public class PendingMessageBizConfig {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private MsgTempBizCategoryConfig build(MsgTempBizCategoryEnum categoryEnum) {
|
||||
return MsgTempBizCategoryConfig.build(categoryEnum, category.get(categoryEnum),
|
||||
categoryOrder.get(categoryEnum),
|
||||
categoryIcon.get(categoryEnum));
|
||||
private MsgTempBizCategoryConfig build(MsgTempBizCategoryEnum category) {
|
||||
return MsgTempBizCategoryConfig.build(category, this.category.get(category),
|
||||
categoryOrder.get(category),
|
||||
categoryIcon.get(category),
|
||||
categoryJumpUrl.get(category));
|
||||
}
|
||||
|
||||
@Setter
|
||||
@ -75,10 +79,16 @@ public class PendingMessageBizConfig {
|
||||
* 图标地址
|
||||
*/
|
||||
private String iconUrl;
|
||||
/**
|
||||
* 指定的跳转地址
|
||||
*/
|
||||
private String jumpUrl;
|
||||
|
||||
public static MsgTempBizCategoryConfig build(MsgTempBizCategoryEnum category, List<Long> configRelationIds,
|
||||
Integer sortOrder, String iconUrl) {
|
||||
return new MsgTempBizCategoryConfig(category, new HashSet<>(configRelationIds), sortOrder, iconUrl);
|
||||
Integer sortOrder, String iconUrl, String jumpUrl) {
|
||||
// 去掉首尾的无效空格
|
||||
jumpUrl = Optional.ofNullable(jumpUrl).map(String::trim).orElse(null);
|
||||
return new MsgTempBizCategoryConfig(category, new HashSet<>(configRelationIds), sortOrder, iconUrl, jumpUrl);
|
||||
}
|
||||
|
||||
public PendingMessageTemporarilyTypeRes toTemporarilyType() {
|
||||
|
||||
@ -123,7 +123,6 @@ public class PendingMessageServiceImpl implements PendingMessageService {
|
||||
// 这里对前端未传入参的情况做一个兜底
|
||||
Collection<MsgStateEnum> msgStates = CollectionUtils.isEmpty(request.getStates()) ? ALL_WITHOUT_UNSENT :
|
||||
request.getStates();
|
||||
// TODO: [cold_blade]
|
||||
String unCompleteStateCntKey = "unCompleteCnt";
|
||||
String completeStateCntKey = "completeCnt";
|
||||
List<StateStatisticModule> modules = Lists.newArrayList(
|
||||
@ -182,7 +181,10 @@ public class PendingMessageServiceImpl implements PendingMessageService {
|
||||
res.setCategoryCode(categoryConfig.getCategory().name());
|
||||
res.setCategoryDesc(categoryConfig.getCategory().getDesc());
|
||||
res.setIconUrl(categoryConfig.getIconUrl());
|
||||
if (1 == count) {
|
||||
if (StringUtils.isNotBlank(categoryConfig.getJumpUrl())) {
|
||||
// 分类指定了具体的跳转地址,则优先使用其指定的地址,这里指定为原生APP
|
||||
res.setRouter(new MessageRouterInfoRes(NativeTypeEnum.ANDROID.getMessage(), categoryConfig.getJumpUrl(), ""));
|
||||
} else if (1 == count) {
|
||||
// 这里仅统计已发送的待办
|
||||
MessageRecord record = selectOne(request.getPersonId(), request.getIdentifyId(), identifyTypes,
|
||||
relationIds, SEND_SUCCESSFULLY_STATES, begin);
|
||||
|
||||
@ -15,6 +15,7 @@ import cn.axzo.msg.center.domain.entity.MessageRouter;
|
||||
import cn.axzo.msg.center.domain.enums.MsgRouteTypeEnum;
|
||||
import cn.axzo.msg.center.domain.enums.NativeTypeEnum;
|
||||
import cn.axzo.msg.center.domain.enums.YesNoEnum;
|
||||
import cn.axzo.msg.center.inside.notices.config.MessageSystemConfig;
|
||||
import cn.axzo.msg.center.inside.notices.service.MessageModuleService;
|
||||
import cn.axzo.msg.center.inside.notices.service.MessageRouterService;
|
||||
import cn.axzo.msg.center.inside.notices.service.RawMessageRecordService;
|
||||
@ -48,18 +49,16 @@ import java.util.stream.Collectors;
|
||||
* @author cold_blade
|
||||
* @date 2023/9/13
|
||||
* @version 1.0
|
||||
* TODO: [cold_blade]待优化
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RawMessageRecordServiceImpl implements RawMessageRecordService {
|
||||
|
||||
private static final int HOT_DATA_SAVE_DAYS = 90;
|
||||
|
||||
private final MessageRecordDao messageRecordDao;
|
||||
private final MessageModuleService messageModuleService;
|
||||
private final MessageRouterService messageRouterService;
|
||||
private final MessageSystemConfig messageSystemConfig;
|
||||
|
||||
@Override
|
||||
public void updatePersonMessageState(Long personId, Collection<MsgStateEnum> srcStates, MsgStateEnum tgtState,
|
||||
@ -229,7 +228,10 @@ public class RawMessageRecordServiceImpl implements RawMessageRecordService {
|
||||
}
|
||||
|
||||
private LocalDateTime getQueryFromTime() {
|
||||
return LocalDate.now().minusDays(HOT_DATA_SAVE_DAYS).atStartOfDay();
|
||||
return Optional.ofNullable(messageSystemConfig.getDataDivideDays())
|
||||
.filter(e -> e > 0)
|
||||
.map(e -> LocalDate.now().minusDays(e).atStartOfDay())
|
||||
.orElseGet(() -> LocalDate.now().minusYears(10).atStartOfDay());
|
||||
}
|
||||
|
||||
private MessageDetailRes convert(MessageRecord msgRecord, MessageRouterDTO router, MsgModuleDTO module) {
|
||||
@ -240,6 +242,7 @@ public class RawMessageRecordServiceImpl implements RawMessageRecordService {
|
||||
if (Objects.nonNull(router)) {
|
||||
res.setRouteUrl(router.getUrl());
|
||||
res.setRouteType(router.getType());
|
||||
res.setRouterParam(msgRecord.getRouterParams());
|
||||
}
|
||||
res.setModuleName(module.getMsgModuleName());
|
||||
res.setModuleIcon(module.getMsgModuleIcon());
|
||||
|
||||
@ -81,6 +81,11 @@ public class MessageDetailRes implements Serializable {
|
||||
*/
|
||||
private Integer routeType;
|
||||
|
||||
/**
|
||||
* 路由参数
|
||||
*/
|
||||
private String routerParam;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user