From 7d18c733d4c4109f2bc8e5b176cfde74c490a207 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期五, 29 三月 2024 10:30:48 +0800
Subject: [PATCH] cps ok
---
smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/wrapper/EmployeeWrapper.java | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/wrapper/EmployeeWrapper.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/wrapper/EmployeeWrapper.java
index bb215e4..b841b2f 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/wrapper/EmployeeWrapper.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/wrapper/EmployeeWrapper.java
@@ -10,6 +10,7 @@
import com.qianwen.core.tool.utils.SpringUtil;
import com.qianwen.smartman.modules.cps.convert.EmployeeConvert;
import com.qianwen.smartman.modules.cps.dto.EmployeeDTO;
+import com.qianwen.smartman.modules.cps.entity.CommonGroup;
import com.qianwen.smartman.modules.cps.service.ICommonGroupService;
import com.qianwen.smartman.modules.cps.vo.EmployeeDetailVO;
import com.qianwen.smartman.modules.system.entity.User;
@@ -30,6 +31,18 @@
employeeDetailVO.setPostName(Func.join(postName));
employeeDetailVO.setAccount(Func.isNotEmpty(user) ? user.getAccount() : null);
employeeDetailVO.setRoleName(Func.join(roleName));
+
+ employeeDetailVO.setOrganizationName(
+ Optional.<String>ofNullable(employeeDetailVO.getOrganizationId())
+ .map(orgid -> {
+ ICommonGroupService groupService = SpringUtil.getBean(ICommonGroupService.class);
+ return groupService.getById(orgid);
+ //return null;
+ })
+ .map(CommonGroup::getName)
+ .orElse(null)
+ );
+ /*
Optional ofNullable = Optional.ofNullable(employeeDetailVO.getOrganizationId());
ICommonGroupService iCommonGroupService = (ICommonGroupService) SpringUtil.getBean(ICommonGroupService.class);
iCommonGroupService.getClass();
@@ -38,6 +51,8 @@
}).map((v0) -> {
return v0.getName();
}).orElse(null));
+ */
+
return employeeDetailVO;
}
}
--
Gitblit v1.9.3