|
@@ -2,7 +2,6 @@ package com.fdkk.sxz.webApi.controller;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
@@ -198,8 +197,10 @@ public class SceneStyleController extends BaseController {
|
|
|
@NoAuthentication
|
|
|
@AroundLog(name = "根据场景码获取风格列表")
|
|
|
public Result getIssueList(@RequestBody RequestSceneStyle style) {
|
|
|
+
|
|
|
LambdaQueryWrapper<SceneStyleEntity> wrapper = Wrappers.lambdaQuery();
|
|
|
wrapper.eq(SceneStyleEntity::getSceneNum, style.getSceneNum());
|
|
|
+ wrapper.ne(SceneStyleEntity::getSceneNum, style.getVrSceneNum());
|
|
|
wrapper.eq(SceneStyleEntity::getIssue, 1);
|
|
|
List<SceneStyleEntity> list = sceneStyleService.list(wrapper);
|
|
|
List<ResponseSceneStyleIssue> collect = list.stream().map(a -> {
|
|
@@ -207,7 +208,17 @@ public class SceneStyleController extends BaseController {
|
|
|
BeanUtil.copyProperties(a, vo);
|
|
|
return vo;
|
|
|
}).collect(Collectors.toList());
|
|
|
- return Result.success(collect);
|
|
|
+
|
|
|
+ LambdaQueryWrapper<SceneStyleEntity> onewrapper = Wrappers.lambdaQuery();
|
|
|
+ onewrapper.eq(SceneStyleEntity::getStyleNum, style.getVrSceneNum());
|
|
|
+ onewrapper.eq(SceneStyleEntity::getIssue, 1);
|
|
|
+ onewrapper.orderByDesc(SceneStyleEntity::getNum);
|
|
|
+ SceneStyleEntity one = sceneStyleService.getOne(wrapper);
|
|
|
+ JSONObject res = new JSONObject();
|
|
|
+ res.put("title", one.getStyleName());
|
|
|
+ res.put("styleList", collect);
|
|
|
+
|
|
|
+ return Result.success(res);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -270,12 +281,13 @@ public class SceneStyleController extends BaseController {
|
|
|
//指明请求来源
|
|
|
Map<String, String> header = new HashMap<>();
|
|
|
header.put("token", request.getHeader("token"));
|
|
|
- String url = mainUrl + "api/scene/synsencecode?sceneNum=" + scene.getSceneNum();
|
|
|
+ JSONObject params = new JSONObject();
|
|
|
+ params.put("sceneNum", scene.getSceneNum());
|
|
|
if (styleEntity.getIsDecoration() == 0) {
|
|
|
- url = url + "&vrsceneNum=" + scene.getVrsceneNum() + "&thumb=" + styleEntity.getThumb();
|
|
|
+ params.put("vrSceneNum", scene.getVrsceneNum());
|
|
|
+ params.put("vrThumb", styleEntity.getThumb());
|
|
|
}
|
|
|
- String res = OkHttpUtils.httpGet(url, header);
|
|
|
- JSONObject jsonObject = JSON.parseObject(res);
|
|
|
+ JSONObject jsonObject = OkHttpUtils.httpPostJson(mainUrl + "api/scene/synsencecode", params.toJSONString(), header);
|
|
|
if (jsonObject.containsKey("code")) {
|
|
|
if (jsonObject.getIntValue("code") == 0) {
|
|
|
LambdaUpdateWrapper<SceneStyleEntity> updateWrapper = Wrappers.lambdaUpdate();
|