Commit 632f4e93 authored by 廖旭伟's avatar 廖旭伟

单事项,辅助接件事项材料列表查询方法subList优化;材料附件下载到本地以及转换预览图片方法修改

parent f8b08c82
...@@ -3,6 +3,7 @@ import cn.hutool.core.io.FileUtil; ...@@ -3,6 +3,7 @@ import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.xhx.common.utils.HttpDownloadUtil; 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.common.utils.WordUtil;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -44,20 +45,13 @@ public class MatterDatumFileServiceImpl extends AbstractCRUDServiceImpl<MatterDa ...@@ -44,20 +45,13 @@ public class MatterDatumFileServiceImpl extends AbstractCRUDServiceImpl<MatterDa
@Override @Override
protected void saveBefore(MatterDatumFileEntity entity, com.mortals.framework.model.Context context) throws AppException { protected void saveBefore(MatterDatumFileEntity entity, com.mortals.framework.model.Context context) throws AppException {
this.validData(entity, context); this.validData(entity, context);
String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/"; if(StringUtils.isNotEmpty(entity.getLocalFileUrl())){
String prePath = "file/preview/"; String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/";
String savePath = entity.getLocalFileUrl(); String prePath = "file/preview/";
String newName = genPreviewPath(rootPath, prePath, savePath); String savePath = entity.getLocalFileUrl();
entity.setPreviewUrl(prePath+newName); 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) { 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