ezhizao_zx 5 сар өмнө
parent
commit
df5ac91be8

+ 9 - 1
src/main/java/cn/ezhizao/project/business/notification/controller/SysNotificationController.java

@@ -41,7 +41,7 @@ public class SysNotificationController extends BaseController
     /**
     /**
      * 查询发版通知公告列表
      * 查询发版通知公告列表
      */
      */
-    @PreAuthorize("@ss.hasPermi('business:notification:list')")
+//    @PreAuthorize("@ss.hasPermi('business:notification:list')")
     @GetMapping("/list")
     @GetMapping("/list")
     public TableDataInfo list(SysNotification sysNotification) throws NoSuchFieldException, IllegalAccessException
     public TableDataInfo list(SysNotification sysNotification) throws NoSuchFieldException, IllegalAccessException
     {
     {
@@ -109,4 +109,12 @@ public class SysNotificationController extends BaseController
     {
     {
         return toAjax(sysNotificationService.removeBatchByIds(ids));
         return toAjax(sysNotificationService.removeBatchByIds(ids));
     }
     }
+
+    @GetMapping("/getUnshowedNotification")
+    public AjaxResult getUnshowedNotification() {
+        // 获取未结束的公告
+        List<SysNotification> list = sysNotificationService.query().eq("status", 2).list();
+        // 假设有一个公告为更新中的公告,另一个公告为非更新中则可以接着查询。
+        return new AjaxResult(list.stream().anyMatch(t -> t.getStatus() == 2) ? 202 : 200, "", list);
+    }
 }
 }

+ 4 - 0
src/main/java/cn/ezhizao/project/business/notification/domain/SysNotification.java

@@ -2,6 +2,7 @@ package cn.ezhizao.project.business.notification.domain;
 
 
 import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
 import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
 import cn.ezhizao.framework.web.domain.BaseEntity;
 import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.Data;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
@@ -47,4 +48,7 @@ public class SysNotification extends BaseEntity
     @ApiModelProperty(value = "公告状态")
     @ApiModelProperty(value = "公告状态")
     private String updateId;
     private String updateId;
 
 
+    @TableField(exist = false)
+    private Long tenantId;
+
 }
 }