Compare commits
3 Commits
da8340d41e
...
6f960da803
Author | SHA1 | Date |
---|---|---|
wangliwen | 6f960da803 | |
wangliwen | 628e22eedc | |
wangliwen | 1531d85695 |
|
@ -10,6 +10,8 @@ import io.renren.common.utils.MessageUtils;
|
||||||
import io.renren.modules.activiti.dto.TaskDTO;
|
import io.renren.modules.activiti.dto.TaskDTO;
|
||||||
import io.renren.modules.demanData.dto.TDemandDataDTO;
|
import io.renren.modules.demanData.dto.TDemandDataDTO;
|
||||||
import io.renren.modules.demanData.service.TDemandDataService;
|
import io.renren.modules.demanData.service.TDemandDataService;
|
||||||
|
import io.renren.modules.demandComment.dto.TDemandCommentDTO;
|
||||||
|
import io.renren.modules.demandComment.service.TDemandCommentService;
|
||||||
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
|
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
|
||||||
import io.renren.modules.processForm.service.TAbilityApplicationService;
|
import io.renren.modules.processForm.service.TAbilityApplicationService;
|
||||||
import io.renren.modules.resource.dto.ResourceDTO;
|
import io.renren.modules.resource.dto.ResourceDTO;
|
||||||
|
@ -62,6 +64,9 @@ public class ActTaskService extends BaseServiceImpl {
|
||||||
public static String Task_HANDLE_STATE_BACK = "back"; //回退
|
public static String Task_HANDLE_STATE_BACK = "back"; //回退
|
||||||
public static String Task_HANDLE_STATE_STOP = "stop"; //终止
|
public static String Task_HANDLE_STATE_STOP = "stop"; //终止
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TDemandCommentService tDemandCommentService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected TaskService taskService;
|
protected TaskService taskService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -166,6 +171,16 @@ public class ActTaskService extends BaseServiceImpl {
|
||||||
listDto.add(dto);
|
listDto.add(dto);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TDemandCommentDTO tDemandCommentDTO = tDemandCommentService.get(Long.valueOf(dto.getBusinessKey()));
|
||||||
|
if (tDemandCommentDTO != null) {
|
||||||
|
Map<String, Object> variables = oMapper.convertValue(tDemandCommentDTO, Map.class);
|
||||||
|
processVariable.putAll(variables);
|
||||||
|
processVariable.putAll(task.getProcessVariables());
|
||||||
|
dto.setParams(processVariable);
|
||||||
|
listDto.add(dto);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return new PageData<>(listDto, (int) taskQuery.count());
|
return new PageData<>(listDto, (int) taskQuery.count());
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,7 +255,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
if ("基础设施".equals(resourceDTO.getType())) { // 基础设施
|
if ("基础设施".equals(resourceDTO.getType())) { // 基础设施
|
||||||
logger.info("西海岸基础设施");
|
logger.info("西海岸基础设施");
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
CompletableFuture cloud = CompletableFuture.runAsync(() -> { // 云脑专网
|
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
String url = String.format(tsingtao_xhaProperties.getCloudcam(), org.apache.commons.lang3.StringUtils.isNotEmpty(resourceDTO.getName()) ? resourceDTO.getName() : "", pageNum, pageSize);
|
String url = String.format(tsingtao_xhaProperties.getCloudcam(), org.apache.commons.lang3.StringUtils.isNotEmpty(resourceDTO.getName()) ? resourceDTO.getName() : "", pageNum, pageSize);
|
||||||
logger.info(url);
|
logger.info(url);
|
||||||
|
@ -295,49 +294,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("失败", exception);
|
logger.error("失败", exception);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
CompletableFuture local = CompletableFuture.runAsync(() -> { // 金宏网
|
|
||||||
OkHttpClient client = new OkHttpClient();
|
|
||||||
String url = String.format(tsingtao_xhaProperties.getLocalcam(), org.apache.commons.lang3.StringUtils.isNotEmpty(resourceDTO.getName()) ? resourceDTO.getName() : "", pageNum, pageSize);
|
|
||||||
logger.info(url);
|
|
||||||
Request request = new Request.Builder().url(url).build();
|
|
||||||
try (Response response = client.newCall(request).execute()) {
|
|
||||||
if (response.isSuccessful()) {
|
|
||||||
String body = response.body().string();
|
|
||||||
JSONObject jsonObject_ = JSON.parseObject(body);
|
|
||||||
logger.info("西海岸接口返回:{}" + body, url);
|
|
||||||
if (jsonObject_.containsKey("data")) {
|
|
||||||
if (jsonObject_.getJSONObject("data").containsKey("list")) {
|
|
||||||
resultPage.setTotal(jsonObject_.getJSONObject("data").getLongValue("total"));
|
|
||||||
resultPage.setRecords(jsonObject_.getJSONObject("data").getJSONArray("list").stream().map(index -> (JSONObject) JSON.toJSON(index)).map(index -> {
|
|
||||||
ResourceDTO resourceDTO1 = new ResourceDTO();
|
|
||||||
resourceDTO1.setId(Long.valueOf(index.getString("id")));
|
|
||||||
resourceDTO1.setDelFlag(index.getIntValue("delFlag"));
|
|
||||||
resourceDTO1.setLink(index.getString("cameraIndexCode"));
|
|
||||||
resourceDTO1.setName(index.getString("name"));
|
|
||||||
resourceDTO1.setType("基础设施");
|
|
||||||
try {
|
|
||||||
resourceDTO1.setCreateDate(sdf.parse(index.getString("createdTime")));
|
|
||||||
} catch (ParseException e) {
|
|
||||||
logger.error("时间异常");
|
|
||||||
resourceDTO1.setCreateDate(new Date());
|
|
||||||
}
|
|
||||||
return resourceDTO1;
|
|
||||||
}).collect(Collectors.toList()));
|
|
||||||
} else {
|
|
||||||
resultPage.setRecords(new ArrayList<>());
|
|
||||||
resultPage.setTotal(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
logger.error("获取失败");
|
|
||||||
}
|
|
||||||
} catch (Exception exception) {
|
|
||||||
logger.error("失败", exception);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
CompletableFuture.allOf(cloud, local);
|
|
||||||
} else {
|
} else {
|
||||||
logger.info("西海岸基普通");
|
logger.info("西海岸基普通");
|
||||||
if (resourceDTO.getInfoList().isEmpty()) {
|
if (resourceDTO.getInfoList().isEmpty()) {
|
||||||
|
|
|
@ -12,7 +12,6 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,8 +35,7 @@ public class TsingtaoXHAVideoPreviewService extends AbstractVideoPreviewService
|
||||||
@Override
|
@Override
|
||||||
public String getHls(String key) {
|
public String getHls(String key) {
|
||||||
List<String> result = new CopyOnWriteArrayList<>();
|
List<String> result = new CopyOnWriteArrayList<>();
|
||||||
CompletableFuture cloud =
|
|
||||||
CompletableFuture.runAsync(() -> { // 云脑专网
|
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
Request request = new Request.Builder().url(String.format(tsingtao_xhaProperties.getCloudhls(), key)).build();
|
Request request = new Request.Builder().url(String.format(tsingtao_xhaProperties.getCloudhls(), key)).build();
|
||||||
try (Response response = client.newCall(request).execute()) {
|
try (Response response = client.newCall(request).execute()) {
|
||||||
|
@ -52,25 +50,6 @@ public class TsingtaoXHAVideoPreviewService extends AbstractVideoPreviewService
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.error("西海岸预览地址获取失败", exception);
|
logger.error("西海岸预览地址获取失败", exception);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
CompletableFuture local =
|
|
||||||
CompletableFuture.runAsync(() -> { // 金宏网
|
|
||||||
OkHttpClient client = new OkHttpClient();
|
|
||||||
Request request = new Request.Builder().url(String.format(tsingtao_xhaProperties.getLocalhls(), key)).build();
|
|
||||||
try (Response response = client.newCall(request).execute()) {
|
|
||||||
if (response.isSuccessful()) {
|
|
||||||
JSONObject jsonObject = JSON.parseObject(response.body().string());
|
|
||||||
if (jsonObject.containsKey("data")) {
|
|
||||||
result.add(jsonObject.getString("data"));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
logger.error("西海岸预览地址获取失败");
|
|
||||||
}
|
|
||||||
} catch (Exception exception) {
|
|
||||||
logger.error("西海案预览地址获取失败", exception);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
CompletableFuture.allOf(cloud, local);
|
|
||||||
return result.stream().filter(index -> StringUtils.isNotEmpty(index)).findAny().orElse(null);
|
return result.stream().filter(index -> StringUtils.isNotEmpty(index)).findAny().orElse(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue