Commit a0f49bf1 authored by ZWT's avatar ZWT

feat(能源管理系统): 修改架构

1.修改架构添加cse;
2.修改各微服务服务名,启动验证,完成cse注册;
3.修改各模块pom及配置文件,解决服务间无法调用问题;
4.修改各服务配置,解决gateway模块跨域问题;
5.暂时删除部分编译错误代码,完成本地登录流程等基础功能测试,验证改造后链路是否正常;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 2fa85573
package pps.core.task.job; package pps.core.task.job;
import pps.cloud.base.service.BaseWatherCloudService; import cn.hutool.core.util.ObjectUtil;
import pps.cloud.prediction.service.PlantPredictedPowerLongTermDataCloudService; import pps.cloud.prediction.service.PlantPredictedPowerLongTermDataCloudService;
import pps.core.common.cache.TaskLockCache;
import pps.core.task.constant.TaskConstant;
import xstartup.annotation.XService; import xstartup.annotation.XService;
import xstartup.annotation.XText; import xstartup.annotation.XText;
import xstartup.base.XContext; import xstartup.base.XContext;
import xstartup.data.XServiceResult; import xstartup.data.XServiceResult;
import xstartup.error.XError;
import xstartup.service.job.XJob; import xstartup.service.job.XJob;
import xstartup.service.job.annotation.XCronTrigger; import xstartup.service.job.annotation.XCronTrigger;
...@@ -15,9 +16,26 @@ import xstartup.service.job.annotation.XCronTrigger; ...@@ -15,9 +16,26 @@ import xstartup.service.job.annotation.XCronTrigger;
public class PlantPredictedPowerLongTermDataJob implements XJob { public class PlantPredictedPowerLongTermDataJob implements XJob {
@XCronTrigger(value = "0 45 1 * * ?") @XCronTrigger(value = "0 45 1 * * ?")
@Override @Override
public XServiceResult execute(XContext context) { public XServiceResult execute(XContext xContext) {
PlantPredictedPowerLongTermDataCloudService cloudService = context.getBean(PlantPredictedPowerLongTermDataCloudService.class); xContext.getLogger().info("------ PlantPredictedPowerLongTermDataJob start:{}", System.currentTimeMillis());
cloudService.runPlantPredictedPowerLongTermData(context); String key = TaskConstant.TASK_LOCK_KEY + "PlantPredictedPowerLongTermDataJob";
return XServiceResult.error(context, XError.NotFound); TaskLockCache exist = TaskLockCache.exist(xContext, key);
if (ObjectUtil.isNull(exist)) {
TaskLockCache cache = new TaskLockCache();
cache.setRedisKey(key);
cache.setRedisValue(key);
TaskLockCache.set(xContext, cache);
try {
PlantPredictedPowerLongTermDataCloudService cloudService = xContext.getBean(PlantPredictedPowerLongTermDataCloudService.class);
XServiceResult result = cloudService.runPlantPredictedPowerLongTermData(xContext);
result.throwIfFail();
} catch (Exception e) {
xContext.getLogger().error("------ PlantPredictedPowerLongTermDataJob Exception: ", e);
} finally {
xContext.getLogger().info("------ PlantPredictedPowerLongTermDataJob end:{}", System.currentTimeMillis());
TaskLockCache.delete(xContext, key);
}
}
return XServiceResult.OK;
} }
} }
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