|
@@ -3,7 +3,6 @@ package com.tzld.piaoquan.growth.common.service.Impl;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
|
|
|
-import com.tzld.piaoquan.growth.common.common.constant.MessageConstant;
|
|
|
import com.tzld.piaoquan.growth.common.common.enums.ExceptionCodeEnum;
|
|
|
import com.tzld.piaoquan.growth.common.common.enums.MessageAttachmentTypeEnum;
|
|
|
import com.tzld.piaoquan.growth.common.common.exception.CustomizeException;
|
|
@@ -16,12 +15,14 @@ import com.tzld.piaoquan.growth.common.model.bo.VideoDetail;
|
|
|
import com.tzld.piaoquan.growth.common.model.bo.VideoParam;
|
|
|
import com.tzld.piaoquan.growth.common.model.po.*;
|
|
|
import com.tzld.piaoquan.growth.common.model.vo.GuaranteedParam;
|
|
|
-import com.tzld.piaoquan.growth.common.service.WeComAccessTokenService;
|
|
|
import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
|
|
|
+import com.tzld.piaoquan.growth.common.service.WeComAccessTokenService;
|
|
|
import com.tzld.piaoquan.growth.common.service.WeComSendService;
|
|
|
-import com.tzld.piaoquan.growth.common.utils.*;
|
|
|
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
|
|
|
+import com.tzld.piaoquan.growth.common.utils.FileUtils;
|
|
|
+import com.tzld.piaoquan.growth.common.utils.ImageUrlValidator;
|
|
|
+import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import lombok.val;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -36,7 +37,6 @@ import java.io.InputStream;
|
|
|
import java.io.OutputStream;
|
|
|
import java.net.HttpURLConnection;
|
|
|
import java.net.URL;
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
import java.nio.file.Files;
|
|
|
import java.nio.file.Paths;
|
|
|
import java.util.*;
|
|
@@ -388,31 +388,31 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public String getPage(Staff staff, Long videoId) {
|
|
|
+ public String getPage(Staff staff, Long videoId, String typeOne, String typeTwo) {
|
|
|
try {
|
|
|
if (staff == null || staff.getCarrierId() == null) {
|
|
|
return "";
|
|
|
}
|
|
|
- String page = selectPage(videoId, staff.getCarrierId(), "企微", "日常推送");
|
|
|
+ String page = selectPage(videoId, staff.getCarrierId(), typeOne, typeTwo);
|
|
|
if (StringUtils.isNotEmpty(page)) {
|
|
|
return page;
|
|
|
}
|
|
|
- return insertPage(staff.getCarrierId(), videoId, staff.getRemark());
|
|
|
+ return insertPage(staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo);
|
|
|
} catch (IOException e) {
|
|
|
log.error("MessageAttachmentService getPage error", e);
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- private String insertPage(String carrierId, Long videoId, String remark) throws IOException {
|
|
|
+ private String insertPage(String carrierId, Long videoId, String remark, String typeOne, String typeTwo) throws IOException {
|
|
|
AdPutFlowParam param = new AdPutFlowParam();
|
|
|
param.setChannel("tencentqw");
|
|
|
param.setPath("pages/category.html");
|
|
|
param.setPutCarrierId(carrierId);
|
|
|
param.setPutScene("touliu");
|
|
|
param.setPutStartDate(DateUtil.getDayDateString("yyyy-MM-dd"));
|
|
|
- param.setPutTypeOne("企微");
|
|
|
- param.setPutTypeTwo("日常推送");
|
|
|
+ param.setPutTypeOne(typeOne);
|
|
|
+ param.setPutTypeTwo(typeTwo);
|
|
|
param.setPutTypeThree("位置X");
|
|
|
param.setRemark(remark);
|
|
|
param.setVideoId(videoId);
|