lyhzzz vor 1 Monat
Ursprung
Commit
42bff0b2e8
25 geänderte Dateien mit 800 neuen und 25 gelöschten Zeilen
  1. 2 0
      src/main/java/com/fdkankan/manage/common/ResultCode.java
  2. 0 21
      src/main/java/com/fdkankan/manage/controller/CaseNumController.java
  3. 56 0
      src/main/java/com/fdkankan/manage/controller/CaseOverviewController.java
  4. 56 0
      src/main/java/com/fdkankan/manage/controller/CaseTabulationController.java
  5. 87 0
      src/main/java/com/fdkankan/manage/entity/CaseOverview.java
  6. 96 0
      src/main/java/com/fdkankan/manage/entity/CaseTabulation.java
  7. 2 2
      src/main/java/com/fdkankan/manage/generate/AutoGenerate.java
  8. 18 0
      src/main/java/com/fdkankan/manage/mapper/ICaseOverviewMapper.java
  9. 18 0
      src/main/java/com/fdkankan/manage/mapper/ICaseTabulationMapper.java
  10. 24 0
      src/main/java/com/fdkankan/manage/service/ICaseOverviewService.java
  11. 3 0
      src/main/java/com/fdkankan/manage/service/ICaseService.java
  12. 30 0
      src/main/java/com/fdkankan/manage/service/ICaseTabulationService.java
  13. 2 0
      src/main/java/com/fdkankan/manage/service/IScenePlusService.java
  14. 2 0
      src/main/java/com/fdkankan/manage/service/ISysRoleService.java
  15. 171 0
      src/main/java/com/fdkankan/manage/service/impl/CaseOverviewServiceImpl.java
  16. 12 0
      src/main/java/com/fdkankan/manage/service/impl/CaseServiceImpl.java
  17. 170 0
      src/main/java/com/fdkankan/manage/service/impl/CaseTabulationServiceImpl.java
  18. 7 0
      src/main/java/com/fdkankan/manage/service/impl/ScenePlusServiceImpl.java
  19. 12 0
      src/main/java/com/fdkankan/manage/service/impl/SysRoleServiceImpl.java
  20. 1 1
      src/main/java/com/fdkankan/manage/util/AesUtil.java
  21. 8 0
      src/main/java/com/fdkankan/manage/util/FileWriterUtil.java
  22. 12 0
      src/main/java/com/fdkankan/manage/vo/request/CaseOverviewParam.java
  23. 1 1
      src/main/resources/bootstrap-dev.yml
  24. 5 0
      src/main/resources/mapper/manage/CaseOverviewMapper.xml
  25. 5 0
      src/main/resources/mapper/manage/CaseTabulationMapper.xml

+ 2 - 0
src/main/java/com/fdkankan/manage/common/ResultCode.java

@@ -111,6 +111,8 @@ public enum ResultCode  {
     DEL_ERROR(60033, "无法删除系统默认"),
 
     BUILD_LOG_ERROR(60034, "打包计算日志失败"),
+    OVERVIEW_NOT_EXIST(60035, "户型图不存在或已删除"),
+    TABULATION_NOT_EXIST(60036, "方位图不存在或已删除"),
     ;
 
     private Integer code;

+ 0 - 21
src/main/java/com/fdkankan/manage/controller/CaseNumController.java

@@ -1,21 +0,0 @@
-package com.fdkankan.manage.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author 
- * @since 2024-12-04
- */
-@RestController
-@RequestMapping("/manage/caseNum")
-public class CaseNumController {
-
-}
-

+ 56 - 0
src/main/java/com/fdkankan/manage/controller/CaseOverviewController.java

@@ -0,0 +1,56 @@
+package com.fdkankan.manage.controller;
+
+
+import com.fdkankan.manage.common.PageInfo;
+import com.fdkankan.manage.common.ResultData;
+import com.fdkankan.manage.service.ICaseOverviewService;
+import com.fdkankan.manage.vo.request.CaseOverviewParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2025-07-15
+ */
+@RestController
+@RequestMapping("/service/manage/caseOverview")
+public class CaseOverviewController {
+
+
+    @Autowired
+    ICaseOverviewService caseOverviewService;
+
+    @PostMapping("/list")
+    public ResultData list(@RequestBody CaseOverviewParam param){
+
+        return ResultData.ok(caseOverviewService.pageList(param));
+    }
+
+    @PostMapping("/copy")
+    public ResultData copy(@RequestBody CaseOverviewParam param){
+        caseOverviewService.copy(param.getOverviewId());
+        return ResultData.ok();
+    }
+
+    @PostMapping("/rename")
+    public ResultData rename(@RequestBody CaseOverviewParam param){
+        caseOverviewService.rename(param.getOverviewId(),param.getNewTitle());
+        return ResultData.ok();
+    }
+
+
+    @PostMapping("/del")
+    public ResultData del(@RequestBody CaseOverviewParam param){
+        caseOverviewService.del(param.getOverviewId());
+        return ResultData.ok();
+    }
+}
+

+ 56 - 0
src/main/java/com/fdkankan/manage/controller/CaseTabulationController.java

@@ -0,0 +1,56 @@
+package com.fdkankan.manage.controller;
+
+
+import com.fdkankan.manage.common.ResultData;
+import com.fdkankan.manage.service.ICaseOverviewService;
+import com.fdkankan.manage.service.ICaseTabulationService;
+import com.fdkankan.manage.vo.request.CaseOverviewParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2025-07-15
+ */
+@RestController
+@RequestMapping("/service/manage/caseTabulation")
+public class CaseTabulationController {
+
+
+    @Autowired
+    ICaseTabulationService caseTabulationService;
+
+    @PostMapping("/list")
+    public ResultData list(@RequestBody CaseOverviewParam param){
+
+        return ResultData.ok(caseTabulationService.pageList(param));
+    }
+
+    @PostMapping("/copy")
+    public ResultData copy(@RequestBody CaseOverviewParam param){
+        caseTabulationService.copy(param.getTabulationId());
+        return ResultData.ok();
+    }
+
+    @PostMapping("/rename")
+    public ResultData rename(@RequestBody CaseOverviewParam param){
+        caseTabulationService.rename(param.getTabulationId(),param.getNewTitle());
+        return ResultData.ok();
+    }
+
+
+    @PostMapping("/del")
+    public ResultData del(@RequestBody CaseOverviewParam param){
+        caseTabulationService.del(param.getTabulationId());
+        return ResultData.ok();
+    }
+}
+

+ 87 - 0
src/main/java/com/fdkankan/manage/entity/CaseOverview.java

@@ -0,0 +1,87 @@
+package com.fdkankan.manage.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2025-07-15
+ */
+@Getter
+@Setter
+@TableName("t_case_overview")
+public class CaseOverview implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @TableField("case_id")
+    private Integer caseId;
+
+    @TableField("title")
+    private String title;
+
+    @TableField("cover")
+    private String cover;
+
+    /**
+     * 数据
+     */
+    @TableField("store")
+    private String store;
+
+    /**
+     * 视口
+     */
+    @TableField("viewport")
+    private String viewport;
+
+    @TableField("type")
+    private Integer type;
+
+    @TableField("map_url")
+    private String mapUrl;
+
+    @TableLogic
+    private Integer tbStatus;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+    @TableField("high")
+    private Integer high;
+
+    @TableField("width")
+    private Integer width;
+
+    @TableField("list_cover")
+    private String listCover;
+
+    @TableField("kankan_cover")
+    private String kankanCover;
+
+    @TableField("platform_id")
+    private Integer platformId;
+
+    @TableField("sys_user_id")
+    private Integer sysUserId;
+
+    @TableField("is_copy")
+    private Integer isCopy;
+
+    @TableField(exist = false)
+    private String resource;
+}

+ 96 - 0
src/main/java/com/fdkankan/manage/entity/CaseTabulation.java

@@ -0,0 +1,96 @@
+package com.fdkankan.manage.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2025-07-15
+ */
+@Getter
+@Setter
+@TableName("t_case_tabulation")
+public class CaseTabulation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @TableField("case_id")
+    private Integer caseId;
+
+    @TableField("title")
+    private String title;
+
+    /**
+     * 数据
+     */
+    @TableField("store")
+    private String store;
+
+    /**
+     * 视口
+     */
+    @TableField("viewport")
+    private String viewport;
+
+    /**
+     * 封面图
+     */
+    @TableField("cover")
+    private String cover;
+
+    /**
+     * 纸张
+     */
+    @TableField("paper_key")
+    private String paperKey;
+
+    @TableField("is_auto_gen")
+    private Integer isAutoGen;
+
+    @TableLogic
+   private Integer tbStatus;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+    @TableField("overview_id")
+    private Integer overviewId;
+
+    @TableField("map_url")
+    private String mapUrl;
+
+    @TableField("high")
+    private Integer high;
+
+    @TableField("width")
+    private Integer width;
+
+    @TableField("list_cover")
+    private String listCover;
+
+    @TableField("platform_id")
+    private Integer platformId;
+
+    @TableField("sys_user_id")
+    private Integer sysUserId;
+
+    @TableField("is_copy")
+    private Integer isCopy;
+
+    @TableField(exist = false)
+    private String resource;
+}

+ 2 - 2
src/main/java/com/fdkankan/manage/generate/AutoGenerate.java

@@ -18,7 +18,7 @@ public class AutoGenerate {
         String path =System.getProperty("user.dir");
 
         generate(path,"manage", getTables(new String[]{
-                "t_orig_file_upload_batch","t_orig_file_upload"
+                "t_overview_num"
         }));
 
 //        generate(path,"goods", getTables(new String[]{
@@ -46,7 +46,7 @@ public class AutoGenerate {
 
 
     public static void  generate(String path,String moduleName,  List<String> tables){
-        FastAutoGenerator.create("jdbc:mysql://119.23.182.50:3306/4dkankan_v4",
+        FastAutoGenerator.create("jdbc:mysql://119.23.182.50:3306/fd_fusion",
                 "root","4dkk2023cuikuan%")
                 .globalConfig(builder -> {
                     builder.author("")               //作者

+ 18 - 0
src/main/java/com/fdkankan/manage/mapper/ICaseOverviewMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage.mapper;
+
+import com.fdkankan.manage.entity.CaseOverview;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2025-07-15
+ */
+@Mapper
+public interface ICaseOverviewMapper extends BaseMapper<CaseOverview> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/manage/mapper/ICaseTabulationMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage.mapper;
+
+import com.fdkankan.manage.entity.CaseTabulation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2025-07-15
+ */
+@Mapper
+public interface ICaseTabulationMapper extends BaseMapper<CaseTabulation> {
+
+}

+ 24 - 0
src/main/java/com/fdkankan/manage/service/ICaseOverviewService.java

@@ -0,0 +1,24 @@
+package com.fdkankan.manage.service;
+
+import com.fdkankan.manage.entity.CaseOverview;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.manage.vo.request.CaseOverviewParam;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2025-07-15
+ */
+public interface ICaseOverviewService extends IService<CaseOverview> {
+
+    Object pageList(CaseOverviewParam param);
+
+    void copy(Integer overviewId);
+
+    void rename(Integer overviewId, String newTitle);
+
+    void del(Integer overviewId);
+}

+ 3 - 0
src/main/java/com/fdkankan/manage/service/ICaseService.java

@@ -6,6 +6,7 @@ import com.fdkankan.manage.entity.Case;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fdkankan.manage.vo.request.CaseParam;
 
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -26,4 +27,6 @@ public interface ICaseService extends IService<Case> {
     List<Case> getCaseByNum(String num);
 
     void checkNumInCase(String num);
+
+    HashMap<Integer, Case> getMapByCaseIds(List<Integer> caseIds);
 }

+ 30 - 0
src/main/java/com/fdkankan/manage/service/ICaseTabulationService.java

@@ -0,0 +1,30 @@
+package com.fdkankan.manage.service;
+
+import com.fdkankan.manage.entity.CaseTabulation;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.manage.vo.request.CaseOverviewParam;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2025-07-15
+ */
+public interface ICaseTabulationService extends IService<CaseTabulation> {
+
+    List<CaseTabulation> getByOverId(Integer overId);
+
+    void delByIds(List<Integer> collect);
+
+    Object pageList(CaseOverviewParam param);
+
+    void copy(Integer tabulationId);
+
+    void rename(Integer tabulationId, String newTitle);
+
+    void del(Integer tabulationId);
+}

+ 2 - 0
src/main/java/com/fdkankan/manage/service/IScenePlusService.java

@@ -40,4 +40,6 @@ public interface IScenePlusService extends IService<ScenePlus> {
     List<ScenePlus> getByNumList(List<String> numList);
 
     String getSceneBuildLog(String num);
+
+    List<String> getNumListBySceneName(String sceneName);
 }

+ 2 - 0
src/main/java/com/fdkankan/manage/service/ISysRoleService.java

@@ -23,4 +23,6 @@ public interface ISysRoleService extends IService<SysRole> {
     void delete(Long id);
 
     void giveMenu(SysRoleMenuParam param);
+
+    Boolean isAdmin();
 }

+ 171 - 0
src/main/java/com/fdkankan/manage/service/impl/CaseOverviewServiceImpl.java

@@ -0,0 +1,171 @@
+package com.fdkankan.manage.service.impl;
+
+import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.io.FileUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.manage.common.PageInfo;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.entity.*;
+import com.fdkankan.manage.exception.BusinessException;
+import com.fdkankan.manage.mapper.ICaseOverviewMapper;
+import com.fdkankan.manage.service.*;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage.util.FileWriterUtil;
+import com.fdkankan.manage.vo.request.CaseOverviewParam;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2025-07-15
+ */
+@Service
+@DS("db2")
+public class CaseOverviewServiceImpl extends ServiceImpl<ICaseOverviewMapper, CaseOverview> implements ICaseOverviewService {
+
+    @Autowired
+    IJyUserPlatformService jyUserPlatformService;
+    @Autowired
+    ISysRoleService sysRoleService;
+    @Autowired
+    IScenePlusService scenePlusService;
+    @Autowired
+    ICaseService caseService;
+    @Autowired
+    ICaseTabulationService caseTabulationService;
+    @Autowired
+    FYunFileServiceInterface fYunFileServiceInterface;
+
+    @Override
+    public Object pageList(CaseOverviewParam param) {
+        Long sysUserId = Long.valueOf(StpUtil.getLoginId().toString());
+        Integer loginPlatformId = jyUserPlatformService.getLoginPlatformId();
+        Boolean flag = sysRoleService.isAdmin();
+
+        LambdaQueryWrapper<CaseOverview> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseOverview::getPlatformId,loginPlatformId);
+        if(!flag){
+            wrapper.eq(CaseOverview::getSysUserId,sysUserId);
+        }
+        if(StringUtils.isNotBlank(param.getTitle())){
+            wrapper.like(CaseOverview::getTitle,param.getTitle());
+        }
+        Page<CaseOverview> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
+
+        List<Integer> caseIds = page.getRecords().stream().map(CaseOverview::getCaseId).collect(Collectors.toList());
+        HashMap<Integer, Case> map = caseService.getMapByCaseIds(caseIds);
+
+        for (CaseOverview record : page.getRecords()) {
+            if(record.getCaseId() != null && map.get(record.getCaseId()) != null){
+                record.setResource(map.get(record.getCaseId()).getCaseTitle());
+            }
+        }
+
+        return PageInfo.PageInfo(page);
+    }
+
+    @Override
+    public void copy(Integer overviewId) {
+        if(overviewId == null){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        CaseOverview caseOverview = this.getById(overviewId);
+        if(caseOverview == null){
+            throw new BusinessException(ResultCode.OVERVIEW_NOT_EXIST);
+        }
+        caseOverview.setId(null);
+        caseOverview.setTitle(caseOverview.getTitle() +"(copy)");
+        caseOverview.setIsCopy(1);
+//        if(StringUtils.isNotBlank(caseOverview.getListCover())){
+//            String newPath = FileWriterUtil.getCpFilePath(caseOverview.getListCover());
+//            fYunFileServiceInterface.copyFileInBucket(caseOverview.getListCover(),newPath);
+//            caseOverview.setListCover(newPath);
+//        }
+//        if(StringUtils.isNotBlank(caseOverview.getKankanCover())){
+//            String newPath = FileWriterUtil.getCpFilePath(caseOverview.getKankanCover());
+//            fYunFileServiceInterface.copyFileInBucket(caseOverview.getKankanCover(),newPath);
+//            caseOverview.setKankanCover(newPath);
+//        }
+
+        this.save(caseOverview);
+
+        List<CaseTabulation> caseTabulations = caseTabulationService.getByOverId(caseOverview.getId());
+        for (CaseTabulation caseTabulation : caseTabulations) {
+            caseTabulation.setId(null);
+            caseTabulation.setOverviewId(caseOverview.getId());
+            caseTabulationService.save(caseTabulation);
+        }
+
+    }
+
+    @Override
+    public void rename(Integer overviewId, String newTitle) {
+        if(overviewId == null || StringUtils.isBlank(newTitle)){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        LambdaUpdateWrapper<CaseOverview> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(CaseOverview::getId,overviewId);
+        wrapper.set(CaseOverview::getTitle,newTitle);
+        this.update(wrapper);
+    }
+
+    @Override
+    public void del(Integer overviewId) {
+        if(overviewId == null ){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        CaseOverview caseOverview = this.getById(overviewId);
+        if(caseOverview == null){
+            return;
+        }
+        this.removeById(overviewId);
+        this.delFile(caseOverview);
+
+        List<CaseTabulation> caseTabulations = caseTabulationService.getByOverId(overviewId);
+        if(!caseTabulations.isEmpty()){
+            caseTabulationService.delByIds(caseTabulations.stream().map(CaseTabulation::getId).collect(Collectors.toList()));
+        }
+
+    }
+
+    private void delFile(CaseOverview caseOverview) {
+        List<CaseOverview> list = this.getByCover(caseOverview.getListCover());
+        if(list.isEmpty()){
+            try {
+                fYunFileServiceInterface.deleteFile(caseOverview.getListCover());
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        List<CaseOverview> list2 = this.getByCover(caseOverview.getKankanCover());
+        if(list2.isEmpty()){
+            try {
+                fYunFileServiceInterface.deleteFile(caseOverview.getKankanCover());
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
+    private List<CaseOverview> getByCover(String listCover) {
+        LambdaQueryWrapper<CaseOverview> wrapper = new LambdaQueryWrapper<>();
+        wrapper.and(e -> e.eq(CaseOverview::getListCover,listCover).or().eq(CaseOverview::getKankanCover,listCover));
+        return this.list(wrapper);
+    }
+}

+ 12 - 0
src/main/java/com/fdkankan/manage/service/impl/CaseServiceImpl.java

@@ -163,4 +163,16 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, Case> implements I
 //        }
 
     }
+
+    @Override
+    public HashMap<Integer, Case> getMapByCaseIds(List<Integer> caseIds) {
+        HashMap<Integer,Case> map = new HashMap<>();
+        if(caseIds == null ||  caseIds.isEmpty()){
+            return map;
+        }
+        List<Case> cases = this.listByIds(caseIds);
+        cases.forEach(e -> map.put(e.getCaseId(),e));
+
+        return map;
+    }
 }

+ 170 - 0
src/main/java/com/fdkankan/manage/service/impl/CaseTabulationServiceImpl.java

@@ -0,0 +1,170 @@
+package com.fdkankan.manage.service.impl;
+
+import cn.dev33.satoken.stp.StpUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.manage.common.PageInfo;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.entity.Case;
+import com.fdkankan.manage.entity.CaseOverview;
+import com.fdkankan.manage.entity.CaseTabulation;
+import com.fdkankan.manage.exception.BusinessException;
+import com.fdkankan.manage.mapper.ICaseTabulationMapper;
+import com.fdkankan.manage.service.ICaseService;
+import com.fdkankan.manage.service.ICaseTabulationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage.service.IJyUserPlatformService;
+import com.fdkankan.manage.service.ISysRoleService;
+import com.fdkankan.manage.vo.request.CaseOverviewParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.lang.reflect.Array;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2025-07-15
+ */
+@Service
+@DS("db2")
+
+public class CaseTabulationServiceImpl extends ServiceImpl<ICaseTabulationMapper, CaseTabulation> implements ICaseTabulationService {
+
+    @Autowired
+    FYunFileServiceInterface fYunFileServiceInterface;
+    @Autowired
+    IJyUserPlatformService jyUserPlatformService;
+    @Autowired
+    ISysRoleService sysRoleService;
+    @Autowired
+    ICaseService caseService;
+
+
+    @Override
+    public Object pageList(CaseOverviewParam param) {
+        Long sysUserId = Long.valueOf(StpUtil.getLoginId().toString());
+        Integer loginPlatformId = jyUserPlatformService.getLoginPlatformId();
+        Boolean flag = sysRoleService.isAdmin();
+
+        LambdaQueryWrapper<CaseTabulation> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseTabulation::getPlatformId,loginPlatformId);
+        wrapper.isNull(CaseTabulation::getOverviewId);
+        if(!flag){
+            wrapper.eq(CaseTabulation::getSysUserId,sysUserId);
+        }
+        Page<CaseTabulation> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
+
+        List<Integer> caseIds = page.getRecords().stream().map(CaseTabulation::getCaseId).collect(Collectors.toList());
+        HashMap<Integer, Case> map = caseService.getMapByCaseIds(caseIds);
+
+        for (CaseTabulation record : page.getRecords()) {
+            if(record.getCaseId() != null && map.get(record.getCaseId()) != null){
+                record.setResource(map.get(record.getCaseId()).getCaseTitle());
+            }
+        }
+
+        return PageInfo.PageInfo(page);
+    }
+
+
+    @Override
+    public void copy(Integer tabulationId) {
+        if(tabulationId == null){
+            throw new BusinessException(ResultCode.PASSWORD_ERROR);
+        }
+        CaseTabulation caseTabulation = this.getById(tabulationId);
+        if(caseTabulation == null){
+            throw new BusinessException(ResultCode.TABULATION_NOT_EXIST);
+        }
+        caseTabulation.setId(null);
+        caseTabulation.setTitle(caseTabulation.getTitle()+"(copy)");
+        caseTabulation.setIsCopy(1);
+        this.save(caseTabulation);
+    }
+
+    @Override
+    public void rename(Integer tabulationId, String newTitle) {
+        if(tabulationId == null){
+            throw new BusinessException(ResultCode.PASSWORD_ERROR);
+        }
+        CaseTabulation caseTabulation = this.getById(tabulationId);
+        if(caseTabulation == null){
+            throw new BusinessException(ResultCode.TABULATION_NOT_EXIST);
+        }
+        LambdaUpdateWrapper<CaseTabulation> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(CaseTabulation::getId,tabulationId);
+        wrapper.set(CaseTabulation::getTitle,newTitle);
+        this.update(wrapper);
+    }
+
+    @Override
+    public void del(Integer tabulationId) {
+        this.delByIds(Arrays.asList(tabulationId));
+    }
+
+    @Override
+    public List<CaseTabulation> getByOverId(Integer overId) {
+        LambdaQueryWrapper<CaseTabulation> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseTabulation::getOverviewId,overId);
+        return this.list(wrapper);
+    }
+
+    @Override
+    public void delByIds(List<Integer> ids) {
+        if(!ids.isEmpty()){
+            List<CaseTabulation> caseTabulations = this.listByIds(ids);
+            this.removeByIds(ids);
+            for (CaseTabulation caseTabulation : caseTabulations) {
+                delFile(caseTabulation);
+            }
+        }
+    }
+
+
+
+    private void delFile(CaseTabulation caseTabulation) {
+        List<CaseTabulation> list = this.getByCover(caseTabulation.getListCover());
+        if(list.isEmpty()){
+            try {
+                fYunFileServiceInterface.deleteFile(caseTabulation.getListCover());
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        List<CaseTabulation> list2 = this.getByCover(caseTabulation.getMapUrl());
+        if(list2.isEmpty()){
+            try {
+                fYunFileServiceInterface.deleteFile(caseTabulation.getMapUrl());
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+        List<CaseTabulation> list3 = this.getByCover(caseTabulation.getCover());
+        if(list3.isEmpty()){
+            try {
+                fYunFileServiceInterface.deleteFile(caseTabulation.getCover());
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
+    private List<CaseTabulation> getByCover(String listCover) {
+        LambdaQueryWrapper<CaseTabulation> wrapper = new LambdaQueryWrapper<>();
+        wrapper.and(e -> e.eq(CaseTabulation::getListCover,listCover).or().eq(CaseTabulation::getMapUrl,listCover).or().like(CaseTabulation::getCover,listCover));
+        return this.list(wrapper);
+    }
+}

+ 7 - 0
src/main/java/com/fdkankan/manage/service/impl/ScenePlusServiceImpl.java

@@ -187,4 +187,11 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
         }
         return buildLogPath.replace("4dkankan/","") +"/"+zipName;
     }
+
+    @Override
+    public List<String> getNumListBySceneName(String sceneName) {
+        LambdaQueryWrapper<ScenePlus> wrapper = new LambdaQueryWrapper<>();
+        wrapper.like(ScenePlus::getTitle,sceneName);
+        return this.list(wrapper).stream().map(ScenePlus::getNum).collect(Collectors.toList());
+    }
 }

+ 12 - 0
src/main/java/com/fdkankan/manage/service/impl/SysRoleServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fdkankan.manage.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -24,6 +25,8 @@ import org.springframework.util.StringUtils;
 
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.RecursiveTask;
 
 /**
  * <p>
@@ -84,4 +87,13 @@ public class SysRoleServiceImpl extends ServiceImpl<ISysRoleMapper, SysRole> imp
         roleMenuService.deleteByRoleId(param.getRoleId());
         roleMenuService.saveBatchByRoleId(param.getRoleId(),param.getMenuIds());
     }
+
+    @Override
+    public Boolean isAdmin() {
+        List<String> roleList = StpUtil.getRoleList();
+        if(roleList.contains("admin")){
+            return true;
+        }
+        return false;
+    }
 }

+ 1 - 1
src/main/java/com/fdkankan/manage/util/AesUtil.java

@@ -122,7 +122,7 @@ public class AesUtil {
      * 测试
      */
     public static void main(String args[]) throws Exception {
-        String data = "Aa123456";
+        String data = "sg123456";
         //String key = getRandomStringKey();  //0000001210830863
         //String iv = getRandomStringIv();    //1xo1ub7m2rsz92ev
 

+ 8 - 0
src/main/java/com/fdkankan/manage/util/FileWriterUtil.java

@@ -1,5 +1,6 @@
 package com.fdkankan.manage.util;
 
+import cn.hutool.core.io.FileUtil;
 import com.fdkankan.manage.constant.FileTypeEnum;
 
 import java.io.*;
@@ -7,6 +8,7 @@ import java.math.BigDecimal;
 import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
 import java.util.List;
+import java.util.UUID;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -110,4 +112,10 @@ public class FileWriterUtil {
         Matcher m = p.matcher(str);
         return m.find();
     }
+
+    public static String getCpFilePath(String filePath){
+        String name = FileUtil.getName(filePath);
+        String suffix = FileUtil.getSuffix(filePath);
+        return filePath.replace(name, UUID.randomUUID().toString().replace("-",""))+"."+suffix;
+    }
 }

+ 12 - 0
src/main/java/com/fdkankan/manage/vo/request/CaseOverviewParam.java

@@ -0,0 +1,12 @@
+package com.fdkankan.manage.vo.request;
+
+import lombok.Data;
+
+@Data
+public class CaseOverviewParam extends RequestBase{
+    private Integer overviewId;
+    private Integer tabulationId;
+    private String title;
+    private String newTitle;
+    private String sceneName;
+}

+ 1 - 1
src/main/resources/bootstrap-dev.yml

@@ -4,7 +4,7 @@ spring:
   cloud:
     nacos:
       config:
-        server-addr: 192.168.0.25:8848
+        server-addr: 119.23.182.50:8848
         file-extension: yaml
         namespace: dev
         extension-configs:

+ 5 - 0
src/main/resources/mapper/manage/CaseOverviewMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.manage.mapper.ICaseOverviewMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/manage/CaseTabulationMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.manage.mapper.ICaseTabulationMapper">
+
+</mapper>