|
@@ -1,11 +1,15 @@
|
|
package com.gis.web.controller;
|
|
package com.gis.web.controller;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.gis.common.util.RandomUtils;
|
|
import com.gis.common.util.Result;
|
|
import com.gis.common.util.Result;
|
|
import com.gis.domain.dto.*;
|
|
import com.gis.domain.dto.*;
|
|
import com.gis.domain.entity.SceneEntity;
|
|
import com.gis.domain.entity.SceneEntity;
|
|
|
|
+import com.gis.domain.entity.SceneInitEntity;
|
|
import com.gis.feign.HouseFeign;
|
|
import com.gis.feign.HouseFeign;
|
|
|
|
+import com.gis.mapper.SceneInitMapper;
|
|
import com.gis.mapper.SceneMapper;
|
|
import com.gis.mapper.SceneMapper;
|
|
|
|
+import com.gis.service.SceneInitService;
|
|
import com.gis.service.SceneService;
|
|
import com.gis.service.SceneService;
|
|
import com.gis.web.aop.WebControllerLog;
|
|
import com.gis.web.aop.WebControllerLog;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -13,6 +17,8 @@ import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.log4j.Log4j2;
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.shiro.crypto.hash.Hash;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -20,13 +26,14 @@ import org.springframework.web.multipart.MultipartFile;
|
|
import tk.mybatis.mapper.entity.Condition;
|
|
import tk.mybatis.mapper.entity.Condition;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* Created by owen on 2020/2/18 0018 12:17
|
|
* Created by owen on 2020/2/18 0018 12:17
|
|
*/
|
|
*/
|
|
-@Log4j2
|
|
|
|
|
|
+@Slf4j
|
|
@Api(tags = "公共")
|
|
@Api(tags = "公共")
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("fcb/pano/common")
|
|
@RequestMapping("fcb/pano/common")
|
|
@@ -41,6 +48,15 @@ public class CommonController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private SceneService sceneService;
|
|
private SceneService sceneService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ SceneMapper sceneMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ SceneInitMapper sceneInitMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ SceneInitService sceneInitService;
|
|
|
|
+
|
|
|
|
|
|
@ApiOperation(value = "检查token是否有效" , position = 3)
|
|
@ApiOperation(value = "检查token是否有效" , position = 3)
|
|
@GetMapping("checkToken")
|
|
@GetMapping("checkToken")
|
|
@@ -82,5 +98,53 @@ public class CommonController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 2021-3-22
|
|
|
|
+ * 更新没问题后,需要删除
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("更新初始场景旧数据")
|
|
|
|
+ @GetMapping("updateData")
|
|
|
|
+ public Result updateData() {
|
|
|
|
+ List<SceneEntity> list = sceneMapper.findAllByIndex();
|
|
|
|
+ log.info("初始场景数量: {}",list.size());
|
|
|
|
+ int i = 0;
|
|
|
|
+ for (SceneEntity entity : list) {
|
|
|
|
+
|
|
|
|
+ String sceneCode = entity.getSceneCode();
|
|
|
|
+ String houseId = entity.getHouseId();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ List<SceneInitEntity> inits = sceneInitMapper.findByHouseIdAndSceneCode(houseId, sceneCode);
|
|
|
|
+ if (inits.size() == 0) {
|
|
|
|
+ SceneInitEntity sceneInitEntity = new SceneInitEntity();
|
|
|
|
+ sceneInitEntity.setSceneCode(sceneCode);
|
|
|
|
+ sceneInitEntity.setHouseId(houseId);
|
|
|
|
+ sceneInitEntity.setId(RandomUtils.getUuid("init"));
|
|
|
|
+ sceneInitService.save(sceneInitEntity);
|
|
|
|
+ log.info("保存场景码: {}", sceneCode);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// if (i == 10) {
|
|
|
|
+// break;
|
|
|
|
+// }
|
|
|
|
+ i++;
|
|
|
|
+ }
|
|
|
|
+ log.info("更新数量: {}", i);
|
|
|
|
+ HashMap<String, Object> result = new HashMap<>();
|
|
|
|
+ result.put("size", i);
|
|
|
|
+ result.put("data", list);
|
|
|
|
+ return Result.success(result);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("查看初始场景旧数据")
|
|
|
|
+ @GetMapping("getData")
|
|
|
|
+ public Result getData() {
|
|
|
|
+ List<SceneInitEntity> inits = sceneInitService.findAll();
|
|
|
|
+ log.info("初始场景数量: {}",inits.size());
|
|
|
|
+ HashMap<String, Object> result = new HashMap<>();
|
|
|
|
+ result.put("size", inits.size());
|
|
|
|
+ result.put("data", inits);
|
|
|
|
+ return Result.success(result);
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|