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))