员工档案

new
zk 1 year ago
parent b08be8439b
commit bdfb1ab58c

@ -0,0 +1,102 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo.*;
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO;
import cn.iocoder.yudao.module.ea.convert.electronicemployee.ElectronicEmployeeConvert;
import cn.iocoder.yudao.module.ea.service.electronicemployee.ElectronicEmployeeService;
@Tag(name = "管理后台 - 员工档案")
@RestController
@RequestMapping("/ea/electronic-employee")
@Validated
public class ElectronicEmployeeController {
@Resource
private ElectronicEmployeeService electronicEmployeeService;
@PostMapping("/create")
@Operation(summary = "创建员工档案")
@PreAuthorize("@ss.hasPermission('ea:electronic-employee:create')")
public CommonResult<Long> createElectronicEmployee(@Valid @RequestBody ElectronicEmployeeCreateReqVO createReqVO) {
return success(electronicEmployeeService.createElectronicEmployee(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新员工档案")
@PreAuthorize("@ss.hasPermission('ea:electronic-employee:update')")
public CommonResult<Boolean> updateElectronicEmployee(@Valid @RequestBody ElectronicEmployeeUpdateReqVO updateReqVO) {
electronicEmployeeService.updateElectronicEmployee(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除员工档案")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('ea:electronic-employee:delete')")
public CommonResult<Boolean> deleteElectronicEmployee(@RequestParam("id") Long id) {
electronicEmployeeService.deleteElectronicEmployee(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得员工档案")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('ea:electronic-employee:query')")
public CommonResult<ElectronicEmployeeRespVO> getElectronicEmployee(@RequestParam("id") Long id) {
ElectronicEmployeeDO electronicEmployee = electronicEmployeeService.getElectronicEmployee(id);
return success(ElectronicEmployeeConvert.INSTANCE.convert(electronicEmployee));
}
@GetMapping("/list")
@Operation(summary = "获得员工档案列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('ea:electronic-employee:query')")
public CommonResult<List<ElectronicEmployeeRespVO>> getElectronicEmployeeList(@RequestParam("ids") Collection<Long> ids) {
List<ElectronicEmployeeDO> list = electronicEmployeeService.getElectronicEmployeeList(ids);
return success(ElectronicEmployeeConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得员工档案分页")
@PreAuthorize("@ss.hasPermission('ea:electronic-employee:query')")
public CommonResult<PageResult<ElectronicEmployeeRespVO>> getElectronicEmployeePage(@Valid ElectronicEmployeePageReqVO pageVO) {
PageResult<ElectronicEmployeeDO> pageResult = electronicEmployeeService.getElectronicEmployeePage(pageVO);
return success(ElectronicEmployeeConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出员工档案 Excel")
@PreAuthorize("@ss.hasPermission('ea:electronic-employee:export')")
@OperateLog(type = EXPORT)
public void exportElectronicEmployeeExcel(@Valid ElectronicEmployeeExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<ElectronicEmployeeDO> list = electronicEmployeeService.getElectronicEmployeeList(exportReqVO);
// 导出 Excel
List<ElectronicEmployeeExcelVO> datas = ElectronicEmployeeConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "员工档案.xls", "数据", ElectronicEmployeeExcelVO.class, datas);
}
}

@ -0,0 +1,65 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class ElectronicEmployeeBaseVO {
@Schema(description = "id" )
private Long id;
@Schema(description = "制单人")
private String createBy;
@Schema(description = "业务实体")
private String company;
@Schema(description = "所属部门", example = "王五")
private String deptName;
@Schema(description = "员工姓名", example = "张三")
private String name;
@Schema(description = "性别")
private String gender;
@Schema(description = "国籍")
private String nationality;
@Schema(description = "联系方式")
private String contactNumber;
@Schema(description = "身份证号")
private String idCardNumber;
@Schema(description = "年度")
private String year;
@Schema(description = "月份")
private String period;
@Schema(description = "借阅状态", example = "2")
private String borrowStatus;
@Schema(description = "归档时间")
private String recordTime;
@Schema(description = "纸档位置")
private String position;
@Schema(description = "完整性")
private Integer cherks;
@Schema(description = "归档状态", example = "2")
private String fileStatus;
}

@ -0,0 +1,100 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;
/**
* @author HP
*/
@Schema(description = "管理后台 - 员工档案创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ElectronicEmployeeCreateReqVO extends ElectronicEmployeeBaseVO {
@Schema(description = "出生日期")
private LocalDate birthdate;
@Schema(description = "地址")
private String address;
@Schema(description = "护照号码")
private String passportNumber;
@Schema(description = "毕业学校")
private String graduationSchool;
@Schema(description = "专业")
private String major;
@Schema(description = "学历")
private String education;
@Schema(description = "教育经历")
private String educationExperience;
@Schema(description = "工作经历")
private String workExperience;
@Schema(description = "职位")
private String jobTitle;
@Schema(description = "职位级别")
private String jobLevel;
@Schema(description = "职位描述", example = "你说的对")
private String jobDescription;
@Schema(description = "薪酬")
private Long salary;
@Schema(description = "身体状况")
private String healthCondition;
@Schema(description = "体检记录")
private String medicalRecords;
@Schema(description = "疾病史")
private String diseaseHistory;
@Schema(description = "养老保险")
private String socialInsurance;
@Schema(description = "医疗保险")
private Long pensionInsurance;
@Schema(description = "失业保险")
private Long medicalInsurance;
@Schema(description = "失业保险")
private Long unemploymentInsurance;
@Schema(description = "工伤保险")
private Long workInjuryInsurance;
@Schema(description = "考核评价")
private String leaveRecords;
@Schema(description = "奖惩记录")
private String overtimeRecords;
@Schema(description = "培训计划")
private String welfareBenefits;
@Schema(description = "培训成果")
private String performanceEvaluation;
@Schema(description = "个人标签")
private String rewardsPunishments;
@Schema(description = "兴趣爱好")
private String trainingRecords;
@Schema(description = "特长", example = "你说的对")
private String personalDescription;
}

@ -0,0 +1,69 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* Excel VO
*
* @author
*/
@Data
public class ElectronicEmployeeExcelVO {
@ExcelProperty("制单人")
private String createBy;
@ExcelProperty("创建日期")
private LocalDateTime createTime;
@ExcelProperty("业务实体")
private String company;
@ExcelProperty("所属部门")
private String deptName;
@ExcelProperty("员工姓名")
private String name;
@ExcelProperty(value = "性别", converter = DictConvert.class)
@DictFormat("system_user_sex") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
private String gender;
@ExcelProperty("国籍")
private String nationality;
@ExcelProperty("联系方式")
private String contactNumber;
@ExcelProperty("身份证号")
private String idCardNumber;
@ExcelProperty("年度")
private String year;
@ExcelProperty("月份")
private String period;
@ExcelProperty(value = "借阅状态", converter = DictConvert.class)
@DictFormat("infra_boolean_string") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
private String borrowStatus;
@ExcelProperty("归档时间")
private String recordTime;
@ExcelProperty("纸档位置")
private String position;
@ExcelProperty("完整性")
private Integer cherks;
@ExcelProperty("归档状态")
private String fileStatus;
}

@ -0,0 +1,66 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 员工档案 Excel 导出 Request VO参数和 ElectronicEmployeePageReqVO 是一致的")
@Data
public class ElectronicEmployeeExportReqVO {
@Schema(description = "制单人")
private String createBy;
@Schema(description = "创建日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "业务实体")
private String company;
@Schema(description = "所属部门", example = "王五")
private String deptName;
@Schema(description = "员工姓名", example = "张三")
private String name;
@Schema(description = "性别")
private String gender;
@Schema(description = "国籍")
private String nationality;
@Schema(description = "联系方式")
private String contactNumber;
@Schema(description = "身份证号")
private String idCardNumber;
@Schema(description = "年度")
private String year;
@Schema(description = "月份")
private String period;
@Schema(description = "借阅状态", example = "2")
private String borrowStatus;
@Schema(description = "归档时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] recordTime;
@Schema(description = "纸档位置")
private String position;
@Schema(description = "完整性")
private Integer cherks;
@Schema(description = "归档状态", example = "2")
private String fileStatus;
}

@ -0,0 +1,68 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 员工档案分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ElectronicEmployeePageReqVO extends PageParam {
@Schema(description = "制单人")
private String createBy;
@Schema(description = "创建日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "业务实体")
private String company;
@Schema(description = "所属部门", example = "王五")
private String deptName;
@Schema(description = "员工姓名", example = "张三")
private String name;
@Schema(description = "性别")
private String gender;
@Schema(description = "国籍")
private String nationality;
@Schema(description = "联系方式")
private String contactNumber;
@Schema(description = "身份证号")
private String idCardNumber;
@Schema(description = "年度")
private String year;
@Schema(description = "月份")
private String period;
@Schema(description = "借阅状态", example = "2")
private String borrowStatus;
@Schema(description = "归档时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] recordTime;
@Schema(description = "纸档位置")
private String position;
@Schema(description = "完整性")
private Integer cherks;
@Schema(description = "归档状态", example = "2")
private String fileStatus;
}

@ -0,0 +1,16 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 员工档案 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ElectronicEmployeeRespVO extends ElectronicEmployeeBaseVO {
@Schema(description = "创建日期")
private LocalDateTime createTime;
}

@ -0,0 +1,97 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 员工档案更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ElectronicEmployeeUpdateReqVO extends ElectronicEmployeeBaseVO {
@Schema(description = "出生日期")
private LocalDate birthdate;
@Schema(description = "地址")
private String address;
@Schema(description = "护照号码")
private String passportNumber;
@Schema(description = "毕业学校")
private String graduationSchool;
@Schema(description = "专业")
private String major;
@Schema(description = "学历")
private String education;
@Schema(description = "教育经历")
private String educationExperience;
@Schema(description = "工作经历")
private String workExperience;
@Schema(description = "职位")
private String jobTitle;
@Schema(description = "职位级别")
private String jobLevel;
@Schema(description = "职位描述", example = "你说的对")
private String jobDescription;
@Schema(description = "薪酬")
private Long salary;
@Schema(description = "身体状况")
private String healthCondition;
@Schema(description = "体检记录")
private String medicalRecords;
@Schema(description = "疾病史")
private String diseaseHistory;
@Schema(description = "养老保险")
private String socialInsurance;
@Schema(description = "医疗保险")
private Long pensionInsurance;
@Schema(description = "失业保险")
private Long medicalInsurance;
@Schema(description = "失业保险")
private Long unemploymentInsurance;
@Schema(description = "工伤保险")
private Long workInjuryInsurance;
@Schema(description = "考核评价")
private String leaveRecords;
@Schema(description = "奖惩记录")
private String overtimeRecords;
@Schema(description = "培训计划")
private String welfareBenefits;
@Schema(description = "培训成果")
private String performanceEvaluation;
@Schema(description = "个人标签")
private String rewardsPunishments;
@Schema(description = "兴趣爱好")
private String trainingRecords;
@Schema(description = "特长", example = "你说的对")
private String personalDescription;
}

@ -0,0 +1,34 @@
package cn.iocoder.yudao.module.ea.convert.electronicemployee;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo.*;
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO;
/**
* Convert
*
* @author
*/
@Mapper
public interface ElectronicEmployeeConvert {
ElectronicEmployeeConvert INSTANCE = Mappers.getMapper(ElectronicEmployeeConvert.class);
ElectronicEmployeeDO convert(ElectronicEmployeeCreateReqVO bean);
ElectronicEmployeeDO convert(ElectronicEmployeeUpdateReqVO bean);
ElectronicEmployeeRespVO convert(ElectronicEmployeeDO bean);
List<ElectronicEmployeeRespVO> convertList(List<ElectronicEmployeeDO> list);
PageResult<ElectronicEmployeeRespVO> convertPage(PageResult<ElectronicEmployeeDO> page);
List<ElectronicEmployeeExcelVO> convertList02(List<ElectronicEmployeeDO> list);
}

@ -0,0 +1,225 @@
package cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* DO
*
* @author
*/
@TableName("ea_electronic_employee")
@KeySequence("ea_electronic_employee_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ElectronicEmployeeDO extends BaseDO {
/**
*
*/
@TableId
private Long id;
/**
*
*/
private String createBy;
/**
* id
*/
private Long companyId;
/**
*
*/
private String company;
/**
* id
*/
private Long deptId;
/**
*
*/
private String deptName;
/**
*
*/
private String name;
/**
*
*
*
*/
private String gender;
/**
*
*/
private LocalDate birthdate;
/**
*
*/
private String nationality;
/**
*
*/
private String address;
/**
*
*/
private String contactNumber;
/**
*
*/
private String idCardNumber;
/**
*
*/
private String passportNumber;
/**
*
*/
private String graduationSchool;
/**
*
*/
private String major;
/**
*
*/
private String education;
/**
*
*/
private String educationExperience;
/**
*
*/
private String workExperience;
/**
*
*/
private String jobTitle;
/**
*
*/
private String jobLevel;
/**
*
*/
private String jobDescription;
/**
*
*/
private Long salary;
/**
*
*/
private String healthCondition;
/**
*
*/
private String medicalRecords;
/**
*
*
*
*/
private String diseaseHistory;
/**
*
*
*
*/
private String socialInsurance;
/**
*
*/
private Long pensionInsurance;
/**
*
*/
private Long medicalInsurance;
/**
*
*/
private Long unemploymentInsurance;
/**
*
*/
private Long workInjuryInsurance;
/**
*
*/
private String leaveRecords;
/**
*
*/
private String overtimeRecords;
/**
*
*/
private String welfareBenefits;
/**
*
*/
private String performanceEvaluation;
/**
*
*/
private String rewardsPunishments;
/**
*
*/
private String trainingRecords;
/**
*
*/
private String personalDescription;
/**
*
*/
private String year;
/**
*
*/
private String period;
/**
*
*
*
*/
private String borrowStatus;
/**
*
*/
private String recordTime;
/**
*
*/
private String position;
/**
*
*/
private Integer cherks;
/**
* id
*/
private Long recordId;
/**
* id
*/
private Long userId;
/**
*
*/
private String fileStatus;
}

@ -0,0 +1,62 @@
package cn.iocoder.yudao.module.ea.dal.mysql.electronicemployee;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo.*;
/**
* Mapper
*
* @author
*/
@Mapper
public interface ElectronicEmployeeMapper extends BaseMapperX<ElectronicEmployeeDO> {
default PageResult<ElectronicEmployeeDO> selectPage(ElectronicEmployeePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ElectronicEmployeeDO>()
.eqIfPresent(ElectronicEmployeeDO::getCreateBy, reqVO.getCreateBy())
.betweenIfPresent(ElectronicEmployeeDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ElectronicEmployeeDO::getCompany, reqVO.getCompany())
.likeIfPresent(ElectronicEmployeeDO::getDeptName, reqVO.getDeptName())
.likeIfPresent(ElectronicEmployeeDO::getName, reqVO.getName())
.eqIfPresent(ElectronicEmployeeDO::getGender, reqVO.getGender())
.eqIfPresent(ElectronicEmployeeDO::getNationality, reqVO.getNationality())
.eqIfPresent(ElectronicEmployeeDO::getContactNumber, reqVO.getContactNumber())
.eqIfPresent(ElectronicEmployeeDO::getIdCardNumber, reqVO.getIdCardNumber())
.eqIfPresent(ElectronicEmployeeDO::getYear, reqVO.getYear())
.eqIfPresent(ElectronicEmployeeDO::getPeriod, reqVO.getPeriod())
.eqIfPresent(ElectronicEmployeeDO::getBorrowStatus, reqVO.getBorrowStatus())
.betweenIfPresent(ElectronicEmployeeDO::getRecordTime, reqVO.getRecordTime())
.eqIfPresent(ElectronicEmployeeDO::getPosition, reqVO.getPosition())
.eqIfPresent(ElectronicEmployeeDO::getCherks, reqVO.getCherks())
.eqIfPresent(ElectronicEmployeeDO::getFileStatus, reqVO.getFileStatus())
.orderByDesc(ElectronicEmployeeDO::getId));
}
default List<ElectronicEmployeeDO> selectList(ElectronicEmployeeExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ElectronicEmployeeDO>()
.eqIfPresent(ElectronicEmployeeDO::getCreateBy, reqVO.getCreateBy())
.betweenIfPresent(ElectronicEmployeeDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ElectronicEmployeeDO::getCompany, reqVO.getCompany())
.likeIfPresent(ElectronicEmployeeDO::getDeptName, reqVO.getDeptName())
.likeIfPresent(ElectronicEmployeeDO::getName, reqVO.getName())
.eqIfPresent(ElectronicEmployeeDO::getGender, reqVO.getGender())
.eqIfPresent(ElectronicEmployeeDO::getNationality, reqVO.getNationality())
.eqIfPresent(ElectronicEmployeeDO::getContactNumber, reqVO.getContactNumber())
.eqIfPresent(ElectronicEmployeeDO::getIdCardNumber, reqVO.getIdCardNumber())
.eqIfPresent(ElectronicEmployeeDO::getYear, reqVO.getYear())
.eqIfPresent(ElectronicEmployeeDO::getPeriod, reqVO.getPeriod())
.eqIfPresent(ElectronicEmployeeDO::getBorrowStatus, reqVO.getBorrowStatus())
.betweenIfPresent(ElectronicEmployeeDO::getRecordTime, reqVO.getRecordTime())
.eqIfPresent(ElectronicEmployeeDO::getPosition, reqVO.getPosition())
.eqIfPresent(ElectronicEmployeeDO::getCherks, reqVO.getCherks())
.eqIfPresent(ElectronicEmployeeDO::getFileStatus, reqVO.getFileStatus())
.orderByDesc(ElectronicEmployeeDO::getId));
}
}

@ -0,0 +1,70 @@
package cn.iocoder.yudao.module.ea.service.electronicemployee;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo.*;
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* Service
*
* @author
*/
public interface ElectronicEmployeeService {
/**
*
*
* @param createReqVO
* @return
*/
Long createElectronicEmployee(@Valid ElectronicEmployeeCreateReqVO createReqVO);
/**
*
*
* @param updateReqVO
*/
void updateElectronicEmployee(@Valid ElectronicEmployeeUpdateReqVO updateReqVO);
/**
*
*
* @param id
*/
void deleteElectronicEmployee(Long id);
/**
*
*
* @param id
* @return
*/
ElectronicEmployeeDO getElectronicEmployee(Long id);
/**
*
*
* @param ids
* @return
*/
List<ElectronicEmployeeDO> getElectronicEmployeeList(Collection<Long> ids);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<ElectronicEmployeeDO> getElectronicEmployeePage(ElectronicEmployeePageReqVO pageReqVO);
/**
* , Excel
*
* @param exportReqVO
* @return
*/
List<ElectronicEmployeeDO> getElectronicEmployeeList(ElectronicEmployeeExportReqVO exportReqVO);
}

@ -0,0 +1,82 @@
package cn.iocoder.yudao.module.ea.service.electronicemployee;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo.*;
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.ea.convert.electronicemployee.ElectronicEmployeeConvert;
import cn.iocoder.yudao.module.ea.dal.mysql.electronicemployee.ElectronicEmployeeMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.ea.enums.ErrorCodeConstants.*;
/**
* Service
*
* @author
*/
@Service
@Validated
public class ElectronicEmployeeServiceImpl implements ElectronicEmployeeService {
@Resource
private ElectronicEmployeeMapper electronicEmployeeMapper;
@Override
public Long createElectronicEmployee(ElectronicEmployeeCreateReqVO createReqVO) {
// 插入
ElectronicEmployeeDO electronicEmployee = ElectronicEmployeeConvert.INSTANCE.convert(createReqVO);
electronicEmployeeMapper.insert(electronicEmployee);
// 返回
return electronicEmployee.getId();
}
@Override
public void updateElectronicEmployee(ElectronicEmployeeUpdateReqVO updateReqVO) {
// 校验存在
validateElectronicEmployeeExists(updateReqVO.getId());
// 更新
ElectronicEmployeeDO updateObj = ElectronicEmployeeConvert.INSTANCE.convert(updateReqVO);
electronicEmployeeMapper.updateById(updateObj);
}
@Override
public void deleteElectronicEmployee(Long id) {
// 校验存在
validateElectronicEmployeeExists(id);
// 删除
electronicEmployeeMapper.deleteById(id);
}
private void validateElectronicEmployeeExists(Long id) {
if (electronicEmployeeMapper.selectById(id) == null) {
throw exception(ELECTRONIC_EMPLOYEE_NOT_EXISTS);
}
}
@Override
public ElectronicEmployeeDO getElectronicEmployee(Long id) {
return electronicEmployeeMapper.selectById(id);
}
@Override
public List<ElectronicEmployeeDO> getElectronicEmployeeList(Collection<Long> ids) {
return electronicEmployeeMapper.selectBatchIds(ids);
}
@Override
public PageResult<ElectronicEmployeeDO> getElectronicEmployeePage(ElectronicEmployeePageReqVO pageReqVO) {
return electronicEmployeeMapper.selectPage(pageReqVO);
}
@Override
public List<ElectronicEmployeeDO> getElectronicEmployeeList(ElectronicEmployeeExportReqVO exportReqVO) {
return electronicEmployeeMapper.selectList(exportReqVO);
}
}

@ -0,0 +1,35 @@
package cn.iocoder.yudao.module.ea.utils.enums;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
/**
* author: zk
* date: 2023/9/22
* description:
* @author HP
*/
@Getter
public enum BorrowStatusEnum {
/**
*
*/
BORROWSTATUS_TRUE("true", "1"),
BORROWSTATUS_FALSE("false", "0")
;
@JsonValue
private final String status;
/**
*
*/
@EnumValue
private final String isStatus;
BorrowStatusEnum(String status, String isStatus) {
this.status = status;
this.isStatus = isStatus;
}
}

@ -0,0 +1,12 @@
<?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="cn.iocoder.yudao.module.ea.dal.mysql.electronicemployee.ElectronicEmployeeMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>
Loading…
Cancel
Save