Commit f8edf969 by 桂前礼

feat:[1004024] 微信群被封处理-转企业微信个人号流程

parent 6c2dc8e4
package com.pcloud.book.group.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* TODO
*
* @author guiq
* @version 1.0
* @since 2020/12/9
*/
@Getter
@Setter
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class ReplyMsgDTO {
@ApiModelProperty("1 文本 | 2 图片 | 3 链接")
private Integer msgType;
private String keyWord;
private String content;
private String imgUrl;
private String desc;
private String title;
private String url;
}
package com.pcloud.book.group.service;
import com.pcloud.book.group.dto.ReplyMsgDTO;
import com.pcloud.common.dto.ResponseDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(value = "pcloud-service-book", qualifier = "wxWorkKeyWordServiceCloud", path = "book/v1.0/wxWorkKeyWordService")
@Api(description = "关键词内部接口")
public interface WxWorkKeyWordService {
@ApiOperation("根据群分类ID获取关键词回复")
@GetMapping("/getKeyWordsByClassify")
ResponseEntity<ResponseDto<List<ReplyMsgDTO>>> getKeyWordsByClassify(@RequestParam("classifyId") Long classifyId);
}
......@@ -717,11 +717,13 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
@Override
@ParamLog("客户端根据群分类获取二维码")
public GroupQrcode4ClassifyVO getGroupQrcode4ClassifyWechat(Long classifyId, Long wechatUserId) {
//获取分类基本信息
ClassifyVO classify = bookGroupClassifyDao.getClassify(classifyId);
if (classify == null) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "社群码不存在,请刷新后重试");
}
if (new BigDecimal(0).compareTo(classify.getPrice()) < 0) {
//校验用户是否正版授权
Boolean isAuth = bookAuthUserBiz.checkIsHaveAuth(classify.getBookId(), classify.getChannelId(), classify.getCreateUser(), wechatUserId, 1);
......@@ -734,6 +736,14 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
}
}
// 临时替换为企业微信加好友流程
if (JedisClusterUtils.exists("WECHAT_GROUP_BAN_PROCESS")) {
GroupQrcode4ClassifyVO vo = new GroupQrcode4ClassifyVO();
vo.setQrcodeUrl(JedisClusterUtils.get("WECHAT_GROUP_BAN_PROCESS"));
vo.setGroupName(classify.getClassify());
return vo;
}
//获取用户是否分配过二维码
GroupQrcode4ClassifyVO groupQrcode4ClassifyVO = bookQrcodeUserDao.getUserQrcode(classifyId, wechatUserId);
if (groupQrcode4ClassifyVO == null) {
......
package com.pcloud.book.group.service.impl;
import com.pcloud.book.group.dto.ReplyMsgDTO;
import com.pcloud.book.group.service.WxWorkKeyWordService;
import com.pcloud.book.keywords.biz.BookKeywordBiz;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.utils.ResponseHandleUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* TODO
*
* @author guiq
* @version 1.0
* @since 2020/12/9
*/
@RestController
@RequestMapping("/wxWorkKeyWordService")
public class WxWorkKeyWordServiceImpl implements WxWorkKeyWordService {
@Autowired
private BookKeywordBiz bookKeywordBiz;
@Override
@GetMapping("/getKeyWordsByClassify")
public ResponseEntity<ResponseDto<List<ReplyMsgDTO>>> getKeyWordsByClassify(@RequestParam("classifyId") Long classifyId) {
return ResponseHandleUtil.toResponse(bookKeywordBiz.getKeyWordsByClassify(classifyId));
}
}
package com.pcloud.book.keywords.biz;
import com.pcloud.book.group.dto.GroupClassifyQrcodeDTO;
import com.pcloud.book.group.dto.ReplyMsgDTO;
import com.pcloud.book.keywords.dto.KeywordDTO;
import com.pcloud.book.keywords.dto.KeywordStatisticsDTO;
import com.pcloud.book.keywords.dto.ReplyKeywordDTO;
......@@ -160,4 +161,6 @@ public interface BookKeywordBiz {
* 自动唤醒处理
*/
void robotWakeUp(String userWxId, String ip, Integer code, String robotId);
List<ReplyMsgDTO> getKeyWordsByClassify(Long classifyId);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment