Commit d87e8be5 by xugaojun

存量会员群发实现,dubbo配置,mq消息,群发逻辑,小程序构造实现

parent 685f54ca
package com.gic.haoban.manage.api.service.mq;
/**
* desc:微信会员消费服务
*
* @author: YongEn
* @date: 2022/2/16
**/
public interface MemberUnionRelateConsumer {
/**
* desc: 添加好友关系-存量会员新增
*
* @param messageParam 消息参数
* @author : YongEn
* @date : 2022/2/16
*/
void addMemberUnionRelate(String messageParam);
}
...@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletResponse;
import com.gic.haoban.app.customer.service.api.service.QywxTagSyncApiService; import com.gic.haoban.app.customer.service.api.service.QywxTagSyncApiService;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService; import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService;
import com.gic.haoban.task.manage.api.service.GroupSendOperateApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
...@@ -65,6 +66,8 @@ public class EnterpriseController extends WebBaseController { ...@@ -65,6 +66,8 @@ public class EnterpriseController extends WebBaseController {
private ExternalClerkRelatedApiService externalClerkRelatedApiService; private ExternalClerkRelatedApiService externalClerkRelatedApiService;
@Autowired @Autowired
private QywxUserApiService qywxUserApiService; private QywxUserApiService qywxUserApiService;
@Autowired
private GroupSendOperateApiService groupSendOperateApiService;
private static final String QYWX_TAG_OPRN_KEY = "qywx-tag-open"; private static final String QYWX_TAG_OPRN_KEY = "qywx-tag-open";
private static final String QYWX_TAG_OPRN_KEY_LOCK = "qywx-tag-open-lock"; private static final String QYWX_TAG_OPRN_KEY_LOCK = "qywx-tag-open-lock";
...@@ -392,4 +395,20 @@ public class EnterpriseController extends WebBaseController { ...@@ -392,4 +395,20 @@ public class EnterpriseController extends WebBaseController {
} }
} }
/**
* desc: 发送群发
*
* @param wxEnterpriseId 微信企业id
* @param content 文本内容
* @return : {@link HaobanResponse}
* @author : YongEn
* @date : 2022/2/17
*/
@RequestMapping("/send-mass")
public HaobanResponse sendMass(String wxEnterpriseId, String content) {
// 异步调用
groupSendOperateApiService.sendMbrFriendRelationMassBefore(wxEnterpriseId, content);
return resultResponse(HaoBanErrCode.ERR_1);
}
} }
...@@ -66,5 +66,6 @@ ...@@ -66,5 +66,6 @@
<dubbo:reference interface="com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService" <dubbo:reference interface="com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService"
id="externalClerkRelatedApiService"/> id="externalClerkRelatedApiService"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxUserApiService" id="qywxUserApiService"/> <dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxUserApiService" id="qywxUserApiService"/>
<dubbo:reference interface="com.gic.haoban.task.manage.api.service.GroupSendOperateApiService" id="groupSendOperateApiService" async="true"/>
</beans> </beans>
package com.gic.haoban.manage.service.mq;
import com.gic.haoban.manage.api.service.mq.MemberUnionRelateConsumer;
import com.gic.haoban.manage.service.mq.processor.AddMemberUnionRelateConsumerProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* desc:微信会员消费服务实现
*
* @author: YongEn
* @date: 2022/2/16
**/
@Service
public class MemberUnionRelateConsumerImpl implements MemberUnionRelateConsumer {
@Autowired
private AddMemberUnionRelateConsumerProcessor addMemberUnionRelateConsumerProcessor;
@Override
public void addMemberUnionRelate(String messageParam) {
addMemberUnionRelateConsumerProcessor.process(messageParam);
}
}
package com.gic.haoban.manage.service.mq.processor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* desc:处理器
*
* @author: YongEn
* @date: 2022/2/16
**/
public abstract class AbstractConsumerProcessor<S, R> {
private static final Logger logger = LoggerFactory.getLogger(AbstractConsumerProcessor.class);
public void process(S messageParam) {
logger.info("接收到消费处理, 参数{}", messageParam);
// 参数解析
R r = paramParse(messageParam);
// 执行处理
doProcess(r);
}
/**
* desc: 参数解析
*
* @param s 原数据
* @return : {@link R}
* @author : YongEn
* @date : 2022/2/16
*/
abstract R paramParse(S s);
/**
* desc: 执行处理
*
* @param r 解析参数
* @return :
* @author : YongEn
* @date : 2022/2/16
*/
abstract void doProcess(R r);
}
package com.gic.haoban.manage.service.pojo.bo;
import java.io.Serializable;
/**
* desc:微信好友关联bo
*
* @author: YongEn
* @date: 2022/2/16
**/
public class MemberUnionRelatedBO implements Serializable {
private static final long serialVersionUID = 5596803679651418366L;
private String corpid;
private String wxEnterpriseId;
private String externalUserid;
private String wxUserId;
private String secret;
private String staffId;
private String content;
public String getCorpid() {
return corpid;
}
public void setCorpid(String corpid) {
this.corpid = corpid;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getExternalUserid() {
return externalUserid;
}
public void setExternalUserid(String externalUserid) {
this.externalUserid = externalUserid;
}
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
...@@ -99,6 +99,9 @@ ...@@ -99,6 +99,9 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.out.WelcomeApiService" <dubbo:service interface="com.gic.haoban.manage.api.service.out.WelcomeApiService"
ref="welcomeApiServiceImpl" timeout="10000"/> ref="welcomeApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.mq.MemberUnionRelateConsumer"
ref="memberUnionRelateConsumerImpl" timeout="10000"/>
<dubbo:reference interface="com.gic.enterprise.api.service.DepartmentService" id="gicDepartmentService"/> <dubbo:reference interface="com.gic.enterprise.api.service.DepartmentService" id="gicDepartmentService"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxDepartmentApiService" <dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxDepartmentApiService"
id="qywxDepartmentApiService"/> id="qywxDepartmentApiService"/>
......
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