Commit 6db0ad80 by qwmqiuwenmin

fix

parent d0d92293
......@@ -123,10 +123,7 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if(fileType != null){
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url), fileType.getCode());
if(jp.getErrorCode() == 0){
String json = jp.getResult().toString();
logger.info("【上传文件】json={}",jp.getResult());
JSONObject jsonObject = JSON.parseObject(json);
materialDTO.setMediaId(jsonObject.getString("media_id"));
materialDTO.setMediaId(jp.getResult().toString());
materialService.insertMaterial(materialDTO);
}
}else{
......@@ -173,10 +170,7 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if(fileType != null && !url.equals(oldUrl)){
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url), fileType.getCode());
if(jp.getErrorCode() == 0){
String json = jp.getResult().toString();
logger.info("【上传文件】json={}",json);
JSONObject jsonObject = JSON.parseObject(json);
materialDTO.setMediaId(jsonObject.getString("media_id"));
materialDTO.setMediaId(jp.getResult().toString());
materialService.edit(materialDTO);
}
}else{
......@@ -214,9 +208,7 @@ public class MaterialApiServiceImpl implements MaterialApiService {
}
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url), fileType.getCode());
if(jp.getErrorCode() == 0){
String json = jp.getResult().toString();
JSONObject jsonObject = JSON.parseObject(json);
old.setMediaId(jsonObject.getString("media_id"));
old.setMediaId(jp.getResult().toString());
materialService.edit(old);
}
return old.getMediaId();
......
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