Commit 6b74c969 authored by hanfeng's avatar hanfeng

开票

parent deaec583
...@@ -64,7 +64,7 @@ public class InvoiceController extends BaseController<InvoiceBiz, Invoice> { ...@@ -64,7 +64,7 @@ public class InvoiceController extends BaseController<InvoiceBiz, Invoice> {
try { try {
String invoicing = baseBiz.Invoicing(invoiceVo); String invoicing = baseBiz.Invoicing(invoiceVo);
return ObjectRestResponse.succ(invoicing); return ObjectRestResponse.succ(invoicing);
} catch (JSONException e) { } catch (BaseException e) {
log.error("开票错误信息={}", e); log.error("开票错误信息={}", e);
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, e.getMessage()); return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, e.getMessage());
} catch (Exception e) { } catch (Exception e) {
......
...@@ -178,15 +178,16 @@ public class InvoiceDaoImpl implements InvoiceDao { ...@@ -178,15 +178,16 @@ public class InvoiceDaoImpl implements InvoiceDao {
//调用第三方接口 //调用第三方接口
String result = sdk.sendPostSyncRequest(invoiceUrl, senid, appKey2, appSecret2, token, taxnum2, method, jsonString); String result = sdk.sendPostSyncRequest(invoiceUrl, senid, appKey2, appSecret2, token, taxnum2, method, jsonString);
//把字符串json数据转换为map //把字符串json数据转换为map
JSONObject jsonObject = JSON.parseObject(result);
try { try {
JSONObject jsonObject = JSON.parseObject(result);
Map<String, String> data = (Map<String, String>) jsonObject.get("result"); Map<String, String> data = (Map<String, String>) jsonObject.get("result");
String invoiceSerialNum = data.get("invoiceSerialNum"); String invoiceSerialNum = data.get("invoiceSerialNum");
return invoiceSerialNum; return invoiceSerialNum;
} catch (JSONException e) { } catch (Exception e) {
log.error("失败原因={}", result); log.error("失败原因={}", result);
throw new JSONException(result); throw new BaseException(result);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment