From 336eb77c1a07ca3e3ead4482b51f848fa16ab3b7 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期日, 12 十一月 2023 20:15:38 +0800
Subject: [PATCH] 自定义流水相关开发

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/DockingLogeWrapper.java |   72 ++++++++++++++++++++++++++++++++++++
 1 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/DockingLogeWrapper.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/DockingLogeWrapper.java
index e69de29..f4015eb 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/DockingLogeWrapper.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/DockingLogeWrapper.java
@@ -0,0 +1,72 @@
+package com.vci.ubcs.code.wrapper;
+
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.vci.ubcs.code.entity.DockingLog;
+import com.vci.ubcs.code.enumpack.SysIntegrationLogTypeEnum;
+import com.vci.ubcs.code.vo.pagemodel.DockingLogeVO;
+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;
+
+public class DockingLogeWrapper extends BaseEntityWrapper<DockingLog, DockingLogeVO> {
+	public static DockingLogeWrapper build() {
+		return new DockingLogeWrapper();
+	}
+
+	@Override
+	public DockingLogeVO entityVO(DockingLog entity) {
+		entity.setTypeText(SysIntegrationLogTypeEnum.getTextByValue(entity.getType()));
+		DockingLogeVO dockingLogeVO = Objects.requireNonNull(BeanUtil.copy(entity, DockingLogeVO.class));
+		return dockingLogeVO;
+	}
+
+
+	/***
+	 * 鏁扮粍瀵硅薄杞崲
+	 * @param entitys
+	 * @return
+	 */
+	public List<DockingLogeVO> entityVOs(Collection<DockingLog> entitys) {
+		if(CollectionUtils.isEmpty(entitys)) {return new ArrayList<>();}
+		List<DockingLogeVO> vos=new ArrayList<>();
+		if(!CollectionUtils.isEmpty(entitys)) {
+			entitys.stream().forEach(vo -> {
+				vo.setTypeText(SysIntegrationLogTypeEnum.getTextByValue(vo.getType()));
+				vos.add(entityVO(vo));
+			});
+		}
+		return vos;
+	}
+
+	/***
+	 * 鏁扮粍瀵硅薄杞崲
+	 * @param vos
+	 * @return
+	 */
+	public List<DockingLog> voentitys(Collection<DockingLogeVO> vos) {
+		if(CollectionUtils.isEmpty(vos)) {return new ArrayList<>();}
+		List<DockingLog>entitys =new ArrayList<>();
+		if(!CollectionUtils.isEmpty(vos)) {
+			vos.stream().forEach(entity -> {
+				entity.setTypeText(SysIntegrationLogTypeEnum.getTextByValue(entity.getType()));
+				entitys.add(voentity(entity));
+			});
+		}
+		return entitys;
+	}
+
+	/***
+	 * 鏁扮粍瀵硅薄杞崲
+	 * @param vo
+	 * @return
+	 */
+	public DockingLog voentity( DockingLogeVO vo) {
+		vo.setTypeText(SysIntegrationLogTypeEnum.getTextByValue(vo.getType()));
+		DockingLog entity = Objects.requireNonNull(BeanUtil.copy(vo, DockingLog.class));
+		return entity;
+	}
+}

--
Gitblit v1.9.3