更正申报接口
This commit is contained in:
parent
325e7609b7
commit
5cffdbc8e6
|
|
@ -83,7 +83,13 @@ public class SzyhApiConstant {
|
||||||
/**
|
/**
|
||||||
* 更正申报
|
* 更正申报
|
||||||
*/
|
*/
|
||||||
public static final String UPDATE_DECLARE = "/gateway/iit/report/correct";
|
// public static final String UPDATE_DECLARE = "/gateway/iit/report/correct";
|
||||||
|
public static final String UPDATE_DECLARE = "/gateway/iit/service/correct";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更正申报反馈
|
||||||
|
*/
|
||||||
|
public static final String UPDATE_DECLARE_FEEDBACK = "/gateway/iit/service/getCorrectFeedback";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 撤销更正申报
|
* 撤销更正申报
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO;
|
||||||
import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO;
|
import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||||
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
||||||
|
import com.engine.salary.entity.taxagent.response.GetRequestIdResponse;
|
||||||
import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
|
import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
|
||||||
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
|
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
|
||||||
import com.engine.salary.entity.taxdeclaration.bo.*;
|
import com.engine.salary.entity.taxdeclaration.bo.*;
|
||||||
|
|
@ -720,7 +721,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
||||||
declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue());
|
declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue());
|
||||||
declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId());
|
declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId());
|
||||||
declareStatus.setTaxDeclareErrorMsg("");
|
declareStatus.setTaxDeclareErrorMsg("");
|
||||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus, true);
|
||||||
|
|
||||||
// 记录日志
|
// 记录日志
|
||||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||||
|
|
@ -736,8 +737,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
||||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) {
|
public void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) {
|
||||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
||||||
|
|
@ -845,7 +844,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
||||||
declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString());
|
declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString());
|
||||||
}
|
}
|
||||||
//更新申报状态
|
//更新申报状态
|
||||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus, true);
|
||||||
|
|
||||||
// 如果申报失败
|
// 如果申报失败
|
||||||
if (CollectionUtils.isNotEmpty(taxDeclareFails)) {
|
if (CollectionUtils.isNotEmpty(taxDeclareFails)) {
|
||||||
|
|
@ -916,7 +915,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
||||||
// 更新个税申报状态
|
// 更新个税申报状态
|
||||||
declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue());
|
declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue());
|
||||||
declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId());
|
declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId());
|
||||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus, true);
|
||||||
|
|
||||||
// 记录日志
|
// 记录日志
|
||||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||||
|
|
@ -973,7 +972,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
||||||
//更新个税申报状态
|
//更新个税申报状态
|
||||||
declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue());
|
declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue());
|
||||||
declareStatus.setRequestId("");
|
declareStatus.setRequestId("");
|
||||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus, true);
|
||||||
|
|
||||||
// 记录日志
|
// 记录日志
|
||||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||||
|
|
@ -1011,12 +1010,30 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
||||||
requestParam.put("sblx", reportType + "");
|
requestParam.put("sblx", reportType + "");
|
||||||
// 请求
|
// 请求
|
||||||
String reqJson = JsonUtil.toJsonString(requestParam);
|
String reqJson = JsonUtil.toJsonString(requestParam);
|
||||||
log.info("更正申报请求数据:" + reqJson);
|
|
||||||
String url = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE;
|
String url = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE;
|
||||||
Map<String, String> params = new HashMap<>(1);
|
Map<String, String> params = new HashMap<>(1);
|
||||||
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||||
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||||
log.info("更正申报返回数据:" + res);
|
GetRequestIdResponse getRequestIdResponse = JsonUtil.parseObject(res, GetRequestIdResponse.class);
|
||||||
|
log.info("更正申报请求数据1:=== params:{} ,getRequestIdResponse:{}", res, getRequestIdResponse);
|
||||||
|
|
||||||
|
|
||||||
|
if (Objects.isNull(getRequestIdResponse) || Objects.isNull(getRequestIdResponse.getHead())) {
|
||||||
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常"));
|
||||||
|
}
|
||||||
|
if (!Objects.equals(getRequestIdResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE) || getRequestIdResponse.getBody() == null) {
|
||||||
|
throw new SalaryRunTimeException(getRequestIdResponse.getHead().getMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
String feedbackUrl = apiConfig.getHost() + SzyhApiConstant.UPDATE_DECLARE_FEEDBACK;
|
||||||
|
Map<String, String> feedbackHeader = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||||
|
Map<String, String> map = new HashMap<>(1);
|
||||||
|
String requestId = getRequestIdResponse.getBody().getRequestId();
|
||||||
|
map.put("requestId", requestId);
|
||||||
|
res = HttpUtil.getRequest(feedbackUrl, feedbackHeader, map);
|
||||||
|
log.info("更正申报请求数据2: === requestId :{} === res : {}", requestId, res);
|
||||||
|
|
||||||
UpdateDeclareResponse updateDeclareResponse = JsonUtil.parseObject(res, UpdateDeclareResponse.class);
|
UpdateDeclareResponse updateDeclareResponse = JsonUtil.parseObject(res, UpdateDeclareResponse.class);
|
||||||
if (Objects.isNull(updateDeclareResponse) || Objects.isNull(updateDeclareResponse.getHead())) {
|
if (Objects.isNull(updateDeclareResponse) || Objects.isNull(updateDeclareResponse.getHead())) {
|
||||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常"));
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常"));
|
||||||
|
|
@ -1029,7 +1046,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
||||||
declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue());
|
declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue());
|
||||||
declareStatus.setTaxDeclareStatus(NOT_DECLARE.getValue());
|
declareStatus.setTaxDeclareStatus(NOT_DECLARE.getValue());
|
||||||
declareStatus.setRequestId("");
|
declareStatus.setRequestId("");
|
||||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus, true);
|
||||||
|
|
||||||
// 记录日志
|
// 记录日志
|
||||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue