Commit 1313ff28 authored by wuxiaokai's avatar wuxiaokai
parents 36bdc8c3 32e11076
...@@ -50,8 +50,6 @@ ...@@ -50,8 +50,6 @@
<pagehelper.boot.version>1.3.1</pagehelper.boot.version> <pagehelper.boot.version>1.3.1</pagehelper.boot.version>
<jersey.version>2.23.2</jersey.version> <jersey.version>2.23.2</jersey.version>
<artemis.version>1.1.7</artemis.version> <artemis.version>1.1.7</artemis.version>
<powerjob.version>4.1.1</powerjob.version>
</properties> </properties>
<!-- 依赖声明 --> <!-- 依赖声明 -->
...@@ -163,12 +161,6 @@ ...@@ -163,12 +161,6 @@
<artifactId>gson</artifactId> <artifactId>gson</artifactId>
<version>${gson.version}</version> <version>${gson.version}</version>
</dependency> </dependency>
<!-- Powerjob -->
<dependency>
<groupId>tech.powerjob</groupId>
<artifactId>powerjob-worker-spring-boot-starter</artifactId>
<version>${powerjob.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
...@@ -160,11 +160,6 @@ ...@@ -160,11 +160,6 @@
<artifactId>hibernate-validator</artifactId> <artifactId>hibernate-validator</artifactId>
<version>6.0.1.Final</version> <version>6.0.1.Final</version>
</dependency> </dependency>
<!-- Powerjob -->
<dependency>
<groupId>tech.powerjob</groupId>
<artifactId>powerjob-worker-spring-boot-starter</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package net.wanji.utc.task;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.wanji.utc.common.constant.Constants;
import net.wanji.utc.mapper.ManufacturerApiInfoMapper;
import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.ManufacturerApiInfoPO;
import net.wanji.utc.po.ManufacturerInfoPO;
import org.springframework.stereotype.Component;
import tech.powerjob.worker.core.processor.ProcessResult;
import tech.powerjob.worker.core.processor.TaskContext;
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;
import java.util.List;
/**
* Powerjob定时任务
*
* @author Kent HAN
* @date 2022/12/16 14:56
*/
@Component
@Slf4j
@RequiredArgsConstructor
public class ApiInfoProcessor implements BasicProcessor {
private final ManufacturerApiInfoMapper manufacturerApiInfoMapper;
private final ManufacturerInfoMapper manufacturerInfoMapper;
@Override
public ProcessResult process(TaskContext context) {
try {
List<ManufacturerApiInfoPO> manufacturerApiInfoPOList = manufacturerApiInfoMapper.selectAll();
if (manufacturerApiInfoPOList == null || manufacturerApiInfoPOList.isEmpty()) {
return null;
}
// 刷新JVM
for (ManufacturerApiInfoPO infoPO : manufacturerApiInfoPOList) {
Integer manufacturerId = infoPO.getManufacturerId();
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId);
String code = manufacturerInfoPO.getCode();
String s = code + Constants.SEPARATOR_UNDER_LINE + infoPO.getCode();
Constants.putManufacturerUrlMap(s, infoPO);
}
log.info("刷新" + manufacturerApiInfoPOList.size() + "条厂商URL至JVM");
} catch (Exception e) {
log.error("刷新厂商URL到JVM异常", e);
}
return null;
}
}
...@@ -47,8 +47,3 @@ signal: ...@@ -47,8 +47,3 @@ signal:
artemisAppSecret: 5z0O0DRKALWyIxdQU4kp artemisAppSecret: 5z0O0DRKALWyIxdQU4kp
# 海康能力开放平台的网站路径 # 海康能力开放平台的网站路径
artemisPath: /artemis artemisPath: /artemis
powerjob:
worker:
app-name: signal-utc-service
server-address: 10.100.1.87:7700
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