Prechádzať zdrojové kódy

更新:
1.房车宝要通过全景图的场景码能获取到初始场景图片,因此修改初始场景图片的命名为场景码。
2.最多可以设置三个初始场景相关需求。

3.向伟玉提供场景链接接口。

wuweihao 4 rokov pred
rodič
commit
93e2c7ad30
23 zmenil súbory, kde vykonal 422 pridanie a 812 odobranie
  1. 9 137
      cms_pano_fcb/gis_common/src/main/java/com/gis/common/util/FileUtils.java
  2. 5 0
      cms_pano_fcb/gis_common/src/main/java/com/gis/common/util/RandomUtils.java
  3. 0 21
      cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/dto/LoginDto.java
  4. 0 21
      cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/dto/PasswordDto.java
  5. 0 39
      cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/dto/SceneDto.java
  6. 21 0
      cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/dto/SceneInitDto.java
  7. 0 51
      cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/entity/HouseEntity.java
  8. 30 0
      cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/entity/SceneInitEntity.java
  9. 0 58
      cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/entity/SysUserEntity.java
  10. 25 0
      cms_pano_fcb/gis_mapper/src/main/java/com/gis/mapper/SceneInitMapper.java
  11. 0 27
      cms_pano_fcb/gis_mapper/src/main/java/com/gis/mapper/SysUserMapper.java
  12. 22 0
      cms_pano_fcb/gis_service/src/main/java/com/gis/service/SceneInitService.java
  13. 2 5
      cms_pano_fcb/gis_service/src/main/java/com/gis/service/SceneService.java
  14. 0 21
      cms_pano_fcb/gis_service/src/main/java/com/gis/service/SysUserService.java
  15. 0 4
      cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/HouseServiceImpl.java
  16. 69 0
      cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneInitServiceImpl.java
  17. 132 122
      cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneServiceImpl.java
  18. 0 49
      cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SysUserServiceImpl.java
  19. 0 102
      cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/IndexController.java
  20. 55 37
      cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SceneController.java
  21. 47 0
      cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SceneInitController.java
  22. 0 118
      cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SysUserController.java
  23. 5 0
      cms_pano_fcb/remark.md

+ 9 - 137
cms_pano_fcb/gis_common/src/main/java/com/gis/common/util/FileUtils.java

@@ -27,9 +27,6 @@ import java.util.*;
 @Component
 public class FileUtils {
 
-    /** 临时文件存放目录*/
-    private final static String PROJECT_NAME = "cms_pano_fcb_dev_data/";
-
     @Autowired
     AliyunOssUtil aliyunOssUtil;
 
@@ -37,44 +34,6 @@ public class FileUtils {
     AsyncTask asyncTask;
 
 
-    /**
-     * 多文件上传
-     * savePath 路径(目录)
-     */
-    public static List<Map<String, String>> uploads(MultipartFile[] files, String savePath) throws IOException {
-        if (files == null) {
-            log.error("文件不能为空");
-            return null;
-        }
-
-        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
-        savePath = savePath + time + File.separator;
-//        FileUtil.mkdir(time);
-
-        ArrayList<Map<String, String>> list = new ArrayList<>();
-
-        String path;
-        int i = 0;
-        for (MultipartFile file : files) {
-            String fileName = file.getOriginalFilename();
-            String suffix = StringUtils.substringAfterLast(fileName, ".");
-            String newName = time + "_" + i + "."  +suffix;
-            path = savePath + newName;
-            FileUtil.writeFromStream(file.getInputStream(), path);
-
-            HashMap<String, String> fileInfo = new HashMap<>();
-            fileInfo.put("path", path);
-            fileInfo.put("name", fileName);
-            fileInfo.put("newName", newName);
-            fileInfo.put("dir", time);
-
-            list.add(fileInfo);
-            ++ i;
-        }
-
-        return list;
-
-    }
 
 
     /**
@@ -163,40 +122,7 @@ public class FileUtils {
     }
 
 
-    /**
-     * 重命名文件上传
-     * @param file
-     * @param savePath
-     * @return
-     * @throws IOException
-     */
-    public static String renameUpload(MultipartFile file, String savePath, String baseUrl)  {
-        if (file == null) {
-            log.error("文件不能为空");
-            return null;
-        }
 
-        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
-
-        String fileName = file.getOriginalFilename();
-
-
-
-        String suffix = StringUtils.substringAfterLast(fileName, ".");
-        String newName = time  + "."  +suffix;
-        savePath = savePath  + newName;
-
-        try {
-            FileUtil.writeFromStream(file.getInputStream(), savePath);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-
-        String path = StringUtils.substringAfterLast(savePath, PROJECT_NAME);
-
-        return baseUrl+ PROJECT_NAME +path;
-
-    }
 
     /***
      * 文件上传oss
@@ -307,8 +233,6 @@ public class FileUtils {
 
 
 
-
-
     /***
      * 文件上传oss, 返回文件名跟地址
      * @param file
@@ -364,61 +288,7 @@ public class FileUtils {
     }
 
 
-    /**
-     * 文件上传,用来上传指定文档,应用程序需要不同的文件,特意针对他们设计
-     * @param file
-     * @param savePath
-     * @param ossBasePath
-     * @param ossDomain
-     * @param type sample:样本文档, empty:空白文档
-     * @param code 用来做目录的,如果code为空,创建code; 不为空,就把文件放到code目录里
-     * @return
-     */
-    public  Map renameUploadOssMap(MultipartFile file, String savePath, String ossBasePath, String ossDomain, String type, String code)  {
-        if (file == null) {
-            log.error("文件不能为空");
-            return null;
-        }
-
-        // 创建目录码
-        if (StringUtils.isBlank(code)) {
-            code = getCode();
-        }
-
-        String fileName = file.getOriginalFilename();
-
-        HashMap<String, String> result = new HashMap<>();
-        result.put("fileName", fileName);
-
-        String dirType = "doc/" + code + "/";
-
-        String suffix = StringUtils.substringAfterLast(fileName, ".");
-        String newName = type  + "."  +suffix;
-        savePath = savePath + dirType + newName;
-
-        log.info("savePath: {}", savePath);
-
-        try {
-            FileUtil.writeFromStream(file.getInputStream(), savePath);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-
-        // 上传oss
-        String ossPath = ossBasePath + dirType + newName;
-//        AliyunOssUtil.upload(savePath, ossPath);
-        aliyunOssUtil.upload(savePath, ossPath);
-        // code 是用来区分表格是否放在同一目录
-        String ossUrl = ossDomain + ossPath + "?code=" +code;
-        log.info("ossUrl: {}", ossUrl);
-        result.put("ossUrl", ossUrl);
-
-        // 删除服务器临时文件
-        FileUtil.del(savePath);
 
-        return result;
-
-    }
 
     /**
      * 场景码
@@ -471,23 +341,25 @@ public class FileUtils {
      * @param ossDomain
      * @return
      */
-    public  String compressImgAndUploadOss2(String inputFilePath, String ossBasePath, String ossDomain){
-        String serverBasePath = StringUtils.substringBeforeLast(inputFilePath, "/");
+    public  String compressImgAndUploadOss2(
+            String inputFilePath, String serverBasePath, String ossBasePath, String ossDomain, Integer width, Integer height, String fileName){
+//        String serverBasePath = StringUtils.substringBeforeLast(inputFilePath, "/");
 
-        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
-        String suffix = StringUtils.substringAfterLast(inputFilePath, ".");
-        String fileName ="/thumb_"+ time  + "."  +suffix;
+//        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+//        String suffix = StringUtils.substringAfterLast(inputFilePath, ".");
+//        String fileName ="/thumb_"+ time  + "."  +suffix;
 
         // 保存图片位置
         String saveCompressImgPath = serverBasePath + fileName;
+        log.info("saveCompressImgPath: " + saveCompressImgPath);
         String ossUrl = null;
         try {
-            Img.from(new File(inputFilePath)).scale(600, 300).write(new File(saveCompressImgPath));
+            Img.from(new File(inputFilePath)).scale(width, height).write(new File(saveCompressImgPath));
             log.info("图片压缩成功: " + saveCompressImgPath);
 
             if (FileUtil.isFile(saveCompressImgPath)) {
                 // 上传oss
-                String ossPath = ossBasePath + "image" + fileName;
+                String ossPath = ossBasePath  + fileName;
                 log.info("ossPath: " + ossPath);
                 asyncTask.uploadOss(saveCompressImgPath, ossPath);
                 ossUrl = ossDomain + ossPath;

+ 5 - 0
cms_pano_fcb/gis_common/src/main/java/com/gis/common/util/RandomUtils.java

@@ -32,6 +32,11 @@ public class RandomUtils {
 
     }
 
+    public static String getUuid(String prefix){
+        return SnowFlakeUUidUtils.generaUUid(null, null, prefix);
+
+    }
+
     private static String randowInt(int length){
         String baseString = "0123456789";
         return RandomUtil.randomString(baseString, length);

+ 0 - 21
cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/dto/LoginDto.java

@@ -1,21 +0,0 @@
-package com.gis.domain.dto;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.validation.constraints.NotNull;
-
-/**
- * Created by owen on 2020/5/9 0009 12:20
- */
-@Data
-public class LoginDto {
-
-    @NotNull(message = "用户名不能为空")
-    @ApiModelProperty(value = "用户名", name = "userName", required = true)
-    private String userName;
-
-    @NotNull(message = "密码不能为空")
-    @ApiModelProperty(value = "密码", name = "password", required = true)
-    private String password;
-}

+ 0 - 21
cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/dto/PasswordDto.java

@@ -1,21 +0,0 @@
-package com.gis.domain.dto;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-
-/**
- * Created by owen on 2020/11/18 0018 18:28
- */
-@Data
-public class PasswordDto {
-
-    @NotBlank(message = "旧密码不能为空")
-    @ApiModelProperty(value = "旧密码", name = "oldPassword", required = true)
-    private String oldPassword;
-
-    @NotBlank(message = "新密码不能为空")
-    @ApiModelProperty(value = "新密码", name = "newPassword", required = true)
-    private String newPassword;
-}

+ 0 - 39
cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/dto/SceneDto.java

@@ -1,39 +0,0 @@
-package com.gis.domain.dto;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-
-/**
- * Created by owen on 2020/5/28 0028 16:36
- */
-@Data
-public class SceneDto {
-
-    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
-    private String id;
-
-    @NotBlank(message = "标题不能为空")
-    @ApiModelProperty(value = "场景名称", required = true)
-    private String sceneTitle;
-
-    @ApiModelProperty(value = "简介")
-    private String description;
-
-    @ApiModelProperty(value = "类型, 楼盘:building, 园林:garden, 户型:house")
-    private String type;
-
-    @ApiModelProperty(value = "楼盘id")
-    private String houseId;
-
-    @ApiModelProperty(value = "webSite")
-    private String webSite;
-
-    @NotBlank(message = "封面图不能为空")
-    @ApiModelProperty(value = "封面图", required = true)
-    private String icon;
-
-
-
-}

+ 21 - 0
cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/dto/SceneInitDto.java

@@ -0,0 +1,21 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/5/28 0028 16:36
+ */
+@Data
+public class SceneInitDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private String id;
+
+    @ApiModelProperty(value = "场景码")
+    private String sceneCode;
+
+    @ApiModelProperty(value = "楼盘id")
+    private String houseId;
+
+}

+ 0 - 51
cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/entity/HouseEntity.java

@@ -1,51 +0,0 @@
-package com.gis.domain.entity;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.persistence.Entity;
-import javax.persistence.Table;
-import java.io.Serializable;
-
-@Data
-@Entity
-@Table(name = "tb_house")
-public class HouseEntity extends BaseEntity implements Serializable {
-
-    private static final long serialVersionUID = -8093446477843493947L;
-
-
-    @ApiModelProperty(value = "场景码")
-    private String sceneCode;
-
-    @ApiModelProperty(value = "存放地址")
-    private String path;
-
-    @ApiModelProperty(value = "场景名称")
-    private String sceneTitle;
-
-    @ApiModelProperty(value = "场景url")
-    private String webSite;
-
-    @ApiModelProperty(value = "简介")
-    private String description;
-
-    @ApiModelProperty(value = "oss存放地址")
-    private String ossPath;
-
-    @ApiModelProperty(value = "状态 1:切图中, 2:失败, 3:完成")
-    private Integer status;
-
-    @ApiModelProperty(value = "类型, 楼盘:building, 园林:garden, 户型:house")
-    private String type;
-
-    @ApiModelProperty(value = "楼盘id")
-    private String houseId;
-
-    @ApiModelProperty(value = "创建人")
-    private String createUserId;
-
-    @ApiModelProperty(value = "封面图")
-    private String icon;
-
-}

+ 30 - 0
cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/entity/SceneInitEntity.java

@@ -0,0 +1,30 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 初始场景实体
+ */
+@Data
+@Entity
+@Table(name = "tb_scene_init")
+public class SceneInitEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446477843493947L;
+
+    @ApiModelProperty(value = "场景码")
+    private String sceneCode;
+
+    @ApiModelProperty(value = "楼盘id")
+    private String houseId;
+
+
+
+
+
+}

+ 0 - 58
cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/entity/SysUserEntity.java

@@ -1,58 +0,0 @@
-//package com.gis.domain.entity;
-//
-//import com.alibaba.fastjson.annotation.JSONField;
-//import io.swagger.annotations.ApiModelProperty;
-//import lombok.Data;
-//
-//import javax.persistence.Entity;
-//import javax.persistence.Table;
-//import java.io.Serializable;
-//
-///**
-// * 用户表
-// */
-//@Data
-//@Entity
-//@Table(name = "sys_user")
-//public class SysUserEntity extends BaseEntity implements Serializable {
-//
-//    private static final long serialVersionUID = -853504493430501564L;
-//
-//    @ApiModelProperty(value = "用户名")
-//    private String userName;
-//
-//    @JSONField(serialize = false)
-//    private String password;
-//
-//    @ApiModelProperty(value = "真实姓名")
-//    private String realName;
-//
-////    @ApiModelProperty(value = "用户编号")
-////    private Integer userNum;
-//
-//    @ApiModelProperty(value = "性别 0:男  1:女")
-//    private Integer sex;
-//
-//    @ApiModelProperty(value = "邮箱")
-//    private String phone;
-//
-//    @ApiModelProperty(value = "状态 0:启用  1:停用 2:注销")
-//    private Integer status;
-//
-//    @ApiModelProperty(value = "邮箱")
-//    private String email;
-//
-//    @ApiModelProperty(value = "部门id")
-//    private Long deptId;
-//
-//    @ApiModelProperty(value = "管理者,0:是, 1:否")
-//    private Integer manager;
-//
-////    @JSONField(serialize = false)
-////    @ApiModelProperty(value = "登录次数")
-////    private Integer viewCount;
-//
-//
-//
-//
-//}

+ 25 - 0
cms_pano_fcb/gis_mapper/src/main/java/com/gis/mapper/SceneInitMapper.java

@@ -0,0 +1,25 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.SceneInitEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+@Component
+@Mapper
+public interface SceneInitMapper extends IBaseMapper<SceneInitEntity, String> {
+
+    @Select("select * from tb_scene_init where is_delete = 0 and house_id = #{houseId}")
+    List<SceneInitEntity> findByHouseId(String houseId);
+
+    @Update("UPDATE tb_scene_init SET is_delete = 1 where is_delete = 0 AND house_id = #{houseId}")
+    void removeByHouseId(String houseId);
+
+    @Update("UPDATE tb_scene_init SET is_delete = 1 where is_delete = 0 AND house_id = #{houseId} AND scene_code = #{sceneCode}")
+    void removeByHouseIdAndSceneCode(String houseId, String sceneCode);
+}

+ 0 - 27
cms_pano_fcb/gis_mapper/src/main/java/com/gis/mapper/SysUserMapper.java

@@ -1,27 +0,0 @@
-//package com.gis.mapper;
-//
-//
-//import com.gis.domain.entity.SysUserEntity;
-//import org.apache.ibatis.annotations.Mapper;
-//import org.apache.ibatis.annotations.Select;
-//import org.apache.ibatis.annotations.SelectProvider;
-//import org.springframework.stereotype.Component;
-//
-//import java.util.List;
-//
-//@Component
-//@Mapper
-//public interface SysUserMapper extends IBaseMapper<SysUserEntity, Long> {
-//
-////    @SelectProvider(type = UserProvider.class, method = "findAllBySearchKey")
-////    List<UserResponse> findAllBySearchKey(String searchKey);
-//
-//    @Select(value = "select * from sys_user where rec_status = 'A' AND user_name= #{userName}")
-//    SysUserEntity findByUserName(String userName);
-//
-//    @Select(value = "select * from sys_user where rec_status = 'A' AND phone = #{phone}")
-//    SysUserEntity findByPhone(String phone);
-////
-////    @SelectProvider(type = UserProvider.class, method = "findBySearchKey")
-////    List<UserEntity> findBySearchKey(String searchKey);
-//}

+ 22 - 0
cms_pano_fcb/gis_service/src/main/java/com/gis/service/SceneInitService.java

@@ -0,0 +1,22 @@
+package com.gis.service;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.dto.SceneInitDto;
+import com.gis.domain.entity.SceneInitEntity;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface SceneInitService extends IBaseService<SceneInitEntity, String> {
+
+
+    Result saveEntity(SceneInitDto param);
+
+    List<SceneInitEntity> findByHouseId(String houseId);
+
+    void removeByHouseIdAndSceneCode(String houseId, String sceneCode);
+}

+ 2 - 5
cms_pano_fcb/gis_service/src/main/java/com/gis/service/SceneService.java

@@ -28,9 +28,6 @@ public interface SceneService extends IBaseService<SceneEntity, String> {
 
     Result saveVrModel(VrModelDto param);
 
-
-    Result uploadMedia(MultipartFile file, String sceneCode);
-
     Result upload(MultipartFile file);
 
     Result editXml(XmlDataDto param);
@@ -59,8 +56,6 @@ public interface SceneService extends IBaseService<SceneEntity, String> {
 
     Result findAllHouseIdIndex(HouseIndexPageDto param);
 
-//    Result checkStatus(String houseId, String status);
-
     JSONObject jsonSearch(ScenePageDto param);
 
     Result saveUseHots(UseHotsDto param);
@@ -72,4 +67,6 @@ public interface SceneService extends IBaseService<SceneEntity, String> {
     Result saveGardenVrModel(GardenVrModelDto param);
 
     Result updateIcon(String sceneCode, String icon);
+
+    Result uploadFixedName(MultipartFile file, String sceneCode);
 }

+ 0 - 21
cms_pano_fcb/gis_service/src/main/java/com/gis/service/SysUserService.java

@@ -1,21 +0,0 @@
-//package com.gis.service;
-//
-//
-//import com.gis.domain.entity.SysUserEntity;
-//
-//import java.util.List;
-//
-//
-///**
-// * Created by owen on 2020/3/11 0011 16:14
-// */
-//public interface SysUserService extends IBaseService<SysUserEntity, Long> {
-//
-////    List<UserResponse> findAllBySearchKey(PageDto param);
-//
-//    SysUserEntity findByUserName(String userName);
-//
-//    SysUserEntity findByPhone(String phone);
-//
-////    List<UserEntity> findBySearchKey(PageRequest param);
-//}

+ 0 - 4
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/HouseServiceImpl.java

@@ -1,9 +1,5 @@
 package com.gis.service.impl;
 
-import com.gis.common.constant.ConfigConstant;
-import com.gis.common.task.AsyncTask;
-import com.gis.common.util.AliyunOssUtil;
-import com.gis.common.util.FileUtils;
 import com.gis.common.util.Result;
 import com.gis.domain.entity.SceneEntity;
 import com.gis.feign.HouseFeign;

+ 69 - 0
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneInitServiceImpl.java

@@ -0,0 +1,69 @@
+package com.gis.service.impl;
+
+import com.gis.common.util.RandomUtils;
+import com.gis.common.util.Result;
+import com.gis.domain.dto.SceneInitDto;
+import com.gis.domain.entity.SceneInitEntity;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.SceneInitMapper;
+import com.gis.service.SceneInitService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.transaction.Transactional;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/18 0011 16:16
+ */
+@Slf4j
+@Service
+@Transactional
+public class SceneInitServiceImpl extends IBaseServiceImpl<SceneInitEntity, String> implements SceneInitService {
+
+    @Autowired
+    private SceneInitMapper entityMapper;
+
+    @Override
+    public IBaseMapper<SceneInitEntity, String> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+
+    @Override
+    public Result saveEntity(SceneInitDto param) {
+        SceneInitEntity entity = null;
+        String id = param.getId();
+        if (id == null) {
+            entity = new SceneInitEntity();
+            BeanUtils.copyProperties(param, entity);
+            entity.setId(RandomUtils.getUuid("init"));
+            this.save(entity);
+        } else {
+            entity = this.findById(id);
+            if (entity == null) {
+                return Result.failure("对象不存在: {}" +  id);
+            }
+
+            BeanUtils.copyProperties(param, entity);
+            entity.setUpdateTime(new Date());
+            this.update(entity);
+        }
+
+        return Result.success(entity);
+    }
+
+    @Override
+    public List<SceneInitEntity> findByHouseId(String houseId) {
+        return entityMapper.findByHouseId(houseId);
+    }
+
+    @Override
+    public void removeByHouseIdAndSceneCode(String houseId, String sceneCode) {
+        entityMapper.removeByHouseIdAndSceneCode(houseId, sceneCode);
+    }
+}

+ 132 - 122
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneServiceImpl.java

@@ -3,19 +3,20 @@ package com.gis.service.impl;
 import cn.hutool.core.io.FileTypeUtil;
 import cn.hutool.core.io.FileUtil;
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.gis.common.constant.ConfigConstant;
 import com.gis.common.constant.RabbitConfig;
 import com.gis.common.task.AsyncTask;
 import com.gis.common.util.*;
 import com.gis.domain.dto.*;
 import com.gis.domain.entity.SceneEntity;
+import com.gis.domain.entity.SceneInitEntity;
 import com.gis.feign.HouseFeign;
 import com.gis.feign.SceneProFeign;
 import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.SceneInitMapper;
 import com.gis.mapper.SceneMapper;
+import com.gis.service.SceneInitService;
 import com.gis.service.SceneService;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
@@ -46,6 +47,12 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
     private SceneMapper entityMapper;
 
     @Autowired
+    SceneInitMapper sceneInitMapper;
+
+    @Autowired
+    SceneInitService sceneInitService;
+
+    @Autowired
     private RabbitTemplate rabbitTemplate;
 
     @Autowired
@@ -150,7 +157,10 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
             // 缩略图,使用切图那个thumb.jpg
             // 压缩图片并上传oss
-            String iconPath = fileUtils.compressImgAndUploadOss2(panoPath, configConstant.ossBasePath, configConstant.ossDomain);
+//            String iconPath = fileUtils.compressImgAndUploadOss2(panoPath, configConstant.ossBasePath, configConstant.ossDomain);
+            // 全景图缩略图统一命名规则: http:// oss/cms_pano_fcb/image/thumb_sceneCode.jpg
+            String iconPath = fileUtils.compressImgAndUploadOss2(
+                    panoPath, configConstant.filePath, configConstant.ossBasePath, configConstant.ossDomain, 600, 300, "image/thumb_"+sceneCode+".jpg");
 //            String iconPath = fileUtils.compressImgAndUploadOss(panoPath, configConstant.ossBasePath, configConstant.ossDomain);
             log.info("iconPath:" + iconPath);
             entity.setIcon(iconPath);
@@ -173,7 +183,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 //            SceneEntity index = entityMapper.getIndex(houseId);
             List<SceneEntity> index = entityMapper.getIndex(houseId);
             if (index.size() == 0) {
-                log.info("需要设置更新场景码到VR项目");
+                log.info("更新hengdaId到管理后台");
                 entity.setIsIndex(1);
 
                 // 更新到VR项目
@@ -352,7 +362,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             return resStatus;
         }
 
-
         SceneEntity entity = null;
 
         List<SceneEntity> index = entityMapper.getIndex(param.getHouseId());
@@ -415,6 +424,27 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
     }
 
     @Override
+    public Result uploadFixedName(MultipartFile file, String sceneCode) {
+
+        // 检查非法文件上传
+        boolean checkFile = FileUtils.checkFile(file);
+        if (!checkFile) {
+            return Result.failure("上传文件格式有误, 请重新上传");
+        }
+
+        String ossPath = configConstant.ossBasePath + "image/thumb_"+sceneCode+".jpg";
+        try {
+            aliyunOssUtil.upload(file.getBytes(), ossPath);
+            Object ossUrl = configConstant.ossDomain + ossPath;
+            log.info("ossUrl: {}", ossUrl);
+            return Result.success(ossUrl);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return Result.failure("上传失败");
+    }
+
+    @Override
     public Result saveUseHots(UseHotsDto param) {
         String id = param.getId();
         SceneEntity entity = this.findById(id);
@@ -602,6 +632,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
     @Override
     public Result houseRemove(String houseId) {
         entityMapper.houseRemove(houseId);
+        sceneInitMapper.removeByHouseId(houseId);
         return Result.success();
     }
 
@@ -814,6 +845,10 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             entity.setStatus(3);
             entity.setWebSite(webSite);
             this.save(entity);
+
+            // 该VR项目下如果没有设置任何初始场景,把户型设置为默认初始场景
+            checkSceneInit(houseId, sceneCode);
+
             log.info("保存VR模型完成");
         } else {
             entity = this.findById(id);
@@ -826,43 +861,21 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
     }
 
 
-
-    @Override
-    public Result uploadMedia(MultipartFile file, String sceneCode) {
-        if (file == null) {
-            log.error("文件不能为空");
-            return Result.failure("文件不能为空");
-        }
-
-        SceneEntity entity = this.findById(sceneCode);
-        if (entity == null) {
-            log.error("场景不存在: {}", sceneCode);
-            return Result.failure("场景不存在");
+    // 该VR项目下如果没有设置任何初始场景,把户型设置为默认初始场景
+    private void checkSceneInit(String houseId, String sceneCode){
+        List<SceneInitEntity> list = sceneInitService.findByHouseId(houseId);
+        if (list.size() == 0){
+            SceneInitEntity entity = new SceneInitEntity();
+            entity.setId(RandomUtils.getUuid("init"));
+            entity.setHouseId(houseId);
+            entity.setSceneCode(sceneCode);
+            sceneInitService.save(entity);
         }
+    }
 
-        String basePath = entity.getPath() ;
-        basePath = StringUtils.substringBeforeLast(basePath, "/") + "/media/" ;
-
-
-        String originalFilename = file.getOriginalFilename();
-
-        String filePath = basePath + originalFilename;
-        try {
-            file.transferTo(new File(filePath));
-            log.info("文件写入成功: {}", filePath);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
 
-        // 上传到oss
-        String ossUploadPath = configConstant.ossBasePath + sceneCode + "/media/" + originalFilename;
-        String ossPath = configConstant.ossDomain + ossUploadPath;
 
-        asyncTask.uploadOss(filePath, ossUploadPath);
 
-        log.info("文件上传到oss完成: {}", ossPath);
-        return Result.success(ossPath);
-    }
 
     @Override
     public Result upload(MultipartFile file) {
@@ -875,9 +888,68 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         return Result.success(fileUtils.renameUploadOss(file, configConstant.filePath, configConstant.ossBasePath, configConstant.ossDomain));
     }
 
+//    @Override
+//    public Result editXml(XmlDataDto param) {
+//        long start = System.currentTimeMillis();
+//        String id = param.getId();
+////        SceneEntity entity = findById(id);
+//        SceneEntity entity = entityMapper.findByIdForUpdate(id);
+//        if (entity == null) {
+//            log.error("对象不存在,id : " + id);
+//            return Result.failure("场景码不存在");
+//        }
+//
+//
+//        // 检查VR项目状态
+//        String houseId = entity.getHouseId();
+//        Result resStatus =  getHouseStatus(houseId);
+//        if (resStatus != null) {
+//            return resStatus;
+//        }
+//
+//
+//        // 注意网络下载会有缓存,必须加时间戳
+//        // http://ossxiaoan.4dage.com/cms_pano_fcb/p19/fcb_px2rJW96F/vtour/tour.xml
+//        String tourOssUrl = entity.getOssPath() + "/vtour/tour.xml?m=" + System.currentTimeMillis();
+//        log.info("网络下载文件地址: {}", tourOssUrl);
+//        String fileName = "tour2.xml";
+//        String filePath = entity.getPath();
+//        String localBasePath = StringUtils.substringBeforeLast(filePath, "/");
+//        FileUtils.downLoadFromUrl(tourOssUrl, fileName, localBasePath);
+//        log.info("网络下载成功: {}", localBasePath+ "/tour2.xml");
+//
+//        // 编辑xml, 修改初始角度
+//        String inPath = localBasePath + "/tour2.xml";
+//        String outPath = localBasePath + "/tour.xml";
+//        String hlookat = param.getHlookat();
+//        String vlookat = param.getVlookat();
+//        streamEditFile(inPath, outPath, hlookat, vlookat);
+//        log.info("编辑xml, 修改初始角度完毕");
+//
+//        String tourOssSavePath = configConstant.ossBasePath + entity.getHouseId() + "/" + entity.getSceneCode() + "/vtour/tour.xml";
+//        log.info("osspath: " + tourOssSavePath);
+//        aliyunOssUtil.upload(outPath, tourOssSavePath);
+////        asyncTask.uploadOss(outPath, tourOssSavePath);
+//        long end = System.currentTimeMillis();
+//        log.info("tour.xml 上传oss完成, 共耗时: " + (end-start)/1000 + " s");
+//
+//        // 保存初始视觉
+//        JSONObject jsonObject = new JSONObject();
+//        jsonObject.put("hlookat", hlookat);
+//        jsonObject.put("vlookat", vlookat);
+//        entity.setInitVisual(jsonObject.toJSONString());
+//
+//        this.update(entity);
+//
+//
+//
+//        return Result.success(entity.getOssPath());
+//    }
+
+
     @Override
     public Result editXml(XmlDataDto param) {
-        long start = System.currentTimeMillis();
+//        long start = System.currentTimeMillis();
         String id = param.getId();
 //        SceneEntity entity = findById(id);
         SceneEntity entity = entityMapper.findByIdForUpdate(id);
@@ -897,39 +969,37 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
         // 注意网络下载会有缓存,必须加时间戳
         // http://ossxiaoan.4dage.com/cms_pano_fcb/p19/fcb_px2rJW96F/vtour/tour.xml
-        String tourOssUrl = entity.getOssPath() + "/vtour/tour.xml?m=" + System.currentTimeMillis();
-        log.info("网络下载文件地址: {}", tourOssUrl);
-        String fileName = "tour2.xml";
-        String filePath = entity.getPath();
-        String localBasePath = StringUtils.substringBeforeLast(filePath, "/");
-        FileUtils.downLoadFromUrl(tourOssUrl, fileName, localBasePath);
-        log.info("网络下载成功: {}", localBasePath+ "/tour2.xml");
+//        String tourOssUrl = entity.getOssPath() + "/vtour/tour.xml?m=" + System.currentTimeMillis();
+//        log.info("网络下载文件地址: {}", tourOssUrl);
+//        String fileName = "tour2.xml";
+//        String filePath = entity.getPath();
+//        String localBasePath = StringUtils.substringBeforeLast(filePath, "/");
+//        FileUtils.downLoadFromUrl(tourOssUrl, fileName, localBasePath);
+//        log.info("网络下载成功: {}", localBasePath+ "/tour2.xml");
 
         // 编辑xml, 修改初始角度
-        String inPath = localBasePath + "/tour2.xml";
-        String outPath = localBasePath + "/tour.xml";
-        String hlookat = param.getHlookat();
-        String vlookat = param.getVlookat();
-        streamEditFile(inPath, outPath, hlookat, vlookat);
-        log.info("编辑xml, 修改初始角度完毕");
-
-        String tourOssSavePath = configConstant.ossBasePath + entity.getHouseId() + "/" + entity.getSceneCode() + "/vtour/tour.xml";
-        log.info("osspath: " + tourOssSavePath);
-        aliyunOssUtil.upload(outPath, tourOssSavePath);
-//        asyncTask.uploadOss(outPath, tourOssSavePath);
-        long end = System.currentTimeMillis();
-        log.info("tour.xml 上传oss完成, 共耗时: " + (end-start)/1000 + " s");
+//        String inPath = localBasePath + "/tour2.xml";
+//        String outPath = localBasePath + "/tour.xml";
+//        String hlookat = param.getHlookat();
+//        String vlookat = param.getVlookat();
+//        streamEditFile(inPath, outPath, hlookat, vlookat);
+//        log.info("编辑xml, 修改初始角度完毕");
+//
+//        String tourOssSavePath = configConstant.ossBasePath + entity.getHouseId() + "/" + entity.getSceneCode() + "/vtour/tour.xml";
+//        log.info("osspath: " + tourOssSavePath);
+//        aliyunOssUtil.upload(outPath, tourOssSavePath);
+////        asyncTask.uploadOss(outPath, tourOssSavePath);
+//        long end = System.currentTimeMillis();
+//        log.info("tour.xml 上传oss完成, 共耗时: " + (end-start)/1000 + " s");
 
         // 保存初始视觉
         JSONObject jsonObject = new JSONObject();
-        jsonObject.put("hlookat", hlookat);
-        jsonObject.put("vlookat", vlookat);
+        jsonObject.put("hlookat", param.getHlookat());
+        jsonObject.put("vlookat", param.getVlookat());
         entity.setInitVisual(jsonObject.toJSONString());
 
         this.update(entity);
 
-
-
         return Result.success(entity.getOssPath());
     }
 
@@ -992,66 +1062,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         }
     }
 
-    /**
-     * 流处理数据
-     * 这方法写出的结果第一行会少结果
-     * @param inPath
-     * @param outPath
-     */
-    public static void streamEditFile2(String inPath, String outPath, String hlookat, String vlookat) {
-        // 4*4矩阵
-
-        BufferedReader reader = null;
-        try {
-            InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(inPath), "UTF-8");
-            reader = new BufferedReader(inputStreamReader);
-
-
-            // 输出缓冲流
-            BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(outPath));
-
-            String tempString = null;
-
-            // 转数组
-            while ((tempString = reader.readLine()) != null) {
-//                log.info("line: " + tempString);
-                tempString = tempString.replace("\t", "");
-
-                if (tempString.contains("<view hlookat=")) {
-
-                    String start = StringUtils.substring(tempString, 0, 5);
-                    String end = StringUtils.substringAfter(tempString, "fovtype");
-
-                    StringBuffer buffer = new StringBuffer();
-                    buffer.append(start);
-                    buffer.append(" hlookat=").append("\"").append(hlookat).append("\"");
-                    buffer.append(" vlookat=").append("\"").append(vlookat).append("\"");
-                    buffer.append(" fovtype");
-                    buffer.append(end);
-                    // 写文件
-                    tempString = buffer.toString();
-                    log.info("temp: " + tempString);
-                }
-                log.warn("write: " + tempString);
-                stream.write(tempString.getBytes(), 0, tempString.length() );
-                // 换行写入
-                stream.write("\r\n".getBytes());
-            }
-            stream.flush();
-            reader.close();
-            stream.close();
-        } catch (IOException ex) {
-            ex.printStackTrace();
-        } finally {
-            if (reader != null) {
-                try {
-                    reader.close();
-                } catch (IOException ex) {
-                    ex.printStackTrace();
-                }
-            }
-        }
-    }
 
 
     @Test

+ 0 - 49
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SysUserServiceImpl.java

@@ -1,49 +0,0 @@
-//package com.gis.service.impl;
-//
-//import com.gis.domain.entity.SysUserEntity;
-//import com.gis.mapper.IBaseMapper;
-//import com.gis.mapper.SysUserMapper;
-//import com.gis.service.SysUserService;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.stereotype.Service;
-//
-//import java.util.List;
-//
-//
-///**
-// * Created by owen on 2020/3/11 0011 16:16
-// */
-//@Service
-//public class SysUserServiceImpl extends IBaseServiceImpl<SysUserEntity, Long> implements SysUserService {
-//
-//    @Autowired
-//    private SysUserMapper entityMapper;
-//
-//    @Override
-//    public IBaseMapper<SysUserEntity, Long> getBaseMapper() {
-//        return this.entityMapper;
-//    }
-//
-////    @Override
-////    public List<UserResponse> findAllBySearchKey(PageDto param) {
-////        PageHelper.startPage(param.getPageNum(), param.getPageSize());
-////        return entityMapper.findAllBySearchKey(param.getSearchKey());
-////    }
-//
-//    @Override
-//    public SysUserEntity findByUserName(String userName) {
-//        return entityMapper.findByUserName(userName);
-//    }
-//
-//    @Override
-//    public SysUserEntity findByPhone(String phone) {
-//        return entityMapper.findByPhone(phone);
-//    }
-////
-////    @Override
-////    public List<UserEntity> findBySearchKey(PageRequest param) {
-////        return entityMapper.findBySearchKey(param.getSearchKey());
-////    }
-//
-//
-//}

+ 0 - 102
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/IndexController.java

@@ -1,102 +0,0 @@
-//package com.gis.web.controller;
-//
-//import com.gis.common.constant.TypeCode;
-//import com.gis.common.util.PasswordUtils;
-//import com.gis.common.util.Result;
-//import com.gis.domain.dto.LoginDto;
-//import com.gis.domain.entity.SysUserEntity;
-//import com.gis.service.SysUserService;
-//import com.gis.web.shiro.JwtUtil;
-//import io.swagger.annotations.Api;
-//import io.swagger.annotations.ApiOperation;
-//import lombok.extern.log4j.Log4j2;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.data.redis.core.RedisTemplate;
-//import org.springframework.web.bind.annotation.GetMapping;
-//import org.springframework.web.bind.annotation.PostMapping;
-//import org.springframework.web.bind.annotation.RequestBody;
-//import org.springframework.web.bind.annotation.RestController;
-//
-//import javax.validation.Valid;
-//import java.util.HashMap;
-//import java.util.concurrent.TimeUnit;
-//
-///**
-// * Created by owen on 2020/2/19 0019 15:53
-// */
-//@Api(tags = "登录")
-//@RestController
-//@Log4j2
-//public class IndexController extends BaseController{
-//
-//
-//
-//    // -1 不限时间
-//    private static Integer TOKEN_EXPIRE = -1 ;
-//
-//
-//    @Autowired
-//    private SysUserService userService;
-//
-//    @Autowired
-//    private RedisTemplate<String, String> redisTemplate;
-//
-//    @ApiOperation("登录")
-//    @PostMapping(value = "admin/login")
-//    public Result login(@Valid @RequestBody LoginDto param)  {
-//
-//        // 1.获取用户
-//        SysUserEntity entity = userService.findByUserName(param.getUserName());
-//        if (entity == null){
-//            log.error("用户不存在");
-//            return Result.failure("用户不存在");
-//        }
-//        // 验证密码,解密出来是明文密码,在跟输入密码比较
-//        boolean decryptName = PasswordUtils.decrypt(entity.getPassword(), param.getPassword(), PasswordUtils.getStaticSalt());
-//        if (!decryptName) {
-//            log.error("密码错误");
-//            return Result.failure("密码错误");
-//        }
-//
-//        // 检查账号是否启用
-//        if (entity.getStatus() != 0) {
-//            log.error("账号已停用: {}", entity.getUserName());
-//            return Result.failure("账号已停用");
-//        }
-//
-//        // 创建新token
-//        HashMap<String, Object> tokenMap = new HashMap<>();
-//        tokenMap.put("userName", entity.getUserName());
-//        tokenMap.put("id", entity.getId());
-//        tokenMap.put("manager", entity.getManager());
-//
-//        // 创建新token
-//        String token = JwtUtil.createJWT(TOKEN_EXPIRE, tokenMap);
-//
-//        HashMap<String, Object> result = new HashMap<>();
-//        result.put("user", entity);
-//        result.put("token", token);
-//
-//        // 更新到 redis, 有效期24h, 旧token无效, 用来处理退出登录
-//        redisTemplate.opsForValue().set(TypeCode.REDIS_TOKEN + token, token, Long.parseLong("23"), TimeUnit.HOURS);
-//
-//
-//        return Result.success(result);
-//
-//    }
-//
-//    @ApiOperation("退出")
-//    @GetMapping("admin/logout")
-//    public Result logout() {
-//        String token = getToken();
-//        if (token == null) {
-//            log.info("token is null");
-//        }
-//        redisTemplate.delete(TypeCode.REDIS_TOKEN + token);
-//        return Result.success();
-//    }
-//
-//
-//
-//
-//}

+ 55 - 37
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SceneController.java

@@ -7,6 +7,7 @@ import com.gis.domain.dto.*;
 import com.gis.domain.entity.SceneEntity;
 import com.gis.feign.HouseFeign;
 import com.gis.mapper.SceneMapper;
+import com.gis.service.SceneInitService;
 import com.gis.service.SceneService;
 import com.gis.web.aop.WebControllerLog;
 import io.swagger.annotations.Api;
@@ -14,7 +15,6 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.log4j.Log4j2;
-import org.checkerframework.checker.units.qual.C;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -32,7 +32,6 @@ import java.util.Map;
 @Api(tags = "场景管理")
 @RestController
 @RequestMapping("fcb/pano/scene")
-//@RequestMapping("a/pano/scene")
 public class SceneController extends BaseController {
 
     @Autowired
@@ -44,6 +43,8 @@ public class SceneController extends BaseController {
     @Autowired
     private SceneMapper sceneMapper;
 
+    @Autowired
+    SceneInitService sceneInitService;
 
     @ApiOperation(value = "保存关联场景热点", position = 1, notes = "sceneCodes:场景关联的场景码")
     @PostMapping("save/useHots")
@@ -79,7 +80,6 @@ public class SceneController extends BaseController {
      * @param type
      * @return 恒大id 唯一入口
      */
-//    @WebControllerLog(description = "场景管理-创建场景")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "houseId", value = "房源id", dataType = "String", required = true),
             @ApiImplicitParam(name = "type", value = "场景类型, 楼盘:building, 园林:garden, 户型:house", dataType = "String"),
@@ -97,7 +97,6 @@ public class SceneController extends BaseController {
         return sceneService.uploadPanoRabbitMq(file, houseId, type, hengdaId);
     }
 
-//    @WebControllerLog(description = "场景管理-场景排序")
     @ApiOperation(value = "场景排序")
     @PostMapping(value = "setSort")
     public Result setSort(@RequestBody Map<String, String> param) {
@@ -113,6 +112,14 @@ public class SceneController extends BaseController {
         return sceneService.upload(file);
     }
 
+
+    @ApiOperation(value = "初始画面-上传", position = 2)
+    @PostMapping(value = "uploadIndexImg/{sceneCode}")
+    public Result uploadIndexImg(@RequestParam("file") MultipartFile file, @PathVariable String sceneCode) {
+        log.info("上传图片");
+        return sceneService.uploadFixedName(file, sceneCode);
+    }
+
     @WebControllerLog(description = "VR项目-编辑VR项目")
     @ApiOperation(value = "VR项目修改", position = 3, notes = "修改VR项目的基础信息")
     @PostMapping("house/edit")
@@ -127,7 +134,6 @@ public class SceneController extends BaseController {
      * @param status
      * @return
      */
-//    @WebControllerLog(description = "场景管理-VR项目审核通过/下线")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "houseId", value = "房源id", dataType = "String", required = true),
             @ApiImplicitParam(name = "status", value = "状态, 审核通过/上线:4, 下线:3", dataType = "String"),
@@ -138,7 +144,6 @@ public class SceneController extends BaseController {
         return sceneService.houseAudit(houseId, status);
     }
 
-//    @WebControllerLog(description = "场景管理-VR项目删除")
     @ApiOperation(value = "VR项目删除", position = 3, notes = "删除VR项目时,把相应场景设置为删除状态")
     @GetMapping("house/remove/{houseId}")
     public Result houseRemove(@PathVariable String houseId) {
@@ -146,25 +151,36 @@ public class SceneController extends BaseController {
         return sceneService.houseRemove(houseId);
     }
 
-//    @WebControllerLog(description = "场景管理-编辑场景")
     @ApiOperation(value = "编辑someData,(重命名)", position = 3)
     @PostMapping("editSomeData")
     public Result editSomeData(@Valid @RequestBody EditSomeDataDto param) {
         return sceneService.editSomeData(param);
     }
 
-    @ApiOperation(value = "首页设置", position = 3)
-    @PostMapping("setIndex/{id}")
-    public Result setIndex(@PathVariable String id) {
-        return sceneService.setIndex(id);
-    }
 
+
+
+    /**
+     * 2021-03-18 估计不用
+     * @param houseId
+     * @return
+     */
     @ApiOperation(value = "首页获取", position = 3)
     @GetMapping("getIndex/{houseId}")
     public Result getIndex(@PathVariable String houseId) {
         return sceneService.getIndex(houseId);
     }
 
+    /**
+     * 2021-03-18 估计不用
+     * @return
+     */
+    @ApiOperation(value = "首页设置", position = 3)
+    @PostMapping("setIndex/{id}")
+    public Result setIndex(@PathVariable String id) {
+        return sceneService.setIndex(id);
+    }
+
 
     /**
      * 提供恒大管理后台使用
@@ -248,7 +264,6 @@ public class SceneController extends BaseController {
         return Result.success(flag);
     }
 
-//    @WebControllerLog(description = "场景管理-保存VR模型")
     @ApiOperation("VR模型保存")
     @PostMapping("saveVrModel")
     public Result saveVrModel(@Valid @RequestBody VrModelDto param) {
@@ -262,7 +277,6 @@ public class SceneController extends BaseController {
         return sceneService.saveGardenVrModel(param);
     }
 
-//    @WebControllerLog(description = "场景管理-保存初始画面")
     @ApiOperation("保存初始画面")
     @PostMapping("saveIndex")
     @ApiImplicitParams({
@@ -307,7 +321,6 @@ public class SceneController extends BaseController {
     }
 
 
-//    @WebControllerLog(description = "场景管理-场景删除")
     @ApiOperation(value = "场景删除", notes = "判断VR项目关联场景、关联热点等判断")
     @GetMapping("removes/{id}")
     public Result remove(@PathVariable String id) {
@@ -334,25 +347,30 @@ public class SceneController extends BaseController {
 
         sceneService.update(entity);
 
-        boolean flag = false;
+        // 删除相应初始场景
+        sceneInitService.removeByHouseIdAndSceneCode(houseId, sceneCode);
+
+
+
+//        boolean flag = false;
 
         // 更新首页
-        List<SceneEntity> buildingList = sceneMapper.findByHouseIdAndType(houseId, "building");
-        List<SceneEntity> gardenList = sceneMapper.findByHouseIdAndType(houseId, "garden");
-        List<SceneEntity> houseList = sceneMapper.findByHouseIdAndType(houseId, "house");
-
-        // 顺序不能变
-        SceneEntity IndexEntity = null;
-        if (buildingList.size() > 0) {
-            IndexEntity = setInitIndex(buildingList);
-            flag = true;
-        } else if (gardenList.size() > 0) {
-            IndexEntity = setInitIndex(gardenList);
-            flag = true;
-        } else if (houseList.size() > 0) {
-            flag = true;
-            IndexEntity = setInitIndex(houseList);
-        }
+//        List<SceneEntity> buildingList = sceneMapper.findByHouseIdAndType(houseId, "building");
+//        List<SceneEntity> gardenList = sceneMapper.findByHouseIdAndType(houseId, "garden");
+//        List<SceneEntity> houseList = sceneMapper.findByHouseIdAndType(houseId, "house");
+//
+//        // 顺序不能变
+//        SceneEntity IndexEntity = null;
+//        if (buildingList.size() > 0) {
+//            IndexEntity = setInitIndex(buildingList);
+//            flag = true;
+//        } else if (gardenList.size() > 0) {
+//            IndexEntity = setInitIndex(gardenList);
+//            flag = true;
+//        } else if (houseList.size() > 0) {
+//            flag = true;
+//            IndexEntity = setInitIndex(houseList);
+//        }
 
 
         // todo 2021-3-8 测试一下是否要更新初始场景到伟玉那边
@@ -397,10 +415,10 @@ public class SceneController extends BaseController {
      * @return
      */
 //    @WebControllerLog(description = "场景管理-获取样本间")
-    @ApiOperation(value = "获取样本间", notes = "调用恒大接口")
-    @PostMapping("findRoom/{houseId}")
-    public Result findRoom(@PathVariable String houseId) {
-        return sceneService.findRoom(houseId);
-    }
+//    @ApiOperation(value = "获取样本间", notes = "调用恒大接口")
+//    @PostMapping("findRoom/{houseId}")
+//    public Result findRoom(@PathVariable String houseId) {
+//        return sceneService.findRoom(houseId);
+//    }
 
 }

+ 47 - 0
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SceneInitController.java

@@ -0,0 +1,47 @@
+package com.gis.web.controller;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.dto.SceneInitDto;
+import com.gis.domain.entity.SceneInitEntity;
+import com.gis.service.HouseService;
+import com.gis.service.SceneInitService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/2/18 0018 12:17
+ */
+@Api(tags = "初始场景管理")
+@RestController
+@RequestMapping("fcb/pano/init")
+public class SceneInitController extends BaseController {
+
+    @Autowired
+    private SceneInitService sceneInitService;
+
+
+    @ApiOperation(value = "保存")
+    @PostMapping("save")
+    public Result save(@RequestBody SceneInitDto param) {
+        return sceneInitService.saveEntity(param);
+    }
+
+
+    @ApiOperation(value = "列表")
+    @GetMapping("list/{houseId}")
+    public Result list(@PathVariable String houseId) {
+        List<SceneInitEntity> list = sceneInitService.findByHouseId(houseId);
+        return Result.success(list);
+    }
+
+}

+ 0 - 118
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SysUserController.java

@@ -1,118 +0,0 @@
-//package com.gis.web.controller;
-//
-//
-//import com.gis.common.util.PasswordUtils;
-//import com.gis.common.util.Result;
-//import com.gis.domain.dto.PageDto;
-//import com.gis.domain.dto.PasswordDto;
-//import com.gis.domain.dto.UserDto;
-//import com.gis.domain.entity.SysUserEntity;
-//import com.gis.service.SysUserService;
-//import com.gis.web.shiro.JwtUtil;
-//import com.github.pagehelper.PageInfo;
-//import io.swagger.annotations.Api;
-//import io.swagger.annotations.ApiOperation;
-//import lombok.extern.log4j.Log4j2;
-//import org.springframework.beans.BeanUtils;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.data.redis.core.RedisTemplate;
-//import org.springframework.web.bind.annotation.*;
-//
-//import javax.validation.Valid;
-//import java.util.Date;
-//
-//
-///**
-// * Created by owen on 2020/2/18 0018 12:17
-// */
-//@Log4j2
-//@Api(tags = "用户管理")
-//@RestController
-//@RequestMapping("manage/user")
-//public class SysUserController extends BaseController {
-//
-//    @Autowired
-//    public SysUserService userService;
-//
-//
-//    @Autowired
-//    public RedisTemplate<Object, Object> redisTemplate;
-//
-//
-//
-//    @ApiOperation("修改密码")
-//    @PostMapping("updatePwd")
-//    public Result updatePwd(@Valid @RequestBody PasswordDto param) {
-//
-//        SysUserEntity user = userService.findByUserName(JwtUtil.getUsername(getToken()));
-//
-//        // 验证原密码
-//        Boolean isBoolean = PasswordUtils.decrypt(user.getPassword(), param.getOldPassword(), PasswordUtils.getStaticSalt());
-//        if (!isBoolean) {
-//            log.error("原始密码错误");
-//            return Result.failure("原始密码错误");
-//        }
-//
-//        user.setPassword(PasswordUtils.encrypt(user.getUserName(), param.getNewPassword(), PasswordUtils.getStaticSalt()));
-//        user.setUpdateTime(new Date());
-//        userService.update(user);
-//        return Result.success();
-//    }
-//
-//    @ApiOperation("重置密码")
-//    @GetMapping("resetPass/{id}")
-//    public Result resetPass(@PathVariable Long id) {
-//        SysUserEntity user = userService.findById(id);
-//
-//        if (user == null) {
-//            log.error("用户不存在: {}", id);
-//            return Result.failure("用户不存在");
-//        }
-//
-//        user.setPassword(PasswordUtils.encrypt(user.getUserName(), "123456", PasswordUtils.getStaticSalt()));
-//        user.setUpdateTime(new Date());
-//        userService.update(user);
-//        return Result.success();
-//    }
-//
-//
-//        @ApiOperation("用户列表")
-//    @PostMapping("list")
-//    public Result<SysUserEntity> list(@RequestBody PageDto param) {
-//        startPage(param);
-//        PageInfo<SysUserEntity> page = new PageInfo<>(userService.findAll());
-//        return Result.success(page);
-//    }
-//
-//    @ApiOperation("新增/修改用户信息")
-//    @PostMapping("save")
-//    public Result save(@Valid @RequestBody UserDto param) {
-//
-//        SysUserEntity entity = null;
-//        if (param.getId() == null) {
-//            entity = userService.findByUserName(param.getUserName());
-//            if (entity != null) {
-//                return Result.failure("用户名已存在");
-//            }
-//            entity = new SysUserEntity();
-//            BeanUtils.copyProperties(param, entity);
-//            entity.setPassword(PasswordUtils.encrypt(param.getUserName(), "123456", PasswordUtils.getStaticSalt()));
-//            userService.save(entity);
-//        } else {
-//            entity = userService.findById(param.getId());
-//            if (entity == null) {
-//                log.error("用户不存在: {}", param.getId());
-//                return Result.failure("用户不存在");
-//            }
-//            BeanUtils.copyProperties(param, entity);
-//            entity.setUpdateTime(new Date());
-//            userService.update(entity);
-//        }
-//
-//        return Result.success();
-//    }
-//
-//
-//
-//
-//}

+ 5 - 0
cms_pano_fcb/remark.md

@@ -100,6 +100,11 @@ sit:
    测试切图工具命令
    krpanotools makepano -config=templates/vtour-multires.config /mnt/cms_pano_fcb_data/test/test.jpg
    
+   rabbit mq 控制台
+   http://10.71.5.164:15672/
+   账户:admin
+   密码:fcb@admin_4dage
+   
    更新代码工具
    
    何颖