#更换服务器

This commit is contained in:
xieshen 2020-12-10 15:13:35 +08:00
parent 65f97c3531
commit 86bda4e945
3 changed files with 15 additions and 17 deletions

View File

@ -63,7 +63,7 @@
<div class="col-xs-4 col-md-4 col-lg-4" style="text-align: center"> <div class="col-xs-4 col-md-4 col-lg-4" style="text-align: center">
<div style="display: inline-block"> <div style="display: inline-block">
<p class="model1-p" style="margin-top: 40px;font-weight: 1000">预警次数</p> <p class="model1-p" style="margin-top: 40px;font-weight: 1000">预警次数</p>
<p class="model1-p" style="color: #00a8e6;font-size: 25px;font-weight: 1000">{{ news_count }}</p> <p class="model1-p" style="color: #00a8e6;font-size: 25px;font-weight: 1000">362</p>
</div> </div>
</div> </div>
</div> </div>

View File

@ -25,7 +25,7 @@ def get_csv_weixin(path):
with open("D:/2020/新媒体监测/新媒体对比结果_微信_账号名称更改.csv", "w", newline='',encoding='utf-8') as csvfile: with open("D:/2020/新媒体监测/新媒体对比结果_微信_账号名称更改.csv", "w", newline='',encoding='utf-8') as csvfile:
writer = csv.writer(csvfile) writer = csv.writer(csvfile)
writer.writerow( writer.writerow(
["序号", "冲突账号"]) ["账号", "备注"])
weixin_code_list = [] weixin_code_list = []
csv_code_list = [] csv_code_list = []
with open(path, encoding='utf-8') as csvfile: with open(path, encoding='utf-8') as csvfile:
@ -33,7 +33,7 @@ def get_csv_weixin(path):
for r in reader: for r in reader:
if r[1] != '单位全称': if r[1] != '单位全称':
if '微信' in r[7]: if '微信' in r[7]:
print(r) # print(r)
csv_code_list.append(r[4]) csv_code_list.append(r[4])
with psycopg2.connect(G2) as connection: with psycopg2.connect(G2) as connection:
with connection.cursor() as cursor: with connection.cursor() as cursor:
@ -46,19 +46,17 @@ def get_csv_weixin(path):
except Exception as e: except Exception as e:
print(e) print(e)
print(len(weixin_code_list),len(csv_code_list)) print(len(weixin_code_list),len(csv_code_list))
if len(weixin_code_list) <= len(csv_code_list):
for c in csv_code_list: print( len(list(set( weixin_code_list ) ^ set( csv_code_list ))))
if c in weixin_code_list: for i in list(set( weixin_code_list ) ^ set( csv_code_list )):
print(c) if i in weixin_code_list and i not in csv_code_list:
else: writer.writerow(
writer.writerow( [i,'删除'])
[r[0], r[4],c,'c']) elif i in csv_code_list and i not in weixin_code_list:
else: writer.writerow(
for w in weixin_code_list: [i, '新增'])
if w in csv_code_list: else:
print(w) writer.writerow(
else: [i, '异常'])
writer.writerow(
[w,'w'])
if __name__ == '__main__': if __name__ == '__main__':
get_csv_weixin('D:/2020/新媒体监测/TASK_ALL.csv') get_csv_weixin('D:/2020/新媒体监测/TASK_ALL.csv')