|
|
@@ -23,6 +23,8 @@ import com.xjrsoft.module.oa.service.INewsRelationConfigService;
|
|
|
import com.xjrsoft.module.oa.service.INewsRelationService;
|
|
|
import com.xjrsoft.module.oa.service.INewsService;
|
|
|
import com.xjrsoft.module.oa.vo.*;
|
|
|
+import com.xjrsoft.module.organization.entity.Department;
|
|
|
+import com.xjrsoft.module.organization.mapper.DepartmentMapper;
|
|
|
import com.xjrsoft.module.system.entity.File;
|
|
|
import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
import io.swagger.annotations.Api;
|
|
|
@@ -50,6 +52,8 @@ public class NewsController {
|
|
|
|
|
|
private INewsRelationService newsRelationService;
|
|
|
private INewsAppendixService newsAppendixService;
|
|
|
+
|
|
|
+ private DepartmentMapper departmentMapper;
|
|
|
private INewsRelationConfigService newsRelationConfigService;
|
|
|
|
|
|
@GetMapping
|
|
|
@@ -118,6 +122,11 @@ public class NewsController {
|
|
|
NewsVo newsVo = BeanUtil.toBean(news, NewsVo.class);
|
|
|
newsVo.setRelationList(newsRelationVoList);
|
|
|
|
|
|
+ Department department = departmentMapper.selectById(newsVo.getSendDeptId());
|
|
|
+ if(department != null){
|
|
|
+ newsVo.setSendDeptIdCN(department.getName());
|
|
|
+ }
|
|
|
+
|
|
|
if (BooleanUtils.isTrue(isRead)) {
|
|
|
// NewsRelation newsRelation = new NewsRelation();
|
|
|
// newsRelation.setNewsId(id);
|
|
|
@@ -316,8 +325,8 @@ public class NewsController {
|
|
|
if(typeId == 1){
|
|
|
Long notReadCount = newsService.count(Wrappers.<News>query().lambda()
|
|
|
.eq(News::getTypeId, typeId)
|
|
|
+ .eq(News::getStatus, 2)
|
|
|
.gt(News::getSendEndDate, LocalDateTime.now())
|
|
|
- .eq(News::getDeleteMark, 0)
|
|
|
.eq(News::getWfStatus, 1)
|
|
|
.notIn(News::getId, "select distinct news_id from xjr_oa_news_relation where user_id = " + StpUtil.getLoginIdAsLong()));
|
|
|
|
|
|
@@ -326,8 +335,8 @@ public class NewsController {
|
|
|
|
|
|
news = newsService.getOne(Wrappers.<News>query().lambda()
|
|
|
.eq(News::getTypeId, typeId)
|
|
|
+ .eq(News::getStatus, 2)
|
|
|
.gt(News::getSendEndDate, LocalDateTime.now())
|
|
|
- .eq(News::getDeleteMark, 0)
|
|
|
.eq(News::getWfStatus, 1)
|
|
|
.notIn(News::getId, "select distinct news_id from xjr_oa_news_relation where user_id = " + StpUtil.getLoginIdAsLong())
|
|
|
.orderByDesc(News::getReleaseTime)
|
|
|
@@ -338,7 +347,7 @@ public class NewsController {
|
|
|
if(typeId == 2){
|
|
|
Long notReadCount = newsService.count(Wrappers.<News>query().lambda()
|
|
|
.eq(News::getTypeId, typeId)
|
|
|
- .eq(News::getDeleteMark, 0)
|
|
|
+ .eq(News::getStatus, 2)
|
|
|
.notIn(News::getId, "select distinct news_id from xjr_oa_news_relation where read_mark = 1 and user_id = " + StpUtil.getLoginIdAsLong())
|
|
|
.and(wp -> wp.gt(News::getSendEndDate, LocalDateTime.now())
|
|
|
.or()
|
|
|
@@ -346,7 +355,7 @@ public class NewsController {
|
|
|
|
|
|
news = newsService.getOne(Wrappers.<News>query().lambda()
|
|
|
.eq(News::getTypeId, typeId)
|
|
|
- .eq(News::getDeleteMark, 0)
|
|
|
+ .eq(News::getStatus, 2)
|
|
|
.notIn(News::getId, "select distinct news_id from xjr_oa_news_relation where read_mark = 1 and user_id = " + StpUtil.getLoginIdAsLong())
|
|
|
.and(wp -> wp.gt(News::getSendEndDate, LocalDateTime.now())
|
|
|
.or()
|
|
|
@@ -377,14 +386,14 @@ public class NewsController {
|
|
|
public RT<Long> unreadCount() {
|
|
|
Long notReadCountNews = newsService.count(Wrappers.<News>query().lambda()
|
|
|
.eq(News::getTypeId, 1)
|
|
|
+ .eq(News::getStatus, 2)
|
|
|
.gt(News::getSendEndDate, LocalDateTime.now())
|
|
|
- .eq(News::getDeleteMark, 0)
|
|
|
.eq(News::getWfStatus, 1)
|
|
|
.notIn(News::getId, "select distinct news_id from xjr_oa_news_relation where user_id = " + StpUtil.getLoginIdAsLong()));
|
|
|
|
|
|
Long notReadCountProclamation = newsService.count(Wrappers.<News>query().lambda()
|
|
|
.eq(News::getTypeId, 2)
|
|
|
- .eq(News::getDeleteMark, 0)
|
|
|
+ .eq(News::getStatus, 2)
|
|
|
.notIn(News::getId, "select distinct news_id from xjr_oa_news_relation where read_mark = 1 and user_id = " + StpUtil.getLoginIdAsLong())
|
|
|
.and(wp -> wp.gt(News::getSendEndDate, LocalDateTime.now())
|
|
|
.or()
|