Merge remote-tracking branch 'origin/master'
# Conflicts:
# febs-server/febs-server-system/src/main/java/cc/mrbird/febs/server/system/controller/UserController.java
| | |
| | | LEFT JOIN t_dept d ON (u.dept_id = d.dept_id) |
| | | LEFT JOIN t_user_role ur ON (u.user_id = ur.user_id) |
| | | LEFT JOIN t_role r ON r.role_id = ur.role_id |
| | | WHERE u.username = #{username} |
| | | WHERE u.username = #{username} and status = 1 |
| | | group by u.username,u.user_id,u.email,u.mobile,u.password, u.status,u.create_time,u.ssex,u.dept_id |
| | | ,u.last_login_time,u.modify_time,u.description,u.avatar |
| | | </select> |
| | |
| | | * 保险类型 |
| | | */ |
| | | public final static String INSURANCETYPE = "INSURANCETYPE"; |
| | | |
| | | /** |
| | | * 请假类型 |
| | | */ |
| | | public final static String LEAVETYPE = "LEAVETYPE"; |
| | | |
| | | /** |
| | | * 仲裁类型 |
| | | */ |
| | | public final static String ARBITRATIONTYPE = "ARBITRATIONTYPE"; |
| | | } |
| | |
| | | package cc.mrbird.febs.common.core.converter; |
| | | |
| | | import cc.mrbird.febs.common.core.utils.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.wuwenze.poi.convert.WriteConverter; |
| | | import com.wuwenze.poi.exception.ExcelKitWriteConverterException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | return StringUtils.EMPTY; |
| | | } else { |
| | | try { |
| | | if (StrUtil.isNotBlank(value.toString())&&value.toString().length()==19){ |
| | | return value.toString(); |
| | | }else{ |
| | | return DateUtil.formatCstTime(value.toString(), DateUtil.FULL_TIME_SPLIT_PATTERN); |
| | | } |
| | | |
| | | } catch (ParseException e) { |
| | | String message = "时间转换异常"; |
| | | log.error(message, e); |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * name:EmpAccidentcases |
| | | * package:cc.mrbird.febs.server.hr.controller |
| | | * description:员工意外险案件控制器 |
| | |
| | | Map<String, Object> dataTable = FebsUtil.getDataTable(this.empAccidentCasesService.findEmpAccidentcasess(request, empAccidentcases)); |
| | | return new FebsResponse().data(dataTable); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "export",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | |
| | | List<EmpAccidentCases> records = this.empAccidentCasesService.findEmpAccidentcasess(request, empBaseinfo).getRecords(); |
| | | ExcelKit.$Export(EmpAccidentCases.class, response).downXlsx(records, false); |
| | | } |
| | | |
| | | @PostMapping |
| | | @PreAuthorize("hasAuthority('empAccidentcases:add')") |
| | | public void addEmpAccidentCases(@Valid EmpAccidentCases empAccidentcases) throws FebsException { |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * name:EmpBadrecord |
| | | * package:cc.mrbird.febs.server.hr.controller |
| | | * description:员工不良记录信息控制器 |
| | |
| | | Map<String, Object> dataTable = FebsUtil.getDataTable(this.empBadrecordService.findEmpBadrecords(request, empBadrecord)); |
| | | return new FebsResponse().data(dataTable); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "export",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | |
| | | List<EmpBadRecord> records = this.empBadrecordService.findEmpBadrecords(request, empBaseinfo).getRecords(); |
| | | ExcelKit.$Export(EmpBadRecord.class, response).downXlsx(records, false); |
| | | } |
| | | |
| | | @PostMapping |
| | | @PreAuthorize("hasAuthority('empBadrecord:add')") |
| | | public void addEmpBadrecord(@Valid EmpBadRecord empBadrecord) throws FebsException { |
| | |
| | | List<EmpBaseInfo> allRoles = empBaseInfoService.list(wrapper); |
| | | return new FebsResponse().data(allRoles); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "export",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | |
| | | ExcelKit.$Export(EmpBaseInfo.class, response).downXlsx(records, false); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "exportWithField",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | | public void exportWithField(QueryRequest request, HttpServletResponse response, String exportField,EmpBaseInfo empBaseinfo) throws IOException { |
| | | request.setPageSize(25535); |
| | | request.setPageNum(1); |
| | | List<EmpBaseInfo> exportList = this.empBaseInfoService.findZsEmpBaseInfos(request, empBaseinfo).getRecords(); |
| | | List<Map<String, Object>> listMapDicItem = new ArrayList(); |
| | | List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, listMapDicItem); |
| | | String fileName = "在职员工列表"; |
| | | Date currentDate = new Date(); |
| | | String dateStr = DateUtil.formatDate(currentDate); |
| | | boolean result = PoiExportExcel.exportCommonExcel(response, fileName + dateStr, fileName, allList); |
| | | } |
| | | |
| | | @ApiOperation(value = "导入员工") |
| | | @PostMapping("importEmp") |
| | | public void importEmp(MultipartFile file) throws IOException { |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * name:EmpDimissionattend |
| | | * package:cc.mrbird.febs.server.hr.controller |
| | | * description:离职当月考勤控制器 |
| | |
| | | Map<String, Object> dataTable = FebsUtil.getDataTable(this.empDimissionattendService.findEmpDimissionattends(request, empDimissionattend)); |
| | | return new FebsResponse().data(dataTable); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "export",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | |
| | | List<EmpDimissionAttend> records = this.empDimissionattendService.findEmpDimissionattends(request, empBaseinfo).getRecords(); |
| | | ExcelKit.$Export(EmpDimissionAttend.class, response).downXlsx(records, false); |
| | | } |
| | | |
| | | @PostMapping |
| | | @PreAuthorize("hasAuthority('empDimissionattend:add')") |
| | | public void addEmpDimissionattend(@Valid EmpDimissionAttend empDimissionattend) throws FebsException { |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * name:EmpInsurance |
| | | * package:cc.mrbird.febs.server.hr.controller |
| | | * description:员工社保申请控制器 |
| | |
| | | Map<String, Object> dataTable = FebsUtil.getDataTable(this.empInsuranceService.findEmpInsurances(request, empInsurance)); |
| | | return new FebsResponse().data(dataTable); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "export",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | |
| | | List<EmpInsurance> records = this.empInsuranceService.findEmpInsurances(request, empBaseinfo).getRecords(); |
| | | ExcelKit.$Export(EmpInsurance.class, response).downXlsx(records, false); |
| | | } |
| | | |
| | | @PostMapping |
| | | @PreAuthorize("hasAuthority('empInsurance:add')") |
| | | public void addEmpInsurance(@Valid EmpInsurance empInsurance) throws FebsException { |
| | |
| | | package cc.mrbird.febs.server.hr.controller; |
| | | |
| | | import cc.mrbird.febs.server.hr.annotation.ControllerEndpoint; |
| | | import cc.mrbird.febs.server.hr.entity.EmpInsurance; |
| | | import cc.mrbird.febs.server.hr.entity.EmpJobChange; |
| | | import cc.mrbird.febs.server.hr.service.IEmpJobChangeService; |
| | | import cc.mrbird.febs.common.core.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.common.core.utils.FebsUtil; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.wuwenze.poi.ExcelKit; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * name:EmpJobchange |
| | |
| | | @ApiOperation(value = "员工调岗记录翻页列表") |
| | | @GetMapping("list") |
| | | public FebsResponse empJobchangeList(QueryRequest request, EmpJobChange empJobchange) { |
| | | Map |
| | | <String, Object> dataTable = FebsUtil.getDataTable(this.empJobchangeService.findEmpJobChanges(request, empJobchange)); |
| | | Map <String, Object> dataTable = FebsUtil.getDataTable(this.empJobchangeService.findEmpJobChanges(request, empJobchange)); |
| | | return new FebsResponse().data(dataTable); |
| | | } |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "export",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | | public void export(QueryRequest request, EmpJobChange empBaseinfo, HttpServletResponse response) { |
| | | public void export(QueryRequest request, EmpJobChange empJobchange, HttpServletResponse response) { |
| | | request.setPageSize(this.empJobchangeService.count()); |
| | | List<EmpJobChange> records = this.empJobchangeService.findEmpJobChanges(request, empBaseinfo).getRecords(); |
| | | ExcelKit.$Export(EmpJobChange.class, response).downXlsx(records, false); |
| | | List<Map<String,Object>> records = this.empJobchangeService.findEmpJobChanges(request, empJobchange).getRecords(); |
| | | List<EmpJobChange> list = records.parallelStream().map(i->{ |
| | | i.put("changeDate", DateUtil.parse(i.get("changeDate").toString())); |
| | | return BeanUtil.toBean(i,EmpJobChange.class); |
| | | }).collect(Collectors.toList()); |
| | | ExcelKit.$Export(EmpJobChange.class, response).downXlsx(list, false); |
| | | } |
| | | @ApiOperation(value = "员工调岗记录增加") |
| | | @PostMapping |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * name:EmpLabortrouble |
| | | * package:cc.mrbird.febs.server.hr.controller |
| | | * description:员工劳资案件控制器 |
| | |
| | | Map<String, Object> dataTable = FebsUtil.getDataTable(this.empLabortroubleService.findEmpLabortroubles(request, empLabortrouble)); |
| | | return new FebsResponse().data(dataTable); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "export",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | |
| | | List<EmpLaborTrouble> records = this.empLabortroubleService.findEmpLabortroubles(request, empBaseinfo).getRecords(); |
| | | ExcelKit.$Export(EmpLaborTrouble.class, response).downXlsx(records, false); |
| | | } |
| | | |
| | | @PostMapping |
| | | @PreAuthorize("hasAuthority('empLabortrouble:add')") |
| | | public void addEmpLabortrouble(@Valid EmpLaborTrouble empLabortrouble) throws FebsException { |
| | |
| | | Map<String, Object> dataTable = FebsUtil.getDataTable(this.empResignService.findEmpResigns(request, empResign)); |
| | | return new FebsResponse().data(dataTable); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出员工") |
| | | @RequestMapping(value = "export",method= RequestMethod.POST) |
| | | @ControllerEndpoint(operation = "导出用户数据", exceptionMessage = "导出Excel失败") |
| | |
| | | List<EmpResign> records = this.empResignService.findEmpResigns(request, empBaseinfo).getRecords(); |
| | | ExcelKit.$Export(EmpResign.class, response).downXlsx(records, false); |
| | | } |
| | | |
| | | @PostMapping |
| | | @PreAuthorize("hasAuthority('empResign:add')") |
| | | public void addEmpResign(@Valid EmpResign empResign) throws FebsException { |
| | |
| | | @TableField("deptId") |
| | | private Long deptId = 0L; |
| | | |
| | | @FieldInfo(name = "deptName", type = "varchar", explain = "部门名称") |
| | | @FieldInfo(name = "deptName", type = "varchar", explain = "部门(护卫点)") |
| | | @TableField("deptName") |
| | | @ExcelField(value = "护卫点(部门)") |
| | | private String deptName = ""; |
| | |
| | | @ExcelField(value = "员工类别", writeConverterExp = "1=正式工,2=临时工") |
| | | private String empType = ""; |
| | | |
| | | @FieldInfo(name = "empTypeName", type = "varchar", explain = "员工类别,员工类别字典表") |
| | | @FieldInfo(name = "empTypeName", type = "varchar", explain = "员工类别") |
| | | @TableField(exist = false) |
| | | private String empTypeName = ""; |
| | | |
| | |
| | | @ExcelField(value = "员工手册", writeConverterExp = "0=未发,1=已发") |
| | | private String handbookStatus = ""; |
| | | |
| | | @FieldInfo(name = "handbookStatusName", type = "varchar", explain = "员工手册") |
| | | @TableField(exist = false) |
| | | @ExcelField(value = "员工手册") |
| | | private String handbookStatusName = ""; |
| | | |
| | | @FieldInfo(name = "urgencyPhone", type = "varchar", explain = "紧急联系电话") |
| | | @TableField("urgencyPhone") |
| | | @ExcelField(value = "紧急联系电话") |
| | |
| | | @ExcelField(value = "工作证", writeConverterExp = "0=未发,1=已发") |
| | | private String empCardStatus = ""; |
| | | |
| | | @FieldInfo(name = "empCardStatusName", type = "varchar", explain = "工作证") |
| | | @TableField(exist = false) |
| | | @ExcelField(value = "工作证") |
| | | private String empCardStatusName = ""; |
| | | |
| | | @FieldInfo(name = "certificateList", type = "varchar", explain = "相关证件") |
| | | @TableField("certificateList") |
| | | private String certificateList = ""; |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private String changeDateStr= ""; |
| | | |
| | | @TableField(exist = false) |
| | | private String deptName= ""; |
| | | |
| | | @ExcelField(value = "员工编号") |
| | | @TableField(exist = false) |
| | | private String empNumb=""; |
| | | @ExcelField(value = "身份证号码") |
| | | @TableField(exist = false) |
| | | private String certificateNumb=""; |
| | | } |
| | |
| | | @ExcelField(value = "仲裁类型", writeConverterExp = "01=未报告,02=民事纠纷,03=合同纠纷") |
| | | private String arbitrationType = ""; |
| | | |
| | | @FieldInfo(name = "arbitrationTypeName", type = "varchar", explain = "仲裁类型") |
| | | @TableField(exist = false) |
| | | private String arbitrationTypeName = ""; |
| | | |
| | | @FieldInfo(name = "arbitrationReason", type = "varchar", explain = "仲裁事由") |
| | | @TableField("arbitrationReason") |
| | | @ExcelField(value = "仲裁事由") |
| | |
| | | @ExcelField(value = "请假类型", writeConverterExp = "1=事假,2=病假") |
| | | private String leaveType = ""; |
| | | |
| | | @FieldInfo(name = "leaveTypeName", type = "varchar", explain = "请假类型") |
| | | @TableField(exist = false) |
| | | private String leaveTypeName = ""; |
| | | |
| | | |
| | | @FieldInfo(name = "leaveDay", type = "decimal", explain = "请假天数") |
| | | @TableField("leaveDay") |
| | | @ExcelField(value = "请假天数") |
| | |
| | | package cc.mrbird.febs.server.hr.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import cc.mrbird.febs.common.core.annotation.FieldInfo; |
| | | import cc.mrbird.febs.common.core.converter.TimeConverter; |
| | | import cc.mrbird.febs.common.core.utils.DateDeSerializer; |
| | | import cc.mrbird.febs.common.core.utils.DateSerializer; |
| | | import cc.mrbird.febs.common.core.utils.DateTimeDeserializer; |
| | | import cc.mrbird.febs.common.core.utils.DateTimeSerializer; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.Version; |
| | | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.wuwenze.poi.annotation.Excel; |
| | | import com.wuwenze.poi.annotation.ExcelField; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.Version; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * name:EmpWorkexperience |
| | | * package:cc.mrbird.febs.server.hr.controller |
| | |
| | | import cc.mrbird.febs.server.hr.feign.fallback.RemoteUserServiceFallback; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("user") |
| | | FebsResponse userList(@RequestParam("queryRequest") QueryRequest queryRequest, @RequestParam("user") SystemUser user); |
| | | |
| | | @PostMapping("user/updateStatus") |
| | | void updateStatus(@RequestParam("certificateNumb")String certificateNumb); |
| | | } |
| | |
| | | package cc.mrbird.febs.server.hr.feign.fallback; |
| | | |
| | | import cc.mrbird.febs.common.core.annotation.Fallback; |
| | | import cc.mrbird.febs.common.core.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.core.entity.system.SystemUser; |
| | | import cc.mrbird.febs.server.hr.feign.IRemoteUserService; |
| | | import feign.hystrix.FallbackFactory; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Override |
| | | public IRemoteUserService create(Throwable throwable) { |
| | | return (queryRequest, user) -> { |
| | | return new IRemoteUserService(){ |
| | | |
| | | @Override |
| | | public FebsResponse userList(QueryRequest queryRequest, SystemUser user) { |
| | | log.error("获取用户信息失败", throwable); |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void updateStatus(String certificateNumb) { |
| | | log.error("禁用账户失败", throwable); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | package cc.mrbird.febs.server.hr.mapper; |
| | | |
| | | import cc.mrbird.febs.server.hr.entity.EmpJobChange; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * name:EmpJobchange |
| | |
| | | " </foreach>\n" + |
| | | "</script>") |
| | | void logicDeleteByIds(@Param("list") List<String> list, @Param("operatorId") String operatorId); |
| | | |
| | | IPage<Map<String,Object>> selectPageVo(Page<?> page, @Param(Constants.WRAPPER) Wrapper wrapper); |
| | | |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cc.mrbird.febs.server.hr.mapper.EmpJobChangeMapper"> |
| | | |
| | | <select id="selectPageVo" resultType="java.util.Map"> |
| | | select a.*,b.empNumb,b.certificateNumb from t_emp_jobchange a inner join t_emp_baseinfo b on a.empId = b.empId ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpAccidentCases; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | |
| | | * |
| | | * @param empAccidentcases empAccidentcases |
| | | */ |
| | | void createEmpAccidentcases(EmpAccidentCases empAccidentcases); |
| | | void createEmpAccidentcases(EmpAccidentCases empAccidentcases) throws FebsException; |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param empAccidentcases empAccidentcases |
| | | */ |
| | | void updateEmpAccidentcases(EmpAccidentCases empAccidentcases); |
| | | void updateEmpAccidentcases(EmpAccidentCases empAccidentcases) throws FebsException; |
| | | |
| | | /** |
| | | * 删除 |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpBadRecord; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | |
| | | * |
| | | * @param empBadrecord empBadrecord |
| | | */ |
| | | void createEmpBadrecord(EmpBadRecord empBadrecord); |
| | | void createEmpBadrecord(EmpBadRecord empBadrecord) throws FebsException; |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param empBadrecord empBadrecord |
| | | */ |
| | | void updateEmpBadrecord(EmpBadRecord empBadrecord); |
| | | void updateEmpBadrecord(EmpBadRecord empBadrecord) throws FebsException; |
| | | |
| | | /** |
| | | * 删除 |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpInsurance; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | |
| | | * |
| | | * @param empInsurance empInsurance |
| | | */ |
| | | void createEmpInsurance(EmpInsurance empInsurance); |
| | | void createEmpInsurance(EmpInsurance empInsurance) throws FebsException; |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param empInsurance empInsurance |
| | | */ |
| | | void updateEmpInsurance(EmpInsurance empInsurance); |
| | | void updateEmpInsurance(EmpInsurance empInsurance) throws FebsException; |
| | | |
| | | /** |
| | | * 删除 |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * name:EmpJobchange |
| | |
| | | * 查询(分页) |
| | | * |
| | | * @param request QueryRequest |
| | | * @param empJobchange empJobchange |
| | | * @param empJobchange EmpJobChangeVO |
| | | * @return IPage<EmpJobchange> |
| | | */ |
| | | IPage<EmpJobChange> findEmpJobChanges(QueryRequest request, EmpJobChange empJobchange); |
| | | IPage<Map<String,Object>> findEmpJobChanges(QueryRequest request, EmpJobChange empJobchange); |
| | | |
| | | /** |
| | | * 查询(所有) |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpLaborTrouble; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | |
| | | * |
| | | * @param empLabortrouble empLabortrouble |
| | | */ |
| | | void createEmpLabortrouble(EmpLaborTrouble empLabortrouble); |
| | | void createEmpLabortrouble(EmpLaborTrouble empLabortrouble) throws FebsException; |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param empLabortrouble empLabortrouble |
| | | */ |
| | | void updateEmpLabortrouble(EmpLaborTrouble empLabortrouble); |
| | | void updateEmpLabortrouble(EmpLaborTrouble empLabortrouble) throws FebsException; |
| | | |
| | | /** |
| | | * 删除 |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpResign; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | |
| | | * |
| | | * @param empResign empResign |
| | | */ |
| | | void createEmpResign(EmpResign empResign); |
| | | void createEmpResign(EmpResign empResign) throws FebsException; |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param empResign empResign |
| | | */ |
| | | void updateEmpResign(EmpResign empResign); |
| | | void updateEmpResign(EmpResign empResign) throws FebsException; |
| | | |
| | | /** |
| | | * 删除 |
| | |
| | | package cc.mrbird.febs.server.hr.service; |
| | | |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpUnemployment; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | |
| | | * |
| | | * @param empUnemployment empUnemployment |
| | | */ |
| | | void createEmpUnemployment(EmpUnemployment empUnemployment); |
| | | void createEmpUnemployment(EmpUnemployment empUnemployment) throws FebsException; |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param empUnemployment empUnemployment |
| | | */ |
| | | void updateEmpUnemployment(EmpUnemployment empUnemployment); |
| | | void updateEmpUnemployment(EmpUnemployment empUnemployment) throws FebsException; |
| | | |
| | | /** |
| | | * 删除 |
| | |
| | | if (StrUtil.isNotBlank(vo.getEmpStatus())) { |
| | | queryWrapper.in("a.empStatus", vo.getEmpStatus()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getPolitics())) { |
| | | queryWrapper.in("a.politics", vo.getPolitics()); |
| | | } |
| | | queryWrapper.eq("a.delFlag", 0); |
| | | Page<EmpAccessory> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | String querySql = empAccessoryMapper.getQuerySql(); |
| | |
| | | @Override |
| | | public void mvFiles(String accessoryids,Long labelid,Long empId) { |
| | | String[] arr = accessoryids.split(","); |
| | | |
| | | LambdaUpdateWrapper<EmpAccessory> wapper = new LambdaUpdateWrapper<>(); |
| | | wapper.in(EmpAccessory::getAccessoryid, arr); |
| | | wapper.set(EmpAccessory::getModifier,operatorId); |
| | |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.system.SystemUser; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createEmpAccidentcases(EmpAccidentCases empAccidentcases) { |
| | | public void createEmpAccidentcases(EmpAccidentCases empAccidentcases) throws FebsException { |
| | | LambdaQueryWrapper<EmpAccidentCases> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpAccidentCases::getEmpId, empAccidentcases.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpAccidentCases::getHrDoDate, empAccidentcases.getHrDoDate()); |
| | | lambdaQueryWrapper.eq(EmpAccidentCases::getDelFlag,0); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("当日记录已存在"); |
| | | } |
| | | empAccidentcases.setAccidentId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | if (empAccidentcases.getReprotTime() == null) { |
| | | empAccidentcases.setReprotTime(empAccidentcases.getInjuredTime()); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateEmpAccidentcases(EmpAccidentCases empAccidentcases) { |
| | | public void updateEmpAccidentcases(EmpAccidentCases empAccidentcases) throws FebsException { |
| | | LambdaQueryWrapper<EmpAccidentCases> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpAccidentCases::getEmpId, empAccidentcases.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpAccidentCases::getHrDoDate, empAccidentcases.getHrDoDate()); |
| | | lambdaQueryWrapper.eq(EmpAccidentCases::getDelFlag,0); |
| | | lambdaQueryWrapper.ne(EmpAccidentCases::getAccidentId,empAccidentcases.getAccidentId()); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("当日记录已存在"); |
| | | } |
| | | EmpAccidentCases dbData = this.getById(empAccidentcases.getAccidentId()); |
| | | empAccidentcases.setCreateTime(dbData.getCreateTime()); |
| | | empAccidentcases.setCreator(dbData.getCreator()); |
| | |
| | | package cc.mrbird.febs.server.hr.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.core.constant.ModuleCode; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpAccidentCases; |
| | | import cc.mrbird.febs.server.hr.entity.EmpBadRecord; |
| | | import cc.mrbird.febs.server.hr.entity.EmpBadRecord; |
| | | import cc.mrbird.febs.server.hr.mapper.EmpBadRecordMapper; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createEmpBadrecord(EmpBadRecord empBadrecord) { |
| | | public void createEmpBadrecord(EmpBadRecord empBadrecord) throws FebsException { |
| | | LambdaQueryWrapper<EmpBadRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpBadRecord::getEmpId, empBadrecord.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpBadRecord::getBadDate, empBadrecord.getBadDate()); |
| | | lambdaQueryWrapper.eq(EmpBadRecord::getDelFlag,0); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("当日记录已存在"); |
| | | } |
| | | empBadrecord.setBadId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | empBadrecord.setCreator(operatorId); |
| | | empBadrecord.setModifier(operatorId); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateEmpBadrecord(EmpBadRecord empBadrecord) { |
| | | public void updateEmpBadrecord(EmpBadRecord empBadrecord) throws FebsException { |
| | | LambdaQueryWrapper<EmpBadRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpBadRecord::getEmpId, empBadrecord.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpBadRecord::getBadDate, empBadrecord.getBadDate()); |
| | | lambdaQueryWrapper.eq(EmpBadRecord::getDelFlag,0); |
| | | lambdaQueryWrapper.ne(EmpBadRecord::getBadId,empBadrecord.getBadId()); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("当日记录已存在"); |
| | | } |
| | | EmpBadRecord dbData = this.getById(empBadrecord.getBadId()); |
| | | empBadrecord.setCreateTime(dbData.getCreateTime()); |
| | | empBadrecord.setCreator(dbData.getCreator()); |
| | |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.util.*; |
| | | import java.util.function.Consumer; |
| | | |
| | | import cc.mrbird.febs.common.core.entity.system.SysConfig; |
| | | import cc.mrbird.febs.common.core.utils.MyUtil; |
| | | import cc.mrbird.febs.server.hr.entity.EmpDimissionLog; |
| | | import cc.mrbird.febs.server.hr.entity.EmpJobChange; |
| | | import cc.mrbird.febs.server.hr.feign.IRemoteUserService; |
| | | import cc.mrbird.febs.server.hr.properties.FebsServerHrProperties; |
| | | import cc.mrbird.febs.server.hr.service.IEmpDimissionLogService; |
| | | import cc.mrbird.febs.server.hr.service.IEmpJobChangeService; |
| | |
| | | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) |
| | | class EmpBaseInfoServiceImpl extends ServiceImpl<EmpBaseInfoMapper, EmpBaseInfo> implements IEmpBaseInfoService { |
| | | private final RedisService redisService; |
| | | private final IRemoteDeptService remoteDeptService; |
| | | private final IRemoteUserService iRemoteUserService; |
| | | private final EmpBaseInfoMapper empBaseInfoMapper; |
| | | private final IEmpDimissionLogService dimissionLogService; |
| | | private final IEmpJobChangeService jobChangeService; |
| | |
| | | |
| | | @Override |
| | | public IPage<EmpBaseInfo> findEmpBaseInfos(QueryRequest request, EmpBaseInfo empBaseInfo) { |
| | | LambdaQueryWrapper<EmpBaseInfo> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(EmpBaseInfo::getDelFlag, empBaseInfo.getDelFlag()); |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpNumb())) { |
| | | queryWrapper.like(EmpBaseInfo::getEmpNumb, empBaseInfo.getEmpNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpName())) { |
| | | queryWrapper.like(EmpBaseInfo::getEmpName, empBaseInfo.getEmpName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) { |
| | | queryWrapper.like(EmpBaseInfo::getCertificateNumb, empBaseInfo.getCertificateNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDeptName())) { |
| | | queryWrapper.like(EmpBaseInfo::getDeptName, empBaseInfo.getDeptName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEntryDateStr())) { |
| | | queryWrapper.between(EmpBaseInfo::getEntryDate, empBaseInfo.getEntryDateStr().split(",")[0], empBaseInfo.getEntryDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDimissionDateStr())) { |
| | | queryWrapper.between(EmpBaseInfo::getDimissionDate, empBaseInfo.getDimissionDateStr().split(",")[0], empBaseInfo.getDimissionDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getSex())) { |
| | | queryWrapper.eq(EmpBaseInfo::getSex, empBaseInfo.getSex()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEducation())) { |
| | | queryWrapper.like(EmpBaseInfo::getEducation, empBaseInfo.getEducation()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getPolitics())) { |
| | | queryWrapper.like(EmpBaseInfo::getPolitics, empBaseInfo.getPolitics()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getAgeStr())) { |
| | | queryWrapper.between(EmpBaseInfo::getAge, empBaseInfo.getAgeStr().split(",")[0], empBaseInfo.getAgeStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getArchivesStatus())) { |
| | | queryWrapper.eq(EmpBaseInfo::getArchivesStatus, empBaseInfo.getArchivesStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) { |
| | | queryWrapper.eq(EmpBaseInfo::getInsuranceType, empBaseInfo.getInsuranceType()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpStatus())) { |
| | | queryWrapper.eq(EmpBaseInfo::getEmpStatus, empBaseInfo.getEmpStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getHandbookStatus())) { |
| | | queryWrapper.eq(EmpBaseInfo::getHandbookStatus, empBaseInfo.getHandbookStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpCardStatus())) { |
| | | queryWrapper.eq(EmpBaseInfo::getEmpCardStatus, empBaseInfo.getEmpCardStatus()); |
| | | } |
| | | Page<EmpBaseInfo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<EmpBaseInfo> iPage = this.page(page, queryWrapper); |
| | | //设置部门 |
| | | List<EmpBaseInfo> list = setDeptName(iPage.getRecords()); |
| | | List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class); |
| | | list.forEach(p -> { |
| | | p.setSexName("1".equals(p.getSex()) ? "男" : "女"); |
| | | p.setEmpTypeName("1".equals(p.getEmpType()) ? "正式工" : "临时工"); |
| | | p.setInsuranceTypeName("1".equals(p.getInsuranceType()) ? "(深户)五险一档" : "(非深户)五险一档"); |
| | | p.setArchivesStatusName("0".equals(p.getArchivesStatus()) ? "未移交" : "已移交"); |
| | | // 设置民族 |
| | | p.setNationName(dicItems.stream() |
| | | .filter(k -> DicCode.NATION.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getNation())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("汉族")); |
| | | // 设置政治面貌 |
| | | p.setPoliticsName(dicItems.stream() |
| | | .filter(k -> DicCode.PLITICAL.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getPolitics())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("群众")); |
| | | // 设置婚姻状况 |
| | | p.setMarriageName(dicItems.stream() |
| | | .filter(k -> DicCode.MARRIAGE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getMarriage())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("未婚")); |
| | | // 设置学历 |
| | | p.setEducationName(dicItems.stream() |
| | | .filter(k -> DicCode.EDUCATION.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getEducation())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("无学历")); |
| | | // 设置籍贯 |
| | | p.setNativePlaceName(dicItems.stream() |
| | | .filter(k -> DicCode.NATIVEPLACE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getNativePlace())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("未知")); |
| | | }); |
| | | iPage.setRecords(list); |
| | | return iPage; |
| | | return this.findZsEmpBaseInfos(request, empBaseInfo); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EmpBaseInfo> findZsEmpBaseInfos(QueryRequest request, EmpBaseInfo empBaseInfo) { |
| | | LambdaQueryWrapper<EmpBaseInfo> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(EmpBaseInfo::getDelFlag, empBaseInfo.getDelFlag()); |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpNumb())) { |
| | | queryWrapper.like(EmpBaseInfo::getEmpNumb, empBaseInfo.getEmpNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpName())) { |
| | | queryWrapper.like(EmpBaseInfo::getEmpName, empBaseInfo.getEmpName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) { |
| | | queryWrapper.like(EmpBaseInfo::getCertificateNumb, empBaseInfo.getCertificateNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDeptName())) { |
| | | queryWrapper.like(EmpBaseInfo::getDeptName, empBaseInfo.getDeptName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEntryDateStr())) { |
| | | queryWrapper.between(EmpBaseInfo::getEntryDate, empBaseInfo.getEntryDateStr().split(",")[0], empBaseInfo.getEntryDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDimissionDateStr())) { |
| | | queryWrapper.between(EmpBaseInfo::getDimissionDate, empBaseInfo.getDimissionDateStr().split(",")[0], empBaseInfo.getDimissionDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getSex())) { |
| | | queryWrapper.in(EmpBaseInfo::getSex, empBaseInfo.getSex().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEducation())) { |
| | | queryWrapper.in(EmpBaseInfo::getEducation, empBaseInfo.getEducation().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getPolitics())) { |
| | | queryWrapper.in(EmpBaseInfo::getPolitics, empBaseInfo.getPolitics().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getAgeStr())) { |
| | | String[] ages=empBaseInfo.getAgeStr().split(","); |
| | | for (int i = 0; i < ages.length; i++) { |
| | | String ageBtn=ages[i]; |
| | | queryWrapper.between(EmpBaseInfo::getAge, ageBtn.split("-")[0], ageBtn.split("-")[1]); |
| | | } |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getArchivesStatus())) { |
| | | queryWrapper.in(EmpBaseInfo::getArchivesStatus, empBaseInfo.getArchivesStatus().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) { |
| | | queryWrapper.in(EmpBaseInfo::getInsuranceType, empBaseInfo.getInsuranceType().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpStatus())) { |
| | | queryWrapper.in(EmpBaseInfo::getEmpStatus, empBaseInfo.getEmpStatus().split(",")); |
| | | } |
| | | Page<EmpBaseInfo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<EmpBaseInfo> iPage = this.page(page, queryWrapper); |
| | | IPage<EmpBaseInfo> iPage = this.page(page, createQueryWrapper(empBaseInfo)); |
| | | //设置部门 |
| | | List<EmpBaseInfo> list = setDeptName(iPage.getRecords()); |
| | | List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class); |
| | | list.forEach(p -> { |
| | | p.setSexName("1".equals(p.getSex()) ? "男" : "女"); |
| | | p.setArchivesStatusName("0".equals(p.getArchivesStatus()) ? "未移交" : "已移交"); |
| | | p.setEmpCardStatusName("1".equals(p.getEmpCardStatus()) ? "未发" : "已发"); |
| | | p.setHandbookStatusName("1".equals(p.getHandbookStatus()) ? "未发" : "已发"); |
| | | //保险类型 |
| | | p.setInsuranceTypeName(dicItems.stream() |
| | | .filter(k -> DicCode.INSURANCETYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getInsuranceType())) |
| | |
| | | String path = properties.getEmpBaseInfoPath()+empBaseInfo.getEmpId()+".png"; |
| | | if ( MyUtil.generateImage(empBaseInfo.getImagePath(),path)) { |
| | | empBaseInfo.setImagePath(empBaseInfo.getEmpId()+".png"); |
| | | }; |
| | | } |
| | | ; |
| | | } |
| | | empBaseInfo.setCreator(operatorId); |
| | | empBaseInfo.setModifier(operatorId); |
| | |
| | | } |
| | | return this.getOne(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 关闭员工档案 |
| | | * |
| | | * <p> |
| | | * date 2021-02-18 12:54 |
| | | * @author: luoyibo |
| | | * |
| | | * @param empDimissionLog |
| | | * @return boolean |
| | | * @author: luoyibo |
| | | */ |
| | | @Override |
| | | public boolean closeEmpArchives(EmpDimissionLog empDimissionLog) { |
| | |
| | | dimissionLog.setReporter(empDimissionLog.getReporter()); |
| | | dimissionLog.setCreator(operatorId); |
| | | dimissionLog.setModifier(operatorId); |
| | | |
| | | dimissionLogService.save(dimissionLog); |
| | | } |
| | | EmpBaseInfo empBaseInfo = this.getById(dimissionLog.getEmpId()); |
| | | //禁用账户 |
| | | iRemoteUserService.updateStatus(empBaseInfo.getCertificateNumb()); |
| | | return empBaseInfoMapper.closeEmpArchives(list, empDimissionLog.getDimissionType(), empDimissionLog.getDimissionDate(), empDimissionLog.getRemark(), operatorId)>0; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 员工岗位变更 |
| | | * |
| | | * <p> |
| | | * date 2021-02-18 20:32 |
| | | * @author: luoyibo |
| | | * |
| | | * @param empJobChange 1 |
| | | * @return boolean |
| | | * @author: luoyibo |
| | | */ |
| | | @Override |
| | | public boolean changeEmpJob(EmpJobChange empJobChange) { |
| | |
| | | |
| | | /** |
| | | * 导入员工 |
| | | * |
| | | * @param listObject |
| | | */ |
| | | @Override |
| | |
| | | out.write(buff); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public IPage<EmpBaseInfo> baseInfoList(String index, String btime, String etime, String pageSize, String pageNum, String number, String name) { |
| | |
| | | } |
| | | return stringObjectMap; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 检查是否是带条件查询 |
| | | * |
| | | * date 2021-02-26 13:49 |
| | | * @author: luoyibo |
| | | * @param empBaseInfo 人员参数 |
| | | * @return boolean |
| | | */ |
| | | private boolean checkQueryCondition(EmpBaseInfo empBaseInfo){ |
| | | int hasCondition = 0; |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpNumb())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpName())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDeptName())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEntryDateStr())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDimissionDateStr())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getSex())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEducation())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getPolitics())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getAgeStr())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getArchivesStatus())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) { |
| | | hasCondition = hasCondition|1; |
| | | } |
| | | return hasCondition==1; |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EmpBaseInfo> createQueryWrapper(EmpBaseInfo empBaseInfo){ |
| | | LambdaQueryWrapper<EmpBaseInfo> queryWrapper = new LambdaQueryWrapper<>(); |
| | | //记录的状态,0-正常 1-删除 2-暂存 |
| | | if(StringUtils.isNotBlank(empBaseInfo.getDelFlag().toString())) { |
| | | queryWrapper.eq(EmpBaseInfo::getDelFlag, empBaseInfo.getDelFlag()); |
| | | } else{ |
| | | queryWrapper.eq(EmpBaseInfo::getDelFlag, 0); |
| | | } |
| | | //人员的状态,0-在职 1-离职 2-退休 |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpStatus())) { |
| | | queryWrapper.in(EmpBaseInfo::getEmpStatus, empBaseInfo.getEmpStatus().split(",")); |
| | | } else{ |
| | | queryWrapper.in(EmpBaseInfo::getEmpStatus, 0); |
| | | } |
| | | // 下面的条件就是人员的属性条件,条件之间是或的关系 |
| | | if(this.checkQueryCondition(empBaseInfo)){ |
| | | queryWrapper.and(p -> { |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpNumb())) { |
| | | p.like(EmpBaseInfo::getEmpNumb, empBaseInfo.getEmpNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpName())) { |
| | | p.or().like(EmpBaseInfo::getEmpName, empBaseInfo.getEmpName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDeptName())) { |
| | | p.or().like(EmpBaseInfo::getDeptName, empBaseInfo.getDeptName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) { |
| | | p.or().like(EmpBaseInfo::getCertificateNumb, empBaseInfo.getCertificateNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEntryDateStr())) { |
| | | p.or().between(EmpBaseInfo::getEntryDate, empBaseInfo.getEntryDateStr().split(",")[0], empBaseInfo.getEntryDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDimissionDateStr())) { |
| | | p.or().between(EmpBaseInfo::getDimissionDate, empBaseInfo.getDimissionDateStr().split(",")[0], empBaseInfo.getDimissionDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getSex())) { |
| | | p.or().in(EmpBaseInfo::getSex, empBaseInfo.getSex().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEducation())) { |
| | | p.or().in(EmpBaseInfo::getEducation, empBaseInfo.getEducation().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getPolitics())) { |
| | | p.or().in(EmpBaseInfo::getPolitics, empBaseInfo.getPolitics().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getAgeStr())) { |
| | | String[] ages = empBaseInfo.getAgeStr().split(","); |
| | | Consumer<LambdaQueryWrapper<EmpBaseInfo>> consumer = new Consumer<LambdaQueryWrapper<EmpBaseInfo>>() { |
| | | @Override |
| | | public void accept(LambdaQueryWrapper<EmpBaseInfo> wrapper) { |
| | | for (int i = 0; i < ages.length; i++) { |
| | | String ageBtn = ages[i]; |
| | | wrapper.or().between(EmpBaseInfo::getAge, ageBtn.split("-")[0], ageBtn.split("-")[1]); |
| | | } |
| | | } |
| | | }; |
| | | p.or().and(consumer); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getArchivesStatus())) { |
| | | p.or().in(EmpBaseInfo::getArchivesStatus, empBaseInfo.getArchivesStatus().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) { |
| | | p.or().in(EmpBaseInfo::getInsuranceType, empBaseInfo.getInsuranceType().split(",")); |
| | | } |
| | | }); |
| | | } |
| | | return queryWrapper; |
| | | } |
| | | } |
| | |
| | | package cc.mrbird.febs.server.hr.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.core.constant.ModuleCode; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpBaseInfo; |
| | | import cc.mrbird.febs.server.hr.entity.EmpInsurance; |
| | | import cc.mrbird.febs.server.hr.entity.EmpUnemployment; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createEmpInsurance(EmpInsurance empInsurance) { |
| | | public void createEmpInsurance(EmpInsurance empInsurance) throws FebsException { |
| | | LambdaQueryWrapper<EmpInsurance> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpInsurance::getEmpId, empInsurance.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpInsurance::getApplayDate, empInsurance.getApplayDate()); |
| | | lambdaQueryWrapper.eq(EmpInsurance::getDelFlag, 0); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("此人已在本日期申请过社保"); |
| | | } |
| | | empInsurance.setInsuranceId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | empInsurance.setCreator(operatorId); |
| | | empInsurance.setModifier(operatorId); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateEmpInsurance(EmpInsurance empInsurance) { |
| | | public void updateEmpInsurance(EmpInsurance empInsurance) throws FebsException { |
| | | LambdaQueryWrapper<EmpInsurance> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpInsurance::getEmpId, empInsurance.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpInsurance::getApplayDate, empInsurance.getApplayDate()); |
| | | lambdaQueryWrapper.eq(EmpInsurance::getDelFlag, 0); |
| | | lambdaQueryWrapper.ne(EmpInsurance::getInsuranceId,empInsurance.getInsuranceId()); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("此人已在本日期申请过社保"); |
| | | } |
| | | EmpInsurance dbData = this.getById(empInsurance.getInsuranceId()); |
| | | empInsurance.setCreateTime(dbData.getCreateTime()); |
| | | empInsurance.setCreator(dbData.getCreator()); |
| | |
| | | |
| | | import cc.mrbird.febs.common.core.constant.ModuleCode; |
| | | import cc.mrbird.febs.server.hr.entity.EmpJobChange; |
| | | import cc.mrbird.febs.server.hr.entity.EmpJobChange; |
| | | import cc.mrbird.febs.server.hr.mapper.EmpJobChangeMapper; |
| | | import cc.mrbird.febs.server.hr.service.IEmpJobChangeService; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | .orElse("1"); |
| | | |
| | | @Override |
| | | public IPage<EmpJobChange> findEmpJobChanges(QueryRequest request, EmpJobChange empJobchange) { |
| | | LambdaQueryWrapper<EmpJobChange> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(EmpJobChange::getDelFlag, 0); |
| | | // if (StringUtils.isNotBlank(empJobchange.getEmpNumb())) { |
| | | // queryWrapper.like(EmpJobChange::getEmpNumb, empJobchange.getEmpNumb()); |
| | | // } |
| | | if (StringUtils.isNotBlank(empJobchange.getEmpName())) { |
| | | queryWrapper.like(EmpJobChange::getEmpName, empJobchange.getEmpName()); |
| | | public IPage<Map<String,Object>> findEmpJobChanges(QueryRequest request, EmpJobChange empJobchange) { |
| | | QueryWrapper<EmpJobChange> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("a.delFlag", 0); |
| | | if (StringUtils.isNotBlank(empJobchange.getEmpNumb())) { |
| | | queryWrapper.like("b.empNumb", empJobchange.getEmpNumb()); |
| | | } |
| | | // if (StringUtils.isNotBlank(empJobchange.getCertificateNumb())) { |
| | | // queryWrapper.like(EmpJobChange::getCertificateNumb, empJobchange.getCertificateNumb()); |
| | | // } |
| | | // if (StringUtils.isNotBlank(empJobchange.getDeptName())) { |
| | | // queryWrapper.like(EmpJobChange::getDeptName, empJobchange.getDeptName()); |
| | | // } |
| | | if (StringUtils.isNotBlank(empJobchange.getEmpName())) { |
| | | queryWrapper.like("a.empName", empJobchange.getEmpName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empJobchange.getCertificateNumb())) { |
| | | queryWrapper.like("b.certificateNumb", empJobchange.getCertificateNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empJobchange.getDeptName())) { |
| | | queryWrapper.like("a.newDeptName", empJobchange.getDeptName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empJobchange.getChangeDateStr())) { |
| | | queryWrapper.between(EmpJobChange::getChangeDate, empJobchange.getChangeDateStr().split(",")[0], empJobchange.getChangeDateStr().split(",")[1]); |
| | | queryWrapper.between("a.changeDate", empJobchange.getChangeDateStr().split(",")[0], empJobchange.getChangeDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empJobchange.getChangeType())) { |
| | | queryWrapper.eq(EmpJobChange::getChangeType, empJobchange.getChangeType()); |
| | | queryWrapper.eq("a.changeType", empJobchange.getChangeType()); |
| | | } |
| | | Page<EmpJobChange> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return this.page(page, queryWrapper); |
| | | return this.baseMapper.selectPageVo(page, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | |
| | | package cc.mrbird.febs.server.hr.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.core.constant.DicCode; |
| | | import cc.mrbird.febs.common.core.constant.ModuleCode; |
| | | import cc.mrbird.febs.server.hr.entity.EmpLaborTrouble; |
| | | import cc.mrbird.febs.server.hr.entity.EmpOccupational; |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.*; |
| | | import cc.mrbird.febs.server.hr.entity.EmpLaborTrouble; |
| | | import cc.mrbird.febs.server.hr.mapper.EmpLaborTroubleMapper; |
| | | import cc.mrbird.febs.server.hr.service.IEmpLaborTroubleService; |
| | |
| | | queryWrapper.like(EmpLaborTrouble::getArbitrationReason, empLabortrouble.getArbitrationReason()); |
| | | } |
| | | Page<EmpLaborTrouble> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return this.page(page, queryWrapper); |
| | | IPage<EmpLaborTrouble> iPage = this.page(page, queryWrapper); |
| | | iPage.setRecords(this.convertDicItemName(iPage.getRecords())); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public List<EmpLaborTrouble> findEmpLabortroubles(EmpLaborTrouble empLabortrouble) { |
| | | LambdaQueryWrapper<EmpLaborTrouble> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(EmpLaborTrouble::getDelFlag, empLabortrouble.getDelFlag()); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | return this.convertDicItemName(this.baseMapper.selectList(queryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createEmpLabortrouble(EmpLaborTrouble empLabortrouble) { |
| | | public void createEmpLabortrouble(EmpLaborTrouble empLabortrouble) throws FebsException { |
| | | LambdaQueryWrapper<EmpLaborTrouble> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpLaborTrouble::getEmpId, empLabortrouble.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpLaborTrouble::getArbitrationDate, empLabortrouble.getArbitrationDate()); |
| | | lambdaQueryWrapper.eq(EmpLaborTrouble::getDelFlag,0); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("当日记录已存在"); |
| | | } |
| | | empLabortrouble.setArbitrationId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | empLabortrouble.setCreator(operatorId); |
| | | empLabortrouble.setModifier(operatorId); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateEmpLabortrouble(EmpLaborTrouble empLabortrouble) { |
| | | public void updateEmpLabortrouble(EmpLaborTrouble empLabortrouble) throws FebsException { |
| | | LambdaQueryWrapper<EmpLaborTrouble> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpLaborTrouble::getEmpId, empLabortrouble.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpLaborTrouble::getArbitrationDate, empLabortrouble.getArbitrationDate()); |
| | | lambdaQueryWrapper.eq(EmpLaborTrouble::getDelFlag,0); |
| | | lambdaQueryWrapper.ne(EmpLaborTrouble::getArbitrationId,empLabortrouble.getArbitrationId()); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("当日记录已存在"); |
| | | } |
| | | EmpLaborTrouble dbData = this.getById(empLabortrouble.getArbitrationId()); |
| | | empLabortrouble.setCreateTime(dbData.getCreateTime()); |
| | | empLabortrouble.setCreator(dbData.getCreator()); |
| | |
| | | this.save(empLabortrouble); |
| | | } |
| | | } |
| | | |
| | | private List<EmpLaborTrouble> convertDicItemName(List<EmpLaborTrouble> list){ |
| | | List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class); |
| | | list.forEach(p -> { |
| | | //仲裁类型 |
| | | p.setArbitrationTypeName(dicItems.stream() |
| | | .filter(k -> DicCode.ARBITRATIONTYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getArbitrationType())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("劳资纠纷")); |
| | | }); |
| | | |
| | | return list; |
| | | } |
| | | } |
| | |
| | | package cc.mrbird.febs.server.hr.service.impl; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | import cc.mrbird.febs.common.core.constant.DicCode; |
| | | import cc.mrbird.febs.common.core.constant.ModuleCode; |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.core.entity.system.Dept; |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.common.core.utils.CastUtil; |
| | | import cc.mrbird.febs.common.core.utils.FebsUtil; |
| | | import cc.mrbird.febs.common.core.utils.SequenceUtil; |
| | | import cc.mrbird.febs.common.redis.service.RedisService; |
| | | import cc.mrbird.febs.server.hr.entity.EmpLeaveInfo; |
| | | import cc.mrbird.febs.server.hr.mapper.EmpLeaveInfoMapper; |
| | | import cc.mrbird.febs.server.hr.service.IEmpLeaveInfoService; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import cc.mrbird.febs.common.core.constant.ModuleCode; |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.core.entity.system.Dept; |
| | | import cc.mrbird.febs.common.core.utils.CastUtil; |
| | | import cc.mrbird.febs.common.core.utils.FebsUtil; |
| | | import cc.mrbird.febs.common.core.utils.SequenceUtil; |
| | | import cc.mrbird.febs.common.redis.service.RedisService; |
| | | import cc.mrbird.febs.server.hr.entity.EmpDimissionAttend; |
| | | import cc.mrbird.febs.server.hr.entity.EmpLeaveInfo; |
| | | import cc.mrbird.febs.server.hr.mapper.EmpLeaveInfoMapper; |
| | | import cc.mrbird.febs.server.hr.service.IEmpLeaveInfoService; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * name:EmpLeaveinfo |
| | |
| | | queryWrapper.le(EmpLeaveInfo::getEndTime, empLeaveinfo.getLeaveDateStr().split(",")[1]); |
| | | } |
| | | Page<EmpLeaveInfo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return this.page(page, queryWrapper); |
| | | IPage<EmpLeaveInfo> iPage = this.page(page, queryWrapper); |
| | | iPage.setRecords(this.convertDicItemName(iPage.getRecords())); |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | |
| | | this.save(leaveInfo); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 将列表中的字典项转换成字典名称 |
| | | * |
| | | * date 2021-02-26 19:37 |
| | | * @author: luoyibo |
| | | * @param list 1 |
| | | * @return java.util.List<cc.mrbird.febs.server.hr.entity.EmpLeaveInfo> |
| | | */ |
| | | private List<EmpLeaveInfo> convertDicItemName(List<EmpLeaveInfo> list){ |
| | | List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class); |
| | | list.forEach(p -> { |
| | | //请假类型 |
| | | p.setLeaveTypeName(dicItems.stream() |
| | | .filter(k -> DicCode.LEAVETYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getLeaveType())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("事假")); |
| | | }); |
| | | |
| | | return list; |
| | | } |
| | | } |
| | |
| | | package cc.mrbird.febs.server.hr.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.core.constant.ModuleCode; |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpResign; |
| | | import cc.mrbird.febs.server.hr.entity.EmpResign; |
| | | import cc.mrbird.febs.server.hr.entity.EmpUnemployment; |
| | | import cc.mrbird.febs.server.hr.mapper.EmpResignMapper; |
| | | import cc.mrbird.febs.server.hr.service.IEmpResignService; |
| | | import cn.hutool.core.date.DateUtil; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createEmpResign(EmpResign empResign) { |
| | | public void createEmpResign(EmpResign empResign) throws FebsException { |
| | | LambdaQueryWrapper<EmpResign> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpResign::getEmpId, empResign.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpResign::getApplayDate, empResign.getApplayDate()); |
| | | lambdaQueryWrapper.eq(EmpResign::getDelFlag,0); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("当日记录已存在"); |
| | | } |
| | | empResign.setResignId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | empResign.setCreator(operatorId); |
| | | empResign.setModifier(operatorId); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateEmpResign(EmpResign empResign) { |
| | | public void updateEmpResign(EmpResign empResign) throws FebsException { |
| | | LambdaQueryWrapper<EmpResign> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpResign::getEmpId, empResign.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpResign::getApplayDate, empResign.getApplayDate()); |
| | | lambdaQueryWrapper.eq(EmpResign::getDelFlag,0); |
| | | lambdaQueryWrapper.ne(EmpResign::getApplayDate,empResign.getApplayDate()); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("当日记录已存在"); |
| | | } |
| | | EmpResign dbData = this.getById(empResign.getResignId()); |
| | | empResign.setCreateTime(dbData.getCreateTime()); |
| | | empResign.setCreator(dbData.getCreator()); |
| | |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | import cc.mrbird.febs.common.core.exception.FebsException; |
| | | import cc.mrbird.febs.server.hr.entity.EmpLaborTrouble; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createEmpUnemployment(EmpUnemployment empUnemployment) { |
| | | public void createEmpUnemployment(EmpUnemployment empUnemployment) throws FebsException { |
| | | LambdaQueryWrapper<EmpUnemployment> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpUnemployment::getEmpId, empUnemployment.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpUnemployment::getApplayDate, empUnemployment.getApplayDate()); |
| | | lambdaQueryWrapper.eq(EmpUnemployment::getDelFlag,0); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("当日记录已存在"); |
| | | } |
| | | empUnemployment.setUnemploymentId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | empUnemployment.setCreator(operatorId); |
| | | empUnemployment.setModifier(operatorId); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateEmpUnemployment(EmpUnemployment empUnemployment) { |
| | | public void updateEmpUnemployment(EmpUnemployment empUnemployment) throws FebsException { |
| | | LambdaQueryWrapper<EmpUnemployment> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(EmpUnemployment::getEmpId, empUnemployment.getEmpId()); |
| | | lambdaQueryWrapper.eq(EmpUnemployment::getApplayDate, empUnemployment.getApplayDate()); |
| | | lambdaQueryWrapper.eq(EmpUnemployment::getDelFlag,0); |
| | | lambdaQueryWrapper.ne(EmpUnemployment::getApplayDate,empUnemployment.getApplayDate()); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("当日记录已存在"); |
| | | } |
| | | EmpUnemployment dbData = this.getById(empUnemployment.getUnemploymentId()); |
| | | empUnemployment.setCreateTime(dbData.getCreateTime()); |
| | | empUnemployment.setCreator(dbData.getCreator()); |
| | |
| | | config: |
| | | server-addr: ${nacos.url}:8848 |
| | | group: DEFAULT_GROUP |
| | | prefix: febs-server-Hr |
| | | prefix: febs-server-hr |
| | | file-extension: yaml |
| | | discovery: |
| | | server-addr: ${nacos.url}:8848 |
| | |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | @PostMapping |
| | | @PreAuthorize("hasAuthority('user:add')") |
| | | @ControllerEndpoint(operation = "新增用户", exceptionMessage = "新增用户失败") |
| | | public void addUser(@Valid SystemUser user) { |
| | | public void addUser(@Valid SystemUser user) throws FebsException { |
| | | this.userService.createUser(user); |
| | | } |
| | | |
| | | @PutMapping |
| | | @PreAuthorize("hasAuthority('user:update')") |
| | | @ControllerEndpoint(operation = "修改用户", exceptionMessage = "修改用户失败") |
| | | public void updateUser(@Valid SystemUser user) { |
| | | public void updateUser(@Valid SystemUser user) throws FebsException { |
| | | this.userService.updateUser(user); |
| | | } |
| | | |
| | |
| | | List<SystemUser> users = this.userService.findUserDetailList(user, queryRequest).getRecords(); |
| | | ExcelKit.$Export(SystemUser.class, response).downXlsx(users, false); |
| | | } |
| | | private static final String XLSX = ".xlsx"; |
| | | @PostMapping("import") |
| | | public FebsResponse importExcels(MultipartFile file) throws IOException, FebsException { |
| | | if (file.isEmpty()) { |
| | | throw new FebsException("导入数据为空"); |
| | | } |
| | | String filename = file.getOriginalFilename(); |
| | | if (!StringUtils.endsWith(filename, XLSX)) { |
| | | throw new FebsException("只支持.xlsx类型文件导入"); |
| | | } |
| | | Stopwatch stopwatch = Stopwatch.createStarted(); |
| | | final List<SystemUser> data = Lists.newArrayList(); |
| | | final List<Map<String, Object>> error = Lists.newArrayList(); |
| | | ExcelKit.$Import(SystemUser.class).readXlsx(file.getInputStream(), new ExcelReadHandler<SystemUser>() { |
| | | @Override |
| | | public void onSuccess(int sheet, int row, SystemUser eximport) { |
| | | data.add(eximport); |
| | | } |
| | | @Override |
| | | public void onError(int sheet, int row, List<ExcelErrorField> errorFields) { |
| | | error.add(ImmutableMap.of("row", row, "errorFields", errorFields)); |
| | | } |
| | | }); |
| | | if (CollectionUtils.isNotEmpty(data)) { |
| | | for (SystemUser systemUser:data){ |
| | | Dept one = deptService.getOne(new QueryWrapper<Dept>().eq("DEPT_NAME", systemUser.getDeptName())); |
| | | if(one!=null){ |
| | | systemUser.setDeptId(one.getDeptId()); |
| | | } |
| | | this.userService.createUser(systemUser); |
| | | } |
| | | } |
| | | ImmutableMap<String, Object> result = ImmutableMap.of( |
| | | "time", stopwatch.stop().toString(), |
| | | "data", data, |
| | | "error", error |
| | | ); |
| | | return new FebsResponse().data(result); |
| | | } |
| | | @PostMapping("template") |
| | | public void generateImportTemplate(HttpServletResponse response) { |
| | | List<SystemUser> list = new ArrayList<>(); |
| | | ExcelKit.$Export(SystemUser.class, response).downXlsx(list, true); |
| | | |
| | | @PostMapping("updateStatus") |
| | | public void updateStatus(@NotBlank(message = "{required}") String certificateNumb) { |
| | | this.userService.updateUserByCertificateNumb(certificateNumb); |
| | | } |
| | | } |
| | |
| | | * |
| | | * @param user user |
| | | */ |
| | | void createUser(SystemUser user); |
| | | void createUser(SystemUser user) throws FebsException; |
| | | |
| | | /** |
| | | * 修改用户 |
| | | * |
| | | * @param user user |
| | | */ |
| | | void updateUser(SystemUser user); |
| | | void updateUser(SystemUser user) throws FebsException; |
| | | |
| | | /** |
| | | * 删除用户 |
| | |
| | | */ |
| | | void resetPassword(String[] usernames); |
| | | |
| | | /** |
| | | * 冻结账户 |
| | | * @description |
| | | * @author yz |
| | | * @date 2021/2/26 10:11 下午 |
| | | * @method updateUserByCertificateNumb |
| | | * @param certificateNumb 身份证号码 |
| | | * @return void |
| | | */ |
| | | void updateUserByCertificateNumb(String certificateNumb); |
| | | |
| | | } |
| | |
| | | import cc.mrbird.febs.server.system.service.IUserRoleService; |
| | | import cc.mrbird.febs.server.system.service.IUserService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.logging.log4j.util.LambdaUtil; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createUser(SystemUser user) { |
| | | public void createUser(SystemUser user) throws FebsException { |
| | | LambdaQueryWrapper<SystemUser> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(SystemUser::getCertificateNumb, user.getCertificateNumb()); |
| | | lambdaQueryWrapper.eq(SystemUser::getUsername, user.getUsername()); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("此用户已存在"); |
| | | } |
| | | // 创建用户 |
| | | user.setCreateTime(new Date()); |
| | | user.setAvatar(SystemUser.DEFAULT_AVATAR); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateUser(SystemUser user) { |
| | | public void updateUser(SystemUser user) throws FebsException { |
| | | LambdaQueryWrapper<SystemUser> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(SystemUser::getCertificateNumb, user.getCertificateNumb()); |
| | | lambdaQueryWrapper.eq(SystemUser::getUsername, user.getUsername()); |
| | | lambdaQueryWrapper.ne(SystemUser::getUserId,user.getUserId()); |
| | | if (this.count(lambdaQueryWrapper) > 0) { |
| | | throw new FebsException("此用户已存在"); |
| | | } |
| | | // 更新用户 |
| | | user.setPassword(null); |
| | | user.setUsername(null); |
| | |
| | | CurrentUser currentUser = FebsUtil.getCurrentUser(); |
| | | return currentUser != null && id.equals(currentUser.getUserId()); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateUserByCertificateNumb(String certificateNumb) { |
| | | LambdaUpdateWrapper<SystemUser> lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
| | | lambdaUpdateWrapper.eq(SystemUser::getCertificateNumb,certificateNumb); |
| | | lambdaUpdateWrapper.set(SystemUser::getStatus,0); |
| | | lambdaUpdateWrapper.set(SystemUser::getModifyTime,new Date()); |
| | | this.update(lambdaUpdateWrapper); |
| | | } |
| | | |
| | | } |