Ver código fonte

小修小补

Joey 1 mês atrás
pai
commit
5ae4a43530
2 arquivos alterados com 18 adições e 18 exclusões
  1. 12 12
      modules/task_monthlyPerformance.dos
  2. 6 6
      modules/task_weeklyPerformnce.dos

+ 12 - 12
modules/task_monthlyPerformance.dos

@@ -348,10 +348,10 @@ def cal_and_save_mc_indicator(entity_type, entity_date, monthly_returns, indicat
 /*
  *  [定时任务]: 基金经理/公司月净值计算
  * 
- *   Example: CalMCMonthlyNavTask('CO', 2024.12.04);
+ *   Example: CalMCMonthlyNavTask('PL', 2024.12.01);
  */
 def CalMCMonthlyNavTask(entity_type, updatetime) {
-//updatetime = 2024.11.05;
+//updatetime = 2024.12.01;
 //entity_type = 'CO';
 	if(!(entity_type IN ['PL', 'CO'])) return;
 
@@ -379,12 +379,12 @@ def CalMCMonthlyNavTask(entity_type, updatetime) {
  * 
  *   @param entity_type <STRING>: PL, CO
  * 
- *   Example: CalMCIndicatorTask('CO', 2024.11.04);
- *   		  CalMCIndicatorTask('PL', 2024.11.04);
+ *   Example: CalMCIndicatorTask('CO', 2024.12.01);
+ *   		  CalMCIndicatorTask('PL', 2024.12.01);
  */
 def CalMCIndicatorTask(entity_type, updatetime) {
-//	entity_type = 'PL';
-// updatetime = 2024.11.01
+//	entity_type = 'CO';
+// updatetime = 2024.12.01
 
 	rt = '';
 
@@ -402,21 +402,21 @@ def CalMCIndicatorTask(entity_type, updatetime) {
 	do {
 
 		// 取完整月净值
-		tb_entity_date = SELECT entity_id, curve_type, strategy, ver_old_month AS end_date
+		tb_entity_date = SELECT entity_id, curve_type, strategy, ver_old_month AS effective_date
 		                 FROM entity_date WHERE entity_id in v_entity_id[i : min(i + batch_size, max_cnt)];
 
 		if(tb_entity_date.isVoid() || tb_entity_date.size() == 0) break;
 
 		s_json = tb_entity_date.toStdJson();
-		tb_nav = get_mc_nav_for_return_calculation('PL', s_json, 0);
+		tb_nav = get_mc_nav_for_return_calculation(entity_type, s_json, 0);
 
-		v_end_date = tb_nav.end_date.temporalParse('yyyy-MM');
-		tb_nav.replaceColumn!('end_date', v_end_date);
+		v_end_date = tb_nav.effective_date.temporalParse('yyyy-MM');
+		tb_nav.replaceColumn!('effective_date', v_end_date);
 		tb_nav.join!(v_end_date.temporalFormat('yyyy-MM-dd').temporalParse('yyyy-MM-dd').businessMonthEnd() AS price_date);
-		tb_nav.sortBy!(['entity_id', 'curve_type', 'strategy', 'end_date']);
+		tb_nav.sortBy!(['entity_id', 'curve_type', 'strategy', 'effective_date']);
 
 		// 计算月度收益
-		tb_monthly_ret = SELECT entity_id, curve_type, strategy, end_date, price_date, cumulative_nav AS nav, cumulative_nav.ratios()-1 AS ret 
+		tb_monthly_ret = SELECT entity_id, curve_type, strategy, effective_date AS end_date, price_date, cumulative_nav AS nav, cumulative_nav.ratios()-1 AS ret 
 						 FROM tb_nav
 						 CONTEXT BY entity_id, curve_type, strategy;
 		

+ 6 - 6
modules/task_weeklyPerformnce.dos

@@ -26,7 +26,7 @@ use fundit::dataSaver;
 def CalEntityRBSATask(entityType, entityIds, updateTime) {
 // entityType = 'MF'
 //entityIds = NULL
-//updateTime = 2024.10.14T10:00:00
+//updateTime = 2024.12.21T10:00:00
 
 	t_cal = get_entity_list_by_latest_return_updatetime(entityType, entityIds, updateTime, true);
 
@@ -106,11 +106,11 @@ def CalEntityRBSATask(entityType, entityIds, updateTime) {
  * 
  *   TODO: max_r2 表在哪里被用到了?应该和基金推荐有关系
  *   
- *   Example: MatchEntityBFITask('MF', 2024.11.20);
+ *   Example: MatchEntityBFITask('MF', 2024.12.01);
  */
 def MatchEntityBFITask(entityType, date) {
 //entityType = 'MF'
-//date = 2024.11.20
+//date = 2024.12.01
 
 	rt = '';
 
@@ -123,7 +123,7 @@ def MatchEntityBFITask(entityType, date) {
 
 	i = 0;
 	size = tb_cal_entity.size();
-	batch_size = 1000;
+	batch_size = 100;
 	
 	do {
 		// 4 min per 1000 funds or 2 min per 1000 portfolios
@@ -143,7 +143,7 @@ def MatchEntityBFITask(entityType, date) {
 	    				   iif(coe_1y.abs() < get_min_threshold('correlation'), double(NULL), coe_1y) AS coe_1y,
 	    				   iif(coe_3y.abs() < get_min_threshold('correlation'), double(NULL), coe_3y) AS coe_3y,
 	    				   iif(coe_5y.abs() < get_min_threshold('correlation'), double(NULL), coe_5y) AS coe_5y,
-	    				   info_ratio_1y, info_ratio_3y, info_ratio_5y, t_value_1y, t_value_3y, t_value_5y, beta_1y, beta_3y, beta_5y
+	    				   t_value_1y, t_value_3y, t_value_5y, beta_1y, beta_3y, beta_5y
 					FROM coe;
 
 			DELETE FROM t_coe WHERE coe_1y IS NULL AND coe_3y IS NULL AND coe_5y IS NULL;
@@ -390,7 +390,7 @@ def cal_and_save_mc_weekly_nav(entity_type, entity_date, is_save_local) {
  *   Example: CalMCWeeklyNavTask('CO', 2024.11.04);
  */
 def CalMCWeeklyNavTask(entity_type, updatetime) {
-//updatetime = 2024.12.05;
+//updatetime = 2024.11.05;
 //entity_type = 'PL';
 	if(!(entity_type IN ['PL', 'CO'])) return;