|
@@ -3,6 +3,9 @@ package com.gis.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
+import cn.hutool.core.thread.ThreadUtil;
|
|
|
+import cn.hutool.core.util.NumberUtil;
|
|
|
+import cn.hutool.core.util.ObjUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HttpRequest;
|
|
@@ -694,6 +697,7 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* someDataToJson
|
|
|
*
|
|
@@ -1462,6 +1466,37 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
|
|
|
}).collect(Collectors.toList());
|
|
|
return Result.success(res);
|
|
|
}
|
|
|
+ @Override
|
|
|
+ public void checkData(String workId, String active) {
|
|
|
+ // 从配置文件或环境变量中获取 URL
|
|
|
+ String urlBase = getUrlBase(active);
|
|
|
+ if (StrUtil.isEmpty(urlBase)) {
|
|
|
+ log.warn("Invalid active value: {}", active);
|
|
|
+ }else {
|
|
|
+ String URL = urlBase + workId + "/someData.json?_= " + System.currentTimeMillis();
|
|
|
+ cn.hutool.http.HttpResponse execute = HttpRequest.get(URL)
|
|
|
+ .timeout(20000)//超时,毫秒
|
|
|
+ .execute();
|
|
|
+ if (execute.getStatus() != 200) {
|
|
|
+ log.error("HTTP request failed with status: {}", execute.getStatus());
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ JSONObject res = JSONObject.parseObject(execute.body());
|
|
|
+ if (res == null || res.isEmpty()) {
|
|
|
+ log.warn("Empty response from URL: {}", URL);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ log.info("成功+---{}", res);
|
|
|
+ if (res.containsKey("openingAnimationType")&& ObjUtil.isNotEmpty(res.get("openingAnimationType"))){
|
|
|
+ boolean openingAnimationType = NumberUtil.isNumber(res.getString("openingAnimationType"));
|
|
|
+ if (!openingAnimationType){
|
|
|
+ fixSomeData(workId,active);
|
|
|
+ fixSomeData2(workId,active);
|
|
|
+ ThreadUtil.safeSleep(2000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public void someDataToDB(String workId, String active) {
|