|
|
|
@ -1,7 +1,9 @@
|
|
|
|
package com.nm.gsgl.service.impl;
|
|
|
|
package com.nm.gsgl.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.Constant;
|
|
|
|
import com.nm.gsgl.common.utils.CloseableHttpClientUtils;
|
|
|
|
import com.nm.gsgl.common.utils.CloseableHttpClientUtils;
|
|
|
|
import com.nm.gsgl.common.utils.LogUtil;
|
|
|
|
import com.nm.gsgl.common.utils.LogUtil;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.utils.PropertiesUtil;
|
|
|
|
import com.nm.gsgl.entity.intermediary.AppAliveStatus;
|
|
|
|
import com.nm.gsgl.entity.intermediary.AppAliveStatus;
|
|
|
|
import com.nm.gsgl.mapper.AppAliveStatusMapper;
|
|
|
|
import com.nm.gsgl.mapper.AppAliveStatusMapper;
|
|
|
|
import com.nm.gsgl.service.CallSendOutInterfaceService;
|
|
|
|
import com.nm.gsgl.service.CallSendOutInterfaceService;
|
|
|
|
@ -25,6 +27,32 @@ public class CallSendOutInterfaceServiceImpl implements CallSendOutInterfaceServ
|
|
|
|
private AppAliveStatusMapper appAliveStatusMapper;
|
|
|
|
private AppAliveStatusMapper appAliveStatusMapper;
|
|
|
|
//public static Logger log = LoggerFactory.getLogger("CallDisInterface");
|
|
|
|
//public static Logger log = LoggerFactory.getLogger("CallDisInterface");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 调用自动下发接口(省内黑名单表直连分中心对相应片区的hang_table_collect表内数据直连分中心数据库完成对表HANG_TABLE的先删后插)
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param uuid uuid
|
|
|
|
|
|
|
|
* @author shuguang
|
|
|
|
|
|
|
|
* @date 2024-11-15 10:18
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean SendFZXHangTableInterface(String uuid) {
|
|
|
|
|
|
|
|
//双机方案
|
|
|
|
|
|
|
|
//获取本机的机器ID,本机的机器ID 1-主机,2-备用机
|
|
|
|
|
|
|
|
int mId = Integer.parseInt(machineId);
|
|
|
|
|
|
|
|
LogUtil.WriteLog_SendFZXHangTableInterface("[uuid:" + uuid + "]-获取当前机器的id为" + mId, "CallSendOutInterfaceServiceImpl-SendFZXHangTableInterface");
|
|
|
|
|
|
|
|
AppAliveStatus appAliveStatus = appAliveStatusMapper.selectById(1);
|
|
|
|
|
|
|
|
int aLiveId = appAliveStatus.getALiveId();
|
|
|
|
|
|
|
|
if (mId == aLiveId) {
|
|
|
|
|
|
|
|
String sendFZXHangTableUrl = PropertiesUtil.getValue("SendFZXHangTableUrl") == null ? Constant.SEND_FZX_HANG_TABLE_URL : PropertiesUtil.getValue("SendFZXHangTableUrl");
|
|
|
|
|
|
|
|
LogUtil.WriteLog_SendFZXHangTableInterface("[uuid:" + uuid + "]-开始调用自动下发接口(省内黑名单表直连分中心对相应片区的hang_table_collect表内数据直连分中心数据库完成对表HANG_TABLE的先删后插)" + sendOutInterfaceUrl, "CallSendOutInterfaceServiceImpl-SendFZXHangTableInterface");
|
|
|
|
|
|
|
|
CloseableHttpClientUtils.doGet(sendFZXHangTableUrl, null, null, 600000);
|
|
|
|
|
|
|
|
LogUtil.WriteLog_SendFZXHangTableInterface("[uuid:" + uuid + "]-调用自动下发接口(省内黑名单表直连分中心对相应片区的hang_table_collect表内数据直连分中心数据库完成对表HANG_TABLE的先删后插)完成" + sendOutInterfaceUrl, "CallSendOutInterfaceServiceImpl-SendFZXHangTableInterface");
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 调用自动下发接口
|
|
|
|
* 调用自动下发接口
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -38,15 +66,15 @@ public class CallSendOutInterfaceServiceImpl implements CallSendOutInterfaceServ
|
|
|
|
//获取本机的机器ID,本机的机器ID 1-主机,2-备用机
|
|
|
|
//获取本机的机器ID,本机的机器ID 1-主机,2-备用机
|
|
|
|
int mId = Integer.parseInt(machineId);
|
|
|
|
int mId = Integer.parseInt(machineId);
|
|
|
|
//log.info("[uuid:{}]获取当前机器的id为{}", uuid, mId);
|
|
|
|
//log.info("[uuid:{}]获取当前机器的id为{}", uuid, mId);
|
|
|
|
LogUtil.WriteLog_CallDisInterface("[uuid:" + uuid + "]-获取当前机器的id为" + mId, "CallSendOutInterfaceServiceImpl");
|
|
|
|
LogUtil.WriteLog_CallDisInterface("[uuid:" + uuid + "]-获取当前机器的id为" + mId, "CallSendOutInterfaceServiceImpl-callSendOutInterface");
|
|
|
|
AppAliveStatus appAliveStatus = appAliveStatusMapper.selectById(1);
|
|
|
|
AppAliveStatus appAliveStatus = appAliveStatusMapper.selectById(1);
|
|
|
|
int aLiveId = appAliveStatus.getALiveId();
|
|
|
|
int aLiveId = appAliveStatus.getALiveId();
|
|
|
|
if (mId == aLiveId) {
|
|
|
|
if (mId == aLiveId) {
|
|
|
|
//log.info("[uuid:{}]开始调用自动下发程序接口-{}进行下发", uuid, sendOutInterfaceUrl);
|
|
|
|
//log.info("[uuid:{}]开始调用自动下发程序接口-{}进行下发", uuid, sendOutInterfaceUrl);
|
|
|
|
LogUtil.WriteLog_CallDisInterface("[uuid:" + uuid + "]-开始调用自动下发程序接口进行下发" + sendOutInterfaceUrl, "CallSendOutInterfaceServiceImpl");
|
|
|
|
LogUtil.WriteLog_CallDisInterface("[uuid:" + uuid + "]-开始调用自动下发程序接口进行下发" + sendOutInterfaceUrl, "CallSendOutInterfaceServiceImpl-callSendOutInterface");
|
|
|
|
CloseableHttpClientUtils.doGet(sendOutInterfaceUrl, null, null, 600000);
|
|
|
|
CloseableHttpClientUtils.doGet(sendOutInterfaceUrl, null, null, 600000);
|
|
|
|
//log.info("[uuid:{}]调用自动下发程序接口-{}进行下发完成", uuid, sendOutInterfaceUrl);
|
|
|
|
//log.info("[uuid:{}]调用自动下发程序接口-{}进行下发完成", uuid, sendOutInterfaceUrl);
|
|
|
|
LogUtil.WriteLog_CallDisInterface("[uuid:" + uuid + "]-调用自动下发程序接口下发完成" + sendOutInterfaceUrl, "CallSendOutInterfaceServiceImpl");
|
|
|
|
LogUtil.WriteLog_CallDisInterface("[uuid:" + uuid + "]-调用自动下发程序接口下发完成" + sendOutInterfaceUrl, "CallSendOutInterfaceServiceImpl-callSendOutInterface");
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|