Compare commits

..

No commits in common. "bf06d60796a73df7892805b0729fda84328af07a" and "1bc5ab6c4d272d788e8fe113f0795db132c30826" have entirely different histories.

9 changed files with 8 additions and 212 deletions

2
.gitignore vendored
View File

@ -24,5 +24,3 @@ hs_err_pid*
.vs
.idea
*.iml
**/target/

View File

@ -15,19 +15,4 @@ public interface CategoryRepository {
* 获取所有节点
*/
List<Category> getAllCategories();
/**
* 获取节点通过编码ID
* @param category
* @return
*/
List<Category> selectCategories(Category category);
/**
* 获取子节点通过父ID
* @param category
* @return
*/
List<Category> selectChildCategories(Category category);
}

View File

@ -11,32 +11,4 @@ public interface CategoryService {
*/
public List<Category> buildCategoryTree();
/**
* 获取所有节点
* @return
*/
List<Category> selectAllCategories();
/**
* 获取节点通过编码ID
* @param category
* @return
*/
List<Category> selectCategories(Category category);
/**
* 获取子节点通过父ID
* @param category
* @return
*/
List<Category> selectChildCategories(Category category);
/**
* 获取 指定节点的 父节点 从所有节点数组中
* @param categoryId
* @param categoryList
* @return
*/
Category getParentCategories(String categoryId, List<Category> categoryList);
}

View File

@ -80,55 +80,4 @@ public class CategoryServiceImpl implements CategoryService {
private boolean hasChild(List<Category> list, Category category) {
return !getChildList(list, category).isEmpty();
}
/**
* 获取所有节点
* @return
*/
public List<Category> selectAllCategories() { return categoryRepository.getAllCategories(); }
/**
* 获取节点通过编码ID
* @param category
* @return
*/
public List<Category> selectCategories(Category category) { return categoryRepository.selectCategories(category); }
/**
* 获取子节点通过父ID
* @param category
* @return
*/
public List<Category> selectChildCategories(Category category) { return categoryRepository.selectChildCategories(category); }
/**
* 获取 指定节点的 父节点 从所有节点数组中
* @param categoryId
* @param categoryList
* @return
*/
public Category getParentCategories(String categoryId, List<Category> categoryList)
{
Category category = null;
Category categoryParent = null;
for(Category iter : categoryList)
{
if(category == null && iter.getCategoryId().equals(categoryId))
{
category = iter;
break;
}
}
for(Category iter : categoryList)
{
if(categoryParent == null && iter.getCategoryId().equals(category.getParentId()))
{
categoryParent = iter;
break;
}
}
return categoryParent;
}
}

View File

@ -19,16 +19,4 @@ public interface CategoryMapper {
* @return
*/
List<Category> selectAllCategories();
/**
* 获取节点通过编码ID
* @return
*/
List<Category> selectCategories(Category category);
/**
* 获取子节点通过父ID
* @return
*/
List<Category> selectChildCategories(Category category);
}

View File

@ -26,22 +26,8 @@ public class CategoryRepositoryImpl implements CategoryRepository {
* 获取所有节点
*/
@Override
public List<Category> getAllCategories() { return categoryMapper.selectAllCategories(); }
/**
* 获取节点通过编码ID
* @param category
* @return
*/
@Override
public List<Category> selectCategories(Category category) { return categoryMapper.selectCategories(category); }
/**
* 获取子节点通过父ID
* @param category
* @return
*/
@Override
public List<Category> selectChildCategories(Category category) { return categoryMapper.selectChildCategories(category); }
public List<Category> getAllCategories(){
return categoryMapper.selectAllCategories();
}
}

View File

@ -32,17 +32,4 @@
<include refid="selectUserVo" />
where category_status="available"
</select>
<select id="selectCategories" resultMap="CategoryResultMap"
parameterType="com.electromagnetic.industry.software.data.manage.domain.boardservice.category.model.Category">
<include refid="selectUserVo" />
where category_id = categoryId and category_status="available"
</select>
<select id="selectChildCategories" resultMap="CategoryResultMap"
parameterType="com.electromagnetic.industry.software.data.manage.domain.boardservice.category.model.Category">
<include refid="selectUserVo" />
where parent_id = parentId and category_status="available"
</select>
</mapper>

View File

@ -9,7 +9,6 @@
<groupId>com.electromagnetic.data</groupId>
<artifactId>electromagnetic-data</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>com.electromagnetic.data</groupId>

View File

@ -2,12 +2,10 @@ package com.electromagnetic.industry.software.data.manage.service.facade;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.category.model.Category;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.EDDataInfo;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.EDDataPage;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.EDDataParams;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.service.EDDataService;
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.service.CategoryService;
import com.electromagnetic.industry.software.data.manage.facade.EDDataFacade;
import com.electromagnetic.industry.software.data.manage.request.indicator.EDDataRequest;
import com.electromagnetic.industry.software.data.manage.response.indicator.EDDataPageResponse;
@ -31,7 +29,6 @@ public class EDDataFacadeImpl implements EDDataFacade {
@Resource
private EDDataService edDataService;
private CategoryService categoryService;
/**
* 创建文件夹
@ -62,7 +59,7 @@ public class EDDataFacadeImpl implements EDDataFacade {
edDataInfo.setNote(request.getNote());
edDataInfo.setDataId(IdWorker.getSnowFlakeIdString());
edDataInfo.setDataNo(edDataInfo.getDataId());
edDataInfo.setDataNo(IdWorker.getSnowFlakeIdString());
edDataInfo.setDataType("folder");
edDataInfo.setVersion("1.0.0");
edDataInfo.setDataStatus("publish");
@ -231,8 +228,7 @@ public class EDDataFacadeImpl implements EDDataFacade {
// 文件保存目录路径
String fileSavePath = storageDirectory + "/" + parentFolderPath;
String treeName = "目录树名称";
//String newFileName = treeName + "," + parentFolderName + "," + fileFullName;
String newFileName = fileFullName;
String newFileName = treeName + "," + parentFolderName + "," + fileFullName;
// 文件数据信息写到数据库
{
@ -257,7 +253,7 @@ public class EDDataFacadeImpl implements EDDataFacade {
edDataInfo.setGmtBatchUpload(request.getGmtBatchUpload());
edDataInfo.setDataId(IdWorker.getSnowFlakeIdString());
edDataInfo.setDataNo(edDataInfo.getDataId());
edDataInfo.setDataNo(IdWorker.getSnowFlakeIdString());
edDataInfo.setDataType("file");
edDataInfo.setVersion("1.0.0");
edDataInfo.setDataStatus("publish");
@ -271,7 +267,7 @@ public class EDDataFacadeImpl implements EDDataFacade {
boolean isSuccess = edDataService.createDataInfo(edDataInfo);
String userHome = System.getProperty("user.home");
File cacheDirectory = new File(userHome + "\\AppData\\Local\\Temp\\EDData\\Upload");
File cacheDirectory = new File(userHome + "\\AppData\\Local\\Temp\\EDData");
if (!cacheDirectory.exists()) {
cacheDirectory.mkdirs();
}
@ -362,70 +358,6 @@ public class EDDataFacadeImpl implements EDDataFacade {
//2循环list将每个文件复制到新建目录并进行重命名命名规则目录树编码+,+文件夹编码有则填写无则为空+,+文件编码
//3打包新建为zip并根据生产下载地址域名+文件路径+文件
//4返回前端下载的地址
// **********在导出的过程中可能会出现有用户上传文件的情况
// 获取目录编码ID
String categoryId = request.getParentId();
// 获取缓存文件夹的绝对路径
String userHome = System.getProperty("user.home");
File cacheDirectory = new File(userHome + "\\AppData\\Local\\Temp\\EDData\\Export");
if (!cacheDirectory.exists()) {
cacheDirectory.mkdirs();
}
String cacheFolder = cacheDirectory.getAbsolutePath(); // 缓存文件夹的绝对路径
List<Category> categoryList = categoryService.selectAllCategories();
{
// 遍历客户端上传的
EDDataParams folderParames = new EDDataParams();
for (String dataId : request.getDataIdArr()) {
Category category = new Category();
category.setCategoryId(dataId);
categoryService.selectCategories(category);
//folderParames.setDataId(dataId);
//EDDataInfo edDataInfo = edDataService.getDataInfo(folderParames);
//if(edDataInfo != null)
//{
// JSONObject implantJsonObject = JSON.parseObject(edDataInfo.getImplantJson());
// String filePath = implantJsonObject.getString("folderPath");
// filePath = storageDirectory + "/" + filePath + "/" + edDataInfo.getDataName();
// dataPathArr.add(filePath);
//}
}
}
String parentFolderPath = ""; //上级文件夹路径
String parentFolderIdPath = ""; //上级文件夹ID路径
String parentFolderName = ""; //上级文件夹名称
// 获取上级文件夹路径
{
EDDataParams folderParames = new EDDataParams();
folderParames.setDataId(categoryId);
EDDataInfo edDataInfoParent = edDataService.getDataInfo(folderParames);
if(edDataInfoParent == null) {
ElectromagneticResultUtil.fail(HttpStatus.BAD_REQUEST.toString(),"上级文件夹为空!");
}
JSONObject implantJsonObject = JSON.parseObject(edDataInfoParent.getImplantJson());
parentFolderPath = implantJsonObject.getString("folderPath");
parentFolderIdPath = implantJsonObject.getString("folderIdPath");
if(!parentFolderPath.isEmpty())
parentFolderPath += "/" ;
if(!parentFolderIdPath.isEmpty())
parentFolderIdPath += "/" ;
parentFolderPath += edDataInfoParent.getDataName();
parentFolderIdPath += edDataInfoParent.getDataId();
parentFolderName = edDataInfoParent.getDataName();
}
return null;
}