Package utils

Examples of utils.Day


        //STUB
        Collaborator author = getDao().getById(Collaborator.class, getUserInfo().getCurrentCollaboratorId());
        //ENDSTUB

        Day day = new  Day(dto.getYear(), dto.getMonth(), dto.getDay());

        DetachedCriteria queryCriteria = DetachedCriteria.forClass(SheduleReception.class)
                .add(Property.forName("register").ge(day.getDate()))
                .add(Property.forName("register").le(day.getEndDate()))
                .add(Property.forName("author").eq(author))
                .addOrder(Property.forName("begin").asc());

        if (dto.getCollaborator() != null) {
            queryCriteria.add(Property.forName("collaborator").eq(dto.getCollaborator()));
View Full Code Here


                ReceptionDTO rdto = new ReceptionDTO();
                rdto.setClient(sheduleReception.getClient());
                rdto.setCollaborator(sheduleReception.getCollaborator());
                rdto.setLpu(sheduleReception.getCollaborator().getLpu());
                rdto.setType(sheduleReception.getWorkType());
                Day day = new Day(sheduleReception.getBegin());
                ReceptionHelper rhBefore = new ReceptionHelper(getDao(), rdto, day.getDate(), day.getEndDate());
                WeekDay weekDay = rhBefore.getModel().get(0);
                List<Ticket> ticketsBefore = weekDay.getTickets();

                getDao().delete(sheduleReception);

                //Ебём мозг 2, нарезаем тикеты после удаления
                ReceptionHelper rhAfter = new ReceptionHelper(getDao(), rdto, day.getDate(), day.getEndDate());
                weekDay = rhAfter.getModel().get(0);
                List<Ticket> ticketsAfter = weekDay.getTickets();

                //Сравниваем списки - получаем свободные тикеты
                ticketsAfter.removeAll(ticketsBefore);
View Full Code Here

        for (CollabWorkTypeDTO collabWorkTypeDTO : collabWorks) {
            ReceptionDTO rdto = new ReceptionDTO();
            rdto.setCollaborator(collabWorkTypeDTO.getCollaborator());
            rdto.setLpu(lpu);
            rdto.setType(collabWorkTypeDTO.getWorkType());
            Day day = new Day(new Date());
            Date dateStart = day.getDate();
            Calendar calendar = day.getCalendar();
            calendar.add(Calendar.DAY_OF_MONTH, 13);
            day = new Day(calendar);
            Date dateEnd = day.getEndDate();

            ReceptionHelper rh = new ReceptionHelper(getDao(), rdto, dateStart, dateEnd);
            List<WeekDay> wModel = rh.getModel();
            for (int i = 0; i < wModel.size() && collabTicketMap.get(collabWorkTypeDTO) == null; i++) {
                WeekDay weekDay = wModel.get(i);
View Full Code Here

    @Override
    protected Map referenceData(HttpServletRequest request, Object command, Errors errors) throws Exception {
        ReceptionDTO dto = (ReceptionDTO) command;
        int uid = updater.registerPage(dto.getCollaborator(), dto.getType());

        Day beginDay = new Day();
        Calendar calEnd = beginDay.getCalendar();
        calEnd.add(Calendar.WEEK_OF_YEAR, 2);
        calEnd.add(Calendar.MILLISECOND, -1);

        ReceptionHelper rh = new ReceptionHelper(getDao(), dto, beginDay.getDate(), calEnd.getTime());
       
        List<WeekDay> mm = rh.getModel();
        int kk = mm.size();

        HashMap model = new HashMap();
View Full Code Here

        if(dto.getTime() == 0) {
            errors.reject("reception.incorrect.time");
            return showForm(request, errors, getFormView());
        }

        Day day = new Day(cal);
        Calendar dayEnd = day.getCalendar();
        dayEnd.add(Calendar.DAY_OF_MONTH, 1);
        dayEnd.add(Calendar.MILLISECOND, -1);

        ReceptionHelper rh = new ReceptionHelper(getDao(), dto, day.getDate(), dayEnd.getTime());
        List<WeekDay> model = rh.getModel();

        if(model.size() != 1) {
            errors.reject("reception.incorrect.time");
            return showForm(request, errors, getFormView());
View Full Code Here

            pageBreadcrumb.add(new BreadCrumb(">", coll.getClient().toString(),
                    "/operator/collaborator.htm", params));
        }

        if(time != 0) {
            Day day = new Day(time);
            pageBreadcrumb.add(new BreadCrumb(">", day.toString(),
                    "/operator/reception.htm", params));
        }

        if(client != null) {
            pageBreadcrumb.add(new BreadCrumb(">", client.toString(),
View Full Code Here

        for (Collaborator collaborator : collaborators) {
            ReceptionDTO dto = new ReceptionDTO();
            dto.setCollaborator(collaborator);
            dto.setLpu(lpu);
            dto.setType(type);
            Day day = new Day(new Date());
            Date dateStart = day.getDate();
            Calendar calendar = day.getCalendar();
            calendar.add(Calendar.DAY_OF_MONTH, 13);
            day = new Day(calendar);
            Date dateEnd = day.getEndDate();

            ReceptionHelper rh = new ReceptionHelper(getDao(), dto, dateStart, dateEnd);
            List<WeekDay> wModel = rh.getModel();
            for (int i = 0; i < wModel.size() && collabTicketMap.get(collaborator) == null; i++) {
                WeekDay weekDay = wModel.get(i);
View Full Code Here

        if(dto.getTime() == 0) {
            errors.reject("reception.incorrect.time");
            return showForm(request, errors, getFormView());
        }

        Day day = new Day(cal);

        ReceptionHelper rh = new ReceptionHelper(getDao(), dto, day.getDate(), day.getEndDate());
        List<WeekDay> model = rh.getModel();

        if(model.size() != 1) {
            errors.reject("reception.incorrect.time");
            return showForm(request, errors, getFormView());
View Full Code Here

                .add(Property.forName("collaborator").eq(dto.getCollaborator()))
                .add(Property.forName("begin").ge(begin))
                .add(Property.forName("begin").le(end));
        List<SheduleReception> list = dao.getList(criteria, null, null);
        for(SheduleReception sr: list) {
            Day day = new Day(sr.getBegin());
            List<SheduleReception> dayList = res.get(day);
            if(dayList == null) {
                dayList = new LinkedList<SheduleReception>();
                res.put(day, dayList);
            }
View Full Code Here

                    .add(Property.forName("collaborator").eq(dto.getCollaborator()))
                    .add(Property.forName("day").ge(begin.getTime()))
                    .add(Property.forName("day").le(end.getTime()));
            for(Object o: dao.getList(criteria, null, null)) {
                Prorumble pro = (Prorumble) o;
                Day day = new Day(pro.getDay().getTime());
                prorumbles.add(day);
            }
        }
        return prorumbles;
    }
View Full Code Here

TOP

Related Classes of utils.Day

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.