liusheng
2024-05-22 9b44e841586ce281e4e3e9d7296d74b29939418b
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceSystemmessageController.java
@@ -1,6 +1,8 @@
package com.ruoyi.web.controller.project;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import com.ruoyi.common.core.domain.model.LoginUser;
@@ -59,21 +61,19 @@
    @ApiOperation("查询未读消息数量")
    @GetMapping("/noreadcount")
    public AjaxResult noreadcount() {
//        LoginUser loginUser = getLoginUser();
//        ServiceSystemmessage serviceSystemmessage = new ServiceSystemmessage();
//        serviceSystemmessage.setReceiveuserno(loginUser.getUsername());
//        serviceSystemmessage.setIsread(0);
//        List<ServiceSystemmessage> list = serviceSystemmessageService.queryList(serviceSystemmessage);
//        return AjaxResult.success(list.size());
        //   log.info("不用管我,正在测试程序");
        return null;
        LoginUser loginUser = getLoginUser();
        ServiceSystemmessage serviceSystemmessage=new ServiceSystemmessage();
        serviceSystemmessage.setReceiveuserno(loginUser.getUsername());
        serviceSystemmessage.setIsread(0);
        List<ServiceSystemmessage> list = serviceSystemmessageService.queryList(serviceSystemmessage);
        return AjaxResult.success(list.size());
    }
    /**
     * 导出系统消息列表
     */
    @ApiOperation("导出系统消息列表")
    @PreAuthorize("@ss.hasPermi('project:systemmessage:export')")
    // @PreAuthorize("@ss.hasPermi('project:systemmessage:export')")
    @Log(title = "系统消息", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceSystemmessage serviceSystemmessage) {
@@ -95,12 +95,13 @@
     * 新增系统消息
     */
    @ApiOperation("新增系统消息")
    @PreAuthorize("@ss.hasPermi('project:systemmessage:add')")
    // @PreAuthorize("@ss.hasPermi('project:systemmessage:add')")
    @Log(title = "系统消息", businessType = BusinessType.INSERT)
    @PostMapping
    @PostMapping("/add")
    @RepeatSubmit
    public AjaxResult add(@RequestBody ServiceSystemmessage serviceSystemmessage) {
        return toAjax(serviceSystemmessageService.save(serviceSystemmessage));
        boolean save = serviceSystemmessageService.save(serviceSystemmessage);
        return AjaxResult.success(serviceSystemmessage);
    }
    /**
@@ -108,7 +109,7 @@
     */
    @ApiOperation("修改系统消息")
    @Log(title = "系统消息", businessType = BusinessType.UPDATE)
    @PutMapping
    @PostMapping("/edit")
    @RepeatSubmit
    public AjaxResult edit(@RequestBody ServiceSystemmessage serviceSystemmessage) {
        return toAjax(serviceSystemmessageService.updateById(serviceSystemmessage));
@@ -118,9 +119,9 @@
     * 删除系统消息
     */
    @ApiOperation("删除系统消息")
    @PreAuthorize("@ss.hasPermi('project:systemmessage:remove')")
    // @PreAuthorize("@ss.hasPermi('project:systemmessage:remove')")
    @Log(title = "系统消息", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(serviceSystemmessageService.removeByIds(Arrays.asList(ids)));
    }