3 Komitmen 70607f8048 ... 917ea05182

Pembuat SHA1 Pesan Tanggal
  hamjin 917ea05182 返回内容修改 2 tahun lalu
  hamjin 9c268aa284 函数变量名修正 2 tahun lalu
  zhangyang 968cb62d3d 消息模块权限优化 2 tahun lalu

+ 6 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoNoticeController.java

@@ -57,7 +57,7 @@ public class PoNoticeController extends BaseController {
     @PreAuthorize("@ss.hasPermi('system:notice:query')")
     @GetMapping(value = "/{poNoticeId}")
     @ApiOperation("获取通知公告内容")
-    public AjaxResult getInfo(@PathVariable Long poNoticeId) {
+    public AjaxResult getInfo(@PathVariable("poNoticeId") Long poNoticeId) {
         return success(poNoticeService.selectPoNoticeById(poNoticeId));
     }
 
@@ -69,8 +69,10 @@ public class PoNoticeController extends BaseController {
     @ApiOperation("添加通知公告")
     @PostMapping
     public AjaxResult add(@Validated @RequestBody PoNotice poNotice) {
-        System.out.println(poNotice);
-        return toAjax(poNoticeService.insertPoNotice(poNotice));
+        List<PoNotice> poNoticeList = poNoticeService.selectPoNoticeList(poNotice);
+        if (poNoticeList == null || poNoticeList.isEmpty())
+            return toAjax(poNoticeService.insertPoNotice(poNotice));
+        return error("重复的公告");
     }
 
     /**
@@ -83,7 +85,7 @@ public class PoNoticeController extends BaseController {
     public AjaxResult edit(@Validated @RequestBody PoNotice poNotice) {
         List<PoNotice> poNotice1 = poNoticeService.selectPoNoticeList(poNotice);
         if (poNotice1 == null || poNotice1.isEmpty())
-            return toAjax(false);
+            return error("要修改的公告不存在");
         poNotice.setUpdateBy(getUsername());
         poNotice.setPublisherId(getUserId());
         return toAjax(poNoticeService.updatePoNotice(poNotice));

+ 3 - 3
ruoyi-admin/src/main/resources/application-druid.yml

@@ -6,9 +6,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://localhost:3306/post?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
-                password: zhangyang0311
+                password: 123456
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭
@@ -43,7 +43,7 @@ spring:
                 allow:
                 url-pattern: /druid/*
                 # 控制台管理用户名和密码
-                login-username: admin
+                login-username: ruoyi
                 login-password: 123456
             filter:
                 stat:

+ 10 - 10
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoNoticeService.java

@@ -21,40 +21,40 @@ public interface IPoNoticeService {
     /**
      * 查询公告列表
      *
-     * @param news 公告信息
+     * @param poNotice 公告信息
      * @return 公告集合
      */
-    List<PoNotice> selectPoNoticeList(PoNotice news);
+    List<PoNotice> selectPoNoticeList(PoNotice poNotice);
 
     /**
      * 新增公告
      *
-     * @param news 公告信息
+     * @param poNotice 公告信息
      * @return 结果
      */
-    int insertPoNotice(PoNotice news);
+    int insertPoNotice(PoNotice poNotice);
 
     /**
      * 修改公告
      *
-     * @param news 公告信息
+     * @param poNotice 公告信息
      * @return 结果
      */
-    int updatePoNotice(PoNotice news);
+    int updatePoNotice(PoNotice poNotice);
 
     /**
      * 删除公告信息
      *
-     * @param newsId 公告ID
+     * @param poNoticeId 公告ID
      * @return 结果
      */
-    int deletePoNoticeById(Long newsId);
+    int deletePoNoticeById(Long poNoticeId);
 
     /**
      * 批量删除公告信息
      *
-     * @param newsIds 需要删除的公告ID
+     * @param poNoticeIds 需要删除的公告ID
      * @return 结果
      */
-    int deletePoNoticeByIds(Long[] newsIds);
+    int deletePoNoticeByIds(Long[] poNoticeIds);
 }

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoNewsServiceImpl.java

@@ -42,7 +42,7 @@ public class PoNewsServiceImpl implements IPoNewsService {
             BeanUtils.copyProperties(item, poNews);
             List<PoNews> newsAndUserVos = poNewsMapper.selectUserByNewsId(newsId);
             list.add(newsAndUserVos);
-            poNews.setUserId(list.toString());
+            poNews.setPhonenumber(list.toString());
             return poNews;
         }).collect(Collectors.toList());
            return collect;