|
@@ -1067,17 +1067,16 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, String> imp
|
|
|
if (execute.getStatus()==200){
|
|
|
JSONObject res=JSONObject.parseObject(execute.body());
|
|
|
log.info("成功+---"+res);
|
|
|
-
|
|
|
if (res.containsKey("scenes")) {
|
|
|
JSONArray scenes = res.getJSONArray("scenes");
|
|
|
- if (scenes.size()>=1){
|
|
|
- JSONObject parse = JSON.parseObject(scenes.get(0).toString());
|
|
|
+ for (int i = 0; i < scenes.size(); i++) {
|
|
|
+ JSONObject parse = JSON.parseObject(scenes.get(i).toString());
|
|
|
if (res.containsKey("customMask")) {
|
|
|
JSONObject customMask = res.getJSONObject("customMask");
|
|
|
JSONObject earth = customMask.getJSONObject("earth");
|
|
|
JSONObject sky = customMask.getJSONObject("sky");
|
|
|
JSONObject customMaskJson = new JSONObject();
|
|
|
- if (StrUtil.isNotEmpty(earth.getString("icon"))){
|
|
|
+ if (StrUtil.isNotEmpty(earth.getString("icon"))&&i==0){
|
|
|
earth.put("antidistorted",true);
|
|
|
earth.put("scale",1);
|
|
|
customMaskJson.put("earth",earth);
|
|
@@ -1091,7 +1090,7 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, String> imp
|
|
|
customMaskJson.put("earth",earth);
|
|
|
}
|
|
|
|
|
|
- if (StrUtil.isNotEmpty(sky.getString("icon"))){
|
|
|
+ if (StrUtil.isNotEmpty(sky.getString("icon"))&&i==0){
|
|
|
sky.put("antidistorted",true);
|
|
|
sky.put("scale",1);
|
|
|
customMaskJson.put("sky",sky);
|
|
@@ -1107,7 +1106,7 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, String> imp
|
|
|
parse.put("customMask",customMaskJson);
|
|
|
}
|
|
|
|
|
|
- if (parse.containsKey("initVisual")) {
|
|
|
+ if (parse.containsKey("initVisual")&&i==0) {
|
|
|
JSONObject initVisual = parse.getJSONObject("initVisual");
|
|
|
initVisual.put("vlookatmin",90);
|
|
|
initVisual.put("vlookatmax",-90);
|
|
@@ -1120,13 +1119,14 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, String> imp
|
|
|
initVisual.put("vlookatmax",-90);
|
|
|
parse.put("initVisual",initVisual);
|
|
|
}
|
|
|
- scenes.set(0,parse);
|
|
|
+ scenes.set(i,parse);
|
|
|
res.put("scenes",scenes);
|
|
|
String str = JSON.toJSONString(res,
|
|
|
SerializerFeature.DisableCircularReferenceDetect);
|
|
|
log.info("修改完成--{}",str);
|
|
|
editSomeData(JSONObject.parseObject(str), workId);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|