Browse Source

获取通知详情接口浏览数自动加1

feature/syp_points
liuchuang 5 years ago
parent
commit
f199a44f03
  1. 5
      esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcNoticeDetailResultDTO.java
  2. 11
      esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/service/impl/NoticeServiceImpl.java
  3. 3
      esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/NoticeDao.xml

5
esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcNoticeDetailResultDTO.java

@ -48,4 +48,9 @@ public class EpdcNoticeDetailResultDTO implements Serializable {
* 首图 * 首图
*/ */
private String imgUrl; private String imgUrl;
/**
* 联系电话
*/
private String mobile;
} }

11
esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/java/com/elink/esua/epdc/service/impl/NoticeServiceImpl.java

@ -46,7 +46,6 @@ import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.service.NoticeDepartmentService; import com.elink.esua.epdc.service.NoticeDepartmentService;
import com.elink.esua.epdc.service.NoticeService; import com.elink.esua.epdc.service.NoticeService;
import com.elink.esua.epdc.util.NewsUtils; import com.elink.esua.epdc.util.NewsUtils;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -249,8 +248,16 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
@Override @Override
public Result<EpdcNoticeDetailResultDTO> getNoticeDetailById(String noticeId) { public Result<EpdcNoticeDetailResultDTO> getNoticeDetailById(String noticeId) {
EpdcNoticeDetailResultDTO dto = this.baseDao.selectOneAppNotice(noticeId); EpdcNoticeDetailResultDTO dto = this.baseDao.selectOneAppNotice(noticeId);
// 浏览数+1
if (null != dto) {
dto.setReadingAmount(dto.getReadingAmount() + NumConstant.ONE);
NoticeEntity entity = new NoticeEntity();
entity.setId(noticeId);
entity.setReadingAmount(dto.getReadingAmount());
updateById(entity);
dto.setNoticeContent("<div style=\"font-size:19px;line-height:31px\">" + dto.getNoticeContent() + "</div>"); dto.setNoticeContent("<div style=\"font-size:19px;line-height:31px\">" + dto.getNoticeContent() + "</div>");
return new Result().ok(dto); }
return new Result<EpdcNoticeDetailResultDTO>().ok(dto);
} }
@Override @Override

3
esua-epdc/epdc-module/epdc-news/epdc-news-server/src/main/resources/mapper/NoticeDao.xml

@ -33,7 +33,8 @@
n.READING_AMOUNT AS readingAmount, n.READING_AMOUNT AS readingAmount,
n.RELEASE_TIME AS noticeTime, n.RELEASE_TIME AS noticeTime,
SUBSTRING_INDEX(n.ALL_DEPT_NAMES,'-',-1) AS deptName, SUBSTRING_INDEX(n.ALL_DEPT_NAMES,'-',-1) AS deptName,
n.NOTICE_IMAGE_URL imgUrl n.NOTICE_IMAGE_URL imgUrl,
n.MOBILE mobile
FROM FROM
epdc_notice n epdc_notice n
WHERE WHERE

Loading…
Cancel
Save