更新0811
This commit is contained in:
parent
b0bb97d65f
commit
ef6727ba08
@ -130,4 +130,7 @@ public class CompanyStaff extends TenantBaseDO {
|
|||||||
|
|
||||||
/** 附件的名称们,手动填写,逗号分隔,没有也要占位,和下面的urls对应 */
|
/** 附件的名称们,手动填写,逗号分隔,没有也要占位,和下面的urls对应 */
|
||||||
private String fileNames;
|
private String fileNames;
|
||||||
|
|
||||||
|
/** 文件夹id */
|
||||||
|
private String folderId;
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.staff.mapper;
|
|||||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
||||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
|
import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
|
||||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
|
import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -27,4 +28,13 @@ public interface CompanyStaffMapper extends BaseMapper<CompanyStaff> {
|
|||||||
* @return cn.iocoder.yudao.module.staff.entity.CompanyStaff
|
* @return cn.iocoder.yudao.module.staff.entity.CompanyStaff
|
||||||
**/
|
**/
|
||||||
CompanyStaffRespVO selectMyAdviser(@Param("tenantId") Long tenantId, @Param("userId") Long userId);
|
CompanyStaffRespVO selectMyAdviser(@Param("tenantId") Long tenantId, @Param("userId") Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 查询员工信息
|
||||||
|
* @param id id
|
||||||
|
* @return: cn.iocoder.yudao.module.system.api.user.dto.UserDTO
|
||||||
|
* @author 許
|
||||||
|
* @date: 2025/8/11 13:32
|
||||||
|
*/
|
||||||
|
UserDTO getStaff(Long id);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
|||||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
|
import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
|
||||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
|
import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
|
||||||
import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
|
import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -158,4 +159,12 @@ public interface CompanyStaffService extends IService<CompanyStaff> {
|
|||||||
**/
|
**/
|
||||||
void updateByExistUser(CompanyStaffRespVO staffRespVO);
|
void updateByExistUser(CompanyStaffRespVO staffRespVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 通过员工id查询员工信息
|
||||||
|
* @param: id
|
||||||
|
* @return: cn.iocoder.yudao.module.system.api.user.dto.UserDTO
|
||||||
|
* @author 許
|
||||||
|
* @date: 2025/8/11 13:24
|
||||||
|
*/
|
||||||
|
UserDTO getStaff(Long id);
|
||||||
}
|
}
|
||||||
|
@ -751,4 +751,17 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
|||||||
baseMapper.updateById(staffRespVO);
|
baseMapper.updateById(staffRespVO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id
|
||||||
|
* @description: 通过员工id查询员工信息
|
||||||
|
* @param: id
|
||||||
|
* @return: cn.iocoder.yudao.module.system.api.user.dto.UserDTO
|
||||||
|
* @author 許
|
||||||
|
* @date: 2025/8/11 13:24
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public UserDTO getStaff(Long id) {
|
||||||
|
return baseMapper.getStaff(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,4 +115,42 @@
|
|||||||
AND bcm.tenant_id = #{tenantId}
|
AND bcm.tenant_id = #{tenantId}
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getStaff" resultType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO"
|
||||||
|
parameterType="java.lang.Long">
|
||||||
|
SELECT
|
||||||
|
su.id,
|
||||||
|
su.username,
|
||||||
|
su.nickname,
|
||||||
|
su.user_type,
|
||||||
|
su.remark,
|
||||||
|
su.dept_id,
|
||||||
|
su.mobile,
|
||||||
|
su.password,
|
||||||
|
su.sex,
|
||||||
|
su.open_id,
|
||||||
|
su.tenant_id,
|
||||||
|
su.status,
|
||||||
|
su.avatar AS avatar,
|
||||||
|
dsc.folder_id AS folderId,
|
||||||
|
GROUP_CONCAT(DISTINCT sr2.name SEPARATOR ',') AS roleNames
|
||||||
|
FROM
|
||||||
|
system_users su
|
||||||
|
LEFT JOIN
|
||||||
|
system_user_role sr ON su.id = sr.user_id AND sr.deleted = 0
|
||||||
|
LEFT JOIN
|
||||||
|
system_role sr2 ON sr.role_id = sr2.id
|
||||||
|
INNER JOIN
|
||||||
|
company_staff dsc ON dsc.user_id = su.id
|
||||||
|
<where>
|
||||||
|
su.deleted = 0
|
||||||
|
AND sr2.service_package_id = 'weixiu' AND dsc.deleted = 0
|
||||||
|
<if test="userId != null">
|
||||||
|
AND su.id = #{userId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY
|
||||||
|
su.id
|
||||||
|
ORDER BY
|
||||||
|
su.nickname
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<version>4.1.0</version>
|
<version>4.1.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
|
@ -55,6 +55,11 @@ public class InspectionConstants {
|
|||||||
*/
|
*/
|
||||||
public static final String JY_DRIVER_STAFF_KEY = "jystaff";
|
public static final String JY_DRIVER_STAFF_KEY = "jystaff";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* key的类型为员工
|
||||||
|
*/
|
||||||
|
public static final String WX_DRIVER_STAFF_KEY = "wxstaff";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* key的类型为设备
|
* key的类型为设备
|
||||||
*/
|
*/
|
||||||
|
@ -16,6 +16,7 @@ public enum InspectionFileEnum {
|
|||||||
student("student","驾校学员文件夹"),
|
student("student","驾校学员文件夹"),
|
||||||
WX_EQUIPMENT("wx_equipment","维修设备文件夹"),
|
WX_EQUIPMENT("wx_equipment","维修设备文件夹"),
|
||||||
JY_EQUIPMENT("jy_equipment","救援设备文件夹"),
|
JY_EQUIPMENT("jy_equipment","救援设备文件夹"),
|
||||||
|
WX_STAFF("wxstaff", "维修员工文件夹"),
|
||||||
INSPECTION_CUSTOMER("small_inspection_member_folder", "检测客户资料夹"),
|
INSPECTION_CUSTOMER("small_inspection_member_folder", "检测客户资料夹"),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -116,6 +116,7 @@ public interface IInspectionFileService extends IService<InspectionFile> {
|
|||||||
Long addFolder(String folderName, String key);
|
Long addFolder(String folderName, String key);
|
||||||
Long addFolderForDevice(String folderName, String key, String servicePackageId);
|
Long addFolderForDevice(String folderName, String key, String servicePackageId);
|
||||||
Long addFolderForJx(String folderName, String key);
|
Long addFolderForJx(String folderName, String key);
|
||||||
|
Long addFolderForWx(String folderName, String key);
|
||||||
Long addFolderForJy(String folderName, String key);
|
Long addFolderForJy(String folderName, String key);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -572,6 +572,36 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper,
|
|||||||
return inspectionFile.getId();
|
return inspectionFile.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long addFolderForWx(String folderName, String key) {
|
||||||
|
//根据key找到对应的文件夹id
|
||||||
|
InspectionFile fatherFolder = baseMapper.selectOne(new LambdaQueryWrapper<InspectionFile>().eq(InspectionFile::getDefaultKey, key));
|
||||||
|
|
||||||
|
//如果默认文件夹为空就新建
|
||||||
|
if (fatherFolder == null) {
|
||||||
|
fatherFolder = new InspectionFile();
|
||||||
|
fatherFolder.setFileName(InspectionFileEnum.getDescByType(key));
|
||||||
|
fatherFolder.setType(InspectionConstants.INSPECTION_FOLDER);
|
||||||
|
fatherFolder.setDefaultKey(key);
|
||||||
|
fatherFolder.setServicePackageId("weixiu");
|
||||||
|
baseMapper.insert(fatherFolder);
|
||||||
|
fatherFolder.setFileCode(fatherFolder.getId() + ",");
|
||||||
|
baseMapper.updateById(fatherFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
InspectionFile inspectionFile = new InspectionFile();
|
||||||
|
inspectionFile.setFatherId(fatherFolder.getId());
|
||||||
|
inspectionFile.setFileName(folderName + InspectionConstants.INSPECTION_FOLDER_SUFFIX);
|
||||||
|
inspectionFile.setType(InspectionConstants.INSPECTION_FOLDER);
|
||||||
|
inspectionFile.setIsStaffFile(InspectionConstants.INSPECTION_IS_STAFF_FILE);
|
||||||
|
inspectionFile.setServicePackageId("weixiu");
|
||||||
|
baseMapper.insert(inspectionFile);
|
||||||
|
inspectionFile.setFileCode(inspectionFile.getId() + ",");
|
||||||
|
baseMapper.updateById(inspectionFile);
|
||||||
|
|
||||||
|
return inspectionFile.getId();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long addFolderForJy(String folderName, String key) {
|
public Long addFolderForJy(String folderName, String key) {
|
||||||
//根据key找到对应的文件夹id
|
//根据key找到对应的文件夹id
|
||||||
|
@ -41,6 +41,12 @@
|
|||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.boot</groupId>
|
||||||
|
<artifactId>dl-module-inspection</artifactId>
|
||||||
|
<version>2.1.0-jdk8-snapshot</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
@ -56,8 +56,8 @@ public class RepairStaffController {
|
|||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
public CommonResult<?> getRepairStaff(Long id) {
|
public CommonResult<?> getRepairStaff(Long id) {
|
||||||
// 查询信息
|
// 查询信息
|
||||||
AdminUserDO user = userService.getUser(id);
|
UserDTO staff = repairStaffService.getStaff(id);
|
||||||
if (user == null) {
|
if (staff == null) {
|
||||||
return CommonResult.error(400, "用户不存在");
|
return CommonResult.error(400, "用户不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ public class RepairStaffController {
|
|||||||
roleDOS = Collections.emptyList();
|
roleDOS = Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
RepairStaff repairStaff = BeanUtil.copyProperties(user, RepairStaff.class);
|
RepairStaff repairStaff = BeanUtil.copyProperties(staff, RepairStaff.class);
|
||||||
|
|
||||||
// 过滤出服务套餐为 weixiu 的
|
// 过滤出服务套餐为 weixiu 的
|
||||||
List<RoleDO> weixiuRoleDOS = roleDOS.stream()
|
List<RoleDO> weixiuRoleDOS = roleDOS.stream()
|
||||||
@ -91,7 +91,7 @@ public class RepairStaffController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/listSelectUser")
|
@GetMapping("/listSelectUser")
|
||||||
public CommonResult<?> listSelectUser(@Valid UserPageReqVO pageReqVO){
|
public CommonResult<?> listSelectUser(@Valid UserPageReqVO pageReqVO) {
|
||||||
// 查询目前所有的userId
|
// 查询目前所有的userId
|
||||||
RolePageReqVO role = new RolePageReqVO();
|
RolePageReqVO role = new RolePageReqVO();
|
||||||
role.setPageNo(1);
|
role.setPageNo(1);
|
||||||
@ -100,15 +100,28 @@ public class RepairStaffController {
|
|||||||
// 获取所有的userId
|
// 获取所有的userId
|
||||||
List<Long> ids = userDTOIPage.getRecords().stream().map(UserDTO::getId).collect(Collectors.toList());
|
List<Long> ids = userDTOIPage.getRecords().stream().map(UserDTO::getId).collect(Collectors.toList());
|
||||||
pageReqVO.setUserIds(ids);
|
pageReqVO.setUserIds(ids);
|
||||||
|
pageReqVO.setUserType("01");
|
||||||
// 获得用户分页列表
|
// 获得用户分页列表
|
||||||
PageResult<AdminUserDO> pageResult = userService.getUserPage(pageReqVO);
|
PageResult<AdminUserDO> pageResult = userService.getUserPage(pageReqVO);
|
||||||
return success(new PageResult<>(pageResult.getList(), pageResult.getTotal()));
|
return success(new PageResult<>(pageResult.getList(), pageResult.getTotal()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/deleteStaff")
|
@DeleteMapping("/deleteStaff")
|
||||||
public CommonResult<?> deleteStaff(Long id) {
|
public CommonResult<?> deleteStaff(@RequestBody List<Long> ids) {
|
||||||
repairStaffService.deleteStaff(id);
|
repairStaffService.deleteStaff(ids);
|
||||||
return CommonResult.ok();
|
return CommonResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 员工新增文件夹
|
||||||
|
* @param: userId 员工id
|
||||||
|
* @return: cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||||
|
* @author 許
|
||||||
|
* @date: 2025/8/11 11:50
|
||||||
|
*/
|
||||||
|
@PostMapping("/addFolder")
|
||||||
|
public CommonResult<?> addFolder(@RequestBody Long userId) {
|
||||||
|
return success(repairStaffService.addFolder(userId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -55,4 +55,9 @@ public class RepairStaff {
|
|||||||
*/
|
*/
|
||||||
private String roleNames;
|
private String roleNames;
|
||||||
List<RoleDO> roles;
|
List<RoleDO> roles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件夹id
|
||||||
|
*/
|
||||||
|
private String folderId;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,9 @@ package cn.iocoder.yudao.module.base.service;
|
|||||||
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.base.entity.RepairStaffSaveVo;
|
import cn.iocoder.yudao.module.base.entity.RepairStaffSaveVo;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface RepairStaffService {
|
public interface RepairStaffService {
|
||||||
/**
|
/**
|
||||||
@ -12,8 +15,29 @@ public interface RepairStaffService {
|
|||||||
public void addStaff(RepairStaffSaveVo repairStaff);
|
public void addStaff(RepairStaffSaveVo repairStaff);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除员工
|
* @description: 删除员工
|
||||||
* @param id
|
* @param ids
|
||||||
|
* @return: void
|
||||||
|
* @author 許
|
||||||
|
* @date: 2025/8/11 14:06
|
||||||
*/
|
*/
|
||||||
void deleteStaff(Long id);
|
void deleteStaff(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 员工新增文件夹
|
||||||
|
* @param: userId
|
||||||
|
* @return: java.lang.Long
|
||||||
|
* @author 許
|
||||||
|
* @date: 2025/8/11 11:51
|
||||||
|
*/
|
||||||
|
Long addFolder(Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 查询员工信息
|
||||||
|
* @param id
|
||||||
|
* @return: cn.iocoder.yudao.module.system.api.user.dto.UserDTO
|
||||||
|
* @author 許
|
||||||
|
* @date: 2025/8/11 13:22
|
||||||
|
*/
|
||||||
|
UserDTO getStaff(Long id);
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@ import cn.iocoder.yudao.common.SystemEnum;
|
|||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.module.base.entity.RepairStaffSaveVo;
|
import cn.iocoder.yudao.module.base.entity.RepairStaffSaveVo;
|
||||||
import cn.iocoder.yudao.module.base.service.RepairStaffService;
|
import cn.iocoder.yudao.module.base.service.RepairStaffService;
|
||||||
|
import cn.iocoder.yudao.module.constant.InspectionConstants;
|
||||||
|
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
||||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
||||||
import cn.iocoder.yudao.module.staff.service.CompanyStaffService;
|
import cn.iocoder.yudao.module.staff.service.CompanyStaffService;
|
||||||
import cn.iocoder.yudao.module.staff.service.UniqueCodeService;
|
import cn.iocoder.yudao.module.staff.service.UniqueCodeService;
|
||||||
@ -16,12 +18,15 @@ import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
|||||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -33,6 +38,7 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
|
|||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
public class RepairStaffServiceImpl implements RepairStaffService {
|
public class RepairStaffServiceImpl implements RepairStaffService {
|
||||||
|
|
||||||
private final AdminUserService userService;
|
private final AdminUserService userService;
|
||||||
@ -49,6 +55,8 @@ public class RepairStaffServiceImpl implements RepairStaffService {
|
|||||||
|
|
||||||
private final UniqueCodeService uniqueCodeService;
|
private final UniqueCodeService uniqueCodeService;
|
||||||
|
|
||||||
|
private final IInspectionFileService inspectionFileService;
|
||||||
|
|
||||||
public void addStaff(RepairStaffSaveVo repairStaff) {
|
public void addStaff(RepairStaffSaveVo repairStaff) {
|
||||||
// 获取当前登录用户的详细信息
|
// 获取当前登录用户的详细信息
|
||||||
AdminUserRespDTO loginUser = getLoginUser();
|
AdminUserRespDTO loginUser = getLoginUser();
|
||||||
@ -104,9 +112,46 @@ public class RepairStaffServiceImpl implements RepairStaffService {
|
|||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteStaff(Long id) {
|
public void deleteStaff(List<Long> ids) {
|
||||||
boolean remove = companyStaffService.remove(Wrappers.<CompanyStaff>lambdaQuery()
|
boolean remove = companyStaffService.remove(Wrappers.<CompanyStaff>lambdaQuery()
|
||||||
.eq(CompanyStaff::getUserId, id));
|
.in(CompanyStaff::getUserId, ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param userId
|
||||||
|
* @description: 员工新增文件夹
|
||||||
|
* @param: userId
|
||||||
|
* @return: java.lang.Long
|
||||||
|
* @author 許
|
||||||
|
* @date: 2025/8/11 11:51
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public Long addFolder(Long userId) {
|
||||||
|
AdminUserDO user = userService.getUser(userId);
|
||||||
|
if (ObjectUtil.isNotEmpty(user)) {
|
||||||
|
Long folderId = inspectionFileService.addFolderForWx(user.getNickname(), InspectionConstants.WX_DRIVER_STAFF_KEY);
|
||||||
|
|
||||||
|
//修改文件夹id
|
||||||
|
companyStaffService.update(Wrappers.<CompanyStaff>lambdaUpdate().eq(CompanyStaff::getUserId, userId).set(CompanyStaff::getFolderId, folderId));
|
||||||
|
|
||||||
|
return folderId;
|
||||||
|
} else {
|
||||||
|
log.error("用户不存在");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id
|
||||||
|
* @description: 查询员工信息
|
||||||
|
* @return: cn.iocoder.yudao.module.system.api.user.dto.UserDTO
|
||||||
|
* @author 許
|
||||||
|
* @date: 2025/8/11 13:22
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public UserDTO getStaff(Long id) {
|
||||||
|
return companyStaffService.getStaff(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,4 +63,9 @@ public class UserDTO {
|
|||||||
*/
|
*/
|
||||||
private String roleNames;
|
private String roleNames;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件夹id
|
||||||
|
*/
|
||||||
|
private String folderId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,4 +45,6 @@ public class UserPageReqVO extends PageParam {
|
|||||||
@Schema(description = "用户编号列表", example = "1024")
|
@Schema(description = "用户编号列表", example = "1024")
|
||||||
private List<Long> userIds;
|
private List<Long> userIds;
|
||||||
|
|
||||||
|
private String userType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
|||||||
.notIn(CollUtil.isNotEmpty(reqVO.getUserIds()), AdminUserDO::getId, reqVO.getUserIds())
|
.notIn(CollUtil.isNotEmpty(reqVO.getUserIds()), AdminUserDO::getId, reqVO.getUserIds())
|
||||||
// 这里加了个模糊查询,用户名称搜索时可以模糊查用户昵称
|
// 这里加了个模糊查询,用户名称搜索时可以模糊查用户昵称
|
||||||
.likeIfPresent(AdminUserDO::getNickname, reqVO.getUsername())
|
.likeIfPresent(AdminUserDO::getNickname, reqVO.getUsername())
|
||||||
|
.eq(ObjectUtil.isNotEmpty(reqVO.getUserType()),AdminUserDO::getUserType, reqVO.getUserType())
|
||||||
.eqIfPresent(AdminUserDO::getStatus, reqVO.getStatus())
|
.eqIfPresent(AdminUserDO::getStatus, reqVO.getStatus())
|
||||||
.betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.inIfPresent(AdminUserDO::getDeptId, deptIds)
|
.inIfPresent(AdminUserDO::getDeptId, deptIds)
|
||||||
|
@ -103,7 +103,7 @@ public class PermissionServiceImpl implements PermissionService {
|
|||||||
/**
|
/**
|
||||||
* 判断指定角色,是否拥有该 permission 权限
|
* 判断指定角色,是否拥有该 permission 权限
|
||||||
*
|
*
|
||||||
* @param roles 指定角色数组
|
* @param roles 指定角色数组
|
||||||
* @param permission 权限标识
|
* @param permission 权限标识
|
||||||
* @return 是否拥有
|
* @return 是否拥有
|
||||||
*/
|
*/
|
||||||
@ -259,8 +259,8 @@ public class PermissionServiceImpl implements PermissionService {
|
|||||||
//根据角色code查出对应的角色列表
|
//根据角色code查出对应的角色列表
|
||||||
List<RoleDO> roleDOList = roleService.getRoleListByCodesTenant(roleCodes);
|
List<RoleDO> roleDOList = roleService.getRoleListByCodesTenant(roleCodes);
|
||||||
Set<Long> roleIds = new HashSet<>();
|
Set<Long> roleIds = new HashSet<>();
|
||||||
roleDOList.forEach(item->roleIds.add(item.getId()));
|
roleDOList.forEach(item -> roleIds.add(item.getId()));
|
||||||
this.assignUserRole(userId,roleIds);
|
this.assignUserRole(userId, roleIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -381,22 +381,25 @@ public class PermissionServiceImpl implements PermissionService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据权限ID拿拥有该权限的所有人
|
* 根据权限ID拿拥有该权限的所有人
|
||||||
|
*
|
||||||
|
* @param roleId 权限ID
|
||||||
* @author 小李
|
* @author 小李
|
||||||
* @date 10:25 2024/8/26
|
* @date 10:25 2024/8/26
|
||||||
* @param roleId 权限ID
|
|
||||||
**/
|
**/
|
||||||
public List<Long> getUserIdByRoleId(Long roleId){
|
public List<Long> getUserIdByRoleId(Long roleId) {
|
||||||
List<UserRoleDO> userRoleDOS = userRoleMapper.selectList(new LambdaQueryWrapperX<UserRoleDO>().eq(UserRoleDO::getRoleId, roleId));
|
List<UserRoleDO> userRoleDOS = userRoleMapper.selectList(new LambdaQueryWrapperX<UserRoleDO>().eq(UserRoleDO::getRoleId, roleId));
|
||||||
List<Long> userIds = userRoleDOS.stream().map(item -> item.getUserId()).collect(Collectors.toList());
|
List<Long> userIds = userRoleDOS.stream().map(item -> item.getUserId()).collect(Collectors.toList());
|
||||||
return userIds;
|
return userIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 赋予用户角色
|
* @param userId 用户ID
|
||||||
*
|
* @param roleIds 角色ID
|
||||||
* @param userId
|
* @param servicePackageId 服务包ID
|
||||||
* @param roleIds
|
* @description: 赋予用户角色-根据服务id
|
||||||
* @param servicePackageId
|
* @return: void
|
||||||
|
* @author 許
|
||||||
|
* @date: 2025/8/11 16:26
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void assignUserRoleByServicePackageId(Long userId, Set<Long> roleIds, String servicePackageId) {
|
public void assignUserRoleByServicePackageId(Long userId, Set<Long> roleIds, String servicePackageId) {
|
||||||
|
@ -134,13 +134,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
su.tenant_id,
|
su.tenant_id,
|
||||||
su.status,
|
su.status,
|
||||||
su.avatar AS avatar,
|
su.avatar AS avatar,
|
||||||
|
dsc.folder_id AS folderId,
|
||||||
GROUP_CONCAT(DISTINCT sr2.name SEPARATOR ',') AS roleNames
|
GROUP_CONCAT(DISTINCT sr2.name SEPARATOR ',') AS roleNames
|
||||||
from system_users su
|
from system_users su
|
||||||
left join system_user_role sr on su.id = sr.user_id and sr.deleted = 0
|
left join system_user_role sr on su.id = sr.user_id and sr.deleted = 0
|
||||||
left join system_role sr2 on sr.role_id = sr2.id
|
left join system_role sr2 on sr.role_id = sr2.id
|
||||||
INNER JOIN company_staff dsc ON dsc.user_id = su.id
|
INNER JOIN company_staff dsc ON dsc.user_id = su.id
|
||||||
<where>
|
<where>
|
||||||
su.deleted = 0 and sr2.service_package_id = 'weixiu'
|
su.deleted = 0 and sr2.service_package_id = 'weixiu' and dsc.deleted = 0
|
||||||
|
|
||||||
<if test="role.nickname != null">
|
<if test="role.nickname != null">
|
||||||
and (su.nickname like CONCAT('%',#{role.nickname},'%') OR su.username like
|
and (su.nickname like CONCAT('%',#{role.nickname},'%') OR su.username like
|
||||||
@ -256,6 +257,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
SELECT sur.*
|
SELECT sur.*
|
||||||
FROM system_user_role sur
|
FROM system_user_role sur
|
||||||
LEFT JOIN system_role sr ON sur.role_id = sr.id
|
LEFT JOIN system_role sr ON sur.role_id = sr.id
|
||||||
WHERE sur.user_id = #{userId} AND sr.service_package_id = #{servicePackageId}
|
WHERE sur.user_id = #{userId} AND sr.service_package_id = #{servicePackageId} AND sur.deleted = 0 AND sr.deleted = 0
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user