企业库

This commit is contained in:
cwchen 2025-10-23 14:00:51 +08:00
parent 92693f4995
commit 4eef37d7ef
2 changed files with 4 additions and 3 deletions

View File

@ -96,7 +96,7 @@ public class CommonUploadService {
if(StringUtils.isEmpty(uploadResult)){ if(StringUtils.isEmpty(uploadResult)){
return AjaxResult.error(Constants.UPLOAD_ERROR); return AjaxResult.error(Constants.UPLOAD_ERROR);
} }
map.put("fileRes", FileUtil.getFileInfo(file,uploadPath)); map.put("fileRes", FileUtil.getFileInfo(file,uploadPath,jsonObj.getString("fileUploadType")));
return AjaxResult.success(Constants.UPLOAD_SUCCESS,map); return AjaxResult.success(Constants.UPLOAD_SUCCESS,map);
} }
@ -165,7 +165,7 @@ public class CommonUploadService {
log.error(e.toString(),e.getMessage()); log.error(e.toString(),e.getMessage());
return AjaxResult.error(Constants.UPLOAD_ERROR); return AjaxResult.error(Constants.UPLOAD_ERROR);
} }
map.put("fileRes", FileUtil.getFileInfo(file,uploadPath)); map.put("fileRes", FileUtil.getFileInfo(file,uploadPath,jsonObj.getString("fileUploadType")));
map.put("ocrResult", ocrResponse); map.put("ocrResult", ocrResponse);
return AjaxResult.success(Constants.UPLOAD_SUCCESS,map); return AjaxResult.success(Constants.UPLOAD_SUCCESS,map);
} }

View File

@ -113,7 +113,7 @@ public class FileUtil {
* @author cwchen * @author cwchen
* @date 2025/10/22 15:37 * @date 2025/10/22 15:37
*/ */
public static Map<String, Object> getFileInfo(MultipartFile file,String path) { public static Map<String, Object> getFileInfo(MultipartFile file,String path,String fileUploadType) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("filePath", path); map.put("filePath", path);
map.put("sourceFileName", file.getOriginalFilename()); map.put("sourceFileName", file.getOriginalFilename());
@ -121,6 +121,7 @@ public class FileUtil {
map.put("suffixName", getFileExtension(file.getOriginalFilename())); map.put("suffixName", getFileExtension(file.getOriginalFilename()));
map.put("fileSize", getFileSizeInMB(file)); map.put("fileSize", getFileSizeInMB(file));
map.put("fileType", isImageFile(file.getOriginalFilename()) ? "1":"2"); map.put("fileType", isImageFile(file.getOriginalFilename()) ? "1":"2");
map.put("businessType", fileUploadType);
return map; return map;
} }