mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-07 19:23:48 +08:00
v3.21.0 【新增】修改部门名称字段;【新增】修改系统版本version字段;【新增】优化代码生成前端代码;【优化】SQL
This commit is contained in:
@@ -230,7 +230,7 @@ public class NoticeService {
|
||||
noticeVisibleRange.setDataName(employeeEntity == null ? StringConst.EMPTY : employeeEntity.getActualName());
|
||||
} else {
|
||||
DepartmentVO departmentVO = departmentService.getDepartmentById(noticeVisibleRange.getDataId());
|
||||
noticeVisibleRange.setDataName(departmentVO == null ? StringConst.EMPTY : departmentVO.getName());
|
||||
noticeVisibleRange.setDataName(departmentVO == null ? StringConst.EMPTY : departmentVO.getDepartmentName());
|
||||
}
|
||||
}
|
||||
updateFormVO.setVisibleRangeList(noticeVisibleRangeList);
|
||||
|
||||
@@ -31,7 +31,7 @@ public class DepartmentEntity {
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String name;
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 负责人员工 id
|
||||
|
||||
@@ -21,7 +21,7 @@ public class DepartmentAddForm {
|
||||
@Schema(description = "部门名称")
|
||||
@Length(min = 1, max = 50, message = "请输入正确的部门名称(1-50个字符)")
|
||||
@NotNull(message = "请输入正确的部门名称(1-50个字符)")
|
||||
private String name;
|
||||
private String departmentName;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@NotNull(message = "排序值")
|
||||
|
||||
@@ -24,7 +24,7 @@ public class DepartmentVO implements Serializable {
|
||||
private Long departmentId;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
private String name;
|
||||
private String departmentName;
|
||||
|
||||
@Schema(description = "部门负责人姓名")
|
||||
private String managerName;
|
||||
|
||||
@@ -97,15 +97,15 @@ public class DepartmentCacheManager {
|
||||
*/
|
||||
private String buildDepartmentPath(DepartmentVO departmentVO, Map<Long, DepartmentVO> departmentMap) {
|
||||
if (Objects.equals(departmentVO.getParentId(), NumberUtils.LONG_ZERO)) {
|
||||
return departmentVO.getName();
|
||||
return departmentVO.getDepartmentName();
|
||||
}
|
||||
//父节点
|
||||
DepartmentVO parentDepartment = departmentMap.get(departmentVO.getParentId());
|
||||
if (parentDepartment == null) {
|
||||
return departmentVO.getName();
|
||||
return departmentVO.getDepartmentName();
|
||||
}
|
||||
String pathName = buildDepartmentPath(parentDepartment, departmentMap);
|
||||
return pathName + "/" + departmentVO.getName();
|
||||
return pathName + "/" + departmentVO.getDepartmentName();
|
||||
|
||||
}
|
||||
// ---------------------- 构造树的一些方法 ------------------------------
|
||||
|
||||
@@ -242,8 +242,6 @@ public class EmployeeService {
|
||||
/**
|
||||
* 更新登录人头像
|
||||
*
|
||||
* @param employeeUpdateAvatarForm
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> updateAvatar(EmployeeUpdateAvatarForm employeeUpdateAvatarForm) {
|
||||
Long employeeId = employeeUpdateAvatarForm.getEmployeeId();
|
||||
@@ -395,7 +393,7 @@ public class EmployeeService {
|
||||
List<EmployeeVO> voList = employeeEntityList.stream().map(e -> {
|
||||
EmployeeVO employeeVO = SmartBeanUtil.copy(e, EmployeeVO.class);
|
||||
if (department != null) {
|
||||
employeeVO.setDepartmentName(department.getName());
|
||||
employeeVO.setDepartmentName(department.getDepartmentName());
|
||||
}
|
||||
return employeeVO;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
@@ -88,7 +88,7 @@ public class LoginManager {
|
||||
|
||||
// 部门信息
|
||||
DepartmentVO department = departmentService.getDepartmentById(employeeEntity.getDepartmentId());
|
||||
requestEmployee.setDepartmentName(null == department ? StringConst.EMPTY : department.getName());
|
||||
requestEmployee.setDepartmentName(null == department ? StringConst.EMPTY : department.getDepartmentName());
|
||||
|
||||
// 头像信息
|
||||
String avatar = employeeEntity.getAvatar();
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.lab1024.sa.base.common.code.SystemErrorCode;
|
||||
import net.lab1024.sa.base.common.domain.RequestUrlVO;
|
||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.base.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.base.common.util.SmartStringUtil;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -134,6 +135,10 @@ public class MenuService {
|
||||
* @return true 重复 false 未重复
|
||||
*/
|
||||
public <T extends MenuBaseForm> Boolean validateWebPerms(T menuDTO) {
|
||||
if(SmartStringUtil.isEmpty(menuDTO.getWebPerms())){
|
||||
return false;
|
||||
}
|
||||
|
||||
MenuEntity menu = menuDao.getByWebPerms(menuDTO.getWebPerms(), Boolean.FALSE);
|
||||
if (menuDTO instanceof MenuAddForm) {
|
||||
return menu != null;
|
||||
|
||||
@@ -72,7 +72,7 @@ public class RoleEmployeeService {
|
||||
List<Long> departmentIdList = employeeList.stream().filter(e -> e != null && e.getDepartmentId() != null).map(EmployeeVO::getDepartmentId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(departmentIdList)) {
|
||||
List<DepartmentEntity> departmentEntities = departmentDao.selectBatchIds(departmentIdList);
|
||||
Map<Long, String> departmentIdNameMap = departmentEntities.stream().collect(Collectors.toMap(DepartmentEntity::getDepartmentId, DepartmentEntity::getName));
|
||||
Map<Long, String> departmentIdNameMap = departmentEntities.stream().collect(Collectors.toMap(DepartmentEntity::getDepartmentId, DepartmentEntity::getDepartmentName));
|
||||
employeeList.forEach(e -> {
|
||||
e.setDepartmentName(departmentIdNameMap.getOrDefault(e.getDepartmentId(), StringConst.EMPTY));
|
||||
});
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<select id="queryPageEmployeeList"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseEmployeeVO">
|
||||
select
|
||||
t_oa_enterprise_employee.*,
|
||||
t_oa_enterprise_employee.enterprise_id,
|
||||
t_oa_enterprise.enterprise_name,
|
||||
t_employee.*,
|
||||
t_employee.actual_name as employeeName
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
<select id="queryNoticeViewRecordList" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeViewRecordVO">
|
||||
select t_notice_view_record.*,
|
||||
t_employee.actual_name as employeeName,
|
||||
t_department.name as departmentName
|
||||
t_department.department_name
|
||||
from t_notice_view_record
|
||||
left join t_employee on t_employee.employee_id = t_notice_view_record.employee_id
|
||||
left join t_department on t_department.department_id = t_employee.department_id
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<select id="listAll" resultType="net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentVO">
|
||||
SELECT t_department.*,
|
||||
t_employee.actual_name as managerName,
|
||||
parent_department.`name` as parentName
|
||||
parent_department.department_name as parentName
|
||||
FROM t_department
|
||||
left join t_employee on t_department.manager_id = t_employee.employee_id
|
||||
left join t_department parent_department on t_department.parent_id = parent_department.department_id
|
||||
@@ -23,7 +23,7 @@
|
||||
resultType="net.lab1024.sa.admin.module.system.department.domain.vo.DepartmentVO">
|
||||
SELECT t_department.*,
|
||||
t_employee.actual_name as managerName,
|
||||
parent_department.`name` as parentName
|
||||
parent_department.department_name as parentName
|
||||
FROM t_department
|
||||
left join t_employee on t_department.manager_id = t_employee.employee_id
|
||||
left join t_department parent_department on t_department.parent_id = parent_department.department_id
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<select id="queryEmployee" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT
|
||||
t_employee.*,
|
||||
t_department.name AS departmentName
|
||||
t_department.department_name
|
||||
FROM t_employee
|
||||
LEFT JOIN t_department ON t_department.department_id = t_employee.department_id
|
||||
<where>
|
||||
@@ -169,7 +169,7 @@
|
||||
|
||||
<select id="getEmployeeById" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT t_employee.*,
|
||||
t_department.name AS departmentName
|
||||
t_department.department_name
|
||||
FROM t_employee
|
||||
LEFT JOIN t_department ON t_department.department_id = t_employee.department_id
|
||||
where t_employee.employee_id = #{employeeId}
|
||||
@@ -178,7 +178,7 @@
|
||||
<select id="selectEmployeeByDisabledAndDeleted" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT
|
||||
t_employee.*,
|
||||
t_department.name AS departmentName
|
||||
t_department.department_name
|
||||
FROM t_employee
|
||||
LEFT JOIN t_department ON t_department.department_id = t_employee.department_id
|
||||
<where>
|
||||
|
||||
Reference in New Issue
Block a user