Browse Source

完成,要联调

zhujinghui 4 năm trước cách đây
mục cha
commit
e7e7f3f80b
22 tập tin đã thay đổi với 986 bổ sung343 xóa
  1. 2 0
      fcb-project-application/src/main/resources/application.properties
  2. 23 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/config/FcbConfig.java
  3. 11 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/dao/TmEstateDao.java
  4. 128 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/dto/KvMap.java
  5. 128 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/dto/scene/SceneProEntity.java
  6. 3 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/entity/TmEstate.java
  7. 9 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/enums/HouseStatus.java
  8. 21 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/enums/TFEnum.java
  9. 21 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/param/PageParam.java
  10. 63 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/param/house/QueryHouseParam.java
  11. 18 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/service/custom/PanoService.java
  12. 330 17
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/service/impl/TmEstateServiceImpl.java
  13. 1 97
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/service/impl/TmHouseServiceImpl.java
  14. 29 50
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/utils/ExcelUtil.java
  15. 95 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/base/vo/house/HouseVO.java
  16. 0 176
      fcb-project-manager-core/src/main/java/fcb/project/manager/core/controller/ProjectController.java
  17. 3 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/core/feignInterfaces/PanoFeign.java
  18. 7 2
      fcb-project-manager-core/src/main/java/fcb/project/manager/core/feignInterfaces/SceneFeign.java
  19. 8 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/core/feignInterfaces/fallBack/PanoFeignFallBack.java
  20. 9 0
      fcb-project-manager-core/src/main/java/fcb/project/manager/core/feignInterfaces/fallBack/SceneFeignFallBack.java
  21. 76 0
      fcb-project-manager-core/src/main/resources/mybatis/mappers/TmEstateMapper.xml
  22. 1 1
      pom.xml

+ 2 - 0
fcb-project-application/src/main/resources/application.properties

@@ -31,6 +31,8 @@ feign.hystrix.enabled=true
 
 mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
 
+mybatis-plus.mapper-locations=classpath*:mybatis/mappers/*.xml
+
 
 
 

+ 23 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/base/config/FcbConfig.java

@@ -0,0 +1,23 @@
+package fcb.project.manager.base.config;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @author Admin
+ */
+@Data
+@Configuration
+public class FcbConfig {
+
+    @Value("${inner.vr.scene.host}")
+    private String innerSceneVrHost;
+
+    @Value("${outer.vr.scene.host}")
+    private String outerSceneVrHost;
+
+    @Value("${excel.local.path}")
+    private String excelLocalPath;
+
+}

+ 11 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/base/dao/TmEstateDao.java

@@ -1,7 +1,15 @@
 package fcb.project.manager.base.dao;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import fcb.project.manager.base.entity.TmEstate;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import fcb.project.manager.base.entity.TmHouse;
+import fcb.project.manager.base.param.house.QueryHouseParam;
+import fcb.project.manager.base.vo.house.HouseVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface TmEstateDao extends BaseMapper<TmEstate> {
 
+    IPage<HouseVO> listProject(@Param("page") Page page, @Param("ew") QueryHouseParam queryHouseParam);
+
+    List<HouseVO> exportProject(@Param("ew") QueryHouseParam queryHouseParam);
 }

+ 128 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/base/dto/KvMap.java

@@ -0,0 +1,128 @@
+/**
+ * Copyright (c) 2011-2017, James Zhan 詹波 (jfinal@126.com).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package fcb.project.manager.base.dto;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Kv (Key Value)
+ * 
+ * Example:
+ *    Kv para = Kv.by("id", 123);
+ * @author zhujh
+ */
+@SuppressWarnings({"serial", "rawtypes", "unchecked"})
+public class KvMap extends HashMap {
+	
+	public KvMap() {}
+
+	public static KvMap by(Object key, Object value) {
+		return new KvMap().set(key, value);
+	}
+	
+	public static KvMap create() {
+		return new KvMap();
+	}
+
+	public KvMap set(Object key, Object value) {
+		super.put(key, value);
+		return this;
+	}
+	
+	public KvMap set(Map map) {
+		super.putAll(map);
+		return this;
+	}
+	
+	public KvMap set(KvMap kv) {
+		super.putAll(kv);
+		return this;
+	}
+	
+	public KvMap delete(Object key) {
+		super.remove(key);
+		return this;
+	}
+	
+	public <T> T getAs(Object key) {
+		return (T)get(key);
+	}
+	
+	public String getStr(Object key) {
+		Object s = get(key);
+		return s != null ? s.toString() : null;
+	}
+	
+	public Integer getInt(Object key) {
+		Number n = (Number)get(key);
+		return n != null ? n.intValue() : null;
+	}
+	
+	public Long getLong(Object key) {
+		Number n = (Number)get(key);
+		return n != null ? n.longValue() : null;
+	}
+	
+	public Number getNumber(Object key) {
+		return (Number)get(key);
+	}
+	
+	public Boolean getBoolean(Object key) {
+		return (Boolean)get(key);
+	}
+	
+	/**
+	 * key 存在,并且 value 不为 null
+	 */
+	public boolean notNull(Object key) {
+		return get(key) != null;
+	}
+	
+	/**
+	 * key 不存在,或者 key 存在但 value 为null
+	 */
+	public boolean isNull(Object key) {
+		return get(key) == null;
+	}
+	
+	/**
+	 * key 存在,并且 value 为 true,则返回 true
+	 */
+	public boolean isTrue(Object key) {
+		Object value = get(key);
+		return (value instanceof Boolean && ((Boolean)value == true));
+	}
+	
+	/**
+	 * key 存在,并且 value 为 false,则返回 true
+	 */
+	public boolean isFalse(Object key) {
+		Object value = get(key);
+		return (value instanceof Boolean && ((Boolean)value == false));
+	}
+	
+//	public String toJson() {
+//		return Json.getJson().toJson(this);
+//	}
+	
+	public boolean equals(Object kv) {
+		return kv instanceof KvMap && super.equals(kv);
+	}
+}
+
+

+ 128 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/base/dto/scene/SceneProEntity.java

@@ -0,0 +1,128 @@
+package fcb.project.manager.base.dto.scene;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+
+/**
+ * 场景表
+ */
+@Data
+public class SceneProEntity implements Serializable {
+
+    private static final long serialVersionUID = 661912133849676944L;
+    /**
+     * 场景名称
+     */
+    private String sceneName;
+    /**
+     * 场景描述
+     */
+    private String sceneDec;
+    /**
+     * 场景的链接地址
+     */
+    private String webSite;
+    /**
+     * 场景缩略图
+     */
+    private String thumb;
+    /**
+     * 0表示未建好,1表示建好,-1表示出错,-2表示不要在官网上显示
+     */
+    private Integer status;
+    /**
+     * 原始的大场景数据(七牛)
+     */
+    private String dataSource;
+    /**
+     * 0表示未付款,1表示付款了,-1表示欠费(八目场景指锁住),-2表示临时空间(八目场景)
+     */
+    private Integer payStatus;
+    /**
+     * 手机id
+     */
+    private String phoneId;
+    /**
+     * 大场景序号
+     */
+    private String num;
+    /**
+     * 0表示其他,1表示文博,2表示地产,3表示电商,4表示餐饮,5表示家居
+     */
+    private Integer sceneType;
+    /**
+     * 1表示推荐,0表示正常
+     */
+    private Integer recommend;
+    /**
+     * 浏览次数
+     */
+    private Integer viewCount;
+    /**
+     * 拍摄数量
+     */
+    private Integer shootCount;
+    /**
+     * 要gps定位
+     */
+    private String gps;
+    /**
+     * 方案:1是双目,2是转台,3是六目,4是八目
+     */
+    private Integer sceneScheme;
+    /**
+     * 用户表t_user的id
+     */
+    private String userId;
+    /**
+     * 相机主表t_camera的id
+     */
+    private String cameraId;
+    /**
+     * 容量
+     */
+    private BigInteger space;
+
+    /**
+     * 算法类型(sfm或slam)
+     */
+    private String algorithm;
+
+    /**
+     * 服务器的服务商
+     */
+    private String ecs;
+
+    /**
+     * 点位视频
+     */
+    private String videos;
+
+    /**
+     * 所有资源文件名
+     */
+    private String filesName;
+
+    /**
+     * 所有资源文件名
+     */
+    private String sceneLogo;
+
+    /**
+     * 硬件版本
+     */
+    private String firmwareVersion;
+
+    private String buildType;
+
+    /**
+     * 场景来源,相机拍摄10以内表示,1表示八目,
+     * 其他来源10以上,11:一键换装,12:123看房,13文通虚拟场景
+     */
+    private Integer sceneSource;
+
+    private String departmentId;
+
+}

+ 3 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/base/entity/TmEstate.java

@@ -16,6 +16,8 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import javax.validation.constraints.NotBlank;
+
 /**
  * <p>
  *
@@ -36,6 +38,7 @@ public class TmEstate implements Serializable {
     private String id;
 
     @ApiModelProperty(value = "楼盘名称")
+    @NotBlank(message = "楼盘名称不能为空")
     private String estateName;
 
     @ApiModelProperty(value = "所属公司ID")

+ 9 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/base/enums/HouseStatus.java

@@ -31,6 +31,15 @@ public enum  HouseStatus {
         return false;
     }
 
+     public static HouseStatus get(Integer key) {
+        for (HouseStatus e : HouseStatus.values()) {
+            if (e.getCode().equals(key)) {
+                return e;
+            }
+        }
+        return HouseStatus.DRAFT;
+    }
+
 
 
 

+ 21 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/base/enums/TFEnum.java

@@ -0,0 +1,21 @@
+package fcb.project.manager.base.enums;
+
+/**
+ * 2 * @Author: Abner
+ * 3 * @Date: 2021/1/8 15:52
+ * 4
+ */
+public enum TFEnum {
+
+    TRUE(1), FALSE(0);
+
+    private Integer key;
+
+    public Integer getKey() {
+        return key;
+    }
+
+    TFEnum(Integer key) {
+        this.key = key;
+    }
+}

+ 21 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/base/param/PageParam.java

@@ -0,0 +1,21 @@
+package fcb.project.manager.base.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author Admin
+ */
+@Data
+public class PageParam {
+
+    @ApiModelProperty(name = "pageNum", value = "pageNum", required = true, dataType = "Integer")
+    @NotBlank(message = "pageNum不能为空")
+    private Integer pageNum;
+
+    @ApiModelProperty(name = "pageSize", value = "pageSize", required = true, dataType = "Integer")
+    @NotBlank(message = "pageSize不能为空")
+    private Integer pageSize;
+}

+ 63 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/base/param/house/QueryHouseParam.java

@@ -0,0 +1,63 @@
+package fcb.project.manager.base.param.house;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import fcb.project.manager.base.param.PageParam;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * @author Admin
+ */
+@Data
+@ApiModel("vr项目查询入参")
+public class QueryHouseParam extends PageParam {
+
+    @ApiModelProperty(name = "fcb_estate_id", value = "楼盘编码",  dataType = "String")
+    private String fcbEstateId;
+
+    @ApiModelProperty(name = "houseTitle", value = "房源名称",  dataType = "String")
+    private String houseTitle;
+
+    @ApiModelProperty(name = "status", value = "状态: 0->草稿;1->待审核;2->已审核;3->未通过", dataType = "Integer")
+    private Integer status;
+
+    @ApiModelProperty(name = "type", value = "房源类型: 1->新房,2->二手房", required = true, dataType = "String")
+    @NotBlank(message = "房源类型不能为空")
+    private Integer type;
+
+    @ApiModelProperty(name = "createStartTime", value = "创建开始时间", dataType = "String")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createStartTime;
+
+    @ApiModelProperty(name = "createEndTime", value = "创建结束时间", dataType = "String")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createEndTime;
+
+    @ApiModelProperty(name = "updateStartTime", value = "更新开始时间", dataType = "String")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime updateStartTime;
+
+    @ApiModelProperty(name = "updateEndTime", value = "更新结束时间", dataType = "String")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime updateEndTime;
+
+    @ApiModelProperty(name = "auditTimeStartTime", value = "审核开始时间", dataType = "String")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime auditTimeStartTime;
+
+    @ApiModelProperty(name = "auditTimeEndTime", value = "审核结束时间", dataType = "String")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime auditTimeEndTime;
+
+    @ApiModelProperty(hidden = true)
+    private String departmentId;
+
+    @ApiModelProperty(hidden = true)
+    private List<Integer> statues;
+
+}

+ 18 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/base/service/custom/PanoService.java

@@ -221,4 +221,22 @@ public class PanoService {
 
         return sevenTwoZeroSceneRspBean.getData();
     }
+
+    public List<Map<String, Object>> listPanoSceneWithTypes(String id, String token) {
+        if (StringUtils.isNotBlank(id)) {
+            throw new RuntimeException("调用feign-listPanoSceneWithTypes方法时id为空");
+        }
+        SceneRspBean sceneRspBean = null;
+        try {
+            sceneRspBean  =  panoFeign.listPanoSceneWithTypes(token , id);
+        }catch (Exception e){
+            log.info("调用720出现异常:{}" , e);
+            throw new RuntimeException("调用feign-listPanoSceneWithTypes方法时返回异常");
+        }
+        List<Map<String, Object>> list = (List<Map<String, Object>>) sceneRspBean.getData();
+        if (!CollectionUtils.isEmpty(list)) {
+            throw new RuntimeException("调用feign-listPanoSceneWithTypes方法时返回数据为空");
+        }
+        return list;
+    }
 }

+ 330 - 17
fcb-project-manager-core/src/main/java/fcb/project/manager/base/service/impl/TmEstateServiceImpl.java

@@ -1,21 +1,44 @@
 package fcb.project.manager.base.service.impl;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import fcb.project.manager.base.config.FcbConfig;
 import fcb.project.manager.base.dao.TmEstateDao;
+import fcb.project.manager.base.dto.scene.SceneProEntity;
 import fcb.project.manager.base.entity.ContextTokenBean;
+import fcb.project.manager.base.entity.SceneRspBean;
 import fcb.project.manager.base.entity.TmEstate;
+import fcb.project.manager.base.entity.TmHouse;
 import fcb.project.manager.base.enums.DeleteStatus;
+import fcb.project.manager.base.enums.HouseStatus;
 import fcb.project.manager.base.enums.SysUserRoleEnums;
+import fcb.project.manager.base.param.house.QueryHouseParam;
 import fcb.project.manager.base.service.ITmEstateService;
+import fcb.project.manager.base.service.custom.PanoService;
+import fcb.project.manager.base.utils.DateUtil;
+import fcb.project.manager.base.utils.ExcelUtil;
+import fcb.project.manager.base.vo.house.HouseVO;
+import fcb.project.manager.core.feignInterfaces.SceneFeign;
+import fdage.back.sdk.base.enums.ResultCodeEnum;
+import fdage.back.sdk.base.exception.CommonBaseException;
 import fdage.back.sdk.base.uuid.SnowFlakeUUidUtils;
 import lombok.extern.log4j.Log4j2;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
+import java.io.File;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -29,33 +52,196 @@ import java.time.LocalDateTime;
 @Log4j2
 public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> implements ITmEstateService {
 
+    @Autowired
+    private PanoService panoService;
+    @Autowired
+    private FcbConfig fcbConfig;
+    @Autowired
+    private TmAuditServiceImpl tmAuditService;
+    @Autowired
+    private SceneFeign sceneFeign;
+    @Autowired
+    private TmOperationServiceImpl tmOperationService;
+    @Autowired
+    private TmHouseServiceImpl tmHouseService;
 
+//    @Autowired
+//    public void setTmHouseService(TmHouseServiceImpl tmHouseService) {
+//        this.tmHouseService = tmHouseService;
+//    }
 
-    public IPage<TmEstate> getListByNameOrBelong(String estateName , String belongCompany, ContextTokenBean contextTokenBean,
-                                                 Long pageNum , Long pageSize){
-        LambdaQueryWrapper<TmEstate> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        if(StringUtils.isNotBlank(belongCompany)){
-            lambdaQueryWrapper.eq(TmEstate::getBelongCompanyId , belongCompany);
+    public IPage<HouseVO> listProject(QueryHouseParam queryHouseParam, ContextTokenBean contextUserInfo, String token) {
+        produceQuery(queryHouseParam, contextUserInfo);
+
+//        IPage<TmHouse> page = new Page<>(queryHouseParam.getPageNum(), queryHouseParam.getPageSize(), true);
+        Page page = new Page().setCurrent(queryHouseParam.getPageNum()).setSize(queryHouseParam.getPageSize());
+        IPage<HouseVO> vos = getBaseMapper().listProject(page, queryHouseParam);
+        
+        produceRes(vos, token);
+        return vos;
+    }
+
+    public String exportProjectList(QueryHouseParam queryHouseParam, ContextTokenBean contextUserInfo, String token) {
+        produceQuery(queryHouseParam, contextUserInfo);
+        List<HouseVO> houseList = getBaseMapper().exportProject(queryHouseParam);
+        //导出的数据
+        Map<String, String> item = null;
+        List<Map> dataList = new ArrayList<Map>();
+        String outType = "";
+        int num = 0;
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        List<String> cols = Arrays.asList("序号", "楼盘编码", "楼盘名称", "航拍数量", "景观图数量", "售楼处数量", "样板间数量", "讲房售楼处数量", "讲房样板间数量", "讲房点位数量",
+                "创建时间", "更新时间", "状态", "审核人", "审核时间");
+        ExcelUtil excelUtil = new ExcelUtil(cols);
+        for(HouseVO house : houseList){
+            int index = 0;
+            num += 1;
+            //楼盘数据
+            item = new HashMap(20);
+            item.put(excelUtil.getColeNames().get(index++), String.valueOf(num));
+            item.put(excelUtil.getColeNames().get(index++), house.getFcbEstateId());
+            item.put(excelUtil.getColeNames().get(index++), house.getEstateName());
+            item.put(excelUtil.getColeNames().get(index++), house.getBuilding().toString());
+            item.put(excelUtil.getColeNames().get(index++), house.getGarden().toString());
+            item.put(excelUtil.getColeNames().get(index++), house.getSales().toString());
+            item.put(excelUtil.getColeNames().get(index++), house.getHouse().toString());
+            item.put(excelUtil.getColeNames().get(index++), house.getSaleVideos().toString());
+            item.put(excelUtil.getColeNames().get(index++), house.getHouseVideos().toString());
+            item.put(excelUtil.getColeNames().get(index++), house.getPoints().toString());
+            item.put(excelUtil.getColeNames().get(index++), house.getCreateTime().format(df));
+            item.put(excelUtil.getColeNames().get(index++), house.getUpdateTime().format(df));
+            item.put(excelUtil.getColeNames().get(index++), HouseStatus.get(house.getAuditStatus()).getDesc());
+            item.put(excelUtil.getColeNames().get(index++), house.getAuditorName());
+            item.put(excelUtil.getColeNames().get(index++), house.getAuditTime().format(df));
+            dataList.add(item);
         }
-        if(StringUtils.isNotBlank(estateName)){
-            lambdaQueryWrapper.like(TmEstate::getEstateName , estateName);
+
+        String date = DateUtil.date2String(new Date(), DateUtil.YYYYMMDDHHMMSS_DATA_FORMAT);
+
+        String aduitName = HouseStatus.get(queryHouseParam.getStatus()).getDesc();
+        if(queryHouseParam.getStatus().compareTo(HouseStatus.REJECT.getCode()) == 0){
+            aduitName = "未通过";
         }
-        if(null != contextTokenBean){
-            if (StringUtils.equals(contextTokenBean.getRoleKey(), SysUserRoleEnums.ADMIN.getRoleKey())
-                    || StringUtils.equals(contextTokenBean.getRoleKey(), SysUserRoleEnums.GROUP.getRoleKey())) {
-                //超级管理员和集团管理员可以看到所有数据
+        String dateStr = "VR楼盘项目-" + aduitName + "-" + date;
+        String fileName = dateStr + ".xls";
+        File file = new File(fcbConfig.getExcelLocalPath() + fileName);
+        if(!file.getParentFile().exists()){
+            file.getParentFile().mkdirs();
+        }
+
+        excelUtil.writeExcel(dataList, excelUtil.getColeNames().size(), fcbConfig.getExcelLocalPath() + fileName, dateStr);
+        return fcbConfig.getOuterSceneVrHost() + "excel/" + dateStr + ".xls";
+    }
+
+
+    private void produceQuery(QueryHouseParam queryHouseParam, ContextTokenBean contextUserInfo) {
+        if (!StringUtils.equals(contextUserInfo.getRoleKey(), SysUserRoleEnums.ADMIN.getRoleKey())
+                && !StringUtils.equals(contextUserInfo.getRoleKey(), SysUserRoleEnums.GROUP.getRoleKey())) {
+            queryHouseParam.setDepartmentId(contextUserInfo.getDepartmentId());
+        }
+        if (queryHouseParam.getStatus() != null && HouseStatus.REJECT.getCode().equals(queryHouseParam.getStatus())) {
+            queryHouseParam.setStatues(Arrays.asList(HouseStatus.REJECT.getCode(), HouseStatus.REGION_REJECT.getCode()));
+        }
+    }
+
+
 
-            } else {
-                lambdaQueryWrapper.eq(TmEstate::getBelongCompanyId , contextTokenBean.getDepartmentId());
+    // todo
+    private void produceRes(IPage<HouseVO> resultPage, String token) {
+        if(null != resultPage && resultPage.getTotal() > 0){
+            List<String> getAllHouseIds = new ArrayList<>();
+            for (int i = 0; i < resultPage.getRecords().size(); i++) {
+                getAllHouseIds.add(resultPage.getRecords().get(i).getId());
             }
+            //从720获取最新的预览路径,重新封装给前端展示
+            TreeMap<String , Object> treeMap =  panoService.getHouseVrlinks(getAllHouseIds , token);
 
+            //从720获取统计数据
+            Map<String, Object> statistics;
+            List<Map<String, Object>> panoSceneWithTypes;
+
+            //当前房源所有场景码集合
+            List<String> allSceneNums;
+
+            //四维看看接口参数
+            Map<String, String> param = new HashMap<>();
+            //四维看看获取统计结果
+            SceneRspBean sceneRspBean;
+
+            for (int i = 0; i < resultPage.getRecords().size(); i++) {
+                String vrId = resultPage.getRecords().get(i).getId();
+                //获取当前房源的审核记录数,用于前端判决是否展示审核历史图标
+                resultPage.getRecords().get(i).setCountNum(tmAuditService.countAuditNum(vrId));
+                if(!CollectionUtils.isEmpty(treeMap)){
+                    String path = (String) treeMap.get(vrId);
+                    if(StringUtils.isNotBlank(path)){
+                        String outerHost = fcbConfig.getOuterSceneVrHost().substring(0 , fcbConfig.getOuterSceneVrHost().length() - 1);
+                        String innerHost = fcbConfig.getInnerSceneVrHost().substring(0 , fcbConfig.getInnerSceneVrHost().length() - 1);
+                        resultPage.getRecords().get(i).setInnerVrLink(innerHost + path);
+                        resultPage.getRecords().get(i).setVrLink(outerHost + path);
+                    }
+                }
+                //调用720云接口,获取统计数据map
+                statistics = panoService.getStatistics(vrId, token);
+                if(statistics != null) {
+                    resultPage.getRecords().get(i).setGarden(statistics.get("garden"));
+                    resultPage.getRecords().get(i).setHouse(statistics.get("house"));
+                    resultPage.getRecords().get(i).setBuilding(statistics.get("building"));
+                    resultPage.getRecords().get(i).setSales(statistics.get("sales"));
+                }
+
+                int salesVideos = 0;
+                int houseVideos = 0;
+                panoSceneWithTypes = panoService.listPanoSceneWithTypes(resultPage.getRecords().get(i).getId(), token);
+
+                List<String> nums = panoSceneWithTypes.stream().map(e -> e.get("sceneNum").toString()).collect(Collectors.toList());
+
+                sceneRspBean = sceneFeign.listScenesInNums(nums, token);
+                List<SceneProEntity> scenes = (List<SceneProEntity>) sceneRspBean.getData();
+                for (SceneProEntity scene : scenes) {
+                    String videoStr = scene.getVideos();
+                    JSONObject scenejson = new JSONObject();
+                    if(videoStr != null) {
+                        scenejson = JSONObject.parseObject(videoStr);
+                    }
+                    Object data = scenejson.get("data");
+                    if (data != null && data instanceof JSONArray) {
+                        JSONArray jsonArray = (JSONArray) data;
+                        if (jsonArray.size() != 0) {
+                            Optional<Map<String, Object>> existData = panoSceneWithTypes.stream().filter(m ->
+                                    "sales".equals(m.get("type")) && scene.getNum().equals(m.get("sceneNum"))).findAny();
+                            if (existData.isPresent()) {
+                                salesVideos += jsonArray.size();
+                            }
+                            existData = panoSceneWithTypes.stream().filter(m ->
+                                    "room".equals(m.get("type")) && scene.getNum().equals(m.get("sceneNum"))).findAny();
+                            if (existData.isPresent()) {
+                                houseVideos += jsonArray.size();
+                            }
+
+                        }
+                    }
+                }
+                resultPage.getRecords().get(i).setSaleVideos(salesVideos);
+                resultPage.getRecords().get(i).setHouseVideos(houseVideos);
+
+                allSceneNums = panoService.getAllSceneNums(vrId, token);
+                if(allSceneNums != null){
+                    param.put("sceneNum", allSceneNums.stream().filter(string ->!string.isEmpty()).collect(Collectors.joining(";")));
+                    sceneRspBean = sceneFeign.statisticsPoints(param, token);
+
+                    if(null == sceneRspBean || sceneRspBean.getCode() != 0){
+                        log.info("调用四维看看获取所有场景点位数失败,场景码是:" + param.get("sceneNum"));
+                    }else {
+                        resultPage.getRecords().get(i).setPoints(sceneRspBean.getData());
+                    }
+                }
+            }
         }
-        lambdaQueryWrapper.eq(TmEstate::getIsDelete , DeleteStatus.NOT_DELETE.getCode());
-        lambdaQueryWrapper.orderByDesc(TmEstate::getCreateTime);
-        IPage<TmEstate> page = new Page<>(pageNum , pageSize);
-        return  getBaseMapper().selectPage(page , lambdaQueryWrapper);
     }
 
+
+
     public TmEstate getOneByNameAndBelong(String estateName , String belongCompany){
         LambdaQueryWrapper<TmEstate> lambdaQueryWrapper = new LambdaQueryWrapper<>();
         if(StringUtils.isNotBlank(estateName)){
@@ -99,4 +285,131 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
         return 1 == getBaseMapper().insert(estate);
     }
 
+
+    @Transactional
+    public Map<String, Object> addProject(TmEstate tmEstate, ContextTokenBean tokenMap) {
+        TmEstate dbEstate = getOneByNameAndBelong(tmEstate.getEstateName(), tokenMap.getDepartmentName());
+        if (null != dbEstate) {
+            log.info("{}公司下面的楼盘{}已经存在", tmEstate.getBelongCompanyName(), tmEstate.getEstateName());
+            throw new CommonBaseException(ResultCodeEnum.D101, "楼盘已经存在,无需再添加");
+        }
+        if (null != tokenMap) {
+            tmEstate.setBelongCompanyId(tokenMap.getDepartmentId());
+            tmEstate.setBelongCompanyName(tokenMap.getDepartmentName());
+            tmEstate.setCreateById(tokenMap.getId());
+            tmEstate.setCreateByName(tokenMap.getNickName());
+        }
+        if (insertNew(tmEstate)) {
+            int ins = tmOperationService.addNewWithTypeAndContent(tokenMap , "VR楼盘项目" , "创建楼盘/" + tmEstate.getEstateName());
+            if(ins != 1){
+                log.error("插入操作记录失败");
+            }
+        }
+
+        TmHouse tmHouse = new TmHouse();
+        tmHouse.setEstateId(tmEstate.getId());
+        tmHouse.setEstateName(tmEstate.getEstateName());
+        if(null != tokenMap){
+            tmHouse.setCreateById(tokenMap.getId());
+            tmHouse.setCreateByName(tokenMap.getNickName());
+        }
+        tmHouse.setBelongCompanyId(tmEstate.getBelongCompanyId());
+        tmHouse.setBelongCompanyName(tmEstate.getBelongCompanyName());
+        tmHouse.setEstateName(tmEstate.getEstateName());
+        tmHouse.setStatus(0);
+        TmHouse latestHouse = tmHouseService.insertNewWithRsp(tmHouse);
+        Map<String , Object> resultMap = new HashMap<>();
+        resultMap.put("houseId" , tmHouse.getId());
+        return resultMap;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public String delete(String estateId, ContextTokenBean contextTokenBean, String token) {
+        TmEstate dbEstate = getById(estateId);
+        if(null == dbEstate){
+            return "楼盘不存在或已被删除";
+        }
+
+        LambdaQueryWrapper<TmHouse> qw = new LambdaQueryWrapper();
+        qw.eq(TmHouse::getIsDelete, 0).eq(TmHouse::getEstateId, estateId);
+        TmHouse dbHouse = tmHouseService.getOne(qw);
+        if (dbHouse == null) {
+            return "楼盘项目不存在或已被删除";
+        }
+
+        deleteEstateById(estateId);
+
+        tmOperationService.addNewWithTypeAndContent(contextTokenBean , "VR楼盘项目" , "删除楼盘/" + dbEstate.getEstateName());
+
+        if(null != dbHouse.getStatus()){
+            //除了草稿、未通过状态,其他状态都不能删除
+            if(!HouseStatus.canDelete(dbHouse.getStatus())){
+                return "存在待审核/已审核数据,无法删除";
+            }
+        }
+
+        if(!isCanDelete(dbHouse, contextTokenBean)){
+            return "暂无删除权限";
+        }
+
+        int delete = tmHouseService.deleteHouseById(dbHouse.getId());
+
+        List<TmHouse> houseList = tmHouseService.getListByEstate(estateId);
+        if(!org.apache.commons.collections.CollectionUtils.isEmpty(houseList)){
+            for (TmHouse house : houseList) {
+                if(null != house){
+                    List<String> sceneNumList = panoService.getKanKanSceneNums(house.getId() , token);
+                    log.info("720返回的房源的[{}]对应的四维场景码列表为:{}" , house.getId() , JSON.toJSONString(sceneNumList));
+                    if(!org.apache.commons.collections.CollectionUtils.isEmpty(sceneNumList)){
+                        return "楼盘下存在未解绑的VR项目,请解绑后删除";
+                    }
+                }
+            }
+        }
+
+        int ins = tmOperationService.addNewWithTypeAndContent(contextTokenBean , "VR楼盘项目" , "删除VR项目/" + dbHouse.getHouseTitle());
+
+        List<String> sceneNumList = panoService.getKanKanSceneNums(dbHouse.getId() , token);
+        log.info("720返回的房源的[{}]对应的四维场景码列表为:{}" , dbHouse.getId() , JSON.toJSONString(sceneNumList));
+        if(!CollectionUtils.isEmpty(sceneNumList)){
+            Map<String , Object> map = new HashMap<>();
+            map.put("status" , 2);
+            map.put("sceneNum" , sceneNumList.stream().collect(Collectors.joining(";")));
+            log.info("上送四维看看的参数为:{}" , JSON.toJSONString(map));
+            SceneRspBean rsp = sceneFeign.updateSceneStatus(map , token);
+            log.info("四维看看翻转状态返回为:{}" , JSON.toJSONString(rsp));
+            if(null == rsp || rsp.getCode() != 0){
+                log.info("调用看看的更新场景状态微服务失败");
+                if(null != rsp){
+                    log.info("code = {} , msg = {}" , rsp.getCode() , rsp.getMsg());
+                }
+                throw new CommonBaseException(ResultCodeEnum.D101 , "更新看看场景状态失败");
+            }
+
+        }
+
+        //通知720,告知房源下线(审核通过/上线:4, 下线:3)
+        //panoService.noticeVrAuditStatus(houseId , getToken() , 3);
+
+        panoService.noticeDeleteVr(dbHouse.getId(), token);
+        return "删除房源成功";
+
+    }
+
+    /**
+     * 是否可以删除的条件
+     * 1.地区管理员和集团管理员、超级管理员能删除下属或自己的模型
+     * 2.拍摄人员只能删除自己的模型
+     * @param dbHouse
+     * @return
+     */
+    private boolean isCanDelete(TmHouse dbHouse, ContextTokenBean contextTokenBean) {
+        if (SysUserRoleEnums.REGION_SHOOT.getRoleKey().equals(contextTokenBean.getRoleKey())
+                && !dbHouse.getCreateById().equals(contextTokenBean.getId())) {
+            return false;
+        }
+        return true;
+    }
+
+
 }

+ 1 - 97
fcb-project-manager-core/src/main/java/fcb/project/manager/base/service/impl/TmHouseServiceImpl.java

@@ -22,6 +22,7 @@ import lombok.extern.log4j.Log4j2;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -65,103 +66,6 @@ public class TmHouseServiceImpl extends ServiceImpl<TmHouseDao, TmHouse> impleme
 
 
 
-    public IPage<TmHouse> getListByNameOrBelong(String houseTitle,
-                                                Integer status, Integer type,
-                                                String estateId, ContextTokenBean contextTokenBean,
-                                                String token,
-                                                Long pageNum, Long pageSize) {
-        LambdaQueryWrapper<TmHouse> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper.eq(TmHouse::getEstateId, estateId);
-        lambdaQueryWrapper.eq(TmHouse::getIsShow, 1);
-        if (StringUtils.isNotBlank(houseTitle)) {
-            lambdaQueryWrapper.like(TmHouse::getHouseTitle, houseTitle);
-        }
-        if (null != contextTokenBean) {
-            if (StringUtils.equals(contextTokenBean.getRoleKey(), SysUserRoleEnums.ADMIN.getRoleKey())
-                    || StringUtils.equals(contextTokenBean.getRoleKey(), SysUserRoleEnums.GROUP.getRoleKey())) {
-                //超级管理员和集团管理员可以看到所有数据
-
-            } else {
-                //非超级管理员,只能看到自己部门的
-                Map<String , Object> map = new HashMap<>();
-                map.put("id" , contextTokenBean.getDepartmentId());
-                Object userResult = userFeign.getAllChildDeptList(map);
-                log.info("用户模块返回的数据为:{}" , userResult);
-                lambdaQueryWrapper.eq(TmHouse::getBelongCompanyId , contextTokenBean.getDepartmentId());
-            }
-        }
-        if (null != status) {
-            if(status.compareTo(HouseStatus.REJECT.getCode()) == 0){
-                lambdaQueryWrapper.in(TmHouse::getStatus, HouseStatus.REJECT.getCode(), HouseStatus.REGION_REJECT.getCode());
-            }else {
-                lambdaQueryWrapper.eq(TmHouse::getStatus, status);
-            }
-        }
-        if (null != type) {
-            lambdaQueryWrapper.eq(TmHouse::getType, type);
-        }
-
-        lambdaQueryWrapper.orderByDesc(TmHouse::getCreateTime);
-        IPage<TmHouse> page = new Page<>(pageNum, pageSize, true);
-        IPage<TmHouse> resultPage = getBaseMapper().selectPage(page, lambdaQueryWrapper);
-        if(null != resultPage && resultPage.getTotal() > 0){
-            List<String> getAllHouseIds = new ArrayList<>();
-            for (int i = 0; i < resultPage.getRecords().size(); i++) {
-                getAllHouseIds.add(resultPage.getRecords().get(i).getId());
-            }
-            //从720获取最新的预览路径,重新封装给前端展示
-            TreeMap<String , Object> treeMap =  panoService.getHouseVrlinks(getAllHouseIds , token);
-
-            //从720获取统计数据
-            Map<String, Object> statistics = null;
-
-            //当前房源所有场景码集合
-            List<String> allSceneNums = null;
-
-            //四维看看接口参数
-            Map<String, String> param = new HashMap<>();
-            //四维看看获取统计结果
-            SceneRspBean sceneRspBean = null;
-
-            for (int i = 0; i < resultPage.getRecords().size(); i++) {
-                String vrId = resultPage.getRecords().get(i).getId();
-                //获取当前房源的审核记录数,用于前端判决是否展示审核历史图标
-                resultPage.getRecords().get(i).setCountNum(tmAuditService.countAuditNum(vrId));
-                if(!CollectionUtils.isEmpty(treeMap)){
-                    String path = (String) treeMap.get(vrId);
-                    if(StringUtils.isNotBlank(path)){
-                        String outerHost = outerSceneVrHost.substring(0 , outerSceneVrHost.length() - 1);
-                        String innerHost = innerSceneVrHost.substring(0 , innerSceneVrHost.length() - 1);
-                        resultPage.getRecords().get(i).setInnerVrLink(innerHost + path);
-                        resultPage.getRecords().get(i).setVrLink(outerHost + path);
-                    }
-                }
-
-                //调用720云接口,获取统计数据map
-                statistics = panoService.getStatistics(vrId, token);
-                if(statistics != null){
-                    resultPage.getRecords().get(i).setGarden(statistics.get("garden"));
-                    resultPage.getRecords().get(i).setHouse(statistics.get("house"));
-                    resultPage.getRecords().get(i).setBuilding(statistics.get("building"));
-                    resultPage.getRecords().get(i).setSales(statistics.get("sales"));
-                }
-
-                allSceneNums = panoService.getAllSceneNums(vrId, token);
-                if(allSceneNums != null){
-                    param.put("sceneNum", allSceneNums.stream().filter(string ->!string.isEmpty()).collect(Collectors.joining(";")));
-                    sceneRspBean = sceneFeign.statisticsPoints(param, token);
-
-                    if(null == sceneRspBean || sceneRspBean.getCode() != 0){
-                        log.info("调用四维看看获取所有场景点位数失败,场景码是:" + param.get("sceneNum"));
-                    }else {
-                        resultPage.getRecords().get(i).setPoints(sceneRspBean.getData());
-                    }
-                }
-            }
-        }
-        return resultPage;
-    }
-
 
     public List<TmHouse> getListByEstate(String estateId){
         LambdaQueryWrapper<TmHouse> lambdaQueryWrapper = new LambdaQueryWrapper<>();

+ 29 - 50
fcb-project-manager-core/src/main/java/fcb/project/manager/base/utils/ExcelUtil.java

@@ -5,6 +5,7 @@ import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.util.CollectionUtils;
 
 import java.io.*;
 import java.util.ArrayList;
@@ -17,20 +18,16 @@ public class ExcelUtil {
 
     private static final String EXCEL_XLS = "xls";
     private static final String EXCEL_XLSX = "xlsx";
+    private List<String> coleNames;
 
-    public static final String[] AUDIT_EXCEL_COLE_NAME = {"序号","VR项目id","VR项目名称","项目类型","所属楼盘","公司","创建人","提审时间","审核状态","审核人", "审核时间"};
-
-    public static void main(String[] args) {
-        Map<String, String> dataMap = new HashMap<String, String>();
-        dataMap.put("BankName", "BankName");
-        dataMap.put("Addr", "Addr");
-        dataMap.put("Phone", "Phone");
-        List<Map> list = new ArrayList<Map>();
-        list.add(dataMap);
-        new ExcelUtil().writeExcel(list, 3, "D:/writeExcel.xls","");
+    public ExcelUtil(List<String> coleNames) {
+        if (!CollectionUtils.isEmpty(coleNames)) {
+            throw new RuntimeException("导出列名称集合为空");
+        }
+        this.coleNames = coleNames;
     }
 
-    public static Workbook writeExcel(List<Map> dataList, int columnCount, String xlsxPath, String titleStr) {
+    public Workbook writeExcel(List<Map> dataList, int columnCount, String xlsxPath, String titleStr) {
         OutputStream out = null;
         try {
             // 获取总列数
@@ -51,7 +48,7 @@ public class ExcelUtil {
              * 第三个代表:起始列
              * 第四个代表:结束列
              */
-            CellRangeAddress cra = new CellRangeAddress(0, 0, 0, AUDIT_EXCEL_COLE_NAME.length -1);
+            CellRangeAddress cra = new CellRangeAddress(0, 0, 0, coleNames.size() -1);
             //把合并样式添加到sheet中
             sheet.addMergedRegion(cra);
 
@@ -85,9 +82,9 @@ public class ExcelUtil {
 
             HSSFRow hssfRow = sheet.createRow((short) 1);
             sheet.createFreezePane(0, 1);
-            for (int i = 0; i < AUDIT_EXCEL_COLE_NAME.length; ++i) {
+            for (int i = 0; i < coleNames.size(); ++i) {
                 HSSFCell cell = hssfRow.createCell((short)i);
-                cell.setCellValue(AUDIT_EXCEL_COLE_NAME[i]);
+                cell.setCellValue(coleNames.get(i));
                 cell.setCellStyle(setBorder);
             }
             // 创建文件输出流,输出电子表格:这个必须有,否则你在sheet上做的任何操作都不会有效
@@ -102,14 +99,14 @@ public class ExcelUtil {
                 // 得到要插入的每一条记录
                 Map<String, String> dataMap = dataList.get(j);
 
-                for (int i = 0; i < AUDIT_EXCEL_COLE_NAME.length; ++i) {
-                    String value = dataMap.get(AUDIT_EXCEL_COLE_NAME[i]);
+                for (int i = 0; i < coleNames.size(); ++i) {
+                    String value = dataMap.get(coleNames.get(i));
                     Cell cell = row.createCell(i);
                     cell.setCellValue(value);
 
                     cell.setCellStyle(setBorder);
                     if(value != null){
-                        setSizeColumn(sheet, AUDIT_EXCEL_COLE_NAME.length);
+                        setSizeColumn(sheet, coleNames.size());
                     }
                 }
             }
@@ -134,43 +131,11 @@ public class ExcelUtil {
     }
 
     /**
-     * 判断Excel的版本,获取Workbook
-     *
-     * @return
-     * @throws IOException
-     */
-    public static Workbook getWorkbok(File file) throws IOException {
-        try {
-            Workbook wb = null;
-            InputStream in = new FileInputStream(file);
-
-            if (!in.markSupported()) {
-                in = new PushbackInputStream(in, 8);
-            }
-
-            if (file.getName().endsWith(EXCEL_XLS)) {
-                wb = new HSSFWorkbook(in);
-            } else if (file.getName().endsWith(EXCEL_XLSX)) {
-                wb = new XSSFWorkbook(in);
-            } else {
-                log.error("你的excel版本目前poi解析不了");
-            }
-            return wb;
-        } catch (Exception e) {
-            log.error("WriteExcelServiceImpl-getWorkbok");
-            StringWriter trace = new StringWriter();
-            e.printStackTrace(new PrintWriter(trace));
-            log.error(trace.toString());
-            return null;
-        }
-    }
-
-    /**
      *  自适应列宽
      * @param sheet
      * @param columnLength 列数
      */
-    private static void setSizeColumn(Sheet sheet, int columnLength) {
+    private void setSizeColumn(Sheet sheet, int columnLength) {
         for (int columnNum = 0; columnNum <= columnLength; columnNum++) {
             int columnWidth = sheet.getColumnWidth(columnNum) / 256;
             for (int rowNum = 0; rowNum < sheet.getLastRowNum(); rowNum++) {
@@ -197,4 +162,18 @@ public class ExcelUtil {
         }
     }
 
+    public List<String> getColeNames() {
+        return coleNames;
+    }
+
+    public static void main(String[] args) {
+        Map<String, String> dataMap = new HashMap<String, String>();
+        dataMap.put("BankName", "BankName");
+        dataMap.put("Addr", "Addr");
+        dataMap.put("Phone", "Phone");
+        List<Map> list = new ArrayList<Map>();
+        list.add(dataMap);
+//        ExcelUtil.writeExcel(list, 3, "D:/writeExcel.xls","");
+    }
+
 }

+ 95 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/base/vo/house/HouseVO.java

@@ -0,0 +1,95 @@
+package fcb.project.manager.base.vo.house;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author Admin
+ */
+@Data
+@ApiModel("vr项目列表出参")
+public class HouseVO {
+
+    @ApiModelProperty(name = "id", value = "vr项目id",  dataType = "String")
+    private String id;
+
+    @ApiModelProperty(name = "estateId", value = "楼盘id",  dataType = "String")
+    private String estateId;
+
+    @ApiModelProperty(name = "fcbEstateId", value = "楼盘编码",  dataType = "String")
+    private String fcbEstateId;
+
+    @ApiModelProperty(name = "estateName", value = "楼盘名称",  dataType = "String")
+    private String estateName;
+
+    @ApiModelProperty(name = "createTime", value = "创建时间",  dataType = "String")
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty(name = "updateTime", value = "更新时间",  dataType = "String")
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime updateTime;
+
+    @ApiModelProperty(name = "auditStatus", value = "审核状态",  dataType = "Integer")
+    private Integer auditStatus;
+
+    @ApiModelProperty(name = "auditorName", value = "审核人",  dataType = "String")
+    private String auditorName;
+
+    @ApiModelProperty(name = "auditTime", value = "审核时间",  dataType = "String")
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime auditTime;
+
+    @ApiModelProperty(name = "coverImagUrl", value = "封面",  dataType = "String")
+    private String coverImagUrl;
+
+    @ApiModelProperty(name = "createByName", value = "创建人",  dataType = "String")
+    private String createByName;
+
+    @ApiModelProperty(name = "houseTitle", value = "vr项目名称",  dataType = "String")
+    private String houseTitle;
+
+    @ApiModelProperty(name = "submitAuditTime", value = "提审时间",  dataType = "String")
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime submitAuditTime;
+
+    @ApiModelProperty(name = "vrLink", value = "vrLink",  dataType = "String")
+    private String vrLink;
+
+    @ApiModelProperty(name = "vrPath", value = "vrPath",  dataType = "String")
+    private String vrPath;
+
+    @ApiModelProperty(name = "innerVrLink", value = "innerVrLink",  dataType = "String")
+    private String innerVrLink;
+
+    @ApiModelProperty(name = "type", value = "type",  dataType = "String")
+    private Integer type;
+
+    @ApiModelProperty(name = "countNum", value = "countNum",  dataType = "Long")
+    private Long countNum;
+
+    @ApiModelProperty(name = "garden", value = "观景图数量",  dataType = "Long")
+    private Object garden;
+
+    @ApiModelProperty(name = "house", value = "样板间数量",  dataType = "Long")
+    private Object house;
+
+    @ApiModelProperty(name = "building", value = "航拍数量",  dataType = "Long")
+    private Object building;
+
+    @ApiModelProperty(name = "sales", value = "销售处数量",  dataType = "Long")
+    private Object sales;
+
+    @ApiModelProperty(name = "sales", value = "讲房点位数量",  dataType = "Long")
+    private Object points;
+
+    @ApiModelProperty(name = "sales", value = "讲房销售处数量",  dataType = "Long")
+    private Object saleVideos;
+
+    @ApiModelProperty(name = "sales", value = "讲房样板间数量",  dataType = "Long")
+    private Object houseVideos;
+}

+ 0 - 176
fcb-project-manager-core/src/main/java/fcb/project/manager/core/controller/ProjectController.java

@@ -1,176 +0,0 @@
-package fcb.project.manager.core.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import fcb.project.manager.base.entity.ContextTokenBean;
-import fcb.project.manager.base.entity.TmEstate;
-import fcb.project.manager.base.entity.TmHouse;
-import fcb.project.manager.base.service.custom.PanoService;
-import fcb.project.manager.base.service.impl.TmEstateServiceImpl;
-import fcb.project.manager.base.service.impl.TmHouseServiceImpl;
-import fcb.project.manager.base.service.impl.TmOperationServiceImpl;
-import fcb.project.manager.base.utils.DataUtils;
-import fdage.back.sdk.base.entity.Result;
-import fdage.back.sdk.base.enums.ResultCodeEnum;
-import fdage.back.sdk.base.exception.CommonBaseException;
-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 org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-
-/**
- * 2 * @Author: Abner
- * 3 * @Date: 2021/1/7 12:16
- * 4
- */
-@Api(tags = "项目管理相关接口")
-@RestController
-@RequestMapping("fcb/project/project")
-@Log4j2
-public class ProjectController extends BaseController {
-
-    @Autowired
-    private TmEstateServiceImpl tmEstateService;
-
-    @Autowired
-    private TmHouseServiceImpl tmHouseService;
-
-    @Autowired
-    private RedisTemplate redisTemplate;
-
-    @Autowired
-    private PanoService panoService;
-
-    @Autowired
-    private TmOperationServiceImpl tmOperationService;
-
-
-    @GetMapping("/queryOrSearchList")
-    @ApiOperation(value = "根据条件拉取所有楼盘")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "estateName", value = "楼盘名称", paramType = "query", required = true, dataType = "String"),
-            @ApiImplicitParam(name = "belongCompany", value = "所属公司", paramType = "query", required = true, dataType = "String"),
-            @ApiImplicitParam(name = "pageNum", value = "当前页码", paramType = "query", required = true, dataType = "Long"),
-            @ApiImplicitParam(name = "pageSize", value = "每页大小", paramType = "query", required = true, dataType = "Long")
-    })
-    public Result<Object> getProjectList(@RequestParam(required = false) String estateName,
-                                         @RequestParam(required = false) String belongCompany,
-                                         @RequestParam(name = "pageNum") Long pageNum,
-                                         @RequestParam(name = "pageSize") Long pageSize) {
-
-        IPage<TmEstate> resultPage = tmEstateService.getListByNameOrBelong(estateName, belongCompany, getContextUserInfo(), pageNum, pageSize);
-        return Result.success(DataUtils.assembleResult(resultPage.getTotal(), resultPage.getPages(),
-                resultPage.getCurrent(), resultPage.getRecords()));
-    }
-
-    @PostMapping("/addEstate")
-    @ApiOperation(value = "创建楼盘项目")
-    public Result<Object> addNewEstate(@RequestBody TmEstate tmEstate, HttpServletRequest request) {
-
-        if (!StringUtils.isNoneBlank(tmEstate.getEstateName())) {
-            throw new CommonBaseException(ResultCodeEnum.D101, "楼盘名称不能为空");
-        }
-        ContextTokenBean tokenMap = getContextUserInfo();
-        TmEstate dbEstate = tmEstateService.getOneByNameAndBelong(tmEstate.getEstateName(), tokenMap.getDepartmentName());
-        if (null != dbEstate) {
-            log.info("{}公司下面的楼盘{}已经存在", tmEstate.getBelongCompanyName(), tmEstate.getEstateName());
-            throw new CommonBaseException(ResultCodeEnum.D101, "楼盘已经存在,无需再添加");
-        }
-        if (null != tokenMap) {
-            tmEstate.setBelongCompanyId(tokenMap.getDepartmentId());
-            tmEstate.setBelongCompanyName(tokenMap.getDepartmentName());
-            tmEstate.setCreateById(tokenMap.getId());
-            tmEstate.setCreateByName(tokenMap.getNickName());
-        }
-        if (tmEstateService.insertNew(tmEstate)) {
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "创建楼盘/" + tmEstate.getEstateName());
-            if(ins != 1){
-                log.info("插入操作记录失败");
-            }
-            return Result.success("新增成功");
-        } else {
-            return Result.failure("新增失败");
-        }
-    }
-
-    @PostMapping("/deleteEstate")
-    @ApiOperation(value = "删除楼盘信息")
-    public Result<Object> deleteEstate(String estateId) {
-
-        if (StringUtils.isBlank(estateId)) {
-            return Result.failure("楼盘ID不能为空");
-        }
-        TmEstate dbEstate = tmEstateService.getById(estateId);
-        if(null == dbEstate){
-            return Result.failure("楼盘不存在");
-        }
-
-        IPage<TmHouse> page = tmHouseService.checkEstateCanDelete(estateId);
-        if (null != page && page.getTotal() > 0) {
-            return Result.failure("楼盘下存在VR项目时不可删除");
-        }
-        List<TmHouse> houseList = tmHouseService.getListByEstate(estateId);
-        if(!CollectionUtils.isEmpty(houseList)){
-            for ( TmHouse house : houseList) {
-                if(null != house){
-                    List<String> sceneNumList = panoService.getKanKanSceneNums(house.getId() , getToken());
-                    log.info("720返回的房源的[{}]对应的四维场景码列表为:{}" , house.getId() , JSON.toJSONString(sceneNumList));
-                    if(!CollectionUtils.isEmpty(sceneNumList)){
-                        return Result.failure("楼盘下存在未解绑的VR项目,请解绑后删除");
-                    }
-                }
-            }
-        }
-        int delete = tmEstateService.deleteEstateById(estateId);
-        if (delete != 1) {
-            return Result.failure("删除失败");
-        }
-        int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "删除楼盘/" + dbEstate.getEstateName());
-        if(ins != 1){
-            log.info("插入操作记录失败");
-        }
-
-        return Result.success("删除楼盘成功");
-
-    }
-
-    @PostMapping("/updateEstate")
-    @ApiOperation(value = "修改楼盘项目信息")
-    public Result<Object> updateEstate(@RequestBody TmEstate tmEstate) {
-
-        if (null == tmEstate) {
-            return Result.failure("入参为空");
-        }
-        if (StringUtils.isBlank(tmEstate.getId())) {
-            return Result.failure("id不能为空");
-        }
-        TmEstate dbEstate = tmEstateService.getById(tmEstate.getId());
-        if(null == dbEstate){
-            return Result.failure("楼盘不存在");
-        }
-        if (tmEstate.getIsDelete().compareTo(1) == 0 && dbEstate.getIsDelete().compareTo(0) == 0) {
-            //删除楼盘操作,需要检查楼盘下面是否还有有效房源
-
-        }
-        if (tmEstateService.updateEstate(tmEstate)) {
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "修改楼盘/" + dbEstate.getEstateName());
-            if(ins != 1){
-                log.info("插入操作记录失败");
-            }
-            return Result.success("修改成功");
-        } else {
-            return Result.failure("修改失败");
-        }
-    }
-
-
-}

+ 3 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/core/feignInterfaces/PanoFeign.java

@@ -2,6 +2,7 @@ package fcb.project.manager.core.feignInterfaces;
 
 import fcb.project.manager.base.entity.CommonRspBean;
 import fcb.project.manager.base.entity.PanoInitSceneTotalRsp;
+import fcb.project.manager.base.entity.SceneRspBean;
 import fcb.project.manager.base.entity.SevenTwoZeroSceneRspBean;
 import fcb.project.manager.core.feignInterfaces.fallBack.PanoFeignFallBack;
 import org.springframework.cloud.openfeign.FeignClient;
@@ -42,4 +43,6 @@ public interface PanoFeign {
     @GetMapping("/fcb/pano/house/getVrSceneCode/{houseId}")
     public SevenTwoZeroSceneRspBean getAllSceneNum(@RequestHeader(name = "token") String token , @PathVariable(name = "") String houseId);
 
+    @GetMapping("fcb/pano/house/getVrSceneCodeAndType/{houseId}")
+    SceneRspBean listPanoSceneWithTypes(@RequestHeader(name = "token")String token, @PathVariable(name = "houseId") String id);
 }

+ 7 - 2
fcb-project-manager-core/src/main/java/fcb/project/manager/core/feignInterfaces/SceneFeign.java

@@ -3,10 +3,12 @@ package fcb.project.manager.core.feignInterfaces;
 import fcb.project.manager.base.entity.SceneRspBean;
 import fcb.project.manager.core.feignInterfaces.fallBack.SceneFeignFallBack;
 import org.springframework.cloud.openfeign.FeignClient;
+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.RequestHeader;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -18,8 +20,11 @@ import java.util.Map;
 public interface SceneFeign {
 
     @PostMapping("/api/scene/updateStatus")
-    public SceneRspBean updateSceneStatus(@RequestBody Map<String , Object> param , @RequestHeader(name = "token") String token);
+    SceneRspBean updateSceneStatus(@RequestBody Map<String, Object> param, @RequestHeader(name = "token") String token);
 
     @PostMapping("/api/scene/statisticsPoints")
-    public SceneRspBean statisticsPoints(@RequestBody Map<String , String> param , @RequestHeader(name = "token") String token);
+    SceneRspBean statisticsPoints(@RequestBody Map<String, String> param, @RequestHeader(name = "token") String token);
+
+    @PostMapping("/api/scene/listScenesInNums")
+    SceneRspBean listScenesInNums(@RequestBody List<String> nums, @RequestHeader(name = "token") String token);
 }

+ 8 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/core/feignInterfaces/fallBack/PanoFeignFallBack.java

@@ -2,6 +2,7 @@ package fcb.project.manager.core.feignInterfaces.fallBack;
 
 import fcb.project.manager.base.entity.CommonRspBean;
 import fcb.project.manager.base.entity.PanoInitSceneTotalRsp;
+import fcb.project.manager.base.entity.SceneRspBean;
 import fcb.project.manager.base.entity.SevenTwoZeroSceneRspBean;
 import fcb.project.manager.core.feignInterfaces.PanoFeign;
 import org.springframework.stereotype.Component;
@@ -79,4 +80,11 @@ public class PanoFeignFallBack implements PanoFeign {
         sevenTwoZeroSceneRspBean.setCode(-1);
         return sevenTwoZeroSceneRspBean;
     }
+
+    @Override
+    public SceneRspBean listPanoSceneWithTypes(String token, String id) {
+        SceneRspBean sceneRspBean = new SceneRspBean();
+        sceneRspBean.setCode(-1);
+        return sceneRspBean;
+    }
 }

+ 9 - 0
fcb-project-manager-core/src/main/java/fcb/project/manager/core/feignInterfaces/fallBack/SceneFeignFallBack.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestHeader;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -32,4 +33,12 @@ public class SceneFeignFallBack implements SceneFeign {
         sceneRspBean.setMsg("服务超时");
         return sceneRspBean;
     }
+
+    @Override
+    public SceneRspBean listScenesInNums(@RequestBody List<String> nums, @RequestHeader(name = "token") String token) {
+        SceneRspBean sceneRspBean = new SceneRspBean();
+        sceneRspBean.setCode(-1);
+        sceneRspBean.setMsg("服务超时");
+        return sceneRspBean;
+    }
 }

+ 76 - 0
fcb-project-manager-core/src/main/resources/mybatis/mappers/TmEstateMapper.xml

@@ -2,4 +2,80 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="fcb.project.manager.base.dao.TmEstateDao">
 
+    <select id="listProject" resultType="fcb.project.manager.base.vo.house.HouseVO">
+        <include refid="loadProjects"></include>
+    </select>
+
+    <select id="exportProject" resultType="fcb.project.manager.base.vo.house.HouseVO">
+        <include refid="loadProjects"></include>
+    </select>
+
+
+    <sql id="loadProjects">
+        SELECT
+        estate.id estateId,
+        estate.estate_name estateName,
+        estate.fcb_estate_id fcbEstateId,
+        house.id,
+        house.create_time createTime,
+        house.update_time updateTime,
+        house.`status` auditStatus,
+        house.auditor_name auditorName,
+        house.audit_time auditTime,
+        house.cover_imag_url coverImagUrl,
+        house.create_by_name createByName,
+        house.house_title houseTitle,
+        house.submit_audit_time submitAuditTime,
+        house.vr_link vrLink,
+        house.vr_path vrPath,
+        house.inner_vr_link innerVrLink,
+        house.type
+        FROM
+        tm_estate estate
+        INNER JOIN tm_house house ON house.estate_id = house.id
+        AND house.isDelete = 0
+        AND house.is_show = 1
+        WHERE
+        estate.isDelete = 0
+        <if test="ew.departmentId != null and ew.departmentId != ''">
+            and estate.belong_company_id = #{departmentId}
+        </if>
+        <if test="ew.fcbEstateId != null and ew.fcbEstateId != ''">
+            and estate.fcb_estate_id = #{ew.fcbEstateId}
+        </if>
+        <if test="ew.houseTitle != null and ew.houseTitle != ''">
+            and house.house_title like concat('%', #{ew.houseTitle}, '%')
+        </if>
+        <if test="ew.status != null">
+            and house.status = #{ew.status}
+        </if>
+        <if test="ew.type != null">
+            and house.type = #{ew.type}
+        </if>
+        <if test="ew.createStartTime != null">
+            and house.create_time >= #{ew.createStartTime}
+        </if>
+        <if test="ew.createEndTime != null">
+            and house.create_time &lt;= #{ew.createEndTime}
+        </if>
+        <if test="ew.updateStartTime != null">
+            and house.update_time >= #{ew.updateStartTime}
+        </if>
+        <if test="ew.updateEndTime != null">
+            and house.update_time &lt;= #{ew.updateEndTime}
+        </if>
+        <if test="ew.auditTimeStartTime != null">
+            and house.audit_time >= #{ew.auditTimeStartTime}
+        </if>
+        <if test="ew.auditTimeEndTime != null">
+            and house.audit_time &lt;= #{ew.auditTimeEndTime}
+        </if>
+        <if test="ew.statues != null and ew.statues.size() != 0">
+            and house.status in
+            <foreach collection="ew.statues" item="status" separator="," open="(" close=")">
+                #{status}
+            </foreach>
+        </if>
+        order by estate.create_time desc
+    </sql>
 </mapper>

+ 1 - 1
pom.xml

@@ -60,7 +60,7 @@
         <dependency>
             <groupId>org.4dage</groupId>
             <artifactId>4dage-back-sdk</artifactId>
-            <version>1.0.3.0-RELEASE</version>
+            <version>1.0.3.1-RELEASE</version>
             <exclusions>
                 <exclusion>
                     <groupId>io.lettuce</groupId>