迁移数据的位置在原数据路径或者原数据父目录及其上,不允许迁移

web_backend_develope
chenlw 9 years ago
parent 83a10a1f45
commit d4cf015596

@ -103,15 +103,22 @@ public class MoveDataServiceImpl implements IMoveDataService {
} }
List<DataInfoEntityMoveTmp> moveList = new ArrayList<DataInfoEntityMoveTmp>(); List<DataInfoEntityMoveTmp> moveList = new ArrayList<DataInfoEntityMoveTmp>();
for (DataInfoEntity dataInfoEntity : data) { for (DataInfoEntity dataInfoEntity : data) {
//(根据迁移路径判断)存在迁移过的数据,不允许迁移,先必须删除记录
if (existIds.contains(dataInfoEntity.getDataPath())) { if (existIds.contains(dataInfoEntity.getDataPath())) {
continue; continue;
} }
// 数据的id不存在的数据不允许迁移
if (dataInfoEntity.getId() == 0) { if (dataInfoEntity.getId() == 0) {
continue; continue;
} }
// 根据数据的id判断存在迁移过的数据不允许迁移先必须删除记录
if (fkIds.contains(dataInfoEntity.getId())) { if (fkIds.contains(dataInfoEntity.getId())) {
continue; continue;
} }
// 迁移数据的位置在原数据路径或者原数据父目录及其上,不允许迁移
if (dataInfoEntity.getDataPath().contains(node.getPath())) {
continue;
}
// TODO 正则:取出 data 的后面 的 路径eg: XXX/320198_16/1,or // TODO 正则:取出 data 的后面 的 路径eg: XXX/320198_16/1,or
// XXX/320122KFQ_15/1 // XXX/320122KFQ_15/1
Matcher matcher = pattern.matcher(dataInfoEntity.getDataPath()); Matcher matcher = pattern.matcher(dataInfoEntity.getDataPath());

Loading…
Cancel
Save