申报表状态更新主记录
This commit is contained in:
parent
7f965c41c9
commit
fbc9c1a187
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.taxdeclaration.param;
|
||||
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
|
@ -14,12 +15,16 @@ import lombok.Data;
|
|||
@Data
|
||||
public class TaxDeclareRecordParam {
|
||||
|
||||
//个税申报记录id")
|
||||
/**
|
||||
* 个税申报记录id
|
||||
*/
|
||||
@DataCheck(require = true,message = "个税申报记录id不能为空!")
|
||||
private Long taxDeclareRecordId;
|
||||
|
||||
/**
|
||||
* 申报类型
|
||||
* @see DeclareReportTypeEnum
|
||||
*/
|
||||
@DataCheck(require = true,message = "申报类型不能为空!")
|
||||
private Integer reportType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.taxdeclaration.po;
|
||||
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -23,6 +24,7 @@ public class TaxDeclareStatusPO {
|
|||
private Long taxDeclareRecordId;
|
||||
/**
|
||||
* 申报类型 1:综合所得; 2: 分类所得;3:非居民所得;4:限售股所得
|
||||
* @see DeclareReportTypeEnum
|
||||
*/
|
||||
private Integer reportType;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -44,4 +44,7 @@ public class TaxPaymentQueryParam {
|
|||
|
||||
//是否为反馈校验 0否 1是")
|
||||
private Integer checkFeedback;
|
||||
|
||||
//申报表类型
|
||||
private Integer reportType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO;
|
|||
import com.engine.salary.entity.taxdeclaration.param.DeclareTaxResultFeedbackQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordParam;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
|
||||
|
|
@ -85,9 +86,8 @@ public interface TaxDeclareRecordService {
|
|||
/**
|
||||
* 税局端申报明细查询
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
String queryCompanyIncomes(Long id);
|
||||
String queryCompanyIncomes(TaxDeclareRecordParam taxDeclareRecordParam);
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -194,5 +194,8 @@ public interface TaxDeclareRecordService {
|
|||
|
||||
void updateById(TaxDeclareRecordPO taxDeclareRecord);
|
||||
|
||||
List<TaxDeclareStatusPO> getTaxReports(Long id);
|
||||
List<TaxDeclareStatusPO> getOrInitTaxReports(Long id);
|
||||
|
||||
|
||||
void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,7 @@ import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
|
|||
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
|
||||
import com.engine.salary.entity.taxdeclaration.bo.*;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO;
|
||||
import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.DeclareTaxResultFeedbackQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.*;
|
||||
import com.engine.salary.entity.taxdeclaration.po.*;
|
||||
import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse;
|
||||
import com.engine.salary.entity.taxdeclaration.response.DeclareTaxFeedbackResponse;
|
||||
|
|
@ -57,6 +54,7 @@ import com.engine.salary.util.db.MapperProxyFactory;
|
|||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
|
|
@ -1068,7 +1066,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue());
|
||||
declareStatus.setTaxDeclareStatus(NOT_DECLARE.getValue());
|
||||
declareStatus.setRequestId("");
|
||||
getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus);
|
||||
updateTaxDeclareStatus(declareStatus);
|
||||
|
||||
// 记录日志
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
|
|
@ -1084,6 +1082,14 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus) {
|
||||
getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus);
|
||||
|
||||
//更新主记录
|
||||
getOrInitTaxReports(declareStatus.getTaxDeclareRecordId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void cancelCorrect(Long id) {
|
||||
|
|
@ -1144,8 +1150,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
Map<String, Object> requestParam = taxDeclareRequest.getRequestParam();
|
||||
// 税款所属期
|
||||
requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle()));
|
||||
// 申报类型
|
||||
requestParam.put("sblx", "1");
|
||||
// 请求
|
||||
String reqJson = JsonUtil.toJsonString(requestParam);
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.QUERY_DECLARE_STATUS;
|
||||
|
|
@ -1157,15 +1161,17 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
}
|
||||
|
||||
@Override
|
||||
public String queryCompanyIncomes(Long id) {
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
||||
public String queryCompanyIncomes(TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
ValidUtil.doValidator(taxDeclareRecordParam);
|
||||
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig();
|
||||
TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord();
|
||||
Map<String, Object> requestParam = taxDeclareRequest.getRequestParam();
|
||||
// 税款所属期
|
||||
requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(taxDeclareRecord.getTaxCycle()));
|
||||
// 报表类型
|
||||
requestParam.put("reportType", "1");
|
||||
requestParam.put("reportType", taxDeclareRecordParam.getReportType());
|
||||
// 页码
|
||||
requestParam.put("pageNo", "1");
|
||||
// 每页数量
|
||||
|
|
@ -1187,7 +1193,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<TaxDeclareStatusPO> getTaxReports(Long id) {
|
||||
public List<TaxDeclareStatusPO> getOrInitTaxReports(Long id) {
|
||||
|
||||
// 查询个税申报记录
|
||||
TaxDeclareRecordPO taxDeclareRecord = getById(id);
|
||||
|
|
@ -1208,7 +1214,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
|
||||
List<TaxDeclareStatusPO> statuses = new ArrayList<>();
|
||||
|
||||
|
||||
int personNum = 0;
|
||||
BigDecimal taxPayAmount = new BigDecimal(0);
|
||||
BigDecimal taxPaidAmount = new BigDecimal(0);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.engine.salary.entity.taxpayment.dto.TaxWithheldVoucherResultDTO;
|
|||
import com.engine.salary.entity.taxpayment.param.TaxPaymentQueryParam;
|
||||
import com.engine.salary.entity.taxpayment.response.BaseResponse;
|
||||
import com.engine.salary.entity.taxpayment.response.WithheldVoucherResponse;
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
|
|
@ -49,10 +50,20 @@ public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentServ
|
|||
param, tempWrapper.getApiConfigPO(), WithheldVoucherResponse.class);
|
||||
// 校验请求结果
|
||||
String responseCode = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getHead).map(SzyhResponseHead::getCode).orElse(null);
|
||||
WithheldVoucherResponse.Feedback feedback = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getBody).map(WithheldVoucherResponse.Body::getZhsd).orElse(null);
|
||||
WithheldVoucherResponse.Feedback feedback = Optional.ofNullable(queryResponse).map(WithheldVoucherResponse::getBody).map(body -> {
|
||||
if (DeclareReportTypeEnum.COMPREHENSIVE_INCOME.getValue().equals(param.getReportType())) {
|
||||
return body.getZhsd();
|
||||
} else if (DeclareReportTypeEnum.CLASSIFIED_INCOME.getValue().equals(param.getReportType())) {
|
||||
return body.getFlsd();
|
||||
} else if (DeclareReportTypeEnum.NONRESIDENT_INCOME.getValue().equals(param.getReportType())) {
|
||||
return body.getFjmsd();
|
||||
} else {
|
||||
return body.getXsgsd();
|
||||
}
|
||||
}).orElse(null);
|
||||
if (!SzyhApiConstant.SUCCESS_CODE.equals(responseCode) || Objects.isNull(feedback)) {
|
||||
log.info("getWithheldVoucher code error:{}", JSON.toJSONString(queryResponse));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel( 95828, "税局接口异常,请稍后重试"));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "税局接口异常,请稍后重试"));
|
||||
}
|
||||
Integer status = SalaryEntityUtil.getIntValue(feedback.getJkzt(), -1);
|
||||
if (status.equals(1)) {
|
||||
|
|
@ -61,7 +72,7 @@ public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentServ
|
|||
}
|
||||
List<TaxWithheldVoucherResultDTO.Voucher> vouchers = new ArrayList<>();
|
||||
for (int i = 1; i <= feedback.getWszmlb().size(); i++) {
|
||||
vouchers.add(new TaxWithheldVoucherResultDTO.Voucher(SalaryI18nUtil.getI18nLabel( 184013, "完税证明") + i, feedback.getWszmlb().get(i - 1)));
|
||||
vouchers.add(new TaxWithheldVoucherResultDTO.Voucher(SalaryI18nUtil.getI18nLabel(184013, "完税证明") + i, feedback.getWszmlb().get(i - 1)));
|
||||
}
|
||||
return new TaxWithheldVoucherResultDTO().setVouchers(vouchers);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,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.TaxAgreementFeedbackResultDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxAmountFormDTO;
|
||||
import com.engine.salary.entity.taxpayment.dto.TaxFeedbackResultDTO;
|
||||
|
|
@ -16,6 +17,8 @@ import com.engine.salary.entity.taxpayment.po.TaxPaymentRequestPO;
|
|||
import com.engine.salary.entity.taxpayment.response.BaseResponse;
|
||||
import com.engine.salary.entity.taxpayment.response.WithholdingFeedbackResponse;
|
||||
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxDeclareStatusEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxPaymentServiceTypeEnum;
|
||||
import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -23,8 +26,7 @@ import com.engine.salary.util.*;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 三方缴款
|
||||
|
|
@ -52,30 +54,66 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
log.info("getAgreementQueryFeedbackResponse not success: {}", JSON.toJSONString(feedbackResponse));
|
||||
throw new SalaryRunTimeException(msg);
|
||||
}
|
||||
WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse)
|
||||
.map(WithholdingFeedbackResponse::getBody)
|
||||
.map(WithholdingFeedbackResponse.Body::getZhsdjk)
|
||||
.orElse(null);
|
||||
if (feedback == null) {
|
||||
log.info("getAgreementQueryFeedbackResponse empty data error: {}", JSON.toJSONString(feedbackResponse));
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175338, "税局接口错误,未返回有效数据"));
|
||||
}
|
||||
|
||||
List<TaxDeclareStatusPO> statuses = getTaxDeclareRecordService(user).getTaxDeclareStatusByTaxDeclareRecordId(param.getTaxDeclareRecordId());
|
||||
statuses.forEach(status -> {
|
||||
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());
|
||||
getTaxDeclareRecordService(user).updateTaxDeclareStatus(status);
|
||||
});
|
||||
|
||||
TaxAmountFormDTO taxAmountFormDTO = queryTaxAmount(param);
|
||||
// 判断缴款状态是否成功
|
||||
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);
|
||||
// 更新个税申报记录状态为已缴款
|
||||
TaxDeclareRecordPO taxDeclareRecord = updateTaxDeclareRecord(param, totalPaid);
|
||||
|
||||
// // 更新个税申报记录状态为已缴款
|
||||
// TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO();
|
||||
// updateTaxDeclareRecord(param, totalPaid);
|
||||
// 更新缴款请求为已反馈
|
||||
updateTaxPaymentRequest(param);
|
||||
BigDecimal otherAmount = totalPaid.subtract(SalaryEntityUtil.empty2Zero(taxDeclareRecord.getTaxPurePaidAmount()));
|
||||
|
||||
TaxDeclareRecordPO declareRecordPO = getTaxDeclareRecordService(user).getById(param.getTaxDeclareRecordId());
|
||||
BigDecimal otherAmount = SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPaidAmount()).subtract(SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPurePaidAmount()));
|
||||
|
||||
return new TaxAgreementFeedbackResultDTO()
|
||||
.setPayAmount(SalaryEntityUtil.thousandthConvert(totalPaid.toString()))
|
||||
.setPayAmount(SalaryEntityUtil.thousandthConvert(SalaryEntityUtil.empty2Zero(declareRecordPO.getTaxPaidAmount()).toString()))
|
||||
.setOtherAmount(SalaryEntityUtil.thousandthConvert(otherAmount.toString()))
|
||||
.setPersonNum(taxAmountFormDTO.getPersonNum());
|
||||
}
|
||||
|
|
@ -94,8 +132,8 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_WITH_HOLDING;
|
||||
Map<String, Object> requestParam = DataCollectionBO.getApiBaseQueryParams(returnPO, taxAgentName, SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth()));
|
||||
requestParam.put("sfxyh", param.getProtocolNumber());
|
||||
requestParam.put("ynse", param.getTaxAmount());
|
||||
requestParam.put("sblx", "1");
|
||||
// requestParam.put("ynse", param.getTaxAmount());
|
||||
// requestParam.put("sblx", "1");
|
||||
return postRequest(apiConfig, url, requestParam, clazz);
|
||||
}
|
||||
|
||||
|
|
@ -118,20 +156,20 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
.build());
|
||||
|
||||
// if (paymentRequestPO != null) {
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER;
|
||||
QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class);
|
||||
SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead)
|
||||
.orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试")));
|
||||
SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode())
|
||||
|| SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg());
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.CANCEL_WITHHOLDING_VOUCHER;
|
||||
QuerySpecialAmountResponse cancelResponse = postRequest(apiConfig, url, requestParam, QuerySpecialAmountResponse.class);
|
||||
SzyhResponseHead head = Optional.ofNullable(cancelResponse).map(QuerySpecialAmountResponse::getHead)
|
||||
.orElse(new SzyhResponseHead("0", SalaryI18nUtil.getI18nLabel(183785, "银联缴款凭证作废失败,请稍后重试")));
|
||||
SalaryAssert.isTrue(SzyhApiConstant.SUCCESS_CODE.equals(head.getCode())
|
||||
|| SzyhApiConstant.NONE_VOUCHER_CODE.equals(head.getCode()), head.getMsg());
|
||||
|
||||
getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO
|
||||
.builder()
|
||||
.feedback(SalaryOnOffEnum.ON.getValue())
|
||||
.requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue())
|
||||
.taxAgentId(taxDeclareRecord.getTaxAgentId())
|
||||
.taxYearMonth(taxDeclareRecord.getTaxCycle())
|
||||
.build());
|
||||
getTaxPaymentRequestMapper().updateFeedbackByRequestTypeTaxAgentIdTaxYearMonth(TaxPaymentRequestPO
|
||||
.builder()
|
||||
.feedback(SalaryOnOffEnum.ON.getValue())
|
||||
.requestType(TaxPaymentServiceTypeEnum.WITHHOLDING_VOUCHER.getValue())
|
||||
.taxAgentId(taxDeclareRecord.getTaxAgentId())
|
||||
.taxYearMonth(taxDeclareRecord.getTaxCycle())
|
||||
.build());
|
||||
// }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -391,13 +391,13 @@ public class TaxDeclarationController {
|
|||
* @param taxDeclareRecordParam 撤销更正申报参数
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/cancelCorrect")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String cancelCorrect(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::cancelCorrect, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
}
|
||||
// @POST
|
||||
// @Path("/cancelCorrect")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String cancelCorrect(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
// User user = HrmUserVarify.getUser(request, response);
|
||||
// return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::cancelCorrect, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 税局端申报状态查询
|
||||
|
|
@ -424,7 +424,7 @@ public class TaxDeclarationController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String queryCompanyIncomes(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, String>(user).run(getTaxDeclareRecordWrapper(user)::queryCompanyIncomes, taxDeclareRecordParam.getTaxDeclareRecordId());
|
||||
return new ResponseResult<TaxDeclareRecordParam, String>(user).run(getTaxDeclareRecordWrapper(user)::queryCompanyIncomes,taxDeclareRecordParam);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -638,11 +638,10 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
/**
|
||||
* 税局端申报明细查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public String queryCompanyIncomes(Long id) {
|
||||
return getTaxDeclareRecordService(user).queryCompanyIncomes(id);
|
||||
public String queryCompanyIncomes(TaxDeclareRecordParam taxDeclareRecordParam) {
|
||||
return getTaxDeclareRecordService(user).queryCompanyIncomes(taxDeclareRecordParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -877,6 +876,6 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
}
|
||||
|
||||
public List<TaxDeclareStatusPO> getTaxReports(Long id) {
|
||||
return getTaxDeclareRecordService(user).getTaxReports(id);
|
||||
return getTaxDeclareRecordService(user).getOrInitTaxReports(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue