From 79b74fd838d1c79d1d737eaba8f81554f37bb4bb Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 26 五月 2023 19:22:58 +0800
Subject: [PATCH] 代码整合
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/DockingPreViewWrapper.java | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 49 insertions(+), 1 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/DockingPreViewWrapper.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/DockingPreViewWrapper.java
index 4823305..518e96f 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/DockingPreViewWrapper.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/DockingPreViewWrapper.java
@@ -1,11 +1,14 @@
package com.vci.ubcs.code.wrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.vci.ubcs.code.entity.DockingPreViewModel;
-import com.vci.ubcs.code.vo.pagemodel.DockingPreClassifyVO;
import com.vci.ubcs.code.vo.pagemodel.DockingPreViewModelVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import java.util.Objects;
/**
*闆嗗洟缂栫爜鐢宠瑙嗗浘鍖呰绫�
@@ -14,9 +17,54 @@
* @since 2023-05-23
*/
public class DockingPreViewWrapper extends BaseEntityWrapper<DockingPreViewModel, DockingPreViewModelVO> {
+ public static DockingPreViewWrapper build() {
+ return new DockingPreViewWrapper();
+ }
@Override
public DockingPreViewModelVO entityVO(DockingPreViewModel entity) {
DockingPreViewModelVO dockingPreViewModelVO = Objects.requireNonNull(BeanUtil.copy(entity, DockingPreViewModelVO.class));
return dockingPreViewModelVO;
}
+
+ /***
+ * 鏁扮粍瀵硅薄杞崲
+ * @param entitys
+ * @return
+ */
+ public List<DockingPreViewModelVO> entityVOs(Collection<DockingPreViewModel> entitys) {
+ if(CollectionUtils.isEmpty(entitys)) {return new ArrayList<>();}
+ List<DockingPreViewModelVO> vos=new ArrayList<>();
+ if(!CollectionUtils.isEmpty(entitys)) {
+ entitys.stream().forEach(dockingPreAttrRange -> {
+ vos.add(entityVO(dockingPreAttrRange));
+ });
+ }
+ return vos;
+ }
+
+ /***
+ * 鏁扮粍瀵硅薄杞崲
+ * @param vos
+ * @return
+ */
+ public List<DockingPreViewModel> voentitys(Collection<DockingPreViewModelVO> vos) {
+ if(CollectionUtils.isEmpty(vos)) {return new ArrayList<>();}
+ List<DockingPreViewModel>entitys =new ArrayList<>();
+ if(!CollectionUtils.isEmpty(vos)) {
+ vos.stream().forEach(entity -> {
+ entitys.add(voentity(entity));
+ });
+ }
+ return entitys;
+ }
+
+ /***
+ * 鏁扮粍瀵硅薄杞崲
+ * @param vo
+ * @return
+ */
+ public DockingPreViewModel voentity( DockingPreViewModelVO vo) {
+ DockingPreViewModel entity = Objects.requireNonNull(BeanUtil.copy(vo, DockingPreViewModel.class));
+ return entity;
+ }
}
--
Gitblit v1.9.3