@@ -12,10 +12,10 @@ from pywe_storage import RedisStorage |
||
12 | 12 |
from TimeConvert import TimeConvert as tc |
13 | 13 |
|
14 | 14 |
from account.models import UserInfo |
15 |
+from integral.models import SaleclerkSubmitLogInfo |
|
15 | 16 |
from mch.models import (ActivityInfo, AdministratorInfo, BrandInfo, ConsumeInfoSubmitLogInfo, DistributorInfo, |
16 | 17 |
LatestAppInfo, LatestAppScreenInfo, ModelInfo, OperatorInfo) |
17 | 18 |
from statistic.models import ConsumeModelSaleStatisticInfo, ConsumeSaleStatisticInfo, ConsumeUserStatisticInfo |
18 |
-from integral.models import SaleclerkSubmitLogInfo |
|
19 | 19 |
from utils.error.errno_utils import (AdministratorStatusCode, OperatorStatusCode, ProductBrandStatusCode, |
20 | 20 |
ProductModelStatusCode, UserStatusCode) |
21 | 21 |
from utils.redis.connect import r |
@@ -392,7 +392,7 @@ def consumer_info_api(request): |
||
392 | 392 |
'ymd': ymd, |
393 | 393 |
}) |
394 | 394 |
|
395 |
- #更新销售员提交的表 |
|
395 |
+ # 更新销售员提交的表 |
|
396 | 396 |
logs = SaleclerkSubmitLogInfo.objects.filter(code=serialNo, model_pk=model.pk) |
397 | 397 |
for log in logs: |
398 | 398 |
log.has_scan = True |
@@ -226,7 +226,7 @@ urlpatterns += [ |
||
226 | 226 |
url(r'^clerk/sale/submit$', sale_views.clerk_sale_submit_api, name='clerk_sale_submit'), # 店员销售信息提交 |
227 | 227 |
url(r'^clerk/integral/list$', sale_views.clerk_integral_list_api, name='clerk_integral_list_api'), # 店员销售积分列表 |
228 | 228 |
url(r'^clerk/model/list$', sale_views.clerk_model_list_api, name='clerk_model_list_api'), |
229 |
- url(r'^clerk/checkout/serialNo$', sale_views.clerk_checkout_serialNo_api, name='clerk_checkout_serialNo_api'), #校验序列号 |
|
229 |
+ url(r'^clerk/checkout/serialNo$', sale_views.clerk_checkout_serialNo_api, name='clerk_checkout_serialNo_api'), # 校验序列号 |
|
230 | 230 |
] |
231 | 231 |
|
232 | 232 |
urlpatterns += [ |
@@ -15,7 +15,7 @@ class SaleclerkIntegralIncomeExpensesInfoAdmin(ReadOnlyModelAdmin, admin.ModelAd |
||
15 | 15 |
|
16 | 16 |
class SaleclerkSubmitLogInfoAdmin(AdvancedExportExcelModelAdmin, ReadOnlyModelAdmin, admin.ModelAdmin): |
17 | 17 |
list_display = ('brand_pk', 'brand_name', 'model_pk', 'model_name', 'distributor_pk', 'distributor_name', 'clerk_id', 'clerk_name', 'code', 'remark', 'dupload', 'test_user', 'test_sn', 'ym', 'ymd', 'status', 'has_scan', 'trackingNo', 'created_at', 'updated_at') |
18 |
- list_filter = ('brand_pk', 'dupload', 'test_user', 'test_sn','has_scan', 'status') |
|
18 |
+ list_filter = ('brand_pk', 'dupload', 'test_user', 'test_sn', 'has_scan', 'status') |
|
19 | 19 |
search_fields = ('code', 'remark') |
20 | 20 |
|
21 | 21 |
|
@@ -11,12 +11,12 @@ from TimeConvert import TimeConvert as tc |
||
11 | 11 |
|
12 | 12 |
from account.models import UserInfo |
13 | 13 |
from integral.models import SaleclerkIntegralIncomeExpensesInfo, SaleclerkSubmitLogInfo |
14 |
-from mch.models import BrandInfo, DistributorInfo, ModelInfo, SaleclerkInfo, ConsumeInfoSubmitLogInfo |
|
14 |
+from logs.models import MchInfoEncryptLogInfo |
|
15 |
+from mch.models import BrandInfo, ConsumeInfoSubmitLogInfo, DistributorInfo, ModelInfo, SaleclerkInfo |
|
15 | 16 |
from statistic.models import (DistributorSaleStatisticInfo, ModelSaleStatisticInfo, ProvinceSaleStatisticInfo, |
16 | 17 |
SaleclerkSaleStatisticInfo, SaleStatisticInfo) |
17 |
-from utils.error.errno_utils import (ProductBrandStatusCode, ProductDistributorStatusCode, ProductModelStatusCode, |
|
18 |
- SaleclerkStatusCode) |
|
19 |
-from logs.models import MchInfoEncryptLogInfo |
|
18 |
+from utils.error.errno_utils import (ProductBrandStatusCode, ProductDistributorStatusCode, ProductMachineStatusCode, |
|
19 |
+ ProductModelStatusCode, SaleclerkStatusCode) |
|
20 | 20 |
|
21 | 21 |
|
22 | 22 |
@logit |
@@ -91,11 +91,11 @@ def clerk_sale_submit_api(request): |
||
91 | 91 |
if trackingNo: |
92 | 92 |
is_exist = SaleclerkSubmitLogInfo.objects.filter(trackingNo=trackingNo, status=True).exists() |
93 | 93 |
if is_exist: |
94 |
- return response(SaleclerkStatusCode.DUPLICATE_TRACKING_NUMBER) |
|
94 |
+ return response(ProductMachineStatusCode.DUPLICATE_TRACKING_NUMBER) |
|
95 | 95 |
|
96 | 96 |
ymd = tc.local_string(format='%Y%m%d') |
97 | 97 |
|
98 |
- #是否被消费者扫过 |
|
98 |
+ # 是否被消费者扫过 |
|
99 | 99 |
has_scan = ConsumeInfoSubmitLogInfo.objects.filter( |
100 | 100 |
model_id=model.model_id, |
101 | 101 |
serialNo=serialNo).exists() |
@@ -408,6 +408,7 @@ def clerk_model_list_api(request): |
||
408 | 408 |
'models': models, |
409 | 409 |
}) |
410 | 410 |
|
411 |
+ |
|
411 | 412 |
@logit |
412 | 413 |
def clerk_checkout_serialNo_api(request): |
413 | 414 |
brandID = request.POST.get('brand_id', settings.KODO_DEFAULT_BRAND_PK) |
@@ -441,6 +442,6 @@ def clerk_checkout_serialNo_api(request): |
||
441 | 442 |
try: |
442 | 443 |
log = MchInfoEncryptLogInfo.objects.get(model_pk=model_pk, sn=serialNo) |
443 | 444 |
except MchInfoEncryptLogInfo.DoesNotExist: |
444 |
- return response(SaleclerkStatusCode.SERIALNO_NOT_FOUND) |
|
445 |
+ return response(ProductMachineStatusCode.SN_NOT_FOUND) |
|
445 | 446 |
|
446 | 447 |
return response(200, 'SerialNo Checkout Success', u'序列号校验成功') |
@@ -7,5 +7,5 @@ pywe-oauth==1.0.7 |
||
7 | 7 |
pywe-pay==1.0.12 |
8 | 8 |
pywe-pay-notify==1.0.4 |
9 | 9 |
pywe-response==1.0.1 |
10 |
-pywe-sign==1.0.8 |
|
10 |
+pywe-sign==1.1.0 |
|
11 | 11 |
pywe-xml==1.0.6 |
@@ -15,12 +15,6 @@ class SaleclerkStatusCode(BaseStatusCode): |
||
15 | 15 |
# 上传 |
16 | 16 |
DUPLICATE_SUBMIT = StatusCodeField(500199, 'Duplicate Submit', description=u'重复提交') |
17 | 17 |
|
18 |
- #序列号校验 |
|
19 |
- SERIALNO_NOT_FOUND = StatusCodeField(500200, 'SerialNo Not Found', description=u'序列号不存在') |
|
20 |
- |
|
21 |
- #快递单号校验 |
|
22 |
- DUPLICATE_TRACKING_NUMBER = StatusCodeField(500198, 'Duplicate Tracking Number', description=u'快递单号重复') |
|
23 |
- |
|
24 | 18 |
|
25 | 19 |
class SalesResponsibilityStatusCode(BaseStatusCode): |
26 | 20 |
""" 销售担当相关错误码 5002xx """ |
@@ -49,6 +43,9 @@ class ProductMachineStatusCode(BaseStatusCode): |
||
49 | 43 |
""" 机器相关错误码 5013xx """ |
50 | 44 |
SN_NOT_FOUND = StatusCodeField(501301, 'SN Not Found', description=u'序列号不存在') |
51 | 45 |
|
46 |
+ # 快递单号校验 |
|
47 |
+ DUPLICATE_TRACKING_NUMBER = StatusCodeField(501311, 'Duplicate Tracking Number', description=u'快递单号重复') |
|
48 |
+ |
|
52 | 49 |
|
53 | 50 |
class ProductCouponStatusCode(BaseStatusCode): |
54 | 51 |
""" 优惠券相关错误码 5014xx """ |