public List getTradeTimes(Date paramDate) { Date localDate1 = paramDate; 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"); ArrayList localArrayList = new ArrayList(); int i = 0; String str4 = null; Map localMap = this.serverDAO.getDaySectionMap(); 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) { setTradeTimeMillis(localTradeTime, str2, str3); i = 1; } else { if ((str4 != null) && (localTradeTime.getStartTime().compareTo(str4) < 0)) { i = 1; } if (i != 0) { setTradeTimeMillis(localTradeTime, str1, str1); } else { setTradeTimeMillis(localTradeTime, str2, str2); } } str4 = localTradeTime.getEndTime(); setTradeTimeStatus(localTradeTime, localDate1, localMap); this.serverDAO.updateTradeSectionDateStatus(localTradeTime); if (localTradeTime.getStatus().shortValue() == 1) { localArrayList.add(localTradeTime); } } return localArrayList; }
public Date calClearDate() { Date localDate1 = this.serverDAO.getCurDbDate(); SystemStatus localSystemStatus = this.serverDAO.getSystemStatus(); if ((DateUtil.formatDate(localSystemStatus.getTradeDate(), "yyyy-MM-dd") .compareTo(DateUtil.formatDate(localDate1, "yyyy-MM-dd")) > 0) || ((DateUtil.formatDate(localSystemStatus.getTradeDate(), "yyyy-MM-dd") .compareTo(DateUtil.formatDate(localDate1, "yyyy-MM-dd")) == 0) && (localSystemStatus.getStatus() != 3))) { return localSystemStatus.getTradeDate(); } String str1 = DateUtil.formatDate(localDate1, "HH:mm:ss"); Date localDate2; if (str1.compareTo(getLastSectionEndTime()) < 0) { Date localDate3 = this.serverDAO.getLastClearDate(); String str2 = DateUtil.formatDate(localDate3, "yyyy-MM-dd"); if (DateUtil.formatDate(localDate1, "yyyy-MM-dd").compareTo(str2) == 0) { localDate2 = DateUtil.GoDate(localDate1, 1); } else { localDate2 = localDate1; } } else { localDate2 = DateUtil.GoDate(localDate1, 1); } return calValidClearDate(localDate2, 1); }
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); }