Compare commits
2 Commits
ad2f822dca
...
7aa4613b96
| Author | SHA1 | Date |
|---|---|---|
|
|
7aa4613b96 | |
|
|
6c0632242d |
|
|
@ -1393,7 +1393,8 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
favorite.setFileId(fileId);
|
||||
boolean isSaved = fileFavoriteService.save(favorite);
|
||||
if (isSaved) {
|
||||
UserThreadLocal.setSuccessInfo("", fileId, StrFormatter.format("收藏了文件"));
|
||||
EdFileInfo fileInfo = this.baseMapper.selectById(fileId);
|
||||
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), fileId, StrFormatter.format("收藏了文件"));
|
||||
}
|
||||
return isSaved;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
|||
edFileRelation.setCreatedBy(UserThreadLocal.getUserId());
|
||||
boolean isSaved = this.save(edFileRelation);
|
||||
if (isSaved) {
|
||||
UserThreadLocal.setSuccessInfo("", edFileRelation.getId(), StrFormatter.format("关联了文件"));
|
||||
EdFileInfo fileInfo = edFileInfoMapper.selectById(edFileRelation.getId());
|
||||
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), edFileRelation.getId(), StrFormatter.format("关联了文件"));
|
||||
}
|
||||
return isSaved;
|
||||
}
|
||||
|
|
@ -89,7 +90,8 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
|||
|
||||
boolean isRemoved = this.removeById(id);
|
||||
if (isRemoved) {
|
||||
UserThreadLocal.setSuccessInfo("", id, StrFormatter.format("取消了文件关联"));
|
||||
EdFileInfo fileInfo = edFileInfoMapper.selectById(id);
|
||||
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), id, StrFormatter.format("取消了文件关联"));
|
||||
}
|
||||
return isRemoved;
|
||||
}
|
||||
|
|
@ -140,7 +142,8 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
|||
nodes.add(fileSimpleInfoVO);
|
||||
}
|
||||
fileRelationViewVO.setNodes(nodes);
|
||||
UserThreadLocal.setSuccessInfo("", startId, StrFormatter.format("查询了文件{}的关联关系", startId));
|
||||
EdFileInfo fileInfo = edFileInfoMapper.selectById(startId);
|
||||
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getId).orElse(""), startId, StrFormatter.format("查询了文件{}的关联关系", startId));
|
||||
return fileRelationViewVO;
|
||||
}
|
||||
|
||||
|
|
@ -273,7 +276,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
|||
log.error(info, e);
|
||||
throw new BizException(info);
|
||||
}
|
||||
UserThreadLocal.setSuccessInfo("", "", "上传了文件并建立了文件关系");
|
||||
UserThreadLocal.setSuccessInfo(newEdFileInfo.getParentId(), newEdFileInfo.getId(), "上传了文件并建立了文件关系");
|
||||
return ElectromagneticResultUtil.success(true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.electromagnetic.industry.software.common.enums.PublishEnum;
|
||||
import com.electromagnetic.industry.software.common.util.IdWorker;
|
||||
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
||||
import com.electromagnetic.industry.software.manage.mapper.EdFileInfoMapper;
|
||||
import com.electromagnetic.industry.software.manage.mapper.EdTagLibraryMapper;
|
||||
import com.electromagnetic.industry.software.manage.mapper.FileTagRelationMapper;
|
||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo;
|
||||
import com.electromagnetic.industry.software.manage.pojo.models.EdTagLibrary;
|
||||
import com.electromagnetic.industry.software.manage.pojo.models.FileTagRelation;
|
||||
import com.electromagnetic.industry.software.manage.pojo.resp.FileTagInfo;
|
||||
|
|
@ -17,14 +19,18 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class FileTagRelationServiceImpl extends ServiceImpl<FileTagRelationMapper, FileTagRelation> implements FileTagRelationService {
|
||||
@Autowired
|
||||
private EdTagLibraryMapper edTagLibraryMapper;
|
||||
@Resource
|
||||
private EdFileInfoMapper edFileInfoMapper;
|
||||
|
||||
private boolean addTagToFile(String fileId, String tagId, String createdBy) {
|
||||
// 检查标签是否存在并且已发布
|
||||
|
|
@ -62,7 +68,8 @@ public class FileTagRelationServiceImpl extends ServiceImpl<FileTagRelationMappe
|
|||
isSuccess &= addTagToFile(fileId, tagId, createdBy);
|
||||
}
|
||||
if (isSuccess) {
|
||||
UserThreadLocal.setSuccessInfo("", "", "添加了标签到文件");
|
||||
EdFileInfo fileInfo = edFileInfoMapper.selectById(fileId);
|
||||
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), fileId, "添加了标签到文件");
|
||||
}
|
||||
return isSuccess;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue