Commit 9edb3564 authored by 侯彦文's avatar 侯彦文

文件目录新增树结构

parent b588106a
......@@ -2,7 +2,6 @@ package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.basedata.entity.annotation.DexEmbedded;
import com.yonde.dex.basedata.entity.annotation.DexTypeVersionProp;
......@@ -22,18 +21,17 @@ import lombok.ToString;
import java.time.LocalDateTime;
/**
* @description: ExtComDocLink-VO
* @author: dexadmin
* @version: V
* @date: 2024-7-15 15:32:34
**/
@JsonTypeInfo( use = JsonTypeInfo.Id.CLASS, property = "dxClassname", visible = true, defaultImpl = ExtComDocLinkVO.class)
* @description: ExtComDocLink-VO
* @author: dexadmin
* @version: V
* @date: 2024-10-12 10:22:01
**/
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "dxClassname", visible = true, defaultImpl = ExtComDocLinkVO.class)
@EqualsAndHashCode(callSuper = true)
@Data
@ToString(callSuper = true)
@DexTypeVersionProp(propName = "target", join = @VersionProperty(curVersion = VersionRelationType.NONE, refVersion = VersionRelationType.VERSION))
@DexTypeVersionProp(propName = "source", join = @VersionProperty(curVersion = VersionRelationType.NONE, refVersion = VersionRelationType.MASTER))
public class ExtComDocLinkVO extends IdOnlyVO implements IdVO ,DxLinkDataVOHolder<ExtReviewCommentVO, DxDocumentVO> ,DxLogicDeleteVOHolder{
@DexTypeVersionProp(propName = "target", join = @VersionProperty(curVersion = VersionRelationType.NONE, refVersion = VersionRelationType.ITERATION))
public class ExtComDocLinkVO extends IdOnlyVO implements IdVO, DxLinkDataVOHolder<ExtReviewCommentVO, DxDocumentVO>, DxLogicDeleteVOHolder {
public static final String DX_ID_EMBEDDABLE_PROP_NAME = "dxIdEmbeddable";
public static final String DX_LOGIC_DELETE_EMBEDDABLE_PROP_NAME = "dxLogicDeleteEmbeddable";
......
......@@ -31,8 +31,8 @@ public class ExtDxDocumentController<V extends DxDocumentVO, S extends ExtDxDocu
@ApiOperation("文档和目录查询")
@GetMapping({"/docAndFloder"})
public ApiResult docAndFloder(@RequestParam Long dxContextId, @RequestParam Long parentId) {
return ApiResult.ok(service.getDocAndFolder(dxContextId, parentId), "查询成功");
public ApiResult docAndFloder(@RequestParam Long dxContextId, @RequestParam Long parentId,@RequestParam Long dxDocumentFolderId) {
return ApiResult.ok(service.getDocAndFolder(dxContextId, parentId,dxDocumentFolderId), "查询成功");
}
//
......
......@@ -24,7 +24,7 @@ public interface ExtDxDocumentService<V extends DxDocumentVO> extends ExtDxDocum
* @param parentId 目录夹id
* @return
*/
Map<String, DxPageImpl> getDocAndFolder(Long dxContextId, Long parentId);
Map<String, DxPageImpl> getDocAndFolder(Long dxContextId, Long parentId,Long dxDocumentFolderId);
/**
* 生成图册目录
......
......@@ -12,6 +12,7 @@ import com.yonde.dcs.document.core.event.DocumentEvent;
import com.yonde.dcs.document.core.util.*;
import com.yonde.dcs.plan.common.constants.Constants;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryBuilder;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
......@@ -74,38 +75,36 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
}
@Override
public Map<String, DxPageImpl> getDocAndFolder(Long dxContextId, Long parentId) {
public Map<String, DxPageImpl> getDocAndFolder(Long dxContextId, Long parentId,Long dxDocumentFolderId) {
Map<String, DxPageImpl> result = new HashMap<>();
//查询目录
SearchQueryCondition folderCondition = SearchQueryBuilder.openBuild()
.openFilterBuilder()
.setItem("dxContextId", SearchItem.Operator.EQ, dxContextId)
.setItem("parentId", SearchItem.Operator.EQ, parentId)
.builder().build();
.builder().setPropName("dxContext").build();
DxPageImpl folderPage = dxDocumentFolderService.findRecursion(folderCondition);
result.put("DxDocumentFolder", folderPage);
//查询文档
SearchQueryCondition documentCondition = SearchQueryBuilder.openBuild()
.openFilterBuilder()
.setItem("dxContextId", SearchItem.Operator.EQ, dxContextId)
.setItem("dxDocumentFolderId", SearchItem.Operator.ISNULL, null)
.setItem("latest", SearchItem.Operator.EQ, true)
.setItem("checkOuted", SearchItem.Operator.EQ, false)
.builder().build();
// SearchQueryCondition documentCondition = SearchQueryCondition.builder()
// .searchItems(SearchItems.builder()
// .item(new SearchItem("dxContextId", SearchItem.Operator.EQ, dxContextId, null))
// .item(new SearchItem("dxDocumentFolderId", SearchItem.Operator.ISNULL, null, null))
// .item(new SearchItem("latest", SearchItem.Operator.EQ, true, null))
// .item(new SearchItem("checkOuted", SearchItem.Operator.EQ, false, null))
// .operator(SearchItems.BooleanOperator.AND).build()).build();
SpecSearch specSearch = SpecSearch.builder()
.searchQueryCondition(documentCondition)
.searchTypes(new ArrayList<>())
.build();
DxPageImpl<V> docPage = this.findByConfigSpec(specSearch);
SearchItems searchItems = new SearchItems();
SearchItem dxDocumentFolderIdSearchItem;
if (Objects.nonNull(dxDocumentFolderId)){
dxDocumentFolderIdSearchItem = new SearchItem("dxDocumentFolderId", SearchItem.Operator.EQ, dxDocumentFolderId, null);
}else{
dxDocumentFolderIdSearchItem = new SearchItem("dxDocumentFolderId", SearchItem.Operator.ISNULL, null, null);
}
searchItems.addItem(dxDocumentFolderIdSearchItem);
SearchItem dxContextIdItem = new SearchItem("dxContextId", SearchItem.Operator.EQ, dxContextId, null);
SearchItem latest = new SearchItem("latest", SearchItem.Operator.EQ, true, null);
SearchItem checkOuted = new SearchItem("checkOuted", SearchItem.Operator.EQ, false, null);
searchItems.addItem(dxContextIdItem);
searchItems.addItem(latest);
searchItems.addItem(checkOuted);
SearchQueryCondition query = SearchQueryCondition.builder()
.searchItems(searchItems).
openProp(SearchQueryCondition.builder().name("dxContext").build()).build();
DxPageImpl<V> docPage = this.findRecursion(query);
result.put("DxDocument", docPage);
return result;
}
......
package com.yonde.dcs.document.entity.po;
import org.springframework.data.annotation.CreatedBy;
import javax.persistence.UniqueConstraint;
import java.util.Date;
import java.time.LocalDateTime;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.LastModifiedDate;
import com.yonde.dex.dao.entity.base.IdEntity;
import org.springframework.data.annotation.LastModifiedBy;
import javax.persistence.Column;
import org.springframework.data.annotation.CreatedDate;
import com.yonde.dex.basedata.entity.annotation.DexEmbedded;
import com.yonde.dex.dao.entity.base.DxIdEntityEmbeddable;
import com.yonde.dex.dao.entity.base.IdEntity;
import com.yonde.dex.dao.entity.base.IdOnlyEntity;
import com.yonde.dex.linkdata.plugin.entities.DxLinkDataEmbeddable;
import com.yonde.dex.linkdata.plugin.entities.DxLinkDataHolder;
import com.yonde.dex.logicdelete.plugin.entities.DxLogicDeleteEmbeddable;
import com.yonde.dex.logicdelete.plugin.entities.DxLogicDeleteHolder;
import lombok.Data;
import com.yonde.dex.basedata.entity.annotation.*;
import java.math.BigInteger;
import javax.persistence.*;
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.yonde.dex.dao.entity.base.IdEntity;
import javax.persistence.Column;
import com.yonde.dex.linkdata.plugin.entities.DxLinkDataHolder;
import com.yonde.dex.dao.entity.base.DxIdEntityEmbeddable;
import com.yonde.dex.dao.entity.base.IdOnlyEntity;
import com.yonde.dex.logicdelete.plugin.entities.DxLogicDeleteHolder;
import com.yonde.dex.linkdata.plugin.entities.DxLinkDataEmbeddable;
import com.yonde.dex.logicdelete.plugin.entities.DxLogicDeleteEmbeddable;
import java.time.LocalDateTime;
/**
* @description: ExtComDocLink-PO实体
* @author: dexadmin
* @version: V
* @date: 2024-8-2 15:26:33
**/
* @description: ExtComDocLink-PO实体
* @author: dexadmin
* @version: V
* @date: 2024-10-12 10:22:01
**/
@Entity
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@Data
@Table(name = "EXT_COM_DOC_LINK")
public class ExtComDocLink extends IdOnlyEntity implements IdEntity ,DxLogicDeleteHolder ,DxLinkDataHolder{
public class ExtComDocLink extends IdOnlyEntity implements IdEntity, DxLogicDeleteHolder, DxLinkDataHolder {
/**
* dao扩展对象
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment