Commit c8ba7ef0 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.6.9' into MVP1.6.9

parents 6e21cc82 a229403c
......@@ -20,8 +20,6 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 预入职-主表
*
......@@ -49,4 +47,10 @@ public class TPreEmpMainSearchVo extends TPreEmpMain {
@Schema(description = "查询limit 数据条数")
private int limitEnd;
/**
* 状态多选
*/
@Schema(description = "状态")
private String[] statusList;
}
......@@ -91,6 +91,20 @@ public class TEmployeeInfoController {
return R.ok(tEmployeeInfoService.getPage(page, tEmployeeInfo));
}
/**
* 分页查询
*
* @param page 分页对象
* @param tEmployeeInfo 人员档案表
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/pageAsso")
public R<IPage<TEmployeeInfo>> getTEmployeeInfoPagepageAsso(Page<TEmployeeInfo> page, TEmployeeInfo tEmployeeInfo) {
return R.ok(tEmployeeInfoService.getPageAsso(page, tEmployeeInfo));
}
/**
* 分页查询
*
......@@ -505,4 +519,16 @@ public class TEmployeeInfoController {
return tEmployeeInfoService.getHcmEmpInfoList(idCardList);
}
/**
* @Author fxj
* @Description 每年1月1号刷新在职和离职人员的年龄信息 公式:当前年-出生年
* @Date 17:29 2024/8/21
**/
@Operation(summary = "每年1月1号刷新在职和离职人员的年龄信息", description = "每年1月1号刷新在职和离职人员的年龄信息")
@Inner
@PostMapping("/inner/updateEmployeeAgeTask")
public void updateEmployeeAgeTask() {
tEmployeeInfoService.updateEmployeeAgeTask();
}
}
......@@ -38,6 +38,8 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, @Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
IPage<TEmployeeInfo> getPageAsso(Page<TEmployeeInfo> page, @Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
long getLeavePageCount(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
List<TEmployeeInfo> getLeavePage(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo, @Param("page")Long page, @Param("size")Long size);
......@@ -134,4 +136,5 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
// hgw 2023-11-23 11:38:00 HCM获取人员信息列表
List<HcmEmployeeInfoVO> getHcmEmpInfoList(@Param("idCardList") List<String> idCardList);
void updateEmployeeAgeTask();
}
......@@ -253,4 +253,7 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
**/
R<List<HcmEmployeeInfoVO>> getHcmEmpInfoList(List<String> idCardList);
void updateEmployeeAgeTask();
IPage<TEmployeeInfo> getPageAsso(Page<TEmployeeInfo> page, TEmployeeInfo tEmployeeInfo);
}
......@@ -2603,4 +2603,18 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
vo.setContract(baseMapper.getHcmContractVo(idCard));
return vo;
}
/**
* @Author fxj
* @Description 每年1月1号刷新在职和离职人员的年龄信息 公式:当前年-出生年
* @Date 17:30 2024/8/21
**/
@Override
public void updateEmployeeAgeTask() {
baseMapper.updateEmployeeAgeTask();
}
@Override
public IPage<TEmployeeInfo> getPageAsso(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo) {
return baseMapper.getPageAsso(page, employeeInfo);
}
}
......@@ -562,6 +562,30 @@
</if>
order by a.CREATE_TIME desc
</select>
<!-- fxj 2024-08-23 身份证/姓名 下拉选择 查询 在职和离职数据 -->
<select id="getPageAsso" resultMap="tEmployeeInfoMap">
select
a.EMP_NAME,
a.EMP_IDCARD
from t_employee_info a
where 1=1
<if test="tEmployeeInfo != null">
<if test="tEmployeeInfo.empName != null and tEmployeeInfo.empName.trim() != ''">
AND a.EMP_NAME like concat('%',#{tEmployeeInfo.empName},'%')
</if>
<if test="tEmployeeInfo.empIdcard != null and tEmployeeInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD like concat('%',#{tEmployeeInfo.empIdcard},'%')
</if>
</if>
<if test="tEmployeeInfo.nameOrIdcard != null and tEmployeeInfo.nameOrIdcard.trim() != ''">
AND (
a.EMP_NAME like concat(#{tEmployeeInfo.nameOrIdcard},'%')
or
a.EMP_IDCARD like concat(#{tEmployeeInfo.nameOrIdcard},'%')
)
</if>
order by a.CREATE_TIME desc
</select>
<!-- hgw 分页查询 -->
<select id="getLeavePage" resultMap="tEmployeeExportMap">
......@@ -1330,4 +1354,9 @@
</foreach>
</select>
<!-- 员工年龄+1 定时任务方法 专用 -->
<update id="updateEmployeeAgeTask">
update t_employee_info set EMP_AGE = YEAR(CURRENT_DATE())-YEAR(STR_TO_DATE(SUBSTRING(EMP_IDCARD,7,4),'%Y')) where EMP_IDCARD is not null and DELETE_FLAG='0' and SUBSTRING(EMP_IDCARD,7,1) in ('1','2')
</update>
</mapper>
......@@ -85,6 +85,12 @@
</sql>
<sql id="tPreEmpMain_where">
<if test="tPreEmpMain != null">
<if test="tPreEmpMain.statusList != null and tPreEmpMain.statusList.length>0">
AND a.STATUS IN
<foreach collection="tPreEmpMain.statusList" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="tPreEmpMain.id != null and tPreEmpMain.id.trim() != ''">
AND a.ID = #{tPreEmpMain.id}
</if>
......
......@@ -1538,12 +1538,13 @@ public class DateUtil {
* @Author: hgw
* @Date: 2022/6/24 16:49
* @return: int
* update 2024-08-21 fxj thisYear - years +1 调整为 thisYear - years
**/
public static int getAge(int years){
SimpleDateFormat sf = new SimpleDateFormat(DateUtil.DATETIME_YYYY);
Date nowDate = new Date();
int thisYear = Integer.parseInt(sf.format(nowDate));
return thisYear - years + 1;
return thisYear - years;
}
/**
......
......@@ -273,8 +273,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 学历名称
*/
@ExcelAttribute(name = "学历",isNotEmpty = true)
@NotNull(message = "学历不可为空")
@ExcelAttribute(name = "学历",isNotEmpty = false)
@Schema(description = "学历:派增只做记录" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="学历")
......
......@@ -2315,7 +2315,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
|| Common.isEmpty(excel.getEmpMobile())
|| Common.isEmpty(excel.getEmpType())
|| Common.isEmpty(excel.getPost())
//|| Common.isEmpty(excel.getEducationName())
|| Common.isEmpty(excel.getEmpRegisType()) //无档案必填2024-08-21 fxj
|| Common.isEmpty(excel.getEducationName()) //无档案必填2024-08-21 fxj
|| Common.isEmpty(excel.getContractName())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_NOT_EMPTY)));
return true;
......@@ -2403,7 +2404,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
excel.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity()));
excel.setIdCardTown(Common.isNotNullToStr(empVo.getIdCity()));
excel.setEmpNational(empVo.getEmpNational());
excel.setEmpRegisType(empVo.getEmpRegisType());
if (Common.isNotNull(empVo.getEmpRegisType())){
//如果档案有值直接取值档案 2024-08-21 fxj
excel.setEmpRegisType(empVo.getEmpRegisType());
}
//派单学历无值时,如果档案有值直接取值档案 2024-08-21 fxj
initEducation(excel, empVo);
if (Common.isEmpty(excel.getPost())){
excel.setPost(empVo.getPost());
}
......@@ -2553,6 +2559,44 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return false;
}
private void initEducation(TDispatchImportVo excel, DispatchEmpVo empVo) {
if (Common.isNotNull(empVo.getHignEducation())){
if (empVo.getHignEducation().equals("1")) {
excel.setEducationName("文盲");
}
if (empVo.getHignEducation().equals("2")) {
excel.setEducationName("小学");
}
if (empVo.getHignEducation().equals("3")) {
excel.setEducationName("初中");
}
if (empVo.getHignEducation().equals("4")) {
excel.setEducationName("高中");
}
if (empVo.getHignEducation().equals("5")) {
excel.setEducationName("大专");
}
if (empVo.getHignEducation().equals("6")) {
excel.setEducationName("本科");
}
if (empVo.getHignEducation().equals("7")) {
excel.setEducationName("硕士");
}
if (excel.getEducationName().equals("8")) {
excel.setEducationName("博士");
}
if (empVo.getHignEducation().equals("9")) {
excel.setEducationName("技工");
}
if (empVo.getHignEducation().equals("10")) {
excel.setEducationName("职高");
}
if (empVo.getHignEducation().equals("11")) {
excel.setEducationName("中专");
}
}
}
/**
* @param errorMessageList
* @param excel
......
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