|
@@ -1,11 +1,13 @@
|
|
package org.springblade.business.service.impl;
|
|
package org.springblade.business.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
-import org.springblade.business.dto.TrialContainerClassificationDTO;
|
|
|
|
|
|
|
|
|
|
+import org.springblade.business.entity.ArchiveFile;
|
|
import org.springblade.business.entity.MetadataClassification;
|
|
import org.springblade.business.entity.MetadataClassification;
|
|
import org.springblade.business.mapper.MetadataClassificationMapper;
|
|
import org.springblade.business.mapper.MetadataClassificationMapper;
|
|
|
|
+import org.springblade.business.service.IArchiveFileService;
|
|
import org.springblade.business.service.IMetadataClassificationService;
|
|
import org.springblade.business.service.IMetadataClassificationService;
|
|
|
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
@@ -14,18 +16,19 @@ import org.springblade.core.secure.BladeUser;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.tool.constant.BladeConstant;
|
|
import org.springblade.core.tool.constant.BladeConstant;
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
|
+import org.springblade.manager.entity.ArchiveTreeContract;
|
|
|
|
+import org.springblade.manager.feign.ArchiveTreeContractClient;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class MetadataClassificationServiceImpl
|
|
public class MetadataClassificationServiceImpl
|
|
extends BaseServiceImpl<MetadataClassificationMapper, MetadataClassification>
|
|
extends BaseServiceImpl<MetadataClassificationMapper, MetadataClassification>
|
|
implements IMetadataClassificationService {
|
|
implements IMetadataClassificationService {
|
|
-
|
|
|
|
|
|
+ private final IArchiveFileService iArchiveFileService;
|
|
|
|
+ private final ArchiveTreeContractClient archiveTreeContractClient;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public MetadataClassification classificationDetail(Integer type) {
|
|
public MetadataClassification classificationDetail(Integer type) {
|
|
@@ -113,4 +116,59 @@ public class MetadataClassificationServiceImpl
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * fileId 文件id
|
|
|
|
+ * cs 施工监理
|
|
|
|
+ * type 管理端的元数据分类
|
|
|
|
+ * is true 归档前,false 归档后
|
|
|
|
+ * istask 0 为审批,1已审批
|
|
|
|
+ * **/
|
|
|
|
+
|
|
|
|
+ public void createMetadataFile(String ipAddress,Long fileId,Integer cs,Integer type,boolean is,Integer istask){
|
|
|
|
+ BladeUser user = AuthUtil.getUser();
|
|
|
|
+ if(fileId != null){
|
|
|
|
+ /**判断是否已经获取过**/
|
|
|
|
+ List<HashMap<String,Object>> metadataMapList = baseMapper.getMetadaFileByFileId(fileId);
|
|
|
|
+ Map<String,Object> metadataMap = null;
|
|
|
|
+ if(metadataMapList != null && metadataMapList.size()>0){
|
|
|
|
+ metadataMap = metadataMapList.get(0);
|
|
|
|
+ }else{
|
|
|
|
+ metadataMap = new HashMap<>();
|
|
|
|
+ }
|
|
|
|
+ /**获取对应分类的字段**/
|
|
|
|
+ QueryWrapper<MetadataClassification> metadata = new QueryWrapper<>();
|
|
|
|
+ metadata.lambda().like(MetadataClassification :: getFileStorageType,type).eq(MetadataClassification::getIsDeleted,0);
|
|
|
|
+ List<MetadataClassification> metadataClassifications = baseMapper.selectList(metadata);
|
|
|
|
+ Map<String,MetadataClassification> map = new LinkedHashMap<>();
|
|
|
|
+ for(MetadataClassification m : metadataClassifications){
|
|
|
|
+ map.put(m.getContainerName(),m);
|
|
|
|
+ }
|
|
|
|
+ Long id = null;
|
|
|
|
+ switch (type){
|
|
|
|
+ case 0:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**聚合层次**/
|
|
|
|
+ map.get("聚合层次");
|
|
|
|
+
|
|
|
|
+ /**全宗名称**/
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /**文件收集上传**/
|
|
|
|
+ private void archiveFileMetadata(Long fileId){
|
|
|
|
+ ArchiveFile byId = iArchiveFileService.getById(fileId);
|
|
|
|
+ if(byId != null && !byId.getNodeId().isEmpty()) {
|
|
|
|
+ ArchiveTreeContract archiveTreeContractById = archiveTreeContractClient.getArchiveTreeContractById(Long.parseLong(byId.getNodeId()));
|
|
|
|
+ archiveTreeContractById.getAncestors();
|
|
|
|
+ List<ArchiveTreeContract> list = archiveTreeContractClient.getArchiveTreeContractListByIds(archiveTreeContractById.getAncestors());
|
|
|
|
+ StringBuffer nameStr = new StringBuffer();
|
|
|
|
+ for(ArchiveTreeContract treeContract : list){
|
|
|
|
+ nameStr.append(treeContract.getNodeName());
|
|
|
|
+ nameStr.append("/");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|