From a79537e02cb735ea2b62b38e1c6332c08a2e0a01 Mon Sep 17 00:00:00 2001 From: P3ngSaM <61768364+P3ngSaM@users.noreply.github.com> Date: Wed, 23 Mar 2022 14:07:36 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E4=BF=A1=E6=81=AF/ESG=E8=AF=84=E4=BB=B7=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=B7=BB=E5=8A=A0=E8=AF=84=E4=BB=B7=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Esg/EsgModel.py | 4 +++- Esg/db.py | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Esg/EsgModel.py b/Esg/EsgModel.py index 77b3a5e..154b9d4 100644 --- a/Esg/EsgModel.py +++ b/Esg/EsgModel.py @@ -1,4 +1,5 @@ import copy +import datetime from Esg.db import update_data from Esg.scripts.environmental import environmental_rating @@ -79,6 +80,7 @@ class EsgModel: result['社会得分'] = score['社会得分'] result['公司治理得分'] = score['公司治理得分'] result['ESG得分'] = score['合计'] + result['评价时间'] = datetime.datetime.now().strftime('%Y-%m-%d') return result @@ -87,7 +89,7 @@ class EsgModel: 保存评价结果 """ rating_result = self.rating_result - update_data('评价', 'ESG评价结果', {"企业ID": self.cid, "评价年度": self.period}, rating_result) + update_data('ESG评价数据', '评价结果', {"企业ID": self.cid, "评价年度": self.period}, rating_result) @staticmethod def score_rank(param): diff --git a/Esg/db.py b/Esg/db.py index 0dbbb4a..4650821 100644 --- a/Esg/db.py +++ b/Esg/db.py @@ -4,11 +4,10 @@ Mongo_tfse import pymongo -DB_HOST = '116.63.130.34' -DB_USER = 'root' -DB_PASS = 'sromitdTW569kC#M' -DB_PORT = 27018 - +DB_HOST = "116.63.130.34" +DB_PASS = "UTlC9cCoglD1cI1*" +DB_USER = "root" +DB_PORT = "27021" client = pymongo.MongoClient('mongodb://{}:{}@{}:{}'.format(DB_USER, DB_PASS, DB_HOST, DB_PORT))