This commit is contained in:
钱涛 2025-07-02 20:43:53 +08:00
parent 2a883868ba
commit d6061fa059
3 changed files with 14 additions and 6 deletions

View File

@ -813,14 +813,22 @@
left join hrsa_other_derate_deduction f on t.id=f.main_id and f.delete_type=0 and f.income_category=#{param.incomeCategory}
left join hrsa_personal_pension g on t.id=g.main_id and g.delete_type=0 and g.income_category=#{param.incomeCategory}
where t.delete_type=0
and t.tax_agent_id = #{param.taxAgentId}
and t.declare_month = #{param.declareMonth}
<if test="param.taxAgentId != null">
and t.tax_agent_id = #{param.taxAgentId}
</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.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>
</select>
</mapper>

View File

@ -102,11 +102,11 @@ public interface OtherDeductionService {
* 按照申报表类型获取其他免税扣除数据
* @param declareMonth
* @param employeeIds
* @param taxAgentId
* @param taxAgentIds
* @param incomeCategory
* @return
*/
List<OtherDeductionPO> getOtherDeductionList(YearMonth declareMonth, List<Long> employeeIds, Long taxAgentId, Integer incomeCategory);
List<OtherDeductionPO> getOtherDeductionList(YearMonth declareMonth, List<Long> employeeIds, List<Long> taxAgentIds, Integer incomeCategory);
/**
* 编辑数据

View File

@ -1894,18 +1894,18 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
@Override
public List<OtherDeductionPO> getOtherDeductionList(YearMonth declareMonth, List<Long> employeeIds, Long taxAgentId, Integer incomeCategory) {
public List<OtherDeductionPO> getOtherDeductionList(YearMonth declareMonth, List<Long> employeeIds, List<Long> taxAgentIds, Integer incomeCategory) {
if (declareMonth == null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:申报月份必传"));
}
if (taxAgentId == null) {
if (CollUtil.isEmpty(taxAgentIds)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:扣缴义务人必传"));
}
if (incomeCategory == null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:所得项目必传"));
}
List<OtherDeductionPO> otherDeductionPOS = listDetails(OtherDeductionPO.builder().incomeCategory(incomeCategory).declareMonth(SalaryDateUtil.toDateStartOfMonth(declareMonth)).employeeIds(employeeIds).taxAgentId(taxAgentId).build());
List<OtherDeductionPO> otherDeductionPOS = listDetails(OtherDeductionPO.builder().incomeCategory(incomeCategory).declareMonth(SalaryDateUtil.toDateStartOfMonth(declareMonth)).employeeIds(employeeIds).taxAgentIds(taxAgentIds).build());
if (CollUtil.isEmpty(otherDeductionPOS)) {
return new ArrayList<>();
}