薪酬系统导入方式配置-数据采集-其他免税扣除-导入,添加导入人员筛选配置化处理
This commit is contained in:
parent
b06eae55d8
commit
d49d187506
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.EmployBiz;
|
||||
|
|
@ -18,10 +19,9 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
|||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.datacollection.OtherDeductionMapper;
|
||||
import com.engine.salary.service.AddUpDeductionService;
|
||||
import com.engine.salary.service.OtherDeductionService;
|
||||
import com.engine.salary.service.SalaryEmployeeService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
|
|
@ -67,6 +67,15 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
|
||||
return (SalaryAcctEmployeeService) ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySysConfMapper getSalarySysConfMapper() {
|
||||
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public OtherDeductionPO getById(Long id) {
|
||||
return getOtherDeductionMapper().getById(id);
|
||||
|
|
@ -153,6 +162,10 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
EmployBiz employBiz = new EmployBiz();
|
||||
OtherDeductionBiz OtherDeductionBiz = new OtherDeductionBiz();
|
||||
|
||||
//查询对于人员信息导入筛选的全局配置
|
||||
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
|
||||
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
|
||||
|
||||
//检验参数
|
||||
checkImportParam(importParam);
|
||||
|
||||
|
|
@ -213,12 +226,12 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
String userName = dto.getUsername();
|
||||
String deparmentName = dto.getDepartmentName();
|
||||
String mobile = dto.getMobile();
|
||||
String workcode = dto.getJobNum();
|
||||
List<Long> employeeSameIds = new ArrayList<>();
|
||||
|
||||
List<DataCollectionEmployee> emps = employees.stream().filter(e -> (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName))
|
||||
&& (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName))
|
||||
&& (StringUtils.isBlank(mobile) || Objects.equals(e.getMobile(), mobile)))
|
||||
.collect(Collectors.toList());
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
List<DataCollectionEmployee> emps = getSalaryAcctEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode);
|
||||
|
||||
//含在职和离职,选在职数据
|
||||
if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) {
|
||||
employeeSameIds = emps.stream()
|
||||
|
|
@ -233,7 +246,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
}
|
||||
|
||||
|
||||
if (StringUtils.isBlank(userName)) {
|
||||
if (StringUtils.isBlank(userName) && "0".equals(confValue)) {
|
||||
//姓名 不能为空
|
||||
//错误消息对象
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
|
|
|
|||
Loading…
Reference in New Issue