ICD映射上传路径微调
This commit is contained in:
@@ -137,6 +137,10 @@ public class PqIcdPathServiceImpl extends ServiceImpl<PqIcdPathMapper, PqIcdPath
|
|||||||
// String workDir = "D:\\program\\CN_Gather";
|
// String workDir = "D:\\program\\CN_Gather";
|
||||||
// 获取映射文件存放文件夹
|
// 获取映射文件存放文件夹
|
||||||
String dirPath = workDir + "\\9100";
|
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;
|
return dirPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,6 +194,17 @@ public class PqIcdPathServiceImpl extends ServiceImpl<PqIcdPathMapper, PqIcdPath
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public boolean deleteIcd(List<String> ids) {
|
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();
|
return this.lambdaUpdate().in(PqIcdPath::getId, ids).set(PqIcdPath::getState, DataStateEnum.DELETED.getCode()).update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user