微调
This commit is contained in:
@@ -6,6 +6,7 @@ import com.njcn.gather.result.service.impl.ResultServiceImpl;
|
|||||||
import com.njcn.http.util.RestTemplateUtil;
|
import com.njcn.http.util.RestTemplateUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -18,8 +19,8 @@ import java.util.Map;
|
|||||||
@Component
|
@Component
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DataCheckAsyncNotifier {
|
public class DataCheckAsyncNotifier {
|
||||||
|
@Value("${dataCheck.url}")
|
||||||
private final static String url="http://172.17.100.111:18091/steady/checksquare/create";
|
private String url;
|
||||||
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
private final RestTemplateUtil restTemplateUtil;
|
private final RestTemplateUtil restTemplateUtil;
|
||||||
|
|||||||
@@ -147,7 +147,8 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
private final DataCheckAsyncNotifier dataCheckAsyncNotifier;
|
private final DataCheckAsyncNotifier dataCheckAsyncNotifier;
|
||||||
private final RestTemplateUtil restTemplateUtil;
|
private final RestTemplateUtil restTemplateUtil;
|
||||||
|
|
||||||
public static final String CHECKSQUARE_CREATE_URL = "http://192.168.2.147:18091/api/steady/checksquare/create";
|
@org.springframework.beans.factory.annotation.Value("${dataCheck.url}")
|
||||||
|
private String url;
|
||||||
private static final DateTimeFormatter CHECKSQUARE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
private static final DateTimeFormatter CHECKSQUARE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
private final Map<String, NotifyState> notifyStates = new ConcurrentHashMap<>();
|
private final Map<String, NotifyState> notifyStates = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@@ -225,7 +226,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
request.setIndicatorCodes(Arrays.asList("V_RMS"));
|
request.setIndicatorCodes(Arrays.asList("V_RMS"));
|
||||||
request.setTimeStart("2026-06-08 00:00:00");
|
request.setTimeStart("2026-06-08 00:00:00");
|
||||||
request.setTimeEnd("2026-06-08 23:59:59");
|
request.setTimeEnd("2026-06-08 23:59:59");
|
||||||
String s = restTemplateUtil.postJson(CHECKSQUARE_CREATE_URL, request, String.class);
|
String s = restTemplateUtil.postJson(url, request, String.class);
|
||||||
JSONObject obj = JSONUtil.parseObj(s);
|
JSONObject obj = JSONUtil.parseObj(s);
|
||||||
DataCheckResultVO data = BeanUtil.copyProperties(obj.get("data"), DataCheckResultVO.class);
|
DataCheckResultVO data = BeanUtil.copyProperties(obj.get("data"), DataCheckResultVO.class);
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
@@ -134,3 +134,4 @@ activate:
|
|||||||
|
|
||||||
dataCheck:
|
dataCheck:
|
||||||
enable: false
|
enable: false
|
||||||
|
url: http://127.0.0.1:18091/steady/checksquare/create
|
||||||
Reference in New Issue
Block a user