package com.kingdee.eas.custom.attendanceexception.app;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.custom.attendanceexception.AttendanceExceptionLogInfo;
import org.apache.log4j.Logger;

import java.util.Calendar;

public class AttendanceExceptionLogControllerBean extends AbstractAttendanceExceptionLogControllerBean {
    private static Logger logger = Logger.getLogger(AttendanceExceptionLogControllerBean.class);


    @Override
    protected IObjectPK _addnew(Context ctx, IObjectValue model) throws BOSException, EASBizException {
        AttendanceExceptionLogInfo info = (AttendanceExceptionLogInfo) model;
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        info.setBizDate(calendar.getTime());
        return super._addnew(ctx, model);
    }
}