From d81fca8baf1b14bfe372cb1e3d85c0afa7350db7 Mon Sep 17 00:00:00 2001
From: yz <yz_0812@outlook.com>
Date: 星期四, 04 三月 2021 02:11:56 +0800
Subject: [PATCH] 修改bug
---
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java
index 25c29d7..dab475f 100644
--- a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java
+++ b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java
@@ -14,6 +14,7 @@
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.mapper.EmpContractInfoMapper;
import cc.mrbird.febs.server.hr.properties.FebsServerHrProperties;
import cc.mrbird.febs.server.hr.service.IEmpContractInfoService;
import cc.mrbird.febs.server.hr.service.IEmpDimissionLogService;
@@ -48,6 +49,7 @@
import cc.mrbird.febs.server.hr.service.IEmpBaseInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.util.FileSystemUtils;
+import org.springframework.validation.annotation.Validated;
import javax.servlet.http.HttpServletResponse;
@@ -69,7 +71,7 @@
private final EmpBaseInfoMapper empBaseInfoMapper;
private final IEmpDimissionLogService dimissionLogService;
private final IEmpJobChangeService jobChangeService;
- private final IEmpContractInfoService empContractInfoService;
+ private final EmpContractInfoMapper empContractInfoMapper;
private final FebsServerHrProperties properties;
private final IRemoteDeptService remoteDeptService;
private final String operatorId = Optional.ofNullable(FebsUtil.getCurrentUser())
@@ -300,14 +302,15 @@
switch (flag) {
case 1:
//解除合同
- empContractInfoService.terminateContract(empDimissionLog.getEmpIds(), operatorId);
+
+ empContractInfoMapper.terminateContract(new ArrayList<>(Arrays.asList(empDimissionLog.getEmpIds().split(StringConstant.COMMA))), operatorId);
break;
case 2:
//禁用账户
iRemoteUserService.updateStatus(empDimissionLog.getCertificateNumb());
break;
case 3:
- empContractInfoService.terminateContract(empDimissionLog.getEmpIds(), operatorId);
+ empContractInfoMapper.terminateContract(new ArrayList<>(Arrays.asList(empDimissionLog.getEmpIds().split(StringConstant.COMMA))), operatorId);
iRemoteUserService.updateStatus(empDimissionLog.getCertificateNumb());
break;
}
@@ -375,7 +378,7 @@
continue;
}
if (this.count(new LambdaQueryWrapper<EmpBaseInfo>().eq(EmpBaseInfo::getEmpNumb,list.get(1).toString()).ne(EmpBaseInfo::getDelFlag,1))>0){
- returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}员工编号重复",listObject.indexOf(list),list.get(1).toString()));
+ returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}员工编号重复",listObject.indexOf(list)+1,list.get(1).toString()));
continue;
}
EmpBaseInfo empBaseInfo = new EmpBaseInfo();
@@ -387,7 +390,7 @@
empBaseInfo.setDeptName(list.get(3).toString());
Dept dept = depts.stream().filter(d -> d.getDeptName().equals(list.get(3).toString())).findFirst().orElse(null);
if (null == dept) {
- returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}部门不存在",listObject.indexOf(list),list.get(3).toString()));
+ returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}部门不存在",listObject.indexOf(list)+1,list.get(3).toString()));
continue;
}
empBaseInfo.setDeptId(dept.getDeptId());
@@ -909,4 +912,14 @@
return dbEmpInfo;
}
}
+
+ @Override
+ public Long getEmpIdByEmpNumb(String empNumb) {
+ try {
+ return this.getOne(new LambdaQueryWrapper<EmpBaseInfo>().eq(EmpBaseInfo::getEmpNumb,empNumb).ne(EmpBaseInfo::getDelFlag,1)).getEmpId();
+ }catch (Exception e){
+ return null;
+ }
+
+ }
}
--
Gitblit v1.8.0