Merge remote-tracking branch 'origin/beta' into beta

beta-prop-all^2
路明慧 2 years ago
commit c6c88f56c2
  1. 66
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceController.java
  2. 41
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoiceall/v1/InvoiceAllController.java
  3. 2
      jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/IInvoiceAll.java
  4. 31
      jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/InvoiceAllImpl.java
  5. 47
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/dto/adapter/request/aisino_jn/HxBillInfoDTO.java
  6. 6
      jianshui-invoice/src/main/java/com/jianshui/invoice/domain/dto/api/elephant/addInvoice/Fjys.java
  7. 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");
}

@ -344,6 +344,47 @@ public class InvoiceAllController {
return incomeResponseService.response(result, companyservice, "");
}
@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_all/v1/qrcodeResult/{identity}", "/api/invoice_all/v1/qrcodeResult"})
public Object qrcodeResult(HttpServletRequest request, String identity) throws Exception {
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(SERVICE_KEY, companyservice.getCompanyid());
IInvoiceAllRequestService incomeRequestService = invoiceAllRequestFactory.getService(requestAdapterKey);
JSONObject requestBody = incomeRequestService.decrypt(request, companyservice);
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IInvoiceAll invoiceAllService = iInvoceiAllServiceFactory.getService(serviceKey);
AjaxResult result = invoiceAllService.qrcodeResult(companyservice, requestBody);
//返回处理 增加调用次数
if (result.isSuccess()) {
serviceManageService.companyConsume(SERVICE_KEY, companyservice.getCompanyid());
}
//返回报文处理器
String responseAdapterKey = serviceManageService.getResponseAdapterKey(SERVICE_KEY, companyservice.getCompanyid());
IInvoiceAllResponseService incomeResponseService = invoiceAllResponseFactory.getService(responseAdapterKey);
return incomeResponseService.response(result, companyservice, "");
}
@ApiOperation("发票查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true),

@ -152,4 +152,6 @@ public interface IInvoiceAll {
/** 查询蓝字发票可红冲金额*/
AjaxResult queryInvoiceBeRed(Companyservice companyservice, InvoiceAllCanRedDTO invoiceAllCanRedDTO);
/** 获取人脸识别结果*/
AjaxResult qrcodeResult(Companyservice companyservice, JSONObject requestBody);
}

@ -1265,5 +1265,36 @@ public class InvoiceAllImpl implements IInvoiceAll {
return AjaxResult.success(result);
}
/** 获取人脸识别结果接口 */
@Override
public AjaxResult qrcodeResult(Companyservice companyservice, com.alibaba.fastjson.JSONObject requestBody) {
JSONObject result = null;
try {
result = ApiHttp.request(WebServiceConstant.HQRLSBJG, WebServiceConstant.URL, requestBody, 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);
}
return AjaxResult.success(json);
} else {
return AjaxResult.error(msg);
}
} catch (Exception e) {
e.printStackTrace();
log.error("【金四服务类】【金财数科】【获取人脸识别结果接口】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage());
return AjaxResult.error(ErrorCode.INCOME_ERROR);
}
}
}

@ -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; // 附加要素值
}

@ -162,7 +162,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 货物运输
@ -201,7 +201,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();