zss
2 天以前 b9a985fea44086bb07069b1913835bbfaf0ed44a
src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java
@@ -28,6 +28,7 @@
import com.ruoyi.project.system.domain.SysNotice;
import com.ruoyi.project.system.mapper.SysNoticeMapper;
import com.ruoyi.project.system.service.ISysNoticeService;
import org.springframework.transaction.annotation.Transactional;
/**
 * 公告 服务层实现
@@ -230,4 +231,20 @@
        return sysNotice;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean appReadNotice(Long noticeId) {
        if (noticeId == null) {
            return false;
        }
        SysNotice sysNotice = noticeMapper.selectNoticeById(noticeId);
        if (sysNotice == null) {
            return false;
        }
        sysNotice.setStatus("1");
        return noticeMapper.update(null, Wrappers.<SysNotice>lambdaUpdate()
                .eq(SysNotice::getNoticeId, noticeId)
                .eq(SysNotice::getStatus, "0")
                .set(SysNotice::getStatus, "1")) > 0;
    }
}