private void setTradeTimeMillis( TradeTime paramTradeTime, String paramString1, String paramString2) { try { if (paramTradeTime.getGatherBid().shortValue() == 1) { paramTradeTime.setBidStartTimeMillis( DateUtil.convertStringToDate( "yyyy-MM-dd HH:mm:ss", paramString1 + " " + paramTradeTime.getBidStartTime()) .getTime()); paramTradeTime.setBidEndTimeMillis( DateUtil.convertStringToDate( "yyyy-MM-dd HH:mm:ss", paramString1 + " " + paramTradeTime.getBidEndTime()) .getTime()); paramTradeTime.setBidStartDate(paramString1); paramTradeTime.setBidEndDate(paramString2); } paramTradeTime.setStartTimeMillis( DateUtil.convertStringToDate( "yyyy-MM-dd HH:mm:ss", paramString1 + " " + paramTradeTime.getStartTime()) .getTime()); paramTradeTime.setEndTimeMillis( DateUtil.convertStringToDate( "yyyy-MM-dd HH:mm:ss", paramString2 + " " + paramTradeTime.getEndTime()) .getTime()); paramTradeTime.setStartDate(paramString1); paramTradeTime.setEndDate(paramString2); } catch (ParseException localParseException) { this.log.error("转换交易节信息时解析日期失败,原因:" + localParseException.getMessage()); System.out.println( DateUtil.getCurDateTime() + " 转换交易节信息时解析日期失败,原因:" + localParseException.getMessage()); } }
public Date getRecoverDateByTime(String paramString) throws ParseException { Object localObject = null; SystemStatus localSystemStatus = this.serverDAO.getSystemStatus(); Date localDate1 = localSystemStatus.getTradeDate(); String str1 = DateUtil.formatDate(localDate1, "yyyy-MM-dd"); Date localDate2 = calValidClearDate(DateUtil.GoDate(localDate1, -1), -1); String str2 = DateUtil.formatDate(localDate2, "yyyy-MM-dd"); String str3 = DateUtil.formatDate(DateUtil.GoDate(localDate2, 1), "yyyy-MM-dd"); int i = 0; String str4 = null; List localList = this.serverDAO.getTradeTimes(); for (int j = 0; j < localList.size(); j++) { TradeTime localTradeTime = (TradeTime) localList.get(j); if (localTradeTime.getEndTime().compareTo(localTradeTime.getStartTime()) < 0) { i = 1; if (paramString.compareTo(localTradeTime.getStartTime()) >= 0) { localObject = str2; break; } if (paramString.compareTo(localTradeTime.getEndTime()) < 0) { localObject = str3; break; } } else { if ((str4 != null) && (localTradeTime.getStartTime().compareTo(str4) < 0)) { i = 1; } if (i != 0) { localObject = str1; break; } if (paramString.compareTo(localTradeTime.getStartTime()) >= 0) { localObject = str2; break; } } str4 = localTradeTime.getEndTime(); } if (localObject == null) { localObject = str1; } return DateUtil.convertStringToDate("yyyy-MM-dd HH:mm:ss", localObject + " " + paramString); }