Commit 858fd29c authored by 吕先亚's avatar 吕先亚

再平衡判断依据改为rp_id

parent dcc77e2c
生成测试用例:
python test_case_gen\Sample\gentestcase.py test_case_gen\Sample\testcase_example_1114.xlsx
python test_case_gen\Sample\gentestcase.py test_case_gen\Sample\testcase_example.xlsx
执行测试用例:
python reb_test.py sv test test_case_gen/Sample/TEST_CASE_1_portfolio.json test_ca
se_gen/Sample/TEST_CASE_1_recomm.json test_data\class.json test_data\record_portfolio.json 20230804
python reb_test.py sv test test_case_gen/Sample/TEST_CASE_2_portfolio.json test_ca
se_gen/Sample/TEST_CASE_2_recomm.json test_data\class.json test_data\record_portfolio.json 20230810
python reb_test.py sv test test_case_gen/Sample/TEST_CASE_3_portfolio.json test_ca
se_gen/Sample/TEST_CASE_3_recomm.json test_data\class.json test_data\record_portfolio.json 20230817
python reb_test.py sv test test_case_gen/Sample/TEST_CASE_4_portfolio.json test_case_gen/Sample/TEST_CASE_4_recomm.json test_data\class.json test_data\record_portfolio.json 20230812
python reb_test.py sv test TEST_CASE_4_portfolio.json TEST_CASE_4_recomm.json test_data\class.json test_data\record_portfolio.json 20230812
......@@ -112,10 +112,13 @@ class base_Quant_api():
if res == 0:
rp_id = '0'
reason = '符合所有條件,無需REB'
last_busi_date = None
rec_reason = None
else:
(rp_id, reason) = res
(rp_id, reason,last_busi_date,rec_reason) = res
self.__default_msg['rebs'].append({"pt_id":pt["pt_id"], "rp_id":rp_id, "reason":reason })
self.__default_msg['rebs'].append({"pt_id":pt["pt_id"], "rp_id":rp_id, "reason":reason,
"last_busi_date":last_busi_date , "rec_reason":rec_reason})
#self.__default_msg['rebs'].append({"pt_id":pt["pt_id"], "rp_id": self._rebalance(pt)})
return self.__default_msg
......
......@@ -26,8 +26,7 @@ class Quant_api(base_Quant_api):
return last_day_date.strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
model_portfolio = self.get_latest_portfolio(pt['recomm_id'])
if not pt.get('last_check_date') or pt.get('last_check_date').replace('-', '') <= model_portfolio[
'data_Date']:
if not pt.get('rp_id') or pt.get('rp_id') != model_portfolio['rp_id']:
note = json.loads(pt.get('note'))
if not note.get('recomm_reason'):
raise RuntimeError('未輸入推薦理由')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment