Commit f2b1018c by 徐高华

群发

parent 4f958fc0
......@@ -194,19 +194,22 @@ public class MaterialServiceImpl implements MaterialService {
}else {
jp = qywxSuiteApiService.uploadMedia(qwDTO.getThirdCorpid(), config.getWxSuiteid(), CommonUtil.getFileByte(url), arr[count - 1], fileType.getCode());
}
String mediaid = old.getMediaId();
if (jp.getErrorCode() == 0) {
if(from==1) {
old.setWxLastUploadTime(new Date());
old.setMediaId(jp.getResult().toString());
mediaid = old.getMediaId() ;
this.edit(old);
}
if(from==2) {
entity.setWxLastUploadTime(new Date());
entity.setMediaId(jp.getResult().toString());
mediaid = entity.getMediaId() ;
this.materialContentMapper.updateByPrimaryKey(entity) ;
}
}
return old.getMediaId();
return mediaid;
}
}
......@@ -111,11 +111,12 @@ public class QywxSendServiceImpl implements QywxSendService {
// 调接口执行创建群发
JSONResponse respon = qywxSuiteApiService.sendExternalMessage(qwDTO.getThirdCorpid(), config.getWxSuiteid(),
messageDTO);
log.info("群发消息={},返回={}", JSON.toJSONString(messageDTO), JSON.toJSONString(respon));
String error = respon.getErrorMessage() ;
Map<String, Object> returnMap = respon.getReturnMap();
String msgIdKey = "msgid";
String msgId = returnMap.get(msgIdKey) == null ? "" : returnMap.get(msgIdKey).toString();
if (StringUtils.isEmpty(msgId)) {
if (StringUtils.isNotEmpty(msgId)) {
return ServiceResponse.success(msgId);
}
return ServiceResponse.failure("9999", error);
......
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