|
|
|
@ -1213,12 +1213,14 @@ public class ElephantInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} else if (StringUtils.isNotEmpty(fpdm) && StringUtils.isNotEmpty(fphm)) { |
|
|
|
|
invoice = invoiceMapper.selectByFpdmFphm(companyservice.getCompanyid(), fpdm, fphm); |
|
|
|
|
} else { |
|
|
|
|
throw new JianshuiParamErrorException(ErrorCode.EMPTY_FPQQLSH, companyservice, "invoice"); |
|
|
|
|
// throw new JianshuiParamErrorException(ErrorCode.EMPTY_FPQQLSH, companyservice, "invoice");
|
|
|
|
|
return new HXResponse(ErrorCode.EMPTY_FPQQLSH.getCode(),ErrorCode.EMPTY_FPQQLSH.getMsg(), null, false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//发票不存在
|
|
|
|
|
if (invoice == null) { |
|
|
|
|
throw new JianshuiParamErrorException(ErrorCode.INVOICE_NOT_EXISTS, companyservice, "invoice"); |
|
|
|
|
// throw new JianshuiParamErrorException(ErrorCode.INVOICE_NOT_EXISTS, companyservice, "invoice");
|
|
|
|
|
return new HXResponse(ErrorCode.INVOICE_NOT_EXISTS.getCode(),ErrorCode.INVOICE_NOT_EXISTS.getMsg(), null, false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TODO 发票状态查询
|
|
|
|
@ -1240,20 +1242,23 @@ public class ElephantInvoiceApiServiceImpl implements IInvoiceApiService { |
|
|
|
|
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { |
|
|
|
|
log.error("【销项发票】【大象接口】【发票作废】发票请求异常,请求报文{},销方信息{}", JSONUtil.parse(queryBody).toString(), JSONObject.toJSONString(companyservice)); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
throw new JianshuiServiceException("系统异常!"); |
|
|
|
|
// throw new JianshuiServiceException("系统异常!");
|
|
|
|
|
return new HXResponse("9999","系统异常!", null, false); |
|
|
|
|
} |
|
|
|
|
log.info("【销项发票】【大象发票】发票作废请求结果{}", queryResult.toString()); |
|
|
|
|
|
|
|
|
|
// 判断外层报文是否成功
|
|
|
|
|
if (queryResult.isError()) { |
|
|
|
|
throw new JianshuiServiceException(queryResult.getMsg()); |
|
|
|
|
// throw new JianshuiServiceException(queryResult.getMsg());
|
|
|
|
|
return new HXResponse("9999",queryResult.getMsg(), null, false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 处理返回报文
|
|
|
|
|
JSONObject content = queryResult.getJsonData(); |
|
|
|
|
String ztdm = content.getString("ZTDM"); |
|
|
|
|
if (!StringUtils.equalsAny(ztdm, "040000")) { |
|
|
|
|
return new HXResponse(content.getString("ZTXX")); |
|
|
|
|
// return new HXResponse(content.getString("ZTXX"));
|
|
|
|
|
return new HXResponse("9999",content.getString("ZTXX"), null, false); |
|
|
|
|
} |
|
|
|
|
// TODO 发票作废通过接口查询
|
|
|
|
|
// // 获取作废状态
|
|
|
|
|