@ -114,88 +114,89 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
String domain1 = downloadNotify . getDOMAIN1 ( ) ;
String md5 = downloadNotify . getDOMAIN2 ( ) . trim ( ) ;
//先查询sqlite库中是否存在已下载的文件
String sql = Constant . SELECT_BUSINESS_BY_ID + id ;
List < BusinessTasks > businessTasks = DatabaseUtil . selectBusines ( sqliteDriverName , sqliteUrl , sql ) ;
//String sql = Constant.SELECT_BUSINESS_BY_ID + id;
//List<BusinessTasks> businessTasks = DatabaseUtil.selectBusines(sqliteDriverName, sqliteUrl, sql);
//构建Ftp下载文件
String ftpUrl = Constant . FTP_PREFIX + HRFtpIP + Constant . STR_COLON + HRPort + Constant . STR_SLASH ;
String fileName = domain1 . substring ( domain1 . lastIndexOf ( "/" ) + 1 ) ;
String ftpFilePath = domain1 . replace ( ftpUrl , Constant . NULL_STRING ) . replace ( fileName , Constant . NULL_STRING ) ;
if ( businessTasks . size ( ) = = 0 | | ! FileUtil . fileExists ( localPath + fileName ) ) {
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType , "FtpDownloadServiceImpl" ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( HRFtpIP , HRFtpUsername , HRPassword , Integer . parseInt ( HRPort ) , ftpFilePath , localPath , fileName ) ;
} catch ( Exception e ) {
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName , "FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
}
long end = System . currentTimeMillis ( ) ;
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载耗时毫秒为" + ( end - start ) , "FtpDownloadServiceImpl" ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为: {}", uuid, protocolType, id, tableName, md5);
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为: {}", uuid, protocolType, id, tableName, downlMd5);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5 ,
//if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
//if (!FileUtil.fileExists(localPath + fileName)) {
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType , "FtpDownloadServiceImpl" ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( HRFtpIP , HRFtpUsername , HRPassword , Integer . parseInt ( HRPort ) , ftpFilePath , localPath , fileName ) ;
} catch ( Exception e ) {
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName , "FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
}
long end = System . currentTimeMillis ( ) ;
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载耗时毫秒为" + ( end - start ) , "FtpDownloadServiceImpl" ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为: {}", uuid, protocolType, id, tableName, md5);
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为: {}", uuid, protocolType, id, tableName, downlMd5);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5 ,
"FtpDownloadServiceImpl" ) ;
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5 ,
"FtpDownloadServiceImpl" ) ;
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败" ,
"FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功" ,
"FtpDownloadServiceImpl" ) ;
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5 ,
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( protocolType , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( id ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( fileCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( protocolType ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( protocolType ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 1 ) ;
//办理状态 0-未处理 1-已处理 2-再次轮询处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( downloadNotify . getCREATETIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
//if (businessTasks.size() == 0) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//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 ,
"FtpDownloadServiceImpl" ) ;
//}
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败" ,
"FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功" ,
"FtpDownloadServiceImpl" ) ;
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( protocolType , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( id ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( fileCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( protocolType ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( protocolType ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 1 ) ;
//办理状态 0-未处理 1-已处理 2-再次轮询处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( downloadNotify . getCREATETIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
if ( businessTasks . size ( ) = = 0 ) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//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 ,
"FtpDownloadServiceImpl" ) ;
}
}
}
} else {
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id ,
"FtpDownloadServiceImpl" ) ;
}
//} else {
// //log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
// LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
// "FtpDownloadServiceImpl");
//}
}
@ -239,78 +240,78 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
//FileUtil.delFile(new File(localPath+fileName));
//先查询sqlite库中是否存在已下载的文件
String sql = Constant . SELECT_BUSINESS_BY_ID + paramId + version ;
List < BusinessTasks > businessTasks = DatabaseUtil . selectBusines ( sqliteDriverName , sqliteUrl , sql ) ;
if ( businessTasks . size ( ) = = 0 ) {
long start = System . currentTimeMillis ( ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( MDFtpIP , MDFtpUsername , MDPassword , Integer . parseInt ( MDPort ) , ftpFilePath , localPath , fileName ) ;
} catch ( Exception 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" ) ;
//String sql = Constant.SELECT_BUSINESS_BY_ID + paramId + version;
//List<BusinessTasks> businessTasks = DatabaseUtil.selectBusines(sqliteDriverName, sqliteUrl, sql);
//if (!FileUtil.fileExists(localPath + fileName)) {
long start = System . currentTimeMillis ( ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( MDFtpIP , MDFtpUsername , MDPassword , Integer . parseInt ( MDPort ) , ftpFilePath , localPath , fileName ) ;
}
long end = System . currentTimeMillis ( ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]-下载zip文件({}){},原MD5值为: {}", uuid, paramId, fileName, md5);
//log.info("[uuid:{}]-下载zip文件({}){},下载的MD5值为: {}", uuid, paramId, fileName, downlMd5);
LogUtil . WriteLog_MDBlackCard ( "[uuid:" + uuid + "]-下载zip文件paramName为" + paramName + "paramId为" + paramId + "fileName" + fileName + "原MD5值为" + md5 ,
} catch ( Exception 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" ) ;
}
long end = System . currentTimeMillis ( ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]-下载zip文件({}){},原MD5值为: {}", uuid, paramId, fileName, md5);
//log.info("[uuid:{}]-下载zip文件({}){},下载的MD5值为: {}", uuid, paramId, fileName, downlMd5);
LogUtil . WriteLog_MDBlackCard ( "[uuid:" + uuid + "]-下载zip文件paramName为" + paramName + "paramId为" + paramId + "fileName" + fileName + "原MD5值为" + md5 ,
"FtpDownloadServiceImpl-getMdMdTask" ) ;
LogUtil . WriteLog_MDBlackCard ( "[uuid:" + uuid + "]-下载zip文件paramName为" + paramName + "paramId为" + paramId + "fileName" + fileName + "下载的MD5值为" + downlMd5 ,
"FtpDownloadServiceImpl-getMdMdTask" ) ;
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, paramName, paramId, fileName);
LogUtil . WriteLog_MDBlackCard ( "[uuid:" + uuid + "]-下载zip文件paramName为" + paramName + "paramId为" + paramId + "fileName" + fileName + "MD5校验失败" ,
"FtpDownloadServiceImpl-getMdMdTask" ) ;
LogUtil . WriteLog_MDBlackCard ( "[uuid:" + uuid + "]-下载zip文件paramName为" + paramName + "paramId为" + paramId + "fileName" + fileName + "下载的MD5值为" + downlMd5 ,
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, paramName, paramId, fileName);
LogUtil . WriteLog_MDBlackCard ( "[uuid:" + uuid + "]-下载zip文件paramName为" + paramName + "paramId为" + paramId + "fileName" + fileName + "MD5校验成功" ,
"FtpDownloadServiceImpl-getMdMdTask" ) ;
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( paramId + Constant . STR_01 , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( paramId + version ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( recordCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( paramId + Constant . STR_01 ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( paramId ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 2 ) ;
//办理状态 0-未处理 1-已处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( paramNotify . getCREATE_TIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
//if (businessTasks.size() == 0) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{}, protocolType为{}", uuid, paramId + version, paramId);
LogUtil . WriteLog_MDBlackCard ( "[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + paramId + version + "protocolType为" + paramId ,
"FtpDownloadServiceImpl-getMdMdTask" ) ;
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, paramName, paramId, fileName);
LogUtil . WriteLog_MDBlackCard ( "[uuid:" + uuid + "]-下载zip文件paramName为" + paramName + "paramId为" + paramId + "fileName" + fileName + "MD5校验失败" ,
"FtpDownloadServiceImpl-getMdMdTask" ) ;
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, paramName, paramId, fileName);
LogUtil . WriteLog_MDBlackCard ( "[uuid:" + uuid + "]-下载zip文件paramName为" + paramName + "paramId为" + paramId + "fileName" + fileName + "MD5校验成功" ,
"FtpDownloadServiceImpl-getMdMdTask" ) ;
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( paramId + Constant . STR_01 , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( paramId + version ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( recordCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( paramId + Constant . STR_01 ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( paramId ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 2 ) ;
//办理状态 0-未处理 1-已处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( paramNotify . getCREATE_TIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
if ( businessTasks . size ( ) = = 0 ) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{}, protocolType为{}", uuid, paramId + version, paramId);
LogUtil . WriteLog_MDBlackCard ( "[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + paramId + version + "protocolType为" + paramId ,
"FtpDownloadServiceImpl-getMdMdTask" ) ;
}
}
//}
}
} else {
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录,无需下载,跳过下载执行后面的处理程序,id为{}", uuid, paramId);
LogUtil . WriteLog_MDBlackCard ( "[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + paramId ,
"FtpDownloadServiceImpl-getMdMdTask" ) ;
}
//} else {
// //log.info("[uuid:{}]sqlite数据库中已存在下载的记录,无需下载,跳过下载执行后面的处理程序,id为{}", uuid, paramId);
// LogUtil.WriteLog_MDBlackCard("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + paramId,
// "FtpDownloadServiceImpl-getMdMdTask");
//}
}
}
@ -350,88 +351,89 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
String domain1 = downloadNotify . getDOMAIN1 ( ) ;
String md5 = downloadNotify . getDOMAIN2 ( ) . trim ( ) ;
//先查询sqlite库中是否存在已下载的文件
String sql = Constant . SELECT_BUSINESS_BY_ID + id ;
List < BusinessTasks > businessTasks = DatabaseUtil . selectBusines ( sqliteDriverName , sqliteUrl , sql ) ;
//String sql = Constant.SELECT_BUSINESS_BY_ID + id;
//List<BusinessTasks> businessTasks = DatabaseUtil.selectBusines(sqliteDriverName, sqliteUrl, sql);
//构建Ftp下载文件
String ftpUrl = Constant . FTP_PREFIX + HRFtpIP + Constant . STR_COLON + HRPort + Constant . STR_SLASH ;
String fileName = domain1 . substring ( domain1 . lastIndexOf ( "/" ) + 1 ) ;
String ftpFilePath = domain1 . replace ( ftpUrl , Constant . NULL_STRING ) . replace ( fileName , Constant . NULL_STRING ) ;
if ( businessTasks . size ( ) = = 0 | | ! FileUtil . fileExists ( localPath + fileName ) ) {
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType , "FtpDownloadServiceImpl" ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( HRFtpIP , HRFtpUsername , HRPassword , Integer . parseInt ( HRPort ) , ftpFilePath , localPath , fileName ) ;
} catch ( Exception e ) {
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName , "FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
}
long end = System . currentTimeMillis ( ) ;
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载耗时毫秒为" + ( end - start ) , "FtpDownloadServiceImpl" ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为: {}", uuid, protocolType, id, tableName, md5);
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为: {}", uuid, protocolType, id, tableName, downlMd5);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5 ,
//if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
//if (!FileUtil.fileExists(localPath + fileName)) {
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType , "FtpDownloadServiceImpl" ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( HRFtpIP , HRFtpUsername , HRPassword , Integer . parseInt ( HRPort ) , ftpFilePath , localPath , fileName ) ;
} catch ( Exception e ) {
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName , "FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
}
long end = System . currentTimeMillis ( ) ;
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载耗时毫秒为" + ( end - start ) , "FtpDownloadServiceImpl" ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为: {}", uuid, protocolType, id, tableName, md5);
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为: {}", uuid, protocolType, id, tableName, downlMd5);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5 ,
"FtpDownloadServiceImpl" ) ;
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5 ,
"FtpDownloadServiceImpl" ) ;
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败" ,
"FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功" ,
"FtpDownloadServiceImpl" ) ;
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5 ,
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( protocolType , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( id ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( fileCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( protocolType ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( protocolType ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 1 ) ;
//办理状态 0-未处理 1-已处理 2-再次轮询处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( downloadNotify . getCREATETIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
//if (businessTasks.size() == 0) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//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 ,
"FtpDownloadServiceImpl" ) ;
//}
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败" ,
"FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功" ,
"FtpDownloadServiceImpl" ) ;
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( protocolType , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( id ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( fileCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( protocolType ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( protocolType ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 1 ) ;
//办理状态 0-未处理 1-已处理 2-再次轮询处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( downloadNotify . getCREATETIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
if ( businessTasks . size ( ) = = 0 ) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//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 ,
"FtpDownloadServiceImpl" ) ;
}
}
}
} else {
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
LogUtil . WriteLog_HRZipDownloadFile ( "[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id ,
"FtpDownloadServiceImpl" ) ;
}
//} else {
// //log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
// LogUtil.WriteLog_HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
// "FtpDownloadServiceImpl");
//}
}
@ -473,88 +475,88 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
String domain1 = downloadNotify . getDOMAIN1 ( ) ;
String md5 = downloadNotify . getDOMAIN2 ( ) . trim ( ) ;
//先查询sqlite库中是否存在已下载的文件
String sql = Constant . SELECT_BUSINESS_BY_ID + id ;
List < BusinessTasks > businessTasks = DatabaseUtil . selectBusines ( sqliteDriverName , sqliteUrl , sql ) ;
//String sql = Constant.SELECT_BUSINESS_BY_ID + id;
//List<BusinessTasks> businessTasks = DatabaseUtil.selectBusines(sqliteDriverName, sqliteUrl, sql);
//构建Ftp下载文件
String ftpUrl = Constant . FTP_PREFIX + HRFtpIP + Constant . STR_COLON + HRPort + Constant . STR_SLASH ;
String fileName = domain1 . substring ( domain1 . lastIndexOf ( "/" ) + 1 ) ;
String ftpFilePath = domain1 . replace ( ftpUrl , Constant . NULL_STRING ) . replace ( fileName , Constant . NULL_STRING ) ;
if ( businessTasks . size ( ) = = 0 | | ! FileUtil . fileExists ( localPath + fileName ) ) {
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType , "FtpDownloadServiceImpl" ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( HRFtpIP , HRFtpUsername , HRPassword , Integer . parseInt ( HRPort ) , ftpFilePath , localPath , fileName ) ;
} catch ( Exception e ) {
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName , "FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
}
long end = System . currentTimeMillis ( ) ;
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载耗时毫秒为" + ( end - start ) , "FtpDownloadServiceImpl" ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为: {}", uuid, protocolType, id, tableName, md5);
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为: {}", uuid, protocolType, id, tableName, downlMd5);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5 ,
//if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType , "FtpDownloadServiceImpl" ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( HRFtpIP , HRFtpUsername , HRPassword , Integer . parseInt ( HRPort ) , ftpFilePath , localPath , fileName ) ;
} catch ( Exception e ) {
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName , "FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
}
long end = System . currentTimeMillis ( ) ;
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载耗时毫秒为" + ( end - start ) , "FtpDownloadServiceImpl" ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为: {}", uuid, protocolType, id, tableName, md5);
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为: {}", uuid, protocolType, id, tableName, downlMd5);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5 ,
"FtpDownloadServiceImpl" ) ;
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5 ,
"FtpDownloadServiceImpl" ) ;
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败" ,
"FtpDownloadServiceImpl" ) ;
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5 ,
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功" ,
"FtpDownloadServiceImpl" ) ;
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( protocolType , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( id ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( fileCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( protocolType ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( protocolType ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 1 ) ;
//办理状态 0-未处理 1-已处理 2-再次轮询处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( downloadNotify . getCREATETIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
//if (businessTasks.size() == 0) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//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 ,
"FtpDownloadServiceImpl" ) ;
//}
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败" ,
"FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功" ,
"FtpDownloadServiceImpl" ) ;
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( protocolType , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( id ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( fileCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( protocolType ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( protocolType ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 1 ) ;
//办理状态 0-未处理 1-已处理 2-再次轮询处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( downloadNotify . getCREATETIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
if ( businessTasks . size ( ) = = 0 ) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//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 ,
"FtpDownloadServiceImpl" ) ;
}
}
}
} else {
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
LogUtil . WriteLog_241HRZipDownloadFile ( "[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id ,
"FtpDownloadServiceImpl" ) ;
}
//} else {
// //log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
// LogUtil.WriteLog_241HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
// "FtpDownloadServiceImpl");
//}
}
@ -587,88 +589,88 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
String domain1 = downloadNotify . getDOMAIN1 ( ) ;
String md5 = downloadNotify . getDOMAIN2 ( ) . trim ( ) ;
//先查询sqlite库中是否存在已下载的文件
String sql = Constant . SELECT_BUSINESS_BY_ID + id ;
List < BusinessTasks > businessTasks = DatabaseUtil . selectBusines ( sqliteDriverName , sqliteUrl , sql ) ;
//String sql = Constant.SELECT_BUSINESS_BY_ID + id;
//List<BusinessTasks> businessTasks = DatabaseUtil.selectBusines(sqliteDriverName, sqliteUrl, sql);
//构建Ftp下载文件
String ftpUrl = Constant . FTP_PREFIX + HRFtpIP + Constant . STR_COLON + HRPort + Constant . STR_SLASH ;
String fileName = domain1 . substring ( domain1 . lastIndexOf ( "/" ) + 1 ) ;
String ftpFilePath = domain1 . replace ( ftpUrl , Constant . NULL_STRING ) . replace ( fileName , Constant . NULL_STRING ) ;
if ( businessTasks . size ( ) = = 0 | | ! FileUtil . fileExists ( localPath + fileName ) ) {
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType , "FtpDownloadServiceImpl" ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( HRFtpIP , HRFtpUsername , HRPassword , Integer . parseInt ( HRPort ) , ftpFilePath , localPath , fileName ) ;
} catch ( Exception e ) {
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName , "FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
}
long end = System . currentTimeMillis ( ) ;
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载耗时毫秒为" + ( end - start ) , "FtpDownloadServiceImpl" ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为: {}", uuid, protocolType, id, tableName, md5);
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为: {}", uuid, protocolType, id, tableName, downlMd5);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5 ,
//if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType , "FtpDownloadServiceImpl" ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( HRFtpIP , HRFtpUsername , HRPassword , Integer . parseInt ( HRPort ) , ftpFilePath , localPath , fileName ) ;
} catch ( Exception e ) {
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName , "FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
}
long end = System . currentTimeMillis ( ) ;
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载耗时毫秒为" + ( end - start ) , "FtpDownloadServiceImpl" ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为: {}", uuid, protocolType, id, tableName, md5);
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为: {}", uuid, protocolType, id, tableName, downlMd5);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5 ,
"FtpDownloadServiceImpl" ) ;
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5 ,
"FtpDownloadServiceImpl" ) ;
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败" ,
"FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功" ,
"FtpDownloadServiceImpl" ) ;
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5 ,
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( protocolType , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( id ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( fileCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( protocolType ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( protocolType ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 1 ) ;
//办理状态 0-未处理 1-已处理 2-再次轮询处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( downloadNotify . getCREATETIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
//if (businessTasks.size() == 0) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//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 ,
"FtpDownloadServiceImpl" ) ;
//}
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败" ,
"FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功" ,
"FtpDownloadServiceImpl" ) ;
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( protocolType , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( id ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( fileCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( protocolType ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( protocolType ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 1 ) ;
//办理状态 0-未处理 1-已处理 2-再次轮询处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( downloadNotify . getCREATETIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
if ( businessTasks . size ( ) = = 0 ) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//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 ,
"FtpDownloadServiceImpl" ) ;
}
}
}
} else {
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
LogUtil . WriteLog_242HRZipDownloadFile ( "[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id ,
"FtpDownloadServiceImpl" ) ;
}
//} else {
// //log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
// LogUtil.WriteLog_242HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
// "FtpDownloadServiceImpl");
//}
}
@ -701,88 +703,88 @@ public class FtpDownloadServiceImpl implements FtpDownloadService {
String domain1 = downloadNotify . getDOMAIN1 ( ) ;
String md5 = downloadNotify . getDOMAIN2 ( ) . trim ( ) ;
//先查询sqlite库中是否存在已下载的文件
String sql = Constant . SELECT_BUSINESS_BY_ID + id ;
List < BusinessTasks > businessTasks = DatabaseUtil . selectBusines ( sqliteDriverName , sqliteUrl , sql ) ;
//String sql = Constant.SELECT_BUSINESS_BY_ID + id;
//List<BusinessTasks> businessTasks = DatabaseUtil.selectBusines(sqliteDriverName, sqliteUrl, sql);
//构建Ftp下载文件
String ftpUrl = Constant . FTP_PREFIX + HRFtpIP + Constant . STR_COLON + HRPort + Constant . STR_SLASH ;
String fileName = domain1 . substring ( domain1 . lastIndexOf ( "/" ) + 1 ) ;
String ftpFilePath = domain1 . replace ( ftpUrl , Constant . NULL_STRING ) . replace ( fileName , Constant . NULL_STRING ) ;
if ( businessTasks . size ( ) = = 0 | | ! FileUtil . fileExists ( localPath + fileName ) ) {
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType , "FtpDownloadServiceImpl" ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( HRFtpIP , HRFtpUsername , HRPassword , Integer . parseInt ( HRPort ) , ftpFilePath , localPath , fileName ) ;
} catch ( Exception e ) {
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName , "FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
}
long end = System . currentTimeMillis ( ) ;
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载耗时毫秒为" + ( end - start ) , "FtpDownloadServiceImpl" ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为: {}", uuid, protocolType, id, tableName, md5);
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为: {}", uuid, protocolType, id, tableName, downlMd5);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5 ,
//if (businessTasks.size() == 0 || !FileUtil.fileExists(localPath + fileName)) {
//log.info("[uuid:{}]开始下载华软中介服务上的任务数据,protocolType为{}", uuid, protocolType);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-开始下载华软中介服务上的任务数据,protocolType为" + protocolType , "FtpDownloadServiceImpl" ) ;
boolean isDownload = false ;
try {
isDownload = FTPUtil . downloadFile ( HRFtpIP , HRFtpUsername , HRPassword , Integer . parseInt ( HRPort ) , ftpFilePath , localPath , fileName ) ;
} catch ( Exception e ) {
//log.error("[uuid:{}]{}-下载zip文件({}){}失败,等待下次轮询", uuid, protocolType, id, tableName);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName , "FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.FTP文件下载失败.getCode(), MessageEnum.FTP文件下载失败.getMessage());
}
long end = System . currentTimeMillis ( ) ;
//log.info("[uuid:{}]下载耗时:{}毫秒", uuid, end - start);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载耗时毫秒为" + ( end - start ) , "FtpDownloadServiceImpl" ) ;
if ( isDownload ) {
//校验md5
String downlMd5 = MD5Util . getMd5ByFilePath ( localPath + fileName ) ;
//log.info("[uuid:{}]{}-下载zip文件({}){},原MD5值为: {}", uuid, protocolType, id, tableName, md5);
//log.info("[uuid:{}]{}-下载zip文件({}){},下载的MD5值为: {}", uuid, protocolType, id, tableName, downlMd5);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "原MD5值为" + md5 ,
"FtpDownloadServiceImpl" ) ;
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5 ,
"FtpDownloadServiceImpl" ) ;
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败" ,
"FtpDownloadServiceImpl" ) ;
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "下载的MD5值为" + downlMd5 ,
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功" ,
"FtpDownloadServiceImpl" ) ;
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( protocolType , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( id ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( fileCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( protocolType ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( protocolType ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 1 ) ;
//办理状态 0-未处理 1-已处理 2-再次轮询处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( downloadNotify . getCREATETIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
//if (businessTasks.size() == 0) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{}, protocolType为{}", uuid, id, protocolType);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + id + "protocolType为" + protocolType ,
"FtpDownloadServiceImpl" ) ;
//}
if ( StringUtils . isBlank ( downlMd5 ) | | ! md5 . equals ( downlMd5 ) ) {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验失败", uuid, protocolType, id, tableName);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验失败" ,
"FtpDownloadServiceImpl" ) ;
//throw new PPException(MessageEnum.MD5校验失败.getCode(), MessageEnum.MD5校验失败.getMessage());
} else {
//log.info("[uuid:{}]{}-下载zip文件({}){},MD5校验成功", uuid, protocolType, id, tableName);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-下载zip文件protocolType为" + protocolType + "id为" + id + "业务主表表名为" + tableName + "MD5校验成功" ,
"FtpDownloadServiceImpl" ) ;
//获取新的版本号
String newVersion = StringUtil . getNewVersion ( protocolType , version ) ;
//插入sqlite数据库任务表中
BusinessTasks bt = new BusinessTasks ( ) ;
bt . setId ( id ) ;
bt . setFileName ( fileName ) ;
bt . setSize ( FileUtil . formatFileSize ( FileUtil . getFileSize ( new File ( localPath + fileName ) ) ) ) ;
bt . setRecordCount ( Integer . parseInt ( fileCount ) ) ;
//1-已下载
bt . setDownStatus ( 1 ) ;
bt . setProtocolType ( protocolType ) ;
bt . setDownloadTime ( DateTimeUtil . getFormateString ( new Date ( ) , Constant . YYYY_MM_DD_HH_MM_SS ) ) ;
bt . setConsumTime ( end - start ) ;
bt . setVersion ( version ) ;
bt . setNewVersion ( newVersion ) ;
bt . setProStatus ( StringUtil . turnProStatus ( protocolType ) ) ;
//中介库名称 1-华软 2-迈道
bt . setMiddleDatabase ( 1 ) ;
//办理状态 0-未处理 1-已处理 2-再次轮询处理
bt . setHandleStatus ( 0 ) ;
//增加部中心zip处理时间 yyyy-MM-dd HH:mm:ss
bt . setCreateTime ( downloadNotify . getCREATETIME ( ) ) ;
String sqliteInsert = StringUtil . sqliteInsert ( bt ) ;
if ( businessTasks . size ( ) = = 0 ) {
DatabaseUtil . insertSqlite ( sqliteDriverName , sqliteUrl , sqliteInsert ) ;
//log.info("[uuid:{}]插入sqlite数据库business_tasks_info表中任务数据,id为{}, protocolType为{}", uuid, id, protocolType);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-插入sqlite数据库business_tasks_info表中任务数据,id为" + id + "protocolType为" + protocolType ,
"FtpDownloadServiceImpl" ) ;
}
}
}
} else {
//log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
LogUtil . WriteLog_244HRZipDownloadFile ( "[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id ,
"FtpDownloadServiceImpl" ) ;
}
//} else {
// //log.info("[uuid:{}]sqlite数据库中已存在下载的记录同时下载路径下存在该文件{},跳过下载执行后面的处理程序,id为{}", uuid, fileName, id);
// LogUtil.WriteLog_244HRZipDownloadFile("[uuid:" + uuid + "]-sqlite数据库中已存在下载的记录同时下载路径下存在该文件" + fileName + "跳过下载执行后面的处理程序,id为" + id,
// "FtpDownloadServiceImpl");
//}
}