fix: 工资单发放页高级搜索功能不生效
This commit is contained in:
parent
b1122ae391
commit
31982fc1db
|
|
@ -15,7 +15,9 @@ import org.apache.ibatis.session.SqlSession;
|
|||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class SalarySendInfoBiz {
|
||||
/**
|
||||
|
|
@ -82,13 +84,15 @@ public class SalarySendInfoBiz {
|
|||
* 工资单发放详情列表
|
||||
*
|
||||
* @param param
|
||||
* @param otherSalaryAccRecordIds
|
||||
* @return
|
||||
*/
|
||||
public List<SalarySendDetailListDTO> detailList(@Param("param") SalarySendDetailQueryParam param) {
|
||||
public List<SalarySendDetailListDTO> detailList(@Param("param") SalarySendDetailQueryParam param,
|
||||
@Param("otherSalaryAccRecordIds") Set<Long> otherSalaryAccRecordIds) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalarySendInfoMapper mapper = sqlSession.getMapper(SalarySendInfoMapper.class);
|
||||
return mapper.detailList(param);
|
||||
return mapper.detailList(param, otherSalaryAccRecordIds);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
|
@ -124,4 +128,17 @@ public class SalarySendInfoBiz {
|
|||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Long> listSalaryAccRecordIds(SalarySendDetailQueryParam queryParam) {
|
||||
if (null == queryParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalarySendInfoMapper mapper = sqlSession.getMapper(SalarySendInfoMapper.class);
|
||||
return mapper.listSalaryAccRecordIds(queryParam);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放信息
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单发放信息查询参数")
|
||||
public class SalarySendDetailListQueryParam extends BaseQueryParam {
|
||||
|
||||
// @ApiModelProperty("主键id")
|
||||
private Collection<Long> ids;
|
||||
|
||||
// @ApiModelProperty("工资单发放Id")
|
||||
private Long salarySendId;
|
||||
|
||||
/**
|
||||
* 工资核算id
|
||||
*/
|
||||
// @JsonIgnore
|
||||
private Long salaryAccountingId;
|
||||
|
||||
// @ApiModelProperty("关键字(姓名)")
|
||||
private String keyword;
|
||||
|
||||
// @ApiModelProperty("姓名")
|
||||
private String username;
|
||||
|
||||
// @ApiModelProperty("个税扣缴义务人的主键id")
|
||||
private Long taxAgent;
|
||||
|
||||
// @ApiModelProperty("部门id")
|
||||
private Long department;
|
||||
|
||||
// @ApiModelProperty("岗位id")
|
||||
private Long position;
|
||||
|
||||
// @ApiModelProperty("状态")
|
||||
private String userstatus;
|
||||
|
||||
// @ApiModelProperty("入职日期")
|
||||
private List<LocalDate> hiredate;
|
||||
|
||||
// @ApiModelProperty("合并计税")
|
||||
private Boolean mergeCountTax;
|
||||
|
||||
/**
|
||||
* 发送状态
|
||||
*/
|
||||
// @JsonIgnore
|
||||
private List<Integer> sendStatuss;
|
||||
|
||||
public static String checkParam(SalarySendDetailListQueryParam saveParam) {
|
||||
if (saveParam.getSalarySendId() == null) {
|
||||
throw new SalaryRunTimeException("工资单发放Id必传");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@
|
|||
(
|
||||
SELECT
|
||||
<include refid="SalaryAccEmployeeColumn"/>
|
||||
FROM hrsa_salary_acct_emp
|
||||
FROM hrsa_salary_acct_emp t
|
||||
WHERE
|
||||
delete_type = 0
|
||||
AND salary_acct_record_id IN
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.apache.ibatis.annotations.Param;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 工资单发放信息
|
||||
|
|
@ -22,6 +23,8 @@ import java.util.List;
|
|||
**/
|
||||
public interface SalarySendInfoMapper {
|
||||
|
||||
List<Long> listSalaryAccRecordIds(@Param("param") SalarySendDetailQueryParam param);
|
||||
|
||||
/**
|
||||
* 查询工资单发放信息列表
|
||||
* @param param
|
||||
|
|
@ -40,10 +43,13 @@ public interface SalarySendInfoMapper {
|
|||
|
||||
/**
|
||||
* 查询工资单发放详情列表
|
||||
*
|
||||
* @param param
|
||||
* @param otherSalaryAccRecordIds
|
||||
* @return
|
||||
*/
|
||||
List<SalarySendDetailListDTO> detailList(@Param("param") SalarySendDetailQueryParam param);
|
||||
List<SalarySendDetailListDTO> detailList(@Param("param") SalarySendDetailQueryParam param,
|
||||
@Param("otherSalaryAccRecordIds") Set<Long> otherSalaryAccRecordIds);
|
||||
|
||||
/**
|
||||
* 分页查询工资单发放详情列表
|
||||
|
|
|
|||
|
|
@ -67,23 +67,23 @@
|
|||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="oracle">
|
||||
INSERT INTO hrsa_salary_send_info (
|
||||
id,
|
||||
salary_send_id,
|
||||
salary_month,
|
||||
salary_acct_record_id,
|
||||
tax_agent_id,
|
||||
employee_id,
|
||||
send_status,
|
||||
creator,
|
||||
create_time,
|
||||
update_time,
|
||||
tenant_key
|
||||
)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
<insert id="batchInsert" databaseId="oracle">
|
||||
INSERT INTO hrsa_salary_send_info (
|
||||
id,
|
||||
salary_send_id,
|
||||
salary_month,
|
||||
salary_acct_record_id,
|
||||
tax_agent_id,
|
||||
employee_id,
|
||||
send_status,
|
||||
creator,
|
||||
create_time,
|
||||
update_time,
|
||||
tenant_key
|
||||
)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
#{item.id,jdbcType=DOUBLE},
|
||||
#{item.salarySendId,jdbcType=DOUBLE},
|
||||
#{item.salaryMonth,jdbcType=DATE},
|
||||
|
|
@ -95,10 +95,10 @@
|
|||
#{item.createTime,jdbcType=DATE},
|
||||
#{item.updateTime,jdbcType=DATE},
|
||||
#{item.tenantKey,jdbcType=VARCHAR}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="sqlserver">
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="sqlserver">
|
||||
<foreach collection="collection" item="item" separator=";">
|
||||
INSERT INTO hrsa_salary_send_info (
|
||||
id,
|
||||
|
|
@ -115,20 +115,20 @@
|
|||
)
|
||||
VALUES
|
||||
(
|
||||
#{item.id},
|
||||
#{item.salarySendId},
|
||||
#{item.salaryMonth},
|
||||
#{item.salaryAcctRecordId},
|
||||
#{item.taxAgentId},
|
||||
#{item.employeeId},
|
||||
#{item.sendStatus},
|
||||
#{item.creator},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.tenantKey}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
#{item.id},
|
||||
#{item.salarySendId},
|
||||
#{item.salaryMonth},
|
||||
#{item.salaryAcctRecordId},
|
||||
#{item.taxAgentId},
|
||||
#{item.employeeId},
|
||||
#{item.sendStatus},
|
||||
#{item.creator},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.tenantKey}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<sql id="salarySendInfoColumn">
|
||||
t1.id,
|
||||
|
|
@ -175,7 +175,7 @@
|
|||
</if>
|
||||
<!-- 岗位 -->
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND e.position IN
|
||||
AND e.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
|
@ -196,112 +196,112 @@
|
|||
AND (e.hiredate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="paramSql" databaseId="oracle">
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t1.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.salarySendId != null">
|
||||
AND t1.salary_send_id = #{param.salarySendId}
|
||||
</if>
|
||||
|
||||
<if test="param.keyword != null and param.keyword != ''">
|
||||
<sql id="paramSql" databaseId="oracle">
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t1.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.salarySendId != null">
|
||||
AND t1.salary_send_id = #{param.salarySendId}
|
||||
</if>
|
||||
|
||||
<if test="param.keyword != null and param.keyword != ''">
|
||||
AND e.lastname like '%'||#{param.keyword}||'%'
|
||||
</if>
|
||||
|
||||
<if test="param.username != null and param.username != ''">
|
||||
</if>
|
||||
|
||||
<if test="param.username != null and param.username != ''">
|
||||
AND e.lastname like '%'||#{param.username}||'%'
|
||||
</if>
|
||||
|
||||
<if test="param.taxAgentId != null">
|
||||
AND t2.id = #{param.taxAgentId}
|
||||
</if>
|
||||
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND d.id IN
|
||||
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND e.position IN
|
||||
<foreach collection="param.positionIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.userstatus != null and param.userstatus != ''">
|
||||
AND e.status = #{param.userstatus}
|
||||
</if>
|
||||
|
||||
<if test="param.sendStatuss != null and param.sendStatuss.size() > 0">
|
||||
AND t1.send_status IN
|
||||
<foreach collection="param.sendStatuss" open="(" item="status" separator="," close=")">
|
||||
#{status}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.hiredate != null and param.hiredate.size() == 2">
|
||||
AND (e.hiredate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="paramSql" databaseId="sqlserver">
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t1.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.salarySendId != null">
|
||||
AND t1.salary_send_id = #{param.salarySendId}
|
||||
</if>
|
||||
|
||||
<if test="param.keyword != null and param.keyword != ''">
|
||||
</if>
|
||||
|
||||
<if test="param.taxAgentId != null">
|
||||
AND t2.id = #{param.taxAgentId}
|
||||
</if>
|
||||
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND d.id IN
|
||||
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND e.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.userstatus != null and param.userstatus != ''">
|
||||
AND e.status = #{param.userstatus}
|
||||
</if>
|
||||
|
||||
<if test="param.sendStatuss != null and param.sendStatuss.size() > 0">
|
||||
AND t1.send_status IN
|
||||
<foreach collection="param.sendStatuss" open="(" item="status" separator="," close=")">
|
||||
#{status}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.hiredate != null and param.hiredate.size() == 2">
|
||||
AND (e.hiredate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="paramSql" databaseId="sqlserver">
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t1.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.salarySendId != null">
|
||||
AND t1.salary_send_id = #{param.salarySendId}
|
||||
</if>
|
||||
|
||||
<if test="param.keyword != null and param.keyword != ''">
|
||||
AND e.lastname like '%'+#{param.keyword}+'%'
|
||||
</if>
|
||||
|
||||
<if test="param.username != null and param.username != ''">
|
||||
</if>
|
||||
|
||||
<if test="param.username != null and param.username != ''">
|
||||
AND e.lastname like '%'+#{param.username}+'%'
|
||||
</if>
|
||||
|
||||
<if test="param.taxAgentId != null">
|
||||
AND t2.id = #{param.taxAgentId}
|
||||
</if>
|
||||
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND d.id IN
|
||||
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND e.position IN
|
||||
<foreach collection="param.positionIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.userstatus != null and param.userstatus != ''">
|
||||
AND e.status = #{param.userstatus}
|
||||
</if>
|
||||
|
||||
<if test="param.sendStatuss != null and param.sendStatuss.size() > 0">
|
||||
AND t1.send_status IN
|
||||
<foreach collection="param.sendStatuss" open="(" item="status" separator="," close=")">
|
||||
#{status}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.hiredate != null and param.hiredate.size() == 2">
|
||||
AND (e.hiredate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
|
||||
</if>
|
||||
</sql>
|
||||
</if>
|
||||
|
||||
<if test="param.taxAgentId != null">
|
||||
AND t2.id = #{param.taxAgentId}
|
||||
</if>
|
||||
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND d.id IN
|
||||
<foreach collection="param.departmentIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND e.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.userstatus != null and param.userstatus != ''">
|
||||
AND e.status = #{param.userstatus}
|
||||
</if>
|
||||
|
||||
<if test="param.sendStatuss != null and param.sendStatuss.size() > 0">
|
||||
AND t1.send_status IN
|
||||
<foreach collection="param.sendStatuss" open="(" item="status" separator="," close=")">
|
||||
#{status}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.hiredate != null and param.hiredate.size() == 2">
|
||||
AND (e.hiredate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="list" resultType="com.engine.salary.entity.salaryBill.dto.SalarySendInfoListDTO">
|
||||
SELECT
|
||||
|
|
@ -325,44 +325,44 @@
|
|||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
</if>
|
||||
</select>
|
||||
<select id="list" resultType="com.engine.salary.entity.salaryBill.dto.SalarySendInfoListDTO" databaseId="oracle">
|
||||
<select id="list" resultType="com.engine.salary.entity.salaryBill.dto.SalarySendInfoListDTO" databaseId="oracle">
|
||||
SELECT
|
||||
|
||||
<include refid="salarySendInfoColumn"/>
|
||||
|
||||
FROM
|
||||
|
||||
FROM
|
||||
hrsa_salary_send_info t1
|
||||
LEFT JOIN hrmresource e ON e.id = t1.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.DEPARTMENTID
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
LEFT JOIN hrsa_tax_agent t2 ON t2.id = t1.tax_agent_id
|
||||
WHERE
|
||||
LEFT JOIN hrsa_tax_agent t2 ON t2.id = t1.tax_agent_id
|
||||
WHERE
|
||||
t1.delete_type = 0
|
||||
|
||||
<if test="param.sendStatusVal != null">
|
||||
AND t1.send_status = #{param.sendStatusVal}
|
||||
<if test="param.sendStatusVal != null">
|
||||
AND t1.send_status = #{param.sendStatusVal}
|
||||
</if>
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
</if>
|
||||
</select>
|
||||
<select id="list" resultType="com.engine.salary.entity.salaryBill.dto.SalarySendInfoListDTO" databaseId="sqlserver">
|
||||
</select>
|
||||
<select id="list" resultType="com.engine.salary.entity.salaryBill.dto.SalarySendInfoListDTO" databaseId="sqlserver">
|
||||
SELECT
|
||||
|
||||
<include refid="salarySendInfoColumn"/>
|
||||
|
||||
FROM
|
||||
|
||||
FROM
|
||||
hrsa_salary_send_info t1
|
||||
LEFT JOIN hrmresource e ON e.id = t1.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.DEPARTMENTID
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
LEFT JOIN hrsa_tax_agent t2 ON t2.id = t1.tax_agent_id
|
||||
WHERE
|
||||
LEFT JOIN hrsa_tax_agent t2 ON t2.id = t1.tax_agent_id
|
||||
WHERE
|
||||
t1.delete_type = 0
|
||||
<if test="param.sendStatusVal != null">
|
||||
AND t1.send_status = #{param.sendStatusVal}
|
||||
AND t1.send_status = #{param.sendStatusVal}
|
||||
</if>
|
||||
|
||||
<include refid="paramSql"/>
|
||||
|
|
@ -370,7 +370,49 @@
|
|||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
</if>
|
||||
</select>
|
||||
</select>
|
||||
|
||||
<select id="listSalaryAccRecordIds" resultType="java.lang.Long">
|
||||
SELECT distinct
|
||||
salary_acct_record_id
|
||||
FROM
|
||||
hrsa_salary_send_info t1
|
||||
LEFT JOIN hrmresource e ON e.id = t1.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.DEPARTMENTID
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
LEFT JOIN hrsa_tax_agent t2 ON t2.id = t1.tax_agent_id
|
||||
WHERE
|
||||
t1.delete_type = 0
|
||||
<include refid="paramSql"/>
|
||||
</select>
|
||||
|
||||
<select id="listSalaryAccRecordIds" resultType="java.lang.Long" databaseId="oracle">
|
||||
SELECT distinct
|
||||
salary_acct_record_id
|
||||
FROM
|
||||
hrsa_salary_send_info t1
|
||||
LEFT JOIN hrmresource e ON e.id = t1.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.DEPARTMENTID
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
LEFT JOIN hrsa_tax_agent t2 ON t2.id = t1.tax_agent_id
|
||||
WHERE
|
||||
t1.delete_type = 0
|
||||
<include refid="paramSql"/>
|
||||
</select>
|
||||
|
||||
<select id="listSalaryAccRecordIds" resultType="java.lang.Long" databaseId="sqlserver">
|
||||
SELECT distinct
|
||||
salary_acct_record_id
|
||||
FROM
|
||||
hrsa_salary_send_info t1
|
||||
LEFT JOIN hrmresource e ON e.id = t1.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.DEPARTMENTID
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
LEFT JOIN hrsa_tax_agent t2 ON t2.id = t1.tax_agent_id
|
||||
WHERE
|
||||
t1.delete_type = 0
|
||||
<include refid="paramSql"/>
|
||||
</select>
|
||||
|
||||
<select id="detailList" resultType="com.engine.salary.entity.salaryBill.dto.SalarySendDetailListDTO">
|
||||
SELECT
|
||||
|
|
@ -385,7 +427,14 @@
|
|||
t1.delete_type = 0
|
||||
<!-- 合并计税 todo -->
|
||||
<if test="param.mergeCountTax != null">
|
||||
|
||||
and (t1.employee_id, t1.tax_agent_id)
|
||||
in (select employee_id, tax_agent_id
|
||||
from hrsa_salary_send_info
|
||||
where delete_type = 0 and salary_acct_record_id in (
|
||||
<foreach collection="otherSalaryAccRecordIds" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
))
|
||||
</if>
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
|
|
@ -393,7 +442,7 @@
|
|||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
</if>
|
||||
</select>
|
||||
<select id="detailList" resultType="com.engine.salary.entity.salaryBill.dto.SalarySendDetailListDTO" databaseId="oracle">
|
||||
<select id="detailList" resultType="com.engine.salary.entity.salaryBill.dto.SalarySendDetailListDTO" databaseId="oracle">
|
||||
SELECT
|
||||
<include refid="salarySendInfoColumn"/>
|
||||
FROM
|
||||
|
|
@ -405,15 +454,22 @@
|
|||
WHERE
|
||||
t1.delete_type = 0
|
||||
<if test="param.mergeCountTax != null">
|
||||
|
||||
and (t1.employee_id, t1.tax_agent_id)
|
||||
in (select employee_id, tax_agent_id
|
||||
from hrsa_salary_send_info
|
||||
where delete_type = 0 and salary_acct_record_id in (
|
||||
<foreach collection="otherSalaryAccRecordIds" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
))
|
||||
</if>
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
</if>
|
||||
</select>
|
||||
<select id="detailList" resultType="com.engine.salary.entity.salaryBill.dto.SalarySendDetailListDTO" databaseId="sqlserver">
|
||||
</select>
|
||||
<select id="detailList" resultType="com.engine.salary.entity.salaryBill.dto.SalarySendDetailListDTO" databaseId="sqlserver">
|
||||
SELECT
|
||||
<include refid="salarySendInfoColumn"/>
|
||||
FROM
|
||||
|
|
@ -424,15 +480,22 @@
|
|||
LEFT JOIN hrsa_tax_agent t2 ON t2.id = t1.tax_agent_id
|
||||
WHERE
|
||||
t1.delete_type = 0
|
||||
<if test="param.mergeCountTax != null">
|
||||
|
||||
<if test="param.mergeCountTax != null">
|
||||
and (t1.employee_id, t1.tax_agent_id)
|
||||
in (select employee_id, tax_agent_id
|
||||
from hrsa_salary_send_info
|
||||
where delete_type = 0 and salary_acct_record_id in (
|
||||
<foreach collection="otherSalaryAccRecordIds" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
))
|
||||
</if>
|
||||
<include refid="paramSql"/>
|
||||
<!-- 排序 -->
|
||||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
</if>
|
||||
</select>
|
||||
</select>
|
||||
|
||||
<select id="mySalaryBillList" resultType="com.engine.salary.entity.salaryBill.dto.SalaryMySalaryBillListDTO">
|
||||
SELECT
|
||||
|
|
@ -611,5 +674,4 @@
|
|||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -466,8 +466,22 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
queryParam.setOrderRule(orderRule);
|
||||
|
||||
//查询关联的核酸id,这里认为一次发放只对应一条核算记录
|
||||
Long salaryAccRecordId =
|
||||
salarySendInfoMapper.listSalaryAccRecordIds(queryParam).stream().findFirst().orElse(null);
|
||||
// 查询合并计税的其他薪资核算记录
|
||||
List<SalaryAcctRecordPO> otherSalaryAcctRecordPOS =
|
||||
getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAccRecordId);
|
||||
if (CollectionUtils.isEmpty(otherSalaryAcctRecordPOS)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
// 查询合并计税的薪资核算人员
|
||||
Set<Long> otherSalaryAcctRecordIds = SalaryEntityUtil.properties(otherSalaryAcctRecordPOS, SalaryAcctRecordPO::getId);
|
||||
if (otherSalaryAcctRecordIds.isEmpty()) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
List<SalarySendDetailListDTO> list = salarySendInfoMapper.detailList(queryParam);
|
||||
List<SalarySendDetailListDTO> list = salarySendInfoMapper.detailList(queryParam, otherSalaryAcctRecordIds);
|
||||
PageInfo<SalarySendDetailListDTO> pageInfo = new PageInfo<>(list, SalarySendDetailListDTO.class);
|
||||
return pageInfo;
|
||||
}
|
||||
|
|
@ -825,7 +839,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
queryParam.setIds(ids);
|
||||
queryParam.setSendStatuss(Arrays.asList(SalarySendStatusEnum.UNSEND.getValue(), SalarySendStatusEnum.WITHDRAW.getValue()));
|
||||
// 2.获取基本数据
|
||||
List<SalarySendDetailListDTO> list = salarySendInfoMapper.detailList(queryParam);
|
||||
List<SalarySendDetailListDTO> list = salarySendInfoMapper.detailList(queryParam, null);
|
||||
// 3.组装详情数据
|
||||
List<Map<String, Object>> listMaps = buildDetailList(salaryItems, list, salarySend.getSalaryAccountingId());
|
||||
return listMaps;
|
||||
|
|
@ -1058,7 +1072,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
queryParam.setOrderRule(orderRule);
|
||||
|
||||
List<SalarySendDetailListDTO> list = salarySendInfoMapper.detailList(queryParam);
|
||||
List<SalarySendDetailListDTO> list = salarySendInfoMapper.detailList(queryParam, null);
|
||||
|
||||
// 3.组装详情数据
|
||||
List<Map<String, Object>> listMaps = buildDetailList(salaryItems, list, salarySend.getSalaryAccountingId());
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.engine.salary.entity.salaryBill.param.*;
|
|||
import com.engine.salary.enums.salarybill.SalarySendStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.SalarySendWrapper;
|
||||
import com.engine.salary.wrapper.SalaryTemplateWrapper;
|
||||
|
|
@ -26,10 +27,7 @@ import javax.ws.rs.core.StreamingOutput;
|
|||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -374,9 +372,21 @@ public class SalaryBillController {
|
|||
@POST
|
||||
@Path("/send/detailList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String detailList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendDetailQueryParam queryParam) {
|
||||
public String detailList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendDetailListQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySendDetailQueryParam, Map<String, Object>>(user).run(getSalarySendWrapper(user)::detailList, queryParam);
|
||||
// 处理入参复用方法
|
||||
SalarySendDetailQueryParam detailQueryParam = SalarySendDetailQueryParam.builder()
|
||||
.departmentIds(SalaryEntityUtil.isNullOrEmpty(queryParam.getDepartment()) ? null : Collections.singletonList(queryParam.getDepartment()))
|
||||
.salarySendId(queryParam.getSalarySendId())
|
||||
.mergeCountTax(queryParam.getMergeCountTax())
|
||||
.positionIds(SalaryEntityUtil.isNullOrEmpty(queryParam.getPosition()) ? null : Collections.singletonList(queryParam.getPosition()))
|
||||
.taxAgentId(queryParam.getTaxAgent())
|
||||
.username(queryParam.getUsername())
|
||||
.userstatus(queryParam.getUserstatus()).build();
|
||||
detailQueryParam.setCurrent(queryParam.getCurrent());
|
||||
detailQueryParam.setPageSize(queryParam.getPageSize());
|
||||
|
||||
return new ResponseResult<SalarySendDetailQueryParam, Map<String, Object>>(user).run(getSalarySendWrapper(user)::detailList, detailQueryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import com.engine.salary.util.SalaryEntityUtil;
|
|||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
|
|
|
|||
Loading…
Reference in New Issue