94 lines
3.4 KiB
Java
94 lines
3.4 KiB
Java
<#-- **** input parameters ***** -->
|
|
<#-- input : message RFX -->
|
|
<#-- project : projectId in ReflexPlatform -->
|
|
<#-- organisation : organisationtId in ReflexPlatform -->
|
|
|
|
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
|
|
<#assign projectRP = project>
|
|
<#assign organisationRP = organisation>
|
|
|
|
<#assign aDateTime = .now>
|
|
|
|
<#switch cloudEventMsg.action>
|
|
<#case "C">
|
|
<#--<#case "U">
|
|
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
|
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
|
<#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)>
|
|
|
|
<#if preparationOrder.total_lv_validated !=0>
|
|
[
|
|
{
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.GoodsPrepared>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsrPrepa_GoodsPrepared.ftl">
|
|
},
|
|
{
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl">
|
|
},
|
|
|
|
<#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!="" >
|
|
{
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCarrierUpdated>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsrPrepa_CarrierUpdated.ftl">
|
|
},
|
|
{
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderCarrierUpdated>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl">
|
|
},
|
|
</#if>
|
|
|
|
|
|
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line>
|
|
<#list preparation_line.despatched_ipg_list as despatched_ipg>
|
|
{
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl">
|
|
}
|
|
|
|
<#if despatched_ipg.carton_number != "000000000000000000" && despatched_ipg.carton_number!=despatched_ipg.hd_number >
|
|
,
|
|
{
|
|
<#assign includeHU = []>
|
|
<#list preparation_line.despatched_ipg_list as despatched_ipg2>
|
|
<#if despatched_ipg.hd_number == despatched_ipg2.hd_number >
|
|
<#assign includeHU = ["${despatched_ipg2.carton_number}"]>
|
|
</#if>
|
|
</#list>
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitHUsAdded>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsrPrepa_HandlingunitHUsAdded.ftl">
|
|
}
|
|
</#if>
|
|
<#sep>,</#sep>
|
|
</#list>
|
|
<#sep>,</#sep>
|
|
</#list>
|
|
|
|
|
|
]
|
|
|
|
<#else>
|
|
<#stop "no confirmed quantity for the preparation - preparation closed">
|
|
</#if>
|
|
|
|
<#break>
|
|
<#case "D">
|
|
<#-- *********************************************** Action = DELETE ******************** -->
|
|
<#stop "event not supported (Case D)">
|
|
<#break>
|
|
|
|
<#default>
|
|
<#stop "event not supported">
|
|
</#switch> |