Commit 0b92514b by qwmqiuwenmin

fix

parent c492e5e4
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.service.out.impl;
import java.io.InputStream;
import java.net.URL;
import java.util.Date;
import java.util.List;
import org.apache.commons.io.IOUtils;
......@@ -123,6 +124,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){
materialDTO.setWxLastUploadTime(new Date());
materialDTO.setMediaId(jp.getResult().toString());
materialService.insertMaterial(materialDTO);
}
......@@ -170,6 +172,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){
materialDTO.setWxLastUploadTime(new Date());
materialDTO.setMediaId(jp.getResult().toString());
materialService.edit(materialDTO);
}
......@@ -208,6 +211,7 @@ public class MaterialApiServiceImpl implements MaterialApiService {
}
JSONResponse jp = qywxSuiteApiService.uploadMedia(enterprise.getCorpid(), config.getWxSuiteid(), getFileByte(url), fileType.getCode());
if(jp.getErrorCode() == 0){
old.setWxLastUploadTime(new Date());
old.setMediaId(jp.getResult().toString());
materialService.edit(old);
}
......
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