Browse Source

Merge remote-tracking branch 'origin/dev_group_act_notice' into dev_group_act_notice

master
sunyuchao 5 years ago
parent
commit
d155cca038
  1. 13
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActReadRecordDTO.java
  2. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActReadRecordEntity.java
  3. 11
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java

13
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActReadRecordDTO.java

@ -17,9 +17,10 @@
package com.epmet.resi.group.dto.act; package com.epmet.resi.group.dto.act;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data;
/** /**
@ -43,6 +44,16 @@ public class ActReadRecordDTO implements Serializable {
*/ */
private String customerId; private String customerId;
/**
* 小组所属网格id
*/
private String gridId;
/**
* 小组id
*/
private String groupId;
/** /**
* group_act_info.id * group_act_info.id
*/ */

10
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActReadRecordEntity.java

@ -40,6 +40,16 @@ public class ActReadRecordEntity extends BaseEpmetEntity {
*/ */
private String customerId; private String customerId;
/**
* 小组所属网格id
*/
private String gridId;
/**
* 小组id
*/
private String groupId;
/** /**
* group_act_info.id * group_act_info.id
*/ */

11
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java

@ -148,7 +148,8 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
List<ActReadRecordEntity> readRecordEntityList=constructReadRec(groupActInfoEntity.getId(), List<ActReadRecordEntity> readRecordEntityList=constructReadRec(groupActInfoEntity.getId(),
formDTO.getCustomerId(), formDTO.getCustomerId(),
formDTO.getGroupId(), formDTO.getGroupId(),
formDTO.getPublishUserId()); formDTO.getPublishUserId(),
groupDTO.getGridId());
//2、插入活动内容 //2、插入活动内容
contentList.forEach(textContentEntity->{ contentList.forEach(textContentEntity->{
groupActContentDao.insert(textContentEntity); groupActContentDao.insert(textContentEntity);
@ -167,7 +168,7 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
return result; return result;
} }
private List<ActReadRecordEntity> constructReadRec(String groupActId, String customerId, String groupId,String publishUserId) { private List<ActReadRecordEntity> constructReadRec(String groupActId, String customerId, String groupId,String publishUserId,String gridId) {
List<ActReadRecordEntity> list=new ArrayList<>(); List<ActReadRecordEntity> list=new ArrayList<>();
List<ResiGroupMemberDTO> memberDTOList=resiGroupMemberService.getMemberList(groupId); List<ResiGroupMemberDTO> memberDTOList=resiGroupMemberService.getMemberList(groupId);
memberDTOList.forEach(memberDTO->{ memberDTOList.forEach(memberDTO->{
@ -177,6 +178,8 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
actReadRecordEntity.setRead(GroupActConstant.UN_READ); actReadRecordEntity.setRead(GroupActConstant.UN_READ);
actReadRecordEntity.setUserId(memberDTO.getCustomerUserId()); actReadRecordEntity.setUserId(memberDTO.getCustomerUserId());
actReadRecordEntity.setShouldBeRead(Constant.YES); actReadRecordEntity.setShouldBeRead(Constant.YES);
actReadRecordEntity.setGroupId(groupId);
actReadRecordEntity.setGridId(gridId);
if(!publishUserId.equals(memberDTO.getCustomerUserId())){ if(!publishUserId.equals(memberDTO.getCustomerUserId())){
list.add(actReadRecordEntity); list.add(actReadRecordEntity);
} }
@ -248,7 +251,7 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
} }
if (!CollectionUtils.isEmpty(formDTO.getImgList())) { if (!CollectionUtils.isEmpty(formDTO.getImgList())) {
//最多选择3张图片 //最多选择3张图片
if (formDTO.getTextList().get(NumConstant.ZERO).length() > NumConstant.THREE) { if (formDTO.getImgList().size() > NumConstant.THREE) {
throw new RenException(EpmetErrorCode.GROUP_ACT_IMG_MAX.getCode(), EpmetErrorCode.GROUP_ACT_IMG_MAX.getMsg()); throw new RenException(EpmetErrorCode.GROUP_ACT_IMG_MAX.getCode(), EpmetErrorCode.GROUP_ACT_IMG_MAX.getMsg());
} }
} }
@ -393,6 +396,8 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
insertEntity.setRead(GroupActConstant.READ); insertEntity.setRead(GroupActConstant.READ);
insertEntity.setShouldBeRead(Constant.NO); insertEntity.setShouldBeRead(Constant.NO);
insertEntity.setUserId(formDTO.getUserId()); insertEntity.setUserId(formDTO.getUserId());
insertEntity.setGridId(groupActInfoEntity.getGridId());
insertEntity.setGroupId(groupActInfoEntity.getGroupId());
actReadRecordDao.insert(insertEntity); actReadRecordDao.insert(insertEntity);
}else{ }else{
if(GroupActConstant.UN_READ.equals(actReadRecordEntity.getRead())){ if(GroupActConstant.UN_READ.equals(actReadRecordEntity.getRead())){

Loading…
Cancel
Save