feat: H5链接配对群ID与客服订单详情扩展(指定响应/罚款)
This commit is contained in:
@@ -30,7 +30,7 @@ from utils.weixin_token import get_weixin_mini_access_token, is_weixin_token_inv
|
||||
# from utils.ip_security import *
|
||||
from utils.invitationcode_utils import CreateInvitationCode, VerifyInvitationCode
|
||||
|
||||
from backend.utils import update_shangjia_daily
|
||||
from utils.chat_utils import subscribe_merchant_link_chat
|
||||
|
||||
from .models import (
|
||||
Gonggao, Lunbo, Tupianpeizhi, Qunpeizhi,
|
||||
@@ -2258,31 +2258,17 @@ class KehuGetDingdanLianjieView(APIView):
|
||||
'waibu_dingdan_id': dingdan_obj.ExternalOrderID or '',
|
||||
})
|
||||
|
||||
# 获取聊天相关标识
|
||||
# 9.1 获取接单打手ID
|
||||
jiedan_dashou_id = dingdan_obj.PlayerID
|
||||
dashou_biaoshi = f'Ds{jiedan_dashou_id}' if jiedan_dashou_id else ''
|
||||
|
||||
# 9.2 获取商家标识
|
||||
shangjia_biaoshi = ''
|
||||
try:
|
||||
shangjia_kuozhan = MerchantOrderExt.query.select_related('Order').filter(
|
||||
Order__OrderID=lianjie_obj.OrderID
|
||||
).first()
|
||||
|
||||
if shangjia_kuozhan and shangjia_kuozhan.MerchantID:
|
||||
shangjia_biaoshi = f'Sj{shangjia_kuozhan.MerchantID}'
|
||||
logger.info(f"生成商家标识: {shangjia_biaoshi}")
|
||||
else:
|
||||
logger.info(f"订单 {lianjie_obj.OrderID} 没有商家订单扩展信息")
|
||||
except Exception as e:
|
||||
logger.error(f"查询商家订单扩展异常: {str(e)}", exc_info=True)
|
||||
# 获取聊天相关标识(新配对群优先,旧单保留 order 群)
|
||||
chat_meta, _sub_ok = subscribe_merchant_link_chat(dingdan_obj, lianjie_obj.UserID)
|
||||
|
||||
# 添加聊天标识
|
||||
dingdan_info.update({
|
||||
'dashou_biaoshi': dashou_biaoshi,
|
||||
'shangjia_biaoshi': shangjia_biaoshi,
|
||||
'you_dashou': bool(dashou_biaoshi),
|
||||
'dashou_biaoshi': chat_meta.get('dashou_biaoshi', ''),
|
||||
'shangjia_biaoshi': chat_meta.get('shangjia_biaoshi', ''),
|
||||
'you_dashou': chat_meta.get('you_dashou', False),
|
||||
'group_id': chat_meta.get('group_id', ''),
|
||||
'is_pair_group': chat_meta.get('is_pair_group', False),
|
||||
'legacy_group_id': chat_meta.get('legacy_group_id', ''),
|
||||
})
|
||||
|
||||
response_data.update(dingdan_info)
|
||||
|
||||
Reference in New Issue
Block a user