大象数电特殊票种(建筑服务)

beta
kk 2 years ago
parent 0fc454b62f
commit 5289a46bd4
  1. 66
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceController.java
  2. 47
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/dto/adapter/request/aisino_jn/HxBillInfoDTO.java
  3. 6
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/dto/api/elephant/addInvoice/Fjys.java
  4. 4
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/ElephantInvoiceApiV6ServiceImpl.java

@ -1742,6 +1742,72 @@ public class InvoiceController {
}
/**
* 批量 开票请求接口-蓝字发票开具红字发票开具
*
* @param request
* @param identity
* @return
* @throws Exception
*/
@Validated
@ApiOperation("开票请求接口-(蓝字发票开具,红字发票开具)")
@ApiImplicitParams({
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true),
@ApiImplicitParam(name = "order", value = "请求体", dataType = "java.lang.Void", required = true)})
@PostMapping({"/api/invoice/v1/addInvoiceBatch", "/api/invoice/v1/addInvoiceBatch/{identity}", "/invoice/addInvoiceBatch"})
public Object addInvoiceBatch(HttpServletRequest request, String identity) throws Exception {
// TODO: 2023/11/2 批量开票接口
if (StringUtils.isEmpty(identity)) {
return AjaxResult.error(ErrorCode.EMPTY_IDENTITY);
}
Companyservice companyservice = iCompanyserviceService.selectCompanyserviceByIdentity(identity);
if (companyservice == null) {
return AjaxResult.error(ErrorCode.COMPANY_NOT_FOUND);
}
// 获得入口报文适配器
String requestAdapterKey = serviceManageService.getRequestAdapterKey("invoice", companyservice.getCompanyid());
IInvoiceRequestService invoiceRequestService = invoiceRequestFactory.getService(requestAdapterKey);
JSONObject decryptResult = invoiceRequestService.decrypt(request, companyservice, "add");
// 报文处理
BillInfo billInfo = decryptResult.toJavaObject(BillInfo.class);
if (billInfo == null) {
throw new JianshuiParamErrorException(ErrorCode.ERROR_PARAMS, companyservice, "invoice");
}
billInfo.setSource("2");
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier("invoice", companyservice.getCompanyid());
serviceManageService.companyConsume("invoice", companyservice.getCompanyid());
billInfo.setServiceSupplierKey(serviceKey);
IInvoiceApiService invoiceService = invoiceServiceFactory.getService(serviceKey);
HXResponse result = invoiceService.addInvoice(billInfo, companyservice);
// HXResponse result = preHandleDecryptResult(decryptResult, "add", companyservice);
String responseAdapterKey = serviceManageService.getResponseAdapterKey("invoice", companyservice.getCompanyid());
IInvoiceResponseService invoiceResponseService = invoiceResponseFactory.getService(responseAdapterKey);
return invoiceResponseService.response(result, companyservice, "add");
}

@ -1,9 +1,11 @@
package com.jianshui.invoice.domain.dto.adapter.request.aisino_jn;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jianshui.common.annotation.Excel;
import com.jianshui.invoice.domain.BillInfo;
import com.jianshui.invoice.domain.dto.api.elephant.addInvoice.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -348,8 +350,9 @@ public class HxBillInfoDTO extends BillInfo {
// private transient String invoiceState; // 发票开票状态。数据库里没有这个字段
/** 全电新增字段 **/
/**
* 全电新增字段
**/
@JSONField(name = "async")
private String async;
@ -442,22 +445,30 @@ public class HxBillInfoDTO extends BillInfo {
// @ApiModelProperty(value = "不动产")
// List<InvoiceAllAddtdywxxDTO> tdywxx;
// 2023/11/2 特殊票种新加
private List<Fjys> fjysList; // 附加要素列表
private List<Bdczlxx> bdczlxxList; // 不动产租赁
private List<Hwys> hwysList; // 货物运输
private List<Bdcxsxx> bdcxsxxListt; // 不动产销售信息
private List<Jzfwxx> jzfwList; // 建筑服务信息
@ApiModelProperty(value = "开票人证件类型")
private String KPRZJLX;
@ApiModelProperty(value = "电局登录用户名")
private String YHM;
private String cezslxdm; // 差额征税类型代码
private String sgfplxdm; // 收购发票类型代码
private String ckywszycdm; // 出口业务适用政策代码
private String zzszjtdm; // 增值税即征即退代码
private String gmfrb; // 经办人
private String jbrsfzjhm; // 经办人身份证件号码
private String gmfrblxdh; // 经办人联系电话
private String jsfs; // 结算方式
private String skyhmc; // 收款银行名称
private String skyhzh; // 收款银行账号
private String ysxwfsd; // 应税行为发生地
}

@ -9,11 +9,11 @@ import lombok.Data;
@Data
public class Fjys {
private String fjysmc; // 附加要素名称
private String FJYSMC; // 附加要素名称
private String fjyslx; // 附加要素类型
private String FJYSLX; // 附加要素类型
private String fjysz; // 附加要素值
private String FJYSZ; // 附加要素值
}

@ -157,7 +157,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
qdtxx.setJZFWXX(billInfo.getJzfwList());// 建筑服务信息
qdtxx.setBDCZLXX(billInfo.getBdczlxxList()); //不动产租赁信息
// 2023/9/27 处理开票接口特殊票种接口地址的转换
// 特殊票种地请求接口名转换
String url = ElephantConstantsV6.ADD_INVOICE_LOCALHOST;
if (CollectionUtils.isNotEmpty(qdtxx.getHWYSLIST())) {
//GenerateQdHwysInvoice 货物运输
@ -196,7 +196,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService {
AjaxResult queryResult = null;
try {
queryResult = ElephantUtils.sendRequestWithoutTokenV6New(ElephantConstantsV6.ADD_INVOICE_LOCALHOST, ElephantConstantsV6.ADD_INVOICE_METHOD, JSONUtil.parse(elephantInvoiceAddDTO), companyservice);
queryResult = ElephantUtils.sendRequestWithoutTokenV6New(url, "", JSONUtil.parse(elephantInvoiceAddDTO), companyservice);
} catch (UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeyException e) {
log.error("【销项发票】【大象接口】【发票开具】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(elephantInvoiceAddDTO).toString(), JSONObject.toJSONString(companyservice));
e.printStackTrace();

Loading…
Cancel
Save