Browse Source

返回部门名

phoenix 1 năm trước cách đây
mục cha
commit
61dfddd67c

+ 15 - 6
src/main/java/com/xjrsoft/module/oa/controller/NewsController.java

@@ -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()

+ 5 - 0
src/main/java/com/xjrsoft/module/oa/vo/NewsVo.java

@@ -80,6 +80,11 @@ public class NewsVo {
      */
     @ApiModelProperty("发送部门")
     private Long sendDeptId;
+    /**
+     * 发送部门
+     */
+    @ApiModelProperty("发送部门")
+    private String sendDeptIdCN;
 
     /**
      * 张贴开起时间