ICD映射上传路径微调

This commit is contained in:
caozehui
2025-12-16 16:18:02 +08:00
parent de1496389e
commit 4b7c1259a7

View File

@@ -137,6 +137,10 @@ public class PqIcdPathServiceImpl extends ServiceImpl<PqIcdPathMapper, PqIcdPath
// String workDir = "D:\\program\\CN_Gather";
// 获取映射文件存放文件夹
String dirPath = workDir + "\\9100";
int index = workDir.indexOf("\\resources\\extraResources\\java");
if (index != -1) {
dirPath = workDir.substring(0, workDir.indexOf("\\resources\\extraResources\\java")) + "\\9100";
}
return dirPath;
}
@@ -190,6 +194,17 @@ public class PqIcdPathServiceImpl extends ServiceImpl<PqIcdPathMapper, PqIcdPath
@Override
@Transactional
public boolean deleteIcd(List<String> ids) {
List<PqIcdPath> pqIcdPaths = this.listByIds(ids);
String commInstallPath = this.getCommInstallPath();
pqIcdPaths.forEach(pqIcdPath -> {
String mappingFilePath = commInstallPath + "\\DeviceControl\\Config\\" + pqIcdPath.getName() + ".txt";
Path path = Paths.get(mappingFilePath);
File file = path.toFile();
if (file.exists()) {
file.delete();
}
});
return this.lambdaUpdate().in(PqIcdPath::getId, ids).set(PqIcdPath::getState, DataStateEnum.DELETED.getCode()).update();
}