|
@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
|
import com.bfd.util.PauseTool; |
|
|
import com.bw.asr.cache.ConfigCache; |
|
|
import com.bw.asr.cache.ConfigCache; |
|
|
import com.bw.asr.entity.Constants; |
|
|
import com.bw.asr.entity.Constants; |
|
|
import com.bw.asr.service.AsrTaskService; |
|
|
import com.bw.asr.service.AsrTaskService; |
|
@ -38,6 +39,13 @@ public class AsrTaskServiceImpl implements AsrTaskService { |
|
|
// TODO Auto-generated method stub |
|
|
// TODO Auto-generated method stub |
|
|
Map<String, Object> data = (Map<String, Object>) task.get(Constants.DATA); |
|
|
Map<String, Object> data = (Map<String, Object>) task.get(Constants.DATA); |
|
|
Map<String, Object> input = (Map<String, Object>) task.get(Constants.INPUT); |
|
|
Map<String, Object> input = (Map<String, Object>) task.get(Constants.INPUT); |
|
|
|
|
|
int scenesId = (int) task.get(Constants.SCENES_ID); |
|
|
|
|
|
int version = (int) task.get(Constants.VERSION); |
|
|
|
|
|
String pauseKey = scenesId + "_" + version; |
|
|
|
|
|
if (!PauseTool.CACHE.containsKey(pauseKey)) { |
|
|
|
|
|
log.info("流程:{}的版本:{}已失效,任务跳过", scenesId, version); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
String token = getToken(input); |
|
|
String token = getToken(input); |
|
|
String createUrl = (String) input.get(Constants.CREATEURL); |
|
|
String createUrl = (String) input.get(Constants.CREATEURL); |
|
|
String url = createUrl + token; |
|
|
String url = createUrl + token; |
|
@ -84,6 +92,13 @@ public class AsrTaskServiceImpl implements AsrTaskService { |
|
|
public void query(Map<String, Object> task) { |
|
|
public void query(Map<String, Object> task) { |
|
|
// TODO Auto-generated method stub |
|
|
// TODO Auto-generated method stub |
|
|
Map<String, Object> input = (Map<String, Object>) task.get(Constants.INPUT); |
|
|
Map<String, Object> input = (Map<String, Object>) task.get(Constants.INPUT); |
|
|
|
|
|
int scenesId = (int) task.get(Constants.SCENES_ID); |
|
|
|
|
|
int version = (int) task.get(Constants.VERSION); |
|
|
|
|
|
String pauseKey = scenesId + "_" + version; |
|
|
|
|
|
if (!PauseTool.CACHE.containsKey(pauseKey)) { |
|
|
|
|
|
log.info("流程:{}的版本:{}已失效,任务跳过", scenesId, version); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
String token = getToken(input); |
|
|
String token = getToken(input); |
|
|
String queryUrl = (String) input.get(Constants.QUERYURL); |
|
|
String queryUrl = (String) input.get(Constants.QUERYURL); |
|
|
String url = queryUrl + token; |
|
|
String url = queryUrl + token; |
|
|