This commit is contained in:
parent
f3fa6c6f32
commit
be25234e0e
|
|
@ -41,8 +41,6 @@ import weaver.hrm.User;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static weaver.conn.ExternalDataSourceManager.list;
|
||||
|
||||
/**
|
||||
* 个税申报表
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
|
|
@ -332,20 +330,42 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
|
|||
}
|
||||
|
||||
public void contrast(Long taxDeclarationId) {
|
||||
TaxDeclarationPO declarationPO = getTaxDeclarationService(user).getById(taxDeclarationId);
|
||||
if (declarationPO == null) {
|
||||
TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(taxDeclarationId);
|
||||
if (taxDeclaration == null) {
|
||||
throw new SalaryRunTimeException("无申报表");
|
||||
}
|
||||
TaxDeclarationPO taxDeclarationPO;
|
||||
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
if (list.size() > 1) {
|
||||
throw new SalaryRunTimeException("存在多条正常工资薪金申报表数据");
|
||||
}
|
||||
taxDeclarationPO = list.get(0);
|
||||
} else {
|
||||
List<TaxDeclarationValuePO> taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId());
|
||||
|
||||
// 查询个税申报表表头
|
||||
IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class);
|
||||
List<TaxReportColumnPO> taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum, 0);
|
||||
// 人员id
|
||||
Set<Long> employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId);
|
||||
// 查询报送的人员
|
||||
List<EmployeeDeclarePO> employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds);
|
||||
// 查询人员信息
|
||||
List<Long> simpleEmployeeIds = taxDeclarationValues.stream()
|
||||
.filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue()))
|
||||
.map(TaxDeclarationValuePO::getEmployeeId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds);
|
||||
// 查询人员薪资(身份证号码等)
|
||||
List<DataCollectionEmployee> simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds);
|
||||
// 查询外部人员
|
||||
List<Long> extEmployeeIds = taxDeclarationValues.stream()
|
||||
.filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue()))
|
||||
.map(TaxDeclarationValuePO::getEmployeeId)
|
||||
.collect(Collectors.toList());
|
||||
List<ExtEmpPO> extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds);
|
||||
|
||||
// 列表表头
|
||||
List<WeaTableColumn> weaTableColumns = TaxDeclarationValueList.buildTableColumns(taxReportColumns);
|
||||
// 列表数据
|
||||
List<Map<String, Object>> data = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues,
|
||||
employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue