Просмотр исходного кода

盘符使用配置文件读取

xiewenjie 3 лет назад
Родитель
Сommit
dc02791544

+ 1 - 0
sxz-application/src/main/resources/application-dev.properties

@@ -87,3 +87,4 @@ max.obj.url=http://192.168.0.75:8080/
 dingding.warning.address=https://oapi.dingtalk.com/robot/send?access_token=13ae02d6821a56ce86c3e6ad98d0260896eba5888a9bd18aed141c39f11299a8
 #缓存接口日志时间(单位小时)
 logsTimeOut=4
+driveLetter=Z:

+ 1 - 0
sxz-application/src/main/resources/application-devuat.properties

@@ -88,3 +88,4 @@ max.obj.url=http://192.168.0.75:8080/
 dingding.warning.address=https://oapi.dingtalk.com/robot/send?access_token=13ae02d6821a56ce86c3e6ad98d0260896eba5888a9bd18aed141c39f11299a8
 #缓存接口日志时间(单位小时)
 logsTimeOut=4
+driveLetter=Z:

+ 1 - 0
sxz-application/src/main/resources/application-prod.properties

@@ -89,3 +89,4 @@ model.build.url=http://101.66.188.5:8100/
 max.obj.url=http://120.78.65.189:8080/
 #缓存接口日志时间(单位小时)
 logsTimeOut=4
+driveLetter=Z:

+ 1 - 0
sxz-application/src/main/resources/application-uat.properties

@@ -88,3 +88,4 @@ max.obj.url=http://192.168.0.75:8080/
 dingding.warning.address=https://oapi.dingtalk.com/robot/send?access_token=13ae02d6821a56ce86c3e6ad98d0260896eba5888a9bd18aed141c39f11299a8
 #缓存接口日志时间(单位小时)
 logsTimeOut=4
+driveLetter=Z:

+ 7 - 4
sxz-core/src/main/java/com/fdkk/sxz/other/listener/RunBuild.java

@@ -78,6 +78,9 @@ public class RunBuild {
     @Value("${max.obj.url}")
     private String maxObjUrl;
 
+    @Value("${driveLetter}")
+    private String driveLetter;
+
     @Autowired
     private RedisUtil redisUtil;
 
@@ -981,20 +984,20 @@ public class RunBuild {
                             String keyPath = "domain/eHome/furniture/InitialData/" + modelType + "/" + filesId + "/";
 
                             if (StrUtil.isNotEmpty(component.getString("template"))) {
-                                objFileRealPath = component.getString("template").replaceAll("Z:/OneKeyDecorate/", buildPath);
+                                objFileRealPath = component.getString("template").replaceAll(driveLetter + "/OneKeyDecorate/", buildPath);
                             }
 
                             if (StrUtil.isNotEmpty(component.getString("templateMtl"))) {
-                                mtlPathFileRealPath = component.getString("templateMtl").replaceAll("Z:/OneKeyDecorate/", buildPath);
+                                mtlPathFileRealPath = component.getString("templateMtl").replaceAll(driveLetter + "/OneKeyDecorate/", buildPath);
                             }
 
                             if (StrUtil.isNotEmpty(component.getString("datasmith"))) {
-                                udatasmitFileRealPath = component.getString("datasmith").replaceAll("Z:/OneKeyDecorate/", buildPath);
+                                udatasmitFileRealPath = component.getString("datasmith").replaceAll(driveLetter + "/OneKeyDecorate/", buildPath);
                             }
 
                             if (StrUtil.isNotEmpty(component.getString("smithAssetPath"))) {
                                 //贴图和udsmesh都在这个目录,直接批量传
-                                udsmeshFileRealPath = component.getString("smithAssetPath").replaceAll("Z:/OneKeyDecorate/", buildPath);
+                                udsmeshFileRealPath = component.getString("smithAssetPath").replaceAll(driveLetter + "/OneKeyDecorate/", buildPath);
                                 //获取目录所有文件然后上传
                                 List<File> udsmeshfiles = FileUtil.loopFiles(udsmeshFileRealPath);
                                 for (File file : udsmeshfiles) {