Commit 7661d54b by 徐高华

朋友圈

parent 2105c8e0
package com.gic.haoban.manage.service.service.moment.impl; package com.gic.haoban.manage.service.service.moment.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
...@@ -348,11 +349,29 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -348,11 +349,29 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
private void sendToQiwei(TabQwMomentPlan plan) { private void sendToQiwei(TabQwMomentPlan plan) {
List<ContentMaterialDTO> imageList = new ArrayList<>() ; List<ContentMaterialDTO> imageList = new ArrayList<>() ;
ContentMaterialDTO d1 = new ContentMaterialDTO(); String json = plan.getMediaInfo() ;
d1.setMaterialType(2); JSONArray arr = JSONArray.parseArray(json) ;
d1.setImgUrl("https://platform-1251519181.demogic.com/image/jhdm/common-6276714201df45ee9266d6bb8926dd30.png"); String msg = null ;
imageList.add(d1) ; for(int i=0;i<arr.size();i++) {
ServiceResponse<String> resp = this.qywxSendService.share(plan.getWxEnterpriseId(),Arrays.asList("b2ef17cce11f476b996d0b27ebadf7fb"),"朋友圈",imageList) ; JSONObject obj = arr.getJSONObject(i) ;
ContentMaterialDTO vo = new ContentMaterialDTO();
vo.setMaterialType(obj.getInteger("materialType"));
vo.setImgUrl(obj.getString("imgUrl"));
if(vo.getMaterialType()==4) {
vo.setLink(obj.getString("videoUrl"));
}
if(vo.getMaterialType()==3) {
vo.setLink(obj.getString("link"));
}
vo.setMaterialTitle(obj.getString("title"));
if(vo.getMaterialType()==1) {
msg = obj.getString("contentText") ;
continue;
}
vo.setMaterialDesc(obj.getString("contentText"));
imageList.add(vo);
}
ServiceResponse<String> resp = this.qywxSendService.share(plan.getWxEnterpriseId(),Arrays.asList("b2ef17cce11f476b996d0b27ebadf7fb"),msg,imageList) ;
logger.info("发企微朋友={}",JSONObject.toJSONString(resp)); logger.info("发企微朋友={}",JSONObject.toJSONString(resp));
String jobId = resp.getResult() ; String jobId = resp.getResult() ;
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(plan.getWxEnterpriseId()); WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(plan.getWxEnterpriseId());
......
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