|
@@ -14,6 +14,7 @@ from utils import response_ok
|
|
from apps.account import tenant_log
|
|
from apps.account import tenant_log
|
|
from apps.foundation.models import BizLog, Config
|
|
from apps.foundation.models import BizLog, Config
|
|
from rest_framework.exceptions import NotFound
|
|
from rest_framework.exceptions import NotFound
|
|
|
|
+from utils.format import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -44,7 +45,7 @@ class XGJ():
|
|
'model': instance.model.series.brand.name + '-' + instance.model.series.name + '-' + instance.model.name,
|
|
'model': instance.model.series.brand.name + '-' + instance.model.series.name + '-' + instance.model.name,
|
|
'guide_price': Formater.formatPriceShow(instance.model.price),
|
|
'guide_price': Formater.formatPriceShow(instance.model.price),
|
|
'shop_price': Formater.formatPriceShow(instance.model.sale_price),
|
|
'shop_price': Formater.formatPriceShow(instance.model.sale_price),
|
|
- 'notes': instance.notes
|
|
|
|
|
|
+ 'notes': instance.notes or u'小程序咨询'
|
|
}
|
|
}
|
|
result = requests.post(url=url, data=json.dumps(param))
|
|
result = requests.post(url=url, data=json.dumps(param))
|
|
result = result.json()
|
|
result = result.json()
|
|
@@ -73,8 +74,8 @@ class XGJ():
|
|
'tel': instance.tel,
|
|
'tel': instance.tel,
|
|
'name': instance.name,
|
|
'name': instance.name,
|
|
'model': instance.model.series.brand.name + '-' + instance.model.series.name + '-' + instance.model.name,
|
|
'model': instance.model.series.brand.name + '-' + instance.model.series.name + '-' + instance.model.name,
|
|
- 'date': instance.date,
|
|
|
|
- 'notes': instance.notes
|
|
|
|
|
|
+ 'date': strfdate(instance.date),
|
|
|
|
+ 'notes': instance.notes or u'小程序预约'
|
|
}
|
|
}
|
|
result = requests.post(url=url, data=json.dumps(param))
|
|
result = requests.post(url=url, data=json.dumps(param))
|
|
result = result.json()
|
|
result = result.json()
|
|
@@ -89,7 +90,6 @@ class XGJ():
|
|
else:
|
|
else:
|
|
tenant_log(instance.customer.user, BizLog.INSERT, u'试驾预约同步销管佳失败,没有设置销管佳地址或密钥,id=%d' % (instance.id))
|
|
tenant_log(instance.customer.user, BizLog.INSERT, u'试驾预约同步销管佳失败,没有设置销管佳地址或密钥,id=%d' % (instance.id))
|
|
|
|
|
|
-
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
def vehicle_estimate(instance): #置换咨询
|
|
def vehicle_estimate(instance): #置换咨询
|
|
xgj_ip = Config.getConfigValue(Config.KEY_XGJ_IP)
|
|
xgj_ip = Config.getConfigValue(Config.KEY_XGJ_IP)
|
|
@@ -103,10 +103,10 @@ class XGJ():
|
|
'company': instance.shop.xgj_id,
|
|
'company': instance.shop.xgj_id,
|
|
'tel': instance.customer.tel,
|
|
'tel': instance.customer.tel,
|
|
'name': instance.customer.name,
|
|
'name': instance.customer.name,
|
|
- 'model': instance.name + '-' + instance.model,
|
|
|
|
- 'plate_date': instance.plate_date,
|
|
|
|
|
|
+ 'model': instance.brand.name + '-' + instance.model,
|
|
|
|
+ 'plate_date': strfdate(instance.plate_date),
|
|
'mileage': instance.mileage,
|
|
'mileage': instance.mileage,
|
|
- 'notes': instance.notes
|
|
|
|
|
|
+ 'notes': instance.notes or u'小程序咨询'
|
|
}
|
|
}
|
|
result = requests.post(url=url, data=json.dumps(param))
|
|
result = requests.post(url=url, data=json.dumps(param))
|
|
result = result.json()
|
|
result = result.json()
|
|
@@ -137,7 +137,7 @@ class XGJ():
|
|
'model': instance.vehicle.name,
|
|
'model': instance.vehicle.name,
|
|
'number': instance.vehicle.number,
|
|
'number': instance.vehicle.number,
|
|
'vin': instance.vehicle.vin,
|
|
'vin': instance.vehicle.vin,
|
|
- 'date': instance.date,
|
|
|
|
|
|
+ 'date': strfdate(instance.date),
|
|
'notes': instance.notes
|
|
'notes': instance.notes
|
|
}
|
|
}
|
|
result = requests.post(url=url, data=json.dumps(param))
|
|
result = requests.post(url=url, data=json.dumps(param))
|