Commit 6b74c969 authored by hanfeng's avatar hanfeng

开票

parent deaec583
......@@ -64,7 +64,7 @@ public class InvoiceController extends BaseController<InvoiceBiz, Invoice> {
try {
String invoicing = baseBiz.Invoicing(invoiceVo);
return ObjectRestResponse.succ(invoicing);
} catch (JSONException e) {
} catch (BaseException e) {
log.error("开票错误信息={}", e);
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, e.getMessage());
} catch (Exception e) {
......
......@@ -178,15 +178,16 @@ public class InvoiceDaoImpl implements InvoiceDao {
//调用第三方接口
String result = sdk.sendPostSyncRequest(invoiceUrl, senid, appKey2, appSecret2, token, taxnum2, method, jsonString);
//把字符串json数据转换为map
JSONObject jsonObject = JSON.parseObject(result);
try {
JSONObject jsonObject = JSON.parseObject(result);
Map<String, String> data = (Map<String, String>) jsonObject.get("result");
String invoiceSerialNum = data.get("invoiceSerialNum");
return invoiceSerialNum;
} catch (JSONException e) {
} catch (Exception e) {
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