Commit f653cc94 by 徐高华

朋友圈

parent fc879677
...@@ -11,6 +11,7 @@ public enum PendingTaskTypeEnum { ...@@ -11,6 +11,7 @@ public enum PendingTaskTypeEnum {
GROUP_TASK(3, "客户群发", "您收到了新的企微群发任务【{}】,赶紧到企业微信-消息-群发助手中执行吧~"), GROUP_TASK(3, "客户群发", "您收到了新的企微群发任务【{}】,赶紧到企业微信-消息-群发助手中执行吧~"),
ACTIVITY(4, "活动", "您报名的{}活动已经开始啦,快去转发赚佣金吧~"), ACTIVITY(4, "活动", "您报名的{}活动已经开始啦,快去转发赚佣金吧~"),
GROUP_CHAT(5, "社群群发", "您收到了新的社群群发任务【{}】,赶紧到企业微信-消息-群发助手中执行吧~"), GROUP_CHAT(5, "社群群发", "您收到了新的社群群发任务【{}】,赶紧到企业微信-消息-群发助手中执行吧~"),
QYWX_MOMENT(6, "企微朋友圈", "您收到了新的企微朋友圈发布任务【{}】,快去执行吧~"),
; ;
private int type; private int type;
private String name; private String name;
......
...@@ -149,7 +149,7 @@ public class MaterialServiceImpl implements MaterialService { ...@@ -149,7 +149,7 @@ public class MaterialServiceImpl implements MaterialService {
Integer materialType = materialDTO.getMaterialType(); Integer materialType = materialDTO.getMaterialType();
String madiaId = materialDTO.getMediaId(); String madiaId = materialDTO.getMediaId();
//需要上传的类型 //需要上传的类型
List<Integer> typeList = Arrays.asList(2, 4, 5, 6 , 7); List<Integer> typeList = Arrays.asList(2, 3, 4, 5, 6 , 7);
if (typeList.contains(materialType)) { if (typeList.contains(materialType)) {
madiaId = this.reUpdalodMetail(materialId,from); madiaId = this.reUpdalodMetail(materialId,from);
} }
...@@ -202,6 +202,10 @@ public class MaterialServiceImpl implements MaterialService { ...@@ -202,6 +202,10 @@ public class MaterialServiceImpl implements MaterialService {
fileType = QywxMediaTypeEnum.IMAGE; fileType = QywxMediaTypeEnum.IMAGE;
url = old.getImgUrl(); url = old.getImgUrl();
} }
if (type ==3) {
fileType = QywxMediaTypeEnum.IMAGE;
url = old.getImgUrl();
}
if (type == 4) { if (type == 4) {
fileType = QywxMediaTypeEnum.VIDEO; fileType = QywxMediaTypeEnum.VIDEO;
url = old.getLink(); url = old.getLink();
......
...@@ -235,6 +235,7 @@ public class QywxSendServiceImpl implements QywxSendService { ...@@ -235,6 +235,7 @@ public class QywxSendServiceImpl implements QywxSendService {
} }
linkMaterialDTO.setDesc(material.getMaterialDesc()); linkMaterialDTO.setDesc(material.getMaterialDesc());
linkMaterialDTO.setUrl(material.getLink()); linkMaterialDTO.setUrl(material.getLink());
linkMaterialDTO.setMedia_id(maerialId);
dto.setMsgType(QywxMediaTypeEnum.LINK.getName()); dto.setMsgType(QywxMediaTypeEnum.LINK.getName());
dto.setLink(linkMaterialDTO); dto.setLink(linkMaterialDTO);
} else if (materialType == 4) { } else if (materialType == 4) {
......
...@@ -7,6 +7,7 @@ import com.gic.haoban.manage.api.dto.moment.QwMomentPlanWxaDTO; ...@@ -7,6 +7,7 @@ import com.gic.haoban.manage.api.dto.moment.QwMomentPlanWxaDTO;
import com.gic.haoban.manage.api.qdto.moment.PlanListWxaQDTO; 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.QwMomentPlanQDTO;
import com.gic.haoban.manage.api.qdto.moment.TaskNumQDTO; import com.gic.haoban.manage.api.qdto.moment.TaskNumQDTO;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlan;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend; import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend;
public interface QwMomentPlanService { public interface QwMomentPlanService {
...@@ -40,4 +41,7 @@ public interface QwMomentPlanService { ...@@ -40,4 +41,7 @@ public interface QwMomentPlanService {
void getMomentId(Long planId) ; void getMomentId(Long planId) ;
void sendToQiwei(TabQwMomentPlan plan) ;
} }
...@@ -20,7 +20,9 @@ import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO; ...@@ -20,7 +20,9 @@ import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO; import com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanDTO; import com.gic.haoban.manage.api.dto.moment.QwMomentPlanDTO;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanWxaDTO; import com.gic.haoban.manage.api.dto.moment.QwMomentPlanWxaDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.PendingTaskQDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum; import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.enums.PendingTaskTypeEnum;
import com.gic.haoban.manage.api.qdto.moment.PlanListWxaQDTO; 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.QwMomentPlanQDTO;
import com.gic.haoban.manage.api.qdto.moment.TaskNumQDTO; import com.gic.haoban.manage.api.qdto.moment.TaskNumQDTO;
...@@ -34,12 +36,14 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaff; ...@@ -34,12 +36,14 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlan; import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlan;
import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend; import com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend;
import com.gic.haoban.manage.service.pojo.ClerkStaffBO; import com.gic.haoban.manage.service.pojo.ClerkStaffBO;
import com.gic.haoban.manage.service.pojo.bo.PendingTaskBO;
import com.gic.haoban.manage.service.pojo.bo.moment.CountBO; import com.gic.haoban.manage.service.pojo.bo.moment.CountBO;
import com.gic.haoban.manage.service.service.QywxSendService; import com.gic.haoban.manage.service.service.QywxSendService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService; import com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanDataService; import com.gic.haoban.manage.service.service.moment.QwMomentPlanDataService;
import com.gic.haoban.manage.service.service.moment.QwMomentPlanService; import com.gic.haoban.manage.service.service.moment.QwMomentPlanService;
import com.gic.haoban.manage.service.service.notify.PendingTaskService;
import com.gic.mq.sdk.GicMQClient; import com.gic.mq.sdk.GicMQClient;
import com.gic.quartz.api.dto.QuartzTaskDTO; import com.gic.quartz.api.dto.QuartzTaskDTO;
import com.gic.quartz.api.service.QuartzService; import com.gic.quartz.api.service.QuartzService;
...@@ -92,6 +96,8 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -92,6 +96,8 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
private QwMomentPlanDataService qwMomentPlanDataService ; private QwMomentPlanDataService qwMomentPlanDataService ;
@Autowired @Autowired
private HaobanCommonMQApiService haobanCommonMQApiService ; private HaobanCommonMQApiService haobanCommonMQApiService ;
@Autowired
private PendingTaskService pendingTaskService ;
private static GicMQClient mqClient = GICMQClientUtil.getClientInstance(); private static GicMQClient mqClient = GICMQClientUtil.getClientInstance();
...@@ -359,12 +365,13 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -359,12 +365,13 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
private void sendPlanNotice(TabQwMomentPlan plan) { private void sendPlanNotice(TabQwMomentPlan plan) {
if(plan.getPublishType()==1 || plan.getPublishTime().getTime() <= System.currentTimeMillis()) { if(plan.getPublishType()==1 || plan.getPublishTime().getTime() <= System.currentTimeMillis()) {
long planId = plan.getPlanId(); long planId = plan.getPlanId();
// 好办小程序
if(plan.getExecType()==1) { if(plan.getExecType()==1) {
// 好办小程序
List<QwMomentPlanAttendDTO> list = this.qwMomentPlanAttendMapper.listClerk(planId , 1); List<QwMomentPlanAttendDTO> list = this.qwMomentPlanAttendMapper.listClerk(planId , 1);
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
for (QwMomentPlanAttendDTO dto : list) { for (QwMomentPlanAttendDTO dto : list) {
this.sendTaskToClerk(dto.getClerkId(),plan); this.sendTaskToClerk(dto.getClerkId(),plan);
this.addPendingTask(plan,dto.getStoreId(),dto.getClerkId()) ;
} }
} }
}else { }else {
...@@ -374,7 +381,8 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -374,7 +381,8 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
} }
} }
private void sendToQiwei(TabQwMomentPlan plan) { @Override
public void sendToQiwei(TabQwMomentPlan plan) {
List<ContentMaterialDTO> imageList = new ArrayList<>() ; List<ContentMaterialDTO> imageList = new ArrayList<>() ;
String json = plan.getMediaInfo() ; String json = plan.getMediaInfo() ;
JSONArray arr = JSONArray.parseArray(json) ; JSONArray arr = JSONArray.parseArray(json) ;
...@@ -411,6 +419,9 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -411,6 +419,9 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
logger.info("朋友圈调用企微失败={}",plan.getPlanId()); logger.info("朋友圈调用企微失败={}",plan.getPlanId());
return; return;
} }
for (QwMomentPlanAttendDTO dto : clerkList) {
this.addPendingTask(plan,dto.getStoreId(),dto.getClerkId()) ;
}
this.qwMomentPlanMapper.updateJobid(plan.getPlanId(),jobId) ; this.qwMomentPlanMapper.updateJobid(plan.getPlanId(),jobId) ;
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(plan.getWxEnterpriseId()); WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(plan.getWxEnterpriseId());
ServiceResponse<Object> resp2 = this.qywxExternalUserService.getMomentTaskResult(qwDTO.getThirdCorpid(), ServiceResponse<Object> resp2 = this.qywxExternalUserService.getMomentTaskResult(qwDTO.getThirdCorpid(),
...@@ -504,4 +515,19 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -504,4 +515,19 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
return dto ; return dto ;
} }
private void addPendingTask(TabQwMomentPlan plan , String storeId , String clerkId ) {
PendingTaskBO bo = new PendingTaskBO();
bo.setRelationId(plan.getPlanId()+"");
bo.setBusinessId(plan.getPlanId()+"");
bo.setTaskType(PendingTaskTypeEnum.QYWX_MOMENT.getType());
bo.setTitle(plan.getTitle());
bo.setDescription(plan.getRemark());
bo.setStoreId(storeId);
bo.setInvalidTime(plan.getEndDate());
bo.setClerkId(clerkId);
bo.setEnterpriseId(plan.getEnterpriseId());
bo.setOverdueTime(plan.getEndDate());
this.pendingTaskService.addOrUpdatePendingTask(bo);
}
} }
...@@ -52,7 +52,7 @@ public class MomentTest { ...@@ -52,7 +52,7 @@ public class MomentTest {
@Test @Test
public void ddd() { public void ddd() {
QwMomentPlanDTO dto = new QwMomentPlanDTO() ; /* QwMomentPlanDTO dto = new QwMomentPlanDTO() ;
dto.setPublishType(1); dto.setPublishType(1);
dto.setPublishTime(new Date()); dto.setPublishTime(new Date());
dto.setWxEnterpriseId("ca66a01b79474c40b3e7c7f93daf1a3b"); dto.setWxEnterpriseId("ca66a01b79474c40b3e7c7f93daf1a3b");
...@@ -65,7 +65,11 @@ public class MomentTest { ...@@ -65,7 +65,11 @@ public class MomentTest {
// ,"b2ef17cce11f476b996d0b27ebadf7fb" // ,"b2ef17cce11f476b996d0b27ebadf7fb"
List<String> clerkIds = Arrays.asList("b2ef17cce11f476b996d0b27ebadf7fb","753a367d709d40a38b17ed25847d3b4b") ; List<String> clerkIds = Arrays.asList("b2ef17cce11f476b996d0b27ebadf7fb","753a367d709d40a38b17ed25847d3b4b") ;
dto.setSelectClerkIdList(clerkIds); dto.setSelectClerkIdList(clerkIds);
this.qwMomentApiService.save(dto) ; this.qwMomentApiService.save(dto) ;*/
Long planId = 772924621895778364L ;
TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(planId) ;
this.qwMomentPlanService.sendToQiwei(plan);
} }
......
...@@ -312,7 +312,6 @@ public class QwMomentController { ...@@ -312,7 +312,6 @@ public class QwMomentController {
}else if(vo.getEndDate().getTime() < System.currentTimeMillis()) { }else if(vo.getEndDate().getTime() < System.currentTimeMillis()) {
vo.setStatusFlag(3); vo.setStatusFlag(3);
} }
} }
} }
} }
......
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