浏览代码

新闻调整

dzx 1 年之前
父节点
当前提交
0cc3626b2a

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

@@ -501,4 +501,10 @@ public class NewsController {
         Long notReadCount = notReadCountNews + notReadCountProclamationToAll + notReadCountProclamation + systemUpdateMessageCount;
         return RT.ok(notReadCount);
     }
+
+    @GetMapping("/all-read")
+    @ApiOperation(value = "全部已读")
+    public RT<Boolean> allRead() {
+        return RT.ok(newsService.allRead(StpUtil.getLoginIdAsLong()));
+    }
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/oa/dto/NewsPageDto.java

@@ -39,4 +39,7 @@ public class NewsPageDto extends PageInput {
     @ApiModelProperty(value = "当前用户id", hidden = true)
     private Long loginId;
 
+    @ApiModelProperty("是否已读(2:是 0:否)")
+    private Integer readMark;
+
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/oa/mapper/NewsMapper.java

@@ -8,6 +8,7 @@ import com.xjrsoft.module.oa.vo.DeptIdOrClassIdVo;
 import com.xjrsoft.module.oa.vo.NewsPageVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Update;
 
 import java.util.List;
 
@@ -26,4 +27,8 @@ public interface NewsMapper extends MPJBaseMapper<News> {
     IPage<NewsPageVo> receiptBox(IPage<NewsPageDto> page,NewsPageDto dto);
 
     List<DeptIdOrClassIdVo> getDeptIdOrClassId(@Param("personalIdList") List<Long> personalIdList);
+
+
+    @Update("UPDATE xjr_oa_news_relation SET read_mark = 1 WHERE user_id = #{userId}")
+    void allRead(Long userId);
 }

+ 2 - 0
src/main/java/com/xjrsoft/module/oa/service/INewsService.java

@@ -139,4 +139,6 @@ public interface INewsService extends MPJBaseService<News> {
     boolean SendMessage(Long id);
 
     boolean dataHandle(Long id);
+
+    boolean allRead(Long userId);
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/oa/service/impl/NewsServiceImpl.java

@@ -927,4 +927,10 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
         });
         return true;
     }
+
+    @Override
+    public boolean allRead(Long userId) {
+        newsMapper.allRead(userId);
+        return true;
+    }
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/oa/vo/NewsPageVo.java

@@ -185,6 +185,6 @@ public class NewsPageVo {
     @ApiModelProperty("封面")
     private Long cover;
 
-    @ApiModelProperty("是否已读(1:是 0:否)")
+    @ApiModelProperty("是否已读(2:是 0:否)")
     private Integer readMark;
 }

+ 3 - 0
src/main/resources/mapper/oa/NewsMapper.xml

@@ -46,6 +46,9 @@
           and t.status = 2
         <if test="dto.type != null and dto.type == 2 and dto.loginId != null">
             and (t.send_range = 1 or t.id in (select news_id from xjr_oa_news_relation t1 where user_id = #{dto.loginId}))
+            <if test="dto.readMark != null">
+                and t3.read_mark =  #{dto.loginId}
+            </if>
         </if>
         <if test="dto.type != null and dto.type == 1">
             and t.wf_status = 1