|
@@ -61,21 +61,22 @@ public class TNoticeController {
|
|
|
}
|
|
|
TAdmin admin = tAdminService.getById(adminId);
|
|
|
LambdaQueryWrapper<TNotice> query = Wrappers.lambdaQuery();
|
|
|
- query.eq(TNotice::getStatus,0);
|
|
|
+ query.eq(TNotice::getStatus,"0");
|
|
|
query.orderByDesc(TNotice::getCreateDate);
|
|
|
List<TNotice> notices = noticeService.list(query);
|
|
|
- if(notices == null){
|
|
|
- return R.fail(ResponseCodesEnum.A0700,"没有公告");
|
|
|
- }
|
|
|
- TNotice tNotice = notices.get(0);
|
|
|
- Long noticeId = admin.getNoticeId();
|
|
|
- long time = tNotice.getCreateDate().getTime();
|
|
|
- if (noticeId!=null) {
|
|
|
- if(noticeId > time) {
|
|
|
- return R.ok(null,"公告已读");
|
|
|
+ if(notices.size() > 0){
|
|
|
+ TNotice tNotice = notices.get(0);
|
|
|
+ Long noticeId = admin.getNoticeId();
|
|
|
+ long time = tNotice.getCreateDate().getTime();
|
|
|
+ if (noticeId!=null) {
|
|
|
+ if(noticeId > time) {
|
|
|
+ return R.ok(null,"公告已读");
|
|
|
+ }
|
|
|
}
|
|
|
+ return R.ok(tNotice,"获取成功");
|
|
|
+ } else {
|
|
|
+ return R.fail(ResponseCodesEnum.A0700,"没有公告");
|
|
|
}
|
|
|
- return R.ok(tNotice,"获取成功");
|
|
|
}
|
|
|
@GetMapping("/updateNotice")
|
|
|
public ResponseModel<?> updateNotice(String adminId) {
|