fix年终奖申报备注为0

This commit is contained in:
钱涛 2023-02-09 19:03:53 +08:00
parent 8790938029
commit 0f9222e1e4
1 changed files with 8 additions and 2 deletions

View File

@ -359,8 +359,8 @@ public class TaxDeclarationBO {
BigDecimal annualTaxSavings = findValue(TaxDeclarationDataIndexConstant.ANNUAL_TAX_SAVINGS, resultMap, salaryItemMap);
valueMap.put(TaxDeclarationDataIndexConstant.ANNUAL_TAX_SAVINGS, annualTaxSavings.toPlainString());
// 备注
BigDecimal annualRemark = findValue(TaxDeclarationDataIndexConstant.ANNUAL_REMARK, resultMap, salaryItemMap);
valueMap.put(TaxDeclarationDataIndexConstant.ANNUAL_REMARK, annualRemark.toPlainString());
String annualRemark = findStringValue(TaxDeclarationDataIndexConstant.ANNUAL_REMARK, resultMap, salaryItemMap);
valueMap.put(TaxDeclarationDataIndexConstant.ANNUAL_REMARK, annualRemark);
// 生成个税申报表详情
result.getNeedInsertTaxDeclarationDetails().addAll(convert2DetailPO(taxDeclaration, employeeType, employeeId, valueMap));
});
@ -713,6 +713,12 @@ public class TaxDeclarationBO {
.orElse(BigDecimal.ZERO);
}
private static String findStringValue(String fieldCode, Map<Long, List<SalaryAcctResultPO>> resultMap, Map<String, Long> salaryItemMap) {
return resultMap.getOrDefault(salaryItemMap.getOrDefault(fieldCode, 0L), Collections.emptyList()).stream()
.map(SalaryAcctResultPO::getResultValue)
.findFirst().orElse("");
}
@Data
public static class Result {