Páginas filhas
  • TRZUVI_DT_Mensagem_ScheduleWork_Exclusao_Horarios

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Linha de Produto:

Logix

Segmento:

Manufatura

Módulo:

Folha de Pagamento - RHU

Função:

EAIAdapterScheduleWork1 - Adapter da mensagem ScheduleWork versão 1.000

Situação:

Devido a alteração na funcionalidade de exclusão de horários, na mensagem única padrão ScheduleWork, atualmente, quando ocorre o envio da exclusão de um horário, é enviada a sequência de horários que está sendo excluída, diferentemente de como a rotina funcionava anteriormente, quando era enviado na exclusão, somente os horários que permaneciam.

Solução:

O programa foi alterado para permitir que, quando for apresentada uma mensagem de exclusão de horários, seja identificada a sequência de horários da mensagem e exclua somente a mensagem esta sequência na tabela ESCALA_HORARIOS. Para os casos em que apresentar a primeira sequência, deverá, além de excluir a tabela ESCALA_HORARIOS, excluir as tabelas ESCALA e TURNO_RHU.

Dessa forma, deverá alterar a função EAIAdapterScheduleWork1, localizada no TFS no endereço: $/Logix/Fontes_Doc/Sustentacao/10R2-11R0/10R2-11R0/framework/eai2/adapter, para prever os ajustes

Exemplos:

É enviada a seguinte mensagem de inclusão de horários pelo Protheus:

<TOTVSMessage>
<MessageInformation version="1.000">
<UUID>8b7b7dd6-f10e-eefc-bd70-dd2u548502ca</UUID>
<Type>BusinessMessage</Type>
<Transaction>SCHEDULEWORK</Transaction>
<StandardVersion>1.000</StandardVersion>
<SourceApplication>P118</SourceApplication>
<CompanyId>YY</CompanyId>
<BranchId>01</BranchId>
<Product name="PROTHEUS" version="11"/>
<GeneratedOn>2015-07-28T14:37:22</GeneratedOn>
<DeliveryType>Sync</DeliveryType>
</MessageInformation>
<BusinessMessage>
<BusinessEvent>
<Entity>ScheduleWork</Entity>
<Event>upsert</Event>
<Identification>
<key name="Code">YY||305|02</key>
</Identification>
</BusinessEvent>
<BusinessContent>
<CompanyId>YY</CompanyId>
<BranchId/>
<WorkShiftCode>305</WorkShiftCode>
<WorkShiftInternalId>YY||305</WorkShiftInternalId>
<Description>TURNO TESTE LOGIX III</Description>
<RegularHour>0</RegularHour>
<RestHour>0</RestHour>
<StartDateScheduleWork>2015-07-27</StartDateScheduleWork>
<ListOfSchedule>
<Schedule>
<StartSequence>1</StartSequence>
<EndSequence>1</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>8.00</StartHour>
<EndHour>17.30</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>12.00</StartHour>
<EndHour>13.30</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>2</StartSequence>
<EndSequence>2</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>8.00</StartHour>
<EndHour>17.30</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>12.00</StartHour>
<EndHour>13.30</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>3</StartSequence>
<EndSequence>3</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>8.00</StartHour>
<EndHour>17.30</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>12.00</StartHour>
<EndHour>13.30</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>4</StartSequence>
<EndSequence>4</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>8.00</StartHour>
<EndHour>17.30</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>12.00</StartHour>
<EndHour>13.30</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>5</StartSequence>
<EndSequence>5</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>8.00</StartHour>
<EndHour>17.30</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>12.00</StartHour>
<EndHour>13.30</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>6</StartSequence>
<EndSequence>6</EndSequence>
<TypeOfDay>2</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>0.00</StartHour>
<EndHour>0.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>7</StartSequence>
<EndSequence>7</EndSequence>
<TypeOfDay>3</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>0.00</StartHour>
<EndHour>0.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>8</StartSequence>
<EndSequence>8</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>22.00</StartHour>
<EndHour>5.00</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>1.00</StartHour>
<EndHour>2.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>9</StartSequence>
<EndSequence>9</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>22.00</StartHour>
<EndHour>5.00</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>1.00</StartHour>
<EndHour>2.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>10</StartSequence>
<EndSequence>10</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>22.00</StartHour>
<EndHour>5.00</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>1.00</StartHour>
<EndHour>2.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>11</StartSequence>
<EndSequence>11</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>22.00</StartHour>
<EndHour>5.00</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>1.00</StartHour>
<EndHour>2.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>12</StartSequence>
<EndSequence>12</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>22.00</StartHour>
<EndHour>5.00</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>1.00</StartHour>
<EndHour>2.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>13</StartSequence>
<EndSequence>13</EndSequence>
<TypeOfDay>2</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>0.00</StartHour>
<EndHour>0.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>14</StartSequence>
<EndSequence>14</EndSequence>
<TypeOfDay>3</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>0.00</StartHour>
<EndHour>0.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
</ListOfSchedule>
</BusinessContent>
</BusinessMessage>
</TOTVSMessage>

 

Exemplo 01)

Na mensagem única é enviada a seguinte mensagem de exclusão, conforme abaixo. Como destacado na mensagem, é identificado que a mensagem é de exclusão e a sequência que está sendo excluída é a partir da 8 (as mensagem do Protheus são enviadas sempre com sequências identificando semanas: semana 1, sequência 1 a 7; semana 2, sequência 8 a 14; semana 3, sequência 15 a 21; etc). Dessa forma, deverá prever a exclusão da tabela ESCALA_HORARIOS, para a empresa e escala em questão, das sequência 08 a 14:

<TOTVSMessage>
<MessageInformation version="1.000">
<UUID>26f55255-25c4-a64e-431d-55b229294b16</UUID>
<Type>BusinessMessage</Type>
<Transaction>SCHEDULEWORK</Transaction>
<StandardVersion>1.000</StandardVersion>
<SourceApplication>P118</SourceApplication>
<CompanyId>YY</CompanyId>
<BranchId>01</BranchId>
<Product name="PROTHEUS" version="11"/>
<GeneratedOn>2015-07-28T14:48:01</GeneratedOn>
<DeliveryType>Sync</DeliveryType>
</MessageInformation>
<BusinessMessage>
<BusinessEvent>
<Entity>ScheduleWork</Entity>
<Event>delete</Event>
<Identification>
<key name="Code">YY||305|02</key>
</Identification>
</BusinessEvent>
<BusinessContent>
<CompanyId>YY</CompanyId>
<BranchId/>
<WorkShiftCode>305</WorkShiftCode>
<WorkShiftInternalId>YY||305</WorkShiftInternalId>
<Description>TURNO TESTE LOGIX III</Description>
<RegularHour>0</RegularHour>
<RestHour>0</RestHour>
<StartDateScheduleWork>2015-07-27</StartDateScheduleWork>
<ListOfSchedule>
<Schedule>
<StartSequence>8</StartSequence>
<EndSequence>8</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>22.00</StartHour>
<EndHour>5.00</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>1.00</StartHour>
<EndHour>2.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>9</StartSequence>
<EndSequence>9</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>22.00</StartHour>
<EndHour>5.00</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>1.00</StartHour>
<EndHour>2.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>10</StartSequence>
<EndSequence>10</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>22.00</StartHour>
<EndHour>5.00</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>1.00</StartHour>
<EndHour>2.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>11</StartSequence>
<EndSequence>11</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>22.00</StartHour>
<EndHour>5.00</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>1.00</StartHour>
<EndHour>2.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>12</StartSequence>
<EndSequence>12</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>22.00</StartHour>
<EndHour>5.00</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>1.00</StartHour>
<EndHour>2.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>13</StartSequence>
<EndSequence>13</EndSequence>
<TypeOfDay>2</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>0.00</StartHour>
<EndHour>0.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>14</StartSequence>
<EndSequence>14</EndSequence>
<TypeOfDay>3</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>0.00</StartHour>
<EndHour>0.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
</ListOfSchedule>
</BusinessContent>
</BusinessMessage>
</TOTVSMessage>

Exemplo 02) 

Na situação abaixo, é enviada a mensagem de exclusão da sequência 1, conforme destaques. Dessa forma, identificando que é a primeira sequência que está sendo excluída e que não haverá mais turnos e escalas registrados para o horário enviado, deverá ser previsto, além da exclusão da tabela ESCALA_HORARIOS, também a exclusão das tabelas TURNO_RHU e ESCALA.

<TOTVSMessage>
<MessageInformation version="1.000">
<UUID>60851bb8-dedd-b76d-0f4n-429fa9a9419f</UUID>
<Type>BusinessMessage</Type>
<Transaction>SCHEDULEWORK</Transaction>
<StandardVersion>1.000</StandardVersion>
<SourceApplication>P118</SourceApplication>
<CompanyId>YY</CompanyId>
<BranchId>01</BranchId>
<Product name="PROTHEUS" version="11"/>
<GeneratedOn>2015-07-28T15:20:25</GeneratedOn>
<DeliveryType>Sync</DeliveryType>
</MessageInformation>
<BusinessMessage>
<BusinessEvent>
<Entity>ScheduleWork</Entity>
<Event>delete</Event>
<Identification>
<key name="Code">YY||305|01</key>
</Identification>
</BusinessEvent>
<BusinessContent>
<CompanyId>YY</CompanyId>
<BranchId/>
<WorkShiftCode>305</WorkShiftCode>
<WorkShiftInternalId>YY||305</WorkShiftInternalId>
<Description>TURNO TESTE LOGIX III</Description>
<RegularHour>0</RegularHour>
<RestHour>0</RestHour>
<StartDateScheduleWork>2015-07-27</StartDateScheduleWork>
<ListOfSchedule>
<Schedule>
<StartSequence>1</StartSequence>
<EndSequence>1</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>8.00</StartHour>
<EndHour>17.30</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>12.00</StartHour>
<EndHour>13.30</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>2</StartSequence>
<EndSequence>2</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>8.00</StartHour>
<EndHour>17.30</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>12.00</StartHour>
<EndHour>13.30</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>3</StartSequence>
<EndSequence>3</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>8.00</StartHour>
<EndHour>17.30</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>12.00</StartHour>
<EndHour>13.30</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>4</StartSequence>
<EndSequence>4</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>8.00</StartHour>
<EndHour>17.30</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>12.00</StartHour>
<EndHour>13.30</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>5</StartSequence>
<EndSequence>5</EndSequence>
<TypeOfDay>1</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>8.00</StartHour>
<EndHour>17.30</EndHour>
</ScheduleHour>
<ScheduleHour>
<HourType>2</HourType>
<StartHour>12.00</StartHour>
<EndHour>13.30</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>6</StartSequence>
<EndSequence>6</EndSequence>
<TypeOfDay>2</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>0.00</StartHour>
<EndHour>0.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
<Schedule>
<StartSequence>7</StartSequence>
<EndSequence>7</EndSequence>
<TypeOfDay>3</TypeOfDay>
<ListOfScheduleHour>
<ScheduleHour>
<HourType>1</HourType>
<StartHour>0.00</StartHour>
<EndHour>0.00</EndHour>
</ScheduleHour>
</ListOfScheduleHour>
</Schedule>
</ListOfSchedule>
</BusinessContent>
</BusinessMessage>
</TOTVSMessage>

Chamados relacionados:

Chamado de desenvolvimento da alteração no Protheus:

TSWELD

Release:

12.1.7