薪酬系统导入方式配置-人员匹配全局配置的confValue默认设为0

This commit is contained in:
sy 2022-09-19 15:11:27 +08:00
parent eb033d64fd
commit b0cc2cc19d
5 changed files with 44 additions and 7 deletions

View File

@ -208,6 +208,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
//查询对于人员信息导入筛选的全局配置
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
InputStream fileInputStream = null;
try {
@ -253,7 +254,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
List<DataCollectionEmployee> employeeSameIds = getSalaryAcctEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode);
if (StringUtils.isBlank(userName) && "0".equals(salarySysConfPO.getConfValue())) {
if (StringUtils.isBlank(userName) && "0".equals(confValue)) {
//姓名 不能为空
//错误消息对象
Map<String, String> errorMessageMap = Maps.newHashMap();

View File

@ -1036,7 +1036,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
//查询对于人员信息导入筛选的全局配置
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
//检验参数
//excel文件id
String imageId = Util.null2String(importParam.getImageId());
@ -1125,7 +1125,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) {
//当人员信息导入筛选的全局配置为"0"姓名才是必填项
if (StringUtils.isEmpty(dataValue) && "0".equals(salarySysConfPO.getConfValue())) {
if (StringUtils.isEmpty(dataValue) && "0".equals(confValue)) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"));
@ -1247,6 +1247,39 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
}
}
/**
* 导出福利核算-补缴导入模板
*/
@Override
public XSSFWorkbook exportSupplyImportTemplate(InsuranceAcctDetailImportTemplateParam param) {
ValidUtil.doValidator(param);
// 必须选择导入模板所需的薪资项目(福利项)
if (CollectionUtils.isEmpty(param.getWelfareNames())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99019, "参数错误,请选择导入模板所需的福利项目核算项"));
}
// 模板表头(默认必带"个税扣缴义务人""姓名")
List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"),
"部门",
SalaryI18nUtil.getI18nLabel(86186, "手机号"),
SalaryI18nUtil.getI18nLabel(86317, "工号"),
SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"),
"账单月份",
"补缴月份");
// List<String> dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "taxAgentName", "billMonth");
// 查询福利核算项目
List<String> welfareNames = (List<String>) param.getWelfareNames();
headerList.addAll(welfareNames);
// excel导出的数据
List<List<Object>> rows = new ArrayList<>();
rows.add(headerList);
String sheetName = "福利核算导入模板";
return ExcelUtil.genWorkbookV2(rows, sheetName);
}
/**
* 将更新的数据设置到老的insuranceAccountDetailPO对象中

View File

@ -698,10 +698,11 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
//查询对于人员信息导入筛选的全局配置
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
String rowIndex = "" + index + "";
//仅在全局人员筛选配置为0才对用户名部门名称手机号有要求
if (StringUtils.isBlank(userName) && StringUtils.isBlank(deparmentName) && StringUtils.isBlank(mobile) && "0".equals(salarySysConfPO.getConfValue())) {
if (StringUtils.isBlank(userName) && StringUtils.isBlank(deparmentName) && StringUtils.isBlank(mobile) && "0".equals(confValue)) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + " 用户名、部门名称、手机号" + SalaryI18nUtil.getI18nLabel(100303, "不能同时为空"));
excelComments.add(errorMessageMap);

View File

@ -491,14 +491,15 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
//查询对于人员信息导入筛选的全局配置
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
List<DataCollectionEmployee> employees = new ArrayList<>();
//0代表姓名+部门+手机号的匹配原则1代表工号为唯一匹配原则
if ("0".equals(salarySysConfPO.getConfValue())) {
if ("0".equals(confValue)) {
employees = employeeList.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());
} else if ("1".equals(salarySysConfPO.getConfValue())) {
} else if ("1".equals(confValue)) {
employees = employeeList.stream().filter(e -> (StringUtils.isBlank(workcode) || Objects.equals(e.getWorkcode(), workcode)))
.collect(Collectors.toList());
}

View File

@ -530,6 +530,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
//查询对于人员信息导入筛选的全局配置
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
// 薪资核算记录的id
Long salaryAcctRecordId = param.getSalaryAcctRecordId();
@ -628,7 +629,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) {
usernameIndex = j;
if (StringUtils.isEmpty(dataValue) && "0".equals(salarySysConfPO.getConfValue())) {
if (StringUtils.isEmpty(dataValue) && "0".equals(confValue)) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"));