bug修改
This commit is contained in:
parent
19962803e5
commit
51042138cf
|
|
@ -28,7 +28,6 @@ public class ImageCaptionController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ImageCaptionService service;
|
private ImageCaptionService service;
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(UserOperaVo vo)
|
public TableDataInfo list(UserOperaVo vo)
|
||||||
{
|
{
|
||||||
|
|
@ -37,7 +36,6 @@ public class ImageCaptionController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认数据
|
* 确认数据
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -64,6 +62,15 @@ public class ImageCaptionController extends BaseController {
|
||||||
public AjaxResult getSelected(UserOperaVo vo) {
|
public AjaxResult getSelected(UserOperaVo vo) {
|
||||||
return service.getSelected(vo);
|
return service.getSelected(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除图片
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/deleteFile")
|
||||||
|
public AjaxResult deleteFile(UserOperaVo vo) {
|
||||||
|
return service.deleteFile(vo);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 侧边栏历史对话
|
* 侧边栏历史对话
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ public class AlgorithmVo {
|
||||||
vo.setImageNum(length);
|
vo.setImageNum(length);
|
||||||
vo.setOperaType(operaType);
|
vo.setOperaType(operaType);
|
||||||
vo.setOperaId(operaId);
|
vo.setOperaId(operaId);
|
||||||
vo.setOperaId(userId);
|
vo.setUserId(userId);
|
||||||
vo.setCreateTime(createTime);
|
vo.setCreateTime(createTime);
|
||||||
vo.setName(operaName);
|
vo.setName(operaName);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ public interface ImageCaptionMapper {
|
||||||
*/
|
*/
|
||||||
void addUpLoadImage(@Param("list") List<SysFile> fileList, @Param("id") String id, @Param("createTime")String createTime, @Param("operaType")String operaType);
|
void addUpLoadImage(@Param("list") List<SysFile> fileList, @Param("id") String id, @Param("createTime")String createTime, @Param("operaType")String operaType);
|
||||||
|
|
||||||
|
void addSureLoadImage(@Param("list") List<SysFile> fileList, @Param("id") String id, @Param("createTime")String createTime, @Param("operaType")String operaType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新 数据
|
* 更新 数据
|
||||||
* @param vo
|
* @param vo
|
||||||
|
|
@ -107,4 +109,19 @@ public interface ImageCaptionMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<UploadFileVo> getAllImageList(UserOperaVo vo);
|
List<UploadFileVo> getAllImageList(UserOperaVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询 图片数据
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<UploadFileVo> getFileList(UserOperaVo vo);
|
||||||
|
|
||||||
|
void addSureFile(@Param("list") List<UploadFileVo> fileList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除图片
|
||||||
|
* @param imageId
|
||||||
|
*/
|
||||||
|
void deleteFile(@Param("list") List<String> imageId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,4 +70,11 @@ public interface ImageCaptionService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<UploadFileVo> getAllImagelist(UserOperaVo vo);
|
List<UploadFileVo> getAllImagelist(UserOperaVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除图片
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult deleteFile(UserOperaVo vo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ public class ImageCaptionServiceImpl implements ImageCaptionService {
|
||||||
//操作日期
|
//操作日期
|
||||||
List<SysFile> fileList=new ArrayList<>();
|
List<SysFile> fileList=new ArrayList<>();
|
||||||
UserOperaVo userOperaVo=new UserOperaVo(userId,operaName,createTime,BJ_TYPE);
|
UserOperaVo userOperaVo=new UserOperaVo(userId,operaName,createTime,BJ_TYPE);
|
||||||
AjaxResult result= addOperaData(multipartFile,vo,userId,operaName,createTime,BJ_TYPE);
|
AjaxResult result= addOperaData(multipartFile,vo,userId,operaName,createTime,fileList,userOperaVo,BJ_TYPE);
|
||||||
if(result.isError()){
|
if(result.isError()){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -75,8 +75,8 @@ public class ImageCaptionServiceImpl implements ImageCaptionService {
|
||||||
List<ImageRecognize> list= algorithmService.getImageList(fileList,operaName);
|
List<ImageRecognize> list= algorithmService.getImageList(fileList,operaName);
|
||||||
//更新标记的数量 和未标记的数量,同时更新 标记图片地址
|
//更新标记的数量 和未标记的数量,同时更新 标记图片地址
|
||||||
updateImage(list,vo);
|
updateImage(list,vo);
|
||||||
// 查询数据历史集合
|
// 查询数据历史集合
|
||||||
List<UserOperaVo> hisImageList=getUploadFileList(userOperaVo);
|
List<UserOperaVo> hisImageList=getUploadFileList(userOperaVo);
|
||||||
return AjaxResult.success(hisImageList);
|
return AjaxResult.success(hisImageList);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error(e.getMessage(),e);
|
log.error(e.getMessage(),e);
|
||||||
|
|
@ -103,7 +103,7 @@ public class ImageCaptionServiceImpl implements ImageCaptionService {
|
||||||
//操作日期
|
//操作日期
|
||||||
//文件路径
|
//文件路径
|
||||||
UserOperaVo userOperaVo=new UserOperaVo(userId,operaName,createTime,PG_TYPE);
|
UserOperaVo userOperaVo=new UserOperaVo(userId,operaName,createTime,PG_TYPE);
|
||||||
AjaxResult result= addOperaData(multipartFile,vo,userId,operaName,createTime,PG_TYPE);
|
AjaxResult result= addOperaData(multipartFile,vo,userId,operaName,createTime,fileList,userOperaVo,PG_TYPE);
|
||||||
if(result.isError()){
|
if(result.isError()){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -132,12 +132,10 @@ public class ImageCaptionServiceImpl implements ImageCaptionService {
|
||||||
* @param operaType
|
* @param operaType
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public AjaxResult addOperaData(MultipartFile[] multipartFile, AlgorithmVo vo,String userId,String operaName,String createTime,String operaType) {
|
public AjaxResult addOperaData(MultipartFile[] multipartFile, AlgorithmVo vo,String userId,String operaName,String createTime, List<SysFile> fileList, UserOperaVo userOperaVo,String operaType) {
|
||||||
try{
|
try{
|
||||||
//文件路径
|
//文件路径
|
||||||
String path="image/"+year+"/"+month+"/"+day+"/";
|
String path="image/"+year+"/"+month+"/"+day+"/";
|
||||||
List<SysFile> fileList=new ArrayList<>();
|
|
||||||
UserOperaVo userOperaVo=new UserOperaVo(userId,operaName,createTime,BJ_TYPE);
|
|
||||||
if(StringUtils.isEmpty(vo.getId())){
|
if(StringUtils.isEmpty(vo.getId())){
|
||||||
Integer addOperaNum=mapper.addUserOperaVo(userOperaVo);
|
Integer addOperaNum=mapper.addUserOperaVo(userOperaVo);
|
||||||
if(addOperaNum==null || addOperaNum==0){
|
if(addOperaNum==null || addOperaNum==0){
|
||||||
|
|
@ -146,13 +144,13 @@ public class ImageCaptionServiceImpl implements ImageCaptionService {
|
||||||
}else{
|
}else{
|
||||||
userOperaVo.setId(vo.getId());
|
userOperaVo.setId(vo.getId());
|
||||||
}
|
}
|
||||||
AlgorithmVo.addSource(vo,multipartFile.length,userOperaVo.getId(),createTime,BJ_TYPE,userId,operaName);
|
AlgorithmVo.addSource(vo,multipartFile.length,userOperaVo.getId(),createTime,operaType,userId,operaName);
|
||||||
//操作记录
|
//操作记录
|
||||||
Integer addedAlgorithmNum= mapper.addAlgorithm(vo);
|
Integer addedAlgorithmNum= mapper.addAlgorithm(vo);
|
||||||
if(addedAlgorithmNum==null || addedAlgorithmNum==0){
|
if(addedAlgorithmNum==null || addedAlgorithmNum==0){
|
||||||
return AjaxResult.error("操作记录添加失败!");
|
return AjaxResult.error("操作记录添加失败!");
|
||||||
}else{
|
}else{
|
||||||
AjaxResult result=ImageMultipartFile(multipartFile,path,createTime,userId,fileList,vo.getId(),BJ_TYPE);
|
AjaxResult result=ImageMultipartFile(multipartFile,path,createTime,userId,fileList,vo.getId(),operaType);
|
||||||
if(result.isError()){
|
if(result.isError()){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -203,7 +201,13 @@ public class ImageCaptionServiceImpl implements ImageCaptionService {
|
||||||
//查询 每次历史的 图片集合
|
//查询 每次历史的 图片集合
|
||||||
List<UploadFileVo> fileVoList=mapper.getImageListDetailsHistory(userOperaVo2);
|
List<UploadFileVo> fileVoList=mapper.getImageListDetailsHistory(userOperaVo2);
|
||||||
for (UploadFileVo obj : fileVoList) {
|
for (UploadFileVo obj : fileVoList) {
|
||||||
String url=minioUtil.getFileUrl(obj.getBucketName(),obj.getBjFilePath(),60*60*7);
|
String url;
|
||||||
|
if(BJ_TYPE.equals(obj.getType())){
|
||||||
|
url=minioUtil.getFileUrl(obj.getBucketName(),obj.getBjFilePath(),60*60*7);
|
||||||
|
} else {
|
||||||
|
url=minioUtil.getFileUrl(obj.getBucketName(),obj.getFilePath(),60*60*7);
|
||||||
|
}
|
||||||
|
|
||||||
obj.setBjUrl(url);
|
obj.setBjUrl(url);
|
||||||
}
|
}
|
||||||
userOperaVo2.setFileVoList(fileVoList);
|
userOperaVo2.setFileVoList(fileVoList);
|
||||||
|
|
@ -238,12 +242,16 @@ public class ImageCaptionServiceImpl implements ImageCaptionService {
|
||||||
// 转换为可读格式(如KB/MB)
|
// 转换为可读格式(如KB/MB)
|
||||||
String humanReadableSize = convertToHumanReadable(sizeInBytes);
|
String humanReadableSize = convertToHumanReadable(sizeInBytes);
|
||||||
SysFile sysFile=minioUtil.uploadFile(file,folderPath);
|
SysFile sysFile=minioUtil.uploadFile(file,folderPath);
|
||||||
|
sysFile.setName(uuid+"."+suffix);
|
||||||
SysFile.addSource(sysFile,userId,originFileName,humanReadableSize);
|
SysFile.addSource(sysFile,userId,originFileName,humanReadableSize);
|
||||||
fileList.add(sysFile);
|
fileList.add(sysFile);
|
||||||
}
|
}
|
||||||
if(fileList.size()!=multipartFile.length){
|
if(fileList.size()!=multipartFile.length){
|
||||||
return AjaxResult.error("文件上传失败!");
|
return AjaxResult.error("文件上传失败!");
|
||||||
}
|
}
|
||||||
|
if(PG_TYPE.equals(operaType)){
|
||||||
|
mapper.addSureLoadImage(fileList,id,createTime,operaType);
|
||||||
|
}
|
||||||
mapper.addUpLoadImage(fileList,id,createTime,operaType);
|
mapper.addUpLoadImage(fileList,id,createTime,operaType);
|
||||||
return AjaxResult.success("上传成功!");
|
return AjaxResult.success("上传成功!");
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
@ -298,9 +306,18 @@ public class ImageCaptionServiceImpl implements ImageCaptionService {
|
||||||
public AjaxResult updateImageSure(UserOperaVo vo) {
|
public AjaxResult updateImageSure(UserOperaVo vo) {
|
||||||
try{
|
try{
|
||||||
vo.setUserId(SecurityUtils.getUserId().toString());
|
vo.setUserId(SecurityUtils.getUserId().toString());
|
||||||
|
vo.setIsSure("1");
|
||||||
mapper.updateAlgorithmSure(vo);
|
mapper.updateAlgorithmSure(vo);
|
||||||
//跟新图片状态
|
//跟新图片状态
|
||||||
mapper.updateImage(vo.getImageId());
|
if(StringUtils.isNotEmpty(vo.getImageId())){
|
||||||
|
mapper.updateImage(vo.getImageId());
|
||||||
|
}
|
||||||
|
//查询 历史确认的图片
|
||||||
|
List<UploadFileVo> fileList=mapper.getFileList(vo);
|
||||||
|
//添加图片到标记
|
||||||
|
mapper.addSureFile(fileList);
|
||||||
|
|
||||||
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error(e.getMessage(),e);
|
log.error(e.getMessage(),e);
|
||||||
}
|
}
|
||||||
|
|
@ -370,6 +387,22 @@ public class ImageCaptionServiceImpl implements ImageCaptionService {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除图片
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult deleteFile(UserOperaVo vo) {
|
||||||
|
try{
|
||||||
|
mapper.deleteFile(vo.getImageId());
|
||||||
|
return AjaxResult.success("删除成功");
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.getMessage(),e);
|
||||||
|
}
|
||||||
|
return AjaxResult.error("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
// 辅助方法:字节转可读格式
|
// 辅助方法:字节转可读格式
|
||||||
private String convertToHumanReadable(long bytes) {
|
private String convertToHumanReadable(long bytes) {
|
||||||
if (bytes < 1024) return bytes + " B";
|
if (bytes < 1024) return bytes + " B";
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{item.name},0,#{createTime},#{operaType},#{item.bjFilePath},#{item.fileSize},#{item.createUser} )
|
#{item.name},0,#{createTime},#{operaType},#{item.bjFilePath},#{item.fileSize},#{item.createUser} )
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="addSureLoadImage">
|
||||||
|
insert into tb_sure_file(
|
||||||
|
id, algorithm_id,original_name,file_path,bucket_name,
|
||||||
|
file_name,is_active,create_time,file_type,bj_file_path,file_size,create_user
|
||||||
|
) values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.id}, #{id},#{item.originName},#{item.url},#{item.bucketName},
|
||||||
|
#{item.name},0,#{createTime},#{operaType},#{item.bjFilePath},#{item.fileSize},#{item.createUser} )
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
<insert id="addImageRecognize">
|
<insert id="addImageRecognize">
|
||||||
insert into tb_image_recognize(
|
insert into tb_image_recognize(
|
||||||
image_id,
|
image_id,
|
||||||
|
|
@ -43,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
type
|
type
|
||||||
)values (#{imageId},#{contentImage},#{overallScore},#{clarity},#{cleanliness},#{compressMarks},#{impression},#{balance},#{detail},#{type})
|
)values (#{imageId},#{contentImage},#{overallScore},#{clarity},#{cleanliness},#{compressMarks},#{impression},#{balance},#{detail},#{type})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateAlgorithm">
|
<update id="updateAlgorithm">
|
||||||
update tb_algorithm set bz_num=#{bzNum},wbz_num=#{wbzNum} where id=#{id}
|
update tb_algorithm set bz_num=#{bzNum},wbz_num=#{wbzNum} where id=#{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
@ -51,8 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
update tb_upload_file set bj_file_path=#{imagePath} where id=#{imageId}
|
update tb_upload_file set bj_file_path=#{imagePath} where id=#{imageId}
|
||||||
</update>
|
</update>
|
||||||
<update id="updateAlgorithmSure">
|
<update id="updateAlgorithmSure">
|
||||||
update tb_algorithm set is_sure=#{isSure}, sure_user=#{createUser} where oper_id=#{id}
|
update tb_algorithm set is_sure=#{isSure}, sure_user=#{userId} where oper_id=#{id}
|
||||||
|
|
||||||
</update>
|
</update>
|
||||||
<update id="updateImage">
|
<update id="updateImage">
|
||||||
update tb_upload_file set is_active=1
|
update tb_upload_file set is_active=1
|
||||||
|
|
@ -61,6 +71,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
<update id="deleteFile">
|
||||||
|
update tb_sure_file set is_active=1
|
||||||
|
where id in
|
||||||
|
<foreach collection="list" item="item" close=")" open="(" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
<select id="getImageList" resultType="com.bonus.business.domain.UserOperaVo">
|
<select id="getImageList" resultType="com.bonus.business.domain.UserOperaVo">
|
||||||
select tuo.id, tuo.type, tuo.oper_name operaName,
|
select tuo.id, tuo.type, tuo.oper_name operaName,
|
||||||
tuo.oper_time operaTime, tuo.user_id , tuo.oper_type
|
tuo.oper_time operaTime, tuo.user_id , tuo.oper_type
|
||||||
|
|
@ -93,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
tir.cleanliness,tir.compress_marks compressMarks,tir.impression,
|
tir.cleanliness,tir.compress_marks compressMarks,tir.impression,
|
||||||
tir.balance,tir.detail,tir.type
|
tir.balance,tir.detail,tir.type
|
||||||
from tb_upload_file file
|
from tb_upload_file file
|
||||||
left join tb_image_recognize tir on tir.image_id=file.id
|
left join tb_image_recognize tir on tir.image_id=file.id
|
||||||
WHERE file.algorithm_id=#{id}
|
WHERE file.algorithm_id=#{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -123,7 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
tir.cleanliness,tir.compress_marks compressMarks,tir.impression,
|
tir.cleanliness,tir.compress_marks compressMarks,tir.impression,
|
||||||
tir.balance,tir.detail,tir.type
|
tir.balance,tir.detail,tir.type
|
||||||
from tb_upload_file file
|
from tb_upload_file file
|
||||||
left join tb_image_recognize tir on tir.image_id=file.id
|
left join tb_image_recognize tir on tir.image_id=file.id
|
||||||
WHERE file.id in
|
WHERE file.id in
|
||||||
<foreach collection="list" item="item" close=")" open="(" separator=",">
|
<foreach collection="list" item="item" close=")" open="(" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
|
|
@ -139,7 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
<!--查询图片-->
|
<!--查询图片-->
|
||||||
<select id="getAllImageList" resultType="com.bonus.file.vo.UploadFileVo">
|
<select id="getAllImageList" resultType="com.bonus.file.vo.UploadFileVo">
|
||||||
select file.id imageId,
|
select file.id imageId,tuo.oper_name operaName,
|
||||||
file.algorithm_id algorithmId, file.original_name originalName,
|
file.algorithm_id algorithmId, file.original_name originalName,
|
||||||
file.file_path filePath,
|
file.file_path filePath,
|
||||||
file.bucket_name bucketName, file.file_name fileName,
|
file.bucket_name bucketName, file.file_name fileName,
|
||||||
|
|
@ -149,24 +166,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
tir.cleanliness,tir.compress_marks compressMarks,tir.impression,
|
tir.cleanliness,tir.compress_marks compressMarks,tir.impression,
|
||||||
tir.balance,tir.detail,tir.type,su.user_name userName
|
tir.balance,tir.detail,tir.type,su.user_name userName
|
||||||
from tb_algorithm tam
|
from tb_algorithm tam
|
||||||
left join tb_upload_file file on file.algorithm_id=tam.id
|
left join tb_user_oper tuo on tuo.id=tam.oper_id
|
||||||
|
left join tb_sure_file file on file.algorithm_id=tam.id
|
||||||
left join tb_image_recognize tir on tir.image_id=file.id
|
left join tb_image_recognize tir on tir.image_id=file.id
|
||||||
left join sys_user su on su.user_id=tam.sure_user
|
left join sys_user su on su.user_id=tam.sure_user
|
||||||
where file.type=#{operaType}
|
where tam.oper_type=#{operaType} and file.is_active='0'
|
||||||
<if test='createUser!=null and createUser!=""'>
|
<if test='createUser!=null and createUser!=""'>
|
||||||
and tam.user_id=#{createUser}
|
and tam.user_id=#{createUser}
|
||||||
</if>
|
|
||||||
<!--查询确认的 和去确认不需要的-->
|
|
||||||
<if test='operaType==1 or operaType=="1"'>
|
|
||||||
and file.is_active='0' and tam.is_sure=1
|
|
||||||
</if>
|
</if>
|
||||||
<if test="operaTime!=null and operaTime!=''">
|
<if test="operaTime!=null and operaTime!=''">
|
||||||
and DATE(tam.create_time) =#{operaTime}
|
and DATE(tam.create_time) =#{operaTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="userName!=null and userName!=''">
|
||||||
|
and su.user_name like concat('%',#{userName},'%')
|
||||||
|
</if>
|
||||||
<if test="operaName!=null and operaName!=''">
|
<if test="operaName!=null and operaName!=''">
|
||||||
and tir.content_image like concat('%',#{operaName},'%')
|
and tir.content_image like concat('%',#{operaName},'%')
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getFileList" resultType="com.bonus.file.vo.UploadFileVo">
|
||||||
|
select file.id imageId,
|
||||||
|
file.algorithm_id algorithmId,
|
||||||
|
file.original_name originalName,
|
||||||
|
file.file_path filePath,
|
||||||
|
file.bucket_name bucketName,
|
||||||
|
file.file_name fileName,
|
||||||
|
file.is_active isActive,
|
||||||
|
file. update_time ,
|
||||||
|
file.create_time createTime,
|
||||||
|
file.file_type fileType,
|
||||||
|
file.bj_file_path bjFilePath,
|
||||||
|
file. file_size fileSize,
|
||||||
|
file.create_user createUser
|
||||||
|
from tb_upload_file file
|
||||||
|
left join tb_algorithm ta on ta.id=file.algorithm_id
|
||||||
|
WHERE file.is_active=0
|
||||||
|
and ta.oper_id=#{id}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="addSureFile">
|
||||||
|
insert into tb_sure_file(
|
||||||
|
id, algorithm_id,original_name,file_path,bucket_name,
|
||||||
|
file_name,is_active,create_time,file_type,bj_file_path,file_size,create_user
|
||||||
|
) values
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(#{item.imageId}, #{item.algorithmId},#{item.originalName},#{item.filePath},#{item.bucketName},
|
||||||
|
#{item.fileName},#{item.isActive},#{item.createTime},#{item.fileType},#{item.bjFilePath},#{item.fileSize},#{item.createUser} )
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -290,13 +290,19 @@ public class MinioUtil {
|
||||||
ZipOutputStream zos = new ZipOutputStream(baos)) {
|
ZipOutputStream zos = new ZipOutputStream(baos)) {
|
||||||
// 压缩每个文件
|
// 压缩每个文件
|
||||||
for (UploadFileVo objectName : objectNames) {
|
for (UploadFileVo objectName : objectNames) {
|
||||||
|
String filePath;
|
||||||
|
if("1".equals(objectName.getType())){
|
||||||
|
filePath = objectName.getBjFilePath();
|
||||||
|
}else{
|
||||||
|
filePath=objectName.getFilePath();
|
||||||
|
}
|
||||||
try (InputStream inputStream = minioClient.getObject(GetObjectArgs.builder()
|
try (InputStream inputStream = minioClient.getObject(GetObjectArgs.builder()
|
||||||
.bucket(minioConfig.getBucketName())
|
.bucket(minioConfig.getBucketName())
|
||||||
.object(objectName.getBjFilePath())
|
.object(filePath)
|
||||||
.build())) {
|
.build())) {
|
||||||
|
|
||||||
// 添加 ZipEntry
|
// 添加 ZipEntry
|
||||||
zos.putNextEntry(new ZipEntry(objectName.getOriginalName()));
|
zos.putNextEntry(new ZipEntry(objectName.getFileName()));
|
||||||
byte[] buffer = new byte[1024];
|
byte[] buffer = new byte[1024];
|
||||||
int len;
|
int len;
|
||||||
while ((len = inputStream.read(buffer)) > 0) {
|
while ((len = inputStream.read(buffer)) > 0) {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import lombok.Data;
|
||||||
@Data
|
@Data
|
||||||
public class UploadFileVo {
|
public class UploadFileVo {
|
||||||
|
|
||||||
|
private String operaName;
|
||||||
|
|
||||||
private String imageId;
|
private String imageId;
|
||||||
/**
|
/**
|
||||||
* 图片名称
|
* 图片名称
|
||||||
|
|
@ -93,5 +95,7 @@ public class UploadFileVo {
|
||||||
*/
|
*/
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue