dengsixing 7 months ago
parent
commit
bb9587bd88

+ 8 - 8
src/main/java/com/fdkankan/contro/service/impl/GzZcdjzxServiceImpl.java

@@ -55,19 +55,19 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
             JSONObject o = (JSONObject) v;
             String id = o.getString("id");
             try {
-                String finalFileFullName = o.getString("finalFileFullName");
                 String filePathFdfs = o.getString("filePathFdfs");
-                String relativePath = finalFileFullName.replace(".zip", "");
-                String[] split = relativePath.split("_");
+                String dataPoint = o.getString("dataPoint");
+                String[] split = dataPoint.split("#");
                 String snCode = split[0];
                 String fileId = split[1];
-                String unicode = split[2];
+                String unicode = snCode + "_" + split[2];
                 String url = bdUtil.getDownloadUrl(filePathFdfs);
-                String dataSource =  ConstantFilePath.BUILD_MODEL_PATH + relativePath;
+                String dataSource =  ConstantFilePath.BUILD_MODEL_PATH + snCode + "/" + fileId + "/" + unicode;
                 String ossHomePath = SceneUtil.getHomePath(dataSource);
                 String ossHomeAbsolutePath = LocalConstants.BASE_PATH + fYunFileConfig.getBucket() + "/" + ossHomePath;
-                httpClient.downloadFile(url, ossHomeAbsolutePath, finalFileFullName);
-                String unzipCmd = "unzip -O GBK " + ossHomeAbsolutePath + finalFileFullName + " -d " + ossHomeAbsolutePath;
+                String zipName = dataPoint.replaceAll("#", "_") + ".zip";
+                httpClient.downloadFile(url, ossHomeAbsolutePath, zipName);
+                String unzipCmd = "unzip -O GBK " + ossHomeAbsolutePath + zipName + " -d " + ossHomeAbsolutePath;
                 CmdUtils.callLine(unzipCmd);
                 SceneFileBuild sceneFileBuild = sceneFileBuildService.findByFileId(fileId);
                 if(Objects.isNull(sceneFileBuild)){
@@ -81,7 +81,7 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
                 }
 
                 // 私钥解密过程
-                String paramsStr = relativePath.replaceAll("_", "#");
+                String paramsStr = snCode + "#" + fileId + "#" + unicode;
                 byte[] res = RSAEncrypt.encrypt(RSAEncrypt.loadPublicKeyByStr(RSAEncrypt.loadPublicKeyByFile()),
                         paramsStr.getBytes(StandardCharsets.UTF_8));
                 String params = new Base64().encodeToString(res);

+ 1 - 1
src/main/java/com/fdkankan/contro/util/BdUtil.java

@@ -101,7 +101,7 @@ public class BdUtil {
         Map<String, String> headers = new HashMap<>();
         headers.put("token", token);
         Map<String, String> params = new HashMap<>();
-        params.put("id,", id);
+        params.put("id", id);
         params.put("thirdFlag", thirdFlag);
         params.put("operateResult", operateResult);
         String url = bdProperties.getAddress() + bdProperties.getUpdateDataFerryInner();