|
@@ -1,530 +0,0 @@
|
|
-package com.sxz.base;
|
|
|
|
-
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
-import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
|
-import com.sxz.base.ChangeingApplication;
|
|
|
|
-import com.sxz.base.entity.*;
|
|
|
|
-import com.sxz.base.mapper.IZhiSceneNumMapper;
|
|
|
|
-import com.sxz.base.service.*;
|
|
|
|
-import com.sxz.base.util.*;
|
|
|
|
-import com.sxz.base.vo.response.ResponseRenovationBuild;
|
|
|
|
-import com.sxz.base.vo.response.ResponseRenovationBuildDetail;
|
|
|
|
-import com.sxz.base.vo.response.ResponseRenovationParts;
|
|
|
|
-import com.sxz.base.vo.response.ResponseRenovationPartsDetail;
|
|
|
|
-import org.junit.Test;
|
|
|
|
-import org.junit.runner.RunWith;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
|
-import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
-import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
-
|
|
|
|
-import java.io.File;
|
|
|
|
-import java.util.*;
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * Created by Hb_zzZ on 2020/8/12.
|
|
|
|
- */
|
|
|
|
-@RunWith(SpringRunner.class)
|
|
|
|
-@SpringBootTest(classes = ChangeingApplication.class)
|
|
|
|
-public class JunitTest {
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private UploadToOssUtil uploadToOssUtil;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private IRenovationPartsService renovationPartsService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private IRenovationPartsTypeService renovationPartsTypeService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private IRenovationPartsDetailService renovationPartsDetailService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private IRenovationPartsAttachingService renovationPartsAttachingService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private IRenovationPartsSizeService renovationPartsSizeService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private IRenovationBuildService renovationBuildService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private IRenovationBuildDetailService renovationBuildDetailService;
|
|
|
|
-
|
|
|
|
-// @Autowired
|
|
|
|
-// private IAddressMapper addressMapper;
|
|
|
|
-
|
|
|
|
- @Qualifier("IZhiSceneNumMapper")
|
|
|
|
- @Autowired
|
|
|
|
- private IZhiSceneNumMapper zhiSceneNumMapper;
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void insertRenovationParts(){
|
|
|
|
- try{
|
|
|
|
- String data = FileUtils.readFile("C:\\Users\\hisun\\Downloads\\left(10).json");
|
|
|
|
-
|
|
|
|
- JSONArray array = JSON.parseArray(data);
|
|
|
|
- JSONObject object = null;
|
|
|
|
- RenovationPartsEntity renovationPartsEntity = null;
|
|
|
|
-
|
|
|
|
- JSONArray typeArray = null;
|
|
|
|
- JSONObject typeObject = null;
|
|
|
|
- RenovationPartsTypeEntity renovationPartsTypeEntity = null;
|
|
|
|
-
|
|
|
|
- JSONArray detailArray = null;
|
|
|
|
- JSONObject detailObject = null;
|
|
|
|
- RenovationPartsDetailEntity renovationPartsDetailEntity = null;
|
|
|
|
-
|
|
|
|
- JSONObject editingJson = null;
|
|
|
|
- JSONObject sizeJson = null;
|
|
|
|
-
|
|
|
|
- RenovationPartsAttachingEntity renovationPartsAttachingEntity = null;
|
|
|
|
- RenovationPartsSizeEntity renovationPartsSizeEntity = null;
|
|
|
|
-
|
|
|
|
- for(int i = 0, len = array.size(); i < len; i++){
|
|
|
|
- object = array.getJSONObject(i);
|
|
|
|
- renovationPartsEntity = new RenovationPartsEntity();
|
|
|
|
- renovationPartsEntity.setName(object.getString("name"));
|
|
|
|
- renovationPartsEntity.setDescription(object.getString("text"));
|
|
|
|
- renovationPartsEntity.setType(object.getString("type"));
|
|
|
|
-
|
|
|
|
- renovationPartsService.save(renovationPartsEntity);
|
|
|
|
-
|
|
|
|
- typeArray = object.getJSONArray("childrens");
|
|
|
|
- for(int j = 0, len1 = typeArray.size(); j < len1; j++){
|
|
|
|
- typeObject = typeArray.getJSONObject(j);
|
|
|
|
- renovationPartsTypeEntity = new RenovationPartsTypeEntity();
|
|
|
|
- renovationPartsTypeEntity.setPartsId(renovationPartsEntity.getId());
|
|
|
|
- renovationPartsTypeEntity.setDescription(typeObject.getString("text"));
|
|
|
|
- renovationPartsTypeEntity.setKeyWord(typeObject.getString("key"));
|
|
|
|
- renovationPartsTypeEntity.setType(typeObject.getString("type"));
|
|
|
|
- renovationPartsTypeEntity.setImg(typeObject.getString("img"));
|
|
|
|
- renovationPartsTypeService.save(renovationPartsTypeEntity);
|
|
|
|
-
|
|
|
|
- detailArray = typeObject.getJSONArray("childrens");
|
|
|
|
- for (int k = 0, len2 = detailArray.size(); k < len2; k++){
|
|
|
|
- detailObject = detailArray.getJSONObject(k);
|
|
|
|
- renovationPartsDetailEntity = new RenovationPartsDetailEntity();
|
|
|
|
- renovationPartsDetailEntity.setPartsTypeId(renovationPartsTypeEntity.getId());
|
|
|
|
- renovationPartsDetailEntity.setDescription(detailObject.getString("text"));
|
|
|
|
- renovationPartsDetailEntity.setKeyWord(detailObject.getString("key"));
|
|
|
|
- renovationPartsDetailEntity.setType(detailObject.getString("type"));
|
|
|
|
- renovationPartsDetailEntity.setImg(detailObject.getString("img"));
|
|
|
|
- renovationPartsDetailEntity.setHighImg(detailObject.getString("highImg"));
|
|
|
|
- renovationPartsDetailEntity.setPath(detailObject.getString("path"));
|
|
|
|
- renovationPartsDetailEntity.setName(detailObject.getString("name"));
|
|
|
|
- renovationPartsDetailEntity.setZhName(detailObject.getString("zhName"));
|
|
|
|
- renovationPartsDetailService.save(renovationPartsDetailEntity);
|
|
|
|
-
|
|
|
|
- editingJson = detailObject.getJSONObject("editing");
|
|
|
|
- renovationPartsAttachingEntity = new RenovationPartsAttachingEntity();
|
|
|
|
- renovationPartsAttachingEntity.setPartsDetailId(renovationPartsDetailEntity.getId());
|
|
|
|
- renovationPartsAttachingEntity.setCeilAttaching(editingJson.getBooleanValue("ceilAttaching"));
|
|
|
|
- renovationPartsAttachingEntity.setWallAttaching(editingJson.getBooleanValue("wallAttaching"));
|
|
|
|
- renovationPartsAttachingEntity.setFloorAttaching(editingJson.getBooleanValue("floorAttaching"));
|
|
|
|
- renovationPartsAttachingService.save(renovationPartsAttachingEntity);
|
|
|
|
-
|
|
|
|
- sizeJson = detailObject.getJSONObject("size");
|
|
|
|
- renovationPartsSizeEntity = new RenovationPartsSizeEntity();
|
|
|
|
- renovationPartsSizeEntity.setPartsDetailId(renovationPartsDetailEntity.getId());
|
|
|
|
- renovationPartsSizeEntity.setX(sizeJson.getIntValue("x"));
|
|
|
|
- renovationPartsSizeEntity.setY(sizeJson.getIntValue("y"));
|
|
|
|
- renovationPartsSizeEntity.setZ(sizeJson.getIntValue("z"));
|
|
|
|
- renovationPartsSizeService.save(renovationPartsSizeEntity);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-// JSONObject object = JSON.parseObject(data);
|
|
|
|
- System.out.println("添加完成!");
|
|
|
|
- }catch (Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void insertRenovationBuild(){
|
|
|
|
- try{
|
|
|
|
- String data = FileUtils.readFile("C:\\Users\\hisun\\Downloads\\result.json");
|
|
|
|
-
|
|
|
|
- JSONArray array = JSON.parseArray(data);
|
|
|
|
- JSONObject object = null;
|
|
|
|
-
|
|
|
|
- JSONArray detailArray = null;
|
|
|
|
- JSONObject detailObject = null;
|
|
|
|
-
|
|
|
|
- RenovationBuildEntity buildEntity = null;
|
|
|
|
- RenovationBuildDetailEntity buildDetailEntity = null;
|
|
|
|
- for(int i = 0, len = array.size(); i < len; i++){
|
|
|
|
- object = array.getJSONObject(i);
|
|
|
|
-
|
|
|
|
- buildEntity = new RenovationBuildEntity();
|
|
|
|
- buildEntity.setName(object.getString("name"));
|
|
|
|
- buildEntity.setKeyWord(object.getString("keyword"));
|
|
|
|
- renovationBuildService.save(buildEntity);
|
|
|
|
-
|
|
|
|
- detailArray = object.getJSONArray("childrens");
|
|
|
|
- for(int j = 0, len1 = detailArray.size(); j < len1; j++){
|
|
|
|
- detailObject = detailArray.getJSONObject(j);
|
|
|
|
- buildDetailEntity = new RenovationBuildDetailEntity();
|
|
|
|
- buildDetailEntity.setBuildId(buildEntity.getId());
|
|
|
|
- buildDetailEntity.setName(detailObject.getString("name"));
|
|
|
|
- buildDetailEntity.setThumbnail(detailObject.getString("thumbnail"));
|
|
|
|
- buildDetailEntity.setOriginImg(detailObject.getString("origin_img"));
|
|
|
|
- buildDetailEntity.setKeyWord(detailObject.getString("keyWord"));
|
|
|
|
- renovationBuildDetailService.save(buildDetailEntity);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }catch (Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void getRenovationPartsList(){
|
|
|
|
- List<ResponseRenovationParts> result = renovationPartsService.getRenovationPartsList();
|
|
|
|
-
|
|
|
|
- System.out.println(JSONArray.toJSON(result));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void getRenovationBuildList(){
|
|
|
|
- List<ResponseRenovationBuild> renovationBuildList = renovationBuildService.getRenovationBuildList();
|
|
|
|
-
|
|
|
|
- System.out.println(JSONArray.toJSON(renovationBuildList));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void insertAttachingEntity(){
|
|
|
|
-
|
|
|
|
- for(int i = 493, len = 782; i < len; i++){
|
|
|
|
-
|
|
|
|
- RenovationPartsAttachingEntity renovationPartsAttachingEntity = new RenovationPartsAttachingEntity();
|
|
|
|
- renovationPartsAttachingEntity.setPartsDetailId((long)i);
|
|
|
|
- renovationPartsAttachingEntity.setCeilAttaching(false);
|
|
|
|
- renovationPartsAttachingEntity.setWallAttaching(false);
|
|
|
|
- renovationPartsAttachingService.save(renovationPartsAttachingEntity);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void findZhiSceneNumList(){
|
|
|
|
- Set<String> list = zhiSceneNumMapper.findAll();
|
|
|
|
-
|
|
|
|
- System.out.println(list.size());
|
|
|
|
-
|
|
|
|
- Set<String> newNum = new HashSet<>();
|
|
|
|
- String num = "";
|
|
|
|
- while (true){
|
|
|
|
-// num = "zh" + RandomUtil.generateShortUuid();
|
|
|
|
- num = RandomUtil.generateShortUuid();
|
|
|
|
- if(!list.contains(num)){
|
|
|
|
- newNum.add(num);
|
|
|
|
- }
|
|
|
|
- if(newNum.size() >= 10000){
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- ZhiSceneNum zhiSceneNum = new ZhiSceneNum();
|
|
|
|
- Date createTime = new Date();
|
|
|
|
- for(String n : newNum){
|
|
|
|
- zhiSceneNum = new ZhiSceneNum();
|
|
|
|
- zhiSceneNum.setCode(n);
|
|
|
|
- zhiSceneNum.setUsed(0);
|
|
|
|
- zhiSceneNum.setUpdateTime(createTime);
|
|
|
|
- zhiSceneNum.setCreateTime(createTime);
|
|
|
|
-// zhiSceneNumMapper.insertSelective(zhiSceneNum);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void updateJson() throws Exception{
|
|
|
|
- String path = "";
|
|
|
|
- String lightPath = "F:\\文档\\WeChat Files\\Iove-bing\\FileStorage\\File\\2020-11\\vr-t-ZAuqgFB-004\\decoration.json";
|
|
|
|
- String sceneNum = "vr-t-ZAuqgFB-004";
|
|
|
|
-
|
|
|
|
- File file = null;
|
|
|
|
- File lightFile = new File(lightPath);
|
|
|
|
-
|
|
|
|
- JSONObject object = null;
|
|
|
|
- JSONObject lightObject = null;
|
|
|
|
-
|
|
|
|
- JSONArray furniture = null;
|
|
|
|
- JSONArray walls = null;
|
|
|
|
- JSONArray rooms = null;
|
|
|
|
- JSONArray lights = null;
|
|
|
|
- JSONArray windows = null;
|
|
|
|
- JSONArray doors = null;
|
|
|
|
-
|
|
|
|
- JSONObject assets = null;
|
|
|
|
- JSONArray materials = null;
|
|
|
|
- JSONObject wallpaper = null;
|
|
|
|
- JSONObject floor = null;
|
|
|
|
- JSONObject texture = null;
|
|
|
|
-
|
|
|
|
- String wallpaperStr = "";
|
|
|
|
- String textureStr = "";
|
|
|
|
-
|
|
|
|
- ResponseRenovationPartsDetail detail = null;
|
|
|
|
- ResponseRenovationBuildDetail buildDetail = null;
|
|
|
|
-
|
|
|
|
- String data = "";
|
|
|
|
- if(lightFile.exists()){
|
|
|
|
- data = FileUtils.readFile(lightPath);
|
|
|
|
- if(data.startsWith("{") && data.endsWith("}")){
|
|
|
|
-
|
|
|
|
- object = JSON.parseObject(data);
|
|
|
|
- if(object != null){
|
|
|
|
-
|
|
|
|
- furniture = object.getJSONArray("furniture");
|
|
|
|
- walls = object.getJSONArray("walls");
|
|
|
|
- rooms = object.getJSONArray("rooms");
|
|
|
|
- lights = object.getJSONArray("lights");
|
|
|
|
- windows = object.getJSONArray("windows");
|
|
|
|
- doors = object.getJSONArray("doors");
|
|
|
|
-
|
|
|
|
- if(furniture != null){
|
|
|
|
-
|
|
|
|
- for(int i = 0, len = furniture.size(); i < len; i++){
|
|
|
|
- if(furniture.getJSONObject(i).containsKey("assets")){
|
|
|
|
-
|
|
|
|
- assets = furniture.getJSONObject(i).getJSONObject("assets");
|
|
|
|
- if(assets.containsKey("name")){
|
|
|
|
- detail = renovationPartsDetailService.findByName(assets.getString("name"));
|
|
|
|
- if(detail != null){
|
|
|
|
- assets.put("previewUrl", detail.getImg());
|
|
|
|
- assets.put("url", detail.getHighImg());
|
|
|
|
- assets.put("path", detail.getPath());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-// if(walls != null){
|
|
|
|
-//
|
|
|
|
-// for(int i = 0, len = walls.size(); i < len; i++){
|
|
|
|
-// if(walls.getJSONObject(i).containsKey("materials") && walls.getJSONObject(i).containsKey("wallpaper")){
|
|
|
|
-//
|
|
|
|
-// materials = walls.getJSONObject(i).getJSONArray("materials");
|
|
|
|
-// for(int j = 0; j < materials.size(); j++){
|
|
|
|
-// wallpaper = materials.getJSONObject(j).getJSONObject("wallpaper");
|
|
|
|
-// if(wallpaper.containsKey("name")){
|
|
|
|
-// buildDetail = buildDetailService.findByName(wallpaper.getString("name"));
|
|
|
|
-// if(buildDetail != null){
|
|
|
|
-// wallpaper.put("previewUrl", buildDetail.getThumbnail());
|
|
|
|
-// wallpaper.put("url", buildDetail.getThumbnail());
|
|
|
|
-//// wallpaper.put("path", buildDetail.getPath());
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// if(rooms != null){
|
|
|
|
-//
|
|
|
|
-// for(int i = 0, len = rooms.size(); i < len; i++){
|
|
|
|
-// if(rooms.getJSONObject(i).containsKey("floor") && rooms.getJSONObject(i).containsKey("texture")){
|
|
|
|
-//
|
|
|
|
-// floor = rooms.getJSONObject(i).getJSONObject("floor");
|
|
|
|
-// texture = floor.getJSONObject("texture");
|
|
|
|
-//
|
|
|
|
-// if(texture.containsKey("name")){
|
|
|
|
-// buildDetail = buildDetailService.findByName(texture.getString("name"));
|
|
|
|
-// if(buildDetail != null){
|
|
|
|
-// texture.put("previewUrl", buildDetail.getThumbnail());
|
|
|
|
-// texture.put("url", buildDetail.getThumbnail());
|
|
|
|
-//// texture.put("path", buildDetail.getPath());
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
- if(walls != null){
|
|
|
|
-
|
|
|
|
- for(int i = 0, len = walls.size(); i < len; i++){
|
|
|
|
- if(walls.getJSONObject(i).containsKey("materials")){
|
|
|
|
-
|
|
|
|
- materials = walls.getJSONObject(i).getJSONArray("materials");
|
|
|
|
- for(int j = 0; j < materials.size(); j++){
|
|
|
|
- wallpaperStr = materials.getJSONObject(j).getString("wallpaper");
|
|
|
|
- wallpaper = new JSONObject();
|
|
|
|
- buildDetail = renovationBuildDetailService.findByName(wallpaperStr);
|
|
|
|
-// if(wallpaper.containsKey("name")){
|
|
|
|
- if(buildDetail != null){
|
|
|
|
- wallpaper.put("previewUrl", buildDetail.getThumbnail());
|
|
|
|
- wallpaper.put("url", buildDetail.getThumbnail());
|
|
|
|
- wallpaper.put("name", wallpaperStr);
|
|
|
|
- wallpaper.put("id", buildDetail.getId());
|
|
|
|
-// wallpaper.put("path", buildDetail.getPath());
|
|
|
|
- materials.getJSONObject(j).put("wallpaper", wallpaper);
|
|
|
|
- }
|
|
|
|
-// }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(rooms != null){
|
|
|
|
-
|
|
|
|
- for(int i = 0, len = rooms.size(); i < len; i++){
|
|
|
|
- if(rooms.getJSONObject(i).containsKey("floor") ){
|
|
|
|
-
|
|
|
|
- floor = rooms.getJSONObject(i).getJSONObject("floor");
|
|
|
|
- textureStr = floor.getString("texture");
|
|
|
|
- texture = new JSONObject();
|
|
|
|
-
|
|
|
|
- buildDetail = renovationBuildDetailService.findByName(textureStr);
|
|
|
|
-// if(texture.containsKey("name")){
|
|
|
|
- if(buildDetail != null){
|
|
|
|
- texture.put("previewUrl", buildDetail.getThumbnail());
|
|
|
|
- texture.put("url", buildDetail.getThumbnail());
|
|
|
|
- texture.put("id", buildDetail.getId());
|
|
|
|
- texture.put("name", textureStr);
|
|
|
|
-// texture.put("path", buildDetail.getPath());
|
|
|
|
- floor.put("texture", texture);
|
|
|
|
- }
|
|
|
|
-// }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(lights != null){
|
|
|
|
-
|
|
|
|
- for(int i = 0, len = lights.size(); i < len; i++){
|
|
|
|
- if(lights.getJSONObject(i).containsKey("assets")){
|
|
|
|
-
|
|
|
|
- assets = lights.getJSONObject(i).getJSONObject("assets");
|
|
|
|
- if(assets.containsKey("name")){
|
|
|
|
- detail = renovationPartsDetailService.findByName(assets.getString("name"));
|
|
|
|
- if(detail != null){
|
|
|
|
- assets.put("previewUrl", detail.getImg());
|
|
|
|
- assets.put("url", detail.getHighImg());
|
|
|
|
- assets.put("path", detail.getPath());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(windows != null){
|
|
|
|
-
|
|
|
|
- for(int i = 0, len = windows.size(); i < len; i++){
|
|
|
|
- if(windows.getJSONObject(i).containsKey("assets")){
|
|
|
|
-
|
|
|
|
- assets = windows.getJSONObject(i).getJSONObject("assets");
|
|
|
|
- if(assets.containsKey("name")){
|
|
|
|
- detail = renovationPartsDetailService.findByName(assets.getString("name"));
|
|
|
|
- if(detail != null){
|
|
|
|
- assets.put("previewUrl", detail.getImg());
|
|
|
|
- assets.put("url", detail.getHighImg());
|
|
|
|
- assets.put("path", detail.getPath());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(doors != null){
|
|
|
|
- for(int i = 0, len = doors.size(); i < len; i++){
|
|
|
|
- if(doors.getJSONObject(i).containsKey("assets")){
|
|
|
|
-
|
|
|
|
- assets = doors.getJSONObject(i).getJSONObject("assets");
|
|
|
|
- if(assets.containsKey("name")){
|
|
|
|
- detail = renovationPartsDetailService.findByName(assets.getString("name"));
|
|
|
|
- if(detail != null){
|
|
|
|
- assets.put("previewUrl", detail.getImg());
|
|
|
|
- assets.put("url", detail.getHighImg());
|
|
|
|
- assets.put("path", detail.getPath());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- FileUtils.writeFile(lightPath.replace("decoration.json", "decorationBack.json"), object.toString(SerializerFeature.WriteMapNullValue));
|
|
|
|
- uploadToOssUtil.upload(lightPath.replace("decoration.json", "decorationBack.json"),
|
|
|
|
- "data/data" + sceneNum + "/changeData/decoration.json");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// FileUtils.writeFile(lightPath, object.toJSONString());
|
|
|
|
-// uploadToOssUtil.upload(buildPath + sceneStyleEntity.getStyleNum() + "light/decoration.json",
|
|
|
|
-// "data/data" + sceneStyleEntity.getStyleNum() + "/proLightData/decoration.json");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void openUrl(){
|
|
|
|
- Set<String> set = new HashSet<>();
|
|
|
|
-
|
|
|
|
- for (String s : set) {
|
|
|
|
- System.out.println(s);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-// System.out.println(OkHttpUtils.httpGet("https://wenku.baidu.com/view/3572a0bcce7931b765ce0508763231126edb77e9.html"));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-// @Test
|
|
|
|
-// public void importData(){
|
|
|
|
-// ImportExeclUtil poi = new ImportExeclUtil();
|
|
|
|
-// List<List<String>> list = poi.read("C:\\Users\\hisun\\Downloads\\江门_二标四实\\户室.xlsx");
|
|
|
|
-//
|
|
|
|
-//// AddressEntity addressEntity = null;
|
|
|
|
-//// if (list != null) {
|
|
|
|
-//// for (int i = 0; i < list.size(); i++) {
|
|
|
|
-//// List<String> cellList = list.get(i);
|
|
|
|
-//// if(i == 0){
|
|
|
|
-//// continue;
|
|
|
|
-//// }
|
|
|
|
-////
|
|
|
|
-//// addressEntity = new AddressEntity();
|
|
|
|
-//// addressEntity.setId(cellList.get(0).toString().trim());
|
|
|
|
-//// addressEntity.setLongitude(cellList.get(1).toString().trim());
|
|
|
|
-//// addressEntity.setLatitude(cellList.get(2).toString().trim());
|
|
|
|
-//// addressEntity.setAddressName(cellList.get(3).toString().trim());
|
|
|
|
-//// addressEntity.setStandardAddress(cellList.get(4).toString().trim());
|
|
|
|
-//// addressEntity.setMainNumber(cellList.get(5).toString().trim());
|
|
|
|
-//// addressEntity.setAuxiliaryNumber(cellList.get(6).toString().trim());
|
|
|
|
-//// addressEntity.setBuildNumber(cellList.get(7).toString().trim());
|
|
|
|
-//// addressEntity.setBuildUnits(cellList.get(8).toString().trim());
|
|
|
|
-//// addressMapper.saveAddress(addressEntity);
|
|
|
|
-//// }
|
|
|
|
-////
|
|
|
|
-//// }
|
|
|
|
-//
|
|
|
|
-// HouseholdEntity householdEntity = null;
|
|
|
|
-// if (list != null) {
|
|
|
|
-// for (int i = 0; i < list.size(); i++) {
|
|
|
|
-// List<String> cellList = list.get(i);
|
|
|
|
-// if(i == 0){
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// householdEntity = new HouseholdEntity();
|
|
|
|
-// householdEntity.setId(cellList.get(0).toString().trim());
|
|
|
|
-// householdEntity.setAddressId(cellList.get(1).toString().trim());
|
|
|
|
-// householdEntity.setName(cellList.get(2).toString().trim());
|
|
|
|
-// householdEntity.setFloor(cellList.get(3).toString().trim());
|
|
|
|
-// householdEntity.setUnit(cellList.get(4).toString().trim());
|
|
|
|
-// householdEntity.setFloorAbbreviation(cellList.get(5).toString().trim());
|
|
|
|
-// householdEntity.setUnitAbbreviation(cellList.get(6).toString().trim());
|
|
|
|
-// householdEntity.setAddressMsg(cellList.get(7).toString().trim());
|
|
|
|
-// addressMapper.saveHousehold(householdEntity);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-}
|
|
|