异步同步人员校验
This commit is contained in:
parent
351d892281
commit
2d091dbd33
|
|
@ -260,6 +260,8 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
* @param currentEmployeeId
|
||||
*/
|
||||
public void handleChangeData(Long currentEmployeeId) {
|
||||
//开始同步中....
|
||||
Util_DataCache.setObjVal("salaryArchiveChangeSign", "1");
|
||||
// 所有增量人员列表
|
||||
List<TaxAgentEmpChangePO> taxAgentEmpChangeList = getTaxAgentEmpChangeService(user).listAllByModule(TaxAgentEmpChangeModuleEnum.SALARY_ARCHIVE);
|
||||
if (CollectionUtils.isEmpty(taxAgentEmpChangeList)) {
|
||||
|
|
@ -301,6 +303,9 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
getTaxAgentEmpChangeService(user).deleleByIds(changeData.getChangeIds());
|
||||
}
|
||||
/** 增量处理 end ***/
|
||||
|
||||
//同步结束....
|
||||
Util_DataCache.setObjVal("salaryArchiveChangeSign", "0");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -451,7 +456,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "薪资档案");
|
||||
// 获取所有可被引用的薪资项目
|
||||
List<SalaryItemPO> salaryItems = salaryItemMapper.getCanAdjustSalaryItems();
|
||||
String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86176, "工号"),SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(91075, "状态"), SalaryI18nUtil.getI18nLabel(91075, "起始发薪日期"), SalaryI18nUtil.getI18nLabel(91075, "最后发薪日期")};
|
||||
String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86176, "工号"), SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(91075, "状态"), SalaryI18nUtil.getI18nLabel(91075, "起始发薪日期"), SalaryI18nUtil.getI18nLabel(91075, "最后发薪日期")};
|
||||
// 2.表头
|
||||
List<Object> headerList = new ArrayList<>(Arrays.asList(header));
|
||||
for (SalaryItemPO salaryItem : salaryItems) {
|
||||
|
|
@ -784,7 +789,6 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 处理历史数据
|
||||
* 下回发版可删除
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
}
|
||||
|
||||
public SIArchivesService getSIArchivesService(User user) {
|
||||
return ServiceUtil.getService(SIArchivesServiceImpl.class,user);
|
||||
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private EmployBiz employBiz = new EmployBiz();
|
||||
|
|
@ -341,14 +341,25 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
|
||||
private void syncLocalEmp(Long taxAgentId, List<DataCollectionEmployee> allSalaryEmployees, List<TaxAgentManageRangePO> allSubAdminRanges) {
|
||||
syncLocalEmp(taxAgentId, allSalaryEmployees, allSubAdminRanges, (long) user.getUID());
|
||||
|
||||
//生成档案
|
||||
getSalaryArchiveService(user).handleChangeData(1L);
|
||||
generateArchive();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成档案
|
||||
*/
|
||||
private void generateArchive() {
|
||||
//生成薪资档案
|
||||
String salaryArchiveChangeSign = (String) Util_DataCache.getObjVal("salaryArchiveChangeSign");
|
||||
if (salaryArchiveChangeSign == null || "0".equals(salaryArchiveChangeSign)) {
|
||||
getSalaryArchiveService(user).handleChangeData(1L);
|
||||
}
|
||||
//生成社保福利档案
|
||||
String welSign = (String) Util_DataCache.getObjVal("welfareChangeSign");
|
||||
if (welSign == null || "0".equals(welSign)) {
|
||||
getSIArchivesService(user).handleChangeData(1L);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -463,14 +474,8 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
// 同步分管理员的人员
|
||||
// taxAgentSubAdminEmployeeService.syncTaxAgentSubAdminEmployee(subAdminEmpSaveParamList, employeeId, tenantKey);
|
||||
|
||||
//生成薪资档案
|
||||
getSalaryArchiveService(user).handleChangeData(1L);
|
||||
|
||||
//生成社保福利档案
|
||||
String welSign = (String) Util_DataCache.getObjVal("welfareChangeSign");
|
||||
if (welSign == null || "0".equals(welSign)) {
|
||||
getSIArchivesService(user).handleChangeData(1L);
|
||||
}
|
||||
//生成档案
|
||||
generateArchive();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -552,6 +557,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
|
||||
/**
|
||||
* 导入数据
|
||||
*
|
||||
* @param taxAgentImportParam
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -670,18 +676,18 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
}
|
||||
|
||||
// 设置员工状态
|
||||
if(StringUtils.isEmpty(employeeStatusStr)){
|
||||
if (StringUtils.isEmpty(employeeStatusStr)) {
|
||||
po.setEmployeeStatus(allEmployeeStatuses);
|
||||
}else{
|
||||
} else {
|
||||
Boolean[] haveError = {false};
|
||||
// 人员状态字符串转换为对应的value
|
||||
List<String> status = SalaryEmployeeStatusEnum.parseByFormatStr(employeeStatusStr, haveError);
|
||||
if(haveError[0]){
|
||||
if (haveError[0]) {
|
||||
Map<String, String> errorMessageMap = new HashMap<>();
|
||||
errorMessageMap.put("message", rowIndex + "员工状态不存在,或格式有误。格式为:试用、正式、临时、试用延期");
|
||||
errorData.add(errorMessageMap);
|
||||
errorSum += 1;
|
||||
}else{
|
||||
} else {
|
||||
po.setEmployeeStatus(status);
|
||||
}
|
||||
}
|
||||
|
|
@ -690,7 +696,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
if (Objects.isNull(taxAgent)) {
|
||||
//个税扣缴义务人不存在
|
||||
Map<String, String> errorMessageMap = new HashMap<>();
|
||||
errorMessageMap.put("message","个税扣缴义务人不存在或不在权限范围内");
|
||||
errorMessageMap.put("message", "个税扣缴义务人不存在或不在权限范围内");
|
||||
errorData.add(errorMessageMap);
|
||||
errorSum += 1;
|
||||
}
|
||||
|
|
@ -761,7 +767,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
}
|
||||
// 多条相同人的则以第一条为准,如果逆序排列(用于重复的则以最后一条为准)Collections.reverse(pos);
|
||||
// 去重(通过记录的唯一条件(人员id)
|
||||
List<TaxAgentManageRangeSaveParam.TaxAgentSubAdminRangeTargetParam> finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTargetId() ))), ArrayList::new));
|
||||
List<TaxAgentManageRangeSaveParam.TaxAgentSubAdminRangeTargetParam> finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTargetId()))), ArrayList::new));
|
||||
return finalPos;
|
||||
}
|
||||
|
||||
|
|
@ -773,7 +779,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
throw new SalaryRunTimeException("文件不存在");
|
||||
}
|
||||
Long taxAgentId = importParam.getTaxAgentId();
|
||||
if(Objects.isNull(taxAgentId)){
|
||||
if (Objects.isNull(taxAgentId)) {
|
||||
throw new SalaryRunTimeException("个税扣缴义务人为空");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue