Browse Source

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

dev_shibei_match
wangchao 5 years ago
parent
commit
08ea7d3bab
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java
  2. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java
  3. 4
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueShareLinkRecordController.java
  4. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueShareLinkRecordDao.java
  5. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueShareLinkVisitRecordDao.java
  6. 9
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueShareLinkRecordService.java
  7. 13
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java
  8. 13
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkVisitRecordDao.xml
  9. 4
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java
  10. 4
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupMemeberOperationServiceImpl.java
  11. 1
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  12. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentDao.java
  13. 8
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java
  14. 42
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java
  15. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  16. 9
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml
  17. 9
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java

@ -227,7 +227,8 @@ public class HttpClientManager {
try { try {
HttpPost httppost = new HttpPost(url); HttpPost httppost = new HttpPost(url);
httppost.setConfig(requestConfig); httppost.setConfig(requestConfig);
httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_JSON); httppost.addHeader(HEADER_CONTENT_TYPE, "application/json");
//httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_JSON);
if (StringUtils.isNotEmpty(jsonStrParam)) { if (StringUtils.isNotEmpty(jsonStrParam)) {
StringEntity se = new StringEntity(jsonStrParam, UTF8); StringEntity se = new StringEntity(jsonStrParam, UTF8);
httppost.setEntity(se); httppost.setEntity(se);

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java

@ -7,6 +7,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.mq.EventClassDto; import com.epmet.commons.tools.dto.form.mq.EventClassDto;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.MqReturnBaseResult; import com.epmet.commons.tools.dto.form.mq.MqReturnBaseResult;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.enums.MqMethodPathEnum; import com.epmet.commons.tools.enums.MqMethodPathEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.exception.ValidateException;
@ -109,6 +110,4 @@ public class SendMqMsgUtils {
return new Result<List<EventClassDto>>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); return new Result<List<EventClassDto>>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg());
} }
} }
} }

4
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueShareLinkRecordController.java

@ -121,8 +121,8 @@ public class IssueShareLinkRecordController {
* @date 2020.12.22 10:53 * @date 2020.12.22 10:53
*/ */
@PostMapping("sharelinkinfo") @PostMapping("sharelinkinfo")
public Result<IssueShareLinkRecordDTO> shareLinkInfo(@RequestParam String shareLinkId){ public Result<IssueShareLinkRecordDTO> shareLinkInfo(@RequestParam String shareLinkId,@LoginUser TokenDto token){
return null; return new Result<IssueShareLinkRecordDTO>().ok(issueShareLinkRecordService.getShareLinkInfoAndUpdate(shareLinkId,token));
} }
} }

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueShareLinkRecordDao.java

@ -22,6 +22,7 @@ import com.epmet.entity.IssueShareLinkRecordEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
* 议题分享链接表 * 议题分享链接表
* *
@ -47,5 +48,4 @@ public interface IssueShareLinkRecordDao extends BaseDao<IssueShareLinkRecordEnt
* @date 2020/12/18 下午1:55 * @date 2020/12/18 下午1:55
*/ */
IssueShareLinkRecordEntity selectIssueInfoById(@Param("issueId") String issueId); IssueShareLinkRecordEntity selectIssueInfoById(@Param("issueId") String issueId);
} }

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueShareLinkVisitRecordDao.java

@ -62,4 +62,6 @@ public interface IssueShareLinkVisitRecordDao extends BaseDao<IssueShareLinkVisi
* @date 2020.12.22 09:53 * @date 2020.12.22 09:53
*/ */
IssueShareLinkVisitRecordDTO selectRecordByLinkIdAndInvitee(@Param("linkId") String linkId, @Param("invitee") String invitee); IssueShareLinkVisitRecordDTO selectRecordByLinkIdAndInvitee(@Param("linkId") String linkId, @Param("invitee") String invitee);
int updateIfJoinGroupByLinkId(@Param("linkId") String linkId, @Param("invitee") String invitee);
} }

9
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueShareLinkRecordService.java

@ -115,4 +115,13 @@ public interface IssueShareLinkRecordService extends BaseService<IssueShareLinkR
* @date 2020/12/18 下午5:22 * @date 2020/12/18 下午5:22
*/ */
IssueVisitResultDTO issueVisit( IssueVisitFormDTO formDTO, TokenDto tokenDto); IssueVisitResultDTO issueVisit( IssueVisitFormDTO formDTO, TokenDto tokenDto);
/**
* @Description 查询分享链接并修改是否通过该邀请进群属性
* @param shareLinkId
* @return com.epmet.dto.IssueShareLinkRecordDTO
* @author wangc
* @date 2020.12.23 15:10
*/
IssueShareLinkRecordDTO getShareLinkInfoAndUpdate(String shareLinkId,TokenDto token);
} }

13
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java

@ -164,4 +164,17 @@ public class IssueShareLinkRecordServiceImpl extends BaseServiceImpl<IssueShareL
return new IssueVisitResultDTO(linkRecord.getIssueId(),linkRecord.getGridId(),linkRecord.getCustomerId()); return new IssueVisitResultDTO(linkRecord.getIssueId(),linkRecord.getGridId(),linkRecord.getCustomerId());
} }
/**
* @Description 查询分享链接并修改是否通过该邀请进群属性
* @param shareLinkId
* @return com.epmet.dto.IssueShareLinkRecordDTO
* @author wangc
* @date 2020.12.23 15:10
*/
@Override
public IssueShareLinkRecordDTO getShareLinkInfoAndUpdate(String shareLinkId,TokenDto token) {
visitRecordDao.updateIfJoinGroupByLinkId(shareLinkId,token.getUserId());
return get(shareLinkId);
}
} }

13
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkVisitRecordDao.xml

@ -44,4 +44,17 @@
invitee_user_id = #{invitee} invitee_user_id = #{invitee}
LIMIT 1 LIMIT 1
</select> </select>
<update id="updateIfJoinGroupByLinkId">
UPDATE
issue_share_link_visit_record
SET
if_join_group = 1
WHERE
del_flag = '0'
AND
share_link_rec_id = #{linkId}
AND
invitee_user_id = #{invitee}
</update>
</mapper> </mapper>

4
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java

@ -103,4 +103,8 @@ public interface TopicConstant {
String GROUP_INFO_FAILURE = "根据groupId未查询到组信息......"; String GROUP_INFO_FAILURE = "根据groupId未查询到组信息......";
String CREATE_TOPIC_FAILURE = "发布话题加分失败......"; String CREATE_TOPIC_FAILURE = "发布话题加分失败......";
String COMMENT_TOPIC_FAILURE = "评论话题加分失败......";
String GET_CUSTOMER_ID_FAILURE = "查询客户ID失败......";
} }

4
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupMemeberOperationServiceImpl.java

@ -307,10 +307,6 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb
log.error("【{}】该用户入组方式为议题分享链接入组,但未查询到链接访问记录,链接Id【{}】",param.getUserId(),param.getShareLinkId()); log.error("【{}】该用户入组方式为议题分享链接入组,但未查询到链接访问记录,链接Id【{}】",param.getUserId(),param.getShareLinkId());
throw new RenException("未找到链接访问记录"); throw new RenException("未找到链接访问记录");
} }
if(!visitRecordResult.getData().getIfJoinGroup()){
log.error("【{}】该用户入组方式为议题分享链接入组,但并不是通过该链接发起的入群申请,链接Id【{}】",param.getUserId(),param.getShareLinkId());
throw new RenException("用户并非通过当前链接申请入组");
}
if(NumConstant.ZERO == visitRecordResult.getData().getIsInviteRegister()) isNew = true; if(NumConstant.ZERO == visitRecordResult.getData().getIsInviteRegister()) isNew = true;
} }

1
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java

@ -430,6 +430,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
* @Date 2020/3/30 22:07 * @Date 2020/3/30 22:07
**/ **/
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void agreeApply(AgreeApplyFormDTO agreeApplyFormDTO) { public void agreeApply(AgreeApplyFormDTO agreeApplyFormDTO) {
GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationService.get(agreeApplyFormDTO.getApplyId()); GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationService.get(agreeApplyFormDTO.getApplyId());
//1、当前申请单是否是待审核 //1、当前申请单是否是待审核

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

@ -22,7 +22,6 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.comment.entity.ResiTopicCommentEntity; import com.epmet.modules.comment.entity.ResiTopicCommentEntity;
import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO;
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -60,4 +59,12 @@ public interface ResiTopicCommentDao extends BaseDao<ResiTopicCommentEntity> {
* @author sun * @author sun
*/ */
List<String> selectTopicList(@Param("userId") String userId); List<String> selectTopicList(@Param("userId") String userId);
/**
* @Description 根据userId查询此人今日评论次数
* @Param userId
* @author zxc
* @date 2020/12/23 上午11:09
*/
Integer selectCommentCountByUserId(@Param("userId") String userId);
} }

8
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java

@ -202,4 +202,12 @@ public interface ResiTopicDao extends BaseDao<ResiTopicEntity> {
* @date 2020/12/23 上午10:02 * @date 2020/12/23 上午10:02
*/ */
Integer selectPublishTopicCountByUserId(@Param("userId")String userId); Integer selectPublishTopicCountByUserId(@Param("userId")String userId);
/**
* @Description 根据topicId查询客户ID
* @Param topicId
* @author zxc
* @date 2020/12/23 下午2:25
*/
String selectCustomerIdByTopicId(@Param("topicId")String topicId);
} }

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

@ -17,23 +17,27 @@
package com.epmet.modules.topic.service.impl; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.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.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;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; 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.Result;
import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.utils.SendMqMsgUtils;
import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.modules.comment.entity.ResiTopicCommentEntity; 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.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO; 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.IssueGridResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -224,6 +227,37 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
comment.setCreatedBy(tokenDto.getUserId()); comment.setCreatedBy(tokenDto.getUserId());
baseDao.insertOne(comment); 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(); return new Result();
} }

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

@ -360,7 +360,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
// 创建话题增加积分 // 创建话题增加积分
// 查询此人今日发表话题数量 // 查询此人今日发表话题数量
Integer publishTopicCount = baseDao.selectPublishTopicCountByUserId(tokenDto.getUserId()); Integer publishTopicCount = baseDao.selectPublishTopicCountByUserId(tokenDto.getUserId());
if (null != publishTopicCount && publishTopicCount <= NumConstant.FIVE){ if (null != publishTopicCount && publishTopicCount <= NumConstant.THREE){
//mq的事件类型 //mq的事件类型
MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO();
mqBaseMsgDTO.setEventClass(EventEnum.PUBLISH_ONE_TOPIC.getEventClass()); mqBaseMsgDTO.setEventClass(EventEnum.PUBLISH_ONE_TOPIC.getEventClass());

9
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml

@ -88,4 +88,13 @@
) )
</select> </select>
<!-- 根据userId查询此人今日评论次数 -->
<select id="selectCommentCountByUserId" resultType="java.lang.Integer">
SELECT COUNT(ID) FROM resi_topic_comment
WHERE DEL_FLAG = 0
AND DATE_FORMAT(CREATED_TIME,'%Y%m%d') = DATE_FORMAT(NOW(),'%Y%m%d')
AND CHAR_LENGTH(COMMENT_CONTENT) > 15
AND CREATED_BY = #{userId}
</select>
</mapper> </mapper>

9
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml

@ -551,5 +551,14 @@
AND CREATED_BY = #{userId} AND CREATED_BY = #{userId}
</select> </select>
<!-- 根据topicId查询客户ID -->
<select id="selectCustomerIdByTopicId" resultType="java.lang.String">
SELECT g.CUSTOMER_ID FROM resi_topic t
LEFT JOIN resi_group g ON g.ID = t.GROUP_ID
WHERE t.DEL_FLAG = 0
AND g.DEL_FLAG = 0
AND t.ID = #{topicId}
</select>
</mapper> </mapper>

Loading…
Cancel
Save