Compare commits

..

No commits in common. "e24321534cebf86317bedea141c2be11dfaa5ff0" and "9e7059a08c57afc0cf5c138b0f0b8deef83aac73" have entirely different histories.

3 changed files with 18 additions and 30 deletions

View File

@ -66,14 +66,10 @@ public class UploadFileVo {
*/
private String createTime;
private String createUser;
/**
* 获取bast64文件
*/
private String bast64;
private String userName;
}

View File

@ -2,7 +2,6 @@ package com.bonus.file.service.impl;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.file.config.MinioConfig;
import com.bonus.file.mapper.FileUtilMapper;
import com.bonus.file.utils.MinioUtil;
@ -85,7 +84,6 @@ public class FileUtilsServiceImpl {
String path="/"+bucketName+"/"+filePath;
vo.setPath(path);
vo.setUrl(minioConfig.getUrl());
vo.setCreateUser(SecurityUtils.getUserId().toString());
int num=mapper.insertUploadFile(vo);
if(num>0){
return vo;
@ -138,7 +136,6 @@ public class FileUtilsServiceImpl {
String path="/"+bucketName+"/"+filePath;
vo.setPath(path);
vo.setUrl(minioConfig.getUrl());
vo.setCreateUser(SecurityUtils.getUserId().toString());
int num=mapper.insertUploadFile(vo);
if(num>0){
return vo;
@ -189,7 +186,6 @@ public class FileUtilsServiceImpl {
String path="/"+bucketName+"/"+filePath;
vo.setPath(path);
vo.setUrl(minioConfig.getUrl());
vo.setCreateUser(SecurityUtils.getUserId().toString());
list.add(vo);
}
int num=mapper.insertUploadFileList(list);
@ -246,7 +242,6 @@ public class FileUtilsServiceImpl {
String path="/"+bucketName+"/"+filePath;
vo.setPath(path);
vo.setUrl(minioConfig.getUrl());
vo.setCreateUser(SecurityUtils.getUserId().toString());
list.add(vo);
}
int num=mapper.insertUploadFileList(list);

View File

@ -7,17 +7,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--文件插入-->
<insert id="insertUploadFile" keyProperty="id" useGeneratedKeys="true">
insert into bm_files(
source_table, source_id, source_type, file_name, file_key,bucket_name, create_time, update_time, is_active, origin_file_name,file_url,file_path,create_user
)values (#{sourceTable},#{sourceId},#{sourceType},#{fileName},#{filePath},#{bucketName},now(),now(),1,#{originFileName},#{url},#{path},#{createUser})
source_table, source_id, source_type, file_name, file_key,bucket_name, create_time, update_time, is_active, origin_file_name,file_url,file_path
)values (#{sourceTable},#{sourceId},#{sourceType},#{fileName},#{filePath},#{bucketName},now(),now(),1,#{originFileName},#{url},#{path})
</insert>
<!--多文件上传-->
<insert id="insertUploadFileList" keyProperty="id" useGeneratedKeys="true">
insert into bm_files ( source_table, source_id, source_type, file_name, file_key,bucket_name, create_time,
update_time, is_active, origin_file_name,file_url,file_path,create_user
insert into bm_files ( source_table, source_id, source_type, file_name, file_key,bucket_name, create_time, update_time, is_active, origin_file_name,file_url,file_path
) values
<foreach collection="list" item="item" separator=",">
(#{item.sourceTable},#{item.sourceId},#{item.sourceType},#{item.fileName},#{item.filePath},
#{item.bucketName},now(),now(),1,#{item.originFileName},#{item.url},#{item.path},#{item.createUser})
#{item.bucketName},now(),now(),1,#{item.originFileName},#{item.url},#{item.path})
</foreach>
</insert>
<!--删除文件-->
@ -49,32 +48,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<select id="getFileList" resultType="com.bonus.system.api.model.UploadFileVo">
select file.id, file.source_table sourceTable, file.source_id sourceId, file.source_type sourceType, file.file_name fileName,
file.file_key filePath, file.bucket_name bucketName, file.create_time createTime,
file.origin_file_name originFileName, file.file_path path, file.file_url url,su.user_name userName
from bm_files file
left join sys_user su on su.user_id=file.create_user
where file.is_active=1
select id, source_table sourceTable, source_id sourceId, source_type sourceType, file_name fileName,
file_key filePath, bucket_name bucketName, create_time createTime,
origin_file_name originFileName, file_path path, file_url url
from bm_files
where is_active=1
<if test="id!=null and id!=''">
and file.id=#{id}
and id=#{id}
</if>
<if test="sourceId !=null and sourceId!=''">
and file.source_id=#{sourceId}
and source_id=#{sourceId}
</if>
<if test="sourceType !=null and sourceType!=''">
and file.source_type=#{sourceType}
and source_type=#{sourceType}
</if>
<if test="sourceTable !=null and sourceTable!=''">
and file.source_table=#{sourceTable}
and source_table=#{sourceTable}
</if>
</select>
<select id="getFileListByIds" resultType="com.bonus.system.api.model.UploadFileVo">
select file.id, file.source_table sourceTable, file.source_id sourceId, file.source_type sourceType, file.file_name fileName,
file.file_key filePath, file.bucket_name bucketName, file.create_time createTime,
file.origin_file_name originFileName, file.file_path path, file.file_url url,su.user_name userName
from bm_files file
left join sys_user su on su.user_id=file.create_user
where file.id in
select id, source_table sourceTable, source_id sourceId, source_type sourceType, file_name fileName,
file_key filePath, bucket_name bucketName, create_time createTime,
origin_file_name originFileName, file_path path, file_url url
from bm_files
where id in
<foreach collection="ids" item="item" open="(" close=")" separator="," >
#{item}
</foreach>