@Override
  protected void executeJob(JobExecutionContext jobExecutionContext) throws JobExecutionException {
    Calendar calendar = Calendar.getInstance();
    calendar.setTimeInMillis(System.currentTimeMillis());
    calendar.setFirstDayOfWeek(Calendar.MONDAY);
    int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
    if (dayOfWeek != Calendar.MONDAY && dayOfWeek != Calendar.THURSDAY) {
      return;
    }

    if (lock) {
      return;
    } else {
      lock = true;
      try {
        LOG.info("后台上周每个汽配店铺所关心的配件 汽修版的上周销量、入库量统计");
        LOG.info("开始时间:" + DateUtil.dateLongToStr(System.currentTimeMillis()));
        IPreciseRecommendService service =
            ServiceManager.getService(IPreciseRecommendService.class);
        service.salesInventoryMonthStat();

      } catch (Exception e) {
        LOG.error("/SalesInventoryWeekStatSchedule method=executeJob 上周销量、入库量统计失败");
        LOG.error(e.getMessage(), e);
      } finally {
        LOG.info("后台结束上周销量、入库量统计");
        lock = false;
        LOG.info("结束时间:" + DateUtil.dateLongToStr(System.currentTimeMillis()));
      }
    }
  }
 public void verificationQueryTime() throws Exception {
   if (this.startDate != null && this.endDate != null) {
     if (this.startDate > endDate) {
       Long temp = endDate;
       endDate = startDate;
       startDate = temp;
     }
     endDate += ONE_DAY - 1000;
     LOG.debug(
         "query order time:"
             + DateUtil.convertDateLongToDateString("yyyy-MM-dd HH:mm", startDate)
             + "--"
             + DateUtil.convertDateLongToDateString("yyyy-MM-dd HH:mm", startDate));
   }
 }
  public void setDefaultInfo() {
    try {
      if (startDateStr == null) {
        this.setStartDate(DateUtil.getFirstDayDateTimeOfMonth());
      } else {
        this.setStartDate(DateUtil.getStartTimeOfDate(startDateStr));
      }

      if (endDateStr == null) {
        this.setEndDate(DateUtil.getNextMonthTime(System.currentTimeMillis()));
      } else {
        this.setStartDate(DateUtil.getEndTimeOfDate(endDateStr));
      }
    } catch (ParseException e) {
      LOG.error(e.getMessage(), e);
    }
  }
 public void setEndDateStr(String endDateStr) {
   if (StringUtils.isBlank(endDateStr)) return;
   endDate = DateUtil.parseInquiryCenterDate(endDateStr);
   this.endDateStr = endDateStr;
 }
 public void setStartDateStr(String startDateStr) {
   if (StringUtils.isBlank(startDateStr)) return;
   startDate = DateUtil.parseInquiryCenterDate(startDateStr);
   this.startDateStr = startDateStr;
 }
Beispiel #6
0
 public void setEstimateTime(Long estimateTime) {
   this.estimateTime = estimateTime;
   this.estimateTimeStr =
       DateUtil.convertDateLongToDateString(DateUtil.DATE_STRING_FORMAT_DAY, estimateTime);
 }