Accept Merge Request #142: (feature/优化进度反馈 -> develop)

Merge Request: 京东物流对接sf端基本完成

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/142?initial=true
This commit is contained in:
马广威
2023-02-17 15:30:08 +08:00
9 changed files with 429 additions and 25 deletions

View File

@@ -34,6 +34,12 @@ class Sf_Bf_Connect(http.Controller):
logging.info('get_bfm_process_or===================================:%s' % order_id.name)
aa.default_code = kw['order_number']
logging.info('get_bfm_process_order_listaaaaaaaaaaaaaaaaaaaaaaaaaaaa================:%s' % aa.default_code)
# # 给stock.picking的default_code字段赋值
# bb = request.env['stock.picking'].sudo().search([('origin', '=', order_id.name)])
# logging.info('get_bfm_process_or===================================:%s' % order_id.name)
# bb.default_code = kw['order_number']
# logging.info('get_bfm_process_order_listbbbbbbbbbbbbbbbbbbbbbbbbbbbb================:%s' % bb.default_code)
for item in bfm_process_order_list:
product = request.env['product.template'].sudo().product_create(product_id, item, order_id,
kw['order_number'], i)
@@ -114,3 +120,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_order================:%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)