|
@@ -205,7 +205,12 @@ public class SceneStyleController extends BaseController {
|
|
//指明请求来源
|
|
//指明请求来源
|
|
Map<String, String> header = new HashMap<>();
|
|
Map<String, String> header = new HashMap<>();
|
|
header.put("token", request.getHeader("token"));
|
|
header.put("token", request.getHeader("token"));
|
|
- JSONObject jsonObject = JSON.parseObject(OkHttpUtils.httpGet(mainUrl + "api/scene/synsencecode?sceneNum=" + scene.getSceneNum() + "&vrsceneNum=" + scene.getVrsceneNum(), header));
|
|
|
|
|
|
+ String url = mainUrl + "api/scene/synsencecode?sceneNum=" + scene.getSceneNum();
|
|
|
|
+ if (styleEntity.getIsDecoration() == 1) {
|
|
|
|
+ url = url + "&vrsceneNum=" + scene.getVrsceneNum();
|
|
|
|
+ }
|
|
|
|
+ String res = OkHttpUtils.httpGet(url, header);
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(res);
|
|
if (jsonObject.containsKey("code")) {
|
|
if (jsonObject.containsKey("code")) {
|
|
if (jsonObject.getIntValue("code") == 0) {
|
|
if (jsonObject.getIntValue("code") == 0) {
|
|
LambdaUpdateWrapper<SceneStyleEntity> updateWrapper = Wrappers.lambdaUpdate();
|
|
LambdaUpdateWrapper<SceneStyleEntity> updateWrapper = Wrappers.lambdaUpdate();
|
|
@@ -215,8 +220,10 @@ public class SceneStyleController extends BaseController {
|
|
.eq(SceneStyleEntity::getIsDecoration, 1)
|
|
.eq(SceneStyleEntity::getIsDecoration, 1)
|
|
.set(SceneStyleEntity::getIsDecoration, 0);
|
|
.set(SceneStyleEntity::getIsDecoration, 0);
|
|
sceneStyleService.update(updateWrapper);
|
|
sceneStyleService.update(updateWrapper);
|
|
- styleEntity.setIsDecoration(1);
|
|
|
|
- sceneStyleService.updateById(styleEntity);
|
|
|
|
|
|
+ if (styleEntity.getIsDecoration() == 0) {
|
|
|
|
+ styleEntity.setIsDecoration(1);
|
|
|
|
+ sceneStyleService.updateById(styleEntity);
|
|
|
|
+ }
|
|
return Result.success("成功");
|
|
return Result.success("成功");
|
|
} else {
|
|
} else {
|
|
return Result.failure("失败");
|
|
return Result.failure("失败");
|