mns-scheduler 1.1.5.5__py3-none-any.whl → 1.1.5.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mns-scheduler might be problematic. Click here for more details.
- mns_scheduler/company_info/base/sync_company_base_info_api.py +6 -1
- mns_scheduler/finance/sync_financial_report_service_api.py +41 -3
- mns_scheduler/zt/zt_pool/ths_zt_pool_sync_api.py +2 -0
- {mns_scheduler-1.1.5.5.dist-info → mns_scheduler-1.1.5.6.dist-info}/METADATA +1 -1
- {mns_scheduler-1.1.5.5.dist-info → mns_scheduler-1.1.5.6.dist-info}/RECORD +7 -7
- {mns_scheduler-1.1.5.5.dist-info → mns_scheduler-1.1.5.6.dist-info}/WHEEL +0 -0
- {mns_scheduler-1.1.5.5.dist-info → mns_scheduler-1.1.5.6.dist-info}/top_level.txt +0 -0
|
@@ -401,7 +401,12 @@ def get_recent_year_income(symbol, company_info_type, exist_company_df):
|
|
|
401
401
|
em_stock_profit = mongodb_util.descend_query(query, db_name_constant.EM_STOCK_PROFIT, 'REPORT_DATE', 1)
|
|
402
402
|
if data_frame_util.is_not_empty(em_stock_profit):
|
|
403
403
|
company_info_type['operate_profit'] = list(em_stock_profit['OPERATE_PROFIT'])[0]
|
|
404
|
-
|
|
404
|
+
total_operate_income = list(em_stock_profit['TOTAL_OPERATE_INCOME'])[0]
|
|
405
|
+
# 金融机构大多收入计入在这个字段中
|
|
406
|
+
if total_operate_income == 0:
|
|
407
|
+
total_operate_income = list(em_stock_profit['OPERATE_INCOME'])[0]
|
|
408
|
+
|
|
409
|
+
company_info_type['total_operate_income'] = total_operate_income
|
|
405
410
|
else:
|
|
406
411
|
company_info_type['operate_profit'] = 0
|
|
407
412
|
company_info_type['total_operate_income'] = 0
|
|
@@ -17,6 +17,7 @@ import mns_scheduler.risk.financial_report_risk_check_api as financial_report_ri
|
|
|
17
17
|
import mns_common.utils.data_frame_util as data_frame_util
|
|
18
18
|
import mns_scheduler.finance.finance_common_api as finance_common_api
|
|
19
19
|
import mns_scheduler.risk.compliance.undisclosed_annual_report_api as undisclosed_annual_report_api
|
|
20
|
+
|
|
20
21
|
mongodb_util = MongodbUtil('27017')
|
|
21
22
|
|
|
22
23
|
|
|
@@ -58,6 +59,10 @@ def sync_financial_report():
|
|
|
58
59
|
period_time = str(now_year) + "-09-30 00:00:00"
|
|
59
60
|
sync_profit_report(period_time, sync_time, period)
|
|
60
61
|
sync_asset_liability_report(period_time, sync_time, period)
|
|
62
|
+
else:
|
|
63
|
+
|
|
64
|
+
sync_miss_report(sync_time)
|
|
65
|
+
|
|
61
66
|
# 未出报告check
|
|
62
67
|
undisclosed_annual_report_api.un_disclosed_report_check(sync_time, now_year, period, period_time)
|
|
63
68
|
|
|
@@ -82,7 +87,7 @@ def sync_asset_liability_report(period_time, sync_time, period):
|
|
|
82
87
|
|
|
83
88
|
# 年报审核
|
|
84
89
|
financial_report_risk_check_api.financial_report_check(new_asset_df, period_time, period,
|
|
85
|
-
|
|
90
|
+
db_name_constant.EM_STOCK_ASSET_LIABILITY)
|
|
86
91
|
|
|
87
92
|
except Exception as e:
|
|
88
93
|
logger.error("同步资产表异常:{},{},{}", symbol, period_time, e)
|
|
@@ -104,10 +109,43 @@ def sync_profit_report(period_time, sync_time, period):
|
|
|
104
109
|
|
|
105
110
|
# 年报审核
|
|
106
111
|
financial_report_risk_check_api.financial_report_check(new_profit_df, period_time,
|
|
107
|
-
|
|
112
|
+
period, db_name_constant.EM_STOCK_PROFIT)
|
|
108
113
|
except Exception as e:
|
|
109
114
|
logger.error("同步利润表异常:{},{},{}", symbol, period_time, e)
|
|
110
115
|
|
|
111
116
|
|
|
117
|
+
def sync_miss_report(sync_time):
|
|
118
|
+
query = {"total_operate_income": 0}
|
|
119
|
+
un_report_company_info = mongodb_util.find_query_data(db_name_constant.COMPANY_INFO, query)
|
|
120
|
+
for un_report_one in un_report_company_info.itertuples():
|
|
121
|
+
try:
|
|
122
|
+
symbol = un_report_one.symbol
|
|
123
|
+
new_profit_df = em_financial_profit_sync_service_api.get_em_profit_api(symbol)
|
|
124
|
+
if data_frame_util.is_empty(new_profit_df):
|
|
125
|
+
continue
|
|
126
|
+
new_profit_df['sync_time'] = sync_time
|
|
127
|
+
|
|
128
|
+
new_profit_df['symbol'] = symbol
|
|
129
|
+
mongodb_util.insert_mongo(new_profit_df, db_name_constant.EM_STOCK_PROFIT)
|
|
130
|
+
|
|
131
|
+
new_asset_df = em_financial_asset_liability_sync_service_api.get_em_asset_liability_api(symbol)
|
|
132
|
+
# 负债比
|
|
133
|
+
new_asset_df['liability_ratio'] = round(
|
|
134
|
+
new_asset_df['TOTAL_LIABILITIES'] * 100 / new_asset_df['TOTAL_ASSETS'],
|
|
135
|
+
2)
|
|
136
|
+
new_asset_df['sync_time'] = sync_time
|
|
137
|
+
if data_frame_util.is_empty(new_asset_df):
|
|
138
|
+
continue
|
|
139
|
+
new_asset_df['symbol'] = symbol
|
|
140
|
+
mongodb_util.insert_mongo(new_asset_df, db_name_constant.EM_STOCK_ASSET_LIABILITY)
|
|
141
|
+
|
|
142
|
+
except Exception as e:
|
|
143
|
+
logger.error("同步财报补偿任务异常:{},{},{}", symbol, e)
|
|
144
|
+
|
|
145
|
+
|
|
112
146
|
if __name__ == '__main__':
|
|
113
|
-
|
|
147
|
+
now_date = datetime.now()
|
|
148
|
+
now_year = now_date.year
|
|
149
|
+
now_month = now_date.month
|
|
150
|
+
sync_time_test = now_date.strftime('%Y-%m-%d %H:%M:%S')
|
|
151
|
+
sync_miss_report(sync_time_test)
|
|
@@ -230,6 +230,8 @@ if __name__ == '__main__':
|
|
|
230
230
|
# trade_date = '2024-08-01'
|
|
231
231
|
# zt_df = ths_zt_pool(trade_date, None)
|
|
232
232
|
# save_ths_zt_pool(zt_df, trade_date)
|
|
233
|
+
trade_date = '2024-09-30'
|
|
234
|
+
zt_df = ths_zt_pool(trade_date, None)
|
|
233
235
|
|
|
234
236
|
query = {"$and": [{'_id': {"$gte": '2013-07-04'}}, {'_id': {"$lte": '2015-04-30'}}]}
|
|
235
237
|
# query = {"$and": [{'_id': {"$gte": '2024-07-24'}}, {'_id': {"$lte": '2024-08-01'}}]}
|
|
@@ -5,7 +5,7 @@ mns_scheduler/big_deal/__init__.py,sha256=QWBdZwBCvQw8aS4hnL9_pg3U3ZiNLUXzlImyy9
|
|
|
5
5
|
mns_scheduler/big_deal/ths_big_deal_sync.py,sha256=aMFj-_pLprh4vGjSSzmr_tlYoPA0L4Lm0SkLRkQwIiw,4564
|
|
6
6
|
mns_scheduler/company_info/__init__.py,sha256=QWBdZwBCvQw8aS4hnL9_pg3U3ZiNLUXzlImyy9WhUcI,163
|
|
7
7
|
mns_scheduler/company_info/base/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
|
|
8
|
-
mns_scheduler/company_info/base/sync_company_base_info_api.py,sha256=
|
|
8
|
+
mns_scheduler/company_info/base/sync_company_base_info_api.py,sha256=AAylhSj6Ca8s0NoeWdCEdB4Uva3VDeAlvz-4rwAzrEw,19627
|
|
9
9
|
mns_scheduler/company_info/clean/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
|
|
10
10
|
mns_scheduler/company_info/clean/company_info_clean_api.py,sha256=n3kxsqihPjKJvGDkAjMYqB_U2EPemOi1Yjez5yOYJeo,4858
|
|
11
11
|
mns_scheduler/company_info/constant/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
|
|
@@ -43,7 +43,7 @@ mns_scheduler/finance/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1t
|
|
|
43
43
|
mns_scheduler/finance/em_financial_asset_liability_sync_service_api.py,sha256=kEZQZkxB7RF7UPH4DmHoRWfEKgI61ZN8BcNOzmBUoV0,19417
|
|
44
44
|
mns_scheduler/finance/em_financial_profit_sync_service_api.py,sha256=A_ONxC-1giGUWUhMJG1fE6jem52uJYtzlewzxPZtdd0,14270
|
|
45
45
|
mns_scheduler/finance/finance_common_api.py,sha256=_cjNHntTgXVbsfDT5F5KtCV_QNq2gbclgZ8UxrgGP64,2471
|
|
46
|
-
mns_scheduler/finance/sync_financial_report_service_api.py,sha256=
|
|
46
|
+
mns_scheduler/finance/sync_financial_report_service_api.py,sha256=45udF-6soKULbIxTrJWDXkWkg55F5ajJX0G2mH6Fv38,6625
|
|
47
47
|
mns_scheduler/hk/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
|
|
48
48
|
mns_scheduler/hk/hk_company_info_sync_service_api.py,sha256=WdzrWH0cjTfEHMBzT0__nlmMjy7Vqbr1-X9lemv3OM8,2323
|
|
49
49
|
mns_scheduler/hk/hk_industry_info_sync_service_api.py,sha256=RUcmguyIMgh9xI09XyM7_So2E1_r1F36EEU-V-EYVio,2409
|
|
@@ -127,10 +127,10 @@ mns_scheduler/zt/script/sync_high_chg_pool_his_data.py,sha256=dtREQdNpoDM4KLTvdX
|
|
|
127
127
|
mns_scheduler/zt/script/sync_now_higt_chg_zt.py,sha256=bhoIGDWTI3w0YKVfIAVNHWpUrYqJYDMGPt-1i3d_Zmw,1850
|
|
128
128
|
mns_scheduler/zt/zt_pool/__init__.py,sha256=Tyvi_iQlv3jz59EdH67Mycnt9CSixcWPQoJwu55bOq0,165
|
|
129
129
|
mns_scheduler/zt/zt_pool/em_zt_pool_sync_api.py,sha256=Y2TattsWufh8rSYxN5szSU_F5dnRELEdcA8jgF-h6Zo,6603
|
|
130
|
-
mns_scheduler/zt/zt_pool/ths_zt_pool_sync_api.py,sha256=
|
|
130
|
+
mns_scheduler/zt/zt_pool/ths_zt_pool_sync_api.py,sha256=Sy39T-yFwLSIIoSZqQzS-6-W1RlaFWvYpksEXKQVFdI,10456
|
|
131
131
|
mns_scheduler/zz_task/__init__.py,sha256=QWBdZwBCvQw8aS4hnL9_pg3U3ZiNLUXzlImyy9WhUcI,163
|
|
132
132
|
mns_scheduler/zz_task/data_sync_task.py,sha256=DczJjItL2JjaDd_bNAkviXtDdZIhTiwIox90q9qw4Qk,20200
|
|
133
|
-
mns_scheduler-1.1.5.
|
|
134
|
-
mns_scheduler-1.1.5.
|
|
135
|
-
mns_scheduler-1.1.5.
|
|
136
|
-
mns_scheduler-1.1.5.
|
|
133
|
+
mns_scheduler-1.1.5.6.dist-info/METADATA,sha256=C1O6d1PTatClun2cwTJXW-WNb3_8fCi1M9hT5hz8MdY,64
|
|
134
|
+
mns_scheduler-1.1.5.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
135
|
+
mns_scheduler-1.1.5.6.dist-info/top_level.txt,sha256=PXQDFBGR1pWmsUbH5yiLAh71P5HZODTRED0zJ8CCgOc,14
|
|
136
|
+
mns_scheduler-1.1.5.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|