|
@@ -102,53 +102,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;
|
|
|
|
|
|
+// /**
|
|
|
|
+// * 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);
|
|
// }
|
|
// }
|
|
- 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);
|
|
|
|
- }
|
|
|
|
|
|
+//
|
|
|
|
+//// 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);
|
|
|
|
+// }
|
|
|
|
|
|
}
|
|
}
|