多线程抽取的修改
This commit is contained in:
parent
e9d99467d3
commit
5b979bf7ec
|
@ -199,7 +199,11 @@ public class CheckoutServiceImpl implements ICheckoutService {
|
|||
resultList.addAll(noDataList);
|
||||
int listSize = resultList.size();
|
||||
for (int i = 0; i < listSize; i++) {
|
||||
resultList.get(i).setId(i);
|
||||
CheckoutEntity obj = resultList.get(i);
|
||||
if (null != obj && "y".equals(obj.getCollUpdate())) {
|
||||
obj.setCollUpdate("是");
|
||||
}
|
||||
obj.setId(i);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
|
|
@ -264,8 +264,6 @@ public class OracleExtractServiceImpl implements IOracleExtractService {
|
|||
if (Constant.CHECKOUT_STATUS_THREE.equals(tmpdata
|
||||
.getPayResultLast())
|
||||
|| Constant.CHECKOUT_STATUS_FIVE
|
||||
.equals(tmpdata.getPayResultLast())
|
||||
|| Constant.CHECKOUT_STATUS_SIX
|
||||
.equals(tmpdata.getPayResultLast())) {
|
||||
// 抽取中
|
||||
data.setPayResultLast(Constant.CHECKOUT_STATUS_SIX);
|
||||
|
@ -289,8 +287,6 @@ public class OracleExtractServiceImpl implements IOracleExtractService {
|
|||
if (Constant.CHECKOUT_STATUS_THREE.equals(tmpdata
|
||||
.getExecResultLast())
|
||||
|| Constant.CHECKOUT_STATUS_FIVE
|
||||
.equals(tmpdata.getExecResultLast())
|
||||
|| Constant.CHECKOUT_STATUS_SIX
|
||||
.equals(tmpdata.getExecResultLast())) {
|
||||
// 抽取中
|
||||
data.setExecResultLast(Constant.CHECKOUT_STATUS_SIX);
|
||||
|
|
|
@ -50,6 +50,7 @@ public class VolumeServiceImpl implements IVolumeService {
|
|||
List<VolumeDataEntity> result = gfsService.getAllVolumes();
|
||||
List<VolumeDataEntity> addVolumes = new ArrayList<VolumeDataEntity>();
|
||||
VolumeDataEntity volumeTmp = null;
|
||||
VolumeDataEntity volumeTmpMysql = entity;
|
||||
if (null != result) {
|
||||
boolean isExits = false;
|
||||
//.trim() 去掉空格
|
||||
|
@ -58,20 +59,21 @@ public class VolumeServiceImpl implements IVolumeService {
|
|||
isExits = true;
|
||||
//TODO 服务器上有该volume,
|
||||
volumeTmp = volumeOnServer;
|
||||
volumeTmpMysql = volumeOnServer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//如果服务器上没有该volume,
|
||||
//如果服务器上没有该volume,则新增volume
|
||||
if (!isExits) {
|
||||
addVolumes.add(entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//记录volume信息,
|
||||
VolumeInitEntity volInSql = new VolumeInitEntity();
|
||||
volInSql.setName(entity.getName());
|
||||
volInSql.setPath(entity.getPath());
|
||||
volInSql.setMark(entity.getHot());
|
||||
volInSql.setName(volumeTmpMysql.getName());
|
||||
volInSql.setPath(volumeTmpMysql.getPath());
|
||||
volInSql.setMark(volumeTmpMysql.getHot());
|
||||
if (volMap.keySet().contains(volInSql.getPath())) {
|
||||
VolumeInitEntity tmp = volMap.get(volInSql.getPath());
|
||||
volInSql.setId(tmp.getId());
|
||||
|
|
|
@ -11,6 +11,8 @@ import java.sql.Connection;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.base.CustomException;
|
||||
import com.platform.dao.DataInfoDao;
|
||||
import com.platform.entities.CheckoutEntity;
|
||||
|
@ -31,6 +33,8 @@ import com.platform.utils.FileOperateHelper;
|
|||
*/
|
||||
public class ThreadExtractStandardSqlServer extends Thread{
|
||||
|
||||
public final static Logger log = Configs.CONSOLE_LOGGER.getLogger(ThreadExtractStandardSqlServer.class);
|
||||
|
||||
/**
|
||||
* 抽取
|
||||
*/
|
||||
|
@ -73,9 +77,10 @@ public class ThreadExtractStandardSqlServer extends Thread{
|
|||
+ DateForm
|
||||
.date2StringBysecond(new Date())
|
||||
+ "\r\n");
|
||||
// 查询最新的 数据记录
|
||||
this.getDataByCk(element);
|
||||
//如果校验成功的 才 进行 抽取----支付标准表
|
||||
if (Constant.CHECKOUT_STATUS_FIVE.equals(element.getPayResultLast())
|
||||
|| Constant.CHECKOUT_STATUS_SIX.equals(element.getPayResultLast())) {
|
||||
if (Constant.CHECKOUT_STATUS_FIVE.equals(element.getPayResultLast())) {
|
||||
String payFilePath = FileOperateHelper.addLastSeparator(element.getPath())+Constant.standard_pay
|
||||
+ element.getAreaCode().toLowerCase()+"_" + element.getSysCode()+".sql";
|
||||
DataInfoEntity data = new DataInfoEntity();
|
||||
|
@ -134,9 +139,10 @@ public class ThreadExtractStandardSqlServer extends Thread{
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
// 查询最新的 数据记录
|
||||
this.getDataByCk(element);
|
||||
//如果校验成功的 才 进行 抽取----执行标准表
|
||||
if (Constant.CHECKOUT_STATUS_FIVE.equals(element.getExecResultLast())
|
||||
|| Constant.CHECKOUT_STATUS_SIX.equals(element.getExecResultLast())){
|
||||
if (Constant.CHECKOUT_STATUS_FIVE.equals(element.getExecResultLast())){
|
||||
String execFilePath = FileOperateHelper.addLastSeparator(element.getPath())+Constant.standard_indicate
|
||||
+ element.getAreaCode().toLowerCase() +"_" + element.getSysCode()+".sql";
|
||||
DataInfoEntity data = new DataInfoEntity();
|
||||
|
@ -238,4 +244,16 @@ public class ThreadExtractStandardSqlServer extends Thread{
|
|||
}
|
||||
}
|
||||
|
||||
private void getDataByCk(CheckoutEntity element) {
|
||||
DataInfoEntity data = null;
|
||||
try {
|
||||
data = dataInfoDao.findById(element.getDataId());
|
||||
if (data != null) {
|
||||
element.setPayResultLast(data.getPayResultLast());
|
||||
element.setExecResultLast(data.getExecResultLast());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue