This commit is contained in:
Harryxzy 2023-01-11 09:47:57 +08:00
parent fd5048bd2d
commit 6460edc013
2 changed files with 25 additions and 1 deletions

View File

@ -372,6 +372,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
}
// 入库
eligibleData = handleImportData(eligibleData);
// 查询已有的人员范围
List<SalarySobRangePO> salarySobRangePOS = listBySalarySobIdAndIncludeType(salarySobId, 1);
SalarySobRangeSaveParam saveParam = new SalarySobRangeSaveParam();
@ -398,6 +399,17 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
return apidatas;
}
// 处理导入数据
private List<SalarySobRangeSaveParam.SalarySobRangeTargetParam> handleImportData(List<SalarySobRangeSaveParam.SalarySobRangeTargetParam> pos) {
if (CollectionUtils.isEmpty(pos)) {
return Collections.emptyList();
}
// 多条相同人的则以第一条为准如果逆序排列用于重复的则以最后一条为准Collections.reverse(pos);
// 去重通过记录的唯一条件(人员id
List<SalarySobRangeSaveParam.SalarySobRangeTargetParam> finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTargetId() ))), ArrayList::new));
return finalPos;
}
private void checkImportParam(SalarySobRangeImportParam importParam) {
//excel文件id
String imageId = Util.null2String(importParam.getImageId());

View File

@ -320,7 +320,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
result.getNeedInsertTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().insertIgnoreNull(range));
}
if (CollectionUtils.isNotEmpty(result.getNeedUpdateTaxAgentManageRanges())) {
result.getNeedInsertTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().updateIgnoreNull(range));
result.getNeedUpdateTaxAgentManageRanges().forEach(range -> getTaxAgentManageRangeMapper().updateIgnoreNull(range));
}
/* 同步本地人员范围的关联人员=========================== */
@ -674,6 +674,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
}
//入库-----------------start
eligibleData = handleImportData(eligibleData);
taxAgentRangeSaveParam.setTargetParams(eligibleData);
// 查询已有的管理范围
List<TaxAgentManageRangePO> taxAgentManageAllRanges = listByTaxAgentId(taxAgentId);
@ -720,6 +721,17 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
return apidatas;
}
// 处理导入数据
private List<TaxAgentManageRangeSaveParam.TaxAgentSubAdminRangeTargetParam> handleImportData(List<TaxAgentManageRangeSaveParam.TaxAgentSubAdminRangeTargetParam> pos) {
if (CollectionUtils.isEmpty(pos)) {
return Collections.emptyList();
}
// 多条相同人的则以第一条为准如果逆序排列用于重复的则以最后一条为准Collections.reverse(pos);
// 去重通过记录的唯一条件(人员id
List<TaxAgentManageRangeSaveParam.TaxAgentSubAdminRangeTargetParam> finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTargetId() ))), ArrayList::new));
return finalPos;
}
private void checkImportParam(TaxAgentImportParam importParam) {
//excel文件id
String imageId = Util.null2String(importParam.getImageId());