讲IDOC生成的XML文件转化为excel文件的方法

2024-04-24 07:18
文章标签 xml excel 方法 生成 转化 idoc

本文主要是介绍讲IDOC生成的XML文件转化为excel文件的方法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

官方教程:http://help.sap.com/saphelp_erp2004/helpdata//EN/e3/7d4719ca581441b6841f1054ff1326/frameset.htm

关于转化的命令和基本格式都在里面

Command Overview

 

Command

Description

<tt:apply ...>

Calls a subtemplate

<tt:assign ...>

Assigns a value to data

<tt:attribute ...>

Defines a non-literal attribute

<tt:call ...>

Calls an ST program

<tt:clear ...>

Initializes data

<tt:cond ...>

Defines a conditioned transformation

<tt:cond-var ...>

Defines a condition for variables

<tt:context ...>

Defines a context for local data roots in subtemplates

<tt:copy ...>

Transforms any data objects to asXML

<tt:d-cond ...>

Defines a conditioned transformation for deserialization

<tt:deserialize ...>

Defines the direction of the transformation

<tt:empty ...>

Defines an empty pattern

<tt:group ...>

Defines a group of conditioned transformations

<tt:include ...>

Includes an ST program

<... tt:lax=?...? ...>

Controls the name comparison of literal XML elements

<tt:loop ...>

Transforms internal tables

<tt:namespace ...>

Declares a namespace

<tt:parameter ...>

Declares a parameter

<tt:read ...>

Reads a variable from XML

<tt:ref ...>

Sets the current node in the own context

<... tt:ref=?...? ...>

Sets the current node for a literal XML element

<tt:root ...>

Declares a data root

<tt:serialize ...>

Defines the direction of the transformation

<tt:s-cond ...>

Defines a conditioned transformation for the serialization

<tt:skip ...>

Skips XML elements during deserialization

<tt:switch ...>

Defines a case distinction between conditioned transformations

<tt:switch-var ...>

Defines a case distinction for variables

<tt:template ...>

Defines a main template or subtemplates

<tt:text ...>

Explicitly identifies a literal text

<tt:transform ...>

Root element of an ST program

<tt:value ...>

Transforms elementary data objects

<... tt:value-ref =?...? ...>

Short form for transformation of elementary data objects inliteral XML elements

<tt:variable ...>

Declares a variable

<tt:with-parameter ...>

Passes values to called ST programs and subtemplates

<tt:with-root ...>

Passes data nodes to called ST programs and subtemplates

<tt:write ...>

Writes the value of a variable to XML

 


下面写一个具体的实例


程序实现把转换好的文件保存为xml

ZTEST_GLB_TRANS


*&---------------------------------------------------------------------*
*& Report  ZTEST_GLB_TRANS
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ztest_glb_trans.
TYPESBEGIN OF xml_line,
data(100TYPE c,
END OF xml_line.

DATA:
lv_xml TYPE string,
it_xml TYPE TABLE OF xml_line.


DATABEGIN OF l_header,
        title1(100)   TYPE c,
        title2(100)   TYPE c,
        cus_name(100TYPE c,
        cus_val(100)  TYPE c,
        con_date(100TYPE c,
        con_val(100)  TYPE c,
        con_term(100TYPE c,
        con_tval(100TYPE c,
        quo_date(100TYPE c,
        quo_comm(100)  TYPE c,
        rep_date(100TYPE c,
        quo_no(100)   TYPE c,
        qty(100)  TYPE c,
        cond(100type c,
        type(100type c,
        des(100type c,
        amou(100type c,
        Unit(100type c,
END OF l_header.

DATA td_header LIKE TABLE OF l_header.


DATABEGIN OF l_item,
        item_type      type c,  "Package = ‘P’; Offer = ‘O’; Good = ‘G’; Subtotal = ‘S’
        mat_des(100)   TYPE c,
        mat_num(100)   type c,
        qty(100)       TYPE c,
        cond(100)      type c,
        con_des(100)   type c,
        amou(100)      type c,
        Unit(100)      type c,
END OF l_item.
DATA td_item LIKE TABLE OF l_item.


PERFORM get_data.

* call XML
CALL TRANSFORMATION ZMPS_PRICING_VALIDATE_XML
SOURCE it_header = td_header
       it_item_data = td_item
RESULT XML  lv_xml.

CALL FUNCTION 'SCMS_STRING_TO_FTEXT'
  EXPORTING
    text      = lv_xml
  TABLES
    ftext_tab = it_xml.
***download
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename = 'C:\Test01.xls'
    filetype = 'BIN'
  TABLES
    data_tab = it_xml.

WRITE:lv_xml.
*&---------------------------------------------------------------------*
*&      Form  GET_DATA
*&---------------------------------------------------------------------*
FORM get_data .
    l_header-title1   = 'Managed Print Services'.
    l_header-title2   = 'Pricing Validation Report'.
    l_header-cus_name = 'Customer'.
    l_header-cus_val  = 'ABC Ltd'.
    l_header-con_date = 'Contract Start Date'.
    l_header-con_val  = '8/1/2011'.
    l_header-con_term = 'Contract Term (months)'.
    l_header-con_tval = '48'.
    l_header-quo_date = 'Quote Date: 07/01/2011'.
    l_header-quo_comm  = 'Valid for 45 days'.
    l_header-rep_date = 'Report Date 07/01/2011'.
    l_header-quo_no   = 'Quote Ref: 123-456'.
    l_header-qty  = 'Qty'.
    l_header-cond = 'Condition'.
    l_header-type = 'type'.
    l_header-des = 'Discription'.
    l_header-amou = 'Amounts'.
    l_header-Unit = 'Unit'.
  APPEND l_header TO td_header.

  CLEAR l_item.
  l_item-mat_des = 'Package'.
  l_item-item_type = 'P'.
  APPEND l_item TO td_item.
  CLEAR l_item.

  l_item-mat_des = 'HP Hardware support'.
  l_item-item_type = 'O'.
  APPEND l_item TO td_item.
  CLEAR l_item.

  l_item-mat_des = 'HP LaserJet 4345MFP Printer'.
  l_item-mat_num = 'Q3942A'.
  l_item-qty    = '15'.
  l_item-cond   = 'ZA73'.
  l_item-con_des   = 'Gross Monthly Base Price (Amount Based)'.
  l_item-amou   = '1200'.
  l_item-unit   = 'Dolllar'.
  APPEND l_item TO td_item.
  CLEAR l_item.

  l_item-cond   = 'YA9F'.
  l_item-con_des   = 'Item Discount on Base Price (Amount Based)'.
  l_item-amou   = '200'.
  l_item-unit   = 'Dolllar'.
  APPEND l_item TO td_item.
  CLEAR l_item.

  l_item-cond   = 'ZM97'.
  l_item-con_des   = 'Uplift on Unit Color Click Price'.
  l_item-amou   = '0'.
  l_item-unit   = 'Dollar Amt Per 1000'.
  APPEND l_item TO td_item.
  CLEAR l_item.

  l_item-con_des   = 'Sub Totals'.
  l_item-amou   = '1200'.
  l_item-item_type   = 'S'.
  APPEND l_item TO td_item.
  CLEAR l_item.

  l_item-con_des   = 'Tax'.
  l_item-amou   = '200'.
  l_item-item_type   = 'S'.
  APPEND l_item TO td_item.
  clear l_item.
ENDFORM.                    " GET_DATA


输入tcode;strans。

ZMPS_PRICING_VALIDATE_XML
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

  <tt:root name="it_header"/>
  <tt:root name="it_item_data"/>

  <tt:template>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
              xmlns:o="urn:schemas-microsoft-com:office:office"
              xmlns:x="urn:schemas-microsoft-com:office:excel"
              xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
              xmlns:html="http://www.w3.org/TR/REC-html40"
              xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
      </ExcelWorkbook>
       <Styles>
          <Style ss:ID="s01">
           <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="10" ss:Color="#000000"
            ss:Italic="1"/>
          </Style>
            <Style ss:ID="s02">
           <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>
          </Style>
          <Style ss:ID="s03">
           <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
           <Borders/>
           <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="14" ss:Color="#000000"
            ss:Bold="1" ss:Italic="1"/>
           <Interior/>
           <NumberFormat/>
           <Protection/>
          </Style>
          <Style ss:ID="s04">
           <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
           <Borders/>
           <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="14" ss:Color="#000000"
            ss:Bold="1"/>
           <Interior/>
           <NumberFormat/>
           <Protection/>
          </Style>
          <Style ss:ID="s05">
           <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
          </Style>
          <Style ss:ID="s06">
           <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
            ss:Bold="1"/>
          </Style>
          <Style ss:ID="s07">
           <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="12" ss:Color="#000000"
            ss:Bold="1"/>
          </Style>

          <Style ss:ID="s08">
           <Borders>
            <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>
           </Borders>
          </Style>
          <Style ss:ID="s09">
           <Borders>
            <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>
           </Borders>
          </Style>
          <Style ss:ID="s10">
           <Borders>
            <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>
            <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>
           </Borders>
          </Style>
          <Style ss:ID="s11">
           <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>
           <Font  ss:FontName="Calibri" x:Family="Swiss"/>
            <Borders>
            <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
           </Borders>
          </Style>
          <Style ss:ID="s12">
           <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
            <Borders>
            <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
           </Borders>
          </Style>
          <Style ss:ID="s13">
            <Borders>
            <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
           </Borders>
          </Style>
      </Styles>

      <Worksheet ss:Name="Pricing validation">
        <Table ss:ExpandedColumnCount="50" x:FullColumns="1" x:FullRows="1">
           <Column ss:Index="2"  ss:Width="180"/>
           <Column ss:Index="10" ss:Width="200"/>
           <Column ss:Index="15" ss:Width="90"/>
          <tt:loop name="header" ref=".it_header">
            <Row>
              <Cell ss:Index="9" ss:StyleID="s03">
                <Data ss:Type="String">
                  <tt:value ref="$header.title1"/>          <!--Managed Print Services-->
                </Data>
              </Cell>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
            </Row>

            <Row>
              <Cell ss:Index="9" ss:StyleID="s04">
                <Data ss:Type="String">
                  <tt:value ref="$header.title2"/>          <!--Pricing Validation Report-->
                </Data>
              </Cell>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
            </Row>

            <Row>
              <Cell ss:Index="2">
                <Data ss:Type="String">
                  <tt:value ref="$header.cus_name"/>                 <!--Customer-->
                </Data>
              </Cell>
              <Cell ss:Index="3">
                <Data ss:Type="String">
                  <tt:value ref="$header.cus_val"/>                  <!--Customer value-->
                </Data>
              </Cell>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
            </Row>

            <Row>
              <Cell ss:Index="2">
                <Data ss:Type="String">
                  <tt:value ref="$header.con_date"/>        <!--Contract Start Date-->
                </Data>
              </Cell>
              <Cell ss:Index="3">
                <Data ss:Type="String">
                  <tt:value ref="$header.con_val"/>        <!--Contract Start Date value-->
                </Data>
              </Cell>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
            </Row>

            <Row>
              <Cell ss:Index="2">
                <Data ss:Type="String">
                  <tt:value ref="$header.con_term"/>         <!--Contract Term (months)-->
                </Data>
              </Cell>
              <Cell ss:Index="3">
                <Data ss:Type="String">
                  <tt:value ref="$header.con_tval"/>     <!--Contract Term (months) value-->
                </Data>
              </Cell>
              <Cell ss:Index="14">
                <Data ss:Type="String">
                  <tt:value ref="$header.rep_date"/>      <!--Report Date + ref value-->
                </Data>
              </Cell>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
            </Row>

            <Row>
              <Cell ss:Index="2">
                <Data ss:Type="String">
                  <tt:value ref="$header.quo_date"/>         <!--Quote Date: + ref value-->
                </Data>
              </Cell>

              <Cell ss:Index="3">
                <Data ss:Type="String">
                  <tt:value ref="$header.quo_comm"/>      <!--Valid for 45 days-->
                </Data>
              </Cell>
              <Cell ss:Index="14">
                <Data ss:Type="String">
                  <tt:value ref="$header.quo_no"/>       <!--Quote Ref: + ref value-->
                </Data>
              </Cell>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
            </Row>

            <Row>
              <Cell>
                <Data ss:Type="String"/>
              </Cell>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
            </Row>

          <Row>
              <Cell ss:Index="8" ss:StyleID="s05">
                <Data ss:Type="String">
                  <tt:value ref="$header.cond"/>          <!--item header Condition-->
                </Data>
              </Cell>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
          </Row>
          <Row>
              <Cell ss:Index="6" ss:StyleID="s11">
                <Data ss:Type="String">
                  <tt:value ref="$header.qty"/>            <!--item header Qty-->
                </Data>
              </Cell>

              <Cell ss:Index="7" ss:StyleID="s13">
              </Cell>

              <Cell ss:Index="8" ss:StyleID="s12">
                <Data ss:Type="String">
                  <tt:value ref="$header.type"/>         <!--item header type-->
                </Data>
              </Cell>

              <Cell ss:Index="9" ss:StyleID="s13">
              </Cell>

              <Cell ss:Index="10" ss:StyleID="s13">
                <Data ss:Type="String">
                  <tt:value ref="$header.des"/>           <!--item header description-->
                </Data>
              </Cell>

              <Cell ss:Index="11" ss:StyleID="s13">
              </Cell>

              <Cell ss:Index="12" ss:StyleID="s13">
              </Cell>



              <Cell ss:Index="13" ss:StyleID="s13">
                <Data ss:Type="String">
                  <tt:value ref="$header.amou"/>           <!--item header amout-->
                </Data>
              </Cell>

              <Cell ss:Index="14" ss:StyleID="s13">
              </Cell>

              <Cell ss:Index="15" ss:StyleID="s11">
                <Data ss:Type="String">
                  <tt:value ref="$header.Unit"/>           <!--item header unit-->
                </Data>
              </Cell>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
          </Row>
         </tt:loop>

     <!--here is item data-->
     <tt:loop name="item" ref=".it_item_data">
           <Row>

             <tt:switch>
              <tt:cond data="$item.item_type='P'">         <!--when type is 'P'-->
              <Cell ss:Index="2" ss:StyleID="s07">
                <Data ss:Type="String">
                  <tt:value ref="$item.mat_des"/>            <!--material package-->
                </Data>
              </Cell>
              </tt:cond>

              <tt:cond data="$item.item_type='O'">        <!--when type is 'O'-->
              <Cell ss:Index="2" ss:StyleID="s06">
                <Data ss:Type="String">
                  <tt:value ref="$item.mat_des"/>         <!--material offer-->
                </Data>
              </Cell>
              </tt:cond>

              <tt:cond>                                   <!--when type is others-->
              <Cell ss:Index="2" >
                <Data ss:Type="String">
                  <tt:value ref="$item.mat_des"/>          <!--material goods-->
                </Data>
              </Cell>
              </tt:cond>
             </tt:switch>

              <Cell ss:Index="3">
              </Cell>

             <tt:switch>
              <tt:cond data="$item.item_type='P'">       <!--when type is 'P'-->
              <Cell ss:Index="4" ss:StyleID="s07">
                <Data ss:Type="String">
                  <tt:value ref="$item.mat_num"/>          <!--package number-->
                </Data>
              </Cell>
              </tt:cond>

              <tt:cond data="$item.item_type='O'">       <!--when type is 'O'-->
              <Cell ss:Index="4" ss:StyleID="s06">
                <Data ss:Type="String">
                  <tt:value ref="$item.mat_num"/>         <!--offer number-->
                </Data>
              </Cell>
              </tt:cond>

              <tt:cond>                                       <!--when type is other-->
              <Cell ss:Index="4">
                <Data ss:Type="String">
                  <tt:value ref="$item.mat_num"/>                <!--good number-->
                </Data>
              </Cell>
              </tt:cond>
             </tt:switch>

              <Cell ss:Index="5">
              </Cell>

              <Cell ss:Index="6" ss:StyleID="s02">
                <Data ss:Type="String">
                  <tt:value ref="$item.qty"/>                        <!--goods quatity-->
                </Data>
              </Cell>

              <Cell ss:Index="7">
              </Cell>

              <Cell ss:Index="8" ss:StyleID="s05">
                <Data ss:Type="String">
                  <tt:value ref="$item.cond"/>                 <!--goods condition type-->
                </Data>
              </Cell>

              <Cell ss:Index="9">
              </Cell>

             <tt:switch>
              <tt:cond data="$item.item_type='S'">           <!--when type is 'S'-->
              <Cell ss:Index="10" ss:StyleID="s02">
                <Data ss:Type="String">
                  <tt:value ref="$item.con_des"/>          <!--goods condition description-->
                </Data>
              </Cell>
              </tt:cond>

              <tt:cond>
              <Cell ss:Index="10">                            <!--when type is not 'S'-->
                <Data ss:Type="String">
                  <tt:value ref="$item.con_des"/>            <!--subtotal/tax-->
                </Data>
              </Cell>
              </tt:cond>
             </tt:switch>

              <Cell ss:Index="11">
              </Cell>

              <Cell ss:Index="12">
              </Cell>

              <Cell ss:Index="13" ss:StyleID="s02">
                <Data ss:Type="String">
                  <tt:value ref="$item.amou"/>                       <!--goods amout-->
                </Data>
              </Cell>

              <Cell ss:Index="14">
              </Cell>

              <Cell ss:Index="15" ss:StyleID="s02">
                <Data ss:Type="String">
                  <tt:value ref="$item.unit"/>                       <!--goods unit-->
                </Data>
              </Cell>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
            </Row>
          </tt:loop>

          <Row>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
          </Row>
          <Row>
              <Cell ss:Index="16" ss:StyleID="s08">
              </Cell>
          </Row>

          <Row>
              <Cell ss:Index="1" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="2" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="3" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="4" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="5" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="6" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="7" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="8" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="9" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="10" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="11" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="12" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="13" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="14" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="15" ss:StyleID="s09">
              </Cell>
              <Cell ss:Index="16" ss:StyleID="s10">
              </Cell>
          </Row>
        </Table>

          <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
           <Zoom>81</Zoom>
           <Selected/>
           <DoNotDisplayGridlines/>
              <FreezePanes/>
               <FrozenNoSplit/>
               <SplitHorizontal>9</SplitHorizontal>
               <TopRowBottomPane>9</TopRowBottomPane>
               <ActivePane>2</ActivePane>
               <Panes>
                <Pane>
                 <Number>3</Number>
                </Pane>
                <Pane>
                 <Number>2</Number>
                 <RangeSelection>R6C1:R6C21</RangeSelection>
                </Pane>
               </Panes>
           <ProtectObjects>False</ProtectObjects>
           <ProtectScenarios>False</ProtectScenarios>
          </WorksheetOptions>

      </Worksheet>
    </Workbook>
  </tt:template>
</tt:transform>

最后显示EXCEL显示效果如图所示



这篇关于讲IDOC生成的XML文件转化为excel文件的方法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/931085

相关文章

Python中提取文件名扩展名的多种方法实现

《Python中提取文件名扩展名的多种方法实现》在Python编程中,经常会遇到需要从文件名中提取扩展名的场景,Python提供了多种方法来实现这一功能,不同方法适用于不同的场景和需求,包括os.pa... 目录技术背景实现步骤方法一:使用os.path.splitext方法二:使用pathlib模块方法三

Python打印对象所有属性和值的方法小结

《Python打印对象所有属性和值的方法小结》在Python开发过程中,调试代码时经常需要查看对象的当前状态,也就是对象的所有属性和对应的值,然而,Python并没有像PHP的print_r那样直接提... 目录python中打印对象所有属性和值的方法实现步骤1. 使用vars()和pprint()2. 使

CSS实现元素撑满剩余空间的五种方法

《CSS实现元素撑满剩余空间的五种方法》在日常开发中,我们经常需要让某个元素占据容器的剩余空间,本文将介绍5种不同的方法来实现这个需求,并分析各种方法的优缺点,感兴趣的朋友一起看看吧... css实现元素撑满剩余空间的5种方法 在日常开发中,我们经常需要让某个元素占据容器的剩余空间。这是一个常见的布局需求

Python常用命令提示符使用方法详解

《Python常用命令提示符使用方法详解》在学习python的过程中,我们需要用到命令提示符(CMD)进行环境的配置,:本文主要介绍Python常用命令提示符使用方法的相关资料,文中通过代码介绍的... 目录一、python环境基础命令【Windows】1、检查Python是否安装2、 查看Python的安

SpringBoot项目配置logback-spring.xml屏蔽特定路径的日志

《SpringBoot项目配置logback-spring.xml屏蔽特定路径的日志》在SpringBoot项目中,使用logback-spring.xml配置屏蔽特定路径的日志有两种常用方式,文中的... 目录方案一:基础配置(直接关闭目标路径日志)方案二:结合 Spring Profile 按环境屏蔽关

Maven 配置中的 <mirror>绕过 HTTP 阻断机制的方法

《Maven配置中的<mirror>绕过HTTP阻断机制的方法》:本文主要介绍Maven配置中的<mirror>绕过HTTP阻断机制的方法,本文给大家分享问题原因及解决方案,感兴趣的朋友一... 目录一、问题场景:升级 Maven 后构建失败二、解决方案:通过 <mirror> 配置覆盖默认行为1. 配置示

SpringBoot排查和解决JSON解析错误(400 Bad Request)的方法

《SpringBoot排查和解决JSON解析错误(400BadRequest)的方法》在开发SpringBootRESTfulAPI时,客户端与服务端的数据交互通常使用JSON格式,然而,JSON... 目录问题背景1. 问题描述2. 错误分析解决方案1. 手动重新输入jsON2. 使用工具清理JSON3.

使用jenv工具管理多个JDK版本的方法步骤

《使用jenv工具管理多个JDK版本的方法步骤》jenv是一个开源的Java环境管理工具,旨在帮助开发者在同一台机器上轻松管理和切换多个Java版本,:本文主要介绍使用jenv工具管理多个JD... 目录一、jenv到底是干啥的?二、jenv的核心功能(一)管理多个Java版本(二)支持插件扩展(三)环境隔

Java中Map.Entry()含义及方法使用代码

《Java中Map.Entry()含义及方法使用代码》:本文主要介绍Java中Map.Entry()含义及方法使用的相关资料,Map.Entry是Java中Map的静态内部接口,用于表示键值对,其... 目录前言 Map.Entry作用核心方法常见使用场景1. 遍历 Map 的所有键值对2. 直接修改 Ma

Mybatis Plus Join使用方法示例详解

《MybatisPlusJoin使用方法示例详解》:本文主要介绍MybatisPlusJoin使用方法示例详解,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,... 目录1、pom文件2、yaml配置文件3、分页插件4、示例代码:5、测试代码6、和PageHelper结合6