修复人员报表排序
This commit is contained in:
parent
71569cad9e
commit
bfbd9e4b40
|
|
@ -64,4 +64,11 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam {
|
|||
|
||||
private List<Long> taxAgentIds;
|
||||
private Set<Date> salaryMonths;
|
||||
|
||||
|
||||
private Collection<Long> salaryAcctRecordIds;
|
||||
private Collection<Long> salarySobIds;
|
||||
private Collection<Long> employeeIds;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -637,6 +637,24 @@
|
|||
</if>
|
||||
)
|
||||
</if>
|
||||
<if test="param.salaryAcctRecordIds != null and param.salaryAcctRecordIds.size()>0">
|
||||
AND t.salary_acct_record_id IN
|
||||
<foreach collection="param.salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
|
||||
#{salaryAcctRecordId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.employeeIds != null and param.employeeIds.size()>0">
|
||||
AND t.employee_id IN
|
||||
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||
#{employeeId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.salarySobIds != null and param.salarySobIds.size()>0">
|
||||
AND t.salary_sob_id IN
|
||||
<foreach collection="param.salarySobIds" open="(" item="salarySobId" separator="," close=")">
|
||||
#{salarySobId}
|
||||
</foreach>
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="SalaryAcctEmployeeParamSql" databaseId="oracle">
|
||||
<if test="param.salaryAcctRecordId != null">
|
||||
|
|
@ -711,6 +729,24 @@
|
|||
</if>
|
||||
)
|
||||
</if>
|
||||
<if test="param.salaryAcctRecordIds != null and param.salaryAcctRecordIds.size()>0">
|
||||
AND t.salary_acct_record_id IN
|
||||
<foreach collection="param.salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
|
||||
#{salaryAcctRecordId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.employeeIds != null and param.employeeIds.size()>0">
|
||||
AND t.employee_id IN
|
||||
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||
#{employeeId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.salarySobIds != null and param.salarySobIds.size()>0">
|
||||
AND t.salary_sob_id IN
|
||||
<foreach collection="param.salarySobIds" open="(" item="salarySobId" separator="," close=")">
|
||||
#{salarySobId}
|
||||
</foreach>
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="SalaryAcctEmployeeParamSql" databaseId="sqlserver">
|
||||
<if test="param.salaryAcctRecordId != null">
|
||||
|
|
@ -786,6 +822,24 @@
|
|||
</if>
|
||||
)
|
||||
</if>
|
||||
<if test="param.salaryAcctRecordIds != null and param.salaryAcctRecordIds.size()>0">
|
||||
AND t.salary_acct_record_id IN
|
||||
<foreach collection="param.salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
|
||||
#{salaryAcctRecordId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.employeeIds != null and param.employeeIds.size()>0">
|
||||
AND t.employee_id IN
|
||||
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||
#{employeeId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.salarySobIds != null and param.salarySobIds.size()>0">
|
||||
AND t.salary_sob_id IN
|
||||
<foreach collection="param.salarySobIds" open="(" item="salarySobId" separator="," close=")">
|
||||
#{salarySobId}
|
||||
</foreach>
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="listPage4Reduce" resultMap="SalaryAccEmployeeMap">
|
||||
|
|
|
|||
|
|
@ -1192,9 +1192,9 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
// List<SalaryAcctEmployeePO> accountDetailPOList = data.getList().stream().filter(po -> pageEmployeeIds.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
List<Map<String, Object>> records = new ArrayList<>();
|
||||
List<SalaryAcctEmployeePO> accountDetailPOList = data.getList();
|
||||
Map<Long, List<SalaryAcctEmployeePO>> employeeListMap = accountDetailPOList.stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId));
|
||||
Map<Long, List<SalaryAcctEmployeePO>> lastEmployeeListMap = data.getLastList().stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId));
|
||||
Map<Long, List<SalaryAcctEmployeePO>> sameEmployeeListMap = data.getSameList().stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId));
|
||||
Map<Long, List<SalaryAcctEmployeePO>> employeeListMap = accountDetailPOList.stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId, LinkedHashMap::new, Collectors.toList()));
|
||||
Map<Long, List<SalaryAcctEmployeePO>> lastEmployeeListMap = data.getLastList().stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId, LinkedHashMap::new, Collectors.toList()));
|
||||
Map<Long, List<SalaryAcctEmployeePO>> sameEmployeeListMap = data.getSameList().stream().collect(Collectors.groupingBy(SalaryAcctEmployeePO::getEmployeeId, LinkedHashMap::new, Collectors.toList()));
|
||||
|
||||
List<Long> empIds = accountDetailPOList.stream().map(SalaryAcctEmployeePO::getEmployeeId).distinct().collect(Collectors.toList());
|
||||
Map<Long, DataCollectionEmployee> employeeByIdMap = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds).stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, o -> o));
|
||||
|
|
|
|||
|
|
@ -612,7 +612,10 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
|
||||
@Override
|
||||
public List<SalaryAcctEmployeePO> listBySalaryStatisticsReportParam(SalaryStatisticsReportDataQueryParam param) {
|
||||
SalaryAcctEmployeePO lambdaQueryChainWrapper = SalaryAcctEmployeePO.builder().build();
|
||||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
SalaryAcctEmployeeQueryParam lambdaQueryChainWrapper = new SalaryAcctEmployeeQueryParam();
|
||||
lambdaQueryChainWrapper.setOrderRule(orderRule);
|
||||
|
||||
// 个税扣缴义务人
|
||||
// Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
|
||||
|
|
@ -681,12 +684,11 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
if (CollectionUtils.isNotEmpty(salaryAcctRecordIds)) {
|
||||
//分片查询
|
||||
List<List<Long>> partition = Lists.partition(salaryAcctRecordIds, 500);
|
||||
List<SalaryAcctEmployeePO> empList = new ArrayList<>();
|
||||
partition.forEach(part -> {
|
||||
lambdaQueryChainWrapper.setSalaryAcctRecordIds(salaryAcctRecordIds);
|
||||
empList.addAll(getSalaryAcctEmployeeMapper().listSome(lambdaQueryChainWrapper));
|
||||
});
|
||||
list = empList;
|
||||
for (List<Long> part : partition) {
|
||||
lambdaQueryChainWrapper.setSalaryAcctRecordIds(part);
|
||||
List<SalaryAcctEmployeePO> pos = getSalaryAcctEmployeeMapper().list(lambdaQueryChainWrapper);
|
||||
list.addAll(pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue