@ -132,23 +132,27 @@ public class ThreadMoveData{
int difSize = ( int ) ( srcSizeTemp - dstSize ) ;
int difSize = ( int ) ( srcSizeTemp - dstSize ) ;
Thread . sleep ( 10 * difSize ) ;
Thread . sleep ( 10 * difSize ) ;
//TODO 查看当前拷贝目录进程是否结束?
//TODO 查看当前拷贝目录进程是否结束?
// TODO 进行MD5校验
// 进行MD5校验
int resl = check . checkoutMD5Folder ( dataMove . getDataPath ( ) , dataMove . getDstPath ( ) ) ;
int resl = check . checkoutMD5Folder ( dataMove . getDataPath ( ) , dataMove . getDstPath ( ) ) ;
// TODO 校验成功--则删除 数据库记录
// 校验成功--则增加 数据库记录
if ( resl = = 1 ) {
if ( resl = = 1 ) {
//校验成功--修改 数据库记录--
// 判断 迁移数据的status是否改为 2
dataMove . setCompleteStatus ( "2" ) ;
DataInfoEntityMoveTmp movetmp = dataInfoMoveTmpDao . findById ( dataMove . getId ( ) ) ;
dataMove . setLastTime ( DateForm . date2StringBysecond ( new Date ( ) ) ) ;
if ( null ! = movetmp & & ! "2" . equals ( movetmp . getCompleteStatus ( ) ) ) {
dataInfoMoveTmpDao . update ( dataMove ) ;
//校验成功--修改 数据库记录--
//TODO 新增 一条数据-到-dataInfo
dataMove . setCompleteStatus ( "2" ) ;
DataInfoEntity data = ( DataInfoEntity ) Bean2MapUtils . convertMap (
dataMove . setLastTime ( DateForm . date2StringBysecond ( new Date ( ) ) ) ;
DataInfoEntity . class , Bean2MapUtils . convertBean ( dataMove ) ) ;
dataInfoMoveTmpDao . update ( dataMove ) ;
data . setDataPath ( dataMove . getDstPath ( ) ) ;
//TODO 新增 一条数据-到-dataInfo
data . setVolumeIp ( dataMove . getDstVolumeIp ( ) ) ;
DataInfoEntity data = ( DataInfoEntity ) Bean2MapUtils . convertMap (
data . setVolumePath ( dataMove . getDstVolumePath ( ) ) ;
DataInfoEntity . class , Bean2MapUtils . convertBean ( dataMove ) ) ;
data . setVolumeIp ( dataMove . getVolumeIp ( ) ) ;
data . setDataPath ( dataMove . getDstPath ( ) ) ;
data . setId ( 0 ) ;
data . setVolumeIp ( dataMove . getDstVolumeIp ( ) ) ;
dataInfoDao . save ( data ) ;
data . setVolumePath ( dataMove . getDstVolumePath ( ) ) ;
data . setVolumeIp ( dataMove . getVolumeIp ( ) ) ;
data . setId ( 0 ) ;
dataInfoDao . save ( data ) ;
}
}
}
else {
else {
// 3:表示 迁移失败
// 3:表示 迁移失败