Kaynağa Gözat

作品改用uuid 2

wuweihao 3 yıl önce
ebeveyn
işleme
ac6b5341a3
17 değiştirilmiş dosya ile 436 ekleme ve 444 silme
  1. 1 1
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/SomeDataDto.java
  2. 3 3
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/CatalogMapper.java
  3. 3 3
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/SceneMapper.java
  4. 3 3
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/WorkMapper.java
  5. 40 40
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/CatalogService.java
  6. 1 1
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/FodderService.java
  7. 54 0
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/IBaseStrService.java
  8. 5 8
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/SceneService.java
  9. 6 6
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/WorkService.java
  10. 193 193
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/CatalogServiceImpl.java
  11. 1 1
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/FodderServiceImpl.java
  12. 2 1
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/IBaseStrServiceImpl.java
  13. 55 102
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/SceneServiceImpl.java
  14. 58 64
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/WorkServiceImpl.java
  15. 1 1
      720yun_fd_manage/gis_web/src/main/java/com/gis/web/controller/FodderController.java
  16. 2 8
      720yun_fd_manage/gis_web/src/main/java/com/gis/web/controller/WebController.java
  17. 8 9
      720yun_fd_manage/gis_web/src/main/java/com/gis/web/controller/WorkController.java

+ 1 - 1
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/SomeDataDto.java

@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank;
 public class SomeDataDto {
 
     @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
-    private Long id;
+    private String id;
 
 
     @NotBlank(message = "someData不能为空")

+ 3 - 3
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/CatalogMapper.java

@@ -19,17 +19,17 @@ public interface CatalogMapper extends IBaseMapper<CatalogEntity, Long> {
 
 
     @Select("select * from tb_catalog where is_delete = 0 and work_id = #{workId}")
-    List<CatalogEntity> findByWorkId(Long workId);
+    List<CatalogEntity> findByWorkId(String workId);
 
     @Select("select a.id,a.parent_id,a.name,a.work_id,a.is_delete,b.id as scene_id ,b.scene_code, b.scene_title,b.catalog_id" +
             " from tb_catalog a LEFT JOIN tb_scene b on a.id = b.catalog_id and b.is_delete='0' WHERE a.is_delete = '0' and a.work_id = #{workId}")
-    List<CatalogSceneTree> afindByWorkId(Long workId);
+    List<CatalogSceneTree> afindByWorkId(String workId);
 
     @Select("select * from tb_catalog where is_delete = 0 and parent_id = #{id}")
     List<CatalogEntity> findByParentId(Long id);
 
     @Update("UPDATE tb_catalog SET is_delete = 1 where is_delete = 0 and work_id = #{workId}")
-    void setDeleteByWorkId(Long workId);
+    void setDeleteByWorkId(String workId);
 
     @Select("select a.id as catalogId, a.name as catalogName, b.id as parentId, b.name as parentName from tb_catalog a left join  tb_catalog b on a.parent_id = b.id where a.is_delete = 0 and a.id = #{catalogId}")
     CatalogVo voFindById(Long catalogId);

+ 3 - 3
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/SceneMapper.java

@@ -39,10 +39,10 @@ public interface SceneMapper extends IBaseMapper<SceneEntity, Long> {
 
 
     @Select("select * from tb_scene where is_delete = 0 and work_id = #{workId}")
-    List<SceneEntity> findByWorkId(Long workId);
+    List<SceneEntity> findByWorkId(String workId);
 
     @Select("select scene_code from tb_scene where is_delete = 0 and work_id = #{workId} AND type = #{type}")
-    List<String> strFindByWorkId(Long workId, String type);
+    List<String> strFindByWorkId(String workId, String type);
 
     @Update("UPDATE tb_scene SET catalog_id = #{newCatalogId} where is_delete = 0 and catalog_id = #{oldCatalogId}")
     void setCatalogByCatalogId(Long newCatalogId, Long oldCatalogId);
@@ -51,7 +51,7 @@ public interface SceneMapper extends IBaseMapper<SceneEntity, Long> {
     void setDeleteByCatalogId(Long id);
 
     @Update("UPDATE tb_scene SET is_delete = 1 where is_delete = 0 and work_id = #{workId}")
-    void setDeleteByWorkId(Long workId);
+    void setDeleteByWorkId(String workId);
 
     @Select("select a.*, b.id as catalogId, b.name as catalogName, c.id as parentId, c.name as parentName " +
             "from tb_scene a left join tb_catalog b on b.id = a.catalog_id left join tb_catalog c on c.id = b.parent_id " +

+ 3 - 3
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/WorkMapper.java

@@ -12,7 +12,7 @@ import java.util.List;
 
 @Component
 @Mapper
-public interface WorkMapper extends IBaseStrMapper<WorkEntity, Long> {
+public interface WorkMapper extends IBaseStrMapper<WorkEntity, String> {
 
 
 
@@ -20,7 +20,7 @@ public interface WorkMapper extends IBaseStrMapper<WorkEntity, Long> {
     List<WorkEntity> search(PageDto param, String userId);
 
     @Update("UPDATE tb_work SET visit= visit + 1 where id = #{id}")
-    void addVisit(Long id);
+    void addVisit(String id);
 
     @Select("select id, name, scene_codes from tb_work where is_delete = 0 and user_id = #{userId} and scene_codes like #{sceneCode}")
     List<WorkEntity> likeSceneCode(String sceneCode, String userId);
@@ -33,7 +33,7 @@ public interface WorkMapper extends IBaseStrMapper<WorkEntity, Long> {
      * @return
      */
     @Select("select id, name, scene_codes, user_id from tb_work where is_delete = 0 and id = #{id} for update")
-    WorkEntity findByIdForUpdate(Long id);
+    WorkEntity findByIdForUpdate(String id);
 
 
     /***

+ 40 - 40
720yun_fd_manage/gis_service/src/main/java/com/gis/service/CatalogService.java

@@ -1,40 +1,40 @@
-package com.gis.service;
-
-
-import com.gis.common.util.Result;
-import com.gis.domain.dto.BaseDto;
-import com.gis.domain.dto.CatalogDto;
-import com.gis.domain.entity.CatalogEntity;
-import com.gis.domain.entity.FodderEntity;
-import com.gis.domain.vo.CatalogVo;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.List;
-
-
-/**
- * Created by owen on 2020/3/11 0011 16:14
- */
-public interface CatalogService extends IBaseService<CatalogEntity, Long> {
-
-
-    Result saveEntity(CatalogDto param);
-
-    Result listTree(Long workId);
-
-    Result webListTree(Long workId);
-
-    Result remove(Long id);
-
-    Result getCatalog(Long workId);
-
-    Result getScene(Long catalogId);
-
-    CatalogVo voFindById(Long catalogId);
-
-    List<CatalogEntity> findByParentId(Long parentId);
-
-    Result editEntity(BaseDto param);
-
-    List<CatalogEntity> findByWorkId(Long id);
-}
+//package com.gis.service;
+//
+//
+//import com.gis.common.util.Result;
+//import com.gis.domain.dto.BaseDto;
+//import com.gis.domain.dto.CatalogDto;
+//import com.gis.domain.entity.CatalogEntity;
+//import com.gis.domain.entity.FodderEntity;
+//import com.gis.domain.vo.CatalogVo;
+//import org.springframework.web.multipart.MultipartFile;
+//
+//import java.util.List;
+//
+//
+///**
+// * Created by owen on 2020/3/11 0011 16:14
+// */
+//public interface CatalogService extends IBaseService<CatalogEntity, Long> {
+//
+//
+//    Result saveEntity(CatalogDto param);
+//
+//    Result listTree(String workId);
+//
+//    Result webListTree(String workId);
+//
+//    Result remove(Long id);
+//
+//    Result getCatalog(String workId);
+//
+//    Result getScene(Long catalogId);
+//
+//    CatalogVo voFindById(Long catalogId);
+//
+//    List<CatalogEntity> findByParentId(Long parentId);
+//
+//    Result editEntity(BaseDto param);
+//
+//    List<CatalogEntity> findByWorkId(Long id);
+//}

+ 1 - 1
720yun_fd_manage/gis_service/src/main/java/com/gis/service/FodderService.java

@@ -21,7 +21,7 @@ public interface FodderService extends IBaseService<FodderEntity, Long> {
 
     Result search(FodderPageDto param);
 
-    Result selectFodderPano(PageDto param, Long workId);
+    Result selectFodderPano(PageDto param, String workId);
 
 
 

+ 54 - 0
720yun_fd_manage/gis_service/src/main/java/com/gis/service/IBaseStrService.java

@@ -0,0 +1,54 @@
+package com.gis.service;
+
+import com.gis.domain.dto.PageDto;
+import com.github.pagehelper.PageInfo;
+import tk.mybatis.mapper.entity.Condition;
+
+import java.io.Serializable;
+import java.util.List;
+
+public interface IBaseStrService<T, ID extends Serializable> {
+
+    public abstract T findById(ID id);
+
+    public abstract T findOne(T entity);
+
+    public abstract List<T> findByIds(String ids);
+
+    public abstract long count();
+
+    public abstract boolean exists(ID id);
+
+    public abstract int save(T entity);
+
+    public abstract int update(T entity);
+
+    public abstract int updateAll(T entity);
+
+    public abstract int deleteById(ID id);
+
+    public abstract int deleteByIds(String ids);
+
+    public abstract int delete(T entity);
+
+    public abstract List<T> findAll(Condition condition, String orderBy);
+
+    public abstract List<T> findAll(Condition condition);
+
+    public abstract List<T> findAll();
+
+    public abstract PageInfo<T> findAll(int pageNum, int pageSize);
+
+    public abstract PageInfo<T> findAll(int pageNum, int pageSize, String orderBy);
+
+    public abstract PageInfo<T> findAll(Condition condition, int pageNum, int pageSize);
+
+    public abstract PageInfo<T> findAll(Condition condition, int pageNum, int pageSize, String orderBy);
+
+    public abstract void startPage(PageDto param);
+
+    public abstract String getUserNameForToken();
+
+
+
+}

+ 5 - 8
720yun_fd_manage/gis_service/src/main/java/com/gis/service/SceneService.java

@@ -26,32 +26,29 @@ public interface SceneService extends IBaseService<SceneEntity, Long> {
 
     Result editSomeData(EditSomeDataDto param);
 
-//    Result setIndex(String id, Long workId);
-//
-//    Result getIndex(Long workId);
+
 
     Result setSort(Map<String, String> param);
 
 
     List<SceneEntity> findByCatalogId(Long catalogId);
 
-    Result select4dkk(PageDto param, Long workId);
+    Result select4dkk(PageDto param, String workId);
 
 
 
 
     SceneEntity findByIdForUpdate(Long id);
 
-    Result saves(CatalogSceneDto param);
 
 
-    List<String> strFindByWorkId(Long workId, String type);
+
+    List<String> strFindByWorkId(String workId, String type);
 
     Result saveUseHots(UseHotsDto param);
 
-    List<SceneEntity> findByWorkId(Long workId);
+    List<SceneEntity> findByWorkId(String workId);
 
-//    Result getVoIndex(Long workId);
 
     Result editEntity(BaseDto param);
 }

+ 6 - 6
720yun_fd_manage/gis_service/src/main/java/com/gis/service/WorkService.java

@@ -16,7 +16,7 @@ import java.util.List;
 /**
  * Created by owen on 2020/3/11 0011 16:14
  */
-public interface WorkService extends IBaseService<WorkEntity, Long> {
+public interface WorkService extends IBaseService<WorkEntity, String> {
 
 
     Result search(PageDto param);
@@ -25,22 +25,22 @@ public interface WorkService extends IBaseService<WorkEntity, Long> {
 
     Result<WorkEntity> entityAdd();
 
-    Result remove(Long id);
+    Result remove(String id);
 
-    void addVisit(Long id);
+    void addVisit(String id);
 
-    Result<WorkInfoVo> getDetail(Long id);
+//    Result<WorkInfoVo> getDetail(String id);
 
     Result edit(SomeDataDto param);
 
-    Result select4dkk(PageDto param, Long workId);
+    Result select4dkk(PageDto param, String workId);
 
     Result editUpload(MultipartFile file);
 
 
     List<WorkEntity> likeSceneCode(String sceneCode);
 
-    WorkEntity findByIdForUpdate(Long id);
+    WorkEntity findByIdForUpdate(String id);
 
 
 }

+ 193 - 193
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/CatalogServiceImpl.java

@@ -1,193 +1,193 @@
-package com.gis.service.impl;
-
-import com.gis.common.constant.MsgCode;
-import com.gis.common.util.Result;
-import com.gis.domain.dto.BaseDto;
-import com.gis.domain.dto.CatalogDto;
-import com.gis.domain.entity.CatalogEntity;
-import com.gis.domain.entity.SceneEntity;
-import com.gis.domain.tree.CatalogTree;
-import com.gis.domain.vo.CatalogSceneTree;
-import com.gis.domain.vo.CatalogVo;
-import com.gis.mapper.CatalogMapper;
-import com.gis.mapper.IBaseMapper;
-import com.gis.mapper.SceneMapper;
-import com.gis.service.CatalogService;
-import com.gis.service.SceneService;
-import com.gis.tree.CatalogTreeUtil;
-import com.gis.tree.SceneTreeUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import javax.transaction.Transactional;
-import java.util.Date;
-import java.util.List;
-
-
-/**
- * Created by owen on 2020/3/11 0011 16:16
- */
-@Slf4j
-@Service
-@Transactional
-public class CatalogServiceImpl extends IBaseServiceImpl<CatalogEntity, Long> implements CatalogService {
-
-    @Autowired
-    private CatalogMapper entityMapper;
-
-    @Autowired
-    private SceneMapper sceneMapper;
-
-    @Autowired
-    SceneService sceneService;
-
-
-
-
-
-    @Override
-    public IBaseMapper<CatalogEntity, Long> getBaseMapper() {
-        return this.entityMapper;
-    }
-
-
-    @Override
-    public Result saveEntity(CatalogDto param) {
-        Long id = param.getId();
-        CatalogEntity entity = null;
-        if (id == null) {
-            entity = new CatalogEntity();
-            BeanUtils.copyProperties(param, entity);
-            save(entity);
-
-            // 若场景二级分组,把父分组场景移动到二级分组
-            Long oldCatalogId = entity.getParentId();
-            if (oldCatalogId != null) {
-                sceneMapper.setCatalogByCatalogId(entity.getId(), oldCatalogId);
-            }
-
-
-        } else {
-            entity = findById(id);
-            if (entity == null) {
-                log.error("对象不存在: " + id);
-                Result.failure("对象不存在");
-            }
-
-            BeanUtils.copyProperties(param, entity);
-            entity.setUpdateTime(new Date());
-            update(entity);
-
-        }
-        return Result.success();
-    }
-
-
-    @Override
-    public Result getCatalog(Long workId) {
-        List<CatalogEntity> list = entityMapper.findByWorkId(workId);
-        CatalogTreeUtil treeUtil = new CatalogTreeUtil(list);
-        List<CatalogTree> catalogTrees = treeUtil.buildTree();
-        return Result.success(treeUtil.buildTree());
-    }
-
-    @Override
-    public Result getScene(Long catalogId) {
-        return Result.success(sceneService.findByCatalogId(catalogId));
-    }
-
-    @Override
-    public CatalogVo voFindById(Long catalogId) {
-        return entityMapper.voFindById(catalogId);
-    }
-
-    @Override
-    public List<CatalogEntity> findByParentId(Long parentId) {
-        return entityMapper.findByParentId(parentId);
-    }
-
-    @Override
-    public Result editEntity(BaseDto param) {
-         Long id = param.getId();
-        CatalogEntity entity = findById(id);
-        if (entity == null) {
-            log.error("对象不存在: " + id);
-            Result.failure("对象不存在");
-        }
-
-        BeanUtils.copyProperties(param, entity);
-        entity.setUpdateTime(new Date());
-        update(entity);
-        return Result.success();
-    }
-
-    @Override
-    public List<CatalogEntity> findByWorkId(Long id) {
-
-        return entityMapper.findByWorkId(id);
-    }
-
-    @Override
-    public Result listTree(Long workId) {
-        List<CatalogEntity> list = entityMapper.findByWorkId(workId);
-        CatalogTreeUtil treeUtil = new CatalogTreeUtil(list, sceneMapper);
-        return Result.success(treeUtil.buildTree());
-    }
-
-    @Override
-    public Result webListTree(Long workId) {
-        List<CatalogSceneTree> list = entityMapper.afindByWorkId(workId);
-
-        SceneTreeUtil sceneTreeUtil = new SceneTreeUtil(list);
-        return Result.success(sceneTreeUtil.buildTree());
-    }
-
-    @Override
-    public Result remove(Long id) {
-
-        CatalogEntity entity = this.findById(id);
-        if (entity == null) {
-            return Result.success();
-        }
-
-        List<SceneEntity> workScenes = sceneService.findByWorkId(entity.getWorkId());
-        List<SceneEntity> catalogScenes = sceneService.findByCatalogId(id);
-        if ((workScenes.size()-catalogScenes.size()) <= 0) {
-            return Result.failure(MsgCode.e3002,"请至少保留一个场景");
-        }
-
-        // 递归删除
-        this.delete(id);
-
-        return Result.success();
-    }
-
-
-
-    private void delete(Long id){
-        CatalogEntity entity = this.findById(id);
-        if (entity == null) {
-            return;
-        }
-
-        entity.setIsDelete(1);
-        entity.setUpdateTime(new Date());
-        this.update(entity);
-
-        // 删除分组,需要把对应的场景删除
-        sceneMapper.setDeleteByCatalogId(id);
-
-        List<CatalogEntity> parentList = entityMapper.findByParentId(id);
-        if (parentList.size() > 0) {
-            for (CatalogEntity catalogEntity : parentList) {
-                // 递归删除
-                delete(catalogEntity.getId());
-            }
-        }
-    }
-
-
-
-}
+//package com.gis.service.impl;
+//
+//import com.gis.common.constant.MsgCode;
+//import com.gis.common.util.Result;
+//import com.gis.domain.dto.BaseDto;
+//import com.gis.domain.dto.CatalogDto;
+//import com.gis.domain.entity.CatalogEntity;
+//import com.gis.domain.entity.SceneEntity;
+//import com.gis.domain.tree.CatalogTree;
+//import com.gis.domain.vo.CatalogSceneTree;
+//import com.gis.domain.vo.CatalogVo;
+//import com.gis.mapper.CatalogMapper;
+//import com.gis.mapper.IBaseMapper;
+//import com.gis.mapper.SceneMapper;
+//import com.gis.service.CatalogService;
+//import com.gis.service.SceneService;
+//import com.gis.tree.CatalogTreeUtil;
+//import com.gis.tree.SceneTreeUtil;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.beans.BeanUtils;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//
+//import javax.transaction.Transactional;
+//import java.util.Date;
+//import java.util.List;
+//
+//
+///**
+// * Created by owen on 2020/3/11 0011 16:16
+// */
+//@Slf4j
+//@Service
+//@Transactional
+//public class CatalogServiceImpl extends IBaseServiceImpl<CatalogEntity, Long> implements CatalogService {
+//
+//    @Autowired
+//    private CatalogMapper entityMapper;
+//
+//    @Autowired
+//    private SceneMapper sceneMapper;
+//
+//    @Autowired
+//    SceneService sceneService;
+//
+//
+//
+//
+//
+//    @Override
+//    public IBaseMapper<CatalogEntity, Long> getBaseMapper() {
+//        return this.entityMapper;
+//    }
+//
+//
+//    @Override
+//    public Result saveEntity(CatalogDto param) {
+//        Long id = param.getId();
+//        CatalogEntity entity = null;
+//        if (id == null) {
+//            entity = new CatalogEntity();
+//            BeanUtils.copyProperties(param, entity);
+//            save(entity);
+//
+//            // 若场景二级分组,把父分组场景移动到二级分组
+//            Long oldCatalogId = entity.getParentId();
+//            if (oldCatalogId != null) {
+//                sceneMapper.setCatalogByCatalogId(entity.getId(), oldCatalogId);
+//            }
+//
+//
+//        } else {
+//            entity = findById(id);
+//            if (entity == null) {
+//                log.error("对象不存在: " + id);
+//                Result.failure("对象不存在");
+//            }
+//
+//            BeanUtils.copyProperties(param, entity);
+//            entity.setUpdateTime(new Date());
+//            update(entity);
+//
+//        }
+//        return Result.success();
+//    }
+//
+//
+//    @Override
+//    public Result getCatalog(String workId) {
+//        List<CatalogEntity> list = entityMapper.findByWorkId(workId);
+//        CatalogTreeUtil treeUtil = new CatalogTreeUtil(list);
+//        List<CatalogTree> catalogTrees = treeUtil.buildTree();
+//        return Result.success(treeUtil.buildTree());
+//    }
+//
+//    @Override
+//    public Result getScene(Long catalogId) {
+//        return Result.success(sceneService.findByCatalogId(catalogId));
+//    }
+//
+//    @Override
+//    public CatalogVo voFindById(Long catalogId) {
+//        return entityMapper.voFindById(catalogId);
+//    }
+//
+//    @Override
+//    public List<CatalogEntity> findByParentId(Long parentId) {
+//        return entityMapper.findByParentId(parentId);
+//    }
+//
+//    @Override
+//    public Result editEntity(BaseDto param) {
+//         Long id = param.getId();
+//        CatalogEntity entity = findById(id);
+//        if (entity == null) {
+//            log.error("对象不存在: " + id);
+//            Result.failure("对象不存在");
+//        }
+//
+//        BeanUtils.copyProperties(param, entity);
+//        entity.setUpdateTime(new Date());
+//        update(entity);
+//        return Result.success();
+//    }
+//
+//    @Override
+//    public List<CatalogEntity> findByWorkId(String id) {
+//
+//        return entityMapper.findByWorkId(id);
+//    }
+//
+//    @Override
+//    public Result listTree(String workId) {
+//        List<CatalogEntity> list = entityMapper.findByWorkId(workId);
+//        CatalogTreeUtil treeUtil = new CatalogTreeUtil(list, sceneMapper);
+//        return Result.success(treeUtil.buildTree());
+//    }
+//
+//    @Override
+//    public Result webListTree(String workId) {
+//        List<CatalogSceneTree> list = entityMapper.afindByWorkId(workId);
+//
+//        SceneTreeUtil sceneTreeUtil = new SceneTreeUtil(list);
+//        return Result.success(sceneTreeUtil.buildTree());
+//    }
+//
+//    @Override
+//    public Result remove(Long id) {
+//
+//        CatalogEntity entity = this.findById(id);
+//        if (entity == null) {
+//            return Result.success();
+//        }
+//
+//        List<SceneEntity> workScenes = sceneService.findByWorkId(entity.getWorkId());
+//        List<SceneEntity> catalogScenes = sceneService.findByCatalogId(id);
+//        if ((workScenes.size()-catalogScenes.size()) <= 0) {
+//            return Result.failure(MsgCode.e3002,"请至少保留一个场景");
+//        }
+//
+//        // 递归删除
+//        this.delete(id);
+//
+//        return Result.success();
+//    }
+//
+//
+//
+//    private void delete(Long id){
+//        CatalogEntity entity = this.findById(id);
+//        if (entity == null) {
+//            return;
+//        }
+//
+//        entity.setIsDelete(1);
+//        entity.setUpdateTime(new Date());
+//        this.update(entity);
+//
+//        // 删除分组,需要把对应的场景删除
+//        sceneMapper.setDeleteByCatalogId(id);
+//
+//        List<CatalogEntity> parentList = entityMapper.findByParentId(id);
+//        if (parentList.size() > 0) {
+//            for (CatalogEntity catalogEntity : parentList) {
+//                // 递归删除
+//                delete(catalogEntity.getId());
+//            }
+//        }
+//    }
+//
+//
+//
+//}

+ 1 - 1
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/FodderServiceImpl.java

@@ -389,7 +389,7 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
 
 
     @Override
-    public Result selectFodderPano(PageDto param, Long workId) {
+    public Result selectFodderPano(PageDto param, String workId) {
         startPage(param);
 
         List<FodderEntity> list = entityMapper.searchPano(param, getUserNameForToken());

+ 2 - 1
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/IBaseStrServiceImpl.java

@@ -8,6 +8,7 @@ import com.gis.domain.entity.BaseStrEntity;
 import com.gis.mapper.IBaseMapper;
 import com.gis.mapper.IBaseStrMapper;
 import com.gis.service.IBaseService;
+import com.gis.service.IBaseStrService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,7 +26,7 @@ import java.util.List;
  * Created by owen on 2020/2/18 0018 11:22
  */
 @Transactional
-public abstract class IBaseStrServiceImpl<T extends BaseStrEntity, ID extends Serializable> implements IBaseService<T, ID> {
+public abstract class IBaseStrServiceImpl<T extends BaseStrEntity, ID extends Serializable> implements IBaseStrService<T, ID> {
 
     @Autowired
     public ConfigConstant configConstant;

+ 55 - 102
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/SceneServiceImpl.java

@@ -1,27 +1,20 @@
 package com.gis.service.impl;
 
-import cn.hutool.core.io.FileUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.gis.common.constant.ConfigConstant;
 import com.gis.common.util.*;
 import com.gis.domain.dto.*;
 import com.gis.domain.entity.CatalogEntity;
-import com.gis.domain.entity.FodderEntity;
 import com.gis.domain.entity.SceneEntity;
-import com.gis.domain.entity.WorkEntity;
 import com.gis.domain.tree.CatalogTree;
-import com.gis.domain.vo.CatalogSceneVo;
-import com.gis.domain.vo.CatalogVo;
 import com.gis.domain.vo.ProSceneVo;
-import com.gis.mapper.CatalogMapper;
 import com.gis.mapper.IBaseMapper;
 import com.gis.mapper.SceneMapper;
-import com.gis.service.CatalogService;
+//import com.gis.service.CatalogService;
 import com.gis.service.SceneService;
 import com.gis.service.WorkService;
 import com.gis.tree.CatalogTreeUtil;
-import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.http.HttpResponse;
@@ -32,9 +25,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.transaction.Transactional;
-import javax.validation.constraints.NotNull;
-import java.io.*;
 import java.util.*;
 
 
@@ -52,8 +42,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
     @Autowired
     WorkService workService;
 
-    @Autowired
-    CatalogService catalogService;
+//    @Autowired
+//    CatalogService catalogService;
 
     @Autowired
     ConfigConstant configConstant;
@@ -72,7 +62,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
     }
 
     @Override
-    public Result select4dkk(PageDto param, Long workId) {
+    public Result select4dkk(PageDto param, String workId) {
         startPage(param);
 
 //        String url = "https://test.4dkankan.com/api/user/scene/list";
@@ -150,71 +140,34 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
     }
 
 
-    @Override
-    public Result saves(CatalogSceneDto params) {
-        SceneEntity entity = null;
-        Long catalogId = params.getCatalogId();
-        Long workId = params.getWorkId();
-//        Long parentId = params.getParentId();
-        // 创建分组
-        CatalogEntity catalogEntity = null;
-        if (catalogId == null) {
-            catalogEntity = createCatalog(params);
-            catalogId = catalogEntity.getId();
-        } else {
-            catalogEntity = catalogService.findById(catalogId);
-        }
-
-        List<SceneDto> scenes = params.getScenes();
 
-        for (SceneDto sceneDto : scenes) {
-            Long id = sceneDto.getId();
-            if (id == null) {
-                entity = new SceneEntity();
-                BeanUtils.copyProperties(sceneDto, entity);
-                entity.setCatalogId(catalogId);
-                entity.setWorkId(workId);
-
-                this.save(entity);
-            } else {
-                entity = findById(id);
-                BeanUtils.copyProperties(sceneDto, entity);
-                entity.setUpdateTime(new Date());
-                this.update(entity);
-
-            }
-        }
-        List<CatalogTree> trees = getTreeByParentId(catalogEntity);
-
-        return Result.success(trees);
-    }
 
     /***
      * 根据父节点查询子节点
      */
-    private List<CatalogTree> getTreeByParentId(CatalogEntity catalogEntity){
-        Long parentId = catalogEntity.getParentId();
-
-        List<CatalogTree> resultTree = new ArrayList<>();
-        // 根据父节点查询子节点
-        if (parentId != null) {
-            // 查找子节点
-            List<CatalogEntity> parents = catalogService.findByParentId(parentId);
-            // 查找父节点
-            CatalogEntity parentCatalog = catalogService.findById(parentId);
-
-            parents.add(parentCatalog);
-            CatalogTreeUtil tree = new CatalogTreeUtil(parents);
-            resultTree = tree.buildTree();
-        } else {
-            // 只有父节点
-            CatalogTree catalogTree = new CatalogTree();
-            catalogTree.setId(catalogEntity.getId());
-            catalogTree.setName(catalogEntity.getName());
-            resultTree.add(catalogTree);
-        }
-        return resultTree;
-    }
+//    private List<CatalogTree> getTreeByParentId(CatalogEntity catalogEntity){
+//        Long parentId = catalogEntity.getParentId();
+//
+//        List<CatalogTree> resultTree = new ArrayList<>();
+//        // 根据父节点查询子节点
+//        if (parentId != null) {
+//            // 查找子节点
+//            List<CatalogEntity> parents = catalogService.findByParentId(parentId);
+//            // 查找父节点
+//            CatalogEntity parentCatalog = catalogService.findById(parentId);
+//
+//            parents.add(parentCatalog);
+//            CatalogTreeUtil tree = new CatalogTreeUtil(parents);
+//            resultTree = tree.buildTree();
+//        } else {
+//            // 只有父节点
+//            CatalogTree catalogTree = new CatalogTree();
+//            catalogTree.setId(catalogEntity.getId());
+//            catalogTree.setName(catalogEntity.getName());
+//            resultTree.add(catalogTree);
+//        }
+//        return resultTree;
+//    }
 
 
 
@@ -225,38 +178,38 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
      * @return
      */
 
-    private CatalogEntity createCatalog(CatalogSceneDto params) {
-        Long parentId = params.getParentId();
-        String parentName = params.getParentName();
-        Long workId = params.getWorkId();
-
-        CatalogEntity entity = new CatalogEntity();
-        entity.setName(params.getCatalogName());
-        entity.setWorkId(workId);
-        // 当父id不为空时
-        if (parentId != null) {
-            entity.setParentId(parentId);
-        }
-
-        // 创建父目录
-        if (parentId == null && parentName != null) {
-            CatalogEntity parentEntity = new CatalogEntity();
-            parentEntity.setWorkId(workId);
-            parentEntity.setName(parentName);
-            catalogService.save(parentEntity);
-            entity.setParentId(parentEntity.getId());
-
-        }
-        // 创建目录
-        catalogService.save(entity);
-        return entity;
-    }
+//    private CatalogEntity createCatalog(CatalogSceneDto params) {
+//        Long parentId = params.getParentId();
+//        String parentName = params.getParentName();
+//        Long workId = params.getWorkId();
+//
+//        CatalogEntity entity = new CatalogEntity();
+//        entity.setName(params.getCatalogName());
+//        entity.setWorkId(workId);
+//        // 当父id不为空时
+//        if (parentId != null) {
+//            entity.setParentId(parentId);
+//        }
+//
+//        // 创建父目录
+//        if (parentId == null && parentName != null) {
+//            CatalogEntity parentEntity = new CatalogEntity();
+//            parentEntity.setWorkId(workId);
+//            parentEntity.setName(parentName);
+//            catalogService.save(parentEntity);
+//            entity.setParentId(parentEntity.getId());
+//
+//        }
+//        // 创建目录
+//        catalogService.save(entity);
+//        return entity;
+//    }
 
 
 
 
     @Override
-    public List<String> strFindByWorkId(Long workId, String type) {
+    public List<String> strFindByWorkId(String workId, String type) {
         return entityMapper.strFindByWorkId(workId, type);
     }
 
@@ -392,7 +345,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
     }
 
     @Override
-    public List<SceneEntity> findByWorkId(Long workId) {
+    public List<SceneEntity> findByWorkId(String workId) {
         return entityMapper.findByWorkId(workId);
     }
 

+ 58 - 64
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/WorkServiceImpl.java

@@ -11,16 +11,10 @@ import com.gis.common.util.*;
 import com.gis.domain.dto.PageDto;
 import com.gis.domain.dto.SomeDataDto;
 import com.gis.domain.dto.WorkDto;
-import com.gis.domain.entity.CatalogEntity;
-import com.gis.domain.entity.SceneEntity;
 import com.gis.domain.entity.WorkEntity;
-import com.gis.domain.tree.CatalogTree;
-import com.gis.domain.vo.WorkInfoVo;
 import com.gis.mapper.*;
-import com.gis.service.CatalogService;
 import com.gis.service.SceneService;
 import com.gis.service.WorkService;
-import com.gis.tree.CatalogTreeUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
@@ -51,7 +45,7 @@ import java.util.stream.Stream;
 @Slf4j
 @Service
 //@Transactional
-public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, Long> implements WorkService {
+public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, String> implements WorkService {
 
     @Autowired
     private WorkMapper entityMapper;
@@ -66,8 +60,8 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, Long> imple
     @Autowired
     private CatalogMapper catalogMapper;
 
-    @Autowired
-    CatalogService catalogService;
+//    @Autowired
+//    CatalogService catalogService;
 
     @Autowired
     SceneMapper sceneMapper;
@@ -88,7 +82,7 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, Long> imple
 
 
     @Override
-    public IBaseStrMapper<WorkEntity, Long> getBaseMapper() {
+    public IBaseStrMapper<WorkEntity, String> getBaseMapper() {
         return this.entityMapper;
     }
 
@@ -205,7 +199,7 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, Long> imple
 
 
     @Override
-    public Result remove(Long id) {
+    public Result remove(String id) {
         WorkEntity entity = this.findById(id);
         if (entity == null) {
             return Result.success();
@@ -229,61 +223,61 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, Long> imple
     }
 
     @Override
-    public void addVisit(Long id) {
+    public void addVisit(String id) {
         entityMapper.addVisit(id);
     }
 
-    @Override
-    public Result<WorkInfoVo> getDetail(Long id) {
-        WorkEntity entity = this.findById(id);
-        if (entity == null) {
-            return Result.failure("对象不存在");
-        }
-        WorkInfoVo workInfoVo = new WorkInfoVo();
-        BeanUtils.copyProperties(entity, workInfoVo);
-
-        // 获取分组信息
-        List<CatalogEntity> list = catalogService.findByWorkId(id);
-
-        // 处理第二级
-        Stream<CatalogEntity> stream2 = list.stream();
-        Stream<CatalogEntity> sub = stream2.filter(s -> s.getParentId() != null);
-        List<CatalogEntity> catalogs = sub.collect(Collectors.toList());
-        workInfoVo.setCatalogs(catalogs);
-
-
-        // 处理第一级
-        CatalogTreeUtil treeUtil = new CatalogTreeUtil(list);
-        List<CatalogTree> trees = treeUtil.buildTree();
-
-        List<CatalogEntity> c1 = new ArrayList<>();
-        for (CatalogTree tree : trees) {
-            CatalogEntity catalogEntity = new CatalogEntity();
-            BeanUtils.copyProperties(tree, catalogEntity);
-            // 有子结节
-            List<CatalogTree> children = tree.getChildren();
-
-            // 子节点
-            List<Long> child = new ArrayList<>();
-            if (children.size() > 0) {
-                for (CatalogTree son : children) {
-                    child.add(son.getId());
-                }
-            }
-            catalogEntity.setChildren(child);
-            c1.add(catalogEntity);
-        }
-        workInfoVo.setCatalogRoot(c1);
-
-        // 处理场景
-        List<SceneEntity> scenes = sceneService.findByWorkId(id);
-        workInfoVo.setScenes(scenes);
-
-        return Result.success(workInfoVo);
-    }
+//    @Override
+//    public Result<WorkInfoVo> getDetail(String id) {
+//        WorkEntity entity = this.findById(id);
+//        if (entity == null) {
+//            return Result.failure("对象不存在");
+//        }
+//        WorkInfoVo workInfoVo = new WorkInfoVo();
+//        BeanUtils.copyProperties(entity, workInfoVo);
+//
+//        // 获取分组信息
+//        List<CatalogEntity> list = catalogService.findByWorkId(id);
+//
+//        // 处理第二级
+//        Stream<CatalogEntity> stream2 = list.stream();
+//        Stream<CatalogEntity> sub = stream2.filter(s -> s.getParentId() != null);
+//        List<CatalogEntity> catalogs = sub.collect(Collectors.toList());
+//        workInfoVo.setCatalogs(catalogs);
+//
+//
+//        // 处理第一级
+//        CatalogTreeUtil treeUtil = new CatalogTreeUtil(list);
+//        List<CatalogTree> trees = treeUtil.buildTree();
+//
+//        List<CatalogEntity> c1 = new ArrayList<>();
+//        for (CatalogTree tree : trees) {
+//            CatalogEntity catalogEntity = new CatalogEntity();
+//            BeanUtils.copyProperties(tree, catalogEntity);
+//            // 有子结节
+//            List<CatalogTree> children = tree.getChildren();
+//
+//            // 子节点
+//            List<Long> child = new ArrayList<>();
+//            if (children.size() > 0) {
+//                for (CatalogTree son : children) {
+//                    child.add(son.getId());
+//                }
+//            }
+//            catalogEntity.setChildren(child);
+//            c1.add(catalogEntity);
+//        }
+//        workInfoVo.setCatalogRoot(c1);
+//
+//        // 处理场景
+//        List<SceneEntity> scenes = sceneService.findByWorkId(id);
+//        workInfoVo.setScenes(scenes);
+//
+//        return Result.success(workInfoVo);
+//    }
 
     @Override
-    public WorkEntity findByIdForUpdate(Long id) {
+    public WorkEntity findByIdForUpdate(String id) {
         // 查询数据之前先清理分页缓存
         PageHelper.clearPage();
         return entityMapper.findByIdForUpdate(id);
@@ -294,7 +288,7 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, Long> imple
 
 
         // 检查是否是改用户的作品
-        Long id = param.getId();
+        String id = param.getId();
 
         // 防止重复提交
         String editKey = RedisConstant.WORK_ID_EDIT + id + ":"+param.toString();
@@ -418,7 +412,7 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, Long> imple
      */
     private void editSomeData(SomeDataDto param) {
 
-        Long id = param.getId();
+        String id = param.getId();
         String baseSomeDathPath = id + "/someData.json";
         String saveSomeDataPath = configConstant.serverBasePath + baseSomeDathPath;
         // 写入服务器
@@ -438,7 +432,7 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, Long> imple
     }
 
     @Override
-    public Result select4dkk(PageDto param, Long workId) {
+    public Result select4dkk(PageDto param, String workId) {
         startPage(param);
 
         String url = configConstant.domain4dKK + "/api/user/scene/list";

+ 1 - 1
720yun_fd_manage/gis_web/src/main/java/com/gis/web/controller/FodderController.java

@@ -125,7 +125,7 @@ public class FodderController extends BaseController {
      * */
     @ApiOperation(value = "选择全景图", position = 1)
     @PostMapping("select/pano/{workId}")
-    public Result selectFodderPano(@RequestBody PageDto param, @PathVariable Long workId) {
+    public Result selectFodderPano(@RequestBody PageDto param, @PathVariable String workId) {
         return fodderService.selectFodderPano(param, workId);
     }
 

+ 2 - 8
720yun_fd_manage/gis_web/src/main/java/com/gis/web/controller/WebController.java

@@ -1,15 +1,12 @@
 package com.gis.web.controller;
 
 
-import cn.hutool.core.io.FileUtil;
 import com.gis.common.constant.ConfigConstant;
 import com.gis.common.constant.MsgCode;
 import com.gis.common.constant.RedisConstant;
 import com.gis.common.util.RedisUtil;
 import com.gis.common.util.Result;
-import com.gis.domain.entity.SceneEntity;
 import com.gis.domain.entity.WorkEntity;
-import com.gis.service.CatalogService;
 import com.gis.service.FodderService;
 import com.gis.service.SceneService;
 import com.gis.service.WorkService;
@@ -17,13 +14,10 @@ import com.github.pagehelper.PageHelper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.log4j.Log4j2;
-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 org.springframework.web.multipart.MultipartFile;
 
-import java.io.IOException;
 import java.util.concurrent.TimeUnit;
 
 
@@ -62,7 +56,7 @@ public class WebController extends BaseController {
     /** 每次浏览作品都需要调用次接口。 浏览量只统计预览跟正式发布的数据 */
     @ApiOperation(value = "检查作品是否可用", notes = "true:可用, false:不可用, visit有值表示要添加浏览量")
     @GetMapping("checkWork/{workId}")
-    public Result checkWork(@PathVariable Long workId, String visit) {
+    public Result checkWork(@PathVariable String workId, String visit) {
         log.info("作品id: {}", workId);
         boolean flag = false;
 
@@ -95,7 +89,7 @@ public class WebController extends BaseController {
 
     @ApiOperation("检验密码")
     @PostMapping("checkPwd")
-    public Result checkPwd(Long workId, String password) {
+    public Result checkPwd(String workId, String password) {
         WorkEntity entity = workService.findById(workId);
         if (entity == null) {
             log.error("对象不存在, 场景码:{}", workId);

+ 8 - 9
720yun_fd_manage/gis_web/src/main/java/com/gis/web/controller/WorkController.java

@@ -70,14 +70,13 @@ public class WorkController extends BaseController {
     /**
      * 2021-04-20
      * 这个接口好像没用
-     * @param id
      * @return
      */
-    @ApiOperation(value = "详情", position = 1)
-    @GetMapping("detail/{id}")
-    public Result<WorkInfoVo> detail(@PathVariable Long id) {
-        return workService.getDetail(id);
-    }
+//    @ApiOperation(value = "详情", position = 1)
+//    @GetMapping("detail/{id}")
+//    public Result<WorkInfoVo> detail(@PathVariable Long id) {
+//        return workService.getDetail(id);
+//    }
 
     @ApiOperation(value = "修改实体", position = 1)
     @PostMapping("save")
@@ -95,13 +94,13 @@ public class WorkController extends BaseController {
 
     @ApiOperation(value = "删除", position = 1)
     @PostMapping("remove/{id}")
-    public Result remove( @PathVariable Long id) {
+    public Result remove( @PathVariable String id) {
         return workService.remove(id);
     }
 
     @ApiOperation(value = "选择三维场景", position = 1)
     @PostMapping("select/4dkk/{workId}")
-    public Result select4dkk(@RequestBody PageDto param, @PathVariable Long workId) {
+    public Result select4dkk(@RequestBody PageDto param, @PathVariable String workId) {
         return workService.select4dkk(param, workId);
     }
 
@@ -116,7 +115,7 @@ public class WorkController extends BaseController {
 
     @ApiOperation(value = "检查作品token是否有效" , position = 3)
     @GetMapping("checkToken/{workId}")
-    public Result checkToken(@PathVariable Long workId) {
+    public Result checkToken(@PathVariable String workId) {
         String token = getToken();
         if (token == null) {
             log.error("token is null");