领悦生成逻辑调整
This commit is contained in:
parent
56d4ef206c
commit
e620efbc5d
|
|
@ -149,4 +149,6 @@ public interface LySalaryReportService {
|
|||
void generateCymxSbReport(String salaryMonth);
|
||||
|
||||
void generateCymxGjjReport(String salaryMonth);
|
||||
|
||||
void deleteByIds(List<Long> needDeleteIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,13 +153,32 @@ public class LyFundReportServiceImpl extends Service implements LyFundReportServ
|
|||
|
||||
// 获取本月是否已有报表数据
|
||||
List<LyFundReportPO> lyFundReportPOS = listBySalaryMonth(salaryMonthDate);
|
||||
// 过滤出已推送成功的数据
|
||||
List<String> canNotGenGmgsqcList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(lyFundReportPOS)) {
|
||||
throw new SalaryRunTimeException("本薪资所属月已生成公积金汇总报表,无法生成公积金汇总报表数据");
|
||||
List<LyFundReportPO> canNotDeleteList = lyFundReportPOS.stream()
|
||||
.filter(report -> (report.getGjjffpzFlag() != null && report.getGjjffpzFlag().equals(NumberUtils.INTEGER_ONE)) || (report.getGjjjtpzFlag() != null && report.getGjjjtpzFlag().equals(NumberUtils.INTEGER_ONE)))
|
||||
.collect(Collectors.toList());
|
||||
// 获取不能生成的发放公司全称
|
||||
canNotGenGmgsqcList = canNotDeleteList.stream().map(LyFundReportPO::getGmgsqc).distinct().collect(Collectors.toList());
|
||||
// 删除其余未推送成功的报表数据
|
||||
List<String> finalCanNotGenGmgsqcList = canNotGenGmgsqcList;
|
||||
List<Long> needDeleteIds = lyFundReportPOS.stream().filter(po -> !finalCanNotGenGmgsqcList.contains(po.getGmgsqc()))
|
||||
.map(LyFundReportPO::getId)
|
||||
.collect(Collectors.toList());
|
||||
deleteByIds(needDeleteIds);
|
||||
}
|
||||
// if (CollectionUtils.isNotEmpty(lyFundReportPOS)) {
|
||||
// throw new SalaryRunTimeException("本薪资所属月已生成公积金汇总报表,无法生成公积金汇总报表数据");
|
||||
// }
|
||||
|
||||
// 获取建模中社保数据
|
||||
List<UfGjjInfo> gjjInfoList = listUfGjjInfoBySalaryMonth(salaryMonthDate);
|
||||
if (CollectionUtils.isNotEmpty(gjjInfoList)) {
|
||||
// 获取所有法人主体信息
|
||||
Map<String, String> frztMap = getLyPZService(user).listAllFrzt();
|
||||
List<String> finalCanNotGenGmgsqcList1 = canNotGenGmgsqcList;
|
||||
gjjInfoList = gjjInfoList.stream().filter(gjjInfo -> !finalCanNotGenGmgsqcList1.contains(frztMap.get(gjjInfo.getFycdgsqc()))).collect(Collectors.toList());
|
||||
Map<String, List<UfGjjInfo>> resultGroup = SalaryEntityUtil.group2Map(gjjInfoList, gjjInfo -> Util.null2String(gjjInfo.getFycdgsqc())
|
||||
+ "-split" + Util.null2String(gjjInfo.getGjjcdgsmc())
|
||||
+ "-split" + Util.null2String(gjjInfo.getZnxmmc()));
|
||||
|
|
@ -167,8 +186,6 @@ public class LyFundReportServiceImpl extends Service implements LyFundReportServ
|
|||
LinkedHashMap<String, List<UfGjjInfo>> sortedMap = new LinkedHashMap<>();
|
||||
resultGroup.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEachOrdered(x -> sortedMap.put(x.getKey(), x.getValue()));
|
||||
|
||||
// 获取所有法人主体信息
|
||||
Map<String, String> frztMap = getLyPZService(user).listAllFrzt();
|
||||
Date now = new Date();
|
||||
sortedMap.forEach((key, valueList) -> {
|
||||
String[] split = key.split("-split");
|
||||
|
|
@ -661,7 +678,10 @@ public class LyFundReportServiceImpl extends Service implements LyFundReportServ
|
|||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
getLyFundReportMapper().deleteByIds(ids);
|
||||
List<List<Long>> partition = Lists.partition(ids, 500);
|
||||
partition.forEach(part -> {
|
||||
getLyFundReportMapper().deleteByIds(part);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -206,9 +206,24 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
|
|||
|
||||
// 获取本月是否已有报表数据
|
||||
List<LySalaryReportPO> lySalaryReportPOS = listBySalaryMonth(salaryMonthDate);
|
||||
// 过滤出已推送成功的数据
|
||||
List<String> canNotGenFfgsqcList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(lySalaryReportPOS)) {
|
||||
throw new SalaryRunTimeException("本薪资所属月已生成薪资汇总报表,无法生成薪资报表数据");
|
||||
List<LySalaryReportPO> canNotDeleteList = lySalaryReportPOS.stream()
|
||||
.filter(report -> (report.getXzjtpzFlag() != null && report.getXzjtpzFlag().equals(NumberUtils.INTEGER_ONE)) || (report.getXzffpzFlag() != null && report.getXzffpzFlag().equals(NumberUtils.INTEGER_ONE)))
|
||||
.collect(Collectors.toList());
|
||||
// 获取不能生成的发放公司全称
|
||||
canNotGenFfgsqcList = canNotDeleteList.stream().map(LySalaryReportPO::getFfgsqc).distinct().collect(Collectors.toList());
|
||||
// 删除其余未推送成功的报表数据
|
||||
List<String> finalCanNotGenFfgsqcList = canNotGenFfgsqcList;
|
||||
List<Long> needDeleteIds = lySalaryReportPOS.stream().filter(po -> !finalCanNotGenFfgsqcList.contains(po.getFfgsqc()))
|
||||
.map(LySalaryReportPO::getId)
|
||||
.collect(Collectors.toList());
|
||||
deleteByIds(needDeleteIds);
|
||||
}
|
||||
// if (CollectionUtils.isNotEmpty(lySalaryReportPOS)) {
|
||||
// throw new SalaryRunTimeException("本薪资所属月已生成薪资汇总报表,无法生成薪资报表数据");
|
||||
// }
|
||||
BaseBean baseBean = new BaseBean();
|
||||
|
||||
// 获取薪资核算结果
|
||||
|
|
@ -224,15 +239,22 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
|
|||
if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOList)) {
|
||||
String dataSourceStr = StringUtils.join(salaryAcctRecordIds, ",");
|
||||
|
||||
// 获取这些人的发放公司全称数据
|
||||
List<Long> salaryAcctEmpIds = salaryAcctEmployeePOList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
||||
Long ffgsqcItemId = getPropLongValue(baseBean, "lySalaryNCReport", "salary_ffgsqc_item_id");
|
||||
List<SalaryAcctResultPO> acctResultList = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, Collections.singletonList(ffgsqcItemId));
|
||||
|
||||
List<String> finalCanNotGenFfgsqcList1 = canNotGenFfgsqcList;
|
||||
List<Long> needExcludeAcctEmpIds = acctResultList.stream().filter(result -> finalCanNotGenFfgsqcList1.contains(result.getResultValue()))
|
||||
.map(SalaryAcctResultPO::getSalaryAcctEmpId).collect(Collectors.toList());
|
||||
salaryAcctEmployeePOList = salaryAcctEmployeePOList.stream().filter(employee -> !needExcludeAcctEmpIds.contains(employee.getId())).collect(Collectors.toList());
|
||||
|
||||
// 获取薪资项目id
|
||||
List<Long> salaryItemIds = new ArrayList<>();
|
||||
|
||||
// 是职能还是项目
|
||||
Long znxmlxItemId = getPropLongValue(baseBean, "lySalaryNCReport", "salary_znxmlx_item_id");
|
||||
salaryItemIds.add(znxmlxItemId);
|
||||
|
||||
// 发放公司全称
|
||||
Long ffgsqcItemId = getPropLongValue(baseBean, "lySalaryNCReport", "salary_ffgsqc_item_id");
|
||||
// 发放公司全称、
|
||||
salaryItemIds.add(ffgsqcItemId);
|
||||
// 费用承担公司全称
|
||||
Long fycdgsqcItemId = getPropLongValue(baseBean, "lySalaryNCReport", "salary_fycdgsqc_item_id");
|
||||
|
|
@ -298,9 +320,9 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
|
|||
salaryItemIds.add(bysfItemId);
|
||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
List<Long> salaryAcctEmpIds = salaryAcctEmployeePOList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
||||
salaryAcctEmpIds = salaryAcctEmployeePOList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
||||
// 获取薪资核算结果
|
||||
List<SalaryAcctResultPO> acctResultList = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, salaryItemIds);
|
||||
acctResultList = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, salaryItemIds);
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFields = new ArrayList<>();
|
||||
salarySobEmpFields.add(SalarySobEmpFieldPO.builder().fieldCode("subcompanyId").build());
|
||||
salarySobEmpFields.add(SalarySobEmpFieldPO.builder().fieldCode("departmentId").build());
|
||||
|
|
@ -819,11 +841,15 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
|
|||
.build();
|
||||
}
|
||||
|
||||
private void deleteByIds(List<Long> salaryReportIds) {
|
||||
@Override
|
||||
public void deleteByIds(List<Long> salaryReportIds) {
|
||||
if (CollectionUtils.isEmpty(salaryReportIds)) {
|
||||
return;
|
||||
}
|
||||
getLySalaryReportMapper().deleteByIds(salaryReportIds);
|
||||
List<List<Long>> partition = Lists.partition(salaryReportIds, 500);
|
||||
partition.forEach(part -> {
|
||||
getLySalaryReportMapper().deleteByIds(part);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -170,13 +170,36 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
|
|||
|
||||
// 获取本月是否已有报表数据
|
||||
List<LySocialReportPO> lySocialReportPOS = listBySalaryMonth(salaryMonthDate);
|
||||
// 过滤出已推送成功的数据
|
||||
List<String> canNotGenGmgsqcList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(lySocialReportPOS)) {
|
||||
throw new SalaryRunTimeException("本薪资所属月已生成社保汇总报表,无法生成社保汇总报表数据");
|
||||
List<LySocialReportPO> canNotDeleteList = lySocialReportPOS.stream()
|
||||
.filter(report -> (report.getSbjtpzFlag() != null && report.getSbjtpzFlag().equals(NumberUtils.INTEGER_ONE)) || (report.getSbffpzFlag() != null && report.getSbffpzFlag().equals(NumberUtils.INTEGER_ONE)))
|
||||
.collect(Collectors.toList());
|
||||
// 获取不能生成的购买公司全称
|
||||
canNotGenGmgsqcList = canNotDeleteList.stream().map(LySocialReportPO::getGmgsqc).distinct().collect(Collectors.toList());
|
||||
// 删除其余未推送成功的报表数据
|
||||
List<String> finalCanNotGenGmgsqcList = canNotGenGmgsqcList;
|
||||
List<Long> needDeleteIds = lySocialReportPOS.stream().filter(po -> !finalCanNotGenGmgsqcList.contains(po.getGmgsqc()))
|
||||
.map(LySocialReportPO::getId)
|
||||
.collect(Collectors.toList());
|
||||
deleteByIds(needDeleteIds);
|
||||
}
|
||||
|
||||
// if (CollectionUtils.isNotEmpty(lySocialReportPOS)) {
|
||||
// throw new SalaryRunTimeException("本薪资所属月已生成社保汇总报表,无法生成社保汇总报表数据");
|
||||
// }
|
||||
|
||||
// 获取建模中社保数据
|
||||
List<UfSbInfo> sbInfoList = listUfSbInfoBySalaryMonth(salaryMonthDate);
|
||||
if (CollectionUtils.isNotEmpty(sbInfoList)) {
|
||||
// 获取所有法人主体信息
|
||||
Map<String, String> frztMap = getLyPZService(user).listAllFrzt();
|
||||
// 过滤购买公司
|
||||
List<String> finalCanNotGenGmgsqcList1 = canNotGenGmgsqcList;
|
||||
sbInfoList = sbInfoList.stream().filter(sbInfo -> !finalCanNotGenGmgsqcList1.contains(frztMap.get(sbInfo.getGmgsqc()))).collect(Collectors.toList());
|
||||
|
||||
|
||||
Map<String, List<UfSbInfo>> resultGroup = SalaryEntityUtil.group2Map(sbInfoList, sbInfo -> Util.null2String(sbInfo.getGmgsqc())
|
||||
+ "-split" + Util.null2String(sbInfo.getSbcdgsmc())
|
||||
+ "-split" + Util.null2String(sbInfo.getZnxmmc()));
|
||||
|
|
@ -184,8 +207,6 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
|
|||
LinkedHashMap<String, List<UfSbInfo>> sortedMap = new LinkedHashMap<>();
|
||||
resultGroup.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEachOrdered(x -> sortedMap.put(x.getKey(), x.getValue()));
|
||||
|
||||
// 获取所有法人主体信息
|
||||
Map<String, String> frztMap = getLyPZService(user).listAllFrzt();
|
||||
Date now = new Date();
|
||||
sortedMap.forEach((key, valueList) -> {
|
||||
String[] split = key.split("-split");
|
||||
|
|
@ -919,7 +940,10 @@ public class LySocialReportServiceImpl extends Service implements LySocialReport
|
|||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
getLySocialReportMapper().deleteByIds(ids);
|
||||
List<List<Long>> partition = Lists.partition(ids, 500);
|
||||
partition.forEach(part -> {
|
||||
getLySocialReportMapper().deleteByIds(part);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue