Browse Source

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

dev_shibei_match
yinzuomei 5 years ago
parent
commit
3b4ecb6b5b
  1. 24
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetLatestV2FormDTO.java
  2. 47
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetLatestV2ResultDTO.java
  3. 104
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java
  4. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeDao.java
  5. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReafdRecordServiceImpl.java
  6. 36
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java
  7. 14
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
  8. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java
  9. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  10. 14
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeDao.xml

24
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetLatestV2FormDTO.java

@ -0,0 +1,24 @@
package com.epmet.resi.group.dto.topic.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/20 下午2:23
* @DESC
*/
@Data
public class GetLatestV2FormDTO implements Serializable {
private static final long serialVersionUID = -5212709032157867124L;
public interface GetLatestV2Form{}
@NotBlank(message = "小组ID不能为空",groups = GetLatestV2Form.class)
private String groupId;
private String userId;
}

47
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetLatestV2ResultDTO.java

@ -0,0 +1,47 @@
package com.epmet.resi.group.dto.topic.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/4/20 下午2:34
* @DESC
*/
@Data
public class GetLatestV2ResultDTO implements Serializable {
private static final long serialVersionUID = 1386600583326358070L;
/**
* 当前人员组内角色(member成员leader群主)
*/
private String userRole;
/**
* 小组类型(ordinary:楼院小组 branch:支部小组)
*/
private String groupType;
/**
* 是否显示通知按钮
*/
private String noticeBut;
/**
* 是否显示活动按钮
*/
private String actBut;
/**
* 是否存在未读消息
*/
private Boolean unReadNews;
/**
* 近十条数据
*/
private List<LatestTenResultDTO> list;
}

104
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java

@ -0,0 +1,104 @@
package com.epmet.resi.group.dto.topic.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/20 下午2:45
* @DESC
*/
@Data
public class LatestTenResultDTO implements Serializable {
private static final long serialVersionUID = -8447212650446365613L;
/**
* 话题通知活动Id
*/
private String id;
/**
* 话题通知活动Id发布人的id
*/
private String userId;
/**
* 发布者的全称街道-姓氏先生/女士专项组显示真实名
*/
private String releaseUserName;
/**
* 话题发布者的头像Url
*/
private String releaseUserHeadPhoto;
/**
* 发布时间yyyy-MM-dd HH:mm
*/
private String releaseTimed;
/**
* 内容
*/
private String content;
/**
* 话题状态discussing进行中closed已关闭
*/
private String status;
/**
* 是否本人
*/
private String releaseUserFlag;
/**
* 如果有图片后台只返回第一张没有图片此列为空
*/
private String firstPhoto;
/**
* 议题id
*/
private String issueId;
/**
* 是否被转为议题true,false
*/
private Boolean shiftIssueFlag;
/**
* 数据类型(topic:话题 notice:通知 act:活动)
*/
private String contentType;
/**
* 本人已读未读状态(read已读 unread未读)
*/
private String readOrUnRead;
/**
* 通知或活动未读人员数
*/
private Integer unReadCount;
public LatestTenResultDTO() {
this.id = "";
this.userId = "";
this.releaseUserName = "";
this.releaseUserHeadPhoto = "";
this.releaseTimed = "";
this.content = "";
this.status = "";
this.releaseUserFlag = "";
this.firstPhoto = "";
this.issueId = "";
this.shiftIssueFlag = false;
this.contentType = "";
this.readOrUnRead = "";
this.unReadCount = NumConstant.ZERO;
}
}

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeDao.java

@ -20,6 +20,7 @@ package com.epmet.modules.notice.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.notice.entity.NoticeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 小组通知表
@ -30,4 +31,9 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface NoticeDao extends BaseDao<NoticeEntity> {
/**
* @Author sun
* @Description 查询通知对应的小组的组长Id
**/
String selectNoticeGroupLeader(@Param("noticeId") String noticeId);
}

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

@ -28,6 +28,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.notice.dao.NoticeDao;
import com.epmet.modules.notice.dao.NoticeReafdRecordDao;
import com.epmet.modules.notice.entity.NoticeReafdRecordEntity;
import com.epmet.modules.notice.redis.NoticeReafdRecordRedis;
@ -60,6 +61,8 @@ public class NoticeReafdRecordServiceImpl extends BaseServiceImpl<NoticeReafdRec
private NoticeReafdRecordRedis noticeReafdRecordRedis;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private NoticeDao noticeDao;
@Override
public PageData<NoticeReafdRecordDTO> page(Map<String, Object> params) {
@ -124,6 +127,9 @@ public class NoticeReafdRecordServiceImpl extends BaseServiceImpl<NoticeReafdRec
NoticeReadListResultDTO resultDTO = new NoticeReadListResultDTO();
List<NoticeReadListResultDTO.NoticeReafdRecord> readList = new ArrayList<>();
List<NoticeReadListResultDTO.NoticeReafdRecord> unReadList = new ArrayList<>();
//0.查询通知对应的小组的组长Id
String leaderId = noticeDao.selectNoticeGroupLeader(formDTO.getNoticeId());
//1.根据通知Id查询组成员已读未读数据
List<NoticeReafdRecordDTO> list = baseDao.getByNoticeId(formDTO.getNoticeId());

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

@ -275,16 +275,18 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
//6.通知已读未读表初始数据
List<NoticeReafdRecordEntity> reafdRecordList = new ArrayList<>();
memberList.forEach(m -> {
if (!"".equals(m.getGroupLeaderFlag())) {
NoticeReafdRecordEntity reafdRecord = new NoticeReafdRecordEntity();
reafdRecord.setCustomerId(resultDTO.getCustomerId());
reafdRecord.setGridId(groupEntity.getGridId());
reafdRecord.setGroupId(formDTO.getGroupId());
reafdRecord.setNoticeId(entity.getId());
reafdRecord.setUserId(m.getCustomerUserId());
NoticeReafdRecordEntity reafdRecord = new NoticeReafdRecordEntity();
reafdRecord.setCustomerId(resultDTO.getCustomerId());
reafdRecord.setGridId(groupEntity.getGridId());
reafdRecord.setGroupId(formDTO.getGroupId());
reafdRecord.setNoticeId(entity.getId());
reafdRecord.setUserId(m.getCustomerUserId());
if ("leader".equals(m.getGroupLeaderFlag())) {
reafdRecord.setReadFlag(ReadFlagConstant.READ);
}else {
reafdRecord.setReadFlag(ReadFlagConstant.UN_READ);
reafdRecordList.add(reafdRecord);
}
reafdRecordList.add(reafdRecord);
});
if (reafdRecordList.size() > NumConstant.ZERO) {
noticeReafdRecordService.insertBatch(reafdRecordList);
@ -394,16 +396,18 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
noticeReafdRecordDao.delByNoticeId(formDTO.getNoticeId());
List<NoticeReafdRecordEntity> reafdRecordList = new ArrayList<>();
memberList.forEach(m -> {
if (!"".equals(m.getGroupLeaderFlag())) {
NoticeReafdRecordEntity reafdRecord = new NoticeReafdRecordEntity();
reafdRecord.setCustomerId(entity.getCustomerId());
reafdRecord.setGridId(entity.getGridId());
reafdRecord.setGroupId(entity.getGroupId());
reafdRecord.setNoticeId(entity.getId());
reafdRecord.setUserId(m.getCustomerUserId());
NoticeReafdRecordEntity reafdRecord = new NoticeReafdRecordEntity();
reafdRecord.setCustomerId(entity.getCustomerId());
reafdRecord.setGridId(entity.getGridId());
reafdRecord.setGroupId(entity.getGroupId());
reafdRecord.setNoticeId(entity.getId());
reafdRecord.setUserId(m.getCustomerUserId());
if ("leader".equals(m.getGroupLeaderFlag())) {
reafdRecord.setReadFlag(ReadFlagConstant.READ);
}else {
reafdRecord.setReadFlag(ReadFlagConstant.UN_READ);
reafdRecordList.add(reafdRecord);
}
reafdRecordList.add(reafdRecord);
});
if (reafdRecordList.size() > NumConstant.ZERO) {
noticeReafdRecordService.insertBatch(reafdRecordList);

14
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java

@ -441,4 +441,18 @@ public class ResiTopicController {
}
return new Result<>();
}
/**
* @Description 查询组内近十条数据
* @Param tokenDto
* @Param formDTO
* @author zxc
* @date 2021/4/20 下午2:34
*/
@PostMapping("getlatestv2")
public Result<GetLatestV2ResultDTO> getLatestV2(@LoginUser TokenDto tokenDto,@RequestBody GetLatestV2FormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GetLatestV2FormDTO.GetLatestV2Form.class);
formDTO.setUserId(tokenDto.getUserId());
return new Result<GetLatestV2ResultDTO>().ok(topicService.getLatestV2(formDTO));
}
}

9
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java

@ -352,4 +352,13 @@ public interface ResiTopicService extends BaseService<ResiTopicEntity> {
void sendTopicPointEventByEventType(TopicEventFormDTO param);
ResiTopicDTO queryTopicInfoByIssueId(String issueId);
/**
* @Description 查询组内近十条数据
* @Param tokenDto
* @Param formDTO
* @author zxc
* @date 2021/4/20 下午2:34
*/
GetLatestV2ResultDTO getLatestV2(GetLatestV2FormDTO formDTO);
}

12
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -2181,6 +2181,18 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
return baseDao.selectByIssueId(issueId);
}
/**
* @Description 查询组内近十条数据
* @Param tokenDto
* @Param formDTO
* @author zxc
* @date 2021/4/20 下午2:34
*/
@Override
public GetLatestV2ResultDTO getLatestV2(GetLatestV2FormDTO formDTO) {
return null;
}
}

14
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeDao.xml

@ -3,5 +3,19 @@
<mapper namespace="com.epmet.modules.notice.dao.NoticeDao">
<select id="selectNoticeGroupLeader" resultType="java.lang.String">
SELECT
rgm.customer_user_id
FROM
notice n
INNER JOIN resi_group rg ON n.group_id = rg.id
INNER JOIN resi_group_member rgm ON n.group_id = rgm.resi_group_id
WHERE
n.del_flag = '0'
AND rg.del_flag = '0'
AND rgm.del_flag = '0'
AND rgm.group_leader_flag = 'leader'
AND n.id = #{noticeId}
</select>
</mapper>
Loading…
Cancel
Save