Commit c36cd5de by Hayreal

sop触达中心-执行sop企微任务

1 parent 4acdec5a
...@@ -13,6 +13,10 @@ public class AttContent implements Serializable { ...@@ -13,6 +13,10 @@ public class AttContent implements Serializable {
@Schema(name = "mediaId", description = "企微素材ID(不用传,用于保存企微返回数据)") @Schema(name = "mediaId", description = "企微素材ID(不用传,用于保存企微返回数据)")
private String mediaId; private String mediaId;
@JsonProperty("thumbMediaId")
@Schema(name = "thumbMediaId", description = "企微素材视频封面ID(不用传,用于保存企微返回数据)")
private String thumbMediaId;
@JsonProperty("attType") @JsonProperty("attType")
@Schema(name = "attType", description = "文本类型:1.文本 2.图片 3.视频 4.小程序 5.文件 6.URI") @Schema(name = "attType", description = "文本类型:1.文本 2.图片 3.视频 4.小程序 5.文件 6.URI")
private Integer attType; private Integer attType;
...@@ -20,4 +24,8 @@ public class AttContent implements Serializable { ...@@ -20,4 +24,8 @@ public class AttContent implements Serializable {
@JsonProperty("attContent") @JsonProperty("attContent")
@Schema(name = "attContent", description = "文本内容 attType=4时传小程序参数") @Schema(name = "attContent", description = "文本内容 attType=4时传小程序参数")
private String attContent; private String attContent;
@JsonProperty("firstOfVideo")
@Schema(name = "firstOfVideo", description = "视频封面 attType=3时传视频封面图片地址")
private String firstOfVideo;
} }
...@@ -154,6 +154,10 @@ public class ExecuteTaskService { ...@@ -154,6 +154,10 @@ public class ExecuteTaskService {
throw new AdminException(ResultEnum.UPLOAD_MEDIA_FAIL); throw new AdminException(ResultEnum.UPLOAD_MEDIA_FAIL);
} }
attContent.setMediaId(mediaId); attContent.setMediaId(mediaId);
if (attType.equals(VEDIO)){
String firstOfVideoMediaId = workWechatService.uploadMediaGetMediaId(workWechatDTO);
attContent.setThumbMediaId(firstOfVideoMediaId);
}
} }
return contentList; return contentList;
} }
...@@ -194,7 +198,6 @@ public class ExecuteTaskService { ...@@ -194,7 +198,6 @@ public class ExecuteTaskService {
// 授权商户号 // 授权商户号
sendWorkDTO.setMerchantId(request.getSupMerchantNo()); sendWorkDTO.setMerchantId(request.getSupMerchantNo());
try { try {
log.info("朋友圈参数详情:{}", JSONObject.toJSONString(sendWorkDTO));
RopResponseDTO<AddWorkWechatMomentTaskResponseDTO> sendResponse = workWechatService.addMomentTask(sendWorkDTO); RopResponseDTO<AddWorkWechatMomentTaskResponseDTO> sendResponse = workWechatService.addMomentTask(sendWorkDTO);
log.info("send qy wechatmoment sendResult:{}", JSONObject.toJSONString(JSONObject.toJSONString(sendResponse))); log.info("send qy wechatmoment sendResult:{}", JSONObject.toJSONString(JSONObject.toJSONString(sendResponse)));
ExecuteSopTaskResponse result = new ExecuteSopTaskResponse(); ExecuteSopTaskResponse result = new ExecuteSopTaskResponse();
......
...@@ -27,7 +27,7 @@ public class ExecuteTaskServiceTest extends BaseTest { ...@@ -27,7 +27,7 @@ public class ExecuteTaskServiceTest extends BaseTest {
List<AttContent> list = new ArrayList<>(); List<AttContent> list = new ArrayList<>();
AttContent contentImage = new AttContent(); AttContent contentImage = new AttContent();
contentImage.setAttContent("https://wx.glsx.com.cn/upload/biz/24dba7b5-33cc-4735-b8ae-e9f31ca124af.jpg"); contentImage.setAttContent("http://img01.glsx.com.cn/upload/biz/dracMini-qy-10004.png");
contentImage.setAttType(DracConstant.AttType.IMAGE); contentImage.setAttType(DracConstant.AttType.IMAGE);
list.add(contentImage); list.add(contentImage);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!