* 部门管理 Mapper 接口
@@ -34,4 +36,11 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SysDeptMapper extends PigxBaseMapper {
+ /**
+ * 获取部门的所有后代部门列表
+ * @param deptId 部门ID
+ * @return 后代部门列表
+ */
+ List listDescendant(Long deptId);
+
}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysDeptRelationMapper.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysDeptRelationMapper.java
deleted file mode 100644
index 9250bb62e..000000000
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysDeptRelationMapper.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- *
- */
-
-package com.pig4cloud.pigx.admin.mapper;
-
-import com.pig4cloud.pigx.admin.api.entity.SysDeptRelation;
-import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- *
- * Mapper 接口
- *
- *
- * @author lengleng
- * @since 2018-02-12
- */
-@Mapper
-public interface SysDeptRelationMapper extends PigxBaseMapper {
-
- /**
- * 删除部门 > 删除所有关联此部门子节点的闭包关系
- * @param id 部门ID
- */
- void deleteDeptRelationsByDeptId(Long id);
-
- /**
- * 删除节点数据
- * @param deptRelation 关系节点
- */
- void deleteDeptRelations(SysDeptRelation deptRelation);
-
- /**
- * 新增节点数据
- * @param deptRelation 关系节点
- */
- void insertDeptRelations(SysDeptRelation deptRelation);
-
-}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysI18nMapper.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysI18nMapper.java
new file mode 100644
index 000000000..846ae3d13
--- /dev/null
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysI18nMapper.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.mapper;
+
+import com.pig4cloud.pigx.admin.api.entity.SysI18nEntity;
+import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 系统表-国际化
+ *
+ * @author PIG
+ * @date 2023-02-14 09:07:01
+ */
+@Mapper
+public interface SysI18nMapper extends PigxBaseMapper {
+
+}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysRouteConfMapper.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysRouteConfMapper.java
old mode 100755
new mode 100644
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysScheduleMapper.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysScheduleMapper.java
new file mode 100644
index 000000000..d81ceeec4
--- /dev/null
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysScheduleMapper.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.mapper;
+
+import com.pig4cloud.pigx.admin.api.entity.SysScheduleEntity;
+import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 日程
+ *
+ * @author aeizzz
+ * @date 2023-03-06 14:26:23
+ */
+@Mapper
+public interface SysScheduleMapper extends PigxBaseMapper {
+
+}
\ No newline at end of file
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysUserRoleMapper.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysUserRoleMapper.java
index 4080595c1..22d37d9f9 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysUserRoleMapper.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/mapper/SysUserRoleMapper.java
@@ -22,7 +22,6 @@ package com.pig4cloud.pigx.admin.mapper;
import com.pig4cloud.pigx.admin.api.entity.SysUserRole;
import com.pig4cloud.pigx.common.data.datascope.PigxBaseMapper;
import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
/**
*
@@ -35,13 +34,4 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public interface SysUserRoleMapper extends PigxBaseMapper {
- /**
- * 根据用户Id删除该用户的角色关系
- * @param userId 用户ID
- * @return boolean
- * @author 寻欢·李
- * @date 2017年12月7日 16:31:38
- */
- Boolean deleteByUserId(@Param("userId") Long userId);
-
}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysAuditLogService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysAuditLogService.java
index 3c387ad7a..93ee03f82 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysAuditLogService.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysAuditLogService.java
@@ -17,15 +17,24 @@
package com.pig4cloud.pigx.admin.service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.admin.api.entity.SysAuditLog;
/**
* 审计记录表
*
- * @author pigx code generator
- * @date 2023-02-27 22:33:30
+ * @author PIG
+ * @date 2023-02-28 20:12:23
*/
public interface SysAuditLogService extends IService {
+ /**
+ * 分页查询审计日志(数据权限处理)
+ * @param page 分页条件
+ * @param sysAuditLog 查询条件
+ * @return page
+ */
+ Page getAuditsByScope(Page page, SysAuditLog sysAuditLog);
+
}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysDeptRelationService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysDeptRelationService.java
deleted file mode 100644
index 4b65ea593..000000000
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysDeptRelationService.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- *
- */
-
-package com.pig4cloud.pigx.admin.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.pig4cloud.pigx.admin.api.entity.SysDept;
-import com.pig4cloud.pigx.admin.api.entity.SysDeptRelation;
-
-/**
- *
- * 服务类
- *
- *
- * @author lengleng
- * @since 2018-02-12
- */
-public interface SysDeptRelationService extends IService {
-
- /**
- * 新建部门关系
- * @param sysDept 部门
- */
- void insertDeptRelation(SysDept sysDept);
-
- /**
- * 通过ID删除部门关系
- * @param id
- */
- void deleteAllDeptRealtion(Long id);
-
- /**
- * 更新部门关系
- * @param relation
- */
- void updateDeptRealtion(SysDeptRelation relation);
-
-}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysDeptService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysDeptService.java
index 09c736c8d..80293f3a6 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysDeptService.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysDeptService.java
@@ -40,18 +40,11 @@ public interface SysDeptService extends IService {
/**
* 查询部门树菜单
- * @return 树
* @param deptName 部门名称
+ * @return 树
*/
List> selectTree(String deptName);
- /**
- * 添加信息部门
- * @param sysDept
- * @return
- */
- Boolean saveDept(SysDept sysDept);
-
/**
* 删除部门
* @param id 部门 ID
@@ -59,15 +52,15 @@ public interface SysDeptService extends IService {
*/
Boolean removeDeptById(Long id);
- /**
- * 更新部门
- * @param sysDept 部门信息
- * @return 成功、失败
- */
- Boolean updateDeptById(SysDept sysDept);
-
List listExcelVo();
R importDept(List excelVOList, BindingResult bindingResult);
+ /**
+ * 获取部门的所有后代部门列表
+ * @param deptId 部门ID
+ * @return 后代部门列表
+ */
+ List listDescendant(Long deptId);
+
}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysDictService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysDictService.java
index 654ed33af..265cebdf0 100755
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysDictService.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysDictService.java
@@ -30,10 +30,10 @@ public interface SysDictService extends IService {
/**
* 根据ID 删除字典
- * @param id
+ * @param ids ID列表
* @return
*/
- R removeDict(Long id);
+ R removeDictByIds(Long[] ids);
/**
* 更新字典
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysI18nService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysI18nService.java
new file mode 100644
index 000000000..e735b1aa7
--- /dev/null
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysI18nService.java
@@ -0,0 +1,20 @@
+package com.pig4cloud.pigx.admin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.pig4cloud.pigx.admin.api.entity.SysI18nEntity;
+import com.pig4cloud.pigx.admin.api.entity.SysLog;
+import com.pig4cloud.pigx.common.core.util.R;
+
+import java.util.Map;
+
+public interface SysI18nService extends IService {
+
+ Map listMap();
+
+ /**
+ * 同步数据
+ * @return R
+ */
+ R syncI18nCache();
+
+}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysMenuService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysMenuService.java
index deaeb6d2a..02de41df8 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysMenuService.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysMenuService.java
@@ -64,7 +64,7 @@ public interface SysMenuService extends IService {
* @param menuName 菜单名称
* @return
*/
- List> treeMenu(Long parentId, String menuName);
+ List> treeMenu(Long parentId, String menuName, String type);
/**
* 查询菜单
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysOauthClientDetailsService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysOauthClientDetailsService.java
index bf46c5152..f7fdad9a8 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysOauthClientDetailsService.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysOauthClientDetailsService.java
@@ -35,13 +35,6 @@ import com.pig4cloud.pigx.common.core.util.R;
*/
public interface SysOauthClientDetailsService extends IService {
- /**
- * 通过ID删除客户端
- * @param clientId
- * @return
- */
- Boolean removeByClientId(String clientId);
-
/**
* 根据客户端信息
* @param clientDetailsDTO
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysPublicParamService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysPublicParamService.java
index 64934d38f..a9117f77b 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysPublicParamService.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysPublicParamService.java
@@ -45,10 +45,10 @@ public interface SysPublicParamService extends IService {
/**
* 删除参数
- * @param publicId
+ * @param publicIds 参数列表
* @return
*/
- R removeParam(Long publicId);
+ R removeParamByIds(Long[] publicIds);
/**
* 同步缓存
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysRoleService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysRoleService.java
index 7f1055060..e0d30d7f0 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysRoleService.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysRoleService.java
@@ -55,10 +55,10 @@ public interface SysRoleService extends IService {
/**
* 通过角色ID,删除角色
- * @param id
+ * @param ids
* @return
*/
- Boolean removeRoleById(Long id);
+ Boolean removeRoleByIds(Long[] ids);
/**
* 根据角色菜单列表
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysRouteConfService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysRouteConfService.java
old mode 100755
new mode 100644
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysScheduleService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysScheduleService.java
new file mode 100644
index 000000000..860cdb334
--- /dev/null
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysScheduleService.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.admin.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.pig4cloud.pigx.admin.api.entity.SysScheduleEntity;
+
+import java.util.List;
+
+/**
+ * 日程
+ *
+ * @author aeizzz
+ * @date 2023-03-06 14:26:23
+ */
+public interface SysScheduleService extends IService {
+
+ IPage getScheduleByScope(Page page, SysScheduleEntity sysSchedule);
+
+ List selectListByScope(String month);
+
+}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysUserRoleService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysUserRoleService.java
index 3f932419e..5b3d23262 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysUserRoleService.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysUserRoleService.java
@@ -32,13 +32,4 @@ import com.pig4cloud.pigx.admin.api.entity.SysUserRole;
*/
public interface SysUserRoleService extends IService {
- /**
- * 根据用户Id删除该用户的角色关系
- * @param userId 用户ID
- * @return boolean
- * @author 寻欢·李
- * @date 2017年12月7日 16:31:38
- */
- Boolean deleteByUserId(Long userId);
-
}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysUserService.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysUserService.java
index 5f5a441a8..c37cb7c06 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysUserService.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/SysUserService.java
@@ -25,8 +25,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.admin.api.dto.UserDTO;
import com.pig4cloud.pigx.admin.api.dto.UserInfo;
import com.pig4cloud.pigx.admin.api.entity.SysUser;
-import com.pig4cloud.pigx.admin.api.vo.CpUserExcelVo;
-import com.pig4cloud.pigx.admin.api.vo.DingUserExcelVo;
import com.pig4cloud.pigx.admin.api.vo.UserExcelVO;
import com.pig4cloud.pigx.admin.api.vo.UserVO;
import com.pig4cloud.pigx.common.core.util.R;
@@ -57,10 +55,10 @@ public interface SysUserService extends IService {
/**
* 删除用户
- * @param sysUser 用户
+ * @param ids 用户
* @return boolean
*/
- Boolean deleteUserById(SysUser sysUser);
+ Boolean deleteUserByIds(Long[] ids);
/**
* 更新当前用户基本信息
@@ -74,7 +72,7 @@ public interface SysUserService extends IService {
* @param userDto 用户信息
* @return
*/
- R updateUser(UserDTO userDto);
+ Boolean updateUser(UserDTO userDto);
/**
* 通过ID查询用户信息
@@ -126,8 +124,10 @@ public interface SysUserService extends IService {
*/
R lockUser(String username);
- R importDingUser(List excelVOList, BindingResult bindingResult);
+ R changePassword(UserDTO userDto);
- R importCpUser(List excelVOList, BindingResult bindingResult);
+ R unbinding(String type);
+
+ R checkPassword(String password);
}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/ConnectServiceImpl.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/ConnectServiceImpl.java
index a821daee5..c15cfcb01 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/ConnectServiceImpl.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/ConnectServiceImpl.java
@@ -90,7 +90,7 @@ public class ConnectServiceImpl implements ConnectService {
// 保存部门以及部门关系
if (CollectionUtils.isNotEmpty(syncDept)) {
- syncDept.forEach(sysDeptService::saveDept);
+ syncDept.forEach(sysDeptService::save);
}
return Boolean.TRUE;
@@ -196,7 +196,7 @@ public class ConnectServiceImpl implements ConnectService {
sysDept.setParentId(dept.getParentId());
sysDept.setSortOrder(dept.getOrder().intValue());
return sysDept;
- }).forEach(sysDeptService::saveDept);
+ }).forEach(sysDeptService::save);
return R.ok();
}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysAuditLogServiceImpl.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysAuditLogServiceImpl.java
index 0fdcbfb9c..7634febab 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysAuditLogServiceImpl.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysAuditLogServiceImpl.java
@@ -16,19 +16,47 @@
*/
package com.pig4cloud.pigx.admin.service.impl;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pigx.admin.api.entity.SysAuditLog;
import com.pig4cloud.pigx.admin.mapper.SysAuditLogMapper;
import com.pig4cloud.pigx.admin.service.SysAuditLogService;
+import com.pig4cloud.pigx.common.data.datascope.DataScope;
+import com.pig4cloud.pigx.common.security.util.SecurityUtils;
import org.springframework.stereotype.Service;
/**
* 审计记录表
*
- * @author pigx code generator
- * @date 2023-02-27 22:33:30
+ * @author PIG
+ * @date 2023-02-28 20:12:23
*/
@Service
public class SysAuditLogServiceImpl extends ServiceImpl implements SysAuditLogService {
+ /**
+ * 分页查询审计日志(数据权限处理)
+ * @param page 分页条件
+ * @param sysAuditLog 查询条件
+ * @return page
+ */
+ @Override
+ public Page getAuditsByScope(Page page, SysAuditLog sysAuditLog) {
+ LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
+ wrapper.like(StrUtil.isNotBlank(sysAuditLog.getAuditName()), SysAuditLog::getAuditName,
+ sysAuditLog.getAuditName());
+ wrapper.like(StrUtil.isNotBlank(sysAuditLog.getAuditField()), SysAuditLog::getAuditField,
+ sysAuditLog.getAuditField());
+ wrapper.like(StrUtil.isNotBlank(sysAuditLog.getCreateBy()), SysAuditLog::getCreateBy,
+ sysAuditLog.getCreateBy());
+
+ // 数据权限限制,只查询本人的审计日志
+ DataScope dataScope = new DataScope();
+ dataScope.setUsername(SecurityUtils.getUser().getUsername());
+ return baseMapper.selectPageByScope(page, wrapper, dataScope);
+ }
+
}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysDeptRelationServiceImpl.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysDeptRelationServiceImpl.java
deleted file mode 100644
index 4fb0373ea..000000000
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysDeptRelationServiceImpl.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- *
- */
-
-package com.pig4cloud.pigx.admin.service.impl;
-
-import cn.hutool.core.collection.CollUtil;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.pig4cloud.pigx.admin.api.entity.SysDept;
-import com.pig4cloud.pigx.admin.api.entity.SysDeptRelation;
-import com.pig4cloud.pigx.admin.mapper.SysDeptRelationMapper;
-import com.pig4cloud.pigx.admin.service.SysDeptRelationService;
-import lombok.AllArgsConstructor;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- *
- * 服务实现类
- *
- *
- * @author lengleng
- * @since 2018-02-12
- */
-@Service
-@AllArgsConstructor
-public class SysDeptRelationServiceImpl extends ServiceImpl
- implements SysDeptRelationService {
-
- private final SysDeptRelationMapper sysDeptRelationMapper;
-
- /**
- * 维护部门关系
- * @param sysDept 部门
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void insertDeptRelation(SysDept sysDept) {
- // 增加部门关系表
- List relationList = sysDeptRelationMapper.selectList(
- Wrappers.query().lambda().eq(SysDeptRelation::getDescendant, sysDept.getParentId()))
- .stream().map(relation -> {
- relation.setDescendant(sysDept.getDeptId());
- return relation;
- }).collect(Collectors.toList());
- if (CollUtil.isNotEmpty(relationList)) {
- relationList.forEach(ele -> baseMapper.insert(ele));
- }
-
- // 自己也要维护到关系表中
- SysDeptRelation own = new SysDeptRelation();
- own.setDescendant(sysDept.getDeptId());
- own.setAncestor(sysDept.getDeptId());
- sysDeptRelationMapper.insert(own);
- }
-
- /**
- * 通过ID删除部门关系
- * @param id
- */
- @Override
- public void deleteAllDeptRealtion(Long id) {
- baseMapper.deleteDeptRelationsByDeptId(id);
- }
-
- /**
- * 更新部门关系
- * @param relation
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void updateDeptRealtion(SysDeptRelation relation) {
- baseMapper.deleteDeptRelations(relation);
- baseMapper.insertDeptRelations(relation);
- }
-
-}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysDeptServiceImpl.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysDeptServiceImpl.java
index 62e2be923..a50cfa679 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysDeptServiceImpl.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysDeptServiceImpl.java
@@ -27,10 +27,8 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pigx.admin.api.entity.SysDept;
-import com.pig4cloud.pigx.admin.api.entity.SysDeptRelation;
import com.pig4cloud.pigx.admin.api.vo.DeptExcelVo;
import com.pig4cloud.pigx.admin.mapper.SysDeptMapper;
-import com.pig4cloud.pigx.admin.service.SysDeptRelationService;
import com.pig4cloud.pigx.admin.service.SysDeptService;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.data.datascope.DataScope;
@@ -56,25 +54,8 @@ import java.util.stream.Collectors;
@AllArgsConstructor
public class SysDeptServiceImpl extends ServiceImpl implements SysDeptService {
- private final SysDeptRelationService sysDeptRelationService;
-
private final SysDeptMapper deptMapper;
- /**
- * 添加信息部门
- * @param dept 部门
- * @return
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public Boolean saveDept(SysDept dept) {
- SysDept sysDept = new SysDept();
- BeanUtils.copyProperties(dept, sysDept);
- this.save(sysDept);
- sysDeptRelationService.insertDeptRelation(sysDept);
- return Boolean.TRUE;
- }
-
/**
* 删除部门
* @param id 部门 ID
@@ -84,97 +65,17 @@ public class SysDeptServiceImpl extends ServiceImpl impl
@Transactional(rollbackFor = Exception.class)
public Boolean removeDeptById(Long id) {
// 级联删除部门
- List idList = sysDeptRelationService
- .list(Wrappers.query().lambda().eq(SysDeptRelation::getAncestor, id)).stream()
- .map(SysDeptRelation::getDescendant).collect(Collectors.toList());
+ List idList = baseMapper.listDescendant(id).stream().map(SysDept::getDeptId).collect(Collectors.toList());
- if (CollUtil.isNotEmpty(idList)) {
- this.removeByIds(idList);
- }
+ Optional.ofNullable(idList).filter(CollUtil::isNotEmpty).ifPresent(this::removeByIds);
- // 删除部门级联关系
- sysDeptRelationService.deleteAllDeptRealtion(id);
return Boolean.TRUE;
}
- /**
- * 更新部门
- * @param sysDept 部门信息
- * @return 成功、失败
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public Boolean updateDeptById(SysDept sysDept) {
- // 更新部门状态
- this.updateById(sysDept);
- // 更新部门关系
- SysDeptRelation relation = new SysDeptRelation();
- relation.setAncestor(sysDept.getParentId());
- relation.setDescendant(sysDept.getDeptId());
- sysDeptRelationService.updateDeptRealtion(relation);
- return Boolean.TRUE;
- }
-
- /**
- * 导出部门
- * @return
- */
- @Override
- public List listExcelVo() {
- List list = this.list();
- List deptExcelVos = list.stream().map(item -> {
- DeptExcelVo deptExcelVo = new DeptExcelVo();
- deptExcelVo.setName(item.getName());
- Optional first = this.list().stream().filter(it -> item.getParentId().equals(it.getDeptId()))
- .map(SysDept::getName).findFirst();
- deptExcelVo.setParentName(first.orElse("跟部门"));
- deptExcelVo.setSortOrder(item.getSortOrder());
- return deptExcelVo;
- }).collect(Collectors.toList());
- return deptExcelVos;
- }
-
- @Override
- public R importDept(List excelVOList, BindingResult bindingResult) {
- List errorMessageList = (List) bindingResult.getTarget();
-
- List deptList = this.list();
- for (DeptExcelVo item : excelVOList) {
- Set errorMsg = new HashSet<>();
- boolean exsitUsername = deptList.stream().anyMatch(sysDept -> item.getName().equals(sysDept.getName()));
- if (exsitUsername) {
- errorMsg.add("部门名称已经存在");
- }
- SysDept one = this.getOne(Wrappers.lambdaQuery().eq(SysDept::getName, item.getParentName()));
- if (item.getParentName().equals("跟部门")) {
- one = new SysDept();
- one.setDeptId(0L);
- }
- if (one == null) {
- errorMsg.add("上级部门不存在");
- }
- if (CollUtil.isEmpty(errorMsg)) {
- SysDept sysDept = new SysDept();
- sysDept.setName(item.getName());
- sysDept.setParentId(one.getDeptId());
- sysDept.setSortOrder(item.getSortOrder());
- this.saveDept(sysDept);
- }
- else {
- // 数据不合法情况
- errorMessageList.add(new ErrorMessage(item.getLineNum(), errorMsg));
- }
- }
- if (CollUtil.isNotEmpty(errorMessageList)) {
- return R.failed(errorMessageList);
- }
- return R.ok(null, "部门导入成功");
- }
-
/**
* 查询全部部门树
- * @return 树 部门名称
* @param deptName
+ * @return 树 部门名称
*/
@Override
public List> selectTree(String deptName) {
@@ -216,4 +117,70 @@ public class SysDeptServiceImpl extends ServiceImpl impl
return TreeUtil.build(collect, 0L);
}
+ /**
+ * 导出部门
+ * @return
+ */
+ @Override
+ public List listExcelVo() {
+ List list = this.list();
+ List deptExcelVos = list.stream().map(item -> {
+ DeptExcelVo deptExcelVo = new DeptExcelVo();
+ deptExcelVo.setName(item.getName());
+ Optional first = this.list().stream().filter(it -> item.getParentId().equals(it.getDeptId()))
+ .map(SysDept::getName).findFirst();
+ deptExcelVo.setParentName(first.orElse("根部门"));
+ deptExcelVo.setSortOrder(item.getSortOrder());
+ return deptExcelVo;
+ }).collect(Collectors.toList());
+ return deptExcelVos;
+ }
+
+ @Override
+ public R importDept(List excelVOList, BindingResult bindingResult) {
+ List errorMessageList = (List) bindingResult.getTarget();
+
+ List deptList = this.list();
+ for (DeptExcelVo item : excelVOList) {
+ Set errorMsg = new HashSet<>();
+ boolean exsitUsername = deptList.stream().anyMatch(sysDept -> item.getName().equals(sysDept.getName()));
+ if (exsitUsername) {
+ errorMsg.add("部门名称已经存在");
+ }
+ SysDept one = this.getOne(Wrappers.lambdaQuery().eq(SysDept::getName, item.getParentName()));
+ if (item.getParentName().equals("根部门")) {
+ one = new SysDept();
+ one.setDeptId(0L);
+ }
+ if (one == null) {
+ errorMsg.add("上级部门不存在");
+ }
+ if (CollUtil.isEmpty(errorMsg)) {
+ SysDept sysDept = new SysDept();
+ sysDept.setName(item.getName());
+ sysDept.setParentId(one.getDeptId());
+ sysDept.setSortOrder(item.getSortOrder());
+ baseMapper.insert(sysDept);
+ }
+ else {
+ // 数据不合法情况
+ errorMessageList.add(new ErrorMessage(item.getLineNum(), errorMsg));
+ }
+ }
+ if (CollUtil.isNotEmpty(errorMessageList)) {
+ return R.failed(errorMessageList);
+ }
+ return R.ok(null, "部门导入成功");
+ }
+
+ /**
+ * 获取部门的所有后代部门列表
+ * @param deptId 部门ID
+ * @return 后代部门列表
+ */
+ @Override
+ public List listDescendant(Long deptId) {
+ return baseMapper.listDescendant(deptId);
+ }
+
}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysDictServiceImpl.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysDictServiceImpl.java
index 1bff7aac1..c62e3912f 100755
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysDictServiceImpl.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysDictServiceImpl.java
@@ -16,6 +16,7 @@
*/
package com.pig4cloud.pigx.admin.service.impl;
+import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pigx.admin.api.entity.SysDict;
@@ -33,6 +34,9 @@ import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import java.util.List;
+import java.util.stream.Collectors;
+
/**
* 字典表
*
@@ -47,21 +51,21 @@ public class SysDictServiceImpl extends ServiceImpl impl
/**
* 根据ID 删除字典
- * @param id 字典ID
+ * @param ids 字典ID 列表
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
@CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true)
- public R removeDict(Long id) {
- SysDict dict = this.getById(id);
- // 系统内置
- if (DictTypeEnum.SYSTEM.getType().equals(dict.getSystemFlag())) {
- return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_DICT_DELETE_SYSTEM));
- }
+ public R removeDictByIds(Long[] ids) {
- baseMapper.deleteById(id);
- dictItemMapper.delete(Wrappers.lambdaQuery().eq(SysDictItem::getDictId, id));
+ List dictIdList = baseMapper.selectBatchIds(CollUtil.toList(ids)).stream()
+ .filter(sysDict -> !sysDict.getSystemFlag().equals(DictTypeEnum.SYSTEM.getType()))// 系统内置类型不删除
+ .map(SysDict::getId).collect(Collectors.toList());
+
+ baseMapper.deleteBatchIds(dictIdList);
+
+ dictItemMapper.delete(Wrappers.lambdaQuery().in(SysDictItem::getDictId, dictIdList));
return R.ok();
}
@@ -78,7 +82,8 @@ public class SysDictServiceImpl extends ServiceImpl impl
if (DictTypeEnum.SYSTEM.getType().equals(sysDict.getSystemFlag())) {
return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_DICT_UPDATE_SYSTEM));
}
- return R.ok(this.updateById(dict));
+ this.updateById(dict);
+ return R.ok(dict);
}
/**
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysFileServiceImpl.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysFileServiceImpl.java
index b68e85374..cd7a1e3cf 100644
--- a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysFileServiceImpl.java
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysFileServiceImpl.java
@@ -37,8 +37,10 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
+import java.util.Objects;
/**
* 文件管理
@@ -107,6 +109,9 @@ public class SysFileServiceImpl extends ServiceImpl impl
@Transactional(rollbackFor = Exception.class)
public Boolean deleteFile(Long id) {
SysFile file = this.getById(id);
+ if (Objects.isNull(file)) {
+ return Boolean.FALSE;
+ }
fileTemplate.removeObject(properties.getBucketName(), file.getFileName());
return this.removeById(id);
}
diff --git a/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysI18nServiceImpl.java b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysI18nServiceImpl.java
new file mode 100644
index 000000000..dd97a2457
--- /dev/null
+++ b/pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysI18nServiceImpl.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+package com.pig4cloud.pigx.admin.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pig4cloud.pigx.admin.api.entity.SysI18nEntity;
+import com.pig4cloud.pigx.admin.mapper.SysI18nMapper;
+import com.pig4cloud.pigx.admin.service.SysI18nService;
+import com.pig4cloud.pigx.common.core.constant.CacheConstants;
+import com.pig4cloud.pigx.common.core.util.R;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 系统表-国际化
+ *
+ * @author PIG
+ * @date 2023-02-14 09:07:01
+ */
+@Service
+public class SysI18nServiceImpl extends ServiceImpl implements SysI18nService {
+
+ /**
+ * 生成前段需要的i18n 格式内容
+ * @return
+ */
+ @Override
+ @Cacheable(value = CacheConstants.I18N_DETAILS)
+ public Map listMap() {
+ List sysI18nEntities = baseMapper.selectList(null);
+ HashMap>> stringListHashMap = new HashMap<>();
+ List