Browse Source

因新增组内消息记录表引起的程序变动(新增话题、自动审核、组长审核、屏蔽、取消屏蔽、关闭、删除组员)

master
sunyuchao 4 years ago
parent
commit
469268347e
  1. 11
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java
  2. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java
  3. 25
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  4. 49
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java

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);
}

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

@ -249,6 +249,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
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());
@ -383,6 +384,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
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());

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

@ -60,6 +60,7 @@ 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;
@ -608,6 +609,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();
}
@ -648,6 +658,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());
@ -711,6 +728,14 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
operation.setCustomerId(loginUserUtil.getLoginUserCustomerId());
resiTopicOperationDao.insertOne(operation);
//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();
}

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

@ -40,8 +40,10 @@ import com.epmet.commons.tools.utils.*;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.feign.EpmetUserFeignClient;
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;
@ -105,37 +107,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
@ -155,6 +146,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) {
@ -778,6 +771,19 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
breviary.append("话题");
}
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());
@ -899,13 +905,28 @@ 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("语音话题");
} else {
breviary.append("语音话题");
}
sendMqMsg(tokenDto.getUserId(), formDTO.getCustomerId(),draft.getCreatedTime(),resiGroupRedis.get(draft.getGroupId()).getGroupName(),breviary.toString());
//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
}
/**

Loading…
Cancel
Save