Условия, которые я создаю в случае, не влияют на календарь апекса, поскольку они должны это условия для рабочих смен, которые я создаю в календаре вершины.
Может ли кто-нибудь помочь мне в этих условиях?
create or replace PROCEDURE check_task_turnos AS
BEGIN
FOR i IN (SELECT ID, calendar_start, calendar_end, estado, TIPO,
,CASE
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 7 AND to_number(to_char(calendar_end,'HH24')) < 15
AND to_number(to_char(sysdate,'HH24')) >= 7 AND to_number(to_char(sysdate,'HH24')) >= 15
then 'apex-cal-yellow'
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 15 AND to_number(to_char(calendar_end,'HH24')) < 23
AND to_number(to_char(sysdate,'HH24')) >= 15 AND to_number(to_char(sysdate,'HH24')) >= 23
then 'apex-cal-yellow'
when to_number(to_char(calendar_start,'DD')) = to_number(to_char(sysdate,'DD'))
AND to_number(to_char(calendar_start,'HH24')) >= 23 AND to_number(to_char(calendar_end,'HH24')) < 7
AND to_number(to_char(sysdate,'HH24')) >= 23 AND to_number(to_char(sysdate,'HH24')) >= 7
then 'apex-cal-yellow'
else null end
FROM PASSAGEM
where estado='Aceite'
and TIPO='To Do'
)
LOOP
-- registo no LOG , aqui nao registas na PASSAGEM, registas numa tabela ao lado de LOG para teres referencia de quando foi alterada a data da tarefa
INSERT INTO PASSAGEM_LOG(passagem_id,
start_date,
end_date
)
VALUES(i.id ,
i.calendar_start+( 8/24) ,
i.calendar_end +(8/24));
-- update das horas de inico e fim para posicionamento no calendario
UPDATE PASSAGEM
SET calendar_start = i.calendar_start+(8/24) --incrementamos 8horas (periodod e um turno
,calendar_end = i.calendar_end+(8/24) --incrementamos 8horas (periodod e um turno
WHERE ID = i.ID;
END LOOP;
COMMIT;
END;