Commit ebacd417 by 徐高华

朋友圈

parent 976483b5
......@@ -33,4 +33,7 @@ public interface QwMomentPlanService {
* @param task
*/
public void getQwData(TabQwMomentPlanAttend task) ;
void getMomentId(Long planId) ;
}
......@@ -13,6 +13,7 @@ import com.gic.enterprise.api.dto.StoreSearchDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.enterprise.api.service.StoreService;
import com.gic.enterprise.api.service.StoreWidgetService;
import com.gic.haoban.manage.api.dto.CommonMQDTO;
import com.gic.haoban.manage.api.dto.ContentMaterialDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
......@@ -23,6 +24,7 @@ import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.qdto.moment.PlanListWxaQDTO;
import com.gic.haoban.manage.api.qdto.moment.QwMomentPlanQDTO;
import com.gic.haoban.manage.api.qdto.moment.TaskNumQDTO;
import com.gic.haoban.manage.api.service.HaobanCommonMQApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
......@@ -86,6 +88,8 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
private StaffMapper staffMapper ;
@Autowired
private QwMomentPlanDataService qwMomentPlanDataService ;
@Autowired
private HaobanCommonMQApiService haobanCommonMQApiService ;
private static GicMQClient mqClient = GICMQClientUtil.getClientInstance();
......@@ -379,7 +383,8 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
logger.info("发企微朋友={}",JSONObject.toJSONString(resp));
String jobId = resp.getResult() ;
if(StringUtils.isBlank(jobId)) {
logger.info("朋友圈调用企微失败={}",plan.getPlanId());
return;
}
this.qwMomentPlanMapper.updateJobid(plan.getPlanId(),jobId) ;
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(plan.getWxEnterpriseId());
......@@ -390,7 +395,33 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
String moment_id = resp2.getResult().toString() ;
this.qwMomentPlanMapper.updateMomentId(plan.getPlanId(),moment_id);
}else {
CommonMQDTO mq = new CommonMQDTO() ;
mq.setType(6) ;
Map<String,String> map = new HashMap<>() ;
map.put("planId",plan.getPlanId()+"") ;
mq.setParams(map);
this.haobanCommonMQApiService.putCommonDelayMessage(mq, 60);
}
}
@Override
public void getMomentId(Long planId) {
TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(planId) ;
String wxEnterpriseId =plan.getWxEnterpriseId() ;
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
ServiceResponse<Object> resp2 = this.qywxExternalUserService.getMomentTaskResult(qwDTO.getThirdCorpid(),
qwDTO.getSelf3thSecret(), plan.getQwJobid(), qwDTO.isSelf(),qwDTO.getUrlHost()) ;
logger.info("获取moment_id={}",JSONObject.toJSONString(resp2));
if(null != resp2.getResult()) {
String moment_id = resp2.getResult().toString() ;
this.qwMomentPlanMapper.updateMomentId(plan.getPlanId(),moment_id);
}else {
CommonMQDTO mq = new CommonMQDTO() ;
mq.setType(6) ;
Map<String,String> map = new HashMap<>() ;
map.put("planId",plan.getPlanId()+"") ;
mq.setParams(map);
this.haobanCommonMQApiService.putCommonDelayMessage(mq, 60);
}
}
......@@ -422,4 +453,5 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
MomentResultDTO dto = resp.getResult() ;
return dto ;
}
}
......@@ -12,6 +12,7 @@ import com.gic.commons.util.StringUtil;
import com.gic.haoban.manage.api.dto.MemberUnionidWechatAccountQDTO;
import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService;
import com.gic.haoban.manage.service.service.chat.GroupChatPlanService;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanService;
import com.gic.haoban.manage.service.service.role.HaobanMenuService;
import com.gic.haoban.manage.service.util.EventUtils;
import com.gic.member.api.dto.MemberInfoChangeNotifyDTO;
......@@ -59,6 +60,8 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
private TabHaobanExternalClerkRelatedMapper externalClerkRelatedMapper ;
@Autowired
private GroupChatPlanService groupChatPlanService ;
@Autowired
private QwMomentPlanService qwMomentPlanService ;
@Override
public void putCommonMessage(CommonMQDTO dto) {
......@@ -151,6 +154,10 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
Long ownerLogId = Long.valueOf(map.get("ownerLogId")) ;
this.groupChatPlanService.doPlanSendInfo(ownerLogId);
break;
case 6 :
Long momentPlanId = Long.valueOf(map.get("planId")) ;
this.qwMomentPlanService.getMomentId(momentPlanId);
break;
default:
break;
}
......
......@@ -98,6 +98,7 @@
b.exec_type execType ,
b.begin_date startTime ,
b.end_date endTime ,
b.media_type mediaType ,
a.plan_id planId ,
a.clerk_id clerkId ,
a.clerk_name clerkName ,
......
......@@ -60,6 +60,17 @@ public class TaskDetailVO implements Serializable {
// 0已失效1待执行 2已执行
private Integer taskStatus ;
// 1内容
private Integer mediaType ;
public Integer getMediaType() {
return mediaType;
}
public void setMediaType(Integer mediaType) {
this.mediaType = mediaType;
}
public Integer getTaskStatus() {
return taskStatus;
}
......
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