@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSONArray ;
import cn.hutool.json.JSONUtil ;
import com.alibaba.fastjson.JSONObject ;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper ;
import com.google.gson.Gson ;
import com.jianshui.common.core.domain.AjaxResult ;
import com.jianshui.common.core.domain.entity.Companyservice ;
@ -14,6 +15,7 @@ import com.jianshui.common.exception.jianshui.JianshuiServiceException;
import com.jianshui.common.utils.StringUtils ;
import com.jianshui.common.utils.http.HttpHelper ;
import com.jianshui.common.utils.uuid.IdUtils ;
import com.jianshui.framework.manager.AsyncManager ;
import com.jianshui.invoice.constant.elephant.ElephantConstants ;
import com.jianshui.invoice.domain.BillInfo ;
import com.jianshui.invoice.domain.FindRedInfo ;
@ -42,6 +44,7 @@ import com.jianshui.system.service.IServiceManageService;
import io.swagger.annotations.* ;
import lombok.extern.slf4j.Slf4j ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.scheduling.annotation.Async ;
import org.springframework.validation.annotation.Validated ;
import org.springframework.web.bind.annotation.* ;
@ -51,6 +54,7 @@ import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException ;
import java.util.Date ;
import java.util.List ;
import java.util.TimerTask ;
/ * *
* @Description
@ -85,7 +89,6 @@ public class InvoiceController {
private InvoiceBackMapper invoiceBackMapper ;
/ * *
* 功能描述 : 红字查询接口
*
@ -263,7 +266,9 @@ public class InvoiceController {
}
/** 开票查询接口(发票请求流水号)*/
/ * *
* 开票查询接口 ( 发票请求流水号 )
* /
@Validated
// @ApiOperation("开票查询接口(发票请求流水号)")
@ApiImplicitParams ( {
@ -273,8 +278,6 @@ public class InvoiceController {
public Object queryInvoice ( HttpServletRequest request , String identity ) throws Exception {
if ( StringUtils . isEmpty ( identity ) ) {
return AjaxResult . error ( ErrorCode . EMPTY_IDENTITY ) ;
}
@ -297,7 +300,9 @@ public class InvoiceController {
return invoiceResponseService . response ( result , companyservice , "query" ) ;
}
/** 开票查询接口(订单号)*/
/ * *
* 开票查询接口 ( 订单号 )
* /
@Validated
// @ApiOperation("开票查询接口(订单号)")
@ApiImplicitParams ( {
@ -328,7 +333,9 @@ public class InvoiceController {
}
/** 开票查询接口(范围查询)*/
/ * *
* 开票查询接口 ( 范围查询 )
* /
@Validated
// @ApiOperation("开票查询接口(范围查询)")
@ApiImplicitParams ( {
@ -359,7 +366,9 @@ public class InvoiceController {
}
/** 作废发票*/
/ * *
* 作废发票
* /
@Validated
// @ApiOperation("作废发票")
@ApiImplicitParams ( {
@ -399,7 +408,9 @@ public class InvoiceController {
return invoiceResponseService . response ( result , companyservice , "deprecate" ) ;
}
/** 作废发票结果查询*/
/ * *
* 作废发票结果查询
* /
@Validated
// @ApiOperation("作废发票结果查询")
@ApiImplicitParams ( {
@ -484,7 +495,9 @@ public class InvoiceController {
}
/** 红字信息表下载*/
/ * *
* 红字信息表下载
* /
@Validated
// @ApiOperation("红字信息表下载")
@ApiImplicitParams ( {
@ -526,7 +539,9 @@ public class InvoiceController {
return invoiceResponseService . response ( result , companyservice , "download_redinfo" ) ;
}
/** 发票推送接口*/
/ * *
* 发票推送接口
* /
@Validated
// @ApiOperation("发票推送接口")
@ApiImplicitParams ( {
@ -571,7 +586,9 @@ public class InvoiceController {
}
/** 发票批量打印接口*/
/ * *
* 发票批量打印接口
* /
@Validated
// @ApiOperation("发票批量打印接口")
@ApiImplicitParams ( {
@ -615,7 +632,9 @@ public class InvoiceController {
return invoiceResponseService . response ( result , companyservice , "batch_print" ) ;
}
/** 打印机查询接口*/
/ * *
* 打印机查询接口
* /
@Validated
// @ApiOperation("打印机查询接口")
@ApiImplicitParams ( {
@ -659,7 +678,9 @@ public class InvoiceController {
return invoiceResponseService . response ( result , companyservice , "printer" ) ;
}
/** 发票签章*/
/ * *
* 发票签章
* /
@Validated
// @ApiOperation("发票签章")
@ApiImplicitParams ( {
@ -689,7 +710,9 @@ public class InvoiceController {
return invoiceResponseService . response ( result , companyservice , "sign_e_seal" ) ;
}
/** 发票专用章导入注册*/
/ * *
* 发票专用章导入注册
* /
@Validated
// @ApiOperation("发票专用章导入注册")
@ApiImplicitParams ( {
@ -719,7 +742,9 @@ public class InvoiceController {
return invoiceResponseService . response ( result , companyservice , "register_e_seal" ) ;
}
/** 发票专用章图片生成*/
/ * *
* 发票专用章图片生成
* /
@Validated
// @ApiOperation("发票专用章图片生成")
@ApiImplicitParams ( {
@ -1021,7 +1046,9 @@ public class InvoiceController {
* @Return
* /
/** 通用异步查询接口*/
/ * *
* 通用异步查询接口
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1056,7 +1083,9 @@ public class InvoiceController {
}
/** 获取发票下载地址*/
/ * *
* 获取发票下载地址
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1091,7 +1120,9 @@ public class InvoiceController {
}
/** 全电文件获取*/
/ * *
* 全电文件获取
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1129,7 +1160,9 @@ public class InvoiceController {
}
/** 获取人脸识别二维码*/
/ * *
* 获取人脸识别二维码
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1166,7 +1199,9 @@ public class InvoiceController {
}
/** 获取人脸识别结果*/
/ * *
* 获取人脸识别结果
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1203,8 +1238,9 @@ public class InvoiceController {
}
/** 发票查询*/
/ * *
* 发票查询
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1241,7 +1277,9 @@ public class InvoiceController {
}
/** 获取发票打印XML*/
/ * *
* 获取发票打印XML
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1278,7 +1316,9 @@ public class InvoiceController {
}
/** 快速红冲*/
/ * *
* 快速红冲
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1316,7 +1356,9 @@ public class InvoiceController {
}
/** 蓝字发票统计*/
/ * *
* 蓝字发票统计
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1352,7 +1394,9 @@ public class InvoiceController {
}
/** 审核红字信息表*/
/ * *
* 审核红字信息表
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1390,7 +1434,9 @@ public class InvoiceController {
}
/** 查询红字信息表明细*/
/ * *
* 查询红字信息表明细
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1427,7 +1473,9 @@ public class InvoiceController {
}
/** 单据传入*/
/ * *
* 单据传入
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1456,7 +1504,9 @@ public class InvoiceController {
}
/** 大象数电V6 */
/** 生成动态二维码接口 (扫码开票)*/
/ * *
* 生成动态二维码接口 ( 扫码开票 )
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1488,7 +1538,9 @@ public class InvoiceController {
}
/** 红字确认单列表查询(数电专用) */
/ * *
* 红字确认单列表查询 ( 数电专用 )
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1520,7 +1572,9 @@ public class InvoiceController {
}
/** 红字确认单明细查询(数电专用) */
/ * *
* 红字确认单明细查询 ( 数电专用 )
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1585,7 +1639,9 @@ public class InvoiceController {
} * /
/** 红字确认单确认(数电专用) */
/ * *
* 红字确认单确认 ( 数电专用 )
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1618,7 +1674,9 @@ public class InvoiceController {
}
/** 数电登录接口(数电专用接口) */
/ * *
* 数电登录接口 ( 数电专用接口 )
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1651,7 +1709,9 @@ public class InvoiceController {
}
/** 数电实名认证状态查询接口(数电专用接口) */
/ * *
* 数电实名认证状态查询接口 ( 数电专用接口 )
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1684,7 +1744,9 @@ public class InvoiceController {
}
/** 发票平台电子税局账号查询接口(数电专用接口) */
/ * *
* 发票平台电子税局账号查询接口 ( 数电专用接口 )
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1717,8 +1779,9 @@ public class InvoiceController {
}
/** 导出机动车加密数据(重汽) */
/ * *
* 导出机动车加密数据 ( 重汽 )
* /
@ApiImplicitParams ( {
@ApiImplicitParam ( name = "identity" , value = "身份认证" , dataType = "java.lang.Void" , example = "1130" , required = true ) ,
@ApiImplicitParam ( name = "order" , value = "请求体" , dataType = "java.lang.Void" , required = true ) } )
@ -1751,7 +1814,6 @@ public class InvoiceController {
}
/ * *
* 批量 : 开票请求接口 - ( 蓝字发票开具 , 红字发票开具 )
*
@ -1768,21 +1830,24 @@ public class InvoiceController {
@PostMapping ( { "/api/invoice/v1/addInvoiceBatch" , "/api/invoice/v1/addInvoiceBatch/{identity}" , "/invoice/addInvoiceBatch" } )
public void addInvoiceBatch ( HttpServletRequest request , String identity ) throws Exception {
// 异步任务
// 1-前置条件判断
InvoiceBack invoiceBack = new InvoiceBack ( ) ;
invoiceBack . setUpdateTime ( new Date ( ) ) ;
invoiceBack . setCreateTime ( new Date ( ) ) ;
invoiceBack . setId ( IdUtil . randomUUID ( ) ) ;
invoiceBack . setSystemOrderno ( IdUtil . randomUUID ( ) ) ;
invoiceBack . setStatus ( "1" ) ;
invoiceBack . setIdentity ( identity ) ;
invoiceBack . setBackMsg ( "" ) ;
invoiceBack . setBackUrl ( "" ) ;
// InvoiceBack invoiceBack = new InvoiceBack();
// invoiceBack.setUpdateTime(new Date());
// invoiceBack.setCreateTime(new Date());
// invoiceBack.setId(IdUtil.randomUUID());
// invoiceBack.setSystemOrderno(IdUtil.randomUUID());
// invoiceBack.setStatus("1");
// invoiceBack.setIdentity(identity);
// invoiceBack.setBackMsg("");
// invoiceBack.setBackUrl("");
// 1-1 identity校验
if ( StringUtils . isEmpty ( identity ) ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "身份认证参数为空!" ) ;
// invoiceBack.setResultCode("9999");
// invoiceBack.setResultMsg("身份认证参数为空!");
log . info ( "[重汽批量开票接口]身份认证参数为空!" ) ;
return ;
}
@ -1792,15 +1857,15 @@ public class InvoiceController {
try {
companyservice = iCompanyserviceService . selectCompanyserviceByIdentity ( identity ) ;
} catch ( Exception e ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "企业信息不存在!" ) ;
log . info ( "[重汽批量开票接口]获取企业信息异常!identity={},e={}" , identity , e ) ;
// invoiceBack.setResultCode("9999");
// invoiceBack.setResultMsg("企业信息不存在!");
log . info ( "[重汽批量开票接口]获取企业信息异常!identity={},e={}" , identity , e ) ;
return ;
}
if ( companyservice = = null ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "企业信息不存在!" ) ;
log . info ( "[重汽批量开票接口]企业信息不存在!identity={}" , identity ) ;
// invoiceBack.setResultCode("9999");
// invoiceBack.setResultMsg("企业信息不存在!");
log . info ( "[重汽批量开票接口]企业信息不存在!identity={}" , identity ) ;
return ;
}
@ -1809,11 +1874,11 @@ public class InvoiceController {
try {
String requestAdapterKey = serviceManageService . getRequestAdapterKey ( "invoice" , companyservice . getCompanyid ( ) ) ;
IInvoiceRequestService invoiceRequestService = invoiceRequestFactory . getService ( requestAdapterKey ) ;
decryptResult = invoiceRequestService . decrypt ( request , companyservice , "add" ) ;
decryptResult = invoiceRequestService . decrypt ( request , companyservice , "addBatch " ) ;
} catch ( Exception e ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "请求解密失败!" ) ;
log . info ( "[重汽批量开票接口]请求解密失败!identity={}" , identity ) ;
// invoiceBack.setResultCode("9999");
// invoiceBack.setResultMsg("请求解密失败!");
log . info ( "[重汽批量开票接口]请求解密失败!identity={},e={} " , identity , e ) ;
return ;
}
@ -1822,15 +1887,15 @@ public class InvoiceController {
try {
billJson = JSONUtil . parseObj ( decryptResult ) ;
} catch ( Exception e ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "未匹配到发票报文!" ) ;
log . info ( "[重汽批量开票接口]报文格式化异常!identity={},e={}" , identity , e ) ;
// invoiceBack.setResultCode("9999");
// invoiceBack.setResultMsg("未匹配到发票报文!");
log . info ( "[重汽批量开票接口]报文格式化异常!identity={},e={}" , identity , e ) ;
return ;
}
if ( billJson . get ( "billInfo" ) = = null ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "未匹配到发票报文!" ) ;
log . info ( "[重汽批量开票接口]未匹配到发票报文!identity={}" , identity ) ;
if ( billJson . get ( "billInfo" ) = = null ) {
// invoiceBack.setResultCode("9999");
// invoiceBack.setResultMsg("未匹配到发票报文!");
log . info ( "[重汽批量开票接口]未匹配到发票报文!identity={}" , identity ) ;
return ;
}
@ -1838,26 +1903,37 @@ public class InvoiceController {
try {
billJsonArray = JSONUtil . parseArray ( billJson . get ( "billInfo" ) ) ;
} catch ( Exception e ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "发票报文为空!" ) ;
log . info ( "[重汽批量开票接口]发票报文获取异常!identity={},e={}" , identity , e ) ;
// invoiceBack.setResultCode("9999");
// invoiceBack.setResultMsg("发票报文为空!");
log . info ( "[重汽批量开票接口]发票报文获取异常!identity={},e={}" , identity , e ) ;
return ;
}
if ( billJsonArray . size ( ) = = 0 ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "发票报文为空!" ) ;
log . info ( "[重汽批量开票接口]发票报文为空!identity={}" , identity ) ;
if ( billJsonArray . size ( ) = = 0 ) {
// invoiceBack.setResultCode("9999");
// invoiceBack.setResultMsg("发票报文为空!");
log . info ( "[重汽批量开票接口]发票报文为空!identity={}" , identity ) ;
return ;
}
// 3-报文递交开票
for ( Object billInfoObj : billJsonArray ) {
BillInfo billInfo = BeanUtil . copyProperties ( billInfoObj , BillInfo . class ) ;
// 1-前置条件判断
InvoiceBack invoiceBack = new InvoiceBack ( ) ;
invoiceBack . setUpdateTime ( new Date ( ) ) ;
invoiceBack . setCreateTime ( new Date ( ) ) ;
invoiceBack . setId ( IdUtil . randomUUID ( ) ) ;
invoiceBack . setSystemOrderno ( IdUtil . randomUUID ( ) ) ;
invoiceBack . setStatus ( "1" ) ;
invoiceBack . setIdentity ( identity ) ;
invoiceBack . setBackMsg ( "" ) ;
invoiceBack . setBackUrl ( "" ) ;
BillInfo billInfo = BeanUtil . copyProperties ( billInfoObj , BillInfo . class ) ;
if ( billInfo = = null ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "报文格式错误!" ) ;
log . info ( "[重汽批量开票接口]报文格式错误!identity={}" , identity ) ;
// invoiceBack.setResultCode("9999");
// invoiceBack.setResultMsg("报文格式错误!");
log . info ( "[重汽批量开票接口]报文格式错误!identity={}" , identity ) ;
continue ;
}
billInfo . setSource ( "2" ) ;
@ -1870,47 +1946,78 @@ public class InvoiceController {
billInfo . setServiceSupplierKey ( serviceKey ) ;
invoiceService = invoiceServiceFactory . getService ( serviceKey ) ;
} catch ( Exception e ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "扣费失败!" ) ;
log . info ( "[重汽批量开票接口]扣费失败!identity={},e={}" , identity , e ) ;
// invoiceBack.setResultCode("9999");
// invoiceBack.setResultMsg("扣费失败!");
log . info ( "[重汽批量开票接口]扣费失败!identity={},e={}" , identity , e ) ;
continue ;
}
// 5-开票
try {
HXResponse resultHx = invoiceService . addInvoice ( billInfo , companyservice ) ;
log . info ( "[重汽批量开票接口]开票identity={},返回结果result={}" , identity , resultHx ) ;
if ( ! resultHx . isSuccess ( ) ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( resultHx . getMessage ( ) ) ;
invoiceBack . setSystemOrderno ( billInfo . getSystemOrderno ( ) ) ;
invoiceBack . setStatus ( "0" ) ;
invoiceBackMapper . insertInvoiceBack ( invoiceBack ) ;
log . info ( "[重汽批量开票接口]提交开票异常,开票失败!identity={},msg={}" , identity , resultHx . getMessage ( ) ) ;
log . info ( "[重汽批量开票接口]开票identity={},返回结果result={}" , identity , resultHx ) ;
if ( ! resultHx . isSuccess ( ) ) {
QueryWrapper < InvoiceBack > queryWrapper = new QueryWrapper < > ( ) ;
queryWrapper . eq ( "system_orderno" , billInfo . getOutTradeOrderno ( ) ) ;
InvoiceBack invoiceBackTemp = invoiceBackMapper . selectOne ( queryWrapper ) ;
if ( invoiceBackTemp ! = null ) {
invoiceBackTemp . setResultCode ( "9999" ) ;
invoiceBackTemp . setResultMsg ( resultHx . getMessage ( ) ) ;
invoiceBackTemp . setStatus ( "0" ) ;
invoiceBackTemp . setUpdateTime ( new Date ( ) ) ;
invoiceBackMapper . updateInvoiceBack ( invoiceBackTemp ) ;
invoiceService . callBackAisino ( invoiceBackTemp , "" , Long . valueOf ( identity ) ) ;
} else {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( resultHx . getMessage ( ) ) ;
invoiceBack . setSystemOrderno ( billInfo . getOutTradeOrderno ( ) ) ;
invoiceBack . setStatus ( "0" ) ;
invoiceBack . setCreateTime ( new Date ( ) ) ;
invoiceBackMapper . insertInvoiceBack ( invoiceBack ) ;
invoiceService . callBackAisino ( invoiceBackTemp , "" , Long . valueOf ( identity ) ) ;
}
log . info ( "[重汽批量开票接口]提交开票异常,开票失败!identity={},msg={}" , identity , resultHx . getMessage ( ) ) ;
continue ;
}
} catch ( Exception e ) {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "开票失败!" ) ;
invoiceBack . setSystemOrderno ( billInfo . getSystemOrderno ( ) ) ;
invoiceBack . setStatus ( "0" ) ;
invoiceBackMapper . insertInvoiceBack ( invoiceBack ) ;
log . info ( "[重汽批量开票接口]提交开票异常,开票失败!identity={},e={}" , identity , e ) ;
continue ;
}
}
log . info ( "[重汽批量开票接口]{},执行完成!" , identity ) ;
}
QueryWrapper < InvoiceBack > queryWrapper = new QueryWrapper < > ( ) ;
queryWrapper . eq ( "system_orderno" , billInfo . getOutTradeOrderno ( ) ) ;
InvoiceBack invoiceBackTemp = invoiceBackMapper . selectOne ( queryWrapper ) ;
if ( invoiceBackTemp ! = null ) {
invoiceBackTemp . setResultCode ( "9999" ) ;
invoiceBackTemp . setResultMsg ( "开票失败!" ) ;
invoiceBackTemp . setStatus ( "0" ) ;
invoiceBackTemp . setUpdateTime ( new Date ( ) ) ;
invoiceBackMapper . updateInvoiceBack ( invoiceBackTemp ) ;
invoiceService . callBackAisino ( invoiceBackTemp , "" , Long . valueOf ( identity ) ) ;
} else {
invoiceBack . setResultCode ( "9999" ) ;
invoiceBack . setResultMsg ( "开票失败!" ) ;
invoiceBack . setSystemOrderno ( billInfo . getOutTradeOrderno ( ) ) ;
invoiceBack . setStatus ( "0" ) ;
invoiceBack . setCreateTime ( new Date ( ) ) ;
invoiceBackMapper . insertInvoiceBack ( invoiceBack ) ;
invoiceService . callBackAisino ( invoiceBackTemp , "" , Long . valueOf ( identity ) ) ;
}
log . info ( "[重汽批量开票接口]提交开票异常,开票失败!identity={},e={}" , identity , e ) ;
continue ;
}
}
log . info ( "[重汽批量开票接口]{},执行完成!" , identity ) ;
}
}