1.单位变电站定时任务
This commit is contained in:
@@ -79,4 +79,13 @@ public class LiteFlowJob {
|
||||
liteFlowFeignClient.generaTrixExecutor(baseParam);
|
||||
}
|
||||
|
||||
@XxlJob("generaTrixJob")
|
||||
public void orgSubStationExecutor() {
|
||||
BaseParam baseParam = new BaseParam();
|
||||
baseParam.setFullChain(true);
|
||||
baseParam.setRepair(false);
|
||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
liteFlowFeignClient.orgSubStationExecutor(baseParam);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,4 +47,8 @@ public interface LiteFlowFeignClient {
|
||||
@ApiOperation("母线算法执行链(主网测点)")
|
||||
@PostMapping("/generaTrixExecutor")
|
||||
void generaTrixExecutor(@RequestBody BaseParam baseParam);
|
||||
|
||||
@ApiOperation("单位变电站算法执行链")
|
||||
@PostMapping("/orgSubStationExecutor")
|
||||
void orgSubStationExecutor(@RequestBody BaseParam baseParam);
|
||||
}
|
||||
|
||||
@@ -63,6 +63,12 @@ public class LiteFlowFeignClientFallbackFactory implements FallbackFactory<LiteF
|
||||
log.error("{}异常,降级处理,异常为:{}", "母线算法执行链(主网测点): ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void orgSubStationExecutor(BaseParam baseParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "单位变电站算法执行链: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类的介绍:监测点算法执行链定时任务
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/12/6 9:35
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class OrgSubStationTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final LiteFlowFeignClient liteFlowFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
BaseParam baseParam = new BaseParam();
|
||||
baseParam.setFullChain(true);
|
||||
baseParam.setRepair(false);
|
||||
if(StrUtil.isBlank(date)){
|
||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
}else {
|
||||
baseParam.setDataDate(date);
|
||||
}
|
||||
liteFlowFeignClient.orgSubStationExecutor(baseParam);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user