Merge branch 'release/2.15.2.2409.01' into release/个税版本

This commit is contained in:
钱涛 2024-10-08 14:37:32 +08:00
commit f89e2d9bda
3 changed files with 55 additions and 16 deletions

View File

@ -9,6 +9,7 @@ import lombok.*;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
* 薪资核算人员列表查询条件
@ -67,4 +68,7 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam {
private List<Long> ids;
private String workcode;
private List<Long> taxAgentIds;
private Set<Date> salaryMonths;
}

View File

@ -521,7 +521,6 @@
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
WHERE delete_type = 0
AND salary_acct_record_id = #{param.salaryAcctRecordId}
<include refid="SalaryAcctEmployeeParamSql"/>
<!-- 排序 -->
<if test="param.orderRule != null">
@ -538,7 +537,6 @@
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
WHERE delete_type = 0
AND salary_acct_record_id = #{param.salaryAcctRecordId}
<include refid="SalaryAcctEmployeeParamSql"/>
<!-- 排序 -->
<if test="param.orderRule != null">
@ -555,7 +553,6 @@
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
WHERE delete_type = 0
AND salary_acct_record_id = #{param.salaryAcctRecordId}
<include refid="SalaryAcctEmployeeParamSql"/>
<!-- 排序 -->
<if test="param.orderRule != null">
@ -564,6 +561,9 @@
</select>
<sql id="SalaryAcctEmployeeParamSql">
<if test="param.salaryAcctRecordId != null">
AND t.salary_acct_record_id = #{param.salaryAcctRecordId}
</if>
<if test="param.ids != null and param.ids.size()>0">
AND t.id IN
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
@ -573,6 +573,18 @@
<if test="param.taxAgentId != null">
AND t.tax_agent_id = #{param.taxAgentId}
</if>
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
AND t.tax_agent_id IN
<foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
#{taxAgentId}
</foreach>
</if>
<if test="param.salaryMonths != null and param.salaryMonths.size()>0">
AND t.salary_month IN
<foreach collection="param.salaryMonths" open="(" item="salaryMonth" separator="," close=")">
#{salaryMonth}
</foreach>
</if>
-- 分部
<if test="param.subcompanyIds != null and param.subcompanyIds.size()>0">
AND t.subcompany_id IN
@ -625,6 +637,9 @@
</if>
</sql>
<sql id="SalaryAcctEmployeeParamSql" databaseId="oracle">
<if test="param.salaryAcctRecordId != null">
AND t.salary_acct_record_id = #{param.salaryAcctRecordId}
</if>
<if test="param.ids != null and param.ids.size()>0">
AND t.id IN
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
@ -634,6 +649,18 @@
<if test="param.taxAgentId != null">
AND t.tax_agent_id = #{param.taxAgentId}
</if>
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
AND t.tax_agent_id IN
<foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
#{taxAgentId}
</foreach>
</if>
<if test="param.salaryMonths != null and param.salaryMonths.size()>0">
AND t.salary_month IN
<foreach collection="param.salaryMonths" open="(" item="salaryMonth" separator="," close=")">
#{salaryMonth}
</foreach>
</if>
-- 分部
<if test="param.subcompanyIds != null and param.subcompanyIds.size()>0">
AND t.subcompany_id IN
@ -684,6 +711,9 @@
</if>
</sql>
<sql id="SalaryAcctEmployeeParamSql" databaseId="sqlserver">
<if test="param.salaryAcctRecordId != null">
AND t.salary_acct_record_id = #{param.salaryAcctRecordId}
</if>
<if test="param.ids != null and param.ids.size()>0">
AND t.id IN
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
@ -693,6 +723,18 @@
<if test="param.taxAgentId != null">
AND t.tax_agent_id = #{param.taxAgentId}
</if>
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
AND t.tax_agent_id IN
<foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
#{taxAgentId}
</foreach>
</if>
<if test="param.salaryMonths != null and param.salaryMonths.size()>0">
AND t.salary_month IN
<foreach collection="param.salaryMonths" open="(" item="salaryMonth" separator="," close=")">
#{salaryMonth}
</foreach>
</if>
-- 分部
<if test="param.subcompanyIds != null and param.subcompanyIds.size()>0">
AND t.subcompany_id IN

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.NumberUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam;
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
@ -33,7 +34,6 @@ import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.wbi.util.Util;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -108,7 +108,8 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
.collect(Collectors.toSet());
// 查询薪资核算人员
List<SalaryAcctEmployeePO> salaryAcctEmployeeList = getSalaryAcctEmployeeService(user).listByTaxAgentAndSalaryMonth(taxAgentIds, salaryMonths);
SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder().salaryMonths(salaryMonths).taxAgentIds(taxAgentIds).build();
List<SalaryAcctEmployeePO> salaryAcctEmployeeList = getSalaryAcctEmployeeService(user).listByParam(salaryAcctEmployeeQueryParam);
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
return page;
}
@ -119,15 +120,8 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
// // 外部人员id
// Set<Long> extEmployeeIds = Sets.newHashSet();
// 内部人员id
Set<Long> innerEmployeeIds = Sets.newHashSet();
for (SalaryAcctEmployeePO sae : salaryAcctEmployeeList) {
// if (EmployeeTypeEnum.EXT_EMPLOYEE.getValue().equals(sae.getEmployeeType())) {
// extEmployeeIds.add(sae.getEmployeeId());
// } else if (EmployeeTypeEnum.ORGANIZATION.getValue().equals(sae.getEmployeeType())) {
// innerEmployeeIds.add(sae.getEmployeeId());
// }
innerEmployeeIds.add(sae.getEmployeeId());
}
Set<Long> innerEmployeeIds = salaryAcctEmployeeList.stream().map(SalaryAcctEmployeePO::getEmployeeId).collect(Collectors.toCollection(LinkedHashSet::new));
// 3.关键字搜索参数
if (StringUtils.isNotEmpty(queryParam.getKeyword())) {
// if (CollectionUtils.isNotEmpty(extEmployeeIds)) {
@ -158,10 +152,9 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
}
}
List<Long> innerEmployeeIdList = innerEmployeeIds.stream().sorted(Comparator.comparing(e -> e)).collect(Collectors.toList());
// List<Long> extEmployeeIdList = extEmployeeIds.stream().sorted(Comparator.comparing(e -> e)).collect(Collectors.toList());
// 排序内部员工优先
list = innerEmployeeIdList.stream().map(e -> SalaryStatisticsEmployeeListDTO.builder()
list = innerEmployeeIds.stream().map(e -> SalaryStatisticsEmployeeListDTO.builder()
.id(e)
// .employeeType(EmployeeTypeEnum.ORGANIZATION.getValue())
.build()).collect(Collectors.toList());