增加bfm回调接口

This commit is contained in:
mgw
2023-02-13 21:51:06 +08:00
parent c07803d3cf
commit c1c39396f9
3 changed files with 61 additions and 28 deletions

View File

@@ -119,3 +119,30 @@ class Sf_Bf_Connect(http.Controller):
res['status'] = -1
res['message'] = '工厂创建销售订单和产品失败,请联系管理员'
return json.JSONEncoder().encode(res)
class jdElcp(http.Controller):
@http.route('/api/jd_create/order', type='http', auth='none', methods=['GET', 'POST'], csrf=False,
cors="*")
def get_jd_order(self, **kw):
"""
回调函数:拿到京东返回的下单数据
"""
logging.info('get_jd_bill================:%s', kw)
aa = request.env['stock.picking'].sudo().search([('origin', '=', kw['orderNo'])])
aa.carrier_tracking_ref = kw['wbNo']
logging.info('get_jd_order================:%s' %
aa.carrier_tracking_ref)
@http.route('/api/jd_create/bill', type='http', auth='none', methods=['GET', 'POST'], csrf=False,
cors="*")
def get_jd_bill(self, **kw):
"""
回调函数:拿到京东返回的快递面单
"""
logging.info('get_jd_bill================:%s', kw)
aa = request.env['stock.picking'].sudo().search([('origin', '=', kw['orderNo'])])
aa.bill_url = kw['bill']
logging.info('get_jd_bill================:%s' %
aa.bill_url)