|
|
|
@ -90,17 +90,17 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void getHrMdTask(String uuid) {
|
|
|
|
public void getHrMdTask(String uuid) {
|
|
|
|
//log.info("[uuid:{}]开始查询华软中介服务上的下载任务数据", uuid);
|
|
|
|
//log.info("[uuid:{}]开始查询华软中介服务上的下载任务数据", uuid);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-开始查询华软中介服务上的下载任务数据", "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-开始查询华软中介服务上的下载任务数据", "FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
//查询下载任务数据
|
|
|
|
//查询下载任务数据
|
|
|
|
List<DownloadNotify> downloadNotifys = DatabaseUtil.selectDownloadNotify(driverName, HRConnectionStringOracle, HROracleName, HROraclePass, Constant.SELECT_TF_DOWNLOAD_NOTIFY_BLACK);
|
|
|
|
List<DownloadNotify> downloadNotifys = DatabaseUtil.selectDownloadNotify(driverName, HRConnectionStringOracle, HROracleName, HROraclePass, Constant.SELECT_TF_DOWNLOAD_NOTIFY_BLACK);
|
|
|
|
String localPath = NFSFilePath + PathUtil.downFile;
|
|
|
|
String localPath = NFSFilePath + PathUtil.downFile;
|
|
|
|
FileUtil.fileCreat(localPath);
|
|
|
|
FileUtil.fileCreat(localPath);
|
|
|
|
//log.info("[uuid:{}]查询华软中介服务上的下载任务数据条数为{}", uuid, downloadNotifys.size());
|
|
|
|
//log.info("[uuid:{}]查询华软中介服务上的下载任务数据条数为{}", uuid, downloadNotifys.size());
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-查询华软中介服务上的下载任务数据条数为" + downloadNotifys.size(), "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-查询华软中介服务上的下载任务数据条数为" + downloadNotifys.size(), "FtpDownloadServiceImpl");
|
|
|
|
if (downloadNotifys.size() == 0) {
|
|
|
|
if (downloadNotifys.size() == 0) {
|
|
|
|
//log.info("[uuid:{}]华软中介服务上无下载任务", uuid);
|
|
|
|
//log.info("[uuid:{}]华软中介服务上无下载任务", uuid);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-华软中介服务无下载任务", "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-华软中介服务无下载任务", "FtpDownloadServiceImpl");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
for (DownloadNotify downloadNotify : downloadNotifys) {
|
|
|
|
for (DownloadNotify downloadNotify : downloadNotifys) {
|
|
|
|
long start = System.currentTimeMillis();
|
|
|
|
long start = System.currentTimeMillis();
|
|
|
|
@ -123,19 +123,19 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
String ftpFilePath = domain1.replace(ftpUrl, Constant.NULL_STRING).replace(fileName, Constant.NULL_STRING);
|
|
|
|
String ftpFilePath = domain1.replace(ftpUrl, Constant.NULL_STRING).replace(fileName, Constant.NULL_STRING);
|
|
|
|
if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
|
|
|
|
if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
|
|
|
|
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
|
|
|
|
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType, "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType, "FtpDownloadServiceImpl");
|
|
|
|
boolean isDownload = false;
|
|
|
|
boolean isDownload = false;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
isDownload = FTPUtil.downloadFile(HRFtpIP, HRFtpUsername, HRPassword, Integer.parseInt(HRPort), ftpFilePath, localPath, fileName);
|
|
|
|
isDownload = FTPUtil.downloadFile(HRFtpIP, HRFtpUsername, HRPassword, Integer.parseInt(HRPort), ftpFilePath, localPath, fileName);
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
|
|
|
|
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName, "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName, "FtpDownloadServiceImpl");
|
|
|
|
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
|
|
|
|
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
|
|
|
|
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载耗时毫秒为" + (end - start), "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载耗时毫秒为" + (end - start), "FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
if (isDownload) {
|
|
|
|
if (isDownload) {
|
|
|
|
//校验md5
|
|
|
|
//校验md5
|
|
|
|
@ -143,21 +143,21 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为:{}", uuid, protocolType, id, tableName, md5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为:{}", uuid, protocolType, id, tableName, md5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为:{}", uuid, protocolType, id, tableName, downlMd5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为:{}", uuid, protocolType, id, tableName, downlMd5);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5,
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5,
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(downlMd5) || !md5.equals(downlMd5)) {
|
|
|
|
if (StringUtils.isBlank(downlMd5) || !md5.equals(downlMd5)) {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败",
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败",
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
|
|
|
|
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功",
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功",
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
//获取新的版本号
|
|
|
|
//获取新的版本号
|
|
|
|
String newVersion = StringUtil.getNewVersion(protocolType, version);
|
|
|
|
String newVersion = StringUtil.getNewVersion(protocolType, version);
|
|
|
|
//插入sqlite数据库任务表中
|
|
|
|
//插入sqlite数据库任务表中
|
|
|
|
@ -184,7 +184,7 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, sqliteInsert);
|
|
|
|
DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, sqliteInsert);
|
|
|
|
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{},protocolType为{}", uuid, id, protocolType);
|
|
|
|
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{},protocolType为{}", uuid, id, protocolType);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + id + "protocolType为" + protocolType,
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + id + "protocolType为" + protocolType,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -193,7 +193,7 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
|
|
|
|
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -213,7 +213,7 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void getMdMdTask(String uuid) {
|
|
|
|
public void getMdMdTask(String uuid) {
|
|
|
|
//log.info("[uuid:{}]开始查询迈道中介服务上的下载任务数据", uuid);
|
|
|
|
//log.info("[uuid:{}]开始查询迈道中介服务上的下载任务数据", uuid);
|
|
|
|
LogUtil.WriteLog_MDBlackCard("[uuid:" + uuid + "]-开始查询迈道中介服务上的下载任务数据", "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_MDBlackCard("[uuid:" + uuid + "]-开始查询迈道中介服务上的下载任务数据", "FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
//查询下载任务数据
|
|
|
|
//查询下载任务数据
|
|
|
|
List<ParamNotify> paramNotifyList = DatabaseUtil.selectParamNotify(driverName, MDConnectionStringOracle, MDOracleName, MDOraclePass, Constant.SELECT_T_PARAM_NOTIFY);
|
|
|
|
List<ParamNotify> paramNotifyList = DatabaseUtil.selectParamNotify(driverName, MDConnectionStringOracle, MDOracleName, MDOraclePass, Constant.SELECT_T_PARAM_NOTIFY);
|
|
|
|
@ -248,7 +248,7 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询{}", uuid, paramName, paramId + version, fileName, e.getMessage(), e);
|
|
|
|
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询{}", uuid, paramName, paramId + version, fileName, e.getMessage(), e);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件paramName为" + paramName + "paramId为" + paramId + "fileName" + fileName, "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件paramName为" + paramName + "paramId为" + paramId + "fileName" + fileName, "FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
@ -323,17 +323,17 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void getHrInsertDBTask(String uuid) {
|
|
|
|
public void getHrInsertDBTask(String uuid) {
|
|
|
|
//log.info("[uuid:{}]开始查询华软中介服务上的下载任务数据", uuid);
|
|
|
|
//log.info("[uuid:{}]开始查询华软中介服务上的下载任务数据", uuid);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-开始查询华软中介服务上的下载任务数据", "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-开始查询华软中介服务上的下载任务数据", "FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
//查询下载任务数据
|
|
|
|
//查询下载任务数据
|
|
|
|
List<DownloadNotify> downloadNotifys = DatabaseUtil.selectDownloadNotify(driverName, HRConnectionStringOracle, HROracleName, HROraclePass, Constant.SELECT_TF_DOWNLOAD_NOTIFY_INSERT_DB);
|
|
|
|
List<DownloadNotify> downloadNotifys = DatabaseUtil.selectDownloadNotify(driverName, HRConnectionStringOracle, HROracleName, HROraclePass, Constant.SELECT_TF_DOWNLOAD_NOTIFY_INSERT_DB);
|
|
|
|
String localPath = NFSFilePath + PathUtil.downFile;
|
|
|
|
String localPath = NFSFilePath + PathUtil.downFile;
|
|
|
|
FileUtil.fileCreat(localPath);
|
|
|
|
FileUtil.fileCreat(localPath);
|
|
|
|
//log.info("[uuid:{}]查询华软中介服务上的下载任务数据条数为{}", uuid, downloadNotifys.size());
|
|
|
|
//log.info("[uuid:{}]查询华软中介服务上的下载任务数据条数为{}", uuid, downloadNotifys.size());
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-查询华软中介服务上的下载任务数据条数为" + downloadNotifys.size(), "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-查询华软中介服务上的下载任务数据条数为" + downloadNotifys.size(), "FtpDownloadServiceImpl");
|
|
|
|
if (downloadNotifys.size() == 0) {
|
|
|
|
if (downloadNotifys.size() == 0) {
|
|
|
|
//log.info("[uuid:{}]华软中介服务上无下载任务", uuid);
|
|
|
|
//log.info("[uuid:{}]华软中介服务上无下载任务", uuid);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-华软中介服务无下载任务", "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-华软中介服务无下载任务", "FtpDownloadServiceImpl");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
for (DownloadNotify downloadNotify : downloadNotifys) {
|
|
|
|
for (DownloadNotify downloadNotify : downloadNotifys) {
|
|
|
|
long start = System.currentTimeMillis();
|
|
|
|
long start = System.currentTimeMillis();
|
|
|
|
@ -356,19 +356,19 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
String ftpFilePath = domain1.replace(ftpUrl, Constant.NULL_STRING).replace(fileName, Constant.NULL_STRING);
|
|
|
|
String ftpFilePath = domain1.replace(ftpUrl, Constant.NULL_STRING).replace(fileName, Constant.NULL_STRING);
|
|
|
|
if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
|
|
|
|
if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
|
|
|
|
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
|
|
|
|
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType, "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType, "FtpDownloadServiceImpl");
|
|
|
|
boolean isDownload = false;
|
|
|
|
boolean isDownload = false;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
isDownload = FTPUtil.downloadFile(HRFtpIP, HRFtpUsername, HRPassword, Integer.parseInt(HRPort), ftpFilePath, localPath, fileName);
|
|
|
|
isDownload = FTPUtil.downloadFile(HRFtpIP, HRFtpUsername, HRPassword, Integer.parseInt(HRPort), ftpFilePath, localPath, fileName);
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
|
|
|
|
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName, "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName, "FtpDownloadServiceImpl");
|
|
|
|
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
|
|
|
|
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
|
|
|
|
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载耗时毫秒为" + (end - start), "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载耗时毫秒为" + (end - start), "FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
if (isDownload) {
|
|
|
|
if (isDownload) {
|
|
|
|
//校验md5
|
|
|
|
//校验md5
|
|
|
|
@ -376,21 +376,21 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为:{}", uuid, protocolType, id, tableName, md5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为:{}", uuid, protocolType, id, tableName, md5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为:{}", uuid, protocolType, id, tableName, downlMd5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为:{}", uuid, protocolType, id, tableName, downlMd5);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5,
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5,
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(downlMd5) || !md5.equals(downlMd5)) {
|
|
|
|
if (StringUtils.isBlank(downlMd5) || !md5.equals(downlMd5)) {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败",
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败",
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
|
|
|
|
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功",
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功",
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
//获取新的版本号
|
|
|
|
//获取新的版本号
|
|
|
|
String newVersion = StringUtil.getNewVersion(protocolType, version);
|
|
|
|
String newVersion = StringUtil.getNewVersion(protocolType, version);
|
|
|
|
//插入sqlite数据库任务表中
|
|
|
|
//插入sqlite数据库任务表中
|
|
|
|
@ -417,7 +417,7 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, sqliteInsert);
|
|
|
|
DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, sqliteInsert);
|
|
|
|
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{},protocolType为{}", uuid, id, protocolType);
|
|
|
|
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{},protocolType为{}", uuid, id, protocolType);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + id + "protocolType为" + protocolType,
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + id + "protocolType为" + protocolType,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -426,7 +426,7 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
|
|
|
|
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
|
|
|
|
LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -445,17 +445,17 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void getHr241InsertDBTask(String uuid) {
|
|
|
|
public void getHr241InsertDBTask(String uuid) {
|
|
|
|
//log.info("[uuid:{}]开始查询华软中介服务上的下载任务数据", uuid);
|
|
|
|
//log.info("[uuid:{}]开始查询华软中介服务上的下载任务数据", uuid);
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-开始查询华软中介服务上的下载任务数据", "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-开始查询华软中介服务上的下载任务数据", "FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
//查询下载任务数据
|
|
|
|
//查询下载任务数据
|
|
|
|
List<DownloadNotify> downloadNotifys = DatabaseUtil.selectDownloadNotify(driverName, HRConnectionStringOracle, HROracleName, HROraclePass, Constant.SELECT_TF_DOWNLOAD_NOTIFY_INSERT_DB_241);
|
|
|
|
List<DownloadNotify> downloadNotifys = DatabaseUtil.selectDownloadNotify(driverName, HRConnectionStringOracle, HROracleName, HROraclePass, Constant.SELECT_TF_DOWNLOAD_NOTIFY_INSERT_DB_241);
|
|
|
|
String localPath = NFSFilePath + PathUtil.downFile;
|
|
|
|
String localPath = NFSFilePath + PathUtil.downFile;
|
|
|
|
FileUtil.fileCreat(localPath);
|
|
|
|
FileUtil.fileCreat(localPath);
|
|
|
|
//log.info("[uuid:{}]查询华软中介服务上的下载任务数据条数为{}", uuid, downloadNotifys.size());
|
|
|
|
//log.info("[uuid:{}]查询华软中介服务上的下载任务数据条数为{}", uuid, downloadNotifys.size());
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-查询华软中介服务上的下载任务数据条数为" + downloadNotifys.size(), "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-查询华软中介服务上的下载任务数据条数为" + downloadNotifys.size(), "FtpDownloadServiceImpl");
|
|
|
|
if (downloadNotifys.size() == 0) {
|
|
|
|
if (downloadNotifys.size() == 0) {
|
|
|
|
//log.info("[uuid:{}]华软中介服务上无下载任务", uuid);
|
|
|
|
//log.info("[uuid:{}]华软中介服务上无下载任务", uuid);
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-华软中介服务无下载任务", "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-华软中介服务无下载任务", "FtpDownloadServiceImpl");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
for (DownloadNotify downloadNotify : downloadNotifys) {
|
|
|
|
for (DownloadNotify downloadNotify : downloadNotifys) {
|
|
|
|
long start = System.currentTimeMillis();
|
|
|
|
long start = System.currentTimeMillis();
|
|
|
|
@ -478,19 +478,19 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
String ftpFilePath = domain1.replace(ftpUrl, Constant.NULL_STRING).replace(fileName, Constant.NULL_STRING);
|
|
|
|
String ftpFilePath = domain1.replace(ftpUrl, Constant.NULL_STRING).replace(fileName, Constant.NULL_STRING);
|
|
|
|
if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
|
|
|
|
if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
|
|
|
|
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
|
|
|
|
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType, "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType, "FtpDownloadServiceImpl");
|
|
|
|
boolean isDownload = false;
|
|
|
|
boolean isDownload = false;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
isDownload = FTPUtil.downloadFile(HRFtpIP, HRFtpUsername, HRPassword, Integer.parseInt(HRPort), ftpFilePath, localPath, fileName);
|
|
|
|
isDownload = FTPUtil.downloadFile(HRFtpIP, HRFtpUsername, HRPassword, Integer.parseInt(HRPort), ftpFilePath, localPath, fileName);
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
|
|
|
|
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName, "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName, "FtpDownloadServiceImpl");
|
|
|
|
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
|
|
|
|
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
|
|
|
|
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载耗时毫秒为" + (end - start), "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载耗时毫秒为" + (end - start), "FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
if (isDownload) {
|
|
|
|
if (isDownload) {
|
|
|
|
//校验md5
|
|
|
|
//校验md5
|
|
|
|
@ -498,21 +498,21 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为:{}", uuid, protocolType, id, tableName, md5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为:{}", uuid, protocolType, id, tableName, md5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为:{}", uuid, protocolType, id, tableName, downlMd5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为:{}", uuid, protocolType, id, tableName, downlMd5);
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5,
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5,
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(downlMd5) || !md5.equals(downlMd5)) {
|
|
|
|
if (StringUtils.isBlank(downlMd5) || !md5.equals(downlMd5)) {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败",
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败",
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
|
|
|
|
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功",
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功",
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
//获取新的版本号
|
|
|
|
//获取新的版本号
|
|
|
|
String newVersion = StringUtil.getNewVersion(protocolType, version);
|
|
|
|
String newVersion = StringUtil.getNewVersion(protocolType, version);
|
|
|
|
//插入sqlite数据库任务表中
|
|
|
|
//插入sqlite数据库任务表中
|
|
|
|
@ -539,7 +539,7 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, sqliteInsert);
|
|
|
|
DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, sqliteInsert);
|
|
|
|
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{},protocolType为{}", uuid, id, protocolType);
|
|
|
|
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{},protocolType为{}", uuid, id, protocolType);
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + id + "protocolType为" + protocolType,
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + id + "protocolType为" + protocolType,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -548,7 +548,7 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
|
|
|
|
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
|
|
|
|
LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -558,17 +558,17 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void getHr242InsertDBTask(String uuid) {
|
|
|
|
public void getHr242InsertDBTask(String uuid) {
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-开始查询华软中介服务上的下载任务数据", "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-开始查询华软中介服务上的下载任务数据", "FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
//查询下载任务数据
|
|
|
|
//查询下载任务数据
|
|
|
|
List<DownloadNotify> downloadNotifys = DatabaseUtil.selectDownloadNotify(driverName, HRConnectionStringOracle, HROracleName, HROraclePass, Constant.SELECT_TF_DOWNLOAD_NOTIFY_INSERT_DB_242);
|
|
|
|
List<DownloadNotify> downloadNotifys = DatabaseUtil.selectDownloadNotify(driverName, HRConnectionStringOracle, HROracleName, HROraclePass, Constant.SELECT_TF_DOWNLOAD_NOTIFY_INSERT_DB_242);
|
|
|
|
String localPath = NFSFilePath + PathUtil.downFile;
|
|
|
|
String localPath = NFSFilePath + PathUtil.downFile;
|
|
|
|
FileUtil.fileCreat(localPath);
|
|
|
|
FileUtil.fileCreat(localPath);
|
|
|
|
//log.info("[uuid:{}]查询华软中介服务上的下载任务数据条数为{}", uuid, downloadNotifys.size());
|
|
|
|
//log.info("[uuid:{}]查询华软中介服务上的下载任务数据条数为{}", uuid, downloadNotifys.size());
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-查询华软中介服务上的下载任务数据条数为" + downloadNotifys.size(), "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-查询华软中介服务上的下载任务数据条数为" + downloadNotifys.size(), "FtpDownloadServiceImpl");
|
|
|
|
if (downloadNotifys.size() == 0) {
|
|
|
|
if (downloadNotifys.size() == 0) {
|
|
|
|
//log.info("[uuid:{}]华软中介服务上无下载任务", uuid);
|
|
|
|
//log.info("[uuid:{}]华软中介服务上无下载任务", uuid);
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-华软中介服务无下载任务", "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-华软中介服务无下载任务", "FtpDownloadServiceImpl");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
for (DownloadNotify downloadNotify : downloadNotifys) {
|
|
|
|
for (DownloadNotify downloadNotify : downloadNotifys) {
|
|
|
|
long start = System.currentTimeMillis();
|
|
|
|
long start = System.currentTimeMillis();
|
|
|
|
@ -591,19 +591,19 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
String ftpFilePath = domain1.replace(ftpUrl, Constant.NULL_STRING).replace(fileName, Constant.NULL_STRING);
|
|
|
|
String ftpFilePath = domain1.replace(ftpUrl, Constant.NULL_STRING).replace(fileName, Constant.NULL_STRING);
|
|
|
|
if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
|
|
|
|
if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
|
|
|
|
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
|
|
|
|
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType, "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType, "FtpDownloadServiceImpl");
|
|
|
|
boolean isDownload = false;
|
|
|
|
boolean isDownload = false;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
isDownload = FTPUtil.downloadFile(HRFtpIP, HRFtpUsername, HRPassword, Integer.parseInt(HRPort), ftpFilePath, localPath, fileName);
|
|
|
|
isDownload = FTPUtil.downloadFile(HRFtpIP, HRFtpUsername, HRPassword, Integer.parseInt(HRPort), ftpFilePath, localPath, fileName);
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
|
|
|
|
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName, "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName, "FtpDownloadServiceImpl");
|
|
|
|
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
|
|
|
|
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
|
|
|
|
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载耗时毫秒为" + (end - start), "FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载耗时毫秒为" + (end - start), "FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
if (isDownload) {
|
|
|
|
if (isDownload) {
|
|
|
|
//校验md5
|
|
|
|
//校验md5
|
|
|
|
@ -611,21 +611,21 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为:{}", uuid, protocolType, id, tableName, md5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为:{}", uuid, protocolType, id, tableName, md5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为:{}", uuid, protocolType, id, tableName, downlMd5);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为:{}", uuid, protocolType, id, tableName, downlMd5);
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5,
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5,
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(downlMd5) || !md5.equals(downlMd5)) {
|
|
|
|
if (StringUtils.isBlank(downlMd5) || !md5.equals(downlMd5)) {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败",
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败",
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
|
|
|
|
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
|
|
|
|
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功",
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功",
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
//获取新的版本号
|
|
|
|
//获取新的版本号
|
|
|
|
String newVersion = StringUtil.getNewVersion(protocolType, version);
|
|
|
|
String newVersion = StringUtil.getNewVersion(protocolType, version);
|
|
|
|
//插入sqlite数据库任务表中
|
|
|
|
//插入sqlite数据库任务表中
|
|
|
|
@ -652,7 +652,7 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, sqliteInsert);
|
|
|
|
DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, sqliteInsert);
|
|
|
|
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{},protocolType为{}", uuid, id, protocolType);
|
|
|
|
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{},protocolType为{}", uuid, id, protocolType);
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + id + "protocolType为" + protocolType,
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + id + "protocolType为" + protocolType,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -661,7 +661,7 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
|
|
|
|
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
|
|
|
|
LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
|
|
|
|
"FtpDownloadServiceImpl-getHrMdTask");
|
|
|
|
"FtpDownloadServiceImpl");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|