|
@@ -1,13 +1,18 @@
|
|
|
package com.fdkk.sxz.webApi.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkk.sxz.annotation.auth.NoAuthentication;
|
|
|
import com.fdkk.sxz.annotation.log.AroundLog;
|
|
|
import com.fdkk.sxz.base.BaseController;
|
|
|
+import com.fdkk.sxz.base.Result;
|
|
|
+import com.fdkk.sxz.entity.SceneEntity;
|
|
|
import com.fdkk.sxz.other.mq.TopicRabbitConfig;
|
|
|
import com.fdkk.sxz.util.EscapeUtil;
|
|
|
import com.fdkk.sxz.util.OkHttpUtils;
|
|
|
import com.fdkk.sxz.vo.request.RequestScene;
|
|
|
+import com.fdkk.sxz.webApi.service.ISceneService;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -40,6 +45,9 @@ public class SceneController extends BaseController {
|
|
|
@Autowired
|
|
|
RabbitTemplate rabbitTemplate; //使用RabbitTemplate,这提供了接收/发送等等方
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ISceneService sceneService;
|
|
|
+
|
|
|
/**
|
|
|
* 获取四维看看用户场景列表
|
|
|
*
|
|
@@ -82,4 +90,48 @@ public class SceneController extends BaseController {
|
|
|
}
|
|
|
return "发送消息结束";
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping(value = "/resetSceneName", method = RequestMethod.GET)
|
|
|
+ @NoAuthentication
|
|
|
+ @AroundLog(name = "发送消息")
|
|
|
+ public Result resetSceneName() {
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+ data.put("pageNum", 1);
|
|
|
+ data.put("pageSize", 20);
|
|
|
+ //指明请求来源
|
|
|
+ data.put("type", "11");
|
|
|
+ Map<String, String> header = new HashMap<>();
|
|
|
+ header.put("token", request.getHeader("token"));
|
|
|
+ for (SceneEntity sceneEntity : sceneService.list()) {
|
|
|
+ data.put("searchKey", sceneEntity.getSceneNum());
|
|
|
+ JSONObject jsonObject = OkHttpUtils.httpPostJson(mainUrl + "api/decorate/scene/list", data.toJSONString(), header);
|
|
|
+ if (jsonObject.getInteger("code") == 200) {
|
|
|
+ JSONArray data1 = jsonObject.getJSONObject("data").getJSONArray("list");
|
|
|
+ if (data1.size() > 0) {
|
|
|
+ sceneEntity.setSceneName(data1.getJSONObject(0).getString("sceneName"));
|
|
|
+ sceneService.updateById(sceneEntity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取四维看看用户场景列表
|
|
|
+ *
|
|
|
+ * @param scene
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation("获取场景数据")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name = "pageSize", value = "页数", dataType = "String")})
|
|
|
+ @RequestMapping(value = "/getAllSceneList", method = RequestMethod.POST)
|
|
|
+ @NoAuthentication
|
|
|
+ @AroundLog(name = "获取四维看看用户场景列表")
|
|
|
+ public Result getAllSceneList(@RequestBody RequestScene scene) {
|
|
|
+ PageInfo<SceneEntity> sceneEntityPageInfo = sceneService.findAllByStatus(scene);
|
|
|
+ return success(sceneEntityPageInfo);
|
|
|
+ }
|
|
|
+
|
|
|
}
|