|
@@ -44,7 +44,7 @@ public class Application {
|
|
|
* # arg[0]=调用类别:
|
|
|
* zt_tag(生成标签) dic_tag(更新mysql字典表) xxh_etl(更新原始信息化etl数据到xxh表)
|
|
|
* z_cancel_data(准备退订数据) join_all(只合并宽表) single_handler(单独调用 指定handler)
|
|
|
- * multi_zt_tag(生成多月份标签) multi_collect_join(聚合并合并多个月标签)
|
|
|
+ * multi_zttag_collect_join(生成/聚合/合并多个月标签)
|
|
|
* # arg[1]=月份: month
|
|
|
* # arg[2]=HandlerName: [比如:java -jar xxx.jar xxhAppTagHandler(使用类名的小写开头的字符串)]
|
|
|
*
|
|
@@ -108,25 +108,6 @@ public class Application {
|
|
|
//生成rfm表 todo
|
|
|
}
|
|
|
/**
|
|
|
- * 生成多个月份的标签数据[必须指定开始月份]
|
|
|
- */
|
|
|
- if(sendTp.equals("multi_zt_tag")) {
|
|
|
- //从jvm参数中获取月份间隔 java -DmonthInterval=xx -jar xxx.jar
|
|
|
- int monthInterval = NumberUtil.parseInt(System.getProperty("monthInterval"));
|
|
|
- if(monthInterval <= 0) { //不传递月份间隔,计算[当前月-paramMonth]=N个月
|
|
|
- Date paramMonthDate = DateUtil.parse(permonth, "yyyyMM");
|
|
|
- Date perMonthDate = DateUtil.offsetMonth(new Date(), -1);
|
|
|
- monthInterval = (int)DateUtil.betweenMonth(paramMonthDate, perMonthDate, false) + 1;
|
|
|
- }
|
|
|
- //批量执行多个月份
|
|
|
- for(String classHandler : classHandlers) {
|
|
|
- if(!"xxhLongTagHandler".equalsIgnoreCase(classHandler)) { //long标签单独跑一次即可
|
|
|
- AbstractTagHandler tagHandler = applicationContext.getBean(classHandler, AbstractTagHandler.class);
|
|
|
- tagHandler.handleMultiMonth(permonth, monthInterval);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- /**
|
|
|
* 单独调用指定handler
|
|
|
*/
|
|
|
if (sendTp.equals("single_handler")) {
|
|
@@ -166,7 +147,7 @@ public class Application {
|
|
|
flatTagHandler.tempDataToFlatView(permonth);
|
|
|
}
|
|
|
//聚合,合并多个月的标签数据
|
|
|
- if(sendTp.equals("multi_collect_join")) {
|
|
|
+ if(sendTp.equals("multi_zttag_collect_join")) {
|
|
|
//从jvm参数中获取月份间隔 java -DmonthInterval=xx -jar xxx.jar
|
|
|
int monthInterval = NumberUtil.parseInt(System.getProperty("monthInterval"));
|
|
|
if(monthInterval <= 0) { //不传递月份间隔,计算[当前月-paramMonth]=N个月
|
|
@@ -176,8 +157,15 @@ public class Application {
|
|
|
}
|
|
|
LocalDate monthDate = LocalDate.parse(permonth+"01", DateTimeFormatter.BASIC_ISO_DATE);
|
|
|
for(int i = 0; i < monthInterval; i++) {
|
|
|
- String monthStr = DateUtil.format(monthDate.plusMonths(i + 1).atStartOfDay(), "yyyyMM");
|
|
|
+ String monthStr = DateUtil.format(monthDate.plusMonths(i).atStartOfDay(), "yyyyMM");
|
|
|
+ //批量执行多个月份
|
|
|
+ for(String classHandler : classHandlers) {
|
|
|
+ AbstractTagHandler tagHandler = applicationContext.getBean(classHandler, AbstractTagHandler.class);
|
|
|
+ tagHandler.handle(monthStr);
|
|
|
+ }
|
|
|
+ //聚合标签
|
|
|
applicationContext.getBean(CollectAllTagHandler.class).handle(monthStr);
|
|
|
+ //合并标签
|
|
|
applicationContext.getBean(FlatTagHandler.class).tempDataToFlatView(monthStr);
|
|
|
}
|
|
|
}
|