|
@@ -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) {
|
|
def CalMCMonthlyNavTask(entity_type, updatetime) {
|
|
-//updatetime = 2024.11.05;
|
|
|
|
|
|
+//updatetime = 2024.12.01;
|
|
//entity_type = 'CO';
|
|
//entity_type = 'CO';
|
|
if(!(entity_type IN ['PL', 'CO'])) return;
|
|
if(!(entity_type IN ['PL', 'CO'])) return;
|
|
|
|
|
|
@@ -379,12 +379,12 @@ def CalMCMonthlyNavTask(entity_type, updatetime) {
|
|
*
|
|
*
|
|
* @param entity_type <STRING>: PL, CO
|
|
* @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) {
|
|
def CalMCIndicatorTask(entity_type, updatetime) {
|
|
-// entity_type = 'PL';
|
|
|
|
-// updatetime = 2024.11.01
|
|
|
|
|
|
+// entity_type = 'CO';
|
|
|
|
+// updatetime = 2024.12.01
|
|
|
|
|
|
rt = '';
|
|
rt = '';
|
|
|
|
|
|
@@ -402,21 +402,21 @@ def CalMCIndicatorTask(entity_type, updatetime) {
|
|
do {
|
|
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)];
|
|
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;
|
|
if(tb_entity_date.isVoid() || tb_entity_date.size() == 0) break;
|
|
|
|
|
|
s_json = tb_entity_date.toStdJson();
|
|
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.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
|
|
FROM tb_nav
|
|
CONTEXT BY entity_id, curve_type, strategy;
|
|
CONTEXT BY entity_id, curve_type, strategy;
|
|
|
|
|