Commit 01e42273 authored by 廖旭伟's avatar 廖旭伟

事项预览次数接口,事项材料本地新增后自动转换图片

parent 0445dac9
......@@ -6,6 +6,7 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.xhx.common.utils.HttpDownloadUtil;
import com.mortals.xhx.common.utils.StringUtils;
import com.mortals.xhx.common.utils.WordUtil;
import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import com.mortals.xhx.module.matter.model.MatterDatumFileEntity;
......@@ -73,6 +74,9 @@ public class MatterDatumConvertTaskImpl implements ITaskExcuteService {
String prePath = "file/preview/";
String savePath = "file/uploadfile/";
for(MatterDatumFileEntity datumFileEntity:datumFileEntityList){
if(StringUtils.isEmpty(datumFileEntity.getFileUrl())||StringUtils.isNotEmpty(datumFileEntity.getLocalFileUrl())){
continue;
}
String fileName = datumFileEntity.getFileName();
String fileUrl = datumFileEntity.getFileUrl();
try {
......
......@@ -49,7 +49,15 @@ public class MatterDatumFileServiceImpl extends AbstractCRUDServiceImpl<MatterDa
String savePath = entity.getLocalFileUrl();
String newName = genPreviewPath(rootPath, prePath, savePath);
entity.setPreviewUrl(prePath+newName);
}
protected void updateBefore(MatterDatumFileEntity entity, com.mortals.framework.model.Context context) throws AppException {
this.validData(entity, context);
String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/";
String prePath = "file/preview/";
String savePath = entity.getLocalFileUrl();
String newName = genPreviewPath(rootPath, prePath, savePath);
entity.setPreviewUrl(prePath+newName);
}
private String genPreviewPath(String rootPath, String prePath, String tempPath) {
......
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