|
|
|
@ -100,6 +100,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
@Override |
|
|
|
|
public HXResponse addInvoice(BillInfo billInfo, Companyservice companyservice) throws IllegalAccessException, InstantiationException { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 预处理
|
|
|
|
|
try { |
|
|
|
|
billInfo = BillInfoUtils.processBillInfo(billInfo, companyservice); |
|
|
|
@ -123,20 +124,35 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
String fplxdm = ElephantUtils.transElephantType(invioceType, 1); |
|
|
|
|
ddpcxx.setFPLXDM(fplxdm); |
|
|
|
|
|
|
|
|
|
//kk TODO : 2023/9/15 V6数电新增
|
|
|
|
|
//kk 2023/9/15 V6数电新增
|
|
|
|
|
// 标准开具
|
|
|
|
|
Qdtxx qdtxx = BeanUtil.copyProperties(billInfo, Qdtxx.class); |
|
|
|
|
|
|
|
|
|
// TODO: 2023/9/22 特定要素类型代码处理
|
|
|
|
|
// 2023/9/22 特定要素类型代码处理
|
|
|
|
|
qdtxx.setTdys(billInfo.getTdyslxdm()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qdtxx.setQydm(billInfo.getDqbm()); |
|
|
|
|
qdtxx.setFJYSLIST(billInfo.getFjyslist());// 附加要素列表
|
|
|
|
|
qdtxx.setHWYSLIST(billInfo.getHwysList()); // 货物运输
|
|
|
|
|
qdtxx.setBDCXSXX(billInfo.getBdcxsxxListt());// 不动产销售信息
|
|
|
|
|
qdtxx.setJZFWXX(billInfo.getJzfwList());// 建筑服务信息
|
|
|
|
|
|
|
|
|
|
qdtxx.setBDCZLXX(billInfo.getBdczlxxList()); //不动产租赁信息
|
|
|
|
|
|
|
|
|
|
// 2023/9/27 处理开票接口特殊票种接口地址的转换
|
|
|
|
|
String url = ElephantConstantsV6.ADD_INVOICE_LOCALHOST; |
|
|
|
|
if (CollectionUtils.isNotEmpty(qdtxx.getHWYSLIST())) { |
|
|
|
|
//GenerateQdHwysInvoice 货物运输
|
|
|
|
|
url = ElephantConstantsV6.GENERATE_QD_HWYS_INVOICE; |
|
|
|
|
} else if (CollectionUtils.isNotEmpty(qdtxx.getBDCXSXX())) { |
|
|
|
|
// GenerateQdBdcxsInvoice 不动产销售信息
|
|
|
|
|
url = ElephantConstantsV6.GENERATE_QD_BDCXS_INVOICE; |
|
|
|
|
} else if (CollectionUtils.isNotEmpty(qdtxx.getJZFWXX())) { |
|
|
|
|
// GenerateQdJzfwInvoice 建筑服务信息
|
|
|
|
|
url = ElephantConstantsV6.GENERATE_QD_JZFW_INVOICE; |
|
|
|
|
} else if (CollectionUtils.isNotEmpty(qdtxx.getBDCZLXX())) { |
|
|
|
|
// GenerateQdBdczlInvoice 不动产租赁信息
|
|
|
|
|
url = ElephantConstantsV6.GENERATE_QD_BDXZL_INVOICE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 开始处理详情
|
|
|
|
|
List<BillDetail> details = billInfo.getBillDetailList(); |
|
|
|
@ -772,8 +788,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 红字确认单列表查询(数电专用) |
|
|
|
|
* |
|
|
|
|
* */ |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public HXResponse queryRedConfirmationList(JSONObject decryptResult, Companyservice companyservice) { |
|
|
|
|
|
|
|
|
@ -792,6 +807,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 红字确认单明细查询(数电专用) |
|
|
|
|
* |
|
|
|
|
* @param decryptResult |
|
|
|
|
* @param companyservice |
|
|
|
|
* @return |
|
|
|
@ -812,6 +828,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 红字确认单申请(数电专用) |
|
|
|
|
* |
|
|
|
|
* @param decryptResult |
|
|
|
|
* @param companyservice |
|
|
|
|
* @return |
|
|
|
@ -833,6 +850,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 红字确认单确认接口 |
|
|
|
|
* |
|
|
|
|
* @param decryptResult |
|
|
|
|
* @param companyservice |
|
|
|
|
* @return |
|
|
|
@ -853,6 +871,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 数电登录接口(数电专用接口) |
|
|
|
|
* |
|
|
|
|
* @param decryptResult |
|
|
|
|
* @param companyservice |
|
|
|
|
* @return |
|
|
|
@ -872,15 +891,14 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 数电实名认证状态查询接口(数电专用接口) |
|
|
|
|
* |
|
|
|
|
* @param decryptResult |
|
|
|
|
* @param companyservice |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@Override |
|
|
|
|
public HXResponse getRpaAuthStatus(JSONObject decryptResult, Companyservice companyservice) { |
|
|
|
|
DxhyInterfaceResponse dxhyInterfaceResponse = null; |
|
|
|
|
try { |
|
|
|
@ -896,6 +914,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 发票平台电子税局账号查询接口(数电专用接口) |
|
|
|
|
* |
|
|
|
|
* @param decryptResult |
|
|
|
|
* @param companyservice |
|
|
|
|
* @return |
|
|
|
@ -939,9 +958,9 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
String dataTemp = dataJson.get("DATA") != null ? dataJson.get("DATA").toString() : ""; |
|
|
|
|
|
|
|
|
|
if ("000000".equals(ztdm)) { |
|
|
|
|
if(StrUtil.isNotEmpty(dataTemp)){ |
|
|
|
|
if (StrUtil.isNotEmpty(dataTemp)) { |
|
|
|
|
return new HXResponse(code, "", dataTemp, true); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
return new HXResponse(code, "", data, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1002,11 +1021,11 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
String invioceType = redinfo.getInvoiceType(); |
|
|
|
|
fplxdm = ElephantUtils.transElephantType(invioceType, 1); |
|
|
|
|
|
|
|
|
|
RedUpload redUpload = BeanUtil.copyProperties(redinfo,RedUpload.class); |
|
|
|
|
RedUpload redUpload = BeanUtil.copyProperties(redinfo, RedUpload.class); |
|
|
|
|
|
|
|
|
|
// 报文组装
|
|
|
|
|
Invoice invoice = invoiceMapper.selectByFpdmFphm(companyservice.getCompanyid(),redinfo.getOriginFpdm(),redinfo.getOriginFphm()); |
|
|
|
|
if(BeanUtil.isEmpty(invoice)){ |
|
|
|
|
Invoice invoice = invoiceMapper.selectByFpdmFphm(companyservice.getCompanyid(), redinfo.getOriginFpdm(), redinfo.getOriginFphm()); |
|
|
|
|
if (BeanUtil.isEmpty(invoice)) { |
|
|
|
|
return new HXResponse("009999", "未查询到原蓝字发票信息!"); |
|
|
|
|
} |
|
|
|
|
// 蓝字发票信息补全
|
|
|
|
@ -1019,7 +1038,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
redUpload.setSFZZFPBZ("Y"); |
|
|
|
|
|
|
|
|
|
List<InvoiceDetail> invoiceDetail = invoice.getInvoiceDetailList(); |
|
|
|
|
if(CollectionUtils.isEmpty(invoiceDetail)){ |
|
|
|
|
if (CollectionUtils.isEmpty(invoiceDetail)) { |
|
|
|
|
return new HXResponse("009999", "未查询到原蓝字发票明细信息!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1055,9 +1074,9 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
// 组装通用报文
|
|
|
|
|
AjaxResult queryResult = null; |
|
|
|
|
queryResult.put("code",dxhyInterfaceResponse.getCode()); |
|
|
|
|
queryResult.put("data",dxhyInterfaceResponse.getData()); |
|
|
|
|
queryResult.put("msg",dxhyInterfaceResponse.getMessage()); |
|
|
|
|
queryResult.put("code", dxhyInterfaceResponse.getCode()); |
|
|
|
|
queryResult.put("data", dxhyInterfaceResponse.getData()); |
|
|
|
|
queryResult.put("msg", dxhyInterfaceResponse.getMessage()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.info("【销项发票】【大象发票】红字信息表上传请求结果{}", queryResult.toString()); |
|
|
|
@ -1762,6 +1781,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 数电获取实名认证二维码接口(数电专用接口) |
|
|
|
|
* |
|
|
|
|
* @param decryptResult |
|
|
|
|
* @param companyservice |
|
|
|
|
* @return |
|
|
|
@ -1782,8 +1802,6 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public HXResponse query(InvoiceAllFileQueryTWODTO invoiceAllFileQueryTWODTO, Companyservice companyservice) { |
|
|
|
|
return null; |
|
|
|
|