|
|
@ -17,23 +17,27 @@ |
|
|
|
|
|
|
|
package com.epmet.modules.topic.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
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.constant.MqConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; |
|
|
|
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; |
|
|
|
import com.epmet.commons.tools.enums.EventEnum; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
|
import com.epmet.commons.tools.scan.param.TextScanParamDTO; |
|
|
|
import com.epmet.commons.tools.scan.param.TextTaskDTO; |
|
|
|
import com.epmet.commons.tools.scan.result.SyncScanResult; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.utils.ScanContentUtils; |
|
|
|
import com.epmet.commons.tools.utils.SendMqMsgUtils; |
|
|
|
import com.epmet.dto.form.UserResiInfoListFormDTO; |
|
|
|
import com.epmet.dto.result.UserResiInfoResultDTO; |
|
|
|
import com.epmet.modules.comment.entity.ResiTopicCommentEntity; |
|
|
@ -58,7 +62,6 @@ import com.epmet.resi.group.dto.topic.ResiTopicCommentDTO; |
|
|
|
import com.epmet.resi.group.dto.topic.ResiTopicDTO; |
|
|
|
import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO; |
|
|
|
import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; |
|
|
|
import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; |
|
|
|
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -224,6 +227,37 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen |
|
|
|
comment.setCreatedBy(tokenDto.getUserId()); |
|
|
|
baseDao.insertOne(comment); |
|
|
|
|
|
|
|
// 话题评论前3次,加积分【对小组内话题进行15字以上评论】
|
|
|
|
Integer commentCount = baseDao.selectCommentCountByUserId(tokenDto.getUserId()); |
|
|
|
if (null != commentCount && commentCount <= NumConstant.THREE){ |
|
|
|
if (StringUtils.isNotBlank(commentContent) && commentContent.length() > NumConstant.FIFTEEN){ |
|
|
|
//mq的事件类型
|
|
|
|
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); |
|
|
|
mqBaseMsgDTO.setEventClass(EventEnum.PARTICIPATE_ONE_TOPIC.getEventClass()); |
|
|
|
//事件code
|
|
|
|
mqBaseMsgDTO.setEventTag(EventEnum.PARTICIPATE_ONE_TOPIC.getEventTag()); |
|
|
|
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>(); |
|
|
|
BasePointEventMsg pointEventMsg = new BasePointEventMsg(); |
|
|
|
String customerId = resiTopicdDao.selectCustomerIdByTopicId(resiCommentFormDTO.getTopicId()); |
|
|
|
if (StringUtils.isBlank(customerId)){ |
|
|
|
throw new RenException(TopicConstant.GET_CUSTOMER_ID_FAILURE); |
|
|
|
} |
|
|
|
pointEventMsg.setCustomerId(customerId); |
|
|
|
pointEventMsg.setUserId(tokenDto.getUserId()); |
|
|
|
// 加分
|
|
|
|
pointEventMsg.setActionFlag(MqConstant.PLUS); |
|
|
|
pointEventMsg.setIsCommon(false); |
|
|
|
pointEventMsg.setEventTag(mqBaseMsgDTO.getEventTag()); |
|
|
|
pointEventMsgList.add(pointEventMsg); |
|
|
|
|
|
|
|
mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); |
|
|
|
Result msgResult= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); |
|
|
|
if(!msgResult.success()){ |
|
|
|
logger.error(TopicConstant.COMMENT_TOPIC_FAILURE); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|