全电接口维护

beta-enc
dongxiaoke 2 years ago
parent 7cf3893e63
commit 115be8c6d1
  1. 5
      jianshui-common/src/main/java/com/jianshui/common/constant/WebServiceConstant.java
  2. 36
      jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/jcsk/CanRedDTO.java
  3. 49
      jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/jcsk/CanRedJsonDataDTO.java
  4. 38
      jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/InvoiceAllImpl.java

@ -98,6 +98,11 @@ public class WebServiceConstant {
public final static String CXHZFPXXQRDMX = "cxhzfpxxqrdmx";
/**
* 查询蓝字发票可红冲金额
*/
public final static String CXLZFPKHCJE = "cxlzfpkhcje";

@ -0,0 +1,36 @@
package com.jianshui.invoiceall.domain.dto.jcsk;
import com.jianshui.invoiceall.domain.dto.InvoiceAllCanRedJsonDataDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
/**
* 查询蓝字发票可红冲金额
*/
@Data
public class CanRedDTO {
@NotEmpty
@ApiModelProperty(value = "办税人身份证号")
private String bsrysfzjhm;
@NotEmpty
@ApiModelProperty(value = "*地区编码(参考码表)")
private String dqbm;
@NotEmpty
@ApiModelProperty(value = "")
private CanRedJsonDataDTO jsonData;
@NotEmpty
@ApiModelProperty(value = "纳税人识别号")
private String nsrsbh;
}

@ -0,0 +1,49 @@
package com.jianshui.invoiceall.domain.dto.jcsk;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
/**
* 查询蓝字发票可红冲金额
*/
@Data
public class CanRedJsonDataDTO {
@NotEmpty
@ApiModelProperty(value = "冲红原因代码")
private String chyydm;
@NotEmpty
@ApiModelProperty(value = "购买方纳税人识别号")
private String gmfnsrsbh;
@NotEmpty
@ApiModelProperty(value = "申请来源")
private String sqly;
@ApiModelProperty(value = "特定要素类型代码(参考码表)")
private String tdyslxdm;
@NotEmpty
@ApiModelProperty(value = "销售方纳税人识别号")
private String xsfnsrsbh;
@NotEmpty
@ApiModelProperty(value = "原发票号码")
private String yfphm;
@NotEmpty
@ApiModelProperty(value = "原开票日期")
private String ykprq;
@ApiModelProperty(value = "原纸质发票代码")
private String yzzfpdm;
@ApiModelProperty(value = "原纸质发票号码")
private String yzzfphm;
}

@ -1216,11 +1216,47 @@ public class InvoiceAllImpl implements IInvoiceAll {
@Override
public AjaxResult queryInvoiceBeRed(Companyservice companyservice, InvoiceAllCanRedDTO invoiceAllCanRedDTO) {
CanRedDTO canRedDTO = BeanUtil.copyProperties(invoiceAllCanRedDTO, CanRedDTO.class);
CanRedJsonDataDTO canRedJsonDataDTO = BeanUtil.copyProperties(invoiceAllCanRedDTO.getJsonData(), CanRedJsonDataDTO.class);
canRedDTO.setJsonData(canRedJsonDataDTO);
ValidateUtils.validate(canRedDTO);
ValidateUtils.validate(canRedJsonDataDTO);
JSONObject result = null;
try {
result = ApiHttp.request(WebServiceConstant.CXLZFPKHCJE, WebServiceConstant.URL, canRedDTO, companyservice);
String code = result.get("code") != null ? result.get("code").toString() : "";
String msg = result.get("msg") != null ? result.get("msg").toString() : "";
String data = result.get("data") != null ? result.get("data").toString() : "";
if ("0000".equals(code) && StrUtil.isNotEmpty(data)) {
JSONObject json = JSONUtil.parseObj(data);
String requestId = json.getOrDefault("requestId", "").toString();
if (StrUtil.isEmpty(requestId)) {
return AjaxResult.error(msg);
}
InvoiceAllApiLog allApiLog = new InvoiceAllApiLog();
allApiLog.setUrl(WebServiceConstant.CXLZFPKHCJE);
allApiLog.setSendMsg(canRedDTO.toString());
allApiLog.setResultMsg(JSONUtil.toJsonStr(result));
allApiLog.setCompany(companyservice.getSellertax());
allApiLog.setIdentityId(companyservice.getIdentity());
allApiLog.setRequestId(requestId);
allApiLog.setCreateTime(new Date());
allApiLogMapper.insertInvoiceAllApiLog(allApiLog);
} else {
return AjaxResult.error(msg);
}
} catch (Exception e) {
e.printStackTrace();
log.error("【金四服务类】【金财数科】【查询蓝字发票可红冲金额】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage());
return AjaxResult.error(ErrorCode.INCOME_ERROR);
}
return null;
return AjaxResult.success(result);
}

Loading…
Cancel
Save