Commit c3a04ba0 by 徐高华

朋友拉数据换成异步+区经换绑

parent d5c2d7a0
...@@ -603,6 +603,9 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -603,6 +603,9 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
@Override @Override
public void getQwPublishData(Long planId, String cursor) { public void getQwPublishData(Long planId, String cursor) {
if(null == cursor) {
logger.info("获取企微朋友执行情况={}", planId);
}
TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(planId) ; TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(planId) ;
String momentId = plan.getMomentId() ; String momentId = plan.getMomentId() ;
if(StringUtils.isBlank(momentId)) { if(StringUtils.isBlank(momentId)) {
...@@ -654,10 +657,16 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -654,10 +657,16 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
// 是否完成 // 是否完成
if(params.equals("1")) { if(params.equals("1")) {
List<Long> planIdList = this.qwMomentPlanMapper.listForData(1) ; List<Long> planIdList = this.qwMomentPlanMapper.listForData(1) ;
logger.info("朋友圈-定时1-{}",planIdList);
if(CollectionUtils.isNotEmpty(planIdList)) { if(CollectionUtils.isNotEmpty(planIdList)) {
for(Long planId : planIdList) { for(Long planId : planIdList) {
try{ try{
this.getQwPublishData(planId,null) ; CommonMQDTO mq = new CommonMQDTO() ;
mq.setType(9) ;
Map<String,String> map = new HashMap<>() ;
map.put("planId",planId+"") ;
mq.setParams(map);
this.haobanCommonMQApiService.putCommonDelayMessage(mq, 10);
}catch (Exception e) { }catch (Exception e) {
logger.info("异常",e); logger.info("异常",e);
} }
...@@ -668,10 +677,20 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -668,10 +677,20 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
// 评论数据 // 评论数据
if(params.equals("2")) { if(params.equals("2")) {
List<Long> planIdList = this.qwMomentPlanMapper.listForData(2) ; List<Long> planIdList = this.qwMomentPlanMapper.listForData(2) ;
logger.info("朋友圈-定时2-{}",planIdList);
if(CollectionUtils.isNotEmpty(planIdList)) { if(CollectionUtils.isNotEmpty(planIdList)) {
for(Long planId : planIdList) { for(Long planId : planIdList) {
try { try {
this.getQwData(planId); try{
CommonMQDTO mq = new CommonMQDTO() ;
mq.setType(10) ;
Map<String,String> map = new HashMap<>() ;
map.put("planId",planId+"") ;
mq.setParams(map);
this.haobanCommonMQApiService.putCommonDelayMessage(mq, 10);
}catch (Exception e) {
logger.info("异常",e);
}
}catch (Exception e) { }catch (Exception e) {
logger.info("异常",e); logger.info("异常",e);
} }
......
...@@ -170,6 +170,14 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService { ...@@ -170,6 +170,14 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
Long qwPlanId = Long.valueOf(map.get("planId")) ; Long qwPlanId = Long.valueOf(map.get("planId")) ;
this.qwMomentPlanService.sendRetry(qwPlanId); this.qwMomentPlanService.sendRetry(qwPlanId);
break; break;
case 9 :
Long planId9 = Long.valueOf(map.get("planId")) ;
this.qwMomentPlanService.getQwPublishData(planId9,null);
break;
case 10 :
Long planId10 = Long.valueOf(map.get("planId")) ;
this.qwMomentPlanService.getQwData(planId10);
break;
default: default:
break; break;
} }
......
...@@ -354,7 +354,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -354,7 +354,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
StaffClerkRelationDTO staffClerkRelationDTO = staffClerkRelationService.getByClerkId(clerkId, wxEnterpriseId); StaffClerkRelationDTO staffClerkRelationDTO = staffClerkRelationService.getByClerkId(clerkId, wxEnterpriseId);
if (staffClerkRelationDTO != null) { if (staffClerkRelationDTO != null) {
return ServiceResponse.failure("3", "该导购已经被绑定,不允许绑定"); // return ServiceResponse.failure("3", "该导购已经被绑定,不允许绑定");
this.unbindByStaffAndClerkId("-1", clerkId, ChannelCodeEnum.AUDIT_UNBIND.getCode(),staffClerkRelationDTO.getWxEnterpriseId());
} }
return ServiceResponse.success(); return ServiceResponse.success();
} }
......
...@@ -22,8 +22,11 @@ import com.gic.haoban.manage.service.service.content.impl.GroupMessageServiceImp ...@@ -22,8 +22,11 @@ import com.gic.haoban.manage.service.service.content.impl.GroupMessageServiceImp
import com.gic.haoban.manage.service.service.moment.QwMomentPlanService; import com.gic.haoban.manage.service.service.moment.QwMomentPlanService;
import com.gic.wechat.api.dto.qdto.group.QywxMomentInfoQDTO; import com.gic.wechat.api.dto.qdto.group.QywxMomentInfoQDTO;
import com.gic.wechat.api.dto.qywx.group.QywxMomentRespDTO; import com.gic.wechat.api.dto.qywx.group.QywxMomentRespDTO;
import com.gic.wechat.api.dto.qywx.moment.MomentResultDTO;
import com.gic.wechat.api.dto.qywx.response.QywxTransferCustomerDTO;
import com.gic.wechat.api.service.qywx.QywxExternalUserService; import com.gic.wechat.api.service.qywx.QywxExternalUserService;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
...@@ -53,14 +56,38 @@ public class MomentTest { ...@@ -53,14 +56,38 @@ public class MomentTest {
private QwMomentPlanMapper qwMomentPlanMapper ; private QwMomentPlanMapper qwMomentPlanMapper ;
@Autowired @Autowired
private QwMomentPlanAttendMapper qwMomentPlanAttendMapper ; private QwMomentPlanAttendMapper qwMomentPlanAttendMapper ;
@Autowired
private QywxUserApiService qywxUserApiService ;
@Test
public void jc() {
String wxEnterpriseId = "d0a9e3cd351e4c26a526082a8c210f03";
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
String wxUserId = "JF10105";
String takeoverUserId = "JF10884";
List<String> list = new ArrayList<>();
list.add("wmEalNBwAANkqRWoKYqbMhlIxwpvTV0g");
QywxTransferCustomerDTO transferCustomerResp = qywxUserApiService.transferCustomer(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), wxUserId, takeoverUserId, list,qwDTO.isSelf(),qwDTO.getUrlHost());
System.out.println(JSONObject.toJSONString(transferCustomerResp));
}
@Test
public void ok() {
SendResultQDTO plan = new SendResultQDTO() ;
plan.setWxEnterpriseId("6d52f722471343eeb7fbed87994cbdf8");
plan.setClerkId("1664331543ab49769ad5ccfb6dc7986c");
plan.setSendTime(DateUtil.strToDate("2025-05-13 18:31:00","yyyy-MM-dd HH:mm:ss"));
plan.setStaffId("e35fe570efe44201beb3381f1e50f07e");
plan.setPlanId(795415784309457024L);
this.qwMomentApiService.finishTask(plan) ;
}
@Test @Test
public void sendToQw() { public void sendToQw() {
Long id = 792759787778540646L ; Long id = 792759787778540646L ;
TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(id) ; TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(id) ;
this.qwMomentPlanService.sendToQiwei(plan); // this.qwMomentPlanService.sendToQiwei(plan);
} }
...@@ -108,8 +135,8 @@ public class MomentTest { ...@@ -108,8 +135,8 @@ public class MomentTest {
@Test @Test
public void getmomentid() { public void getmomentid() {
String wxEnterpriseId = "ca66a01b79474c40b3e7c7f93daf1a3b"; String wxEnterpriseId = "d4210ec4393d4be9b75b79f7e4db4287";
String jobId = "kyy1q5PYkElEGL6BISXVKkKZPD-Lpq76iGKEn8Z1nU4OBh9487Ni70dA638plHpD"; String jobId = "PpJSQQbEj2idWBfdPk0s8qL4RZiXOcFryhsozrorxtf_S0iGF2a2bCN0LzSBj8er";
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId); WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
ServiceResponse<Object> resp2 = this.qywxExternalUserService.getMomentTaskResult(qwDTO.getThirdCorpid(), ServiceResponse<Object> resp2 = this.qywxExternalUserService.getMomentTaskResult(qwDTO.getThirdCorpid(),
qwDTO.getSelf3thSecret(), jobId, qwDTO.isSelf(),qwDTO.getUrlHost()) ; qwDTO.getSelf3thSecret(), jobId, qwDTO.isSelf(),qwDTO.getUrlHost()) ;
...@@ -119,10 +146,9 @@ public class MomentTest { ...@@ -119,10 +146,9 @@ public class MomentTest {
@Test @Test
public void data() { public void data() {
Long planId = 773211358316478465L ; Long planId = 801500314782997092L ;
// this.qwMomentPlanService.getQwData(planId); //this.qwMomentPlanService.getQwPublishData(planId,null);
this.qwMomentPlanService.getQwData(planId) ;
this.qwMomentPlanService.getQwPublishData(planId,null);
} }
......
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