Commit d6d3c102 authored by fangxinjiang's avatar fangxinjiang

学历信息接口更新

parent 04c3e418
...@@ -53,8 +53,6 @@ public class EmpEducationExcelVO implements Serializable { ...@@ -53,8 +53,6 @@ public class EmpEducationExcelVO implements Serializable {
@Schema(description ="学历") @Schema(description ="学历")
private String educationName; private String educationName;
/** /**
* 学校名称 * 学校名称
*/ */
......
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @Author fxj
* @Date 2022/6/20
* @Description
* @Version 1.0
*/
@Data
public class EmpEducationUpdateVo extends TEmpEducation {
/**
* 是否大专及以上(0否1是)
*/
@Schema(description = "是否大专及以上(0否1是)")
private Integer isCollege;
}
...@@ -25,10 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TCustomerInfoService; ...@@ -25,10 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TCustomerInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -25,10 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TCutsomerDataPermissonServic ...@@ -25,10 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TCutsomerDataPermissonServic
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -24,10 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService; ...@@ -24,10 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -24,10 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpChangeInfoService; ...@@ -24,10 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpChangeInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -21,23 +21,19 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -21,23 +21,19 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.plugin.excel.annotation.RequestExcel; import com.pig4cloud.plugin.excel.annotation.RequestExcel;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.PostExcelVO;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpDisabilityInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpDisabilityInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpDisabilityInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpDisabilityInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpDisabilityExcelVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpDisabilityExcelVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.net.URLDecoder;
import java.util.List; import java.util.List;
......
...@@ -25,16 +25,13 @@ import com.pig4cloud.plugin.excel.vo.ErrorMessage; ...@@ -25,16 +25,13 @@ import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpEducationService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpEducationService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationExcelVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationExcelVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpWorkRecordExcelVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -92,7 +89,7 @@ public class TEmpEducationController { ...@@ -92,7 +89,7 @@ public class TEmpEducationController {
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('archives_tempeducation_add')" ) @PreAuthorize("@pms.hasPermission('archives_tempeducation_add')" )
public R<Boolean> save(@RequestBody TEmpEducation tEmpEducation) { public R<Boolean> save(@RequestBody TEmpEducation tEmpEducation) {
return R.ok(tEmpEducationService.save(tEmpEducation)); return tEmpEducationService.saveDiy(tEmpEducation);
} }
/** /**
...@@ -105,7 +102,7 @@ public class TEmpEducationController { ...@@ -105,7 +102,7 @@ public class TEmpEducationController {
@PutMapping @PutMapping
@PreAuthorize("@pms.hasPermission('archives_tempeducation_edit')" ) @PreAuthorize("@pms.hasPermission('archives_tempeducation_edit')" )
public R<Boolean> updateById(@RequestBody TEmpEducation tEmpEducation) { public R<Boolean> updateById(@RequestBody TEmpEducation tEmpEducation) {
return R.ok(tEmpEducationService.updateById(tEmpEducation)); return tEmpEducationService.updateByIdDiy(tEmpEducation);
} }
/** /**
...@@ -120,6 +117,7 @@ public class TEmpEducationController { ...@@ -120,6 +117,7 @@ public class TEmpEducationController {
public R<Boolean> removeById(@PathVariable Long id) { public R<Boolean> removeById(@PathVariable Long id) {
return R.ok(tEmpEducationService.removeById(id)); return R.ok(tEmpEducationService.removeById(id));
} }
/** /**
* 通过id删除员工学历信息表 * 通过id删除员工学历信息表
* @param ids * @param ids
......
...@@ -30,10 +30,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; ...@@ -30,10 +30,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -24,10 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpProfessionalQualificatio ...@@ -24,10 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpProfessionalQualificatio
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -30,10 +30,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; ...@@ -30,10 +30,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -25,10 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService; ...@@ -25,10 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -56,7 +54,7 @@ public class TEmployeeInfoController { ...@@ -56,7 +54,7 @@ public class TEmployeeInfoController {
*/ */
@Operation(summary = "分页查询", description = "分页查询") @Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page") @GetMapping("/page")
@PreAuthorize("@pms.hasPermission('demo_temployeeinfo_get')") //@PreAuthorize("@pms.hasPermission('demo_temployeeinfo_get')")
public R<IPage<TEmployeeInfo>> getTEmployeeInfoPage(Page<TEmployeeInfo> page, TEmployeeInfo tEmployeeInfo) { public R<IPage<TEmployeeInfo>> getTEmployeeInfoPage(Page<TEmployeeInfo> page, TEmployeeInfo tEmployeeInfo) {
return R.ok(tEmployeeInfoService.page(page, Wrappers.query(tEmployeeInfo))); return R.ok(tEmployeeInfoService.page(page, Wrappers.query(tEmployeeInfo)));
} }
......
...@@ -25,10 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService; ...@@ -25,10 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -23,12 +23,10 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; ...@@ -23,12 +23,10 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -25,10 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService; ...@@ -25,10 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -19,7 +19,9 @@ package com.yifu.cloud.plus.v1.yifu.archives.mapper; ...@@ -19,7 +19,9 @@ package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* 人员档案表 * 人员档案表
...@@ -30,4 +32,5 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -30,4 +32,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> { public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
int updateEducationOfEmp(@Param("education") EmpEducationUpdateVo education);
} }
...@@ -35,4 +35,8 @@ import java.util.List; ...@@ -35,4 +35,8 @@ import java.util.List;
public interface TEmpEducationService extends IService<TEmpEducation> { public interface TEmpEducationService extends IService<TEmpEducation> {
R<List<ErrorMessage>> importEmpEducation(List<EmpEducationExcelVO> excelVOList, BindingResult bindingResult); R<List<ErrorMessage>> importEmpEducation(List<EmpEducationExcelVO> excelVOList, BindingResult bindingResult);
R<Boolean> updateByIdDiy(TEmpEducation tEmpEducation);
R<Boolean> saveDiy(TEmpEducation tEmpEducation);
} }
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVo;
/** /**
* 人员档案表 * 人员档案表
...@@ -28,4 +29,5 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; ...@@ -28,4 +29,5 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
*/ */
public interface TEmployeeInfoService extends IService<TEmployeeInfo> { public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
void updateEducationOfEmp(EmpEducationUpdateVo education);
} }
...@@ -20,8 +20,6 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -20,8 +20,6 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysPost;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.PostExcelVO;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpDisabilityInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpDisabilityInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpDisabilityInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpDisabilityInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpDisabilityInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpDisabilityInfoService;
......
...@@ -16,17 +16,29 @@ ...@@ -16,17 +16,29 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.service.impl; package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpEducationMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpEducationMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpEducationService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpEducationService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationExcelVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationExcelVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import java.util.List; import java.util.*;
/** /**
* 员工学历信息表 * 员工学历信息表
...@@ -34,11 +46,145 @@ import java.util.List; ...@@ -34,11 +46,145 @@ import java.util.List;
* @author fxj * @author fxj
* @date 2022-06-18 09:39:46 * @date 2022-06-18 09:39:46
*/ */
@RequiredArgsConstructor
@Service @Service
public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, TEmpEducation> implements TEmpEducationService { public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, TEmpEducation> implements TEmpEducationService {
private final TEmployeeInfoMapper employeeInfoMapper;
/**
* @Author fxj
* @Description 批量导入学历信息
* @Date 16:16 2022/6/20
**/
@Transactional
@Override @Override
public R<List<ErrorMessage>> importEmpEducation(List<EmpEducationExcelVO> excelVOList, BindingResult bindingResult) { public R<List<ErrorMessage>> importEmpEducation(List<EmpEducationExcelVO> excelVOList, BindingResult bindingResult) {
return null; // 通用校验获取失败的数据
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
Map<Long,ErrorMessage> errorMsgMap = new HashMap<>();
if (Common.isNotNull(errorMessageList)){
errorMessageList.stream().forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(),errorMessage));
}
// 个性化校验逻辑
List<TEmpEducation> list = this.list();
TEmployeeInfo emp;
TEmpEducation exist;
Set<String> errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
// 已有验证报错直接下一个
if (Common.isNotNull(errorMsgMap.get(i+2))){
continue;
}
errorMsg = new HashSet<>();
EmpEducationExcelVO excel = excelVOList.get(i);
emp = employeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard,excel.getEmpIdcard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(emp)){
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_NOT_EXIST, excel.getEmpIdcard()));
}
if (CommonConstants.ONE_STRING.equals(emp.getFileStatus())){
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED, excel.getEmpIdcard()));
}
// 检查添加人员是否已经存在
boolean match = list.stream().anyMatch(info -> excel.getEducationName().equals(info.getEducationName())
&& excel.getEmpIdcard().equals(info.getEmpIdcard()));
if (match) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_EDUCATION_EXISTING, excel.getEmpName()));
}
exist = baseMapper.selectOne(Wrappers.<TEmpEducation>query().lambda()
.eq(TEmpEducation::getEmpIdcard,excel.getEmpIdcard())
.eq(TEmpEducation::getEducationName,excel.getEducationName())
.eq(TEmpEducation::getDeleteFlag,CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(exist)){
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_EDUCATION_EXISTING, excel.getEducationName()));
}
// 数据合法情况
if (CollUtil.isEmpty(errorMsg)) {
insertExcelPost(excel,emp);
} else {
// 数据不合法
errorMessageList.add(new ErrorMessage((long) (i + 2), errorMsg));
}
}
if (CollUtil.isNotEmpty(errorMessageList)) {
return R.failed(errorMessageList);
}
return R.ok();
}
/**
* @Author fxj
* @Description 更新学历信息
* @Date 16:17 2022/6/20
**/
@Transactional
@Override
public R<Boolean> updateByIdDiy(TEmpEducation tEmpEducation) {
TEmpEducation education = baseMapper.selectOne(Wrappers.<TEmpEducation>query().lambda()
.eq(TEmpEducation::getEmpIdcard,tEmpEducation.getEmpIdcard())
.eq(TEmpEducation::getEducationName,tEmpEducation.getEducationName())
.eq(TEmpEducation::getId,tEmpEducation.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(education)){
return R.failed(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_EDUCATION_EXISTING, tEmpEducation.getEducationName()));
} }
updateEducationOfEmp(education);
baseMapper.updateById(tEmpEducation);
return R.ok();
}
/**
* @Author fxj
* @Description 保存 学历信息
* @Date 16:17 2022/6/20
**/
@Transactional
@Override
public R<Boolean> saveDiy(TEmpEducation tEmpEducation) {
TEmpEducation education = baseMapper.selectOne(Wrappers.<TEmpEducation>query().lambda()
.eq(TEmpEducation::getEmpIdcard,tEmpEducation.getEmpIdcard())
.eq(TEmpEducation::getEducationName,tEmpEducation.getEducationName())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(education)){
return R.failed(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_EDUCATION_EXISTING, tEmpEducation.getEducationName()));
}
updateEducationOfEmp(education);
baseMapper.insert(tEmpEducation);
return R.ok();
}
private void updateEducationOfEmp(TEmpEducation education) {
if (CommonConstants.ZERO_STRING.equals(education.getHighIdentification())){
EmpEducationUpdateVo updateVo = new EmpEducationUpdateVo();
BeanUtil.copyProperties(education, updateVo);
if (Integer.parseInt(education.getEducationName()) >= CommonConstants.FOUR_INT){
updateVo.setIsCollege(CommonConstants.ZERO_INT);
}else {
updateVo.setIsCollege(CommonConstants.ONE_INT);
}
employeeInfoMapper.updateEducationOfEmp(updateVo);
}
}
/**
* 插入excel education
*/
private void insertExcelPost(EmpEducationExcelVO excel,TEmployeeInfo emp) {
TEmpEducation insert = new TEmpEducation();
BeanUtil.copyProperties(excel, insert);
insert.setDeleteFlag(CommonConstants.ZERO_STRING);
insert.setEmpCode(emp.getEmpCode());
insert.setEmpId(emp.getId());
insert.setEmpCode(emp.getEmpCode());
// 更新档案学历信息
updateEducationOfEmp(insert);
this.save(insert);
}
} }
...@@ -23,24 +23,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -23,24 +23,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage; import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpDisabilityInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpFamilyMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpFamilyMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpFamilyService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpFamilyService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpDisabilityExcelVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpFamilyExcelVO; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpFamilyExcelVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes; import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.omg.PortableInterceptor.INACTIVE;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
...@@ -144,7 +138,7 @@ public class TEmpFamilyServiceImpl extends ServiceImpl<TEmpFamilyMapper, TEmpFam ...@@ -144,7 +138,7 @@ public class TEmpFamilyServiceImpl extends ServiceImpl<TEmpFamilyMapper, TEmpFam
} }
/** /**
* 插入excel Post * 插入excel family
*/ */
private void insertExcelPost(EmpFamilyExcelVO excel,TEmployeeInfo emp) { private void insertExcelPost(EmpFamilyExcelVO excel,TEmployeeInfo emp) {
TEmpFamily insert = new TEmpFamily(); TEmpFamily insert = new TEmpFamily();
......
...@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -31,4 +32,8 @@ import org.springframework.stereotype.Service; ...@@ -31,4 +32,8 @@ import org.springframework.stereotype.Service;
@Service @Service
public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, TEmployeeInfo> implements TEmployeeInfoService { public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, TEmployeeInfo> implements TEmployeeInfoService {
@Override
public void updateEducationOfEmp(EmpEducationUpdateVo education) {
baseMapper.updateEducationOfEmp(education);
}
} }
...@@ -73,4 +73,17 @@ ...@@ -73,4 +73,17 @@
<result property="leaveReason" column="LEAVE_REASON"/> <result property="leaveReason" column="LEAVE_REASON"/>
<result property="leaveRemark" column="LEAVE_REMARK"/> <result property="leaveRemark" column="LEAVE_REMARK"/>
</resultMap> </resultMap>
<update id="updateEducationOfEmp">
update t_employee_info
<trim prefix="set" suffixOverrides=",">
<if test="education.isCollege != null">is_college=#{education.isCollege},</if>
<if test="education.hignEducation != null">hign_education=#{education.hignEducation},</if>
<if test="education.school != null">school=#{education.school},</if>
<if test="education.major != null">major=#{education.major},</if>
<if test="education.admissionDate != null">admission_date=#{education.admissionDate},</if>
<if test="education.gradutionDate != null">gradution_date=#{education.gradutionDate},</if>
</trim>
WHERE id=#{education.empId}
</update>
</mapper> </mapper>
...@@ -113,6 +113,11 @@ public interface CommonConstants { ...@@ -113,6 +113,11 @@ public interface CommonConstants {
*/ */
String ZERO_STRING = "0"; String ZERO_STRING = "0";
/**
* number 0
*/
int ZERO_INT = 0;
/** /**
* number 1 * number 1
*/ */
...@@ -150,21 +155,21 @@ public interface CommonConstants { ...@@ -150,21 +155,21 @@ public interface CommonConstants {
* @Author pwang * @Author pwang
* @Date 2019-08-02 16:39 * @Date 2019-08-02 16:39
**/ **/
public static int[] dingleDigitIntArray = {0,1,2,3,4,5,6,7,8,9}; int[] dingleDigitIntArray = {0,1,2,3,4,5,6,7,8,9};
/** /**
* 个位数字串(阿里编码规约不允许直接使用‘魔法值’) * 个位数字串(阿里编码规约不允许直接使用‘魔法值’)
* @Author pwang * @Author pwang
* @Date 2019-08-02 16:39 * @Date 2019-08-02 16:39
**/ **/
public static String[] dingleDigitStrArray = {"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"}; String[] dingleDigitStrArray = {"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"};
/** /**
* 逗号 * 逗号
* @Author fxj * @Author fxj
**/ **/
public static final char COMMA_CHAR = ','; char COMMA_CHAR = ',';
public static final char SPOT_CHAR = '.'; char SPOT_CHAR = '.';
/** /**
* 100 * 100
* @Author fxj * @Author fxj
...@@ -172,22 +177,24 @@ public interface CommonConstants { ...@@ -172,22 +177,24 @@ public interface CommonConstants {
int INTEGER_HUNDRED = 100; int INTEGER_HUNDRED = 100;
//,逗号 //,逗号
public static final String COMMA_STRING = ","; String COMMA_STRING = ",";
//、顿号 //、顿号
public static final String DUNHAO_STRING = "、"; String DUNHAO_STRING = "、";
//- 横 //- 横
public static final char DOWN_LINE_CHAR ='_'; char DOWN_LINE_CHAR ='_';
// 冒号 : // 冒号 :
public static final String COLON_STRING =":"; String COLON_STRING =":";
// - 横 分割线 中 // - 横 分割线 中
public static final String CENTER_SPLIT_LINE_STRING = "-"; String CENTER_SPLIT_LINE_STRING = "-";
// 斜杠 // 斜杠
public static final String SLASH_SPLIT_LINE_STRING = "/"; String SLASH_SPLIT_LINE_STRING = "/";
// = 等 // = 等
public static final char ETC_CHAR = '='; char ETC_CHAR = '=';
// = 等 // = 等
public static final String ETC_STRING = "="; String ETC_STRING = "=";
//+ 加 //+ 加
public static final char ADD_CHAR = '+'; char ADD_CHAR = '+';
//int 4
int FOUR_INT = 4;
} }
...@@ -184,4 +184,9 @@ public interface ErrorCodes { ...@@ -184,4 +184,9 @@ public interface ErrorCodes {
* 已存在对应身份证的工作记录信息 * 已存在对应身份证的工作记录信息
*/ */
String ARCHIVES_EMP_WORK_RECORD_EXISTING = "archives.emp.work.record.existing"; String ARCHIVES_EMP_WORK_RECORD_EXISTING = "archives.emp.work.record.existing";
/**
* 已存在该员工对应学历名称的学历信息
*/
String ARCHIVES_EMP_EDUCATION_EXISTING = "archives.emp.education.existing";
} }
...@@ -46,6 +46,7 @@ archives.emp.family.name.existing=\u5DF2\u5B58\u5728\u5BF9\u5E94\u8EAB\u4EFD\u8B ...@@ -46,6 +46,7 @@ archives.emp.family.name.existing=\u5DF2\u5B58\u5728\u5BF9\u5E94\u8EAB\u4EFD\u8B
archives.emp.not.exist=\u65E0\u5BF9\u5E94\u8EAB\u4EFD\u8BC1\u7684\u5458\u5DE5\u4FE1\u606F archives.emp.not.exist=\u65E0\u5BF9\u5E94\u8EAB\u4EFD\u8BC1\u7684\u5458\u5DE5\u4FE1\u606F
archives.emp.reduced=\u5458\u5DE5\u5DF2\u51CF\u6863 archives.emp.reduced=\u5458\u5DE5\u5DF2\u51CF\u6863
archives.emp.work.record.existing=\u5DF2\u5B58\u5728\u5BF9\u5E94\u8EAB\u4EFD\u8BC1\u7684\u5DE5\u4F5C\u8BB0\u5F55\u4FE1\u606F archives.emp.work.record.existing=\u5DF2\u5B58\u5728\u5BF9\u5E94\u8EAB\u4EFD\u8BC1\u7684\u5DE5\u4F5C\u8BB0\u5F55\u4FE1\u606F
archives.emp.education.existing=\u5DF2\u5B58\u5728\u8BE5\u5458\u5DE5\u5BF9\u5E94\u5B66\u5386\u540D\u79F0\u7684\u5B66\u5386\u4FE1\u606F
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment