|
|
@ -1260,11 +1260,11 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { |
|
|
|
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { |
|
|
|
log.error("【销项发票】【大象接口】【发票开具】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(queryBody).toString(), JSONObject.toJSONString(companyservice)); |
|
|
|
log.error("【销项发票】【大象接口】【发票开具】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(queryBody).toString(), JSONObject.toJSONString(companyservice)); |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
throw new JianshuiServiceException("系统异常!"); |
|
|
|
return new HXResponse("9999", "系统异常!"); |
|
|
|
} |
|
|
|
} |
|
|
|
// 判断外层报文是否成功
|
|
|
|
// 判断外层报文是否成功
|
|
|
|
if (queryResult.isError()) { |
|
|
|
if (queryResult.isError()) { |
|
|
|
throw new JianshuiServiceException(queryResult.getMsg()); |
|
|
|
return new HXResponse("9999", "未查询到发票结果"); |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject contentJson = queryResult.getJsonData(); |
|
|
|
JSONObject contentJson = queryResult.getJsonData(); |
|
|
|
ElephantInvoiceQueryResultDTO queryResultDTO = contentJson.toJavaObject(ElephantInvoiceQueryResultDTO.class); |
|
|
|
ElephantInvoiceQueryResultDTO queryResultDTO = contentJson.toJavaObject(ElephantInvoiceQueryResultDTO.class); |
|
|
@ -1281,13 +1281,12 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
if (billInfo.getFpqqlsh() != null) { |
|
|
|
if (billInfo.getFpqqlsh() != null) { |
|
|
|
tempInvoice.setFpqqlsh(billInfo.getFpqqlsh()); |
|
|
|
tempInvoice.setFpqqlsh(billInfo.getFpqqlsh()); |
|
|
|
} |
|
|
|
} |
|
|
|
return new HXResponse(queryResultDTO.getZTXX(), tempInvoice); |
|
|
|
return new HXResponse("9999", queryResultDTO.getZTXX()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<DDFPZXX> ddfpzxxes = queryResultDTO.getDDFPZXX(); |
|
|
|
List<DDFPZXX> ddfpzxxes = queryResultDTO.getDDFPZXX(); |
|
|
|
if (ddfpzxxes.size() > 1) { |
|
|
|
if (ddfpzxxes.size() > 1) { |
|
|
|
HXResponse response = new HXResponse("9996", "一次只能查询一张发票"); |
|
|
|
return new HXResponse("9999", "一次只能查询一张发票"); |
|
|
|
return response; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
DDFPZXX ddfpzxx = ddfpzxxes.get(0); |
|
|
|
DDFPZXX ddfpzxx = ddfpzxxes.get(0); |
|
|
|
DDFPXX ddfpxx = ddfpzxx.getDDFPXX(); |
|
|
|
DDFPXX ddfpxx = ddfpzxx.getDDFPXX(); |
|
|
@ -1378,7 +1377,7 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
} catch (ParseException e) { |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
log.error("【销项发票】【大象接口】【订单查询】 发票格式化日期错误。请求报文{},大象返回报文{},原始报文{}", queryBody.toJSONString(), queryResult.toString(), JSONObject.toJSONString(billInfo)); |
|
|
|
log.error("【销项发票】【大象接口】【订单查询】 发票格式化日期错误。请求报文{},大象返回报文{},原始报文{}", queryBody.toJSONString(), queryResult.toString(), JSONObject.toJSONString(billInfo)); |
|
|
|
throw new JianshuiServiceException("日期处理错误,请联系管理员!"); |
|
|
|
return new HXResponse("9999", "日期处理错误,请联系管理员!"); |
|
|
|
} |
|
|
|
} |
|
|
|
invoice.setBuyerName(ddfpxx.getGMFMC()); // "购方名称"
|
|
|
|
invoice.setBuyerName(ddfpxx.getGMFMC()); // "购方名称"
|
|
|
|
invoice.setBuyerTaxnum(ddfpxx.getGMFSBH()); // "购方税号"
|
|
|
|
invoice.setBuyerTaxnum(ddfpxx.getGMFSBH()); // "购方税号"
|
|
|
|