备份
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
package com.ruoyi.oa.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.ruoyi.oa.domain.vo.FileUser;
|
||||
import com.ruoyi.oa.domain.vo.UserFilesVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.oa.domain.vo.EmployeeFilesVo;
|
||||
import com.ruoyi.oa.domain.bo.EmployeeFilesBo;
|
||||
import com.ruoyi.oa.service.IEmployeeFilesService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 文件档案管理
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-03-08
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/files")
|
||||
public class EmployeeFilesController extends BaseController {
|
||||
|
||||
private final IEmployeeFilesService iEmployeeFilesService;
|
||||
|
||||
/**
|
||||
* 查询文件档案管理列表
|
||||
*/
|
||||
@SaCheckPermission("oa:files:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<FileUser> list(EmployeeFilesBo bo, PageQuery pageQuery) {
|
||||
return iEmployeeFilesService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件档案管理详细信息
|
||||
*
|
||||
* @param userId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa:files:query")
|
||||
@GetMapping("/{userId}")
|
||||
public R<UserFilesVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("userId") Long userId) {
|
||||
return R.ok(iEmployeeFilesService.queryUserFilesVoByUserId(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件档案管理
|
||||
*/
|
||||
@SaCheckPermission("oa:files:add")
|
||||
@Log(title = "文件档案管理", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody UserFilesVo filesVo) {
|
||||
return toAjax(iEmployeeFilesService.insertByBo(filesVo));
|
||||
}
|
||||
}
|
||||
@@ -63,13 +63,13 @@ public class EmployeeOnboardingController extends BaseController {
|
||||
/**
|
||||
* 获取入职管理详细信息
|
||||
*
|
||||
* @param onboardingId 主键
|
||||
* @param userId 主键
|
||||
*/
|
||||
@SaCheckPermission("system:onboarding:query")
|
||||
@GetMapping("/{onboardingId}")
|
||||
@GetMapping("/{userId}")
|
||||
public R<EmployeeOnboardingVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long onboardingId) {
|
||||
return R.ok(iEmployeeOnboardingService.queryById(onboardingId));
|
||||
@PathVariable Long userId) {
|
||||
return R.ok(iEmployeeOnboardingService.queryByUserId(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.ruoyi.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 文件档案管理对象 employee_files
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-03-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("employee_files")
|
||||
public class EmployeeFiles extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
@TableId(value = "file_id")
|
||||
private Long fileId;
|
||||
/**
|
||||
* 用户ID (外键)
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 文件类型(hukou,id_card,bank_card,honor_certificate,education_proof)
|
||||
*/
|
||||
private Long fileType;
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
/**
|
||||
* 文件存储路径
|
||||
*/
|
||||
private String filePath;
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
private Date uploadTime;
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -99,4 +99,6 @@ public class EmployeeOnboarding extends BaseEntity {
|
||||
* 紧急联系人2
|
||||
*/
|
||||
private String emergencyContact2;
|
||||
|
||||
private Long status;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.oa.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 文件档案管理业务对象 employee_files
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-03-08
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class EmployeeFilesBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 用户ID (外键)
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
private Long fileType;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件存储路径
|
||||
*/
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date uploadTime;
|
||||
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
|
||||
}
|
||||
@@ -113,4 +113,7 @@ public class EmployeeOnboardingBo extends BaseEntity {
|
||||
|
||||
private String address;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private Long status;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.ruoyi.oa.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 文件档案管理视图对象 employee_files
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-03-08
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class EmployeeFilesVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 用户ID (外键)
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 文件类型(hukou,id_card,bank_card,honor_certificate,education_proof)
|
||||
*/
|
||||
private Long fileType;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件存储路径
|
||||
*/
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
private Date uploadTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -148,5 +148,12 @@ public class EmployeeOnboardingVo extends EmployeeOnboarding {
|
||||
/** 银行卡号 */
|
||||
private String bankCard;
|
||||
|
||||
/** 至今工作时间 */
|
||||
private Long workTime;
|
||||
|
||||
/** 是否转正 */
|
||||
private Long confirmStatus;
|
||||
|
||||
|
||||
private Long status;
|
||||
}
|
||||
|
||||
31
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/vo/FileUser.java
Normal file
31
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/vo/FileUser.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.oa.domain.vo;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class FileUser extends SysUser {
|
||||
|
||||
/**
|
||||
* 入职日期
|
||||
*/
|
||||
private Date joiningDate;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* userId
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 文件数
|
||||
*/
|
||||
private Long fileTotal;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.oa.domain.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class UserFilesVo {
|
||||
|
||||
private Long userId;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private String phonenumber;
|
||||
|
||||
private List<EmployeeFilesVo> fileList;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.oa.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.oa.domain.EmployeeFiles;
|
||||
import com.ruoyi.oa.domain.OaSalary;
|
||||
import com.ruoyi.oa.domain.vo.EmployeeFilesVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.oa.domain.vo.FileUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 文件档案管理Mapper接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-03-08
|
||||
*/
|
||||
public interface EmployeeFilesMapper extends BaseMapperPlus<EmployeeFilesMapper, EmployeeFiles, EmployeeFilesVo> {
|
||||
|
||||
Page<FileUser> selectFileUserVoPage(Page<Object> build,@Param(Constants.WRAPPER) Wrapper<SysUser> userLambdaQueryWrapper);
|
||||
|
||||
void deleteByUserId(Long userId);
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
package com.ruoyi.oa.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.oa.domain.EmployeeOnboarding;
|
||||
import com.ruoyi.oa.domain.vo.EmployeeOnboardingVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 入职管理Mapper接口
|
||||
@@ -14,4 +19,8 @@ import com.ruoyi.oa.domain.vo.EmployeeOnboardingVo;
|
||||
public interface EmployeeOnboardingMapper extends BaseMapperPlus<EmployeeOnboardingMapper, EmployeeOnboarding, EmployeeOnboardingVo> {
|
||||
|
||||
Boolean updateByUserId(EmployeeOnboarding update);
|
||||
|
||||
Page<EmployeeOnboardingVo> selectVoPagePlus(Page<Object> build,@Param(Constants.WRAPPER) Wrapper<EmployeeOnboarding> lqw);
|
||||
|
||||
EmployeeOnboardingVo selectVoByUserId(Long userId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.vo.EmployeeFilesVo;
|
||||
import com.ruoyi.oa.domain.bo.EmployeeFilesBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.oa.domain.vo.FileUser;
|
||||
import com.ruoyi.oa.domain.vo.UserFilesVo;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件档案管理Service接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-03-08
|
||||
*/
|
||||
public interface IEmployeeFilesService {
|
||||
|
||||
/**
|
||||
* 查询文件档案管理
|
||||
*/
|
||||
EmployeeFilesVo queryById(Long fileId);
|
||||
|
||||
/**
|
||||
* 查询文件档案管理列表
|
||||
*/
|
||||
TableDataInfo<FileUser> queryPageList(EmployeeFilesBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询文件档案管理列表
|
||||
*/
|
||||
List<EmployeeFilesVo> queryList(EmployeeFilesBo bo);
|
||||
|
||||
/**
|
||||
* 新增文件档案管理
|
||||
*/
|
||||
Boolean insertByBo(UserFilesVo userFilesVo);
|
||||
|
||||
/**
|
||||
* 修改文件档案管理
|
||||
*/
|
||||
Boolean updateByBo(EmployeeFilesBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除文件档案管理信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 查询此用户的大概信息和文件列表
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
UserFilesVo queryUserFilesVoByUserId(@NotNull(message = "主键不能为空") Long userId);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.oa.domain.bo.EmployeeOnboardingBo;
|
||||
import com.ruoyi.oa.domain.vo.EmployeeOnboardingVo;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -46,4 +47,11 @@ public interface IEmployeeOnboardingService {
|
||||
* 校验并批量删除入职管理信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 查询入职信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
EmployeeOnboardingVo queryByUserId(@NotNull(message = "主键不能为空") Long userId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.oa.domain.vo.FileUser;
|
||||
import com.ruoyi.oa.domain.vo.UserFilesVo;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import liquibase.pro.packaged.A;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.EmployeeFilesBo;
|
||||
import com.ruoyi.oa.domain.vo.EmployeeFilesVo;
|
||||
import com.ruoyi.oa.domain.EmployeeFiles;
|
||||
import com.ruoyi.oa.mapper.EmployeeFilesMapper;
|
||||
import com.ruoyi.oa.service.IEmployeeFilesService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 文件档案管理Service业务层处理
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-03-08
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class EmployeeFilesServiceImpl implements IEmployeeFilesService {
|
||||
|
||||
private final EmployeeFilesMapper baseMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
/**
|
||||
* 查询文件档案管理
|
||||
*/
|
||||
@Override
|
||||
public EmployeeFilesVo queryById(Long fileId){
|
||||
return baseMapper.selectVoById(fileId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文件档案管理列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<FileUser> queryPageList(EmployeeFilesBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysUser> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
userLambdaQueryWrapper.like(bo.getNickName() != null, SysUser::getNickName, bo.getNickName());
|
||||
Page<FileUser> result = baseMapper.selectFileUserVoPage(pageQuery.build(), userLambdaQueryWrapper);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文件档案管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<EmployeeFilesVo> queryList(EmployeeFilesBo bo) {
|
||||
LambdaQueryWrapper<EmployeeFiles> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<EmployeeFiles> buildQueryWrapper(EmployeeFilesBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<EmployeeFiles> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getUserId() != null, EmployeeFiles::getUserId, bo.getUserId());
|
||||
lqw.eq(bo.getFileType() != null, EmployeeFiles::getFileType, bo.getFileType());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFileName()), EmployeeFiles::getFileName, bo.getFileName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFilePath()), EmployeeFiles::getFilePath, bo.getFilePath());
|
||||
lqw.eq(bo.getUploadTime() != null, EmployeeFiles::getUploadTime, bo.getUploadTime());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件档案管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(UserFilesVo userFilesVo) {
|
||||
// 删除该用户所有的文件,重新填入
|
||||
baseMapper.deleteByUserId(userFilesVo.getUserId());
|
||||
List<EmployeeFilesVo> fileList = userFilesVo.getFileList();
|
||||
fileList.forEach(file -> {
|
||||
EmployeeFiles employeeFiles = BeanUtil.toBean(file, EmployeeFiles.class);
|
||||
employeeFiles.setUserId(userFilesVo.getUserId());
|
||||
baseMapper.insert(employeeFiles);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文件档案管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(EmployeeFilesBo bo) {
|
||||
EmployeeFiles update = BeanUtil.toBean(bo, EmployeeFiles.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(EmployeeFiles entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文件档案管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserFilesVo queryUserFilesVoByUserId(Long userId) {
|
||||
UserFilesVo userFilesVo = new UserFilesVo();
|
||||
SysUser sysUser = userService.selectUserById(userId);
|
||||
userFilesVo.setUserId(sysUser.getUserId());
|
||||
userFilesVo.setNickName(sysUser.getNickName());
|
||||
userFilesVo.setPhonenumber(sysUser.getPhonenumber());
|
||||
EmployeeFilesBo employeeFilesBo = new EmployeeFilesBo();
|
||||
employeeFilesBo.setUserId(userId);
|
||||
LambdaQueryWrapper<EmployeeFiles> employeeFilesLambdaQueryWrapper = buildQueryWrapper(employeeFilesBo);
|
||||
List<EmployeeFilesVo> list = baseMapper.selectVoList(employeeFilesLambdaQueryWrapper);
|
||||
userFilesVo.setFileList(list);
|
||||
return userFilesVo;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@@ -60,12 +61,8 @@ public class EmployeeOnboardingServiceImpl implements IEmployeeOnboardingService
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<EmployeeOnboardingVo> queryPageList(EmployeeOnboardingBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<EmployeeOnboarding> lqw = buildQueryWrapper(bo);
|
||||
Page<EmployeeOnboardingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
result.getRecords().forEach(employeeOnboardingVo -> {
|
||||
SysUser sysUser = userService.selectUserByIdAndNotDelFlag(employeeOnboardingVo.getUserId());
|
||||
employeeOnboardingVo.setNickName(sysUser.getNickName());
|
||||
});
|
||||
QueryWrapper<EmployeeOnboarding> lqw = buildQueryWrapper(bo);
|
||||
Page<EmployeeOnboardingVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@@ -74,16 +71,16 @@ public class EmployeeOnboardingServiceImpl implements IEmployeeOnboardingService
|
||||
*/
|
||||
@Override
|
||||
public List<EmployeeOnboardingVo> queryList(EmployeeOnboardingBo bo) {
|
||||
LambdaQueryWrapper<EmployeeOnboarding> lqw = buildQueryWrapper(bo);
|
||||
QueryWrapper<EmployeeOnboarding> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<EmployeeOnboarding> buildQueryWrapper(EmployeeOnboardingBo bo) {
|
||||
private QueryWrapper<EmployeeOnboarding> buildQueryWrapper(EmployeeOnboardingBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<EmployeeOnboarding> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getUserId() != null, EmployeeOnboarding::getUserId, bo.getUserId());
|
||||
lqw.eq(bo.getJoiningDate() != null, EmployeeOnboarding::getJoiningDate, bo.getJoiningDate());
|
||||
lqw.eq(bo.getManagerId() != null, EmployeeOnboarding::getManagerId, bo.getManagerId());
|
||||
QueryWrapper<EmployeeOnboarding> lqw =new QueryWrapper<EmployeeOnboarding>();
|
||||
lqw.eq(bo.getUserId() != null, "eo.user_id", bo.getUserId());
|
||||
lqw.eq(bo.getJoiningDate() != null, "eo.joining_date", bo.getJoiningDate());
|
||||
lqw.like(bo.getNickName()!=null,"su.nick_name",bo.getNickName());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -129,4 +126,10 @@ public class EmployeeOnboardingServiceImpl implements IEmployeeOnboardingService
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmployeeOnboardingVo queryByUserId(Long userId) {
|
||||
|
||||
return baseMapper.selectVoById(userId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.oa.mapper.EmployeeFilesMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.oa.domain.EmployeeFiles" id="EmployeeFilesResult">
|
||||
<result property="fileId" column="file_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="fileType" column="file_type"/>
|
||||
<result property="fileName" column="file_name"/>
|
||||
<result property="filePath" column="file_path"/>
|
||||
<result property="uploadTime" column="upload_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteByUserId" parameterType="Long">
|
||||
delete from employee_files where user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="selectFileUserVoPage" resultType="com.ruoyi.oa.domain.vo.FileUser">
|
||||
select su.user_id,su.nick_name,joining_date,count(file_id) AS fileTotal from sys_user su
|
||||
left join employee_onboarding eo on su.user_id = eo.user_id
|
||||
left join fad_oa.employee_files ef on su.user_id = ef.user_id AND ef.del_flag = '0'
|
||||
${ew.getCustomSqlSegment}
|
||||
GROUP BY
|
||||
su.user_id,
|
||||
su.nick_name,
|
||||
eo.joining_date
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.oa.mapper.EmployeeOnboardingMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.oa.domain.EmployeeOnboarding" id="EmployeeOnboardingResult">
|
||||
@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="weight" column="weight"/>
|
||||
<result property="emergencyContact1" column="emergency_contact1"/>
|
||||
<result property="emergencyContact2" column="emergency_contact2"/>
|
||||
<result property="status" column="status"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -42,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="birthDate != null and birthDate != ''">birth_date = #{birthDate},</if>
|
||||
<if test="ethnicity != null and ethnicity != ''">ethnicity = #{ethnicity},</if>
|
||||
<if test="confirmDate != null and confirmDate != ''">confirm_date = #{confirmDate},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="maritalStatus != null and maritalStatus != ''">marital_status = #{maritalStatus},</if>
|
||||
<if test="politicalStatus != null and politicalStatus != ''">political_status = #{politicalStatus},</if>
|
||||
<if test="height != null and height != ''">height = #{height},</if>
|
||||
@@ -52,5 +54,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<select id="selectVoPagePlus" resultType="com.ruoyi.oa.domain.vo.EmployeeOnboardingVo">
|
||||
SELECT
|
||||
eo.user_id,
|
||||
su.nick_name,
|
||||
eo.joining_date,
|
||||
DATEDIFF(CURDATE(), eo.joining_date) AS workTime,
|
||||
eo.confirm_date,
|
||||
highest_degree,
|
||||
eo.remark,
|
||||
eo.birth_date,
|
||||
eo.status,
|
||||
CASE
|
||||
WHEN eo.confirm_date IS NULL THEN 0
|
||||
ELSE 1
|
||||
END AS confirmStatus
|
||||
FROM employee_onboarding eo
|
||||
LEFT JOIN sys_user su
|
||||
ON su.user_id = eo.user_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectVoByUserId" resultType="com.ruoyi.oa.domain.vo.EmployeeOnboardingVo">
|
||||
SELECT
|
||||
eo.user_id,
|
||||
su.nick_name,
|
||||
eo.joining_date,
|
||||
DATEDIFF(CURDATE(), eo.joining_date) AS workTime,
|
||||
eo.confirm_date,
|
||||
highest_degree,
|
||||
eo.remark,
|
||||
eo.birth_date,
|
||||
eo.status,
|
||||
political_status,
|
||||
CASE
|
||||
WHEN eo.confirm_date IS NULL THEN 0
|
||||
ELSE 1
|
||||
END AS confirmStatus
|
||||
FROM employee_onboarding eo
|
||||
LEFT JOIN sys_user su
|
||||
ON su.user_id = eo.user_id
|
||||
|
||||
where eo.user_id = #{userId}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user