瀏覽代碼

修改配置文件,

zhujinghui 4 年之前
父節點
當前提交
692768f501

+ 33 - 35
fcb-project-manager-core/src/main/java/fcb/project/manager/base/service/impl/TmEstateServiceImpl.java

@@ -21,10 +21,13 @@ 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.BeanUtils;
 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.entity.Result;
+import fdage.back.sdk.base.entity.ViewResult;
 import fdage.back.sdk.base.enums.ResultCodeEnum;
 import fdage.back.sdk.base.exception.CommonBaseException;
 import fdage.back.sdk.base.uuid.SnowFlakeUUidUtils;
@@ -33,7 +36,6 @@ import lombok.extern.log4j.Log4j2;
 import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -105,14 +107,14 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
             item.put(excelUtil.getColeNames().get(index++), house.getGarden() != null ? house.getGarden().toString() : "0");
             item.put(excelUtil.getColeNames().get(index++), house.getSales() != null ? house.getSales().toString() : "0");
             item.put(excelUtil.getColeNames().get(index++), house.getHouse() != null ? house.getHouse().toString() : "0");
-            item.put(excelUtil.getColeNames().get(index++), house.getHouse() != null ? house.getSaleVideos().toString() : "0");
+            item.put(excelUtil.getColeNames().get(index++), house.getSaleVideos() != null ? house.getSaleVideos().toString() : "0");
             item.put(excelUtil.getColeNames().get(index++), house.getHouseVideos() != null ? house.getHouseVideos().toString() : "0");
             item.put(excelUtil.getColeNames().get(index++), house.getPoints() != null ? house.getPoints().toString() : "0");
             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.getStatus()).getDesc());
             item.put(excelUtil.getColeNames().get(index++), house.getAuditorName());
-            item.put(excelUtil.getColeNames().get(index++), house.getAuditTime().format(df));
+            item.put(excelUtil.getColeNames().get(index++), house.getAuditTime() != null ? house.getAuditTime().format(df) : "");
             dataList.add(item);
         }
 
@@ -197,33 +199,27 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
                     List<String> nums = panoSceneWithTypesMap.entrySet().stream().map(e -> e.getKey()).collect(Collectors.toList());
 
                     sceneRspBean = sceneFeign.listScenesInNums(nums, token);
-                    List<SceneProEntity> scenes = (List<SceneProEntity>) sceneRspBean.getData();
+                    List<Map<String, Object>> scenes = (List<Map<String, Object>>) sceneRspBean.getData();
                     log.info("远程调用listScenesInNums接口,入参-{}", nums);
                     log.info("远程调用listScenesInNums接口,返回数据-{}", new Gson().toJson(scenes));
-                    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.Entry<String, Object>> existData = panoSceneWithTypesMap.entrySet().stream().filter(m ->
-                                        "sales".equals(m.getKey()) && scene.getNum().equals(m.getValue().toString())).findAny();
-                                if (existData.isPresent()) {
-                                    salesVideos += jsonArray.size();
-                                }
-                                existData = panoSceneWithTypesMap.entrySet().stream().filter(m ->
-                                        "room".equals(m.getKey()) && scene.getNum().equals(m.getValue().toString())).findAny();
-                                if (existData.isPresent()) {
-                                    houseVideos += jsonArray.size();
-                                }
-
+                    for (Map<String, Object> scene : scenes) {
+                        if (scene.get("videos") != null) {
+                            String videoStr = scene.get("videos").toString();
+                            log.info("videos-{}", videoStr);
+                            Optional<Map.Entry<String, Object>> existData = panoSceneWithTypesMap.entrySet().stream().filter(m ->
+                                    "sales".equals(m.getValue()) && scene.get("num").toString().equals(m.getKey())).findAny();
+                            if (existData.isPresent()) {
+                                salesVideos++;
+                            }
+                            existData = panoSceneWithTypesMap.entrySet().stream().filter(m ->
+                                    "room".equals(m.getValue()) && scene.get("num").toString().equals(m.getKey())).findAny();
+                            if (existData.isPresent()) {
+                                houseVideos++;
                             }
                         }
                     }
+                    log.info("salesVideos-{}", salesVideos);
+                    log.info("houseVideos-{}", houseVideos);
                     houseVOS.get(i).setSaleVideos(salesVideos);
                     houseVOS.get(i).setHouseVideos(houseVideos);
                 }
@@ -232,10 +228,12 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
                 if(allSceneNums != null){
                     param.put("sceneNum", allSceneNums.stream().filter(string ->!string.isEmpty()).collect(Collectors.joining(";")));
                     sceneRspBean = sceneFeign.statisticsPoints(param, token);
-
+                    log.info("远程调用statisticsPoints接口,入参-{}", param);
+                    log.info("远程调用statisticsPoints接口,返回数据-{}", new Gson().toJson(sceneRspBean));
                     if(null == sceneRspBean || sceneRspBean.getCode() != 0){
-                        log.info("调用四维看看获取所有场景点位数失败,场景码是:" + param.get("sceneNum"));
+                        log.info("调用四维看看获取所有场景点位数失败,场景码是:{}" + param.get("sceneNum"));
                     }else {
+                        log.info("points-{}", sceneRspBean.getData());
                         houseVOS.get(i).setPoints(sceneRspBean.getData());
                     }
                 }
@@ -329,17 +327,17 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
     }
 
     @Transactional(rollbackFor = Exception.class)
-    public String delete(String estateId, ContextTokenBean contextTokenBean, String token) {
+    public ViewResult delete(String estateId, ContextTokenBean contextTokenBean, String token) {
         TmEstate dbEstate = getById(estateId);
         if(null == dbEstate){
-            return "楼盘不存在或已被删除";
+            return ViewResult.error("楼盘不存在或已被删除");
         }
 
         LambdaQueryWrapper<TmHouse> qw = new LambdaQueryWrapper();
         qw.eq(TmHouse::getIsDelete, 0).eq(TmHouse::getEstateId, estateId);
         TmHouse dbHouse = tmHouseService.getOne(qw);
         if (dbHouse == null) {
-            return "楼盘项目不存在或已被删除";
+            return ViewResult.error("楼盘项目不存在或已被删除");
         }
 
         deleteEstateById(estateId);
@@ -349,15 +347,15 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
         if(null != dbHouse.getStatus()){
             //除了草稿、未通过状态,其他状态都不能删除
             if(!HouseStatus.canDelete(dbHouse.getStatus())){
-                return "存在待审核/已审核数据,无法删除";
+                return ViewResult.error("存在待审核/已审核数据,无法删除");
             }
         }
 
         if(!isCanDelete(dbHouse, contextTokenBean)){
-            return "暂无删除权限";
+            return ViewResult.error("暂无删除权限");
         }
 
-        int delete = tmHouseService.deleteHouseById(dbHouse.getId());
+        tmHouseService.deleteHouseById(dbHouse.getId());
 
         List<TmHouse> houseList = tmHouseService.getListByEstate(estateId);
         if(!org.apache.commons.collections.CollectionUtils.isEmpty(houseList)){
@@ -366,7 +364,7 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
                     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项目,请解绑后删除";
+                        return ViewResult.error("楼盘下存在未解绑的VR项目,请解绑后删除");
                     }
                 }
             }
@@ -397,7 +395,7 @@ public class TmEstateServiceImpl extends ServiceImpl<TmEstateDao, TmEstate> impl
         //panoService.noticeVrAuditStatus(houseId , getToken() , 3);
 
         panoService.noticeDeleteVr(dbHouse.getId(), token);
-        return "删除房源成功";
+        return ViewResult.success("删除房源成功");
 
     }