代码提交

This commit is contained in:
liang.chao 2025-09-17 15:02:28 +08:00
parent 7f8e38302a
commit 7b8c202055
4 changed files with 9 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@ -130,7 +131,7 @@ public class DaKyProFilesContentsVo {
/**
* 文件大小
*/
private String fileSize;
private BigDecimal fileSize;
/**
* 文件后缀名

View File

@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sourceFileName != null and sourceFileName != ''">source_file_name,</if>
<if test="fileName != null and fileName != ''">file_name,</if>
<if test="fileType != null and fileType != ''">file_type,</if>
<if test="fileSize != null and fileSize != ''">file_size,</if>
<if test="sourceType != null and sourceType != ''">source_type,</if>
<if test="createUserId != null">create_user_id,</if>
<if test="createUserName != null and createUserName != ''">create_user_name,</if>
@ -67,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sourceFileName != null and sourceFileName != ''">#{sourceFileName},</if>
<if test="fileName != null and fileName != ''">#{fileName},</if>
<if test="fileType != null and fileType != ''">#{fileType},</if>
<if test="fileSize != null and fileSize != ''">#{fileSize},</if>
<if test="sourceType != null and sourceType != ''">#{sourceType},</if>
<if test="createUserId != null">#{createUserId},</if>
<if test="createUserName != null and createUserName != ''">#{createUserName},</if>

View File

@ -2,6 +2,8 @@ package com.bonus.common.utils.bean;
import lombok.Data;
import java.math.BigDecimal;
/**
* @Authorliang.chao
* @Date2025/9/17 - 13:56
@ -13,7 +15,7 @@ public class FileDto {
// 文件路径
private String filePath;
// 文件大小
private String fileSize;
private BigDecimal fileSize;
// 文件类型 1.图片 2.文件
private String fileType;
// 文件后缀名

View File

@ -7,6 +7,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
@ -309,7 +310,7 @@ public class FileUtils {
String pathName = targetFile.getAbsolutePath();
bean.setFilePath(pathName);
bean.setFileName(fileName);
bean.setFileSize(file.getSize() + "");
bean.setFileSize(new BigDecimal(file.getSize()));
bean.setSuffixName(fileExtension);
return bean;
} else {