|
|
@@ -436,16 +436,24 @@ public class NewsController {
|
|
|
newsCountTypeVo.setTitle(news.getFullHead());
|
|
|
}
|
|
|
if(typeId == 4){
|
|
|
- long count = systemUpdateMessageService.count(
|
|
|
+ List<SystemUpdateMessage> list = systemUpdateMessageService.list(
|
|
|
MPJWrappers.<SystemUpdateMessage>lambdaJoin()
|
|
|
+ .distinct()
|
|
|
.leftJoin(SystemUpdateMessageNotice.class, SystemUpdateMessageNotice::getSystemUpdateMessageId, SystemUpdateMessage::getId)
|
|
|
.eq(SystemUpdateMessageNotice::getUserId, StpUtil.getLoginIdAsLong())
|
|
|
.eq(SystemUpdateMessage::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
.eq(SystemUpdateMessage::getStatus, 1)
|
|
|
.eq(SystemUpdateMessageNotice::getStatus, 0)
|
|
|
+ .orderByDesc(SystemUpdateMessage::getReleaseDate)
|
|
|
);
|
|
|
- newsCountTypeVo.setTypeId(typeId);
|
|
|
- newsCountTypeVo.setTotal(count);
|
|
|
+ if(list.isEmpty()){
|
|
|
+ newsCountTypeVo.setTypeId(typeId);
|
|
|
+ newsCountTypeVo.setTotal(list.stream().count());
|
|
|
+ SystemUpdateMessage message = list.get(0);
|
|
|
+ newsCountTypeVo.setTitle(message.getTitle());
|
|
|
+ newsCountTypeVo.setTime(message.getReleaseDate());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
newsCountTypeVoList.add(newsCountTypeVo);
|
|
|
}
|