com.greenline.guahao.web.module.home.controllers.my.reservation.OrderLimitUtil.java Source code

Java tutorial

Introduction

Here is the source code for com.greenline.guahao.web.module.home.controllers.my.reservation.OrderLimitUtil.java

Source

/**
 * Project: guahao-portal-web-home
 * 
 * File Created at 2012-9-17
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package com.greenline.guahao.web.module.home.controllers.my.reservation;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;
import org.springframework.ui.ModelMap;

import com.greenline.common.util.DESUtil;
import com.greenline.guahao.biz.manager.cache.order.OrderValidLimitCacheManager;
import com.greenline.guahao.web.module.common.constants.ReservationConstants;

/**
 * @Type OrderLimitUtil
 * @Desc ??
 * @author ??
 * @date 2012-9-17
 * @Version V1.0
 */
@Component
public class OrderLimitUtil {
    private static final Log log = LogFactory.getLog(OrderLimitUtil.class);

    @Resource
    private OrderValidLimitCacheManager orderValidLimitCacheManager;

    // ?1????
    public void setSignData(ModelMap model, Long cuserId) {
        SimpleDateFormat destsmf = new SimpleDateFormat("yyyyMMddHHmmss");
        String todatasign = cuserId + destsmf.format(new Date());
        // ??20
        orderValidLimitCacheManager.setSignData(cuserId + StringUtils.EMPTY, todatasign);
        log.info("___________?:?todatasign=" + todatasign);
        String signdata = DESUtil.DESEncode(todatasign, ReservationConstants.DESC_ORDER_KEY);
        log.info("___________?:??signdata=" + signdata);
        model.put("signdata", signdata);
        // ??
        orderValidLimitCacheManager.setOrderSpeedTime(cuserId + StringUtils.EMPTY);
    }
}