|
12
|
+
|
|
|
13
|
+
|
|
|
14
|
+logger = logging.getLogger('console')
|
|
|
15
|
+
|
|
|
16
|
+
|
|
|
17
|
+class Command(CompatibilityBaseCommand):
|
|
|
18
|
+ def handle(self, *args, **options):
|
|
|
19
|
+
|
|
|
20
|
+ logger.info('Gis is dealing')
|
|
|
21
|
+
|
|
|
22
|
+ while True:
|
|
|
23
|
+ # r.rpushjson('TEMPLET_CMD_KEY', {
|
|
|
24
|
+ # 'lat': .0,
|
|
|
25
|
+ # 'lon': .0,
|
|
|
26
|
+ # 'ymd': 0,
|
|
|
27
|
+ # 'ym': 0,
|
|
|
28
|
+ # })
|
|
|
29
|
+ k, v = r.blpopjson(MINI_PROGRAM_GIS_LIST, 60)
|
|
|
30
|
+ if v:
|
|
|
31
|
+
|
|
|
32
|
+ close_old_connections()
|
|
|
33
|
+
|
|
|
34
|
+ logger.info(v)
|
|
|
35
|
+
|
|
|
36
|
+ with transaction.atomic():
|
|
|
37
|
+ try:
|
|
|
38
|
+ gisinfo = requests.get(settings.GIS_2_ADMINISTRATIVE_DIVISION.format(v.get('lat', 0), v.get('lon', 0))).json()
|
|
|
39
|
+ except Exception as e:
|
|
|
40
|
+ logger.info(e.message)
|
|
|
41
|
+ if gisinfo.get('error') != 0:
|
|
|
42
|
+ continue
|
|
|
43
|
+ ymd = v.get('ymd', 0)
|
|
|
44
|
+ ym = v.get('ym', 0)
|
|
|
45
|
+ zh1 = gisinfo.get('data', {}).get('zh1', '')
|
|
|
46
|
+
|
|
|
47
|
+ close_old_connections()
|
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+from __future__ import unicode_literals
|
|
|
2
|
+
|
|
|
3
|
+from django.db import models
|
|
|
4
|
+
|
|
|
5
|
+
|
|
|
6
|
+# Create your models here.
|
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+from django.test import TestCase
|
|
|
2
|
+
|
|
|
3
|
+
|
|
|
4
|
+# Create your tests here.
|
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+from django.shortcuts import render
|
|
|
2
|
+
|
|
|
3
|
+
|
|
|
4
|
+# Create your views here.
|
|
|
|
@@ -52,6 +52,7 @@ INSTALLED_APPS = (
|
|
52
|
52
|
'api',
|
|
53
|
53
|
'account',
|
|
54
|
54
|
'box',
|
|
|
55
|
+ 'commands',
|
|
55
|
56
|
'group',
|
|
56
|
57
|
'integral',
|
|
57
|
58
|
'logs',
|
|
|
|
@@ -390,6 +391,9 @@ KODO_DEFAULT_BRAND_DOMAIN = ''
|
|
390
|
391
|
|
|
391
|
392
|
KODO_CLERK_AUTH_URL = 'http://pai.ai/w/o?r=http%3A%2F%2Fkodo.xfoto.com.cn%2Fp%2Fclerk%3Fbrand_id%3D{0}'
|
|
392
|
393
|
|
|
|
394
|
+# 经纬度
|
|
|
395
|
+GIS_2_ADMINISTRATIVE_DIVISION = 'http://116.196.105.215:1234/gis?auth_user=freevip&latitude={0}&longitude={1}'
|
|
|
396
|
+
|
|
393
|
397
|
try:
|
|
394
|
398
|
from local_settings import *
|
|
395
|
399
|
except ImportError:
|
|
|
|
@@ -4,7 +4,7 @@ Pillow==5.0.0
|
|
4
|
4
|
StatusCode==1.0.0
|
|
5
|
5
|
TimeConvert==1.4.3
|
|
6
|
6
|
cryptography==1.5.2
|
|
7
|
|
-furl==1.2.1
|
|
|
7
|
+furl==2.0.0
|
|
8
|
8
|
isoweek==1.3.3
|
|
9
|
9
|
jsonfield==2.0.2
|
|
10
|
10
|
mock==2.0.0
|
|
|
|
@@ -66,3 +66,6 @@ APP_PATCH_INFO = 'app:patch:info:%s:%s:%s' # STRING,APP 补丁信息,platfo
|
|
66
|
66
|
|
|
67
|
67
|
# BOX 相关
|
|
68
|
68
|
BOX_PROGRAM_VERSION_INFO = 'box:program:version:info' # STRING,BOX 程序版本信息
|
|
|
69
|
+
|
|
|
70
|
+# 小程序相关
|
|
|
71
|
+MINI_PROGRAM_GIS_LIST = 'tamron:miniprogram:gis:list'
|