فهرست منبع

更新:
dev-1.2 初始场景、经纪人开发完

wuweihao 4 سال پیش
والد
کامیت
9c2f76a297
18فایلهای تغییر یافته به همراه447 افزوده شده و 634 حذف شده
  1. 22 16
      cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/dto/SceneInitDto.java
  2. 9 2
      cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/entity/SceneEntity.java
  3. 2 2
      cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/entity/SceneInitEntity.java
  4. 50 0
      cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/vo/SceneInitVo.java
  5. 24 9
      cms_pano_fcb/gis_mapper/src/main/java/com/gis/mapper/SceneInitMapper.java
  6. 7 4
      cms_pano_fcb/gis_mapper/src/main/java/com/gis/mapper/SceneMapper.java
  7. 3 0
      cms_pano_fcb/gis_service/src/main/java/com/gis/feign/HouseFeign.java
  8. 9 3
      cms_pano_fcb/gis_service/src/main/java/com/gis/service/SceneInitService.java
  9. 7 4
      cms_pano_fcb/gis_service/src/main/java/com/gis/service/SceneService.java
  10. 26 8
      cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneInitServiceImpl.java
  11. 92 364
      cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneServiceImpl.java
  12. 4 0
      cms_pano_fcb/gis_web/src/main/java/com/gis/web/aop/WebControllerLog.java
  13. 91 56
      cms_pano_fcb/gis_web/src/main/java/com/gis/web/aop/WebLogAspect.java
  14. 62 57
      cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/CommonController.java
  15. 1 1
      cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/HouseController.java
  16. 23 106
      cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SceneController.java
  17. 3 2
      cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SceneInitController.java
  18. 12 0
      cms_pano_fcb/remark.md

+ 22 - 16
cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/dto/SceneInitDto.java

@@ -14,9 +14,9 @@ public class SceneInitDto {
     @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
     private String id;
 
-    @NotBlank(message = "场景码不能为空")
-    @ApiModelProperty(value = "场景码", required = true)
-    private String sceneCode;
+//    @NotBlank(message = "场景码不能为空")
+//    @ApiModelProperty(value = "场景码", required = true)
+//    private String sceneCode;
 
     @NotBlank(message = "楼盘id不能为空")
     @ApiModelProperty(value = "楼盘id", required = true)
@@ -25,19 +25,25 @@ public class SceneInitDto {
     @ApiModelProperty(value = "缩略图(管理后台用)")
     private String icon;
 
-    @ApiModelProperty(value = "类型, 楼盘:building, 园林:garden, 户型:house")
-    private String type;
+//    @ApiModelProperty(value = "类型, 楼盘:building, 园林:garden, 户型:house")
+//    private String type;
+//
+//    @ApiModelProperty(value = "场景名称")
+//    private String sceneTitle;
+//
+//    @ApiModelProperty(value = "样版间名称")
+//    private String roomName;
+//
+//    @ApiModelProperty(value = "场景url")
+//    private String webSite;
+//
+//    @ApiModelProperty(value =  "模型在全景园林显示byType=garden")
+//    private String byType;
+
+    /**2021-05-13 新增*/
+    @NotBlank(message = "场景id不能为空")
+    @ApiModelProperty(value = "场景id", required = true)
+    private String sceneId;
 
-    @ApiModelProperty(value = "场景名称")
-    private String sceneTitle;
-
-    @ApiModelProperty(value = "样版间名称")
-    private String roomName;
-
-    @ApiModelProperty(value = "场景url")
-    private String webSite;
-
-    @ApiModelProperty(value =  "模型在全景园林显示byType=garden")
-    private String byType;
 
 }

+ 9 - 2
cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/entity/SceneEntity.java

@@ -62,8 +62,7 @@ public class SceneEntity extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "样版间名称")
     private String roomName;
 
-    @ApiModelProperty(value = "恒大样本间id, 只有在house类型才有此数据")
-    private String roomId;
+
 
     /**
      * 只可以存一次,不能重复,重复需要删除旧数据
@@ -91,4 +90,12 @@ public class SceneEntity extends BaseEntity implements Serializable {
     private Integer isUseIndex = 0;
 
 
+    @ApiModelProperty(value = "恒大样本间id, 只有在house类型才有此数据")
+    private String roomId;
+
+    @ApiModelProperty(value = "恒大经纪人id(讲房顾问), 只有在house类型才有此数据")
+    private String agentId;
+
+
+
 }

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

@@ -23,8 +23,8 @@ public class SceneInitEntity extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "楼盘id")
     private String houseId;
 
-//    @ApiModelProperty(value = "楼盘id")
-//    private String sceneId;
+    @ApiModelProperty(value = "场景id")
+    private String sceneId;
 
 
 

+ 50 - 0
cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/vo/SceneInitVo.java

@@ -0,0 +1,50 @@
+package com.gis.domain.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2021-05-13 新增
+ */
+@Data
+public class SceneInitVo {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private String id;
+
+//    @NotBlank(message = "场景码不能为空")
+    @ApiModelProperty(value = "场景码", required = true)
+    private String sceneCode;
+
+    @NotBlank(message = "楼盘id不能为空")
+    @ApiModelProperty(value = "楼盘id", required = true)
+    private String houseId;
+
+    @ApiModelProperty(value = "缩略图(管理后台用)")
+    private String icon;
+
+    @ApiModelProperty(value = "类型, 楼盘:building, 园林:garden, 户型:house")
+    private String type;
+
+    @ApiModelProperty(value = "场景名称")
+    private String sceneTitle;
+
+    @ApiModelProperty(value = "样版间名称")
+    private String roomName;
+
+    @ApiModelProperty(value = "场景url")
+    private String webSite;
+
+    @ApiModelProperty(value =  "模型在全景园林显示byType=garden")
+    private String byType;
+
+    @ApiModelProperty(value = "场景id")
+    private String sceneId;
+
+    @ApiModelProperty(value = "样版间id")
+    private String roomId;
+
+
+}

+ 24 - 9
cms_pano_fcb/gis_mapper/src/main/java/com/gis/mapper/SceneInitMapper.java

@@ -3,6 +3,7 @@ package com.gis.mapper;
 
 import com.gis.domain.dto.SceneInitDto;
 import com.gis.domain.entity.SceneInitEntity;
+import com.gis.domain.vo.SceneInitVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -18,19 +19,33 @@ 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}")
+    @Update("UPDATE tb_scene_init SET is_delete = 1, update_time = NOW() 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);
+//    @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);
 
     // 按创建日期前三条信息
-    @Select("select a.id, a.house_id, a.scene_code, b.icon as icon, b.type as type, b.scene_title as sceneTitle, " +
-            "b.web_site as webSite, b.room_name as roomName, b.by_type as byType " +
-            " from tb_scene_init a left join tb_scene b on a.scene_code = b.scene_code AND a.house_id = b.house_id " +
+//    @Select("select a.id, a.house_id, a.scene_code, b.icon as icon, b.type as type, b.scene_title as sceneTitle, " +
+//            "b.web_site as webSite, b.room_name as roomName, b.by_type as byType " +
+//            " from tb_scene_init a left join tb_scene b on a.scene_code = b.scene_code AND a.house_id = b.house_id " +
+//            " where a.is_delete = 0 and a.house_id = #{houseId} and b.is_delete = 0 order by a.create_time asc limit 3")
+//    List<SceneInitDto> voFindByHouseId(String houseId);
+
+    // 按创建日期前三条信息
+    @Select("select a.id, a.house_id, b.scene_code, b.icon as icon, b.type as type, b.scene_title as sceneTitle, " +
+            "b.web_site as webSite, b.room_name as roomName, b.by_type as byType, b.id as sceneId, b.room_id as roomId " +
+            " from tb_scene_init a left join tb_scene b on a.scene_id = b.id AND a.house_id = b.house_id " +
             " where a.is_delete = 0 and a.house_id = #{houseId} and b.is_delete = 0 order by a.create_time asc limit 3")
-    List<SceneInitDto> voFindByHouseId(String houseId);
+    List<SceneInitVo> voFindByHouseId(String houseId);
+
+
+//    @Select("select * from tb_scene_init where is_delete = 0 and house_id = #{houseId} AND scene_code = #{sceneCode}")
+//    List<SceneInitEntity> findByHouseIdAndSceneCode(String houseId, String sceneCode);
+
+    @Select("select * from tb_scene_init where is_delete = 0 and house_id = #{houseId} AND scene_id = #{sceneId}")
+    List<SceneInitEntity> findByHouseIdAndSceneId(String houseId, String sceneId);
 
-    @Select("select * from tb_scene_init where is_delete = 0 and house_id = #{houseId} AND scene_code = #{sceneCode}")
-    List<SceneInitEntity> findByHouseIdAndSceneCode(String houseId, String sceneCode);
+    @Update("UPDATE tb_scene_init SET is_delete = 1, update_time = NOW() where is_delete = 0 AND house_id = #{houseId} AND scene_id = #{sceneId}")
+    void removeByHouseIdAndSceneId(String houseId, String sceneId);
 }

+ 7 - 4
cms_pano_fcb/gis_mapper/src/main/java/com/gis/mapper/SceneMapper.java

@@ -56,16 +56,16 @@ public interface SceneMapper extends IBaseMapper<SceneEntity, String> {
     @Select("select * from tb_scene where is_delete = 0 and house_id = #{houseId} and type = #{type} order by sort asc, create_time asc ")
     List<SceneEntity> findByHouseIdAndType(String houseId, String type);
 
-    @Update("UPDATE tb_scene SET sort=#{sort} where id = #{id}")
+    @Update("UPDATE tb_scene SET sort=#{sort} , update_time = NOW() where id = #{id}")
     void setSortById(String id, String sort);
 
     @Select("select scene_code from tb_scene where is_delete = 0 and status >= #{status} and type = #{type} and house_id = #{houseId}")
     List<String> getVrSceneCode(String houseId, String status, String type);
 
-    @Update("UPDATE tb_scene SET is_delete = 1 where is_delete = 0 AND house_id = #{houseId}")
+    @Update("UPDATE tb_scene SET is_delete = 1, update_time = NOW() where is_delete = 0 AND house_id = #{houseId}")
     void houseRemove(String houseId);
 
-    @Update("UPDATE tb_scene SET status = #{status} where is_delete = 0 AND house_id = #{houseId}")
+    @Update("UPDATE tb_scene SET status = #{status}, update_time = NOW() where is_delete = 0 AND house_id = #{houseId}")
     void houseAudit(String houseId, String status);
 
     @Select("select * from tb_scene where is_delete = 0 and status = #{status} and house_id = #{houseId}")
@@ -84,7 +84,7 @@ public interface SceneMapper extends IBaseMapper<SceneEntity, String> {
     @Select("select * from tb_scene where is_delete = 0 and house_id = #{houseId} and use_hots like #{sceneCode}")
     List<SceneEntity> searchUseHots(String houseId, String sceneCode);
 
-    @Update("UPDATE tb_scene SET icon = #{icon} where is_delete = 0 AND scene_code = #{sceneCode}")
+    @Update("UPDATE tb_scene SET icon = #{icon} , update_time = NOW() where is_delete = 0 AND scene_code = #{sceneCode}")
     void updateIcon(String sceneCode, String icon);
 
     @Select("select house_id, scene_title, is_index, scene_code, is_delete from tb_scene where is_delete = 0 and is_index=1")
@@ -92,4 +92,7 @@ public interface SceneMapper extends IBaseMapper<SceneEntity, String> {
 
     @Select("select * from tb_scene where is_delete = 0 and house_id = #{houseId} and room_id = #{roomId}")
     List<SceneEntity> findByHouseIdAndRoomId(String houseId, String roomId);
+
+    @Select("select * from tb_scene where is_delete = 0 and house_id = #{houseId} AND scene_code = #{sceneCode} limit 1")
+    SceneEntity findByHouseIdAndSceneCode(String houseId, String sceneCode);
 }

+ 3 - 0
cms_pano_fcb/gis_service/src/main/java/com/gis/feign/HouseFeign.java

@@ -44,4 +44,7 @@ public interface HouseFeign {
     @PostMapping(value = "/fcb/project/house/updateHouse", consumes = MediaType.APPLICATION_JSON_VALUE, produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
     Result updateHouseJson(@RequestBody JSONObject param) throws Exception;
 
+
+    @GetMapping(value = "fcb/project/house/canEdit")
+    Result canEdit(@RequestParam String houseId) throws Exception;
 }

+ 9 - 3
cms_pano_fcb/gis_service/src/main/java/com/gis/service/SceneInitService.java

@@ -4,6 +4,7 @@ package com.gis.service;
 import com.gis.common.util.Result;
 import com.gis.domain.dto.SceneInitDto;
 import com.gis.domain.entity.SceneInitEntity;
+import com.gis.domain.vo.SceneInitVo;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
@@ -17,13 +18,18 @@ public interface SceneInitService extends IBaseService<SceneInitEntity, String>
 
     Result saveEntity(SceneInitDto param);
 
-    void removeByHouseIdAndSceneCode(String houseId, String sceneCode);
+//    void removeByHouseIdAndSceneCode(String houseId, String sceneCode);
 
     Result uploadFixedName(MultipartFile file, String sceneCode);
 
-    List<SceneInitDto> voFindByHouseId(String houseId);
+//    List<SceneInitDto> voFindByHouseId(String houseId);
+    List<SceneInitVo> voFindByHouseId(String houseId);
 
     List<SceneInitEntity> findByHouseId(String houseId);
 
-    List<SceneInitEntity> findByHouseIdAndSceneCode(String houseId, String sceneCode);
+//    List<SceneInitEntity> findByHouseIdAndSceneCode(String houseId, String sceneCode);
+
+    List<SceneInitEntity> findByHouseIdAndSceneId(String houseId, String id);
+
+    void removeByHouseIdAndSceneId(String houseId, String id);
 }

+ 7 - 4
cms_pano_fcb/gis_service/src/main/java/com/gis/service/SceneService.java

@@ -24,7 +24,7 @@ public interface SceneService extends IBaseService<SceneEntity, String> {
 
     Result findVrModel(SceneRroPageDto param);
 
-    Result findVrModel2(SceneRroPageDto param);
+//    Result findVrModel2(SceneRroPageDto param);
 
     Result saveVrModel(VrModelDto param);
 
@@ -40,9 +40,9 @@ public interface SceneService extends IBaseService<SceneEntity, String> {
 
     Result editSomeData(EditSomeDataDto param);
 
-    Result setIndex(String id);
-
-    Result getIndex(String houseId);
+//    Result setIndex(String id);
+//
+//    Result getIndex(String houseId);
 
     Result findByHouseId(String houseId);
 
@@ -69,4 +69,7 @@ public interface SceneService extends IBaseService<SceneEntity, String> {
     Result updateIcon(String sceneCode, String icon);
 
 
+    SceneEntity findByHouseIdAndSceneCode(String houseId, String sceneCode);
+
+    Result editAgent(String id, String agentId);
 }

+ 26 - 8
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneInitServiceImpl.java

@@ -6,6 +6,7 @@ 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.domain.vo.SceneInitVo;
 import com.gis.mapper.IBaseMapper;
 import com.gis.mapper.SceneInitMapper;
 import com.gis.service.SceneInitService;
@@ -48,13 +49,15 @@ public class SceneInitServiceImpl extends IBaseServiceImpl<SceneInitEntity, Stri
         String id = param.getId();
         if (id == null) {
             String houseId = param.getHouseId();
-            String sceneCode = param.getSceneCode();
+//            String sceneCode = param.getSceneCode();
+            String sceneId = param.getSceneId();
             List<SceneInitEntity> initEntityList = this.findByHouseId(houseId);
             if (initEntityList.size() > 3) {
                 return Result.failure("初始场景不能大于3个" );
             }
 
-            List<SceneInitEntity> initEntities = entityMapper.findByHouseIdAndSceneCode(houseId, sceneCode);
+//            List<SceneInitEntity> initEntities = entityMapper.findByHouseIdAndSceneCode(houseId, sceneCode);
+            List<SceneInitEntity> initEntities =  entityMapper.findByHouseIdAndSceneId(houseId, sceneId);
             if (initEntities.size() > 0) {
                 return Result.failure("初始场景不能重复添加" );
             }
@@ -83,20 +86,35 @@ public class SceneInitServiceImpl extends IBaseServiceImpl<SceneInitEntity, Stri
     }
 
     @Override
-    public List<SceneInitEntity> findByHouseIdAndSceneCode(String houseId, String sceneCode) {
-        return entityMapper.findByHouseIdAndSceneCode(houseId, sceneCode);
+    public List<SceneInitEntity> findByHouseIdAndSceneId(String houseId, String sceneId) {
+        return entityMapper.findByHouseIdAndSceneId(houseId, sceneId);
     }
 
     @Override
-    public List<SceneInitDto> voFindByHouseId(String houseId) {
-        return entityMapper.voFindByHouseId(houseId);
+    public void removeByHouseIdAndSceneId(String houseId, String sceneId) {
+        entityMapper.removeByHouseIdAndSceneId(houseId, sceneId);
     }
 
+//    @Override
+//    public List<SceneInitEntity> findByHouseIdAndSceneCode(String houseId, String sceneCode) {
+//        return entityMapper.findByHouseIdAndSceneCode(houseId, sceneCode);
+//    }
+
+//    @Override
+//    public List<SceneInitDto> voFindByHouseId(String houseId) {
+//        return entityMapper.voFindByHouseId(houseId);
+//    }
+
     @Override
-    public void removeByHouseIdAndSceneCode(String houseId, String sceneCode) {
-        entityMapper.removeByHouseIdAndSceneCode(houseId, sceneCode);
+    public List<SceneInitVo> voFindByHouseId(String houseId) {
+        return entityMapper.voFindByHouseId(houseId);
     }
 
+//    @Override
+//    public void removeByHouseIdAndSceneCode(String houseId, String sceneCode) {
+//        entityMapper.removeByHouseIdAndSceneCode(houseId, sceneCode);
+//    }
+
     @Override
     public Result uploadFixedName(MultipartFile file, String sceneCode) {
 

+ 92 - 364
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneServiceImpl.java

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.gis.common.constant.CmdConstant;
 import com.gis.common.constant.ConfigConstant;
 import com.gis.common.constant.RabbitConfig;
+import com.gis.common.exception.BaseRuntimeException;
 import com.gis.common.task.AsyncTask;
 import com.gis.common.util.*;
 import com.gis.domain.dto.*;
@@ -105,7 +106,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             return Result.failure("houseId不能为空");
         }
 
-        Result resStatus =  getHouseStatus(houseId);
+        Result resStatus =  canEdit(houseId);
         if (resStatus != null) {
             return resStatus;
         }
@@ -160,11 +161,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             entity.setPath(panoPath);
             entity.setOssPath(configConstant.ossDomain + configConstant.projectName + "/" + houseId + "/" + sceneCode);
 
-            // 缩略图,使用切图那个thumb.jpg
             // 压缩图片并上传oss
             // 全景图缩略图统一命名规则: 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 = convertAndUploadOss(
                     panoPath, configConstant.filePath, configConstant.ossBasePath, configConstant.ossDomain, 600, 300, "image/thumb_"+sceneCode+".jpg");
@@ -214,7 +212,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         log.info("saveCompressImgPath: " + saveCompressImgPath);
         String ossUrl = null;
         try {
-//            Img.from(new File(inputFilePath)).scale(width, height).write(new File(saveCompressImgPath));
             // 使用convert压缩图片
             String cmd = CmdConstant.CONVERT;
             String size = width + "x" + height;
@@ -239,63 +236,79 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             log.error("图片格式有误,不支持此图片");
             e.printStackTrace();
         }
-
-
         return ossUrl;
     }
 
 
 
     /**
-     * 查询VR项目状态
+     * 查询VR项目是否可编辑
+     * true: 可编辑
+     * false: 不可编辑
      * @param houseId
      * @return
      */
-    private Result getHouseStatus(String houseId){
+    private Result canEdit(String houseId){
         Result result = null;
         try {
             result = houseFeign.findByHouseId(houseId);
+            log.info("房车宝返回数据:{}", result);
         } catch (Exception e) {
             e.printStackTrace();
+            log.error("调用房车宝接口失败");
+            throw new BaseRuntimeException("调用房车宝接口失败");
         }
-        String status = null;
         if (result.getCode() == 0) {
-            Object data = result.getData();
-            JSONObject jsonObject = JSON.parseObject(data.toString());
-            status = jsonObject.getString("status");
-            log.info("house status: " + status);
-            log.warn("可以正常编辑");
-            if (status.equals("1")) {
-                log.warn("审核中不能编辑");
-                return Result.failure(7005, "审核中不能编辑");
-            }
-            if (status.equals("2")) {
-                log.warn("已审核中不能编辑");
-                return Result.failure(7006, "已审核中不能编辑");
+            boolean data = (boolean) result.getData();
+            if (data) {
+                log.info("vr项目可编辑");
+                return Result.success();
+            } else {
+                log.info("vr项目不可编辑");
+                return Result.failure(7005, "VR项目不可编辑");
             }
 
-
-        }
-
-        if (result.getCode() == -1){
+        } else {
             log.error("VR项目接口查询失败:" + result.getMsg() );
             return Result.failure(7007, "VR项目接口查询失败");
         }
 
-        return null;
     }
 
+//    private Result getHouseStatus(String houseId){
+//        Result result = null;
+//        try {
+//            result = houseFeign.findByHouseId(houseId);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        String status = null;
+//        if (result.getCode() == 0) {
+//            Object data = result.getData();
+//            JSONObject jsonObject = JSON.parseObject(data.toString());
+//            status = jsonObject.getString("status");
+//            log.info("house status: " + status);
+//            log.warn("可以正常编辑");
+//            if (status.equals("1")) {
+//                log.warn("审核中不能编辑");
+//                return Result.failure(7005, "审核中不能编辑");
+//            }
+//            if (status.equals("2")) {
+//                log.warn("已审核中不能编辑");
+//                return Result.failure(7006, "已审核中不能编辑");
+//            }
+//        }
+//
+//        if (result.getCode() == -1){
+//            log.error("VR项目接口查询失败:" + result.getMsg() );
+//            return Result.failure(7007, "VR项目接口查询失败");
+//        }
+//
+//        return null;
+//    }
 
 
 
-    @Test
-    public void test2(){
-        String type = "aa.jpg";
-        System.out.println(StringUtils.substringBeforeLast(type, "."));
-        System.out.println(type.equalsIgnoreCase("jpeg"));
-
-
-    }
 
     @Override
     public Result search(ScenePageDto param) {
@@ -353,12 +366,14 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
                 String byType = sceneEntity.getByType();
                 String sceneCode = sceneEntity.getSceneCode();
                 String houseId = sceneEntity.getHouseId();
+                String id = sceneEntity.getId();
                 if (byType.equals("garden")) {
                     sceneEntity.setType("garden");
                 }
 
                 // 2020.04.02检查初始场景是否使用
-                List<SceneInitEntity> initEntities = sceneInitService.findByHouseIdAndSceneCode(houseId, sceneCode);
+//                List<SceneInitEntity> initEntities = sceneInitService.findByHouseIdAndSceneCode(houseId, sceneCode);
+                List<SceneInitEntity> initEntities = sceneInitService.findByHouseIdAndSceneId(houseId, id);
                 if (initEntities.size() > 0) {
                     sceneEntity.setIsUseIndex(1);
                 }
@@ -385,15 +400,13 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
         // 检查VR项目状态
         String houseId = param.getHouseId();
-        Result resStatus =  getHouseStatus(houseId);
+        Result resStatus =  canEdit(houseId);
         if (resStatus != null) {
             return resStatus;
         }
 
         SceneEntity entity = null;
 
-//        List<SceneEntity> index = entityMapper.getIndex(param.getHouseId());
-
         if ( id == null) {
             entity = entityMapper.findByVrModelIdAndHouseId(param.getVrModelId(), param.getHouseId());
             if (entity != null){
@@ -409,24 +422,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
 
             BeanUtils.copyProperties(param, entity);
-            // 2021-03-30 更新pro, 不更新场景码到恒大后台
-//            if (index.size() == 0) {
-//                entity.setIsIndex(1);
-
-//                HouseSceneIndexDto indexDto = new HouseSceneIndexDto();
-//                indexDto.setId(entity.getHouseId());
-//                indexDto.setSceneNum(entity.getSceneCode());
-//                indexDto.setUpdateTime(LocalDateTime.now());
-//                indexDto.setFcbHouseId(entity.getHengdaId());
-//                Result result = houseFeign.updateHouseSceneIndex(indexDto);
-
-//                if (result.getCode() == 0) {
-//                    log.info("更新了初始场景到VR项目完成");
-//                } else {
-//                    log.error("更新了初始场景到VR项目异常");
-//                    return Result.failure(result.getMsg());
-//                }
-//            }
+
             entity.setId(RandomUtils.getUuid());
             entity.setType("house");
             entity.setStatus(3);
@@ -452,6 +448,22 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         return Result.success();
     }
 
+    @Override
+    public SceneEntity findByHouseIdAndSceneCode(String houseId, String sceneCode) {
+        return entityMapper.findByHouseIdAndSceneCode(houseId, sceneCode);
+    }
+
+    @Override
+    public Result editAgent(String id, String agentId) {
+        SceneEntity entity = this.findById(id);
+        if (entity == null) {
+            return Result.failure("场景不存在:" + id);
+        }
+        entity.setAgentId(agentId);
+        entity.setUpdateTime(new Date());
+        this.update(entity);
+        return Result.success();
+    }
 
 
     @Override
@@ -495,112 +507,9 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         return flag;
     }
 
-//    /**
-//     * 编辑场景
-//     * house字段更新伟玉房源接口
-//     * 其他字段更新720场景数据,websit要更新到伟玉那边去
-//     */
-//    @Override
-//    public Result editHouse(EditHouseDto param) {
-//
-//        // 检查VR项目状态
-//        String houseId = param.getHouseId();
-//        Result resStatus =  getHouseStatus(houseId);
-//        if (resStatus != null) {
-//            return resStatus;
-//        }
-//
-//        // TODO: 2021/1/8 0008 更新伟玉房源表单接口
-//        HouseDto houseDto = new HouseDto();
-//        houseDto.setId(houseId);
-//        houseDto.setCoverImagUrl(param.getHouseIcon());
-//        houseDto.setHouseTitle(param.getHouseTitle());
-//        houseDto.setShareDesc(param.getHouseDescription());
-//        houseDto.setUpdateTime(LocalDateTime.now());
-//        // 2021-03-30 新增
-//        houseDto.setFcbHouseId(param.getFcbHouseId());
-//        // 设置为显示
-//        houseDto.setIsShow("1");
-//
-//        log.info("update houseDto: " + houseDto.toString());
-//
-//        try {
-//            Result result = houseFeign.updateHouse(houseDto);
-//            if (result.getCode() == 0) {
-//                log.info("更新房源信息完成");
-//            } else {
-//                log.error("更新房源信息异常");
-//                return Result.failure(result.getMsg());
-//            }
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//
-//        return Result.success();
-//    }
 
 
     @Override
-    public Result setIndex(String id) {
-
-
-
-        SceneEntity entity = findById(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;
-        }
-        log.info("检查状态完成,可以编辑");
-
-
-        // 设置初始场景
-            // step:1先全部设置为0
-            entityMapper.setIndexByHouseId(0, entity.getHouseId());
-            // step:1先全部设置为1
-            entityMapper.setIndexById(id, 1);
-
-
-
-        // TODO: 2021/1/9 0008 更新伟玉房源表单接口
-//        HouseSceneIndexDto houseSceneIndexDto = new HouseSceneIndexDto();
-//        houseSceneIndexDto.setId(houseId);
-//
-//        // 初始场景
-//        houseSceneIndexDto.setSceneNum(entity.getSceneCode());
-//        houseSceneIndexDto.setUpdateTime(LocalDateTime.now());
-//        houseSceneIndexDto.setFcbHouseId(entity.getHouseId());
-//        Result result = houseFeign.updateHouseSceneIndex(houseSceneIndexDto);
-//        if (result.getCode() == 0) {
-//            log.info("更新房源updateHouse完成");
-//        } else {
-//            log.error("更新房源updateHouse异常");
-//            return Result.failure(result.getMsg());
-//        }
-
-        return Result.success();
-    }
-
-    @Override
-    public Result getIndex(String houseId) {
-        List<SceneEntity> index = entityMapper.getIndex(houseId);
-        if (index.size() == 0) {
-            log.info("首页场景码不存在");
-            return Result.success();
-        }
-        SceneEntity entity = index.get(0);
-        log.info("首页场景码: " + entity.getSceneCode());
-        return Result.success(entity);
-    }
-
-    @Override
     public Result findByHouseId(String houseId) {
         return Result.success(entityMapper.findByHouseId(houseId));
     }
@@ -614,7 +523,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             if (n == 1) {
                 SceneEntity entity = this.findById(id);
                 String houseId = entity.getHouseId();
-                Result resStatus =  getHouseStatus(houseId);
+                Result resStatus =  canEdit(houseId);
                 if (resStatus != null) {
                     return resStatus;
                 }
@@ -641,8 +550,10 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
     @Override
     public Result houseRemove(String houseId) {
+
         entityMapper.houseRemove(houseId);
         sceneInitMapper.removeByHouseId(houseId);
+        log.info("管理后台-vr项目删除成功, id: {}", houseId);
         return Result.success();
     }
 
@@ -745,57 +656,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
     }
 
-    /**
-     * 没有的接口,需要删除
-     * @param param
-     * @return
-     */
-    @Override
-    public Result findVrModel2(SceneRroPageDto param) {
-        // TODO: 2021/1/8 0008 查找4dkk场景数据,当前区域公司下的模型
-        @NotBlank(message = "token不能为空") String token = param.getToken();
-        // 只获取计算成功的, 0:计算成功
-//        param.setStatus("0");
-        Result result = sceneProFeign.findByList(param, token);
-        log.info("result: " + result.toString());
-
-        // 过滤已添加的数据
-        if (result.getCode() == 0) {
-
-            Object data = result.getData();
-            PageInfo page = JSON.parseObject(data.toString(), PageInfo.class);
-
-            List<Object> list = page.getList();
-            log.info("list size: " + list.size());
-
-            List<Object> newList = new ArrayList<>();
-
-            for (Object o : list) {
-                JSONObject scenePro = JSON.parseObject(o.toString());
-                String sceneProId = scenePro.getString("id");
-                List<SceneEntity> vrModelId = entityMapper.findByVrModelId2(sceneProId);
-//                SceneEntity vrModelId = entityMapper.findByVrModelIdAndHouseId(sceneProId, param.getHouseId());
-                String use = "0";
-                if (vrModelId.size() > 0) {
-                    use = "1";
-                }
-
-                scenePro.put("isUse", use);
-                newList.add(scenePro);
-            }
-
-            page.setList(newList);
-            log.info("newList size: " + newList.size());
-
-            return Result.success(page);
-        } else {
-            log.error("异常了");
-            return Result.failure(result.getMsg());
-        }
-
-
-    }
-
 
 
     @Override
@@ -806,7 +666,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         // 检查VR项目状态
         String houseId = param.getHouseId();
         String roomId = param.getRoomId();
-        Result resStatus =  getHouseStatus(houseId);
+        Result resStatus =  canEdit(houseId);
         if (resStatus != null) {
             return resStatus;
         }
@@ -842,7 +702,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             this.save(entity);
 
             // 该VR项目下如果没有设置任何初始场景,把户型设置为默认初始场景
-            checkSceneInit(houseId, sceneCode);
+//            checkSceneInit(houseId, sceneCode);
+            checkSceneInit(houseId, id);
 
             log.info("保存VR模型完成");
         } else {
@@ -859,17 +720,30 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
 
     // 该VR项目下如果没有设置任何初始场景,把户型设置为默认初始场景
-    private void checkSceneInit(String houseId, String sceneCode){
+    private void checkSceneInit(String houseId, String id){
         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);
+//            entity.setSceneCode(sceneCode);
+            entity.setSceneId(id);
             sceneInitService.save(entity);
         }
     }
 
+    // 该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);
+//        }
+//    }
+
 
 
 
@@ -885,64 +759,6 @@ 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) {
@@ -958,7 +774,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
         // 检查VR项目状态
         String houseId = entity.getHouseId();
-        Result resStatus =  getHouseStatus(houseId);
+        Result resStatus =  canEdit(houseId);
         if (resStatus != null) {
             return resStatus;
         }
@@ -1000,73 +816,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         return Result.success(entity.getOssPath());
     }
 
-    @Test
-    public void tes1(){
-        String inPath = "C:\\Users\\Administrator\\Desktop\\33\\tour2.xml";
-        String outPath = "C:\\Users\\Administrator\\Desktop\\33\\tour.xml";
-        streamEditFile(inPath, outPath, "0.1", "0.2");
-    }
-
-
-    public static void streamEditFile(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);
-
-
-            // 输出缓冲流
-
-            String tempString = null;
-            StringBuffer buffer = new StringBuffer();
-
-            // 转数组
-            while ((tempString = reader.readLine()) != null) {
-
-                if (tempString.contains("<view hlookat=")) {
-                tempString = tempString.replace("\t", "");
-
-                    String start = StringUtils.substring(tempString, 0, 5);
-                    String end = StringUtils.substringAfter(tempString, "fovtype");
-
-                    StringBuffer aa = new StringBuffer();
-                    aa.append(start);
-                    aa.append(" hlookat=").append("\"").append(hlookat).append("\"");
-                    aa.append(" vlookat=").append("\"").append(vlookat).append("\"");
-                    aa.append(" fovtype");
-                    aa.append(end);
-                    // 写文件
-                    tempString = aa.toString();
-                    log.info("temp: " + tempString);
-                }
-                // 换行写入
-                buffer.append(tempString).append("\r\n");
-            }
-            reader.close();
-            FileUtil.writeUtf8String(buffer.toString(), outPath);
-        } catch (IOException ex) {
-            ex.printStackTrace();
-        } finally {
-            if (reader != null) {
-                try {
-                    reader.close();
-                } catch (IOException ex) {
-                    ex.printStackTrace();
-                }
-            }
-        }
-    }
-
-
 
-    @Test
-    public void test(){
-        String a= "/home/data/cms_pano_fcb_data/p19/fcb_px2rJW96F/fcb_px2rJW96F.jpg";
-        String s = StringUtils.substringBeforeLast(a, "/");
-        System.out.println(s);
-    }
 
     @Override
     public SceneEntity findBySceneCode(String sceneCode) {
@@ -1090,7 +840,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
         // 检查VR项目状态
         String houseId = entity.getHouseId();
-        Result resStatus =  getHouseStatus(houseId);
+        Result resStatus =  canEdit(houseId);
         if (resStatus != null) {
             return resStatus;
         }
@@ -1106,26 +856,4 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         return Result.success();
     }
 
-
-
-
-
-
-    @Test
-    public void tess(){
-        String a = "/home/data/cms_pano_fcb_data/fcb_pano1348947775971389440/pano.jpg";
-        String s = StringUtils.substringBeforeLast(a, "/");
-        System.out.println(s);
-    }
-
-
-    @Test
-    public void pngToJpg(){
-//        String png = "C:\\Users\\Administrator\\Desktop\\33\\2_1.png";
-//        String jpg = "C:\\Users\\Administrator\\Desktop\\33\\png\\1.jpn";
-//        ImgUtil.convert();
-    }
-
-
-
 }

+ 4 - 0
cms_pano_fcb/gis_web/src/main/java/com/gis/web/aop/WebControllerLog.java

@@ -10,4 +10,8 @@ import java.lang.annotation.*;
 @Documented
 public @interface WebControllerLog {
     String description() default "";
+
+
+    //是否加入数据库
+    boolean addDb() default false;
 }

+ 91 - 56
cms_pano_fcb/gis_web/src/main/java/com/gis/web/aop/WebLogAspect.java

@@ -21,9 +21,7 @@ import org.springframework.stereotype.Component;
 import javax.servlet.http.HttpServletRequest;
 import java.lang.reflect.Method;
 import java.time.LocalDateTime;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * Created by owen on 2020/2/25 0025 9:24
@@ -49,12 +47,22 @@ public class WebLogAspect {
     public void controllerLog(){}//签名,可以理解成这个切入点的一个名称
 
     @Before("controllerLog()") //在切入点的方法run之前要干的
-    public void logBeforeController(JoinPoint joinPoint)  {
+    public void logBeforeController(JoinPoint joinPoint) throws Exception  {
         log.info("start : {}" , request.getRequestURI());
-        log.info("request Method : {}" , request.getMethod());
-        log.info("request IP : {}" , request.getRemoteAddr());
+        log.info("request Method:{}, IP:{}" , request.getMethod(),  request.getRemoteAddr());
+//        log.info("request IP : {}" , request.getRemoteAddr());
         log.info("request Args : {}" , Arrays.toString(joinPoint.getArgs()));
 
+        Map<String, Object> controllerLog = getControllerLog(joinPoint);
+        if (controllerLog == null) {
+            return;
+        }
+
+        String description = (String)controllerLog.get("description");
+        Boolean addDb = (boolean)controllerLog.get("addDb");
+        log.info("request description:{}, addDb:{}", description, addDb);
+//        log.info("request addDb : {}", addDb);
+
         // 获取token
         String token = request.getHeader("token");
         log.info("token: " + token);
@@ -67,7 +75,7 @@ public class WebLogAspect {
             return;
         }
 
-        String description = getControllerLogDescription(joinPoint);
+//        String description = getControllerLogDescription(joinPoint);
 
         // 这个方法只能提前,不能往后
         if (StringUtils.isBlank(description)) {
@@ -75,54 +83,54 @@ public class WebLogAspect {
             return;
         }
 
-        String userInfo = redisTemplate.opsForValue().get(token);
+        // true: 存入数据库
+        if (addDb) {
+            String userInfo = redisTemplate.opsForValue().get(token);
 
-        if (userInfo == null) {
-            log.warn("redis 找不到token key: " + token);
-            return;
-        }
+            if (userInfo == null) {
+                log.warn("redis 找不到token key: " + token);
+                return;
+            }
 
 
-        try {
-        JSONObject jsonObject = JSONObject.parseObject(userInfo);
-        log.info("userInfo : " + jsonObject.toString());
+            try {
+                JSONObject jsonObject = JSONObject.parseObject(userInfo);
+                log.info("userInfo : " + jsonObject.toString());
 
-        log.info("request description  : {}", description);
-        List<String> detail = getDetail(description);
-            LogInfoDto logInfoDto = new LogInfoDto();
-            logInfoDto.setId(RandomUtils.getUuid());
-            String detail_0 = detail.get(0);
+                log.info("request description  : {}", description);
+                List<String> detail = getDetail(description);
+                LogInfoDto logInfoDto = new LogInfoDto();
+                logInfoDto.setId(RandomUtils.getUuid());
+                String detail_0 = detail.get(0);
 //            log.info("detail_0:"+detail_0);
-            logInfoDto.setOperateType(detail_0);
-            String detail_1 = detail.get(1);
+                logInfoDto.setOperateType(detail_0);
+                String detail_1 = detail.get(1);
 //            log.info("detail_1:"+detail_1);
-            logInfoDto.setOperateContent(detail_1);
-            // 所属公司ID
-            logInfoDto.setOperatorCompanyId(jsonObject.getString("departmentId"));
-            // 所属公司
-            logInfoDto.setOperatorCompanyName(jsonObject.getString("departmentName"));
-            logInfoDto.setOperatorId(jsonObject.getString("id"));
-            logInfoDto.setOperatorName(jsonObject.getString("nickName"));
-            logInfoDto.setOperatorPhone(jsonObject.getString("userName"));
-            logInfoDto.setOperatorRoleId(jsonObject.getString("roleId"));
-            logInfoDto.setOperatorRoleName(jsonObject.getString("roleName"));
-
-            LocalDateTime now = LocalDateTime.now();
-            logInfoDto.setUpdateTime(now);
-            logInfoDto.setCreateTime(now);
-            logInfoDto.setOperateTime(now);
-
-
-            houseFeign.addLog(logInfoDto);
-        } catch (Exception e) {
-            //下面这个getSignature().getDeclaringTypeName()是获取包+类名的   然后后面的joinPoint.getSignature.getName()获取了方法名
-            log.info("request Class_Method : {}" , joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName());
-            e.printStackTrace();
-        }
-
-
-
+                logInfoDto.setOperateContent(detail_1);
+                // 所属公司ID
+                logInfoDto.setOperatorCompanyId(jsonObject.getString("departmentId"));
+                // 所属公司
+                logInfoDto.setOperatorCompanyName(jsonObject.getString("departmentName"));
+                logInfoDto.setOperatorId(jsonObject.getString("id"));
+                logInfoDto.setOperatorName(jsonObject.getString("nickName"));
+                logInfoDto.setOperatorPhone(jsonObject.getString("userName"));
+                logInfoDto.setOperatorRoleId(jsonObject.getString("roleId"));
+                logInfoDto.setOperatorRoleName(jsonObject.getString("roleName"));
+
+                LocalDateTime now = LocalDateTime.now();
+                logInfoDto.setUpdateTime(now);
+                logInfoDto.setCreateTime(now);
+                logInfoDto.setOperateTime(now);
+
+
+                houseFeign.addLog(logInfoDto);
+            } catch (Exception e) {
+                //下面这个getSignature().getDeclaringTypeName()是获取包+类名的   然后后面的joinPoint.getSignature.getName()获取了方法名
+                log.info("request Class_Method : {}" , joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName());
+                e.printStackTrace();
+            }
 
+        }
 
     }
 
@@ -142,18 +150,42 @@ public class WebLogAspect {
      * @return 方法描述
      * @throws Exception
      */
-    public static String getControllerLogDescription(JoinPoint joinPoint)  {
+//    public static String getControllerLogDescription(JoinPoint joinPoint)  {
+//        String targetName = joinPoint.getTarget().getClass().getName();
+//        String methodName = joinPoint.getSignature().getName();
+//        Object[] arguments = joinPoint.getArgs();
+//        Class targetClass = null;
+//        try {
+//            targetClass = Class.forName(targetName);
+//        } catch (ClassNotFoundException e) {
+//            e.printStackTrace();
+//        }
+//        Method[] methods = targetClass.getMethods();
+//        String description = "";
+//        for (Method method : methods) {
+//            if (method.getName().equals(methodName)) {
+//                Class[] clazzs = method.getParameterTypes();
+//                if (clazzs.length == arguments.length) {
+//                    WebControllerLog annotation = method.getAnnotation(WebControllerLog.class);
+//                    if (annotation != null) {
+//                        description = annotation.description();
+//                        break;
+//                    }
+//                }
+//            }
+//        }
+//        return description;
+//    }
+
+
+    public static Map<String, Object> getControllerLog(JoinPoint joinPoint) throws Exception {
         String targetName = joinPoint.getTarget().getClass().getName();
         String methodName = joinPoint.getSignature().getName();
         Object[] arguments = joinPoint.getArgs();
-        Class targetClass = null;
-        try {
-            targetClass = Class.forName(targetName);
-        } catch (ClassNotFoundException e) {
-            e.printStackTrace();
-        }
+        Class targetClass = Class.forName(targetName);
         Method[] methods = targetClass.getMethods();
         String description = "";
+        Map<String, Object> result = new HashMap<>();
         for (Method method : methods) {
             if (method.getName().equals(methodName)) {
                 Class[] clazzs = method.getParameterTypes();
@@ -161,12 +193,15 @@ public class WebLogAspect {
                     WebControllerLog annotation = method.getAnnotation(WebControllerLog.class);
                     if (annotation != null) {
                         description = annotation.description();
+                        boolean addDb = annotation.addDb();
+                        result.put("description", description);
+                        result.put("addDb", addDb);
                         break;
                     }
                 }
             }
         }
-        return description;
+        return result;
     }
 
     private static List<String> getDetail(String str){

+ 62 - 57
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/CommonController.java

@@ -1,31 +1,24 @@
 package com.gis.web.controller;
 
 
-import com.gis.common.util.RandomUtils;
 import com.gis.common.util.Result;
 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.domain.vo.SceneInitVo;
 import com.gis.mapper.SceneInitMapper;
 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;
-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.apache.shiro.crypto.hash.Hash;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import tk.mybatis.mapper.entity.Condition;
 
-import java.util.Date;
+import javax.validation.Valid;
 import java.util.HashMap;
 import java.util.List;
 
@@ -102,53 +95,65 @@ 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);
-//    }
+    /**
+     * 2021-5-13
+     * 更新没问题后,需要删除
+     */
+    @ApiOperation("更新初始场景旧数据")
+    @GetMapping("updateData")
+    public Result updateData() {
+        // init表查询场景码
+        List<SceneInitEntity> all = sceneInitService.findAll();
+        log.info("初始场景数量:{}", all.size());
+        // 根据场景码去tb_scene 把id查出来
+        int m = 0;
+        for (SceneInitEntity sceneInitEntity : all) {
+            String houseId = sceneInitEntity.getHouseId();
+            String sceneCode = sceneInitEntity.getSceneCode();
+            SceneEntity scenes = sceneService.findByHouseIdAndSceneCode(houseId, sceneCode);
+            if (scenes != null) {
+                log.info("scenes: {}", scenes.toString());
+                if (sceneInitEntity.getSceneId() == null) {
+                    sceneInitEntity.setSceneId(scenes.getId());
+                    sceneInitService.update(sceneInitEntity);
+                    m ++;
+                }
+
+            }
+
+        }
+        // 把id填充到tb_init.scene_id
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("初始场景数量", all.size());
+        result.put("更新成功", m);
+
+        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);
+    }
+
+    @WebControllerLog(description = "公共-列表")
+    @ApiOperation(value = "列表")
+    @GetMapping("list/{houseId}")
+    public Result<SceneInitVo> list(@PathVariable String houseId) {
+        List<SceneInitVo> list = sceneInitService.voFindByHouseId(houseId);
+        return Result.success(list);
+    }
+
+
+    @ApiOperation(value = "保存")
+    @PostMapping("save")
+    public Result save(@Valid @RequestBody SceneInitDto param) {
+        return sceneInitService.saveEntity(param);
+    }
 
 }

+ 1 - 1
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/HouseController.java

@@ -56,7 +56,7 @@ public class HouseController extends BaseController {
     }
 
 
-    @WebControllerLog(description = "VR项目-编辑VR项目")
+    @WebControllerLog(description = "VR项目-编辑VR项目", addDb = true)
     @ApiOperation(value = "VR项目修改", position = 3, notes = "修改VR项目的基础信息")
     @PostMapping("edit")
     public Result editHouse(@Valid @RequestBody EditHouseDto param) {

+ 23 - 106
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SceneController.java

@@ -9,6 +9,7 @@ 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;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -47,6 +48,16 @@ public class SceneController extends BaseController {
     @Autowired
     SceneInitService sceneInitService;
 
+
+    @WebControllerLog(description = "场景管理-编辑经纪人")
+    @ApiOperation(value = "编辑经纪人", notes = "2021-05-14新增接口")
+    @GetMapping("editAgent/{id}/{agentId}")
+    public Result editAgent(@PathVariable String id, @PathVariable String agentId) {
+        return sceneService.editAgent(id, agentId);
+    }
+
+
+
     @ApiOperation(value = "保存关联场景热点", position = 1, notes = "sceneCodes:场景关联的场景码")
     @PostMapping("save/useHots")
     public Result saveUseHots(@Valid @RequestBody UseHotsDto param) {
@@ -94,12 +105,10 @@ public class SceneController extends BaseController {
     @ApiOperation(value = "上传-全景图(创建场景)", position = 2)
     @PostMapping("uploadPano/{houseId}/{type}/{hengdaId}")
     public Result uploadPano(MultipartFile file, @PathVariable String houseId, @PathVariable String type, @PathVariable String hengdaId) {
-
         if (file == null) {
             log.error("文件不能为空");
             return Result.failure("文件不能为空");
         }
-
         return sceneService.uploadPanoRabbitMq(file, houseId, type, hengdaId);
     }
 
@@ -119,19 +128,6 @@ public class SceneController extends BaseController {
     }
 
 
-//    @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")
-//    public Result editHouse(@Valid @RequestBody EditHouseDto param) {
-//        return sceneService.editHouse(param);
-//    }
 
     /**
      * 提供恒大管理后台使用
@@ -144,16 +140,17 @@ public class SceneController extends BaseController {
             @ApiImplicitParam(name = "houseId", value = "房源id", dataType = "String", required = true),
             @ApiImplicitParam(name = "status", value = "状态, 审核通过/上线:4, 下线:3", dataType = "String"),
     })
+    @WebControllerLog(description = "场景管理-VR项目审核通过/下线")
     @ApiOperation(value = "VR项目审核通过/下线", position = 3)
     @GetMapping("house/audit/{houseId}/{status}")
     public Result houseAudit(@PathVariable String houseId, @PathVariable String status) {
         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) {
-        log.info("VR项目删除: " + houseId);
         return sceneService.houseRemove(houseId);
     }
 
@@ -165,29 +162,6 @@ public class SceneController extends BaseController {
 
 
 
-
-    /**
-     * 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);
-//    }
-
-
     /**
      * 提供恒大管理后台使用
      * 传status=3 ,需要把状态3、4 的数据都返回
@@ -201,6 +175,7 @@ public class SceneController extends BaseController {
             @ApiImplicitParam(name = "type", value = "场景类型, 楼盘:building, 园林:garden, 户型:house", dataType = "String", required = true),
             @ApiImplicitParam(name = "status", value = "状态 3:成功", dataType = "String", required = true)
     })
+    @WebControllerLog(description = "场景管理-获取场景码列表")
     @ApiOperation(value = "获取场景码列表", position = 3, notes = "把VR项目相应的计算成功的场景码返回给恒大管理后台")
     @GetMapping("getVrSceneCode/{houseId}/{status}/{type}")
     public Result getVrSceneCode(@PathVariable String houseId, @PathVariable String status, @PathVariable String type) {
@@ -231,6 +206,7 @@ public class SceneController extends BaseController {
      * 提供恒大管理后台使用
      * 2021-3-24 估计这个方法不用
      */
+    @WebControllerLog(description = "场景管理-房源首页批量获取")
     @ApiOperation(value = "房源首页批量获取", position = 3, notes = "获取所有VR项目的首页场景链接")
     @PostMapping("house/findAllHouseId")
     public Result findAllHouseId(@RequestBody HouseIndexPageDto param) {
@@ -256,6 +232,7 @@ public class SceneController extends BaseController {
      * @param sceneCode
      * @return
      */
+    @WebControllerLog(description = "VR模模型-根据场景码查询")
     @ApiOperation(value = "VR模模型-根据场景码查询", notes = "提供给四维看看,判断是否在720yun中使用此场景,true:有,四维看看不能删除此场景; false:可以删除")
     @GetMapping(value = "fdkk/findBySceneCode")
     public Result vrFindBySceneCode(String sceneCode) {
@@ -274,6 +251,7 @@ public class SceneController extends BaseController {
     // todo 这个修好户型,会涉及到初始场景的问题,要如何处理
 
     /**
+     * 2021-05-14 已更新 2021-04-28问题
      * 2021-04-28
      * 比较好的处理方式是记录场景id , init表也是记录场景id, 这样就不用去维护数据了
      * @param param
@@ -335,7 +313,7 @@ public class SceneController extends BaseController {
         return Result.success(entity);
     }
 
-
+    @WebControllerLog(description = "场景管理-场景删除")
     @ApiOperation(value = "场景删除", notes = "判断VR项目关联场景、关联热点等判断")
     @GetMapping("removes/{id}")
     public Result remove(@PathVariable String id) {
@@ -363,77 +341,16 @@ public class SceneController extends BaseController {
         sceneService.update(entity);
 
         // 删除相应初始场景
-        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);
-//        }
-
-
-        // todo 2021-3-8 测试一下是否要更新初始场景到伟玉那边
-        // 更新首页场景到VR项目
-//        if (flag) {
-//            HouseSceneIndexDto indexDto = new HouseSceneIndexDto();
-//            indexDto.setId(IndexEntity.getHouseId());
-//            indexDto.setSceneNum(IndexEntity.getSceneCode());
-//            indexDto.setUpdateTime(LocalDateTime.now());
-//            indexDto.setFcbHouseId(IndexEntity.getHengdaId());
-//            Result result = houseFeign.updateHouseSceneIndex(indexDto);
-//
-//
-//            if (result.getCode() == 0) {
-//                log.info("更新了初始场景到VR项目完成");
-//            } else {
-//                log.error("更新了初始场景到VR项目异常");
-//                return Result.failure(result.getMsg());
-//            }
-//            log.info("result: " + result);
-//            log.info("更新了初始场景到VR项目");
-//        }
+//        sceneInitService.removeByHouseIdAndSceneCode(houseId, sceneCode);
+        // 2021-05-13
+        sceneInitService.removeByHouseIdAndSceneId(houseId, id);
 
         return Result.success();
     }
 
 
-//    private SceneEntity setInitIndex(List<SceneEntity> entityList) {
-//
-//        SceneEntity sceneEntity = entityList.get(0);
-//        if (sceneEntity != null) {
-//            sceneEntity.setIsIndex(1);
-//            sceneService.update(sceneEntity);
-//        }
-//        return sceneEntity;
-//    }
 
-    /**
-     * 这个接口,好像是没用的
-     *
-     * @param houseId
-     * @return
-     */
-//    @WebControllerLog(description = "场景管理-获取样本间")
-//    @ApiOperation(value = "获取样本间", notes = "调用恒大接口")
-//    @PostMapping("findRoom/{houseId}")
-//    public Result findRoom(@PathVariable String houseId) {
-//        return sceneService.findRoom(houseId);
-//    }
+
+
 
 }

+ 3 - 2
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SceneInitController.java

@@ -4,6 +4,7 @@ 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.domain.vo.SceneInitVo;
 import com.gis.service.HouseService;
 import com.gis.service.SceneInitService;
 import io.swagger.annotations.Api;
@@ -47,8 +48,8 @@ public class SceneInitController extends BaseController {
      */
     @ApiOperation(value = "列表")
     @GetMapping("list/{houseId}")
-    public Result<SceneInitDto> list(@PathVariable String houseId) {
-        List<SceneInitDto> list = sceneInitService.voFindByHouseId(houseId);
+    public Result<SceneInitVo> list(@PathVariable String houseId) {
+        List<SceneInitVo> list = sceneInitService.voFindByHouseId(houseId);
         return Result.success(list);
     }
 

+ 12 - 0
cms_pano_fcb/remark.md

@@ -228,6 +228,18 @@ sit:
         
      2021-04-30
         消费端队列加入超时机制   
+        
+        
+====================== 2021-05-13   1.2新需求开发 ======================   
+    增加字段: alter table tb_scene_init add scene_id varchar(30) NOT NULL COMMENT '场景id';
+    增加字段: alter table tb_scene_init add scene_id varchar(30)  NULL COMMENT '场景id';
+    增加字段: alter table tb_scene add agent_id varchar(30) NULL COMMENT '恒大经纪人id(讲房顾问), 只有在house类型才有此数据';
+    测试接口:
+        初始场景-保存 需要传scene_id
+        场景管理-场景列表(searchUnion)
+        场景管理-场景删除
+        
+     初始场景的旧数据处理完毕   
     
 # uat 更新日志
     20210301-1700