Browse Source

Merge branch 'dev_group_act_notice' into dev_temp

# Conflicts:
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java
#	epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
dev_shibei_match
sunyuchao 4 years ago
parent
commit
e4abc55f55
  1. 107
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/GroupMessageDTO.java
  2. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetPastTopicListV2FormDTO.java
  3. 4
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetPastTopicListV2ResultDTO.java
  4. 50
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java
  5. 45
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupMessageDao.java
  6. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  7. 75
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupMessageEntity.java
  8. 97
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/GroupMessageService.java
  9. 11
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java
  10. 105
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupMessageServiceImpl.java
  11. 42
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java
  12. 68
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  13. 50
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java
  14. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java
  15. 294
      epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.16__group_act.sql
  16. 22
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupMessageDao.xml
  17. 59
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

107
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/GroupMessageDTO.java

@ -0,0 +1,107 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.resi.group.dto.group;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 组内消息(话题通知活动)记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-22
*/
@Data
public class GroupMessageDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 网格id
*/
private String gridId;
private String groupId;
/**
* 话题topic; 通知notice; 活动act
*/
private String type;
/**
* 话题id , 通知id,活动id
*/
private String messageId;
/**
* 发布人用户id
*/
private String publishUserId;
/**
* 话题状态讨论中 - discussing 已屏蔽 - hidden 已关闭 - closed
* 活动状态已发布published;已取消canceled已变更changed已关闭closed
* 通知已发布published
*/
private String status;
/**
* 逻辑删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
private Date operateTime;
}

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetPastTopicListV2FormDTO.java

@ -18,11 +18,6 @@ public class GetPastTopicListV2FormDTO implements Serializable {
public interface GetPastTopicListV2Form{}
/**
* null默认查询讨论中已关闭dicussing讨论中closed关闭
*/
private String status;
@NotBlank(message = "小组ID不能为空",groups = GetPastTopicListV2Form.class)
private String groupId;

4
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetPastTopicListV2ResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.resi.group.dto.topic.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -74,4 +75,7 @@ public class GetPastTopicListV2ResultDTO implements Serializable {
* 徽章Url集合
*/
private List<String> badgeList;
@JsonIgnore
private String userId;
}

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

@ -41,7 +41,10 @@ import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.act.dao.*;
import com.epmet.modules.act.dao.ActOperationRecordDao;
import com.epmet.modules.act.dao.ActReadRecordDao;
import com.epmet.modules.act.dao.GroupActContentDao;
import com.epmet.modules.act.dao.GroupActInfoDao;
import com.epmet.modules.act.entity.*;
import com.epmet.modules.act.service.ActCategoryDictService;
import com.epmet.modules.act.service.ActSignInRecordService;
@ -49,6 +52,7 @@ import com.epmet.modules.act.service.ActSummaryService;
import com.epmet.modules.act.service.GroupActInfoService;
import com.epmet.modules.constant.GroupActConstant;
import com.epmet.modules.constant.UserMessageConstant;
import com.epmet.modules.group.service.GroupMessageService;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.invitation.service.InvitationRecordService;
import com.epmet.modules.member.service.ResiGroupMemberService;
@ -57,6 +61,7 @@ import com.epmet.resi.group.dto.act.GroupActInfoDTO;
import com.epmet.resi.group.dto.act.form.*;
import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO;
import com.epmet.resi.group.dto.act.result.ActDetailResultDTO;
import com.epmet.resi.group.dto.group.GroupMessageDTO;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.invitation.InvitationRecordDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
@ -115,6 +120,9 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
private InvitationRecordService invitationRecordService;
@Autowired
private ActSummaryService actSummaryService;
@Autowired
private GroupMessageService groupMessageService;
/**
* 003发布编辑组织活动
*
@ -175,10 +183,45 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
//5、发送站内信
sendMessage(memberDTOList,formDTO,groupActInfoEntity,groupDTO);
//6、插入或更新历史关系表
saveGroupMessage(groupActInfoEntity);
result.setGroupActId(groupActInfoEntity.getId());
return result;
}
private void saveGroupMessage(GroupActInfoEntity groupActInfoEntity) {
GroupMessageDTO groupMessageDTO=groupMessageService.getByMessageId(groupActInfoEntity.getId());
if(null==groupMessageDTO){
GroupMessageDTO insert=new GroupMessageDTO();
insert.setCustomerId(groupActInfoEntity.getCustomerId());
insert.setGridId(groupActInfoEntity.getGridId());
if(GroupActConstant.CANCELED.equals(groupActInfoEntity.getStatus())){
insert.setOperateTime(groupActInfoEntity.getCanceledTime());
}else if(GroupActConstant.CLOSED.equals(groupActInfoEntity.getStatus())){
insert.setOperateTime(groupActInfoEntity.getClosedTime());
}else{
insert.setOperateTime(groupActInfoEntity.getUpdatedTime());
}
insert.setStatus(groupActInfoEntity.getStatus());
insert.setMessageId(insert.getId());
insert.setType("act");
insert.setPublishUserId(groupActInfoEntity.getPublishUserId());
insert.setGroupId(groupActInfoEntity.getGroupId());
groupMessageService.save(insert);
return;
}
if(GroupActConstant.CANCELED.equals(groupActInfoEntity.getStatus())){
groupMessageDTO.setOperateTime(groupActInfoEntity.getCanceledTime());
}else if(GroupActConstant.CLOSED.equals(groupActInfoEntity.getStatus())){
groupMessageDTO.setOperateTime(groupActInfoEntity.getClosedTime());
}else{
groupMessageDTO.setOperateTime(groupActInfoEntity.getUpdatedTime());
}
groupMessageDTO.setStatus(groupActInfoEntity.getStatus());
groupMessageService.update(groupMessageDTO);
}
private void sendMessage(List<ResiGroupMemberDTO> memberDTOList, PublishGroupActFormDTO formDTO, GroupActInfoEntity groupActInfoEntity,ResiGroupDTO resiGroupDTO) {
List<UserMessageFormDTO> list = new ArrayList<>();
@ -637,6 +680,8 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
//6、发送站内信
sendUserMessageForCancelAct(actInfoEntity,formDTO.getUserId());
//7、插入或更新消息表
saveGroupMessage(actInfoEntity);
GroupActIdDTO resultDTO=new GroupActIdDTO();
resultDTO.setGroupActId(formDTO.getGroupActId());
return resultDTO;
@ -743,5 +788,8 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
actInfoEntity.setStatus(GroupActConstant.CLOSED);
actInfoEntity.setClosedTime(actOperationRecordEntity.getCreatedTime());
baseDao.updateById(actInfoEntity);
//6、插入或更新
saveGroupMessage(actInfoEntity);
}
}

45
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/GroupMessageDao.java

@ -0,0 +1,45 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.modules.group.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.group.entity.GroupMessageEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 组内消息(话题通知活动)记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-22
*/
@Mapper
public interface GroupMessageDao extends BaseDao<GroupMessageEntity> {
GroupMessageEntity selectByMessageId(String messageId);
/**
* @Description 按条件获取分页后的ID
* @Param groupId
* @author zxc
* @date 2021/4/22 下午2:37
*/
List<String> selectNeedIds(@Param("groupId") String groupId);
}

9
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java

@ -25,6 +25,7 @@ import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.notice.result.UnReadListResultDTO;
import com.epmet.resi.group.dto.topic.result.GetPastTopicListV2ResultDTO;
import com.epmet.resi.group.dto.topic.result.LatestTenResultDTO;
import com.epmet.resi.group.dto.member.result.GroupAchievementDTO;
import org.apache.ibatis.annotations.Mapper;
@ -305,4 +306,12 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
* @return java.util.List<com.epmet.resi.group.dto.member.result.GroupAchievementDTO>
*/
List<GroupAchievementDTO> selectRecentGroupAchievements(@Param("userId") String userId);
/**
* @Description 根据IDs查询 topicactnotice信息
* @Param ids
* @author zxc
* @date 2021/4/22 下午2:59
*/
List<GetPastTopicListV2ResultDTO> getPastTopicListV2ByIds(@Param("ids")List<String> ids);
}

75
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupMessageEntity.java

@ -0,0 +1,75 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.modules.group.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 组内消息(话题通知活动)记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-22
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("group_message")
public class GroupMessageEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 网格id
*/
private String gridId;
private String groupId;
/**
* 话题topic; 通知notice; 活动act
*/
private String type;
/**
* 话题id , 通知id,活动id
*/
private String messageId;
/**
* 发布人用户id
*/
private String publishUserId;
/**
* 话题状态讨论中 - discussing 已屏蔽 - hidden 已关闭 - closed
* 活动状态已发布published;已取消canceled已变更changed已关闭closed
* 通知已发布published
*/
private String status;
private Date operateTime;
}

97
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/GroupMessageService.java

@ -0,0 +1,97 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.modules.group.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.modules.group.entity.GroupMessageEntity;
import com.epmet.resi.group.dto.group.GroupMessageDTO;
import java.util.List;
import java.util.Map;
/**
* 组内消息(话题通知活动)记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-22
*/
public interface GroupMessageService extends BaseService<GroupMessageEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<GroupMessageDTO>
* @author generator
* @date 2021-04-22
*/
PageData<GroupMessageDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<GroupMessageDTO>
* @author generator
* @date 2021-04-22
*/
List<GroupMessageDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return GroupMessageDTO
* @author generator
* @date 2021-04-22
*/
GroupMessageDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-04-22
*/
void save(GroupMessageDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-04-22
*/
void update(GroupMessageDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-04-22
*/
void delete(String[] ids);
GroupMessageDTO getByMessageId(String messageId);
}

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

@ -11,8 +11,10 @@ import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovIssueOpenFeignClient;
import com.epmet.modules.constant.GroupMemberConstant;
import com.epmet.modules.group.dao.GroupMessageDao;
import com.epmet.modules.group.dao.ResiGroupDao;
import com.epmet.modules.group.dao.ResiGroupStatisticalDao;
import com.epmet.modules.group.entity.GroupMessageEntity;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.modules.group.entity.ResiGroupStatisticalEntity;
import com.epmet.modules.group.redis.ResiGroupRedis;
@ -68,6 +70,8 @@ public class ExitGroupServiceImpl implements ExitGroupService {
private ResiGroupRedis resiGroupRedis;
@Autowired
private ResiGroupDao resiGroupDao;
@Autowired
private GroupMessageDao groupMessageDao;
/**
* @param formDTO
@ -113,6 +117,13 @@ public class ExitGroupServiceImpl implements ExitGroupService {
entity.setOperationReason(GroupMemberConstant.DELETE_MEMBER_REASON);
entity.setTopicId(d);
list.add(entity);
//2021.4.22 start sun 因业务调整,新增组内消息记录表,话题状态变化时相应的修改数据状态
GroupMessageEntity groupMessage = groupMessageDao.selectByMessageId(d);
if(null != groupMessage){
groupMessage.setStatus(TopicConstant.HIDDEN);
groupMessageDao.updateById(groupMessage);
}
//2021.4.22 end sun
});
resiTopicOperationService.insertBatch(list);
}

105
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupMessageServiceImpl.java

@ -0,0 +1,105 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.modules.group.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.modules.group.dao.GroupMessageDao;
import com.epmet.modules.group.entity.GroupMessageEntity;
import com.epmet.modules.group.service.GroupMessageService;
import com.epmet.resi.group.dto.group.GroupMessageDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 组内消息(话题通知活动)记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-22
*/
@Service
public class GroupMessageServiceImpl extends BaseServiceImpl<GroupMessageDao, GroupMessageEntity> implements GroupMessageService {
@Override
public PageData<GroupMessageDTO> page(Map<String, Object> params) {
IPage<GroupMessageEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, GroupMessageDTO.class);
}
@Override
public List<GroupMessageDTO> list(Map<String, Object> params) {
List<GroupMessageEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, GroupMessageDTO.class);
}
private QueryWrapper<GroupMessageEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<GroupMessageEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public GroupMessageDTO get(String id) {
GroupMessageEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, GroupMessageDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(GroupMessageDTO dto) {
GroupMessageEntity entity = ConvertUtils.sourceToTarget(dto, GroupMessageEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(GroupMessageDTO dto) {
GroupMessageEntity entity = ConvertUtils.sourceToTarget(dto, GroupMessageEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public GroupMessageDTO getByMessageId(String messageId) {
GroupMessageEntity entity = baseDao.selectByMessageId(messageId);
return ConvertUtils.sourceToTarget(entity, GroupMessageDTO.class);
}
}

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

@ -39,7 +39,9 @@ import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.constant.UserMessageConstant;
import com.epmet.modules.group.dao.GroupMessageDao;
import com.epmet.modules.group.dao.ResiGroupDao;
import com.epmet.modules.group.entity.GroupMessageEntity;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.modules.member.dao.ResiGroupMemberDao;
import com.epmet.modules.notice.dao.NoticeAttachmentDao;
@ -111,6 +113,8 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
private NoticeReadRecordService noticeReafdRecordService;
@Autowired
private NoticeReadRecordDao noticeReadRecordDao;
@Autowired
private GroupMessageDao groupMessageDao;
@Override
@ -241,7 +245,19 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
noticeReafdRecordService.insertBatch(reafdRecordList);
}
//7.组内成员推送站内信
//7.组内消息记录表新增数据
GroupMessageEntity messageEntity = new GroupMessageEntity();
messageEntity.setCustomerId(resultDTO.getCustomerId());
messageEntity.setGridId(groupEntity.getGridId());
messageEntity.setGroupId(entity.getGroupId());
messageEntity.setType("notice");
messageEntity.setMessageId(entity.getId());
messageEntity.setPublishUserId(entity.getCreatedBy());
messageEntity.setStatus("published");
messageEntity.setOperateTime(entity.getChangeTime());
groupMessageDao.insert(messageEntity);
//8.组内成员推送站内信
List<UserMessageFormDTO> userMessageFormDTOS = new ArrayList<>();
memberList.forEach(m -> {
if (!"".equals(m.getGroupLeaderFlag())) {
@ -362,13 +378,31 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
noticeReafdRecordService.insertBatch(reafdRecordList);
}
//7.推送站内信
//7-1.获取小组信息
//7.组内消息记录表更新数据
GroupMessageEntity groupMessage = groupMessageDao.selectByMessageId(formDTO.getNoticeId());
if(null == groupMessage){
GroupMessageEntity messageEntity = new GroupMessageEntity();
messageEntity.setCustomerId(entity.getCustomerId());
messageEntity.setGridId(entity.getGridId());
messageEntity.setGroupId(entity.getGroupId());
messageEntity.setType("notice");
messageEntity.setMessageId(entity.getId());
messageEntity.setPublishUserId(entity.getCreatedBy());
messageEntity.setStatus("published");
messageEntity.setOperateTime(entity.getChangeTime());
groupMessageDao.insert(messageEntity);
}else {
groupMessage.setOperateTime(entity.getChangeTime());
groupMessageDao.updateById(groupMessage);
}
//8.推送站内信
//8-1.获取小组信息
ResiGroupEntity groupEntity = resiGroupDao.selectById(entity.getGroupId());
if (null == groupEntity) {
throw new RenException(String.format("保存小组通知,获取小组数据失败,小组Id->", formDTO.getUserId()));
}
//7-2.推送站内信信息
//8-2.推送站内信信息
List<UserMessageFormDTO> userMessageFormDTOS = new ArrayList<>();
memberList.forEach(m -> {
if (!"".equals(m.getGroupLeaderFlag())) {

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

@ -57,8 +57,10 @@ import com.epmet.modules.constant.WxmpSubscribeConstant;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.feign.GovIssueFeignClient;
import com.epmet.modules.feign.GovOrgFeignClient;
import com.epmet.modules.group.dao.GroupMessageDao;
import com.epmet.modules.group.dao.ResiGroupDao;
import com.epmet.modules.group.dao.ResiGroupStatisticalDao;
import com.epmet.modules.group.entity.GroupMessageEntity;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.modules.group.entity.ResiGroupStatisticalEntity;
import com.epmet.modules.group.redis.ResiGroupRedis;
@ -183,6 +185,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private GroupMessageDao groupMessageDao;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
@ -621,6 +626,15 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
// 5.更新组缓存信息,话题数量-1
updCacheGroupStatisticalInfo(topic.getGroupId(),ModuleConstant.MINUS_OPERATION,NumConstant.ONE);
//2021.4.22 start sun 因业务调整,新增组内消息记录表,话题状态变化时相应的修改数据状态
GroupMessageEntity groupMessage = groupMessageDao.selectByMessageId(hiddenFormDTO.getTopicId());
if(null != groupMessage){
groupMessage.setStatus(TopicConstant.HIDDEN);
groupMessageDao.updateById(groupMessage);
}
//2021.4.22 end sun
return new Result();
}
@ -661,6 +675,13 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
operation.setCreatedBy(tokenDto.getUserId());
operation.setCustomerId(loginUserUtil.getLoginUserCustomerId());
resiTopicOperationDao.insertOne(operation);
//2021.4.22 start sun 因业务调整,新增组内消息记录表,话题状态变化时相应的修改数据状态
GroupMessageEntity groupMessage = groupMessageDao.selectByMessageId(id);
if(null != groupMessage){
groupMessage.setStatus(TopicConstant.PUBLISHMENT);
groupMessageDao.updateById(groupMessage);
}
//2021.4.22 end sun
}
QueryWrapper<ResiGroupStatisticalEntity> statisticalWrapper = new QueryWrapper<>();
statisticalWrapper.eq(TopicConstant.RESI_GROUP_ID,topic.getGroupId());
@ -772,6 +793,14 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
}
}
//2021.4.22 start sun 因业务调整,新增组内消息记录表,话题状态变化时相应的修改数据状态
GroupMessageEntity groupMessage = groupMessageDao.selectByMessageId(closeFormDTO.getTopicId());
if(null != groupMessage){
groupMessage.setStatus(TopicConstant.CLOSED);
groupMessageDao.updateById(groupMessage);
}
//2021.4.22 end sun
return new Result();
}
@ -2387,7 +2416,44 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
*/
@Override
public List<GetPastTopicListV2ResultDTO> getPastTopicListV2(GetPastTopicListV2FormDTO formDTO) {
return null;
PageInfo<String> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> groupMessageDao.selectNeedIds(formDTO.getGroupId()));
List<String> ids = pageInfo.getList();
if (CollectionUtils.isEmpty(ids)){
return new ArrayList<>();
}
// 根据IDs查询 topic,act,notice信息
List<GetPastTopicListV2ResultDTO> infos = resiGroupDao.getPastTopicListV2ByIds(ids);
if (CollectionUtils.isEmpty(infos)){
return new ArrayList<>();
}
ResiGroupEntity resiGroup = resiGroupDao.selectById(formDTO.getGroupId());
List<String> userIds = infos.stream().map(m -> m.getUserId()).collect(Collectors.toList());
// 用户信息
List<UserInfoResultDTO> userInfos = this.disPoseUserInfo(resiGroup.getGroupType(), userIds);
// 各字段赋值
infos.forEach(i -> {
// 用户头像,姓名赋值
if (!CollectionUtils.isEmpty(userInfos)){
userInfos.forEach(u -> {
if (i.getUserId().equals(u.getUserId())){
i.setReleaseUserName(u.getReleaseUserName());
i.setReleaseUserHeadPhoto(u.getReleaseUserHeadPhoto());
}
});
}
// 是否是本人赋值
i.setReleaseUserFlag(formDTO.getUserId().equals(i.getUserId()));
// 是否转议题赋值
i.setShiftIssueFlag(StringUtils.isNotEmpty(i.getIssueId()));
if (i.getReleaseUserFlag()==true){
// 如果此贴是自己发布的,肯定是已读
i.setReadOrUnRead(ModuleConstant.READ_FLAG_YES);
}else {
// TODO 不是自己发布的
}
});
return infos;
}
/**

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

@ -43,8 +43,10 @@ import com.epmet.dto.result.CommonDataFilterResultDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.feign.GovOrgFeignClient;
import com.epmet.modules.group.dao.GroupMessageDao;
import com.epmet.modules.group.dao.ResiGroupDao;
import com.epmet.modules.group.dao.ResiGroupStatisticalDao;
import com.epmet.modules.group.entity.GroupMessageEntity;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.modules.group.entity.ResiGroupStatisticalEntity;
import com.epmet.modules.group.redis.ResiGroupRedis;
@ -108,37 +110,26 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
private ExecutorService threadPool = new ThreadPoolExecutor(1, 1,
1L, TimeUnit.MINUTES,
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy());
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private ResiGroupMemberService resiGroupMemberService;
@Autowired
private ResiTopicAttachmentDao resiTopicAttachmentDao;
@Autowired
private ResiTopicOperationDao resiTopicOperationDao;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private ResiGroupDao resiGroupDao;
@Autowired
private ResiGroupMemberDao resiGroupMemberDao;
@Autowired
private ResiGroupStatisticalDao resiGroupStatisticalDao;
@Autowired
private ResiTopicDao resiTopicDao;
@Autowired
private ResiGroupRedis resiGroupRedis;
@Autowired
private TopicDraftAttachmentService topicDraftAttachmentService;
@Autowired
@ -160,6 +151,8 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
private String voiceAsyncScanMethod;
@Value("${openapi.scan.method.voiceResults}")
private String voiceResultsMethod;
@Autowired
private GroupMessageDao groupMessageDao;
@Override
public PageData<TopicDraftDTO> page(Map<String, Object> params) {
@ -792,6 +785,20 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
sendMqMsg(draft.getCreatedBy(), draft.getCustomerId(), draft.getCreatedTime(),resiGroupRedis.get(draft.getGroupId()).getGroupName(),
breviary.toString(), dataFilterResult.getData().getAgencyId(), draft.getGridId(), draft.getGroupId());
sendMqMsg(draft.getCreatedBy(), draft.getCustomerId(),draft.getCreatedTime(),resiGroupRedis.get(draft.getGroupId()).getGroupName(),breviary.toString());
//2021.4.22 start sun 因业务调整,新增组内消息记录表,新增话题时相应的初始数据
GroupMessageEntity messageEntity = new GroupMessageEntity();
messageEntity.setCustomerId(draft.getCustomerId());
messageEntity.setGridId(draft.getGridId());
messageEntity.setGroupId(draft.getGroupId());
messageEntity.setType("topic");
messageEntity.setMessageId(resiTopic.getId());
messageEntity.setPublishUserId(resiTopic.getCreatedBy());
messageEntity.setStatus(TopicConstant.PUBLISHMENT);
messageEntity.setOperateTime(null == resiTopic.getCreatedTime() ? new Date() : resiTopic.getCreatedTime());
groupMessageDao.insert(messageEntity);
//2021.4.22 end sun
}
//记录操作记录
entity = baseDao.selectById(formDTO.getTopicDraftId());
@ -913,10 +920,14 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
TopicDraftEntity draft = baseDao.selectById(draftId);
StringBuilder breviary = new StringBuilder();
String content = CharMatcher.WHITESPACE.trimFrom(draft.getTopicContent());
if(!StringUtils.isBlank(content) && !StringUtils.equals("语音话题",content)){
if (!StringUtils.isBlank(content) && !StringUtils.equals("语音话题", content)) {
breviary.append("话题\"");
breviary.append(content.length() > NumConstant.TEN ? (content.substring(NumConstant.ZERO,NumConstant.TEN) + "…") : content);
breviary.append(content.length() > NumConstant.TEN ? (content.substring(NumConstant.ZERO, NumConstant.TEN) + "…") : content);
breviary.append("\"");
} else {
breviary.append("语音话题");
}
sendMqMsg(tokenDto.getUserId(), formDTO.getCustomerId(),draft.getCreatedTime(),resiGroupRedis.get(draft.getGroupId()).getGroupName(),breviary.toString());
}else {
breviary.append("语音话题");
}
@ -930,6 +941,19 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
sendMqMsg(tokenDto.getUserId(), formDTO.getCustomerId(), draft.getCreatedTime(), resiGroupRedis.get(draft.getGroupId()).getGroupName(),
breviary.toString(), dataFilterResult.getData().getAgencyId(), formDTO.getGridId(), formDTO.getGroupId());
//2021.4.22 start sun 因业务调整,新增组内消息记录表,新增话题时相应的初始数据
GroupMessageEntity messageEntity = new GroupMessageEntity();
messageEntity.setCustomerId(formDTO.getCustomerId());
messageEntity.setGridId(formDTO.getGridId());
messageEntity.setGroupId(formDTO.getGroupId());
messageEntity.setType("topic");
messageEntity.setMessageId(topic.getId());
messageEntity.setPublishUserId(topic.getCreatedBy());
messageEntity.setStatus(TopicConstant.PUBLISHMENT);
messageEntity.setOperateTime(null == topic.getCreatedTime() ? currentTime : topic.getCreatedTime());
groupMessageDao.insert(messageEntity);
//2021.4.22 end sun
}
/**

5
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java

@ -397,4 +397,9 @@ public interface ModuleConstant extends Constant {
String GET_USER_INFO_ERR = "查询用户信息失败了";
/**
* 已读
*/
String READ_FLAG_YES = "read";
}

294
epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.16__group_act.sql

@ -0,0 +1,294 @@
CREATE TABLE `group_message` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`GRID_ID` varchar(64) NOT NULL COMMENT '网格id',
`GROUP_ID` varchar(64) NOT NULL COMMENT '小组id',
`TYPE` varchar(64) NOT NULL COMMENT '话题:topic; 通知:notice; 活动:act',
`MESSAGE_ID` varchar(64) NOT NULL COMMENT '话题id , 通知id,活动id',
`PUBLISH_USER_ID` varchar(64) NOT NULL COMMENT '发布人用户id',
`STATUS` varchar(64) NOT NULL COMMENT '话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed)\r\n活动状态:已发布:published;已取消:canceled;已变更:changed;已关闭:closed\r\n通知:已发布:published',
`OPERATE_TIME` datetime NOT NULL COMMENT '操作时间',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '逻辑删除标识',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组内消息(话题、通知、活动)记录表';
/*
Navicat Premium Data Transfer
Source Server : 192.168.1.130
Source Server Type : MySQL
Source Server Version : 50728
Source Host : 192.168.1.130:3306
Source Schema : epmet_resi_group
Target Server Type : MySQL
Target Server Version : 50728
File Encoding : 65001
Date: 22/04/2021 10:39:14
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for act_category_dict
-- ----------------------------
DROP TABLE IF EXISTS `act_category_dict`;
CREATE TABLE `act_category_dict` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`CATEGORY_CODE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '类别编码',
`CATEGORY_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动类别名称;eg:支部建设、联建共建',
`LEVEL` int(11) NOT NULL COMMENT '等级1,2......',
`SORT` int(11) NOT NULL COMMENT '排序',
`PARENT_CODE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '上级类别编码',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '逻辑删除标识',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '活动类别字典' ROW_FORMAT = Dynamic;
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1', 'default', '100', '支部建设', 1, 1, '0', '0', 0, 'APP_USER', '2021-04-15 15:17:15', 'APP_USER', '2021-04-15 15:17:18');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10', 'default', '101001', '省级、市级机关', 2, 1, '101', '0', 0, 'APP_USER', '2021-04-15 15:27:13', 'APP_USER', '2021-04-15 15:27:18');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('11', 'default', '101002', '区直机关', 2, 2, '101', '0', 0, 'APP_USER', '2021-04-15 15:27:49', 'APP_USER', '2021-04-15 15:27:53');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('12', 'default', '101003', '驻区企事业单位', 2, 3, '101', '0', 0, 'APP_USER', '2021-04-15 15:28:31', 'APP_USER', '2021-04-15 15:28:33');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('13', 'default', '101004', '驻区\"两新\"组织', 2, 4, '101', '0', 0, 'APP_USER', '2021-04-15 15:29:13', 'APP_USER', '2021-04-15 15:29:16');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('14', 'default', '100001001', '三会一课-尹作梅测试', 3, 1, '100001', '0', 0, 'APP_USER', '2021-04-19 15:05:00', 'APP_USER', '2021-04-19 15:05:03');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2', 'default', '101', '联建共建', 1, 2, '0', '0', 0, 'APP_USER', '2021-04-15 15:17:44', 'APP_USER', '2021-04-15 15:17:56');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3', 'default', '102', '为民服务', 1, 3, '0', '0', 0, 'APP_USER', '2021-04-15 15:18:22', 'APP_USER', '2021-04-15 15:18:29');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('4', 'default', '100001', '三会一课', 2, 1, '100', '0', 0, 'APP_USER', '2021-04-15 15:19:50', 'APP_USER', '2021-04-15 15:19:57');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('5', 'default', '100002', '主题党日', 2, 2, '100', '0', 0, 'APP_USER', '2021-04-15 15:22:42', 'APP_USER', '2021-04-15 15:22:48');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('6', 'default', '100003', '\"三述\"专题', 2, 3, '100', '0', 0, 'APP_USER', '2021-04-15 15:24:06', 'APP_USER', '2021-04-15 15:24:12');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('7', 'default', '100004', '党内志愿服务', 2, 4, '100', '0', 0, 'APP_USER', '2021-04-15 15:24:52', 'APP_USER', '2021-04-15 15:24:58');
INSERT INTO `epmet_resi_group`.`act_category_dict`(`ID`, `CUSTOMER_ID`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `SORT`, `PARENT_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('9', 'default', '100005', '党内关怀服务', 2, 5, '100', '0', 0, 'APP_USER', '2021-04-15 15:25:36', 'APP_USER', '2021-04-15 15:25:43');
-- ----------------------------
-- Table structure for act_comment
-- ----------------------------
DROP TABLE IF EXISTS `act_comment`;
CREATE TABLE `act_comment` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`GROUP_ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'group_act_info.id',
`COMMENT_USER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评论人id',
`COMMENT_CONTENT` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评论内容;目前限制500字',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除标记 0:未删除,1:已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人,评论人Id,来自user',
`CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '活动评论表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for act_operation_record
-- ----------------------------
DROP TABLE IF EXISTS `act_operation_record`;
CREATE TABLE `act_operation_record` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键(签到成功后插入此表)',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`GROUP_ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'group_act_info.id',
`OPERATE_USER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作人id',
`OPERATION_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作类型:发布:publish;\r\n取消:cancel;\r\n变更:change;\r\n关闭:close',
`NOTE` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注;取消理由',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '逻辑删除标识',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '活动操作表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for act_read_record
-- ----------------------------
DROP TABLE IF EXISTS `act_read_record`;
CREATE TABLE `act_read_record` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键(发布活动后后台自动初始化记录)',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '小组所属网格id',
`GROUP_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '小组id',
`GROUP_ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'group_act_info.id',
`READ_FLAG` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'un_read' COMMENT '已读: read未读:un_read;查看活动详情后修改此表,或者插入一条新的已读记录',
`USER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户id',
`SHOULD_BE_READ` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'yes' COMMENT 'yes:应读;no: 新入群的人已读',
`DEL_FLAG` int(11) NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '活动已读记录' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for act_sign_in_code
-- ----------------------------
DROP TABLE IF EXISTS `act_sign_in_code`;
CREATE TABLE `act_sign_in_code` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`GROUP_ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'group_act_info.id',
`URL` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '签到码url',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除标志',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '组织活动签到码' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for act_sign_in_record
-- ----------------------------
DROP TABLE IF EXISTS `act_sign_in_record`;
CREATE TABLE `act_sign_in_record` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键(签到成功后插入此表)',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`GROUP_ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'group_act_info.id',
`SIGN_USER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '签到用户id',
`SIGN_IN_ADDRESS` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '签到地点',
`LONGITUDE` decimal(32, 10) NULL DEFAULT NULL COMMENT '签到地点-经度',
`LATITUDE` decimal(32, 10) NULL DEFAULT NULL COMMENT '签到地点-纬度',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '逻辑删除标识',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '组织活动签到记录' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for act_summary
-- ----------------------------
DROP TABLE IF EXISTS `act_summary`;
CREATE TABLE `act_summary` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键(确认提交后插入此表)',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`GROUP_ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'group_act_info.id',
`SHOULD_ATTEND` int(11) NOT NULL COMMENT '应参加人数:来源于group_act_info',
`SIGNED_IN_NUM` int(11) NOT NULL COMMENT '已签到人数',
`SIGNED_IN_USERS` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '已签到人员姓名列表、分隔; 按照签到时间升序排列',
`USER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '填写总结的人',
`DEL_FLAG` int(11) NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '活动总结' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for act_summary_content
-- ----------------------------
DROP TABLE IF EXISTS `act_summary_content`;
CREATE TABLE `act_summary_content` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`ACT_SUMMARY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'act_summary.id',
`GROUP_ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'group_act_info.id',
`CONTENT` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '总结内容',
`CONTENT_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容类型: 文字:text;图片:img',
`SORT` int(11) NOT NULL COMMENT '内容顺序 从1开始',
`DEL_FLAG` int(11) NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '活动总结内容' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for group_act_content
-- ----------------------------
DROP TABLE IF EXISTS `group_act_content`;
CREATE TABLE `group_act_content` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`GROUP_ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'group_act_info.id',
`CONTENT` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动内容',
`CONTENT_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容类型: 文字:text;图片:img',
`SORT` int(11) NOT NULL COMMENT '内容顺序 从1开始',
`DEL_FLAG` int(11) NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '组织活动内容' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for group_act_info
-- ----------------------------
DROP TABLE IF EXISTS `group_act_info`;
CREATE TABLE `group_act_info` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`GROUP_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '小组id',
`GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '小组所属的网格id',
`AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所属的组织id',
`GRID_PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格的所有上级id',
`TITLE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动标题;需内容审核',
`START_TIME` datetime(0) NOT NULL COMMENT '活动时间',
`CATEGORY_CODE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动所属类别编码',
`PARENT_CODE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '上级类别编码',
`ALL_CATEGORY_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动类别名称;eg:支部建设-三会一课',
`ADDRESS` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动地点',
`LONGITUDE` decimal(32, 10) NOT NULL COMMENT '活动地点-经度',
`LATITUDE` decimal(32, 10) NOT NULL COMMENT '活动地点-纬度',
`SHOULD_ATTEND` int(11) NOT NULL COMMENT '应参加人数组长填入;此列也是应签到人数;',
`STATUS` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动状态:已发布:published;已取消:canceled;已变更:changed;已关闭:closed',
`CHANGED_TIME` datetime(0) NOT NULL COMMENT '最后一次编辑时间;首次发布与CREATED_TIME一致',
`SIGN_IN_START_TIME` datetime(0) NULL DEFAULT NULL COMMENT '签到开始时间',
`SIGN_IN_END_TIME` datetime(0) NULL DEFAULT NULL COMMENT '签到截止时间',
`SUMMARY_FLAG` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否填写总结?1:已填写;0:未填写',
`SIGNED_IN_NUM` int(11) NOT NULL DEFAULT 0 COMMENT '已签到人数(有人签到自动+1)',
`CANCELED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '取消时间',
`CLOSED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '关闭时间',
`PUBLISH_USER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动发布人用户id',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识',
`REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁',
`CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间(活动发布时间)',
`UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '组织活动信息' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
DROP TABLE IF EXISTS `invitation_record`;
CREATE TABLE `invitation_record` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`GRID_ID` varchar(64) NOT NULL COMMENT '小组所属的网格id',
`GROUP_ID` varchar(64) NOT NULL COMMENT '小组id',
`SOURCE_TYPE` varchar(32) NOT NULL COMMENT 'act:活动;notice:通知',
`SOURCE_ID` varchar(64) NOT NULL COMMENT '活动id,或者通知id....',
`SHARE_USER_ID` varchar(64) NOT NULL COMMENT '分享人id',
`INVITE_CONTENT` varchar(255) DEFAULT NULL COMMENT '分享内容',
`DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='分享记录(话题、通知...后续支持增加)';

22
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupMessageDao.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.modules.group.dao.GroupMessageDao">
<select id="selectByMessageId" parameterType="java.lang.String" resultType="com.epmet.modules.group.entity.GroupMessageEntity">
select * from group_message gm
where GM.DEL_FLAG='0'
AND gm.MESSAGE_ID=#{messageId}
</select>
<select id="selectNeedIds" resultType="java.lang.String">
SELECT
message_id
FROM group_message
WHERE DEL_FLAG = '0'
AND GROUP_ID = #{groupId}
order by created_time desc
</select>
</mapper>

59
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

@ -782,4 +782,63 @@
rgas.ARRIVE_TIME DESC
LIMIT 10
</select>
<!-- 根据IDs查询 topic,act,notice信息 -->
<select id="getPastTopicListV2ByIds" resultType="com.epmet.resi.group.dto.topic.result.GetPastTopicListV2ResultDTO">
SELECT id,userId,releaseTime,content,status,issueId,contentType FROM
((SELECT
t.ID,
t.CREATED_BY AS userId,
DATE_FORMAT(t.CREATED_TIME,'%Y-%m-%d %H:%m:%s') AS releaseTime,
t.TOPIC_CONTENT AS content,
t.`STATUS` AS status,
IFNULL(t.ISSUE_ID,'') AS issueId,
'topic' AS contentType
FROM resi_topic t
WHERE t.DEL_FLAG = '0'
AND t.`STATUS` != 'hidden'
AND (
<foreach collection="ids" item="id" separator=" OR ">
t.id = #{id}
</foreach>
)
)
UNION ALL
(SELECT
ai.ID,
ai.CREATED_BY AS userId,
DATE_FORMAT(ai.CREATED_TIME,'%Y-%m-%d %H:%m:%s') AS releaseTime,
IFNULL(ac.CONTENT,'') AS content,
ai.`STATUS` AS status,
'' AS issueId,
'act' AS contentType
FROM group_act_info ai
LEFT JOIN group_act_content ac ON ac.GROUP_ACT_ID = ai.ID AND ac.CONTENT_TYPE = 'text'
WHERE ai.DEL_FLAG = '0'
AND (
<foreach collection="ids" item="id" separator=" OR ">
ai.id = #{id}
</foreach>
)
)
UNION ALL
(SELECT
n.ID,
n.CREATED_BY AS userId,
DATE_FORMAT(n.CREATED_TIME,'%Y-%m-%d %H:%m:%s') AS releaseTime,
n.CONTENT AS content,
'' AS status,
'' AS issueId,
'notice' AS contentType
FROM notice n
WHERE n.DEL_FLAG = '0'
AND (
<foreach collection="ids" item="id" separator=" OR ">
n.id = #{id}
</foreach>
)
)
)temp
ORDER BY releaseTime DESC
</select>
</mapper>

Loading…
Cancel
Save