薪酬系统-福利档案,福利档案新增接口v3
This commit is contained in:
parent
86dbb87f1b
commit
f3dc63244f
|
|
@ -0,0 +1,14 @@
|
|||
package com.api.salary.web;
|
||||
|
||||
import com.engine.salary.process.siArchives.SIArchiveActionAPI;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author: sy
|
||||
* @Description:
|
||||
* @Date: 2022/11/11
|
||||
**/
|
||||
@Path("/bs/hrmsalary/siArchiveAction")
|
||||
public class SIArchiveActionAPIController extends SIArchiveActionAPI {
|
||||
}
|
||||
|
|
@ -712,26 +712,48 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
|
||||
public boolean singleAccountCheck(List<Map<String, Object>> singleAccount, Map<Long, String> welfareMap, List<InsuranceArchivesAccountPO> insuranceArchivesAccountPOS, List<DataCollectionEmployee> employeeByIds, List<Map<String, String>> excelComments, int i, Map<String, Long> schemeNameIdMap, Map<String, Long> paymentNameIdMap, Long creator, int index, Boolean openDevolution, List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeTree, String runStatus) {
|
||||
boolean isError = false;
|
||||
String userName = (String) singleAccount.get(0).get(SalaryI18nUtil.getI18nLabel(85429, "姓名"));
|
||||
String deparmentName = (String) singleAccount.get(1).get(SalaryI18nUtil.getI18nLabel(86185, "部门"));
|
||||
String mobile = (String) singleAccount.get(2).get(SalaryI18nUtil.getI18nLabel(86186, "手机号"));
|
||||
String userStatus = (String) singleAccount.get(3).get(SalaryI18nUtil.getI18nLabel(86187, "员工状态"));
|
||||
String workcode = (String) singleAccount.get(4).get(SalaryI18nUtil.getI18nLabel(86317, "工号"));
|
||||
// String userName = (String) singleAccount.get(0).get(SalaryI18nUtil.getI18nLabel(85429, "姓名"));
|
||||
// String deparmentName = (String) singleAccount.get(1).get(SalaryI18nUtil.getI18nLabel(86185, "部门"));
|
||||
// String mobile = (String) singleAccount.get(2).get(SalaryI18nUtil.getI18nLabel(86186, "手机号"));
|
||||
// String userStatus = (String) singleAccount.get(3).get(SalaryI18nUtil.getI18nLabel(86187, "员工状态"));
|
||||
// String workcode = (String) singleAccount.get(4).get(SalaryI18nUtil.getI18nLabel(86317, "工号"));
|
||||
|
||||
Map<String, Object> userNameMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(85429, "姓名"));
|
||||
Map<String, Object> deparmentNameMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(86185, "部门"));
|
||||
Map<String, Object> mobileMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(86186, "手机号"));
|
||||
Map<String, Object> userStatusMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(86187, "员工状态"));
|
||||
Map<String, Object> workcodeMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(86317, "工号"));
|
||||
Map<String, Object> employeeIdMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(86187, "员工id"));
|
||||
|
||||
|
||||
String userName = (String) userNameMap.get(SalaryI18nUtil.getI18nLabel(85429, "姓名"));
|
||||
String deparmentName = (String) deparmentNameMap.get(SalaryI18nUtil.getI18nLabel(86185, "部门"));
|
||||
String mobile = (String) mobileMap.get(SalaryI18nUtil.getI18nLabel(86186, "手机号"));
|
||||
String userStatus = (String) userStatusMap.get(SalaryI18nUtil.getI18nLabel(86187, "员工状态"));
|
||||
String workcode = (String) workcodeMap.get(SalaryI18nUtil.getI18nLabel(86317, "工号"));
|
||||
Long addEmployeeId = (Long) employeeIdMap.get(SalaryI18nUtil.getI18nLabel(86187, "员工id"));
|
||||
|
||||
//查询对于人员信息导入筛选的全局配置
|
||||
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(confValue)) {
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", rowIndex + " 用户名、部门名称、手机号" + SalaryI18nUtil.getI18nLabel(100303, "不能同时为空"));
|
||||
excelComments.add(errorMessageMap);
|
||||
isError = true;
|
||||
List<DataCollectionEmployee> employees = new ArrayList<>();
|
||||
//当新增数据中包含员工id信息时,直接根据员工id获取员工信息
|
||||
if (addEmployeeId == null) {
|
||||
//仅在全局人员筛选配置为“0”时,才对用户名、部门名称、手机号有要求
|
||||
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);
|
||||
isError = true;
|
||||
}
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
employees = getSalaryEmployeeService(user).matchImportEmployee(employeeByIds, userName, deparmentName, mobile, workcode, null);
|
||||
} else {
|
||||
employees = employeeByIds.stream().filter(f -> f.getEmployeeId().equals(addEmployeeId)).collect(Collectors.toList());
|
||||
}
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).matchImportEmployee(employeeByIds, userName, deparmentName, mobile, workcode, null);
|
||||
|
||||
|
||||
if (CollectionUtils.isEmpty(employees)) {
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
|
|
@ -1321,17 +1343,24 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
// 待导入数据
|
||||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId()));
|
||||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
// 表头
|
||||
List<String> headers = ExcelSupport.getSheetHeader(sheet, 0);
|
||||
List<String> headers = new ArrayList<>();
|
||||
if (param.getImportDatas().size() > 0) {
|
||||
Map<String,Object> getHeadersMap = param.getImportDatas().get(0);
|
||||
for (Map.Entry<String,Object> entry : getHeadersMap.entrySet()){
|
||||
headers.add(entry.getKey());
|
||||
}
|
||||
} else {
|
||||
throw new SalaryRunTimeException("新增福利档案数据为空!");
|
||||
}
|
||||
|
||||
// 错误sheet数据
|
||||
List<Map<String, Object>> errorData = new LinkedList<>();
|
||||
// 错误提示
|
||||
List<Map<String, String>> excelComments = new LinkedList<>();
|
||||
|
||||
// 处理数值
|
||||
List<Map<String, Object>> data = ExcelParseHelper.parse2Map(sheet, 1);
|
||||
List<Map<String, Object>> data = param.getImportDatas();
|
||||
total = data.size();
|
||||
|
||||
//当前sheel的单行记录
|
||||
|
|
@ -1370,8 +1399,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
// }
|
||||
|
||||
// 数据入库处理
|
||||
handleImportData(insuranceArchivesAccountPOS);
|
||||
|
||||
if (param.isAddData()) {
|
||||
handleImportData(insuranceArchivesAccountPOS);
|
||||
}
|
||||
// 发送导入回调信息
|
||||
// salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue