Helius
2020-08-25 d06ef42904752c43a8a2458ce38793b50442ab2c
src/main/java/com/xcong/excoin/modules/helpCenter/service/impl/HelpCenterServiceImpl.java
@@ -208,6 +208,7 @@
                  helpCenterNoticeEntity.getArticleTitle();
                  newNoticeInfoVo.setArticleTitle(articleTitle);
               }
               arrayList.add(newNoticeInfoVo);
            }
         }
      }
@@ -215,6 +216,88 @@
      return Result.ok(arrayList);
   }
   @Override
   public Result getAboutUs() {
      NoticeInfoVo noticeInfoVo = new NoticeInfoVo();
      HelpCenterArticleEntity selectById = helpCenterArticleDao.selectById(27);
      if(ObjectUtil.isNotEmpty(selectById)) {
         String createBy = selectById.getCreateBy();
         noticeInfoVo.setCreateBy(createBy);
         String content = selectById.getContent();
         noticeInfoVo.setContent(content);
         Date createTime = selectById.getCreateTime();
         noticeInfoVo.setCreateTime(createTime);
         String title = selectById.getTitle();
         noticeInfoVo.setTitle(title);
         int typeLanguage = selectById.getTypeLanguage();
         noticeInfoVo.setTypeLanguage(typeLanguage);
         Long id = selectById.getId();
         noticeInfoVo.setId(id);
      }
      return Result.ok(noticeInfoVo);
   }
   @Override
   public Result getUserAgreement() {
      NoticeInfoVo noticeInfoVo = new NoticeInfoVo();
      HelpCenterArticleEntity selectById = helpCenterArticleDao.selectById(29);
      if(ObjectUtil.isNotEmpty(selectById)) {
         String createBy = selectById.getCreateBy();
         noticeInfoVo.setCreateBy(createBy);
         String content = selectById.getContent();
         noticeInfoVo.setContent(content);
         Date createTime = selectById.getCreateTime();
         noticeInfoVo.setCreateTime(createTime);
         String title = selectById.getTitle();
         noticeInfoVo.setTitle(title);
         int typeLanguage = selectById.getTypeLanguage();
         noticeInfoVo.setTypeLanguage(typeLanguage);
         Long id = selectById.getId();
         noticeInfoVo.setId(id);
      }
      return Result.ok(noticeInfoVo);
   }
   @Override
   public Result getFristNewNoticeList(@Valid NewNoticePageDto newNoticePageDto) {
      List<NewNoticeInfoVo> arrayList = new ArrayList<>();
        Page<HelpCenterNoticeEntity> page = new Page<>(1, 5);
        //获取【帮助中心公告】
        HelpCenterNoticeEntity helpCenterNoticeEntity = new HelpCenterNoticeEntity();
        IPage<HelpCenterNoticeEntity> HelpCenterNoticeEntitys = helpCenterNoticeDao.getNewNoticeList(page, helpCenterNoticeEntity);
        List<HelpCenterNoticeEntity> records = HelpCenterNoticeEntitys.getRecords();
        if(CollUtil.isNotEmpty(records)) {
           for(HelpCenterNoticeEntity helpCenterNotice : records) {
              NewNoticeInfoVo newNoticeInfoVo = new NewNoticeInfoVo();
              Long id = helpCenterNotice.getId();
              newNoticeInfoVo.setId(id);
              String createBy = helpCenterNotice.getCreateBy();
              newNoticeInfoVo.setCreateBy(createBy);
              Date createTime = helpCenterNotice.getCreateTime();
              newNoticeInfoVo.setCreateTime(createTime);
              int articleNotice = helpCenterNotice.getArticleNotice();
              newNoticeInfoVo.setArticleNotice(articleNotice);
              int type = newNoticePageDto.getType();
              if(type == 2) {
                 Long articleIdUs = helpCenterNotice.getArticleIdUs();
                 newNoticeInfoVo.setArticleId(articleIdUs);
                 String articleTitleUs = helpCenterNotice.getArticleTitleUs();
                 newNoticeInfoVo.setArticleTitle(articleTitleUs);
              }else {
                 Long articleId = helpCenterNotice.getArticleId();
                 newNoticeInfoVo.setArticleId(articleId);
                 String articleTitle = helpCenterNotice.getArticleTitle();
                 newNoticeInfoVo.setArticleTitle(articleTitle);
              }
              arrayList.add(newNoticeInfoVo);
           }
        }
      return Result.ok(arrayList);
   }