Commit 699bfd2f by Hayreal

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

1 parent 95f0899e
......@@ -140,16 +140,12 @@ public class ExecuteTaskService {
for (AttContent attContent : contentList) {
UpLoadMediaToWorkWechatRequestDTO workWechatDTO = new UpLoadMediaToWorkWechatRequestDTO();
Integer attType = attContent.getAttType();
if (attType.equals(TEXT) || attType.equals(FILE)) {
workWechatDTO.setContent(attContent.getAttContent());
continue;
} else if (attType.equals(URI)) {
if (attType.equals(URI)) {
// 构建短链
workWechatDTO.setContent(buildShortURL(attContent.getAttContent()));
continue;
} else {
JSONObject attContentJSON = JSONObject.parseObject(attContent.getAttContent());
workWechatDTO.setContent(attContentJSON.get("pic_url").toString());
workWechatDTO.setContent(attContent.getAttContent());
}
workWechatDTO.setMerchantId(merchantId);
workWechatDTO.setAttType(attType);
......@@ -168,7 +164,7 @@ public class ExecuteTaskService {
*/
public String buildShortURL(String attContent) {
GenerateUrlRequest request = new GenerateUrlRequest();
request.setUrl(JSONObject.parseObject(attContent).get("url").toString());
request.setUrl(attContent);
return shortUrlService.generate(request);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!