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

+ 10 - 7
sxz-core/src/main/java/com/fdkk/sxz/other/listener/SnycBuild.java

@@ -57,13 +57,16 @@ public class SnycBuild {
         CustomProductEntity customProductEntity = null;
         CustomComponentEntity componentEntity = null;
         try {
-            SnycBuild.log.info("更新模型库,syncmodel开始:" + json);
-            String resultData = OkHttpUtils.httpPostJson(buildUrl + "syncmodel", json);
-            JSONObject resultJson = JSONObject.parseObject(resultData);
-            SnycBuild.log.info("更新模型库,syncmodel结束:" + resultData.toString());
-            if ("error".equals(resultJson.getString("state"))) {
-                SnycBuild.log.info("更新模型库,syncmodel接口失败:" + resultData);
-                throw new RuntimeException(id + ":更新模型库,syncmodel接口失败");
+            //审批定制的时候,也审批组件,不
+            if (!json.equals("no")) {
+                SnycBuild.log.info("更新模型库,syncmodel开始:" + json);
+                String resultData = OkHttpUtils.httpPostJson(buildUrl + "syncmodel", json);
+                JSONObject resultJson = JSONObject.parseObject(resultData);
+                SnycBuild.log.info("更新模型库,syncmodel结束:" + resultData.toString());
+                if ("error".equals(resultJson.getString("state"))) {
+                    SnycBuild.log.info("更新模型库,syncmodel接口失败:" + resultData);
+                    throw new RuntimeException(id + ":更新模型库,syncmodel接口失败");
+                }
             }
             switch (type) {
                 case "1":

+ 1 - 1
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/ImportDataController.java

@@ -882,7 +882,7 @@ public class ImportDataController extends BaseController {
         }
         visionJson.put("sweepLocations", sweepLocations);
 
-        FileUtils.writeFile("D:\\test\\vision1.txt", visionJson.toString());
+        FileUtils.writeFile(visionPath, visionJson.toString());
     }
 
     /**

+ 13 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/custom/impl/CustomProductServiceImpl.java

@@ -183,6 +183,19 @@ public class CustomProductServiceImpl extends BaseServiceImpl<ICustomProductMapp
                             componentEntity.setExamine(2);
                             componentEntity.setExamineTime(new Date());
                             customComponentService.updateById(componentEntity);
+                            JSONObject jsonObject = new JSONObject();
+                            String version = SnowFlakeUUidUtils.generaUUid(null, null, null);
+                            CustomProductServiceImpl.log.info("更新配件模型库,syncmodel接口参数:");
+                            try {
+                                uploadToOssUtil.uploadTo4dTjw(syncDataArray.toJSONString().getBytes(), "domain/eHome/furniture/syncdata/" +
+                                        version + "/SyncData.json");
+                            } catch (IOException e) {
+                                e.printStackTrace();
+                            }
+                            CustomProductServiceImpl.log.info("上传完成SyncData.jsn:" + version);
+                            jsonObject.put("version", version);
+                            String message = id + ":;" + "3" + ":;" + jsonObject.toString();
+                            rabbitTemplate.convertAndSend(TopicRabbitConfig.TOPICE, TopicRabbitConfig.SYNCMODEL, message);
                         }
                     });
                 }