Commit 2a4ae50c authored by wangyangyang's avatar wangyangyang

Merge remote-tracking branch 'origin/master'

parents 1e8b7f48 9edb3564
...@@ -2,7 +2,6 @@ package com.yonde.dcs.document.common.vo; ...@@ -2,7 +2,6 @@ package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO; import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.basedata.entity.annotation.DexEmbedded; import com.yonde.dex.basedata.entity.annotation.DexEmbedded;
import com.yonde.dex.basedata.entity.annotation.DexTypeVersionProp; import com.yonde.dex.basedata.entity.annotation.DexTypeVersionProp;
...@@ -22,18 +21,17 @@ import lombok.ToString; ...@@ -22,18 +21,17 @@ import lombok.ToString;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
* @description: ExtComDocLink-VO * @description: ExtComDocLink-VO
* @author: dexadmin * @author: dexadmin
* @version: V * @version: V
* @date: 2024-7-15 15:32:34 * @date: 2024-10-12 10:22:01
**/ **/
@JsonTypeInfo( use = JsonTypeInfo.Id.CLASS, property = "dxClassname", visible = true, defaultImpl = ExtComDocLinkVO.class) @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "dxClassname", visible = true, defaultImpl = ExtComDocLinkVO.class)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@ToString(callSuper = true) @ToString(callSuper = true)
@DexTypeVersionProp(propName = "target", join = @VersionProperty(curVersion = VersionRelationType.NONE, refVersion = VersionRelationType.VERSION)) @DexTypeVersionProp(propName = "target", join = @VersionProperty(curVersion = VersionRelationType.NONE, refVersion = VersionRelationType.ITERATION))
@DexTypeVersionProp(propName = "source", join = @VersionProperty(curVersion = VersionRelationType.NONE, refVersion = VersionRelationType.MASTER)) public class ExtComDocLinkVO extends IdOnlyVO implements IdVO, DxLinkDataVOHolder<ExtReviewCommentVO, DxDocumentVO>, DxLogicDeleteVOHolder {
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_ID_EMBEDDABLE_PROP_NAME = "dxIdEmbeddable";
public static final String DX_LOGIC_DELETE_EMBEDDABLE_PROP_NAME = "dxLogicDeleteEmbeddable"; public static final String DX_LOGIC_DELETE_EMBEDDABLE_PROP_NAME = "dxLogicDeleteEmbeddable";
......
...@@ -31,8 +31,8 @@ public class ExtDxDocumentController<V extends DxDocumentVO, S extends ExtDxDocu ...@@ -31,8 +31,8 @@ public class ExtDxDocumentController<V extends DxDocumentVO, S extends ExtDxDocu
@ApiOperation("文档和目录查询") @ApiOperation("文档和目录查询")
@GetMapping({"/docAndFloder"}) @GetMapping({"/docAndFloder"})
public ApiResult docAndFloder(@RequestParam Long dxContextId, @RequestParam Long parentId) { public ApiResult docAndFloder(@RequestParam Long dxContextId, @RequestParam Long parentId,@RequestParam Long dxDocumentFolderId) {
return ApiResult.ok(service.getDocAndFolder(dxContextId, parentId), "查询成功"); return ApiResult.ok(service.getDocAndFolder(dxContextId, parentId,dxDocumentFolderId), "查询成功");
} }
// //
......
...@@ -24,7 +24,7 @@ public interface ExtDxDocumentService<V extends DxDocumentVO> extends ExtDxDocum ...@@ -24,7 +24,7 @@ public interface ExtDxDocumentService<V extends DxDocumentVO> extends ExtDxDocum
* @param parentId 目录夹id * @param parentId 目录夹id
* @return * @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; ...@@ -12,6 +12,7 @@ import com.yonde.dcs.document.core.event.DocumentEvent;
import com.yonde.dcs.document.core.util.*; import com.yonde.dcs.document.core.util.*;
import com.yonde.dcs.plan.common.constants.Constants; import com.yonde.dcs.plan.common.constants.Constants;
import com.yonde.dex.basedata.data.search.SearchItem; 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.SearchQueryBuilder;
import com.yonde.dex.basedata.data.search.SearchQueryCondition; import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl; import com.yonde.dex.basedata.entity.data.DxPageImpl;
...@@ -74,38 +75,36 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe ...@@ -74,38 +75,36 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
} }
@Override @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<>(); Map<String, DxPageImpl> result = new HashMap<>();
//查询目录 //查询目录
SearchQueryCondition folderCondition = SearchQueryBuilder.openBuild() SearchQueryCondition folderCondition = SearchQueryBuilder.openBuild()
.openFilterBuilder() .openFilterBuilder()
.setItem("dxContextId", SearchItem.Operator.EQ, dxContextId) .setItem("dxContextId", SearchItem.Operator.EQ, dxContextId)
.setItem("parentId", SearchItem.Operator.EQ, parentId) .setItem("parentId", SearchItem.Operator.EQ, parentId)
.builder().build(); .builder().setPropName("dxContext").build();
DxPageImpl folderPage = dxDocumentFolderService.findRecursion(folderCondition); DxPageImpl folderPage = dxDocumentFolderService.findRecursion(folderCondition);
result.put("DxDocumentFolder", folderPage); result.put("DxDocumentFolder", folderPage);
//查询文档 //查询文档
SearchQueryCondition documentCondition = SearchQueryBuilder.openBuild() SearchItems searchItems = new SearchItems();
.openFilterBuilder() SearchItem dxDocumentFolderIdSearchItem;
.setItem("dxContextId", SearchItem.Operator.EQ, dxContextId) if (Objects.nonNull(dxDocumentFolderId)){
.setItem("dxDocumentFolderId", SearchItem.Operator.ISNULL, null) dxDocumentFolderIdSearchItem = new SearchItem("dxDocumentFolderId", SearchItem.Operator.EQ, dxDocumentFolderId, null);
.setItem("latest", SearchItem.Operator.EQ, true) }else{
.setItem("checkOuted", SearchItem.Operator.EQ, false) dxDocumentFolderIdSearchItem = new SearchItem("dxDocumentFolderId", SearchItem.Operator.ISNULL, null, null);
.builder().build(); }
searchItems.addItem(dxDocumentFolderIdSearchItem);
// SearchQueryCondition documentCondition = SearchQueryCondition.builder() SearchItem dxContextIdItem = new SearchItem("dxContextId", SearchItem.Operator.EQ, dxContextId, null);
// .searchItems(SearchItems.builder() SearchItem latest = new SearchItem("latest", SearchItem.Operator.EQ, true, null);
// .item(new SearchItem("dxContextId", SearchItem.Operator.EQ, dxContextId, null)) SearchItem checkOuted = new SearchItem("checkOuted", SearchItem.Operator.EQ, false, null);
// .item(new SearchItem("dxDocumentFolderId", SearchItem.Operator.ISNULL, null, null)) searchItems.addItem(dxContextIdItem);
// .item(new SearchItem("latest", SearchItem.Operator.EQ, true, null)) searchItems.addItem(latest);
// .item(new SearchItem("checkOuted", SearchItem.Operator.EQ, false, null)) searchItems.addItem(checkOuted);
// .operator(SearchItems.BooleanOperator.AND).build()).build(); SearchQueryCondition query = SearchQueryCondition.builder()
.searchItems(searchItems).
SpecSearch specSearch = SpecSearch.builder() openProp(SearchQueryCondition.builder().name("dxContext").build()).build();
.searchQueryCondition(documentCondition) DxPageImpl<V> docPage = this.findRecursion(query);
.searchTypes(new ArrayList<>())
.build();
DxPageImpl<V> docPage = this.findByConfigSpec(specSearch);
result.put("DxDocument", docPage); result.put("DxDocument", docPage);
return result; return result;
} }
......
package com.yonde.dcs.document.entity.po; 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.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 lombok.Data;
import com.yonde.dex.basedata.entity.annotation.*; import lombok.EqualsAndHashCode;
import java.math.BigInteger;
import javax.persistence.*;
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import javax.persistence.Column;
import javax.persistence.Embedded; import javax.persistence.Embedded;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Table; import javax.persistence.Table;
import com.yonde.dex.dao.entity.base.IdEntity; import java.time.LocalDateTime;
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;
/** /**
* @description: ExtComDocLink-PO实体 * @description: ExtComDocLink-PO实体
* @author: dexadmin * @author: dexadmin
* @version: V * @version: V
* @date: 2024-8-2 15:26:33 * @date: 2024-10-12 10:22:01
**/ **/
@Entity @Entity
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@NoArgsConstructor @NoArgsConstructor
@Data @Data
@Table(name = "EXT_COM_DOC_LINK") @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扩展对象 * 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