Browse Source

更新:
增加前端显示字段

wuweihao 4 năm trước cách đây
mục cha
commit
17303b75cc

+ 14 - 4
cms_pano_fcb/gis_domain/src/main/java/com/gis/domain/dto/SceneInitDto.java

@@ -3,6 +3,8 @@ package com.gis.domain.dto;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import javax.validation.constraints.NotBlank;
+
 /**
  * Created by owen on 2020/5/28 0028 16:36
  */
@@ -12,16 +14,24 @@ public class SceneInitDto {
     @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
     private String id;
 
-    @ApiModelProperty(value = "场景码")
+    @NotBlank(message = "场景码不能为空")
+    @ApiModelProperty(value = "场景码", required = true)
     private String sceneCode;
 
-    @ApiModelProperty(value = "楼盘id")
+    @NotBlank(message = "楼盘id不能为空")
+    @ApiModelProperty(value = "楼盘id", required = true)
     private String houseId;
 
     @ApiModelProperty(value = "缩略图(管理后台用)")
     private String icon;
 
-//    @ApiModelProperty(value = "场景id")
-//    private String sceneId;
+    @ApiModelProperty(value = "类型, 楼盘:building, 园林:garden, 户型:house")
+    private String type;
+
+    @ApiModelProperty(value = "场景名称")
+    private String sceneTitle;
+
+    @ApiModelProperty(value = "场景url")
+    private String webSite;
 
 }

+ 3 - 2
cms_pano_fcb/gis_mapper/src/main/java/com/gis/mapper/SceneInitMapper.java

@@ -24,8 +24,9 @@ public interface SceneInitMapper extends IBaseMapper<SceneInitEntity, String> {
     @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, b.icon as icon, a.scene_code 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 ")
+    @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 " +
+            " 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")
     List<SceneInitDto> voFindByHouseId(String houseId);
 
     @Select("select * from tb_scene_init where is_delete = 0 and house_id = #{houseId} AND scene_code = #{sceneCode}")

+ 7 - 1
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneInitServiceImpl.java

@@ -46,6 +46,12 @@ public class SceneInitServiceImpl extends IBaseServiceImpl<SceneInitEntity, Stri
         SceneInitEntity entity = null;
         String id = param.getId();
         if (id == null) {
+
+            List<SceneInitEntity> initEntityList = this.findByHouseId(param.getHouseId());
+            if (initEntityList.size() > 3) {
+                return Result.failure("初始场景不能大于3个" );
+            }
+
             entity = new SceneInitEntity();
             BeanUtils.copyProperties(param, entity);
             entity.setId(RandomUtils.getUuid("init"));
@@ -53,7 +59,7 @@ public class SceneInitServiceImpl extends IBaseServiceImpl<SceneInitEntity, Stri
         } else {
             entity = this.findById(id);
             if (entity == null) {
-                return Result.failure("对象不存在: {}" +  id);
+                return Result.failure("对象不存在:" +  id);
             }
 
             BeanUtils.copyProperties(param, entity);

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

@@ -44,8 +44,8 @@ public class WebLogAspect {
     @Autowired
     HouseFeign houseFeign;
 
-//    @Pointcut("execution(* com.gis.web.controller.*.*(..))")//切入点描述 这个是controller包的切入点
-    @Pointcut("@annotation(com.gis.web.aop.WebControllerLog)")//切入点描述 这个是controller包的切入点
+    @Pointcut("execution(* com.gis.web.controller.*.*(..))")//切入点描述 这个是controller包的切入点
+//    @Pointcut("@annotation(com.gis.web.aop.WebControllerLog)")//切入点描述 这个是controller包的切入点
     public void controllerLog(){}//签名,可以理解成这个切入点的一个名称
 
     @Before("controllerLog()") //在切入点的方法run之前要干的

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

@@ -16,6 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.validation.Valid;
+import java.util.Date;
 import java.util.List;
 
 
@@ -34,7 +36,7 @@ public class SceneInitController extends BaseController {
 
     @ApiOperation(value = "保存")
     @PostMapping("save")
-    public Result save(@RequestBody SceneInitDto param) {
+    public Result save(@Valid @RequestBody SceneInitDto param) {
         return sceneInitService.saveEntity(param);
     }
 
@@ -53,4 +55,18 @@ public class SceneInitController extends BaseController {
         return sceneInitService.uploadFixedName(file, sceneCode);
     }
 
+
+    @ApiOperation(value = "删除")
+    @GetMapping("remove/{id}")
+    public Result remove(@PathVariable String id) {
+        SceneInitEntity entity = sceneInitService.findById(id);
+        if (entity == null){
+            return Result.failure("对象不存在: " + id);
+        }
+        entity.setIsDelete(1);
+        entity.setUpdateTime(new Date());
+        sceneInitService.update(entity);
+        return Result.success();
+    }
+
 }

+ 2 - 2
cms_pano_fcb/remark.md

@@ -167,9 +167,9 @@ sit:
     6. 先保存VR项目,才能添加场景
     7. 
 
-# uat 更新日志
+# sit 更新日志
     20210322
-        新增:初始画面-上传接口,作用封面图统一
+        新增:初始画面-上传接口,作用封面图统一 全景图缩略图统一命名规则: http:// oss/cms_pano_fcb/image/thumb_sceneCode.jpg
         新增:初始场景管理模块,提供管理后台初始场景列表  (新的是三个初始场景,是否需要兼容旧数据??)