Compare commits
4 Commits
d9525bc13b
...
a7c19b1c93
| Author | SHA1 | Date |
|---|---|---|
|
|
a7c19b1c93 | |
|
|
d2a1a34328 | |
|
|
f7275abe20 | |
|
|
08310e1606 |
|
|
@ -4,11 +4,17 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.electromagnetic.industry.software.common.enums.EffectFlagEnum;
|
||||||
|
import com.electromagnetic.industry.software.common.util.EleCommonUtil;
|
||||||
|
import com.electromagnetic.industry.software.common.util.IdWorker;
|
||||||
|
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("ed_file_favorite")
|
@TableName("ed_file_favorite")
|
||||||
public class EdFileFavorite {
|
public class EdFileFavorite extends BaseModel{
|
||||||
|
|
||||||
@TableId(type = IdType.ASSIGN_UUID)
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
@ -19,4 +25,15 @@ public class EdFileFavorite {
|
||||||
@TableField("file_id")
|
@TableField("file_id")
|
||||||
private String fileId;
|
private String fileId;
|
||||||
|
|
||||||
|
public void newInit() {
|
||||||
|
String userId = UserThreadLocal.getUserId();
|
||||||
|
String newId = IdWorker.getSnowFlakeIdString();
|
||||||
|
Date now = new Date();
|
||||||
|
this.setId(newId);
|
||||||
|
this.setCreatedTime(now);
|
||||||
|
this.setCreatedBy(userId);
|
||||||
|
this.setUpdatedTime(now);
|
||||||
|
this.setUpdatedBy(userId);
|
||||||
|
this.setEffectFlag(EffectFlagEnum.EFFECT.code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,17 @@
|
||||||
package com.electromagnetic.industry.software.manage.pojo.models;
|
package com.electromagnetic.industry.software.manage.pojo.models;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.electromagnetic.industry.software.common.enums.EffectFlagEnum;
|
||||||
|
import com.electromagnetic.industry.software.common.util.IdWorker;
|
||||||
|
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("ed_file_relation")
|
@TableName("ed_file_relation")
|
||||||
public class EdFileRelation {
|
public class EdFileRelation extends BaseModel{
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
|
@ -30,21 +32,15 @@ public class EdFileRelation {
|
||||||
*/
|
*/
|
||||||
private String relationship;
|
private String relationship;
|
||||||
|
|
||||||
/**
|
public void newInit() {
|
||||||
* 创建者 用户id
|
String userId = UserThreadLocal.getUserId();
|
||||||
*/
|
String newId = IdWorker.getSnowFlakeIdString();
|
||||||
@TableField(value = "created_by")
|
Date now = new Date();
|
||||||
private String createdBy;
|
this.setId(newId);
|
||||||
|
this.setCreatedTime(now);
|
||||||
@TableField(value = "created_at", fill = FieldFill.INSERT)
|
this.setCreatedBy(userId);
|
||||||
private Date createdAt;
|
this.setUpdatedTime(now);
|
||||||
|
this.setUpdatedBy(userId);
|
||||||
/**
|
this.setEffectFlag(EffectFlagEnum.EFFECT.code);
|
||||||
* 更新者 用户id
|
}
|
||||||
*/
|
|
||||||
@TableField(value = "updated_by")
|
|
||||||
private String updatedBy;
|
|
||||||
|
|
||||||
@TableField(value = "updated_at", fill = FieldFill.UPDATE)
|
|
||||||
private Date updatedAt;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileFavorite;
|
import com.electromagnetic.industry.software.manage.pojo.models.EdFileFavorite;
|
||||||
|
|
||||||
public interface EdFileFavoriteService extends IService<EdFileFavorite> {
|
public interface EdFileFavoriteService extends IService<EdFileFavorite> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除
|
||||||
|
* @param userId
|
||||||
|
* @param fileId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean logicRemove (String userId, String fileId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
package com.electromagnetic.industry.software.manage.service.serviceimpl;
|
package com.electromagnetic.industry.software.manage.service.serviceimpl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.electromagnetic.industry.software.common.enums.EffectFlagEnum;
|
||||||
import com.electromagnetic.industry.software.manage.mapper.EdFileFavoriteMapper;
|
import com.electromagnetic.industry.software.manage.mapper.EdFileFavoriteMapper;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileFavorite;
|
import com.electromagnetic.industry.software.manage.pojo.models.EdFileFavorite;
|
||||||
import com.electromagnetic.industry.software.manage.service.EdFileFavoriteService;
|
import com.electromagnetic.industry.software.manage.service.EdFileFavoriteService;
|
||||||
|
|
@ -8,4 +12,19 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class EdFileFavoriteServiceImpl extends ServiceImpl<EdFileFavoriteMapper, EdFileFavorite> implements EdFileFavoriteService {
|
public class EdFileFavoriteServiceImpl extends ServiceImpl<EdFileFavoriteMapper, EdFileFavorite> implements EdFileFavoriteService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除
|
||||||
|
* @param userId
|
||||||
|
* @param fileId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean logicRemove (String userId, String fileId) {
|
||||||
|
LambdaUpdateWrapper <EdFileFavorite> updateWrapper = Wrappers.lambdaUpdate(EdFileFavorite.class)
|
||||||
|
.eq(EdFileFavorite::getUserId, userId)
|
||||||
|
.eq(EdFileFavorite::getFileId, fileId)
|
||||||
|
.set(EdFileFavorite::getEffectFlag, EffectFlagEnum.NOT_EFFECTIVE.code);
|
||||||
|
return update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -953,7 +953,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
destPath,
|
destPath,
|
||||||
strategyStr,
|
strategyStr,
|
||||||
Optional.ofNullable(finalEdFileInfo).map(EdFileInfo::getFileName).orElse(fileName) + "." + Optional.ofNullable(finalEdFileInfo).map(EdFileInfo::getFileType).orElse(suffix));
|
Optional.ofNullable(finalEdFileInfo).map(EdFileInfo::getFileName).orElse(fileName) + "." + Optional.ofNullable(finalEdFileInfo).map(EdFileInfo::getFileType).orElse(suffix));
|
||||||
return ElectromagneticResultUtil.success(true);
|
return ElectromagneticResultUtil.success(newEdFileInfo.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,11 @@
|
||||||
package com.electromagnetic.industry.software.manage.service.serviceimpl;
|
package com.electromagnetic.industry.software.manage.service.serviceimpl;
|
||||||
|
|
||||||
import cn.hutool.core.io.FileUtil;
|
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.text.StrFormatter;
|
import cn.hutool.core.text.StrFormatter;
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.hutool.crypto.SecureUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.electromagnetic.industry.software.common.enums.EffectFlagEnum;
|
import com.electromagnetic.industry.software.common.enums.*;
|
||||||
import com.electromagnetic.industry.software.common.enums.EleDataSaveStatusEnum;
|
|
||||||
import com.electromagnetic.industry.software.common.enums.EleDataTypeEnum;
|
|
||||||
import com.electromagnetic.industry.software.common.enums.PublishEnum;
|
|
||||||
import com.electromagnetic.industry.software.common.exception.BizException;
|
import com.electromagnetic.industry.software.common.exception.BizException;
|
||||||
import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
|
import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
|
||||||
import com.electromagnetic.industry.software.common.util.*;
|
import com.electromagnetic.industry.software.common.util.*;
|
||||||
|
|
@ -37,7 +31,6 @@ import static com.electromagnetic.industry.software.common.cons.ElectromagneticC
|
||||||
@Service
|
@Service
|
||||||
public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper, EdFileRelation> implements EdFileRelationService {
|
public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper, EdFileRelation> implements EdFileRelationService {
|
||||||
|
|
||||||
private final EleLog log = new EleLog(EdFileInfoServiceImpl.class);
|
|
||||||
@Resource
|
@Resource
|
||||||
EdFileInfoMapper edFileInfoMapper;
|
EdFileInfoMapper edFileInfoMapper;
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -52,6 +45,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public Boolean createRelation(EdFileRelation edFileRelation) throws BizException {
|
public Boolean createRelation(EdFileRelation edFileRelation) throws BizException {
|
||||||
// 无法建立已建立的关系
|
// 无法建立已建立的关系
|
||||||
String queryId1 = edFileRelation.getId1();
|
String queryId1 = edFileRelation.getId1();
|
||||||
|
|
@ -65,17 +59,24 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
||||||
queryWrapper.eq(EdFileRelation::getId1, queryId1).eq(EdFileRelation::getId2, queryId2)
|
queryWrapper.eq(EdFileRelation::getId1, queryId1).eq(EdFileRelation::getId2, queryId2)
|
||||||
.or()
|
.or()
|
||||||
.eq(EdFileRelation::getId1, queryId2).eq(EdFileRelation::getId2, queryId1);
|
.eq(EdFileRelation::getId1, queryId2).eq(EdFileRelation::getId2, queryId1);
|
||||||
List<EdFileRelation> list = this.list(queryWrapper);
|
EdFileRelation relation = this.getOne(queryWrapper);
|
||||||
if (!list.isEmpty()) {
|
if (relation != null && relation.getEffectFlag().equals(EffectFlagEnum.EFFECT.code)) {
|
||||||
throw new BizException("请勿重复建立关系");
|
throw new BizException("请勿重复建立关系");
|
||||||
}
|
}
|
||||||
|
|
||||||
edFileRelation.setId(IdWorker.getSnowFlakeIdString());
|
boolean isSaved;
|
||||||
edFileRelation.setCreatedBy(UserThreadLocal.getUserId());
|
if (relation != null) {
|
||||||
boolean isSaved = this.save(edFileRelation);
|
relation.setRelationship(edFileRelation.getRelationship());
|
||||||
|
relation.setEffectFlag(EffectFlagEnum.EFFECT.code);
|
||||||
|
isSaved = this.updateById(relation);
|
||||||
|
} else {
|
||||||
|
EdFileRelation newRelation = new EdFileRelation();
|
||||||
|
newRelation.newInit();
|
||||||
|
BeanUtils.copyProperties(edFileRelation, newRelation);
|
||||||
|
isSaved = this.save(newRelation);
|
||||||
|
}
|
||||||
if (isSaved) {
|
if (isSaved) {
|
||||||
EdFileInfo fileInfo = edFileInfoMapper.selectById(edFileRelation.getId());
|
UserThreadLocal.setSuccessInfo("", edFileRelation.getId(), StrFormatter.format("关联了文件"));
|
||||||
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), edFileRelation.getId(), StrFormatter.format("关联了文件"));
|
|
||||||
}
|
}
|
||||||
return isSaved;
|
return isSaved;
|
||||||
}
|
}
|
||||||
|
|
@ -89,10 +90,17 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
||||||
@Override
|
@Override
|
||||||
public Boolean cancelRelation(String id) {
|
public Boolean cancelRelation(String id) {
|
||||||
|
|
||||||
boolean isRemoved = this.removeById(id);
|
EdFileRelation edFileRelation = this.getById(id);
|
||||||
|
if (edFileRelation == null) {
|
||||||
|
throw new BizException("关系不存在");
|
||||||
|
}
|
||||||
|
if (edFileRelation.getEffectFlag().equals(EffectFlagEnum.NOT_EFFECTIVE.code)) {
|
||||||
|
throw new BizException("关系已取消");
|
||||||
|
}
|
||||||
|
edFileRelation.setEffectFlag(EffectFlagEnum.NOT_EFFECTIVE.code);
|
||||||
|
boolean isRemoved = this.updateById(edFileRelation);
|
||||||
if (isRemoved) {
|
if (isRemoved) {
|
||||||
EdFileInfo fileInfo = edFileInfoMapper.selectById(id);
|
UserThreadLocal.setSuccessInfo("", id, StrFormatter.format("取消了文件关联"));
|
||||||
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), id, StrFormatter.format("取消了文件关联"));
|
|
||||||
}
|
}
|
||||||
return isRemoved;
|
return isRemoved;
|
||||||
}
|
}
|
||||||
|
|
@ -174,10 +182,13 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Edge> getEdges(String id) {
|
private List<Edge> getEdges(String id) {
|
||||||
|
|
||||||
LambdaQueryWrapper<EdFileRelation> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<EdFileRelation> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(EdFileRelation::getId1, id)
|
queryWrapper.eq(EdFileRelation::getEffectFlag, EffectFlagEnum.EFFECT.code)
|
||||||
|
.and(wrapper -> wrapper.eq(EdFileRelation::getId1, id)
|
||||||
.or()
|
.or()
|
||||||
.eq(EdFileRelation::getId2, id);
|
.eq(EdFileRelation::getId2, id));
|
||||||
|
|
||||||
List<EdFileRelation> list = this.list(queryWrapper);
|
List<EdFileRelation> list = this.list(queryWrapper);
|
||||||
List<Edge> edges = new ArrayList<>();
|
List<Edge> edges = new ArrayList<>();
|
||||||
for (EdFileRelation edFileRelation : list) {
|
for (EdFileRelation edFileRelation : list) {
|
||||||
|
|
@ -203,84 +214,18 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ElectromagneticResult<?> uploadFileAndRelation(String parentId, String id, MultipartFile file, String desc, int dataOwnCode) {
|
public ElectromagneticResult<?> uploadFileAndRelation(String parentId, String id, MultipartFile file, String desc, int dataOwnCode) {
|
||||||
|
|
||||||
Assert.isTrue(EleCommonUtil.isFileNameValid(file.getOriginalFilename()), NAME_VALID_MSG);
|
// 上传文件
|
||||||
String fileName = file.getOriginalFilename();
|
ElectromagneticResult<?> uploadResult = edFileInfoService.upload(parentId, file, FileRepeatEnum.NEW.code, dataOwnCode);
|
||||||
String mainName = FileUtil.mainName(fileName);
|
Assert.notNull(uploadResult.getData(), "上传失败");
|
||||||
String suffix = FileUtil.getSuffix(fileName);
|
String relatedFileId = (String) uploadResult.getData();
|
||||||
Assert.isTrue(StrUtil.isNotEmpty(suffix), "文件类型不能为空");
|
|
||||||
// 查找下一层,看是否存在顶级定义相关文件,如果存在,则该层属于管理员层级定义的,不允许上传文件
|
|
||||||
long dirCount = edFileInfoService.count(Wrappers.lambdaQuery(EdFileInfo.class)
|
|
||||||
.eq(EdFileInfo::getParentId, parentId)
|
|
||||||
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code)
|
|
||||||
.eq(EdFileInfo::getDataOwn, dataOwnCode)
|
|
||||||
.eq(EdFileInfo::getDataType, EleDataTypeEnum.FOLDER.code));
|
|
||||||
Assert.isTrue(dirCount == 0, "层级目录不允许上传文件");
|
|
||||||
|
|
||||||
|
|
||||||
EdFileInfo newEdFileInfo = new EdFileInfo();
|
|
||||||
newEdFileInfo.newInit();
|
|
||||||
try {
|
|
||||||
Assert.isTrue(EleCommonUtil.isFileNameValid(fileName), NAME_VALID_MSG);
|
|
||||||
Long count = edFileInfoService.count(Wrappers.lambdaQuery(EdFileInfo.class)
|
|
||||||
.eq(EdFileInfo::getParentId, parentId)
|
|
||||||
.eq(EdFileInfo::getFileName, mainName)
|
|
||||||
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code)
|
|
||||||
.eq(EdFileInfo::getFileType, suffix));
|
|
||||||
|
|
||||||
EdFileInfo parentFileInfo = edFileInfoMapper.selectOne(Wrappers.lambdaQuery(EdFileInfo.class)
|
|
||||||
.select(EdFileInfo.class, obj -> !StrUtil.equals(obj.getColumn(), "file_content"))
|
|
||||||
.eq(EdFileInfo::getId, parentId)
|
|
||||||
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code));
|
|
||||||
String codePathByDbPath = commonService.getCodePathByDbPath(parentFileInfo.getFilePath());
|
|
||||||
String fileCode = commonService.createFileCode(codePathByDbPath, suffix, FILE_START_VERSION, newEdFileInfo.getFileTime());
|
|
||||||
newEdFileInfo.setParentId(parentId)
|
|
||||||
.setFileCode(fileCode)
|
|
||||||
.setFileName(mainName)
|
|
||||||
.setFileType(suffix)
|
|
||||||
.setFileVersion(FILE_START_VERSION)
|
|
||||||
.setFileTime(newEdFileInfo.getFileTime())
|
|
||||||
.setFileSize(file.getSize())
|
|
||||||
.setFilePath(parentFileInfo.getFilePath() + MYSQL_FILE_PATH_SPLIT + newEdFileInfo.getId())
|
|
||||||
.setDataType(EleDataTypeEnum.FILE.code)
|
|
||||||
.setDataStatus(PublishEnum.PUBLISHED.getCode())
|
|
||||||
.setFileCode(fileCode)
|
|
||||||
.setSaveStatus(EleDataSaveStatusEnum.SUCCESS.code)
|
|
||||||
.setDataOwn(dataOwnCode)
|
|
||||||
.setEffectFlag(EffectFlagEnum.EFFECT.code);
|
|
||||||
|
|
||||||
// 文件名加”_1“,存为新文件
|
|
||||||
if (count > 0) {
|
|
||||||
edFileInfoService.resetFileInfoName(newEdFileInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
edFileInfoService.saveOrUpdate(newEdFileInfo);
|
|
||||||
String fileDestPath = commonService.getFileSysPath(newEdFileInfo.getId());
|
|
||||||
FileUtil.writeFromStream(file.getInputStream(), fileDestPath);
|
|
||||||
EleCommonUtil.encryptFile(fileDestPath, SecureUtil.aes(FILE_SEC_PASSWD.getBytes()));
|
|
||||||
|
|
||||||
// 创建文件关系
|
// 创建文件关系
|
||||||
EdFileRelation relation = new EdFileRelation();
|
EdFileRelation relation = new EdFileRelation();
|
||||||
|
relation.newInit();
|
||||||
relation.setId1(id);
|
relation.setId1(id);
|
||||||
relation.setId2(newEdFileInfo.getId());
|
relation.setId2(relatedFileId);
|
||||||
relation.setRelationship(desc);
|
relation.setRelationship(desc);
|
||||||
createRelation(relation);
|
createRelation(relation);
|
||||||
|
UserThreadLocal.setSuccessInfo("", id, StrFormatter.format("建立了文件 {} 与文件 {} 的关系", id, relatedFileId));
|
||||||
} catch (Exception e) {
|
|
||||||
newEdFileInfo.setParentId(parentId)
|
|
||||||
.setFileName(mainName)
|
|
||||||
.setFileType(suffix)
|
|
||||||
.setFileSize(file.getSize())
|
|
||||||
.setDataType(EleDataTypeEnum.FILE.code)
|
|
||||||
.setDataStatus(PublishEnum.PUBLISHED.getCode())
|
|
||||||
.setSaveStatus(EleDataSaveStatusEnum.FAIL.code)
|
|
||||||
.setDataOwn(dataOwnCode)
|
|
||||||
.setEffectFlag(EffectFlagEnum.NOT_EFFECTIVE.code);
|
|
||||||
edFileInfoService.saveOrUpdate(newEdFileInfo);
|
|
||||||
String info = "上传文件失败";
|
|
||||||
log.error(info, e);
|
|
||||||
throw new BizException(info);
|
|
||||||
}
|
|
||||||
UserThreadLocal.setSuccessInfo(newEdFileInfo.getParentId(), newEdFileInfo.getId(), "上传了文件并建立了文件关系");
|
|
||||||
return ElectromagneticResultUtil.success(true);
|
return ElectromagneticResultUtil.success(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk16</artifactId>
|
<artifactId>bcprov-jdk18on</artifactId>
|
||||||
<version>1.46</version>
|
<version>1.77</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue