You've already forked reflex-wms-connector
SCPN1-10882
This commit is contained in:
@@ -11,38 +11,43 @@
|
|||||||
|
|
||||||
<#switch cloudEventMsg.action>
|
<#switch cloudEventMsg.action>
|
||||||
<#case "C">
|
<#case "C">
|
||||||
<#-- *********************************************** Action = CREATE ******************** -->
|
<#-- *********************************************** Action = CREATE ******************** -->
|
||||||
|
|
||||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||||
<#assign ancReceiptLine = JsonUtil.jsonToMap(dataRfx)>
|
<#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)>
|
||||||
[
|
[
|
||||||
|
<#if AncReceipt.line_list?? && AncReceipt.line_list[0]??>
|
||||||
{
|
{
|
||||||
<#stop "create anticipated receipt line">
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderLinesAdded>
|
||||||
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||||
|
"datas" :
|
||||||
|
<#include "RFXtoRP_HliAntRecLr_OrderLinesAdded.ftl">
|
||||||
|
},
|
||||||
|
{
|
||||||
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderReceiptExpected>
|
||||||
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||||
|
"datas" :
|
||||||
|
<#include "RFXtoRP_HsrAntRec_ReceiptExpected.ftl">
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
<#break>
|
<#else>
|
||||||
|
<#stop>
|
||||||
|
</#if>
|
||||||
|
<#break>
|
||||||
|
|
||||||
<#case "U">
|
<#case "U">
|
||||||
<#-- *********************************************** Action = UPDATE ******************** -->
|
<#-- *********************************************** Action = UPDATE ******************** -->
|
||||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||||
<#assign ancReceiptLine = JsonUtil.jsonToMap(dataRfx)>
|
<#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)>
|
||||||
[
|
<#stop>
|
||||||
{
|
<#break>
|
||||||
<#stop "update anticipated receipt line">
|
|
||||||
}
|
|
||||||
]
|
|
||||||
<#break>
|
|
||||||
|
|
||||||
<#case "D">
|
<#case "D">
|
||||||
<#-- *********************************************** Action = DELETE ******************** -->
|
<#-- *********************************************** Action = DELETE ******************** -->
|
||||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||||
<#assign ancReceiptLine = JsonUtil.jsonToMap(dataRfx)>
|
<#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)>
|
||||||
[
|
<#stop>
|
||||||
{
|
<#break>
|
||||||
<#stop "delete anticipated receipt line">
|
|
||||||
}
|
|
||||||
]
|
|
||||||
<#break>
|
|
||||||
|
|
||||||
|
|
||||||
<#default>
|
<#default>
|
||||||
<#stop >
|
<#stop >
|
||||||
</#switch>
|
</#switch>
|
||||||
|
|||||||
47
RFXtoRP_HliAntRecLr_OrderLinesAdded.ftl
Normal file
47
RFXtoRP_HliAntRecLr_OrderLinesAdded.ftl
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<#include "ReflexUtils.ftl">
|
||||||
|
<#include "HfRpConfig.ftl">
|
||||||
|
<#include "ActorPrefix.ftl">
|
||||||
|
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"Header": {
|
||||||
|
"ProjectID": "${projectRP}"
|
||||||
|
},
|
||||||
|
"ID": {
|
||||||
|
<#if AncReceipt.anticipated_receipt_reference?? && AncReceipt.anticipated_receipt_reference!="">
|
||||||
|
"RefID": "${AncReceipt.anticipated_receipt_reference?json_string}"
|
||||||
|
<#else>
|
||||||
|
"RefID": "AR-${AncReceipt.physical_depot_code?trim?json_string}${AncReceipt.activity_code?trim?json_string}${AncReceipt.originator_code?trim?json_string}${AncReceipt.anticipated_receipt_year?json_string}${AncReceipt.anticipated_receipt_number?json_string}"
|
||||||
|
</#if>
|
||||||
|
},
|
||||||
|
"Payload": {
|
||||||
|
"Lines": [
|
||||||
|
<#-- Lines iteration -->
|
||||||
|
<#list AncReceipt.line_list?filter(l -> l??) as line>
|
||||||
|
{
|
||||||
|
<#if line.anticipated_receipt_reference_line_no?? && line.anticipated_receipt_reference_line_no!=0>
|
||||||
|
"LineID": "${line.anticipated_receipt_reference_line_no}",
|
||||||
|
<#else>
|
||||||
|
"LineID": "${line.anticipated_receipt_line_number}",
|
||||||
|
</#if>
|
||||||
|
<#-- Line Metadata inclusion -->
|
||||||
|
<#include "RFXtoRP_HsrAntRec_Created_LineMetadata.ftl">,
|
||||||
|
"RequestedContent":{
|
||||||
|
"Goods":{
|
||||||
|
"ItemID":"${line.item_code?trim?json_string!"0"}",
|
||||||
|
"LVBranchID":"${line.item_lv_code?trim?json_string!"0"}",
|
||||||
|
<#-- Segmentation Keys inclusion -->
|
||||||
|
<#include "RFXtoRP_HsrAntRec_Created_SegmentationKeys.ftl">
|
||||||
|
},
|
||||||
|
"Quantity" :
|
||||||
|
{
|
||||||
|
"LVID": "${quantity_in_base_lv_RP_Cst}",
|
||||||
|
"Value": ${line.planned_quantity_in_base_lv!0}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}<#sep>,</#sep>
|
||||||
|
</#list>
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user