薪酬系统导入方式配置-社保福利台账核算导入,添加导入人员筛选配置化处理
This commit is contained in:
parent
3c007f8e0b
commit
c13ca103f3
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.cloudstore.eccom.pc.table.*;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
|
|
@ -36,8 +37,10 @@ import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper;
|
|||
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
|
||||
import com.engine.salary.mapper.siaccount.InsuranceAccountInspectMapper;
|
||||
import com.engine.salary.mapper.sicategory.ICategoryMapper;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryFormItemUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
|
|
@ -120,6 +123,14 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
|
||||
SICategoryBiz siCategoryBiz = new SICategoryBiz();
|
||||
|
||||
private SalarySysConfMapper getSalarySysConfMapper() {
|
||||
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
|
||||
}
|
||||
|
||||
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
|
||||
return (SalaryAcctEmployeeService) ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listPage(InsuranceAccountBatchParam queryParam) {
|
||||
Long employeeId = (long) user.getUID();
|
||||
|
|
@ -1023,6 +1034,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
EmployBiz employBiz = new EmployBiz();
|
||||
|
||||
//查询对于人员信息导入筛选的全局配置
|
||||
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
|
||||
|
||||
//检验参数
|
||||
//excel文件id
|
||||
String imageId = Util.null2String(importParam.getImageId());
|
||||
|
|
@ -1107,19 +1121,19 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
String dataValue = (String) map.getOrDefault(dataKey.toString(), "");
|
||||
String deparmentName = (String) map.getOrDefault("部门", "");
|
||||
String mobile = (String) map.getOrDefault("手机号", "");
|
||||
String workcode = (String) map.getOrDefault("工号", "");
|
||||
|
||||
if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) {
|
||||
if (StringUtils.isEmpty(dataValue)) {
|
||||
//当人员信息导入筛选的全局配置为"0"时,姓名才是必填项
|
||||
if (StringUtils.isEmpty(dataValue) && "0".equals(salarySysConfPO.getConfValue())) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"));
|
||||
excelComments.add(errorMessageMap);
|
||||
|
||||
} else {
|
||||
List<DataCollectionEmployee> employeeSameIds = salaryEmployees.stream().filter(e -> (StringUtils.isBlank(dataValue) || Objects.equals(e.getUsername(), dataValue))
|
||||
&& (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName))
|
||||
&& (StringUtils.isBlank(mobile) || Objects.equals(e.getMobile(), mobile)))
|
||||
.collect(Collectors.toList());
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
List<DataCollectionEmployee> employeeSameIds = getSalaryAcctEmployeeService(user).matchImportEmployee(salaryEmployees, dataValue, deparmentName, mobile, workcode);
|
||||
|
||||
if (CollectionUtils.isEmpty(employeeSameIds)) {
|
||||
isError = true;
|
||||
|
|
@ -1135,7 +1149,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
if (employeeSameIds.size() != 1) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", row + "员工信息不能为空且不可重复(姓名、部门和手机号同时确认唯一)");
|
||||
errorMessageMap.put("message", row + "员工信息不存在或者存在多个员工");
|
||||
excelComments.add(errorMessageMap);
|
||||
} else {
|
||||
employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;
|
||||
|
|
@ -1144,12 +1158,14 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
employeeId = employeeSameIds.get(0).getEmployeeId();
|
||||
}
|
||||
}
|
||||
}else if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(86184, "部门"), dataKey.toString())) {
|
||||
|
||||
} else if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), dataKey.toString())) {
|
||||
|
||||
}
|
||||
|
||||
// else if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(86184, "部门"), dataKey.toString())) {
|
||||
//
|
||||
// } else if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), dataKey.toString())) {
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
if (!isError){
|
||||
|
|
|
|||
Loading…
Reference in New Issue