version1
chengqf 2 years ago
parent 12a956874c
commit 247d1a2020

@ -31,7 +31,6 @@ public interface IdcService {
BaseResponse downlaodSuccess(HttpServletRequest request,Map<String,Object> params);
public void asyncIdcTask();
void asyncUdiTask();
void asyncSpsTask();

@ -85,6 +85,7 @@ public class IdcServiceImpl implements IdcService {
@Resource
private ScheduledDao scheduledDao;
/*获取拉取任务列表*/
@Override
public BaseResponse taskList(HttpServletRequest request, Map<String, Object> params) {
Map<String, Object> map = new HashMap<String, Object>();
@ -93,6 +94,7 @@ public class IdcServiceImpl implements IdcService {
return ResultVOUtils.success(list);
}
/*下载任务*/
@Override
public BaseResponse download(HttpServletRequest request, Map<String, Object> params) {
String id = "";
@ -103,7 +105,6 @@ public class IdcServiceImpl implements IdcService {
id = params.get("id").toString();
}
Map<String, Object> map = map = dbDao.get("select * from " + tableName + " where id='" + id + "'");
if (map == null)
@ -138,13 +139,14 @@ public class IdcServiceImpl implements IdcService {
asyncDataTask(false);
}
/*拉取前一级中继服务数据*/
/*UDI系统拉取前一级中继服务或自助平台数据*/
@Async
@Override
public void asyncFetchUdiTask() {
fetchTask(false);
}
/*中继服务拉取任务*/
@Async
@Override
public void asyncFetchTask() {
@ -157,6 +159,7 @@ public class IdcServiceImpl implements IdcService {
}
/*任务拉取,isIdc 是否中继服务*/
private void fetchTask(boolean isIdc) {
String host = getNextHost();
@ -165,10 +168,8 @@ public class IdcServiceImpl implements IdcService {
if (map != null && map.get("syncIp") != null)
host = map.get("syncIp").toString();
}
logger.info("fetch from ip:" + host);
if (!StringUtils.isEmpty(host)) {
String result = IDCUtils.post(host + "/spssync/common/list", null);
if (IDCUtils.isJson(result)) {
JSONObject json = JSON.parseObject(result);
if (json != null && json.getInteger("code") == 20000 && json.getString("data") != null) {
@ -185,17 +186,7 @@ public class IdcServiceImpl implements IdcService {
}
}
@Async
@Override
public void asyncIdcTask() {
initTable();
Map<String, Object> map = dbDao.get("select * from idc_var where code='system_type'");
if (map == null) {
dbDao.save("insert into idc_var (code,content) values ('system_type','IDC')");
}
}
private void asyncDataTask(boolean isUpload) {
initTable();
Map<String, Object> map = dbDao.get("select * from sync_data_set limit 1");

Loading…
Cancel
Save