|
@@ -312,8 +312,11 @@ public class ZEngiineeringPhotoServiceImpl implements IZEngiineeringPhotoService
|
|
zEngineeringCivilBo.getzEngineeringNodeBo().getzEngineeringInfoBoList().forEach(zEngineeringInfoBo -> {
|
|
zEngineeringCivilBo.getzEngineeringNodeBo().getzEngineeringInfoBoList().forEach(zEngineeringInfoBo -> {
|
|
zEngineeringInfoBo.getzEngiineeringPhotoBoList().forEach(photo -> {
|
|
zEngineeringInfoBo.getzEngiineeringPhotoBoList().forEach(photo -> {
|
|
if (StringUtils.isNotBlank(photo)) {
|
|
if (StringUtils.isNotBlank(photo)) {
|
|
|
|
+ try {
|
|
// 创建最外层文件夹
|
|
// 创建最外层文件夹
|
|
- File file = new File(filePath);
|
|
|
|
|
|
+ byte[] fileNameBytes = filePath.getBytes("UTF-8");
|
|
|
|
+ // 使用UTF-8编码创建文件
|
|
|
|
+ File file = new File(new String(fileNameBytes, "UTF-8"));
|
|
if (!file.exists()) {
|
|
if (!file.exists()) {
|
|
file.mkdirs();
|
|
file.mkdirs();
|
|
}
|
|
}
|
|
@@ -323,55 +326,84 @@ public class ZEngiineeringPhotoServiceImpl implements IZEngiineeringPhotoService
|
|
// headFile.mkdirs();
|
|
// headFile.mkdirs();
|
|
// }
|
|
// }
|
|
// 小区下再次创建小区,本级用于导出
|
|
// 小区下再次创建小区,本级用于导出
|
|
- File areaFile = new File(file.getPath() + "/" + zEngineeringCivilBo.getAreaId());
|
|
|
|
|
|
+// File areaFile = new File(file.getPath() + "/" + zEngineeringCivilBo.getAreaId());
|
|
|
|
+ byte[] areafileNameBytes = (file.getPath() + "/" + zEngineeringCivilBo.getAreaId()).getBytes("UTF-8");
|
|
|
|
+ // 使用UTF-8编码创建文件
|
|
|
|
+ File areaFile = new File(new String(areafileNameBytes, "UTF-8"));
|
|
if (!areaFile.exists()) {
|
|
if (!areaFile.exists()) {
|
|
areaFile.mkdirs();
|
|
areaFile.mkdirs();
|
|
}
|
|
}
|
|
// 楼
|
|
// 楼
|
|
- File buildingFile = new File(areaFile.getPath() + "/" + zEngineeringCivilBo.getBuildingId());
|
|
|
|
|
|
+// File buildingFile = new File(areaFile.getPath() + "/" + zEngineeringCivilBo.getBuildingId());
|
|
|
|
+ byte[] buildingfileNameBytes = (areaFile.getPath() + "/" + zEngineeringCivilBo.getBuildingId()).getBytes("UTF-8");
|
|
|
|
+ // 使用UTF-8编码创建文件
|
|
|
|
+ File buildingFile = new File(new String(buildingfileNameBytes, "UTF-8"));
|
|
if (!buildingFile.exists()) {
|
|
if (!buildingFile.exists()) {
|
|
buildingFile.mkdirs();
|
|
buildingFile.mkdirs();
|
|
}
|
|
}
|
|
// 单元
|
|
// 单元
|
|
- File unitFile = new File(buildingFile.getPath() + "/" + zEngineeringCivilBo.getUnitId());
|
|
|
|
|
|
+// File unitFile = new File(buildingFile.getPath() + "/" + zEngineeringCivilBo.getUnitId());
|
|
|
|
+ byte[] unitfileNameBytes = (buildingFile.getPath() + "/" + zEngineeringCivilBo.getUnitId()).getBytes("UTF-8");
|
|
|
|
+ // 使用UTF-8编码创建文件
|
|
|
|
+ File unitFile = new File(new String(unitfileNameBytes, "UTF-8"));
|
|
if (!unitFile.exists()) {
|
|
if (!unitFile.exists()) {
|
|
unitFile.mkdirs();
|
|
unitFile.mkdirs();
|
|
}
|
|
}
|
|
// 房间
|
|
// 房间
|
|
- File houseFile = new File(unitFile.getPath() + "/" + zEngineeringCivilBo.getHouseId());
|
|
|
|
|
|
+// File houseFile = new File(unitFile.getPath() + "/" + zEngineeringCivilBo.getHouseId());
|
|
|
|
+ byte[] housefileNameBytes = (unitFile.getPath() + "/" + zEngineeringCivilBo.getHouseId()).getBytes("UTF-8");
|
|
|
|
+ // 使用UTF-8编码创建文件
|
|
|
|
+ File houseFile = new File(new String(housefileNameBytes, "UTF-8"));
|
|
if (!houseFile.exists()) {
|
|
if (!houseFile.exists()) {
|
|
houseFile.mkdirs();
|
|
houseFile.mkdirs();
|
|
}
|
|
}
|
|
// 工程周期
|
|
// 工程周期
|
|
- File EnginCycleFile = new File(houseFile.getPath() + "/" + zEngineeringCivilBo.getEnginCycle());
|
|
|
|
|
|
+// File EnginCycleFile = new File(houseFile.getPath() + "/" + zEngineeringCivilBo.getEnginCycle());
|
|
|
|
+ byte[] EnginCycleNameBytes = (houseFile.getPath() + "/" + zEngineeringCivilBo.getEnginCycle()).getBytes("UTF-8");
|
|
|
|
+ // 使用UTF-8编码创建文件
|
|
|
|
+ File EnginCycleFile = new File(new String(EnginCycleNameBytes, "UTF-8"));
|
|
if (!EnginCycleFile.exists()) {
|
|
if (!EnginCycleFile.exists()) {
|
|
EnginCycleFile.mkdirs();
|
|
EnginCycleFile.mkdirs();
|
|
}
|
|
}
|
|
// 工程类型
|
|
// 工程类型
|
|
- File EnginType = new File(EnginCycleFile.getPath() + "/" + zEngineeringCivilBo.getEnginType());
|
|
|
|
|
|
+// File EnginType = new File(EnginCycleFile.getPath() + "/" + zEngineeringCivilBo.getEnginType());
|
|
|
|
+ byte[] EnginTypeNameBytes = (EnginCycleFile.getPath() + "/" + zEngineeringCivilBo.getEnginType()).getBytes("UTF-8");
|
|
|
|
+ // 使用UTF-8编码创建文件
|
|
|
|
+ File EnginType = new File(new String(EnginTypeNameBytes, "UTF-8"));
|
|
if (!EnginType.exists()) {
|
|
if (!EnginType.exists()) {
|
|
EnginType.mkdirs();
|
|
EnginType.mkdirs();
|
|
}
|
|
}
|
|
// 工程分类
|
|
// 工程分类
|
|
- File EnginClassification = new File(EnginType.getPath() + "/" + zEngineeringCivilBo.getEnginClassification());
|
|
|
|
|
|
+// File EnginClassification = new File(EnginType.getPath() + "/" + zEngineeringCivilBo.getEnginClassification());
|
|
|
|
+ byte[] EnginClassificationNameBytes = (EnginType.getPath() + "/" + zEngineeringCivilBo.getEnginClassification()).getBytes("UTF-8");
|
|
|
|
+ // 使用UTF-8编码创建文件
|
|
|
|
+ File EnginClassification = new File(new String(EnginClassificationNameBytes, "UTF-8"));
|
|
if (!EnginClassification.exists()) {
|
|
if (!EnginClassification.exists()) {
|
|
EnginClassification.mkdirs();
|
|
EnginClassification.mkdirs();
|
|
}
|
|
}
|
|
// 节点类型
|
|
// 节点类型
|
|
- File Type = new File(EnginClassification.getPath() + "/" + zEngineeringCivilBo.getzEngineeringNodeBo().getType());
|
|
|
|
|
|
+// File Type = new File(EnginClassification.getPath() + "/" + zEngineeringCivilBo.getzEngineeringNodeBo().getType());
|
|
|
|
+ byte[] TypeNameBytes = (EnginClassification.getPath() + "/" + zEngineeringCivilBo.getzEngineeringNodeBo().getType()).getBytes("UTF-8");
|
|
|
|
+ // 使用UTF-8编码创建文件
|
|
|
|
+ File Type = new File(new String(TypeNameBytes, "UTF-8"));
|
|
if (!Type.exists()) {
|
|
if (!Type.exists()) {
|
|
Type.mkdirs();
|
|
Type.mkdirs();
|
|
}
|
|
}
|
|
// 时间
|
|
// 时间
|
|
- File CreateTimeFile = new File(Type.getPath() + "/" + new SimpleDateFormat("yyyy-MM-dd").format(zEngineeringInfoBo.getCreateTime()) );
|
|
|
|
|
|
+// File CreateTimeFile = new File(Type.getPath() + "/" + new SimpleDateFormat("yyyy-MM-dd").format(zEngineeringInfoBo.getCreateTime()) );
|
|
|
|
+ byte[] CreateTimeFileNameBytes = (Type.getPath() + "/" + new SimpleDateFormat("yyyy-MM-dd").format(zEngineeringInfoBo.getCreateTime())).getBytes("UTF-8");
|
|
|
|
+ // 使用UTF-8编码创建文件
|
|
|
|
+ File CreateTimeFile = new File(new String(CreateTimeFileNameBytes, "UTF-8"));
|
|
if (!CreateTimeFile.exists()) {
|
|
if (!CreateTimeFile.exists()) {
|
|
CreateTimeFile.mkdirs();
|
|
CreateTimeFile.mkdirs();
|
|
}
|
|
}
|
|
- File CreateByFile = new File(CreateTimeFile.getPath() + "/" + zEngineeringInfoBo.getConstructUser());
|
|
|
|
|
|
+// File CreateByFile = new File(CreateTimeFile.getPath() + "/" + zEngineeringInfoBo.getConstructUser());
|
|
|
|
+ byte[] CreateByFileNameBytes = (CreateTimeFile.getPath() + "/" + zEngineeringInfoBo.getConstructUser()).getBytes("UTF-8");
|
|
|
|
+ // 使用UTF-8编码创建文件
|
|
|
|
+ File CreateByFile = new File(new String(CreateByFileNameBytes, "UTF-8"));
|
|
if (!CreateByFile.exists()) {
|
|
if (!CreateByFile.exists()) {
|
|
CreateByFile.mkdirs();
|
|
CreateByFile.mkdirs();
|
|
}
|
|
}
|
|
- try {
|
|
|
|
obsService.download(CreateByFile.getPath(), photo.substring(photo.lastIndexOf("/")+1));
|
|
obsService.download(CreateByFile.getPath(), photo.substring(photo.lastIndexOf("/")+1));
|
|
System.out.println(photo.substring(photo.lastIndexOf("/")+1));
|
|
System.out.println(photo.substring(photo.lastIndexOf("/")+1));
|
|
System.out.println(photo);
|
|
System.out.println(photo);
|