Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01

# Conflicts:
#	src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java
This commit is contained in:
钱涛 2025-04-23 17:42:08 +08:00
commit 2fe958f5db
6 changed files with 40 additions and 22 deletions

View File

@ -38,6 +38,10 @@ public class TaxDeclarationListDTO {
@TableTitle(title = "薪资类型", dataIndex = "incomeCategory", key = "incomeCategory")
private String incomeCategory;
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
@TableTitle(title = "税款所属期", dataIndex = "taxCycle", key = "taxCycle")
private Date taxCycle;
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
@TableTitle(title = "薪资所属月", dataIndex = "salaryMonth", key = "salaryMonth")
private Date salaryMonth;
@ -48,10 +52,6 @@ public class TaxDeclarationListDTO {
@TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName")
private String taxAgentName;
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
@TableTitle(title = "税款所属期", dataIndex = "taxCycle", key = "taxCycle")
private Date taxCycle;
//@TableTitle(title = "操作人id", dataIndex = "operateEmployeeId", key = "operateEmployeeId")
private Long operateEmployeeId;

View File

@ -1,9 +1,12 @@
package com.engine.salary.entity.taxdeclaration.param;
import com.engine.salary.common.BaseQueryParam;
import lombok.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.YearMonth;
import java.util.Date;
/**
* 个税申报记录查询条件
@ -19,13 +22,7 @@ import java.time.YearMonth;
@AllArgsConstructor
public class TaxDeclarationListQueryParam extends BaseQueryParam {
//薪资所属月范围起点
private YearMonth fromSalaryMonth;
private Date fromSalaryMonth;
//薪资所属月范围终点
private YearMonth endSalaryMonth;
private String fromSalaryMonthStr;
private String endSalaryMonthStr;
private Date endSalaryMonth;
}

View File

@ -90,6 +90,13 @@ public class TaxDeclarationPO {
LocalDateRange salaryMonths;
//"开始日期
private Date taxCycleFromDate;
//结束日期
private Date taxCycleEndDate;
private Collection<Long> taxAgentIds;
private Set<String> opts;

View File

@ -61,6 +61,12 @@
<if test="salaryMonths != null and salaryMonths.endDate != null">
AND salary_month <![CDATA[ <= ]]> #{salaryMonths.endDate}
</if>
<if test="taxCycleFromDate != null">
AND tax_cycle <![CDATA[ >= ]]> #{taxCycleFromDate}
</if>
<if test="taxCycleEndDate != null">
AND tax_cycle <![CDATA[ <= ]]> #{taxCycleEndDate}
</if>
<if test="taxAgentIds != null and taxAgentIds.size()>0">
AND tax_agent_id IN
<foreach collection="taxAgentIds" open="(" item="id" separator="," close=")">

View File

@ -119,14 +119,25 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
public PageInfo<TaxDeclarationPO> listPageByParam(TaxDeclarationListQueryParam queryParam) {
// 分页参数
TaxDeclarationPO po = TaxDeclarationPO.builder().build();
LocalDateRange localDateRange = new LocalDateRange();
if (Objects.nonNull(queryParam.getFromSalaryMonth())) {
localDateRange.setFromDate(SalaryDateUtil.localDateToDate(queryParam.getFromSalaryMonth().atDay(1)));
po.setTaxCycleFromDate(queryParam.getFromSalaryMonth());
}
if (Objects.nonNull(queryParam.getEndSalaryMonth())) {
localDateRange.setEndDate(SalaryDateUtil.localDateToDate(queryParam.getEndSalaryMonth().atEndOfMonth()));
po.setTaxCycleEndDate(queryParam.getEndSalaryMonth());
}
// 分权
Boolean openDevolution = getTaxAgentService(user).isNeedAuth(currentEmployeeId);
if (openDevolution) {
// 查询负责管理的个税扣缴义务人
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents(currentEmployeeId);
if (CollectionUtils.isEmpty(taxAgentPOS)) {
return new PageInfo<>(new ArrayList<>());
}
Set<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId);
po.setTaxAgentIds(taxAgentIds);
}
po.setSalaryMonths(localDateRange);
// 查询个税申报表
List<TaxDeclarationPO> taxDeclarationPOS = getTaxDeclarationMapper().listSome(po);

View File

@ -31,7 +31,6 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.ParseException;
import java.time.LocalDate;
@ -58,10 +57,8 @@ public class TaxDeclarationController {
@POST
@Path("/list")
@Produces(MediaType.APPLICATION_JSON)
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam) throws ParseException {
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam){
User user = HrmUserVarify.getUser(request, response);
queryParam.setFromSalaryMonth(SalaryDateUtil.String2YearMonth(queryParam.getFromSalaryMonthStr() == null ? "" : queryParam.getFromSalaryMonthStr()));
queryParam.setEndSalaryMonth(SalaryDateUtil.String2YearMonth(queryParam.getEndSalaryMonthStr() == null ? "" : queryParam.getEndSalaryMonthStr()));
return new ResponseResult<TaxDeclarationListQueryParam, PageInfo<TaxDeclarationListDTO>>(user).run(getTaxDeclarationWrapper(user)::listPage, queryParam);
}