Browse Source

接口调整 不在吧通知详情与阅读放在一起

master
sunyuchao 4 years ago
parent
commit
caa46d0a6f
  1. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeDetailFormDTO.java
  2. 3
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java
  3. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java
  4. 4
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java
  5. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeDetailFormDTO.java

@ -17,10 +17,5 @@ public class NoticeDetailFormDTO {
@NotBlank(message = "通知Id不能为空",groups = {NoticeDetailFormDTO.Detail.class})
private String noticeId;
/**
* token中用户Id
*/
private String userId;
public interface Detail{}
}

3
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java

@ -92,9 +92,8 @@ public class NoticeController {
* @Description 小组通知详情
**/
@PostMapping(value = "noticedetail")
public Result<NoticeDetailResultDTO> noticeDetail(@LoginUser TokenDto tokenDto, @RequestBody NoticeDetailFormDTO formDTO){
public Result<NoticeDetailResultDTO> noticeDetail(@RequestBody NoticeDetailFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, NoticeDetailFormDTO.Detail.class);
formDTO.setUserId(tokenDto.getUserId());
return new Result<NoticeDetailResultDTO>().ok(noticeService.noticeDetail(formDTO));
}

5
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java

@ -18,6 +18,7 @@
package com.epmet.modules.notice.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -66,11 +67,15 @@ public class NoticeReadRecordController {
* @return
* @Author sun
* @Description 小组通知阅读状态修改
* 只给居民端使用
**/
@PostMapping(value = "readtype")
public Result readType(@LoginUser TokenDto tokenDto, @RequestBody ReadTypeFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ReadTypeFormDTO.Read.class);
formDTO.setUserId(tokenDto.getUserId());
if(!"resi".equals(tokenDto.getApp())){
throw new RenException(String.format("接口仅用于居民端使用,请检查用户是否为居民端用户,userId->", formDTO.getUserId()));
}
noticeReafdRecordService.readType(formDTO);
return new Result();
}

4
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java

@ -165,13 +165,13 @@ public class NoticeReadRecordServiceImpl extends BaseServiceImpl<NoticeReadRecor
} else {
//4.根据是否过期判断已存在记录且是已读状态不在修改
if (bl) {
if ("un_read".equals(entity.getReadFlag())) {
if ("un_read".equals(entity.getReadFlag()) && null != entity) {
entity.setReadFlag(ReadFlagConstant.READ);
entity.setViewDetail(ReadFlagConstant.READ);
baseDao.updateById(entity);
}
} else {
if ("un_read".equals(entity.getViewDetail())) {
if ("un_read".equals(entity.getViewDetail()) && null != entity) {
entity.setViewDetail(ReadFlagConstant.READ);
baseDao.updateById(entity);
}

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java

@ -494,12 +494,6 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
resultDTO.setImageList(imageList);
resultDTO.setDocList(docList);
//5.修改当前人员对通知的阅读状态
ReadTypeFormDTO readType = new ReadTypeFormDTO();
readType.setNoticeId(formDTO.getNoticeId());
readType.setUserId(formDTO.getUserId());
noticeReadRecordService.readType(readType);
return resultDTO;
}

Loading…
Cancel
Save