From 5b979bf7ece63438530cc3a1b9eea4d9ae174834 Mon Sep 17 00:00:00 2001 From: chenlw <874313221@qq.com> Date: Wed, 28 Dec 2016 11:21:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E7=BA=BF=E7=A8=8B=E6=8A=BD=E5=8F=96?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CheckoutServiceImpl.java | 6 ++++- .../impl/OracleExtractServiceImpl.java | 4 --- .../service/impl/VolumeServiceImpl.java | 12 +++++---- .../ThreadExtractStandardSqlServer.java | 26 ++++++++++++++++--- 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/com/platform/service/impl/CheckoutServiceImpl.java b/src/com/platform/service/impl/CheckoutServiceImpl.java index 45747d6..a783abf 100644 --- a/src/com/platform/service/impl/CheckoutServiceImpl.java +++ b/src/com/platform/service/impl/CheckoutServiceImpl.java @@ -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; } diff --git a/src/com/platform/service/impl/OracleExtractServiceImpl.java b/src/com/platform/service/impl/OracleExtractServiceImpl.java index 01cca4c..66fc659 100644 --- a/src/com/platform/service/impl/OracleExtractServiceImpl.java +++ b/src/com/platform/service/impl/OracleExtractServiceImpl.java @@ -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); diff --git a/src/com/platform/service/impl/VolumeServiceImpl.java b/src/com/platform/service/impl/VolumeServiceImpl.java index 1ae8288..7072ff0 100644 --- a/src/com/platform/service/impl/VolumeServiceImpl.java +++ b/src/com/platform/service/impl/VolumeServiceImpl.java @@ -50,6 +50,7 @@ public class VolumeServiceImpl implements IVolumeService { List result = gfsService.getAllVolumes(); List addVolumes = new ArrayList(); 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()); diff --git a/src/com/platform/service/thread/ThreadExtractStandardSqlServer.java b/src/com/platform/service/thread/ThreadExtractStandardSqlServer.java index bf8ca09..e33fbcd 100644 --- a/src/com/platform/service/thread/ThreadExtractStandardSqlServer.java +++ b/src/com/platform/service/thread/ThreadExtractStandardSqlServer.java @@ -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); + } + } }