Esempio n. 1
0
 private String getLastSectionEndTime() {
   String str = null;
   List localList = this.serverDAO.getTradeTimes();
   int i = localList.size();
   if ((localList != null) && (i > 0)) {
     TradeTime localTradeTime = (TradeTime) localList.get(i - 1);
     str = localTradeTime.getEndTime();
   }
   return str;
 }
Esempio n. 2
0
 private void setTradeTimeStatus(TradeTime paramTradeTime, Date paramDate, Map paramMap) {
   Map localMap = (Map) paramMap.get(Integer.valueOf(DateUtil.getWeekDay(paramDate)));
   if (localMap == null) {
     paramTradeTime.setStatus(Short.valueOf((short) 0));
   } else {
     Short localShort = (Short) localMap.get(paramTradeTime.getSectionID());
     if (localShort == null) {
       paramTradeTime.setStatus(Short.valueOf((short) 0));
     } else {
       int i = localShort.shortValue();
       if (i == 0) {
         paramTradeTime.setStatus(Short.valueOf((short) 1));
       } else {
         paramTradeTime.setStatus(Short.valueOf((short) 0));
       }
     }
   }
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 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());
   }
 }