Compare commits

..

No commits in common. "7aa4613b9686d7417c063bcdd5f3a79657472375" and "ad2f822dcaf4f106ad80b1c4b2ddc9930b45fc00" have entirely different histories.

3 changed files with 6 additions and 17 deletions

View File

@ -1393,8 +1393,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
favorite.setFileId(fileId);
boolean isSaved = fileFavoriteService.save(favorite);
if (isSaved) {
EdFileInfo fileInfo = this.baseMapper.selectById(fileId);
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), fileId, StrFormatter.format("收藏了文件"));
UserThreadLocal.setSuccessInfo("", fileId, StrFormatter.format("收藏了文件"));
}
return isSaved;
}

View File

@ -73,8 +73,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
edFileRelation.setCreatedBy(UserThreadLocal.getUserId());
boolean isSaved = this.save(edFileRelation);
if (isSaved) {
EdFileInfo fileInfo = edFileInfoMapper.selectById(edFileRelation.getId());
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), edFileRelation.getId(), StrFormatter.format("关联了文件"));
UserThreadLocal.setSuccessInfo("", edFileRelation.getId(), StrFormatter.format("关联了文件"));
}
return isSaved;
}
@ -90,8 +89,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
boolean isRemoved = this.removeById(id);
if (isRemoved) {
EdFileInfo fileInfo = edFileInfoMapper.selectById(id);
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), id, StrFormatter.format("取消了文件关联"));
UserThreadLocal.setSuccessInfo("", id, StrFormatter.format("取消了文件关联"));
}
return isRemoved;
}
@ -142,8 +140,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
nodes.add(fileSimpleInfoVO);
}
fileRelationViewVO.setNodes(nodes);
EdFileInfo fileInfo = edFileInfoMapper.selectById(startId);
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getId).orElse(""), startId, StrFormatter.format("查询了文件{}的关联关系", startId));
UserThreadLocal.setSuccessInfo("", startId, StrFormatter.format("查询了文件{}的关联关系", startId));
return fileRelationViewVO;
}
@ -276,7 +273,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
log.error(info, e);
throw new BizException(info);
}
UserThreadLocal.setSuccessInfo(newEdFileInfo.getParentId(), newEdFileInfo.getId(), "上传了文件并建立了文件关系");
UserThreadLocal.setSuccessInfo("", "", "上传了文件并建立了文件关系");
return ElectromagneticResultUtil.success(true);
}
}

View File

@ -6,10 +6,8 @@ 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;
@ -19,18 +17,14 @@ 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) {
// 检查标签是否存在并且已发布
@ -68,8 +62,7 @@ public class FileTagRelationServiceImpl extends ServiceImpl<FileTagRelationMappe
isSuccess &= addTagToFile(fileId, tagId, createdBy);
}
if (isSuccess) {
EdFileInfo fileInfo = edFileInfoMapper.selectById(fileId);
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), fileId, "添加了标签到文件");
UserThreadLocal.setSuccessInfo("", "", "添加了标签到文件");
}
return isSuccess;
}