diff --git a/src/com/engine/salary/entity/hrm/DeptInfo.java b/src/com/engine/salary/entity/hrm/DeptInfo.java index c9b6876ef..3cc8389b2 100644 --- a/src/com/engine/salary/entity/hrm/DeptInfo.java +++ b/src/com/engine/salary/entity/hrm/DeptInfo.java @@ -32,4 +32,7 @@ public class DeptInfo { * 所属分部id */ private Long subcompanyid1; + + + private Double showorder; } diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java index b906a6a37..5bc233416 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java @@ -901,4 +901,65 @@ public class SalaryAcctResultBO { } + + public static List> buildData4Report(List salaryItems, + List salarySobEmpFields, + List simpleEmployees, + List salaryAcctEmployees, + List salaryAccountingResults, + boolean dynamicEmpInfo) { + if (CollectionUtils.isEmpty(salaryAcctEmployees)) { + return Collections.emptyList(); + } + SalaryI18nUtil.i18nList(salaryAcctEmployees); + Map employeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId); + Map> acctResultMap = SalaryEntityUtil.group2Map(salaryAccountingResults, SalaryAcctResultPO::getSalaryAcctEmpId); + return salaryAcctEmployees.stream().map(e -> { + Map resultValueMap = SalaryEntityUtil.convert2Map(acctResultMap.getOrDefault(e.getId(), Collections.emptyList()), + SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue); + // 薪资项目的值 + Map map = SalaryEntityUtil.convert2Map(salaryItems, o -> "" + o.getId(), o -> resultValueMap.getOrDefault(o.getId(), StringUtils.EMPTY)); + // 人员信息字段的值 + Map fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(e.getEmployeeId()), e, false ); + for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) { + // 员工信息字段的字段类型 + if (dynamicEmpInfo) { + map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode())); + } else { + if ("departmentName".equals(salarySobEmpField.getFieldCode())) { + map.put("departmentName", e.getDepartmentName()); + } else if ("departmentId".equals(salarySobEmpField.getFieldCode())) { + map.put("departmentId", e.getDepartmentId()); + } else if ("subcompanyName".equals(salarySobEmpField.getFieldCode())) { + map.put("subcompanyName", e.getSubcompanyName()); + } else if ("jobcall".equals(salarySobEmpField.getFieldCode())) { + map.put("jobcall", e.getJobcall()); + } else if ("jobcallId".equals(salarySobEmpField.getFieldCode())) { + map.put("jobcallId", e.getJobcallId()); + } else if ("jobtitleName".equals(salarySobEmpField.getFieldCode())) { + map.put("jobtitleName", e.getJobtitleName()); + } else if ("jobtitleId".equals(salarySobEmpField.getFieldCode())) { + map.put("jobtitleId", e.getJobtitleId()); + } else if ("status".equals(salarySobEmpField.getFieldCode())) { + map.put("status", e.getStatus()); + } else if ("statusName".equals(salarySobEmpField.getFieldCode())) { + map.put("statusName", UserStatusEnum.getDefaultLabelByValue(new Integer(e.getStatus()))); + } else { + map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode())); + } + } + map.put(salarySobEmpField.getFieldCode() + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue()); + } + // 主键id + map.put("id", e.getId()); + //人员id + map.put("employeeId", e.getEmployeeId()); + map.put("userName", fieldValueMap.get("username")); + // 个税扣缴义务人 + // String taxAgentName = taxAgentNameMap.getOrDefault(e.getTaxAgentId(), StringUtils.EMPTY); + // map.put("taxAgentName", taxAgentName); + return map; + }).collect(Collectors.toList()); + } + } diff --git a/src/com/engine/salary/mapper/datacollection/AttendQuoteDataValueMapper.xml b/src/com/engine/salary/mapper/datacollection/AttendQuoteDataValueMapper.xml index 30d790e9d..d99b8b9ca 100644 --- a/src/com/engine/salary/mapper/datacollection/AttendQuoteDataValueMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/AttendQuoteDataValueMapper.xml @@ -381,6 +381,9 @@ AND attend_quote_id = #{param.attendQuoteId} + + AND attend_quote_data_id = #{param.attendQuoteDataId} + AND employee_id IN diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml index fb71c7ffe..ea614385c 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml @@ -343,7 +343,8 @@