Merge remote-tracking branch 'origin/custom/联特' into custom/联特
This commit is contained in:
commit
83d2cf2eb1
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_tax_payment_request add report_type number(11) null;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_tax_payment_request add report_type number(11) null;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_tax_payment_request add report_type number(11) null;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE hrsa_tax_payment_request ADD COLUMN report_type int NULL;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
alter table hrsa_tax_payment_request add report_type number(11) null
|
||||
/
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE hrsa_tax_payment_request ADD COLUMN report_type int ;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
alter table hrsa_tax_payment_request add report_type int null
|
||||
go
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
alter table hrsa_tax_payment_request add report_type number(11) null;
|
||||
/
|
||||
|
||||
|
|
@ -73,6 +73,8 @@ public class TaxPaymentRequestPO implements Serializable {
|
|||
//是否已获取反馈")
|
||||
private Integer feedback;
|
||||
|
||||
private Integer reportType;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -79,8 +79,6 @@ public interface TaxPaymentRequestMapper {
|
|||
|
||||
void updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO build);
|
||||
|
||||
void updateFeedbackByTaxDeclareRecordId(TaxPaymentRequestPO build);
|
||||
|
||||
TaxPaymentRequestPO getOne(TaxPaymentRequestPO build);
|
||||
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
<result column="tax_year_month" property="taxYearMonth"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="report_type" property="reportType"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -32,6 +33,7 @@
|
|||
, t.tax_year_month
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
, t.report_type
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
@ -93,6 +95,9 @@
|
|||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="reportType != null">
|
||||
AND report_type = #{reportType}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -142,7 +147,10 @@
|
|||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time
|
||||
update_time,
|
||||
</if>
|
||||
<if test="reportType != null">
|
||||
report_type
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -180,7 +188,10 @@
|
|||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime}
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="reportType != null">
|
||||
#{reportType}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
@ -201,7 +212,8 @@
|
|||
tax_declare_record_id,
|
||||
tax_year_month,
|
||||
tenant_key,
|
||||
update_time
|
||||
update_time,
|
||||
report_type
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
|
|
@ -217,7 +229,8 @@
|
|||
#{item.taxDeclareRecordId},
|
||||
#{item.taxYearMonth},
|
||||
#{item.tenantKey},
|
||||
#{item.updateTime}
|
||||
#{item.updateTime},
|
||||
#{item.reportType}
|
||||
</foreach>
|
||||
)
|
||||
</insert>
|
||||
|
|
@ -236,7 +249,8 @@
|
|||
tax_declare_record_id,
|
||||
tax_year_month,
|
||||
tenant_key,
|
||||
update_time
|
||||
update_time,
|
||||
report_type
|
||||
)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
|
|
@ -252,7 +266,8 @@
|
|||
#{item.taxDeclareRecordId,jdbcType=DOUBLE},
|
||||
#{item.taxYearMonth,jdbcType=DATE},
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.updateTime,jdbcType=DATE}
|
||||
#{item.updateTime,jdbcType=DATE},
|
||||
#{item.reportType,jdbcType=INTEGER}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
@ -272,7 +287,8 @@
|
|||
tax_declare_record_id,
|
||||
tax_year_month,
|
||||
tenant_key,
|
||||
update_time
|
||||
update_time,
|
||||
report_type
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
|
|
@ -287,7 +303,8 @@
|
|||
#{item.taxDeclareRecordId},
|
||||
#{item.taxYearMonth},
|
||||
#{item.tenantKey},
|
||||
#{item.updateTime}
|
||||
#{item.updateTime},
|
||||
#{item.reportType}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
|
@ -307,6 +324,7 @@
|
|||
tax_year_month=#{taxYearMonth},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
report_type=#{reportType},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
@ -349,6 +367,9 @@
|
|||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="reportType != null">
|
||||
report_type=#{reportType},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
@ -385,17 +406,9 @@
|
|||
AND request_type=#{requestType}
|
||||
AND tax_agent_id=#{taxAgentId}
|
||||
AND tax_year_month=#{taxYearMonth}
|
||||
AND report_type=#{reportType}
|
||||
</update>
|
||||
|
||||
<update id="updateFeedbackByTaxDeclareRecordId"
|
||||
parameterType="com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO">
|
||||
UPDATE hrsa_tax_payment_request
|
||||
<set>
|
||||
feedback=#{feedback}
|
||||
</set>
|
||||
WHERE delete_type = 0
|
||||
AND tax_declare_record_id=#{taxDeclareRecordId}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
|
|
@ -407,6 +420,7 @@
|
|||
AND request_type = #{requestType}
|
||||
AND tax_agent_id = #{taxAgentId}
|
||||
AND tax_year_month = #{taxYearMonth}
|
||||
AND report_type = #{reportType}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -11,6 +11,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
|||
import com.engine.salary.entity.taxagent.response.SzyhResponseHead;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO;
|
||||
|
|
@ -34,7 +35,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
|
|
@ -54,6 +54,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa
|
|||
protected TaxDeclareStatusService getTaxDeclareStatusService(User user) {
|
||||
return ServiceUtil.getService(TaxDeclareStatusServiceImpl.class, user);
|
||||
}
|
||||
|
||||
protected TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -172,6 +173,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa
|
|||
.requestType(param.getType())
|
||||
.taxAgentId(param.getTaxAgentId())
|
||||
.taxYearMonth(param.getTaxYearMonth())
|
||||
.reportType(param.getReportType())
|
||||
.build());
|
||||
}
|
||||
} else {
|
||||
|
|
@ -189,6 +191,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa
|
|||
.requestId(requestId)
|
||||
.requestType(param.getType())
|
||||
.feedback(SalaryOnOffEnum.OFF.getValue())
|
||||
.reportType(param.getReportType())
|
||||
.build();
|
||||
getTaxPaymentRequestMapper().insertIgnoreNull(paymentRequestPO);
|
||||
}
|
||||
|
|
@ -200,6 +203,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa
|
|||
.builder()
|
||||
.taxAgentId(param.getTaxAgentId())
|
||||
.taxYearMonth(param.getTaxYearMonth())
|
||||
.reportType(param.getReportType())
|
||||
.build());
|
||||
if (Objects.isNull(param.getCheckFeedback()) || SalaryOnOffEnum.ON.getValue().equals(param.getCheckFeedback())) {
|
||||
TaxPaymentRequestPO notFeedback = paymentRequests.stream()
|
||||
|
|
@ -226,6 +230,7 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa
|
|||
.requestType(getServiceType())
|
||||
.taxAgentId(param.getTaxAgentId())
|
||||
.taxYearMonth(param.getTaxYearMonth())
|
||||
.reportType(param.getReportType())
|
||||
.build());
|
||||
SalaryAssert.notNull(paymentRequest, "请先点击[三方缴款]或[银行端凭证缴款]按钮发起缴款请求后,再点击[缴款反馈]按钮");
|
||||
paymentRequest.setFeedback(SalaryOnOffEnum.ON.getValue());
|
||||
|
|
@ -256,10 +261,11 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa
|
|||
public TaxAmountFormDTO queryTaxAmount(TaxPaymentQueryParam param) {
|
||||
TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId());
|
||||
SalaryAssert.notNull(taxDeclareRecord, "个税申报记录不存在");
|
||||
if (!TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue().equals(taxDeclareRecord.getTaxDeclareStatus())) {
|
||||
TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(param.getTaxDeclareRecordId(), param.getReportType());
|
||||
if (!TaxDeclareStatusEnum.DECLARE_SUCCESS_UNPAID.getValue().equals(taxDeclareStatus.getTaxDeclareStatus())) {
|
||||
throw new SalaryRunTimeException("当前申报状态不是[申报成功,未缴费],暂时无法获取");
|
||||
}
|
||||
if (taxDeclareRecord.getTaxPayAmount() == null || taxDeclareRecord.getPersonNum() == null) {
|
||||
if (taxDeclareStatus.getTaxPayAmount() == null || taxDeclareStatus.getPersonNum() == null) {
|
||||
throw new SalaryRunTimeException("未获取到应缴信息,请先进行个税在线申报");
|
||||
}
|
||||
TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(taxDeclareRecord.getTaxAgentId());
|
||||
|
|
@ -267,32 +273,11 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa
|
|||
|
||||
return TaxAmountFormDTO.builder()
|
||||
.taxAgent(taxAgentPO.getName())
|
||||
.amount(SalaryEntityUtil.thousandthConvert(taxDeclareRecord.getTaxPayAmount()))
|
||||
.personNum(taxDeclareRecord.getPersonNum().toString())
|
||||
.amount(SalaryEntityUtil.thousandthConvert(taxDeclareStatus.getTaxPayAmount()))
|
||||
.personNum(taxDeclareStatus.getPersonNum().toString())
|
||||
.build();
|
||||
}
|
||||
|
||||
protected TaxDeclareRecordPO updateTaxDeclareRecord(TaxPaymentQueryParam param, BigDecimal totalPaid) {
|
||||
TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId());
|
||||
if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue().equals(taxDeclareRecord.getTaxDeclareStatus())) {
|
||||
throw new SalaryRunTimeException("当前申报表状态为已缴款,无法更新状态");
|
||||
}
|
||||
BigDecimal taxPayAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPayAmount());
|
||||
BigDecimal taxPurePaidAmount = SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount());
|
||||
if (SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPaidAmount()).equals(totalPaid)
|
||||
&& taxPayAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
throw new SalaryRunTimeException("请进行缴款后再刷新缴款状态");
|
||||
}
|
||||
taxDeclareRecord.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue());
|
||||
taxDeclareRecord.setTaxPaidAmount(totalPaid.toString());
|
||||
taxDeclareRecord.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString());
|
||||
taxDeclareRecord.setTaxPayAmount(BigDecimal.ZERO.toString());
|
||||
taxDeclareRecord.setUpdateTime(new Date());
|
||||
getTaxDeclareRecordService(user).updateById(taxDeclareRecord);
|
||||
// 填充回去后续返回数据用
|
||||
taxDeclareRecord.setTaxPayAmount(taxPayAmount.toString());
|
||||
return taxDeclareRecord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map<String, Object> requestParam) {
|
||||
|
|
|
|||
|
|
@ -405,11 +405,13 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
if (openSum != null && StringUtils.isNotBlank(openSum.getConfValue()) && OpenEnum.parseByValue(openSum.getConfValue()) == OpenEnum.OPEN) {
|
||||
total = true;
|
||||
Map<String, Object> sumRow = getSalaryAcctResultService(user).sumRow(queryParam);
|
||||
sumRow.forEach((k, v) -> {
|
||||
if (NumberUtils.isCreatable(v.toString())) {
|
||||
sumRow.put(k, new BigDecimal(v.toString()));
|
||||
}
|
||||
});
|
||||
if (sumRow != null) {
|
||||
sumRow.forEach((k, v) -> {
|
||||
if (NumberUtils.isCreatable(v.toString())) {
|
||||
sumRow.put(k, new BigDecimal(v.toString()));
|
||||
}
|
||||
});
|
||||
}
|
||||
if (sumRow != null) {
|
||||
sumRow.put("taxAgentName", "总计");
|
||||
resultMapList.add(sumRow);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
|
|||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxAgreementFeedbackResultDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO;
|
||||
import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam;
|
||||
import com.engine.salary.entity.taxpayment.response.BaseResponse;
|
||||
|
|
@ -23,7 +22,6 @@ import com.engine.salary.util.*;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
|
@ -55,53 +53,57 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
throw new SalaryRunTimeException(msg);
|
||||
}
|
||||
|
||||
List<TaxDeclareStatusPO> statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(param.getTaxDeclareRecordId());
|
||||
for (TaxDeclareStatusPO status : statuses) {
|
||||
WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse)
|
||||
.map(WithholdingFeedbackResponse::getBody)
|
||||
.map(body -> {
|
||||
if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.COMPREHENSIVE_INCOME.getValue())) {
|
||||
return body.getZhsdjk();
|
||||
} else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.CLASSIFIED_INCOME.getValue())) {
|
||||
return body.getFlsdjk();
|
||||
} else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.NONRESIDENT_INCOME.getValue())) {
|
||||
return body.getFjmsdjk();
|
||||
} else {
|
||||
return body.getXsgsdjk();
|
||||
}
|
||||
TaxDeclareStatusPO status = getTaxDeclareStatusService(user).getTaxDeclareStatus(param.getTaxDeclareRecordId(),param.getReportType());
|
||||
WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse)
|
||||
.map(WithholdingFeedbackResponse::getBody)
|
||||
.map(body -> {
|
||||
if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.COMPREHENSIVE_INCOME.getValue())) {
|
||||
return body.getZhsdjk();
|
||||
} else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.CLASSIFIED_INCOME.getValue())) {
|
||||
return body.getFlsdjk();
|
||||
} else if (Objects.equals(status.getReportType(), DeclareReportTypeEnum.NONRESIDENT_INCOME.getValue())) {
|
||||
return body.getFjmsdjk();
|
||||
} else {
|
||||
return body.getXsgsdjk();
|
||||
}
|
||||
|
||||
})
|
||||
.orElse(null);
|
||||
if (feedback == null) {
|
||||
log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据"));
|
||||
}
|
||||
// 判断缴款状态是否成功
|
||||
Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1);
|
||||
TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class);
|
||||
if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) {
|
||||
throw new SalaryRunTimeException(String.format("缴款失败,失败原因:%s,申报状态:%s", feedback.getJksbyy(), feedback.getSbzt()));
|
||||
}
|
||||
// 累计实缴金额
|
||||
BigDecimal totalPaid = feedback.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue().equals(status.getTaxDeclareStatus())) {
|
||||
throw new SalaryRunTimeException("当前申报表状态为已缴款,无法更新状态");
|
||||
}
|
||||
BigDecimal taxPayAmount = SalaryEntityUtil.empty2Zero(status.getTaxPayAmount());
|
||||
BigDecimal taxPurePaidAmount = SalaryEntityUtil.empty2Zero(status.getTaxPurePaidAmount());
|
||||
if (SalaryEntityUtil.empty2Zero(status.getTaxPaidAmount()).equals(totalPaid)
|
||||
&& taxPayAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
throw new SalaryRunTimeException("请进行缴款后再刷新缴款状态");
|
||||
}
|
||||
status.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue());
|
||||
status.setTaxPaidAmount(totalPaid.toString());
|
||||
status.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString());
|
||||
status.setTaxPayAmount(BigDecimal.ZERO.toString());
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(status, false);
|
||||
})
|
||||
.orElse(null);
|
||||
if (feedback == null) {
|
||||
// 更新缴款请求为已反馈
|
||||
updateTaxPaymentRequest(param);
|
||||
log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据"));
|
||||
}
|
||||
// 判断缴款状态是否成功
|
||||
Integer paymentStatus = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1);
|
||||
TaxPaymentStatusEnum paymentStatusEnum = SalaryEnumUtil.enumMatchByValue(paymentStatus, TaxPaymentStatusEnum.class);
|
||||
if (paymentStatusEnum != TaxPaymentStatusEnum.SUCCESS) {
|
||||
// 更新缴款请求为已反馈
|
||||
updateTaxPaymentRequest(param);
|
||||
throw new SalaryRunTimeException(String.format("缴款失败,失败原因:%s,申报状态:%s", feedback.getJksbyy(), feedback.getSbzt()));
|
||||
}
|
||||
// 累计实缴金额
|
||||
BigDecimal totalPaid = feedback.getKkfhlb().stream().map(e -> new BigDecimal(e.getSjse())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue().equals(status.getTaxDeclareStatus())) {
|
||||
// 更新缴款请求为已反馈
|
||||
updateTaxPaymentRequest(param);
|
||||
throw new SalaryRunTimeException("当前申报表状态为已缴款,无法更新状态");
|
||||
}
|
||||
BigDecimal taxPayAmount = SalaryEntityUtil.empty2Zero(status.getTaxPayAmount());
|
||||
BigDecimal taxPurePaidAmount = SalaryEntityUtil.empty2Zero(status.getTaxPurePaidAmount());
|
||||
if (SalaryEntityUtil.empty2Zero(status.getTaxPaidAmount()).equals(totalPaid) && taxPayAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
// 更新缴款请求为已反馈
|
||||
updateTaxPaymentRequest(param);
|
||||
throw new SalaryRunTimeException("请进行缴款后再刷新缴款状态");
|
||||
}
|
||||
status.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.getValue());
|
||||
status.setTaxPaidAmount(totalPaid.toString());
|
||||
status.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString());
|
||||
status.setTaxPayAmount(BigDecimal.ZERO.toString());
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(status, false);
|
||||
|
||||
TaxAmountFormDTO taxAmountFormDTO = queryTaxAmount(param);
|
||||
|
||||
//更新主记录
|
||||
getTaxDeclareStatusService(user).updateRecord(param.getTaxDeclareRecordId());
|
||||
|
|
@ -112,9 +114,9 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
BigDecimal otherAmount = SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPaidAmount()).subtract(SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPurePaidAmount()));
|
||||
|
||||
return new TaxAgreementFeedbackResultDTO()
|
||||
.setPayAmount(SalaryEntityUtil.thousandthConvert(SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPaidAmount()).toString()))
|
||||
.setPayAmount(SalaryEntityUtil.thousandthConvert(SalaryEntityUtil.empty2Zero(status.getTaxPaidAmount()).toString()))
|
||||
.setOtherAmount(SalaryEntityUtil.thousandthConvert(otherAmount.toString()))
|
||||
.setPersonNum(taxAmountFormDTO.getPersonNum());
|
||||
.setPersonNum(status.getPersonNum().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -106,14 +106,6 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS
|
|||
|
||||
@Override
|
||||
public void cancelWithholdingVoucher(TaxDeclarationApiConfigPO apiConfig, TaxDeclareRecordPO taxDeclareRecord, Map<String, Object> requestParam) {
|
||||
TaxPaymentRequestPO paymentRequestPO = getTaxPaymentRequestMapper().getOne(TaxPaymentRequestPO
|
||||
.builder()
|
||||
.requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue())
|
||||
.taxAgentId(taxDeclareRecord.getTaxAgentId())
|
||||
.taxYearMonth(taxDeclareRecord.getTaxCycle())
|
||||
.build());
|
||||
// if (paymentRequestPO != null) {
|
||||
|
||||
List<TaxDeclareStatusPO> statuses = getTaxDeclareStatusService(user).getTaxDeclareStatusByTaxDeclareRecordId(taxDeclareRecord.getId());
|
||||
TaxPaymentClient taxPaymentClient = new TaxPaymentClient(taxDeclareRecord.getTaxAgentId());
|
||||
statuses.forEach(status -> {
|
||||
|
|
@ -128,9 +120,9 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS
|
|||
.requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue())
|
||||
.taxAgentId(taxDeclareRecord.getTaxAgentId())
|
||||
.taxYearMonth(taxDeclareRecord.getTaxCycle())
|
||||
.reportType(status.getReportType())
|
||||
.build());
|
||||
});
|
||||
// }
|
||||
}
|
||||
|
||||
// @Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue