|  |  |  | @ -2,7 +2,6 @@ package com.platform.service.impl; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import java.io.File; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.ArrayList; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.Arrays; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.Calendar; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.Collections; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.HashMap; | 
			
		
	
	
		
			
				
					|  |  |  | @ -11,6 +10,7 @@ import java.util.Map; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import javax.annotation.Resource; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import org.apache.log4j.Logger; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import com.base.Custom4exception; | 
			
		
	
	
		
			
				
					|  |  |  | @ -34,18 +34,39 @@ import com.platform.utils.Constant; | 
			
		
	
		
			
				
					|  |  |  |  | import com.platform.utils.DateForm; | 
			
		
	
		
			
				
					|  |  |  |  | import com.platform.utils.FileOperateHelper; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | /** 校验业务类 | 
			
		
	
		
			
				
					|  |  |  |  |  * @author chen | 
			
		
	
		
			
				
					|  |  |  |  |  * | 
			
		
	
		
			
				
					|  |  |  |  |  */ | 
			
		
	
		
			
				
					|  |  |  |  | @Service(value = "checkoutService") | 
			
		
	
		
			
				
					|  |  |  |  | public class CheckoutServiceImpl implements ICheckoutService { | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  |  | 	 * 日志 | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	public static Logger log = Logger.getLogger(CheckoutServiceImpl.class); | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  |  | 	 * 数据管理业务层 | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	@Resource(name = "dataInfoService") | 
			
		
	
		
			
				
					|  |  |  |  | 	private DataInfoService dataInfoService; | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  |  | 	 * 系统清单数据 | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	@Resource(name = "preDataInfoDao") | 
			
		
	
		
			
				
					|  |  |  |  | 	private PreDataInfoDao preDataInfoDao; | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  |  | 	 * 数据管理 | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	@Resource(name = "dataInfoDao") | 
			
		
	
		
			
				
					|  |  |  |  | 	private DataInfoDao dataInfoDao; | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** | 
			
		
	
		
			
				
					|  |  |  |  | 	 * oracle数据库管理 | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	@Resource(name = "gatherOracleDao") | 
			
		
	
		
			
				
					|  |  |  |  | 	private GatherOracleDao gatherOracleDao; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -97,6 +118,132 @@ public class CheckoutServiceImpl implements ICheckoutService { | 
			
		
	
		
			
				
					|  |  |  |  | 		return checks; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  |  | 		public List<CheckoutEntity> findByCity(String city) throws Exception { | 
			
		
	
		
			
				
					|  |  |  |  | 			CheckoutEntity cksql = new CheckoutEntity(); | 
			
		
	
		
			
				
					|  |  |  |  | 			Calendar c2 = Calendar.getInstance(); | 
			
		
	
		
			
				
					|  |  |  |  | 			 // 时间设置为 半年前的时间
 | 
			
		
	
		
			
				
					|  |  |  |  | 			c2.set(Calendar.MONTH, getMonBeforeHalfYear(c2.get(Calendar.MONTH))); | 
			
		
	
		
			
				
					|  |  |  |  | 			String time = DateForm.date2StringByDay(c2.getTime()); | 
			
		
	
		
			
				
					|  |  |  |  | 			cksql.setCollectingTime(time); | 
			
		
	
		
			
				
					|  |  |  |  | 			cksql.setCityName(city); | 
			
		
	
		
			
				
					|  |  |  |  | 			 | 
			
		
	
		
			
				
					|  |  |  |  | 			Map<String,CheckoutEntity> resul = new HashMap<String,CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 			Map<String,CheckoutEntity> nodata = new HashMap<String,CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 			List<CheckoutEntity> list = preDataInfoDao.findByCity(cksql); | 
			
		
	
		
			
				
					|  |  |  |  | 			int length = list.size(); | 
			
		
	
		
			
				
					|  |  |  |  | 			// 对所有数据分析
 | 
			
		
	
		
			
				
					|  |  |  |  | 			for (int i = 0; i < length; i++) { | 
			
		
	
		
			
				
					|  |  |  |  | 				CheckoutEntity preDataInfo = list.get(i); | 
			
		
	
		
			
				
					|  |  |  |  | 				preDataInfo.setId(i); | 
			
		
	
		
			
				
					|  |  |  |  | 				preDataInfo.setCollUpdate(isY(preDataInfo.getCollUpdate())); | 
			
		
	
		
			
				
					|  |  |  |  | 				if (preDataInfo.getDataVersion() < 1) { | 
			
		
	
		
			
				
					|  |  |  |  | 					preDataInfo.setCollection("否"); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 				if (null != preDataInfo.getCollectingTime()) { | 
			
		
	
		
			
				
					|  |  |  |  | 					if (c2.getTime().before(DateForm.string2DateByDay(preDataInfo.getCollectingTime()))) { | 
			
		
	
		
			
				
					|  |  |  |  | 						resul.put(preDataInfo.getAreaCode()+"_"+preDataInfo.getSysCode()+"_"+preDataInfo.getDataId(), preDataInfo); | 
			
		
	
		
			
				
					|  |  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  |  | 					else { | 
			
		
	
		
			
				
					|  |  |  |  | 						preDataInfo.setDataId(0); | 
			
		
	
		
			
				
					|  |  |  |  | 						preDataInfo.setPath(null); | 
			
		
	
		
			
				
					|  |  |  |  | 						preDataInfo.setDataVersion(0); | 
			
		
	
		
			
				
					|  |  |  |  | 						preDataInfo.setExecResult(null); | 
			
		
	
		
			
				
					|  |  |  |  | 						preDataInfo.setExecResultLast(null); | 
			
		
	
		
			
				
					|  |  |  |  | 						preDataInfo.setPayResult(null); | 
			
		
	
		
			
				
					|  |  |  |  | 						preDataInfo.setPayResultLast(null); | 
			
		
	
		
			
				
					|  |  |  |  | 						preDataInfo.setCheckoutFlag(null); | 
			
		
	
		
			
				
					|  |  |  |  | 						preDataInfo.setCollection("否"); | 
			
		
	
		
			
				
					|  |  |  |  | 						//data_id 已经为 0 (数据不存在时)
 | 
			
		
	
		
			
				
					|  |  |  |  | 						nodata.put(preDataInfo.getAreaCode()+"_"+preDataInfo.getSysCode(), preDataInfo); | 
			
		
	
		
			
				
					|  |  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 				else{ | 
			
		
	
		
			
				
					|  |  |  |  | 					nodata.put(preDataInfo.getAreaCode()+"_"+preDataInfo.getSysCode(), preDataInfo); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			List<String> keyList = new ArrayList<String>(); | 
			
		
	
		
			
				
					|  |  |  |  | 			//记录 不存在数据 在 nodata的 key值
 | 
			
		
	
		
			
				
					|  |  |  |  | 			for (String nodatakey : nodata.keySet()) { | 
			
		
	
		
			
				
					|  |  |  |  | 				keyList.add(nodatakey); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			 | 
			
		
	
		
			
				
					|  |  |  |  | 			List<CheckoutEntity> resultList = new ArrayList<CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 			for (String key : resul.keySet()) { | 
			
		
	
		
			
				
					|  |  |  |  | 				//如果有 校验失败的结果则  为否
 | 
			
		
	
		
			
				
					|  |  |  |  | 				CheckoutEntity tmp = resul.get(key); | 
			
		
	
		
			
				
					|  |  |  |  | 				if(!Constant.CHECKOUT_STATUS_ZERO.equals(tmp.getPayResultLast()) && !Constant.CHECKOUT_STATUS_ZERO.equals(tmp.getExecResultLast())){ | 
			
		
	
		
			
				
					|  |  |  |  | 					if (Constant.CHECKOUT_STATUS_FOUR.equals(tmp.getPayResultLast()) || Constant.CHECKOUT_STATUS_FOUR.equals(tmp.getExecResultLast())) { | 
			
		
	
		
			
				
					|  |  |  |  | 						tmp.setCheckResult(Constant.ORACLE_CHECK_REULT_ONE); | 
			
		
	
		
			
				
					|  |  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  |  | 					else if(!Constant.CHECKOUT_STATUS_TWO.equals(tmp.getPayResultLast()) && !Constant.CHECKOUT_STATUS_TWO.equals(tmp.getExecResultLast())){ | 
			
		
	
		
			
				
					|  |  |  |  | 						tmp.setCheckResult(Constant.ORACLE_CHECK_REULT_ZERO); | 
			
		
	
		
			
				
					|  |  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 				resultList.add(resul.get(key)); | 
			
		
	
		
			
				
					|  |  |  |  | 				for (String nodatakey : keyList) { | 
			
		
	
		
			
				
					|  |  |  |  | 					if (key.contains(nodatakey)) { | 
			
		
	
		
			
				
					|  |  |  |  | 						nodata.remove(nodatakey); | 
			
		
	
		
			
				
					|  |  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			for (String key : nodata.keySet()) { | 
			
		
	
		
			
				
					|  |  |  |  | 				resultList.add(nodata.get(key)); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			return resultList; | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  |  | 	public Map<String, PreDataInfo> findDetail(CheckoutEntity ck) | 
			
		
	
		
			
				
					|  |  |  |  | 			throws Exception { | 
			
		
	
		
			
				
					|  |  |  |  | 		Map<String, PreDataInfo> map = new HashMap<String, PreDataInfo>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		PreDataInfo data = new CheckoutEntity(); | 
			
		
	
		
			
				
					|  |  |  |  | 		String areaCode = ck.getAreaCode(); | 
			
		
	
		
			
				
					|  |  |  |  | 		int sysCode = ck.getSysCode(); | 
			
		
	
		
			
				
					|  |  |  |  | 		data.setAreaCode(areaCode); | 
			
		
	
		
			
				
					|  |  |  |  | 		data.setSysCode(sysCode); | 
			
		
	
		
			
				
					|  |  |  |  | 		PreDataInfo data1 = preDataInfoDao.findStandardByCode(data); | 
			
		
	
		
			
				
					|  |  |  |  | 		data1.reSetWorkRange(new ArrayList<String>()); | 
			
		
	
		
			
				
					|  |  |  |  | 		map.put("data1", data1); | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 		data.setAreaCode(areaCode); | 
			
		
	
		
			
				
					|  |  |  |  | 		data.setSysCode(sysCode); | 
			
		
	
		
			
				
					|  |  |  |  | 		PreDataInfo data2 = preDataInfoDao.findLastByCode(data); | 
			
		
	
		
			
				
					|  |  |  |  | 		// 对比字段
 | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getFunctionDetails().equals(data2.getFunctionDetails())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setFunctionDetails(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getAreaLevel().equals(data2.getAreaLevel())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setAreaLevel(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getBeginUseTime().equals(data2.getBeginUseTime())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setBeginUseTime(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getDataBaseType().equals(data2.getDataBaseType())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setDataBaseType(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getDataBaseVersion().equals(data2.getDataBaseVersion())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setDataBaseVersion(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getDeveloperFullName().equals(data2.getDeveloperFullName())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setDeveloperFullName(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getDepartmentManager().equals(data2.getDepartmentManager())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setDepartmentManager(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getManagerContacts().equals(data2.getManagerContacts())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setManagerContacts(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getSysVersion().equals(data2.getSysVersion())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setSysVersion(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if(!checkWorkRange(data1, data2)){ | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.reSetWorkRange(null); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		map.put("data2", data2); | 
			
		
	
		
			
				
					|  |  |  |  | 		return map; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  |  | 	public List<CheckoutEntity> checkAll(List<CheckoutEntity> list) throws Exception { | 
			
		
	
		
			
				
					|  |  |  |  | 		List<CheckoutEntity> oracleList = new ArrayList<CheckoutEntity>(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -112,6 +259,7 @@ public class CheckoutServiceImpl implements ICheckoutService { | 
			
		
	
		
			
				
					|  |  |  |  | 			else if ("ORACLE".equals(checkoutEntity.getDataBaseType())) { | 
			
		
	
		
			
				
					|  |  |  |  | 				oracleList.add(checkoutEntity); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			log.info(checkoutEntity.toString()); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		// sql Server校验
 | 
			
		
	
		
			
				
					|  |  |  |  | 		for (CheckoutEntity checkoutEntity : sqlServerList) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -170,108 +318,25 @@ public class CheckoutServiceImpl implements ICheckoutService { | 
			
		
	
		
			
				
					|  |  |  |  | 		return result; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	private int getMonBeforeHalfYear(int num){ | 
			
		
	
		
			
				
					|  |  |  |  | 		num -= Configs.dataBefore; | 
			
		
	
		
			
				
					|  |  |  |  | 		if (num <= 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 			num = num + 12; | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		return num; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	private String isY(String str1, String str2) { | 
			
		
	
		
			
				
					|  |  |  |  | 		String r = "否"; | 
			
		
	
		
			
				
					|  |  |  |  | 		if (null !=str2 && null !=str1 && str1.equals(str2) && "y".equals(str1.toLowerCase())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			r = "是"; | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		return r; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	private String isY(String str1) { | 
			
		
	
		
			
				
					|  |  |  |  | 		if (null != str1 && "y".equals(str1.toLowerCase())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			return "是"; | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		else { | 
			
		
	
		
			
				
					|  |  |  |  | 			return "否"; | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  |  | 	public List<CheckoutEntity> findByCity(String city) throws Exception { | 
			
		
	
		
			
				
					|  |  |  |  | 		CheckoutEntity cksql = new CheckoutEntity(); | 
			
		
	
		
			
				
					|  |  |  |  | 		Calendar c2 = Calendar.getInstance(); | 
			
		
	
		
			
				
					|  |  |  |  | 		 // 时间设置为 半年前的时间
 | 
			
		
	
		
			
				
					|  |  |  |  | 		c2.set(Calendar.MONTH, getMonBeforeHalfYear(c2.get(Calendar.MONTH))); | 
			
		
	
		
			
				
					|  |  |  |  | 		String time = DateForm.date2StringByDay(c2.getTime()); | 
			
		
	
		
			
				
					|  |  |  |  | 		cksql.setCollectingTime(time); | 
			
		
	
		
			
				
					|  |  |  |  | 		cksql.setCityName(city); | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 		Map<String,CheckoutEntity> resul = new HashMap<String,CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		Map<String,CheckoutEntity> nodata = new HashMap<String,CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		List<CheckoutEntity> list = preDataInfoDao.findByCity(cksql); | 
			
		
	
		
			
				
					|  |  |  |  | 		int length = list.size(); | 
			
		
	
		
			
				
					|  |  |  |  | 		for (int i = 0; i < length; i++) { | 
			
		
	
		
			
				
					|  |  |  |  | 			CheckoutEntity preDataInfo = list.get(i); | 
			
		
	
		
			
				
					|  |  |  |  | //			if (null != preDataInfo.getPayResultLast() && 
 | 
			
		
	
		
			
				
					|  |  |  |  | //					preDataInfo.getPayResultLast().equals(preDataInfo.getExecResultLast()) && 
 | 
			
		
	
		
			
				
					|  |  |  |  | //					"是".equals(preDataInfo.getExecResultLast())) {
 | 
			
		
	
		
			
				
					|  |  |  |  | //				preDataInfo.setCheckResult("是");
 | 
			
		
	
		
			
				
					|  |  |  |  | //			}else if(null != preDataInfo.getPayResultLast() && null != preDataInfo.getExecResultLast() && !"-".equals(preDataInfo.getPayResultLast()) && !"-".equals(preDataInfo.getExecResultLast())){
 | 
			
		
	
		
			
				
					|  |  |  |  | //				preDataInfo.setCheckResult("否");
 | 
			
		
	
		
			
				
					|  |  |  |  | //			}
 | 
			
		
	
		
			
				
					|  |  |  |  | 			preDataInfo.setId(i); | 
			
		
	
		
			
				
					|  |  |  |  | 			preDataInfo.setCollUpdate(isY(preDataInfo.getCollUpdate())); | 
			
		
	
		
			
				
					|  |  |  |  | 			if (preDataInfo.getDataVersion() < 1) { | 
			
		
	
		
			
				
					|  |  |  |  | 				preDataInfo.setCollection("否"); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			if (null != preDataInfo.getCollectingTime()) { | 
			
		
	
		
			
				
					|  |  |  |  | 				if (c2.getTime().before(DateForm.string2DateByDay(preDataInfo.getCollectingTime()))) { | 
			
		
	
		
			
				
					|  |  |  |  | 					resul.put(preDataInfo.getAreaCode()+"_"+preDataInfo.getSysCode()+"_"+preDataInfo.getDataId(), preDataInfo); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 				else { | 
			
		
	
		
			
				
					|  |  |  |  | 					preDataInfo.setDataId(0); | 
			
		
	
		
			
				
					|  |  |  |  | 					preDataInfo.setPath(null); | 
			
		
	
		
			
				
					|  |  |  |  | 					preDataInfo.setDataVersion(0); | 
			
		
	
		
			
				
					|  |  |  |  | 					preDataInfo.setExecResult(null); | 
			
		
	
		
			
				
					|  |  |  |  | 					preDataInfo.setExecResultLast(null); | 
			
		
	
		
			
				
					|  |  |  |  | 					preDataInfo.setPayResult(null); | 
			
		
	
		
			
				
					|  |  |  |  | 					preDataInfo.setPayResultLast(null); | 
			
		
	
		
			
				
					|  |  |  |  | 					preDataInfo.setCheckoutFlag(null); | 
			
		
	
		
			
				
					|  |  |  |  | 					preDataInfo.setCollection("否"); | 
			
		
	
		
			
				
					|  |  |  |  | 					//data_id 已经为 0
 | 
			
		
	
		
			
				
					|  |  |  |  | 					nodata.put(preDataInfo.getAreaCode()+"_"+preDataInfo.getSysCode(), preDataInfo); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			else{ | 
			
		
	
		
			
				
					|  |  |  |  | 				nodata.put(preDataInfo.getAreaCode()+"_"+preDataInfo.getSysCode(), preDataInfo); | 
			
		
	
		
			
				
					|  |  |  |  | 	public List<CheckoutEntity> deleteAll(List<CheckoutEntity> list) | 
			
		
	
		
			
				
					|  |  |  |  | 			throws Exception { | 
			
		
	
		
			
				
					|  |  |  |  | 		List<Integer> dataIds = new ArrayList<Integer>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		for (CheckoutEntity checkoutEntity : list) { | 
			
		
	
		
			
				
					|  |  |  |  | 			int dataInfoId = checkoutEntity.getDataId(); | 
			
		
	
		
			
				
					|  |  |  |  | 			if (dataInfoId > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 				dataIds.add(dataInfoId); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		List<String> keyList = new ArrayList<String>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		for (String nodatakey : nodata.keySet()) { | 
			
		
	
		
			
				
					|  |  |  |  | 			keyList.add(nodatakey); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 		List<CheckoutEntity> resultList = new ArrayList<CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		for (String key : resul.keySet()) { | 
			
		
	
		
			
				
					|  |  |  |  | 			//如果有 校验失败的结果则  为否
 | 
			
		
	
		
			
				
					|  |  |  |  | 			CheckoutEntity tmp = resul.get(key); | 
			
		
	
		
			
				
					|  |  |  |  | 			if(!Constant.CHECKOUT_STATUS_ZERO.equals(tmp.getPayResultLast()) && !Constant.CHECKOUT_STATUS_ZERO.equals(tmp.getExecResultLast())){ | 
			
		
	
		
			
				
					|  |  |  |  | 				if (Constant.CHECKOUT_STATUS_FOUR.equals(tmp.getPayResultLast()) || Constant.CHECKOUT_STATUS_FOUR.equals(tmp.getExecResultLast())) { | 
			
		
	
		
			
				
					|  |  |  |  | 					tmp.setCheckResult(Constant.ORACLE_CHECK_REULT_ONE); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 				else if(!Constant.CHECKOUT_STATUS_TWO.equals(tmp.getPayResultLast()) && !Constant.CHECKOUT_STATUS_TWO.equals(tmp.getExecResultLast())){ | 
			
		
	
		
			
				
					|  |  |  |  | 					tmp.setCheckResult(Constant.ORACLE_CHECK_REULT_ZERO); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			resultList.add(resul.get(key)); | 
			
		
	
		
			
				
					|  |  |  |  | 			for (String nodatakey : keyList) { | 
			
		
	
		
			
				
					|  |  |  |  | 				if (key.contains(nodatakey)) { | 
			
		
	
		
			
				
					|  |  |  |  | 					nodata.remove(nodatakey); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (dataIds.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 			dataInfoService.deleteData(dataIds); | 
			
		
	
		
			
				
					|  |  |  |  | 		// 根据 dataIds 删除
 | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		for (String key : nodata.keySet()) { | 
			
		
	
		
			
				
					|  |  |  |  | 			resultList.add(nodata.get(key)); | 
			
		
	
		
			
				
					|  |  |  |  | 		List<CheckoutEntity> result = new ArrayList<CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		if (list.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 			result = findByCity(list.get(0).getCityName()); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		return resultList; | 
			
		
	
		
			
				
					|  |  |  |  | 		return result; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	@Override | 
			
		
	
	
		
			
				
					|  |  |  | @ -295,54 +360,104 @@ public class CheckoutServiceImpl implements ICheckoutService { | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  |  | 	public Map<String, PreDataInfo> findDetail(CheckoutEntity ck) | 
			
		
	
		
			
				
					|  |  |  |  | 	public List<CheckoutEntity> extractSqlServer(List<CheckoutEntity> list) | 
			
		
	
		
			
				
					|  |  |  |  | 			throws Exception { | 
			
		
	
		
			
				
					|  |  |  |  | 		Map<String, PreDataInfo> map = new HashMap<String, PreDataInfo>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		PreDataInfo data = new CheckoutEntity(); | 
			
		
	
		
			
				
					|  |  |  |  | 		String areaCode = ck.getAreaCode(); | 
			
		
	
		
			
				
					|  |  |  |  | 		int sysCode = ck.getSysCode(); | 
			
		
	
		
			
				
					|  |  |  |  | 		data.setAreaCode(areaCode); | 
			
		
	
		
			
				
					|  |  |  |  | 		data.setSysCode(sysCode); | 
			
		
	
		
			
				
					|  |  |  |  | 		PreDataInfo data1 = preDataInfoDao.findStandardByCode(data); | 
			
		
	
		
			
				
					|  |  |  |  | 		data1.reSetWorkRange(new ArrayList<String>()); | 
			
		
	
		
			
				
					|  |  |  |  | 		map.put("data1", data1); | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 		data.setAreaCode(areaCode); | 
			
		
	
		
			
				
					|  |  |  |  | 		data.setSysCode(sysCode); | 
			
		
	
		
			
				
					|  |  |  |  | 		PreDataInfo data2 = preDataInfoDao.findLastByCode(data); | 
			
		
	
		
			
				
					|  |  |  |  | 		// 对比字段
 | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getFunctionDetails().equals(data2.getFunctionDetails())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setFunctionDetails(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getAreaLevel().equals(data2.getAreaLevel())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setAreaLevel(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getBeginUseTime().equals(data2.getBeginUseTime())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setBeginUseTime(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getDataBaseType().equals(data2.getDataBaseType())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setDataBaseType(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		//待抽取标准表 的 SqlServer服务的 数据列表:
 | 
			
		
	
		
			
				
					|  |  |  |  | 		List<CheckoutEntity> sqlServer = new ArrayList<CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		for (CheckoutEntity checkoutEntity : list) { | 
			
		
	
		
			
				
					|  |  |  |  | 			if ("SQL SERVER".equals(checkoutEntity.getDataBaseType()) && checkoutEntity.getDataId() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 				sqlServer.add(checkoutEntity); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getDataBaseVersion().equals(data2.getDataBaseVersion())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setDataBaseVersion(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		//TODO 修改sqlServer 列表对应的 数据---  payResultLast 、execResultLast-> 正在抽取
 | 
			
		
	
		
			
				
					|  |  |  |  | 		// 待抽取的集合  
 | 
			
		
	
		
			
				
					|  |  |  |  | 		List<CheckoutEntity> Extractlist = new ArrayList<CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		// TODO 抽取 --- 线程
 | 
			
		
	
		
			
				
					|  |  |  |  | 		if (sqlServer.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 			for (CheckoutEntity checkoutEntity : sqlServer) { | 
			
		
	
		
			
				
					|  |  |  |  | 				boolean isTract = false; | 
			
		
	
		
			
				
					|  |  |  |  | 				//校验结果:成功或失     0:未校验,1:不需校验,2:正在校验,3:校验成功,4:校验失败,5:待抽取,6:正在抽取,7:抽取完成
 | 
			
		
	
		
			
				
					|  |  |  |  | 				if(Constant.CHECKOUT_STATUS_THREE.equals(checkoutEntity.getPayResultLast())){ | 
			
		
	
		
			
				
					|  |  |  |  | 					isTract = true; | 
			
		
	
		
			
				
					|  |  |  |  | 					checkoutEntity.setPayResultLast(Constant.CHECKOUT_STATUS_FIVE); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 				if(Constant.CHECKOUT_STATUS_THREE.equals(checkoutEntity.getExecResultLast())){ | 
			
		
	
		
			
				
					|  |  |  |  | 					isTract = true; | 
			
		
	
		
			
				
					|  |  |  |  | 					checkoutEntity.setExecResultLast(Constant.CHECKOUT_STATUS_FIVE); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 				if (isTract) { | 
			
		
	
		
			
				
					|  |  |  |  | 					Extractlist.add(checkoutEntity); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			// 汇总库的信息
 | 
			
		
	
		
			
				
					|  |  |  |  | 			GatherOracleInfo oracleInfo = null; | 
			
		
	
		
			
				
					|  |  |  |  | 			List<GatherOracleInfo> oracleConnects = gatherOracleDao.selectAllOracle(); | 
			
		
	
		
			
				
					|  |  |  |  | 			for (GatherOracleInfo info : oracleConnects) { | 
			
		
	
		
			
				
					|  |  |  |  | 				//抽取标准表的汇总库
 | 
			
		
	
		
			
				
					|  |  |  |  | 				if (Constant.ORACLE_EXTRACT_TYPE_ONE.equals(info.getType())) { | 
			
		
	
		
			
				
					|  |  |  |  | 					oracleInfo = info; | 
			
		
	
		
			
				
					|  |  |  |  | 					break; | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			if (null != oracleInfo) { | 
			
		
	
		
			
				
					|  |  |  |  | 				// 如果能连接
 | 
			
		
	
		
			
				
					|  |  |  |  | 				if(OracleConnector.canConnect("jdbc:oracle:thin:@" + oracleInfo.getIp() + ":" + oracleInfo.getPort() + ":" | 
			
		
	
		
			
				
					|  |  |  |  | 						+ oracleInfo.getDatabaseName(), oracleInfo.getUser(), oracleInfo.getPassword())){ | 
			
		
	
		
			
				
					|  |  |  |  | 					for (CheckoutEntity check : Extractlist) { | 
			
		
	
		
			
				
					|  |  |  |  | 						 DataInfoEntity data = new DataInfoEntity(); | 
			
		
	
		
			
				
					|  |  |  |  | 						 data.setId(check.getDataId()); | 
			
		
	
		
			
				
					|  |  |  |  | 						 data.setPayResultLast(check.getPayResultLast()); | 
			
		
	
		
			
				
					|  |  |  |  | 						 data.setExecResultLast(check.getExecResultLast()); | 
			
		
	
		
			
				
					|  |  |  |  | 						 data.setCheckoutFlag(check.getCheckoutFlag()); | 
			
		
	
		
			
				
					|  |  |  |  | 						 try { | 
			
		
	
		
			
				
					|  |  |  |  | 							dataInfoDao.update(data); | 
			
		
	
		
			
				
					|  |  |  |  | 						} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  |  | 							log.error(e); | 
			
		
	
		
			
				
					|  |  |  |  | 						} | 
			
		
	
		
			
				
					|  |  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  |  | 					//抽取
 | 
			
		
	
		
			
				
					|  |  |  |  | 					new ThreadExtractStandardSqlServer(oracleInfo, Extractlist, dataInfoDao).start(); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 				else { | 
			
		
	
		
			
				
					|  |  |  |  | 					//连接不上标准表汇总库错误 
 | 
			
		
	
		
			
				
					|  |  |  |  | 					throw new CustomException(Custom4exception.CHECKOUT_EXTRACT_EXCEPT, null); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getDeveloperFullName().equals(data2.getDeveloperFullName())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setDeveloperFullName(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		List<CheckoutEntity> result = new ArrayList<CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		//TODO findByCity
 | 
			
		
	
		
			
				
					|  |  |  |  | 		if (list.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 			result  = findByCity(list.get(0).getCityName()); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getDepartmentManager().equals(data2.getDepartmentManager())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setDepartmentManager(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		return result; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** 前   Configs.dataBefore   个月 | 
			
		
	
		
			
				
					|  |  |  |  | 	 * @param num | 
			
		
	
		
			
				
					|  |  |  |  | 	 * @return | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	private int getMonBeforeHalfYear(int num){ | 
			
		
	
		
			
				
					|  |  |  |  | 		num -= Configs.dataBefore; | 
			
		
	
		
			
				
					|  |  |  |  | 		if (num <= 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 			num = num + 12; | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getManagerContacts().equals(data2.getManagerContacts())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setManagerContacts(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		return num; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	private String isY(String str1, String str2) { | 
			
		
	
		
			
				
					|  |  |  |  | 		String r = "否"; | 
			
		
	
		
			
				
					|  |  |  |  | 		if (null !=str2 && null !=str1 && str1.equals(str2) && "y".equals(str1.toLowerCase())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			r = "是"; | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (data1.getSysVersion().equals(data2.getSysVersion())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.setSysVersion(""); | 
			
		
	
		
			
				
					|  |  |  |  | 		return r; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	private String isY(String str1) { | 
			
		
	
		
			
				
					|  |  |  |  | 		if (null != str1 && "y".equals(str1.toLowerCase())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			return "是"; | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if(!checkWorkRange(data1, data2)){ | 
			
		
	
		
			
				
					|  |  |  |  | 			data2.reSetWorkRange(null); | 
			
		
	
		
			
				
					|  |  |  |  | 		else { | 
			
		
	
		
			
				
					|  |  |  |  | 			return "否"; | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		map.put("data2", data2); | 
			
		
	
		
			
				
					|  |  |  |  | 		return map; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** true 系统所属范围没变化,false:系统范围改变 | 
			
		
	
	
		
			
				
					|  |  |  | @ -385,6 +500,11 @@ public class CheckoutServiceImpl implements ICheckoutService { | 
			
		
	
		
			
				
					|  |  |  |  | 		return true; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** 判断 data1 和 data2是否有差别 | 
			
		
	
		
			
				
					|  |  |  |  | 	 * @param data1 | 
			
		
	
		
			
				
					|  |  |  |  | 	 * @param data2 | 
			
		
	
		
			
				
					|  |  |  |  | 	 * @return | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	private boolean checkField(PreDataInfo data1, PreDataInfo data2) { | 
			
		
	
		
			
				
					|  |  |  |  | 		if (!data1.getFunctionDetails().equals(data2.getFunctionDetails())) { | 
			
		
	
		
			
				
					|  |  |  |  | 			return false; | 
			
		
	
	
		
			
				
					|  |  |  | @ -468,8 +588,8 @@ public class CheckoutServiceImpl implements ICheckoutService { | 
			
		
	
		
			
				
					|  |  |  |  | 	 * @return | 
			
		
	
		
			
				
					|  |  |  |  | 	 */ | 
			
		
	
		
			
				
					|  |  |  |  | 	private CheckoutEntity checkOracleOne(CheckoutEntity ck) { | 
			
		
	
		
			
				
					|  |  |  |  | 		//TODO 校验: Oracle数据-更改为正则校验
 | 
			
		
	
		
			
				
					|  |  |  |  | 		//TODO  Oracle校验结果记录进数据库,
 | 
			
		
	
		
			
				
					|  |  |  |  | 		//校验: Oracle数据-更改为正在校验
 | 
			
		
	
		
			
				
					|  |  |  |  | 		//  Oracle校验结果记录进数据库,
 | 
			
		
	
		
			
				
					|  |  |  |  | 		String pay = ck.getPayResult(); | 
			
		
	
		
			
				
					|  |  |  |  | 		String exec = ck.getExecResult(); | 
			
		
	
		
			
				
					|  |  |  |  | 		if (Constant.CHECKOUT_STATUS_ZERO.equals(ck.getPayResultLast())) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -494,105 +614,4 @@ public class CheckoutServiceImpl implements ICheckoutService { | 
			
		
	
		
			
				
					|  |  |  |  | 		ck.setCheckoutFlag(Constant.CHECKOUTFLAG_TWO); | 
			
		
	
		
			
				
					|  |  |  |  | 		return ck; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  |  | 	public List<CheckoutEntity> deleteAll(List<CheckoutEntity> list) | 
			
		
	
		
			
				
					|  |  |  |  | 			throws Exception { | 
			
		
	
		
			
				
					|  |  |  |  | 		List<Integer> dataIds = new ArrayList<Integer>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		for (CheckoutEntity checkoutEntity : list) { | 
			
		
	
		
			
				
					|  |  |  |  | 			int dataInfoId = checkoutEntity.getDataId(); | 
			
		
	
		
			
				
					|  |  |  |  | 			if (dataInfoId > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 				dataIds.add(dataInfoId); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (dataIds.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 			dataInfoService.deleteData(dataIds); | 
			
		
	
		
			
				
					|  |  |  |  | 		// 根据 dataIds 删除
 | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		List<CheckoutEntity> result = new ArrayList<CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		if (list.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 			result = findByCity(list.get(0).getCityName()); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		return result; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  |  | 	public List<CheckoutEntity> extractSqlServer(List<CheckoutEntity> list) | 
			
		
	
		
			
				
					|  |  |  |  | 			throws Exception { | 
			
		
	
		
			
				
					|  |  |  |  | 		//待抽取标准表 的 SqlServer服务的 数据列表:
 | 
			
		
	
		
			
				
					|  |  |  |  | 		List<CheckoutEntity> sqlServer = new ArrayList<CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		for (CheckoutEntity checkoutEntity : list) { | 
			
		
	
		
			
				
					|  |  |  |  | 			if ("SQL SERVER".equals(checkoutEntity.getDataBaseType()) && checkoutEntity.getDataId() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 				sqlServer.add(checkoutEntity); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		//TODO 修改sqlServer 列表对应的 数据---  payResultLast 、execResultLast-> 正在抽取
 | 
			
		
	
		
			
				
					|  |  |  |  | 		// 待抽取的集合  
 | 
			
		
	
		
			
				
					|  |  |  |  | 		List<CheckoutEntity> Extractlist = new ArrayList<CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		// TODO 抽取 --- 线程
 | 
			
		
	
		
			
				
					|  |  |  |  | 		if (sqlServer.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 			for (CheckoutEntity checkoutEntity : sqlServer) { | 
			
		
	
		
			
				
					|  |  |  |  | 				boolean isTract = false; | 
			
		
	
		
			
				
					|  |  |  |  | 				//校验结果:成功或失     0:未校验,1:不需校验,2:正在校验,3:校验成功,4:校验失败,5:待抽取,6:正在抽取,7:抽取完成
 | 
			
		
	
		
			
				
					|  |  |  |  | 				if(Constant.CHECKOUT_STATUS_THREE.equals(checkoutEntity.getPayResultLast())){ | 
			
		
	
		
			
				
					|  |  |  |  | 					isTract = true; | 
			
		
	
		
			
				
					|  |  |  |  | 					checkoutEntity.setPayResultLast(Constant.CHECKOUT_STATUS_FIVE); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 				if(Constant.CHECKOUT_STATUS_THREE.equals(checkoutEntity.getExecResultLast())){ | 
			
		
	
		
			
				
					|  |  |  |  | 					isTract = true; | 
			
		
	
		
			
				
					|  |  |  |  | 					checkoutEntity.setExecResultLast(Constant.CHECKOUT_STATUS_FIVE); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 				if (isTract) { | 
			
		
	
		
			
				
					|  |  |  |  | 					Extractlist.add(checkoutEntity); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			// 汇总库的信息
 | 
			
		
	
		
			
				
					|  |  |  |  | 			GatherOracleInfo oracleInfo = null; | 
			
		
	
		
			
				
					|  |  |  |  | 			List<GatherOracleInfo> oracleConnects = gatherOracleDao.selectAllOracle(); | 
			
		
	
		
			
				
					|  |  |  |  | 			for (GatherOracleInfo info : oracleConnects) { | 
			
		
	
		
			
				
					|  |  |  |  | 				//抽取标准表的汇总库
 | 
			
		
	
		
			
				
					|  |  |  |  | 				if (Constant.ORACLE_EXTRACT_TYPE_ONE.equals(info.getType())) { | 
			
		
	
		
			
				
					|  |  |  |  | 					oracleInfo = info; | 
			
		
	
		
			
				
					|  |  |  |  | 					break; | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			if (null != oracleInfo) { | 
			
		
	
		
			
				
					|  |  |  |  | 				// 如果能连接
 | 
			
		
	
		
			
				
					|  |  |  |  | 				if(OracleConnector.canConnect("jdbc:oracle:thin:@" + oracleInfo.getIp() + ":" + oracleInfo.getPort() + ":" | 
			
		
	
		
			
				
					|  |  |  |  | 						+ oracleInfo.getDatabaseName(), oracleInfo.getUser(), oracleInfo.getPassword())){ | 
			
		
	
		
			
				
					|  |  |  |  | 					for (CheckoutEntity check : Extractlist) { | 
			
		
	
		
			
				
					|  |  |  |  | 						 DataInfoEntity data = new DataInfoEntity(); | 
			
		
	
		
			
				
					|  |  |  |  | 						 data.setId(check.getDataId()); | 
			
		
	
		
			
				
					|  |  |  |  | 						 data.setPayResultLast(check.getPayResultLast()); | 
			
		
	
		
			
				
					|  |  |  |  | 						 data.setExecResultLast(check.getExecResultLast()); | 
			
		
	
		
			
				
					|  |  |  |  | 						 data.setCheckoutFlag(check.getCheckoutFlag()); | 
			
		
	
		
			
				
					|  |  |  |  | 						 try { | 
			
		
	
		
			
				
					|  |  |  |  | 							dataInfoDao.update(data); | 
			
		
	
		
			
				
					|  |  |  |  | 						} catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  |  | 							// TODO Auto-generated catch block
 | 
			
		
	
		
			
				
					|  |  |  |  | 							e.printStackTrace(); | 
			
		
	
		
			
				
					|  |  |  |  | 						} | 
			
		
	
		
			
				
					|  |  |  |  | 					} | 
			
		
	
		
			
				
					|  |  |  |  | 					//抽取
 | 
			
		
	
		
			
				
					|  |  |  |  | 					new ThreadExtractStandardSqlServer(oracleInfo, Extractlist, dataInfoDao).start(); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 				else { | 
			
		
	
		
			
				
					|  |  |  |  | 					//连接不上标准表汇总库错误 
 | 
			
		
	
		
			
				
					|  |  |  |  | 					throw new CustomException(Custom4exception.CHECKOUT_EXTRACT_EXCEPT, null); | 
			
		
	
		
			
				
					|  |  |  |  | 				} | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		List<CheckoutEntity> result = new ArrayList<CheckoutEntity>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		//TODO findByCity
 | 
			
		
	
		
			
				
					|  |  |  |  | 		if (list.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 			result  = findByCity(list.get(0).getCityName()); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		return result; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	@Override | 
			
		
	
		
			
				
					|  |  |  |  | 	public Map<String, PreDataInfo> readLog(CheckoutEntity ck) throws Exception { | 
			
		
	
		
			
				
					|  |  |  |  | 		// TODO Auto-generated method stub
 | 
			
		
	
		
			
				
					|  |  |  |  | 		return null; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |