解决发现的问题
This commit is contained in:
parent
ccb61bfa40
commit
ad39488e94
|
|
@ -39,7 +39,7 @@ public class LoginInterceptor implements HandlerInterceptor {
|
|||
|
||||
private boolean checkSysAdminOperation(HttpServletRequest request) {
|
||||
String requestURI = request.getRequestURI();
|
||||
if (!requestURI.startsWith("/data/ed/prj")) {
|
||||
if (requestURI.startsWith("/data/ed/prj")) {
|
||||
return UserThreadLocal.getAdminType().equals(AdminTypeEnum.SYSTEM.getValue());
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
.collect(Collectors.toList());
|
||||
// 找出用户创建的文件夹
|
||||
List<EdFileInfo> userFolders = importAllFiles.stream().filter(e -> ObjUtil.equals(e.getDataType(), EleDataTypeEnum.FOLDER.code))
|
||||
.filter(e -> ObjUtil.notEqual(e.getPrjDir(), false))
|
||||
.filter(e -> ObjUtil.equals(e.getPrjDir(), false))
|
||||
.collect(Collectors.toList());
|
||||
// 找出所有文件
|
||||
List<EdFileInfo> allFiles = importAllFiles.stream().filter(e -> ObjUtil.equals(e.getDataType(), EleDataTypeEnum.FILE.code)).collect(Collectors.toList());
|
||||
|
|
@ -470,7 +470,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
EdFileInfo fileInfo = v.stream().filter(e -> e.getEffectFlag().equals(EffectFlagEnum.EFFECT.code)).findFirst().get();
|
||||
resetFileInfoName(fileInfo);
|
||||
allObjs.addAll(v);
|
||||
allObjs.add(fileInfo);
|
||||
} else {
|
||||
Map<String, EdFileInfo> dbIdMap = dbFileInfos.stream().collect(Collectors.toMap(EdFileInfo::getId, e -> e));
|
||||
Map<String, EdFileInfo> importIdMap = v.stream().collect(Collectors.toMap(EdFileInfo::getId, e -> e));
|
||||
|
|
@ -521,7 +520,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
String id = saveObj.getId();
|
||||
String preVersionId = dbVersionRelation.get(id);
|
||||
EdFileInfo tmp = importIdMap.get(preVersionId);
|
||||
saveObj.setPreVersion(tmp.getFileVersion());
|
||||
saveObj.setPreVersion(ObjUtil.isNull(tmp) ? null : tmp.getFileVersion());
|
||||
int effect = ObjUtil.equals(saveObj.getId(), effectId) ? EffectFlagEnum.EFFECT.code : EffectFlagEnum.NOT_EFFECTIVE.code;
|
||||
saveObj.setEffectFlag(effect);
|
||||
}
|
||||
|
|
@ -529,7 +528,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
}
|
||||
}
|
||||
this.saveOrUpdateBatch(allObjs);
|
||||
update2FileSystem(allFiles, prjDirPath);
|
||||
update2FileSystem(allObjs, prjDirPath);
|
||||
}
|
||||
|
||||
private void resetFileInfoName(EdFileInfo fileInfo) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,10 @@ public class FileSystemServiceImpl implements FileSystemService {
|
|||
if (!FileUtil.exist(destParentDir)) {
|
||||
FileUtil.mkdir(destParentDir);
|
||||
}
|
||||
FileUtil.move(new File(source), new File(destination), true);
|
||||
if (FileUtil.exist(destination)) {
|
||||
return;
|
||||
}
|
||||
FileUtil.move(new File(source), new File(destination), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@
|
|||
//import cn.hutool.core.util.ZipUtil;
|
||||
//import cn.hutool.crypto.SecureUtil;
|
||||
//import cn.hutool.crypto.symmetric.AES;
|
||||
//import com.electromagnetic.industry.software.common.exception.BizException;
|
||||
//import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
||||
//import com.electromagnetic.industry.software.manage.Application;
|
||||
//import com.electromagnetic.industry.software.manage.service.EdFileInfoService;
|
||||
//import com.electromagnetic.industry.software.manage.service.serviceimpl.EdFileInfoServiceImpl;
|
||||
//import org.junit.jupiter.api.Test;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
|
|
|
|||
Loading…
Reference in New Issue