Browse Source

Merge remote-tracking branch 'origin/dev_voice_share_point' into dev_temp

master
wangchao 5 years ago
parent
commit
b536789e87
  1. 16
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  2. 45
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicEventFormDTO.java
  3. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
  4. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  5. 14
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
  6. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java
  7. 62
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  8. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java

16
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.nacos.client.utils.StringUtils; import com.alibaba.nacos.client.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -7,6 +8,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
@ -26,6 +28,8 @@ import com.epmet.dao.IssueProcessDao;
import com.epmet.dao.IssueProjectRelationDao; import com.epmet.dao.IssueProjectRelationDao;
import com.epmet.dto.*; import com.epmet.dto.*;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.form.IssueAuditionFormDTO;
import com.epmet.dto.form.IssueShiftedFromTopicFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.IssueEntity; import com.epmet.entity.IssueEntity;
import com.epmet.entity.IssueProcessEntity; import com.epmet.entity.IssueProcessEntity;
@ -40,10 +44,8 @@ import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO;
import com.epmet.resi.group.dto.group.result.GroupShiftProjectListResultDTO; import com.epmet.resi.group.dto.group.result.GroupShiftProjectListResultDTO;
import com.epmet.resi.group.dto.group.result.GroupVotingListResultDTO; import com.epmet.resi.group.dto.group.result.GroupVotingListResultDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.form.*;
import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO; import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicTurnIssueFromDTO;
import com.epmet.resi.group.dto.topic.form.TopicIdListFormDTO;
import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO;
import com.epmet.resi.group.dto.topic.result.GovTopicIssueInfoResultDTO; import com.epmet.resi.group.dto.topic.result.GovTopicIssueInfoResultDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.service.*; import com.epmet.service.*;
@ -868,6 +870,14 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
}catch(RenException e){ }catch(RenException e){
logger.error(e.getInternalMsg()); logger.error(e.getInternalMsg());
} }
//7:发送话题转议题积分事件
TopicEventFormDTO eventParam = new TopicEventFormDTO();
eventParam.setTopicId(entity.getSourceId());
eventParam.setEvent(EventEnum.TOPIC_SHIFTED_TO_PROJECT);
if(!resiGroupOpenFeignClient.sendEvent(eventParam).success()){
logger.warn("com.epmet.service.impl.IssueServiceImpl.shiftProject,话题被转为项目积分事件发送失败,参数:{}", JSON.toJSONString(formDTO));
}
} }
/** /**

45
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicEventFormDTO.java

@ -0,0 +1,45 @@
package com.epmet.resi.group.dto.topic.form;
import com.epmet.commons.tools.enums.EventEnum;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Description 话题相关积分入参dto
* @ClassName TopicEventFormDTO
* @Auth wangc
* @Date 2021-01-04 16:37
*/
@Data
public class TopicEventFormDTO implements Serializable {
private static final long serialVersionUID = 2297474207576464905L;
/**
* 话题Id
*/
@NotBlank(message = "话题Id不能为空")
private String topicId;
/**
* 话题作者Id
*/
//private String topicAuthorId;
/**
* 议题发起人Id
*/
private String issuePublisherId;
/**
* 事件枚举
*/
@NotNull(message = "楼院小组事件枚举类型不能为空")
private EventEnum event;
/**
* 后续相关参数可再添加
*/
}

10
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java

@ -175,4 +175,14 @@ public interface ResiGroupOpenFeignClient {
*/ */
@PostMapping("resi/group/topicdraft/autoAudit") @PostMapping("resi/group/topicdraft/autoAudit")
Result autoAudit(); Result autoAudit();
/**
* @Description 根据事件枚举发送积分事件
* @param param
* @return void
* @author wangc
* @date 2021.01.04 16:41
*/
@PostMapping("resi/group/topic/sendevent")
Result sendEvent(@RequestBody TopicEventFormDTO param);
} }

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -125,4 +125,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
public Result autoAudit() { public Result autoAudit() {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "autoAudit"); return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "autoAudit");
} }
@Override
public Result sendEvent(TopicEventFormDTO param) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "sendEvent",param);
}
} }

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

@ -402,4 +402,18 @@ public class ResiTopicController {
return new Result<TopicAttachmentResultDTO>().ok(topicService.topicAttachmentList(formDTO)); return new Result<TopicAttachmentResultDTO>().ok(topicService.topicAttachmentList(formDTO));
} }
/**
* @Description 根据事件枚举发送积分事件
* @param param
* @return void
* @author wangc
* @date 2021.01.04 16:41
*/
@PostMapping("sendevent")
public Result sendEvent(@RequestBody TopicEventFormDTO param){
ValidatorUtils.validateEntity(param);
topicService.sendTopicPointEventByEventType(param);
return new Result();
}
} }

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

@ -331,4 +331,13 @@ public interface ResiTopicService extends BaseService<ResiTopicEntity> {
* @Description 获取话题附件信息 * @Description 获取话题附件信息
**/ **/
TopicAttachmentResultDTO topicAttachmentList(TopicAttachmentFormDTO formDTO); TopicAttachmentResultDTO topicAttachmentList(TopicAttachmentFormDTO formDTO);
/**
* @Description 根据事件枚举发送积分事件
* @param param
* @return void
* @author wangc
* @date 2021.01.04 16:41
*/
void sendTopicPointEventByEventType(TopicEventFormDTO param);
} }

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

@ -1604,7 +1604,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
pointEventMsg.setRemark(new StringBuilder(groupCache.getGroupName()).append("小组中发布的") pointEventMsg.setRemark(new StringBuilder(groupCache.getGroupName()).append("小组中发布的")
.append( .append(
StringUtils.isBlank(content) ? "语音话题" : StringUtils.isBlank(content) ? "语音话题" :
"\"" + "话题\"" +
content content
.substring(NumConstant.ZERO,content.length() < NumConstant.TEN ? content.length() : NumConstant.TEN) .substring(NumConstant.ZERO,content.length() < NumConstant.TEN ? content.length() : NumConstant.TEN)
+ (NumConstant.TEN > content.length() ? "\"" : "…\"") + (NumConstant.TEN > content.length() ? "\"" : "…\"")
@ -1619,7 +1619,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
pointEventMsg2.setIsCommon(false); pointEventMsg2.setIsCommon(false);
pointEventMsg2.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag()); pointEventMsg2.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag());
//将话题“某某某…” (前十个字后面省略号) 转为议题 //将话题“某某某…” (前十个字后面省略号) 转为议题
pointEventMsg2.setRemark(new StringBuilder("将话题") pointEventMsg2.setRemark(new StringBuilder("将")
.append( .append(
new StringBuilder(new StringBuilder(pointEventMsg.getRemark().replaceFirst(new StringBuilder(groupCache.getGroupName()).append("小组中发布的").toString(),"")) new StringBuilder(new StringBuilder(pointEventMsg.getRemark().replaceFirst(new StringBuilder(groupCache.getGroupName()).append("小组中发布的").toString(),""))
.reverse().toString() .reverse().toString()
@ -1738,7 +1738,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
pointEventMsg.setRemark(new StringBuilder(groupCache.getGroupName()).append("小组中发布的") pointEventMsg.setRemark(new StringBuilder(groupCache.getGroupName()).append("小组中发布的")
.append( .append(
StringUtils.isBlank(content) ? "语音话题" : StringUtils.isBlank(content) ? "语音话题" :
"\"" + "话题\"" +
content content
.substring(NumConstant.ZERO,content.length() < NumConstant.TEN ? content.length() : NumConstant.TEN) .substring(NumConstant.ZERO,content.length() < NumConstant.TEN ? content.length() : NumConstant.TEN)
+ (NumConstant.TEN > content.length() ? "\"" : "…\"") + (NumConstant.TEN > content.length() ? "\"" : "…\"")
@ -1753,7 +1753,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
pointEventMsg2.setIsCommon(false); pointEventMsg2.setIsCommon(false);
pointEventMsg2.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag()); pointEventMsg2.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag());
//将话题“某某某…” (前十个字后面省略号) 转为议题 //将话题“某某某…” (前十个字后面省略号) 转为议题
pointEventMsg2.setRemark(new StringBuilder("将话题") pointEventMsg2.setRemark(new StringBuilder("将")
.append( .append(
new StringBuilder(new StringBuilder(pointEventMsg.getRemark().replaceFirst(new StringBuilder(groupCache.getGroupName()).append("小组中发布的").toString(),"")).reverse() new StringBuilder(new StringBuilder(pointEventMsg.getRemark().replaceFirst(new StringBuilder(groupCache.getGroupName()).append("小组中发布的").toString(),"")).reverse()
.toString().replaceFirst("题议为转被","")).reverse() .toString().replaceFirst("题议为转被","")).reverse()
@ -1995,6 +1995,60 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
return resultDTO; return resultDTO;
} }
/**
* @Description 根据事件枚举发送积分事件
* @param param
* @return void
* @author wangc
* @date 2021.01.04 16:41
*/
@Override
public void sendTopicPointEventByEventType(TopicEventFormDTO param) {
ResiTopicEntity topic = baseDao.selectById(param.getTopicId());
if(null == topic){
log.error("com.epmet.modules.topic.service.impl.ResiTopicServiceImpl.sendTopicPointEventByEventType,根据话题Id没有找到对应的话题信息,参数:{}",JSON.toJSONString(param
));
return;
}
ResiGroupInfoRedisDTO group = resiGroupRedis.get(topic.getGroupId());
if(null == group){
log.error("com.epmet.modules.topic.service.impl.ResiTopicServiceImpl.sendTopicPointEventByEventType,根据组Id没有找到对应的小组信息,组Id:{}",topic.getGroupId());
return;
}
//某某小组中发布的话题“某某某…” (前十个字后面省略号) 被转为项目
if(EventEnum.TOPIC_SHIFTED_TO_PROJECT == param.getEvent()){
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
mqBaseMsgDTO.setEventClass("resi_group");
mqBaseMsgDTO.setEventTag(EventEnum.TOPIC_SHIFTED_TO_PROJECT.getEventTag());
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>();
//话题被转为项目 话题作者
BasePointEventMsg pointEventMsg = new BasePointEventMsg();
pointEventMsg.setCustomerId(group.getCustomerId());
pointEventMsg.setUserId(topic.getCreatedBy());
pointEventMsg.setActionFlag(MqConstant.PLUS);
pointEventMsg.setIsCommon(false);
pointEventMsg.setEventTag(EventEnum.TOPIC_SHIFTED_TO_ISSUE.getEventTag());
//某某小组中发布的话题“某某某…” (前十个字后面省略号) 被转为议题
String content = CharMatcher.WHITESPACE.trimFrom(topic.getTopicContent());
pointEventMsg.setRemark(new StringBuilder(group.getGroupName()).append("小组中发布的")
.append(
StringUtils.isBlank(content) ? "语音话题" :
"话题\"" +
content
.substring(NumConstant.ZERO,content.length() < NumConstant.TEN ? content.length() : NumConstant.TEN)
+ (NumConstant.TEN > content.length() ? "\"" : "…\"")
).append("被转为项目").toString());
pointEventMsgList.add(pointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList));
if(!SendMqMsgUtils.sendMsg(mqBaseMsgDTO).success()){
log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param));
}
}
}
} }

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

@ -916,7 +916,7 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
actPointEventMsg.setIsCommon(false); actPointEventMsg.setIsCommon(false);
actPointEventMsg.setRemark(new StringBuilder(groupName).append("小组中发布话题").append(topicBreviary).toString()); actPointEventMsg.setRemark(new StringBuilder(groupName).append("小组中发布话题").append(topicBreviary).toString());
actPointEventMsg.setTargetDate(targetDate); actPointEventMsg.setTargetDate(targetDate);
actPointEventMsg.setEventTag(EventEnum.PUBLISH_ONE_TOPIC.getEventClass()); actPointEventMsg.setEventTag(EventEnum.PUBLISH_ONE_TOPIC.getEventTag());
actPointEventMsgList.add(actPointEventMsg); actPointEventMsgList.add(actPointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList));

Loading…
Cancel
Save