Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

TM.Shared.OrderStatus_to_TM.Bosman.IFTSTA.xsl 4.7KB

1 tydzień temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  2. xmlns:ScriptNS0="http://schemas.microsoft.com/BizTalk/2003/ScriptNS0"
  3. xmlns:ScriptNS1="http://schemas.microsoft.com/BizTalk/2003/ScriptNS1"
  4. xmlns:DateTime="TM.Shared.Components.DateTime"
  5. xmlns:SSO="TM.Shared.Components.SSO"
  6. xmlns:String="TM.Shared.Components.String"
  7. xmlns:s0="http://TM.KLG.com/KLG/OrderStatus"
  8. xmlns:ns0="http://schemas.microsoft.com/BizTalk/EDI/EDIFACT/2006"
  9. exclude-result-prefixes="s0 ns0 ScriptNS0 ScriptNS1 DateTime SSO String">
  10. <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" indent="yes" />
  11. <!-- Region global variable initialization -->
  12. <!-- region connectionString -->
  13. <xsl:variable name="connectionString" select="SSO:GetValue('TM.Bosman', 'ESBLookupConnectionString2016')"/>
  14. <!-- end region -->
  15. <!-- end region -->
  16. <!-- region templates -->
  17. <xsl:template match="/">
  18. <xsl:apply-templates select="/s0:StatusReport" />
  19. </xsl:template>
  20. <xsl:template match="/s0:StatusReport">
  21. <ns0:EFACT_D96A_IFTSTA_BOSMAN>
  22. <UNH>
  23. <UNH1>
  24. <xsl:value-of select="DateTime:FormatDateTime(TimeStamp, 'yyyy-MM-ddTHH:mm:ss', 'yyyyMMddHHmmss')" />
  25. </UNH1>
  26. <UNH2>
  27. <UNH2.1>IFTSTA</UNH2.1>
  28. <UNH2.2>D</UNH2.2>
  29. <UNH2.3>96A</UNH2.3>
  30. <UNH2.4>UN</UNH2.4>
  31. <UNH2.5>EAN002</UNH2.5>
  32. </UNH2>
  33. </UNH>
  34. <ns0:BGM>
  35. <!-- Max length of BGM02 is 35 -->
  36. <BGM02>
  37. <xsl:value-of select="substring(/s0:StatusReport/Status/ShipmentReference,1,35)"/>
  38. </BGM02>
  39. </ns0:BGM>
  40. <ns0:DTM>
  41. <ns0:C507>
  42. <C50701>137</C50701>
  43. <C50702>
  44. <xsl:value-of select="DateTime:FormatDateTime(TimeStamp, 'yyyy-MM-ddTHH:mm:ss', 'yyyyMMdd')" />
  45. </C50702>
  46. <C50703>102</C50703>
  47. </ns0:C507>
  48. </ns0:DTM>
  49. <ns0:CNILoop1>
  50. <ns0:CNI>
  51. <!-- Momenteel bevat Shared.Status maximaal 1 bericht -->
  52. <CNI01>1</CNI01>
  53. <ns0:C503>
  54. <C50301>
  55. <xsl:choose>
  56. <xsl:when test="contains(/s0:StatusReport/Status/ShipmentReference,'/')">
  57. <xsl:value-of select="normalize-space(substring-after(/s0:StatusReport/Status/ShipmentReference,'/'))"/>
  58. </xsl:when>
  59. <xsl:otherwise>
  60. <xsl:value-of select="/s0:StatusReport/Status/ShipmentReference"/>
  61. </xsl:otherwise>
  62. </xsl:choose>
  63. </C50301>
  64. </ns0:C503>
  65. </ns0:CNI>
  66. <ns0:STSLoop1>
  67. <ns0:STS>
  68. <ns0:C601>
  69. <C60101>1</C60101>
  70. </ns0:C601>
  71. <ns0:C555>
  72. <C55501>
  73. <xsl:variable name="status">
  74. <xsl:choose>
  75. <xsl:when test="ScriptNS0:DBValueExtract(string(ScriptNS0:DBLookup(0, /s0:StatusReport/Status/StatusCode, $connectionString, 'TM_Bosman_StatusCode', 'KLG')), 'Bosman') != ''">
  76. <xsl:value-of select="ScriptNS0:DBValueExtract(string(ScriptNS0:DBLookup(0, /s0:StatusReport/Status/StatusCode, $connectionString, 'TM_Bosman_StatusCode', 'KLG')), 'Bosman')" />
  77. </xsl:when>
  78. <xsl:otherwise>
  79. <xsl:value-of select="/s0:StatusReport/Status/StatusCode"/>
  80. </xsl:otherwise>
  81. </xsl:choose>
  82. </xsl:variable>
  83. <xsl:value-of select="$status"/>
  84. </C55501>
  85. </ns0:C555>
  86. </ns0:STS>
  87. <ns0:DTM_3>
  88. <ns0:C507_3>
  89. <C50701>334</C50701>
  90. <xsl:choose>
  91. <xsl:when test="String:Left(Status/StatusTimeStamp,1)>'0'">
  92. <C50702>
  93. <xsl:value-of select="DateTime:FormatDateTime(Status/StatusTimeStamp, 'yyyy-MM-ddTHH:mm:ss', 'yyyyMMddHHmm')" />
  94. </C50702>
  95. <C50703>203</C50703>
  96. </xsl:when>
  97. <xsl:otherwise>
  98. <C50702>000101010000</C50702>
  99. <C50703>102</C50703>
  100. </xsl:otherwise>
  101. </xsl:choose>
  102. </ns0:C507_3>
  103. </ns0:DTM_3>
  104. </ns0:STSLoop1>
  105. </ns0:CNILoop1>
  106. <UNT>
  107. <UNT1>0</UNT1>
  108. <UNT2>
  109. <xsl:value-of select="DateTime:FormatDateTime(TimeStamp, 'yyyy-MM-ddTHH:mm:ss', 'yyyyMMddHHmmss')" />
  110. </UNT2>
  111. </UNT>
  112. </ns0:EFACT_D96A_IFTSTA_BOSMAN>
  113. </xsl:template>
  114. <!-- end region -->
  115. <xsl:variable name="dbClose" select="ScriptNS0:DBLookupShutdown()"/>
  116. </xsl:stylesheet>