79 lines
3.6 KiB
Java
79 lines
3.6 KiB
Java
<#include "RPtoRFX_PrepOrder_DefaultData.ftl">
|
|
|
|
<#assign aDateTime = .now>
|
|
|
|
{
|
|
"id" : {"refid" : "${executionflow.OrderID}"},
|
|
"route" : "rest/public/v1/activities/{activity_code}/physical_depots/{physical_depot_code}/originators/{originator_code}/preparation_orders",
|
|
"method" : "POST",
|
|
"uri_substitutions": {
|
|
"activity_code": "${activity_code}",
|
|
"physical_depot_code": "${ActorID_RPtoRFX[executionflow.ShipFrom.ActorID]!executionflow.ShipFrom.ActorID}",
|
|
"originator_code": "${Reflex_Originator}"
|
|
},
|
|
"payload" :
|
|
{
|
|
"originator_reference": "${executionflow.OrderID}",
|
|
"preparation_type_code": "${preparation_type_code}",
|
|
"end_consignee_code": "${ActorID_RPtoRFX[executionflow.ShipTo.ActorID]!executionflow.ShipTo.ActorID}",
|
|
<#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??>
|
|
"requested_delivery_start_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}",
|
|
<#else>
|
|
"requested_delivery_start_datetime": "${aDateTime?iso_utc}",
|
|
</#if>
|
|
"automatic_generation": "true",
|
|
"consolidated_delivery": "false",
|
|
"intermediate_consignee": "false",
|
|
"print_deconsolidation_sheet": "false",
|
|
"print_final_delivery_note": "false",
|
|
"protected": "false",
|
|
"automatic_generation": "false",
|
|
"stock_despatch_at_preparation_confirmation": "false",
|
|
"deactivate": "false",
|
|
"requested_delivery_date_type": "010",
|
|
<#if executionflow.ShipTo.ActorID == "">
|
|
"address": {
|
|
"mail_address": "${executionflow.Carrier.Actor.Emails[0]!""}",
|
|
"mobile_phone_number": "${executionflow.Carrier.Actor.Phones[0]!""}",
|
|
"street_and_number_and_po_box": "${executionflow.Carrier.Actor.Address.StreetAddressOne!""}",
|
|
"additional_address_data_1": "${executionflow.Carrier.Actor.Address.StreetAddressTwo!""}",
|
|
"additional_address_data_2": "${executionflow.Carrier.Actor.Address.StreetAddressThree!""}",
|
|
"postal_code": "${executionflow.Carrier.Actor.Address.PostalCode!""}",
|
|
"iso_country_code": "${executionflow.Carrier.Actor.Address.CountryCode!""}"
|
|
},
|
|
</#if>
|
|
<#if executionflow.Lines??>
|
|
"line_list": [
|
|
<#list executionflow.Lines as line>
|
|
{
|
|
|
|
<#if line.RequestedContent.Goods.SegmentationKeys??>
|
|
<#assign ic_map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") />
|
|
"owner_code_to_prepare": "${ic_map.Owner.String!"${Default_Value_Owner_SegmentationKey}"}",
|
|
"grade_code_to_prepare": "${SegmentationKeys_RPtoRFX[ic_map.Grade.String!""]!"${Default_Value_Grade_SegmentationKey}"}",
|
|
"batch_1": "${ic_map.BatchNumber!""}",
|
|
</#if>
|
|
"originator_reference_line_number": ${line.LineID?number},
|
|
"item_code": "${line.RequestedContent.Goods.ItemID!""}",
|
|
"item_lv_code": "${line.RequestedContent.Goods.LVBranchID!""}",
|
|
"base_lv_quantity_to_prepare": ${line.RequestedMetrics.QuantityInBaseLV.Value!0},
|
|
"input_order_data": "false",
|
|
"stock_reservation": "false",
|
|
"forced_priority_date_min_lead_time": "false",
|
|
"temp_substitution_possible": "false",
|
|
"substitution_possible": "false",
|
|
"base_lv_quantity": "true",
|
|
"any_lv": "false"
|
|
}<#sep>,</#sep>
|
|
</#list>
|
|
],
|
|
</#if>
|
|
"optional_attributes": {
|
|
"apt_with_end_consignee": "false",
|
|
"apt_with_intermediate": "false",
|
|
<#-- "load_grouping": "${executionflow.Carrier.ActorID!""}" -->
|
|
"load_grouping": "${load_grouping}"
|
|
}
|
|
}
|
|
}
|