<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          common.officeOffice 軟件操作組件

          聯(lián)合創(chuàng)作 · 2023-09-29 22:07

          java組件,實現(xiàn)Excel,word,pdf等常用office的

          #目前只完善Excel的導(dǎo)入導(dǎo)出,方便簡潔。具體步驟如下: 1,定義與Excel對應(yīng)的bean類,加上配置。

          @ExcelSheet(sheetIndex=0,titleIndex=1,dataIndex=2)
          public class UploadUser {
          @ExcelColumn(fieldTitle = "登錄名稱", columnIndex = 0)
          
          private String username;
          
          @ExcelColumn(fieldTitle = "角色", columnIndex = 1)
          
          //@ColumnDataHandler("io.tsing.admin.util.RoleTranslate")
          
          private String role;
          
          @ExcelColumn(fieldTitle = "昵稱", columnIndex = 2)
          
          private String nickname;
          
          @ExcelColumn(fieldTitle = "姓名", columnIndex = 3)
          
          private String realname;
          
          @ExcelColumn(fieldTitle = "性別", columnIndex = 4)
          
          private String gender;
          
          @ExcelColumn(fieldTitle = "密碼", columnIndex = 5)
          
          //@ColumnDataHandler("io.tsing.admin.util.PassWordTranslate")
          
          private String password;
          
          @ExcelColumn(fieldTitle = "郵件", columnIndex = 6)
          
          private String email;
          
          @ExcelColumn(fieldTitle = "手機號碼", columnIndex = 7)
          
          private String mobile;
          
          @ExcelColumn(fieldTitle = "電話號碼", columnIndex = 8)
          
          private String telephone;
          
          
          get*(){}
          set*(*){}
          }

          2、調(diào)用導(dǎo)入導(dǎo)出方法,就可以實現(xiàn)導(dǎo)入導(dǎo)出了。

          public void static main(String arg[]) {
          ExcelUtil excelUtil = new ExcelUtil();
          //導(dǎo)入:
          InputStream inputStream=new FileInputStream(String.format("%s%s", path, "persionTempalte.xlsx"));
          List s=excelUtil.parse(inputStream, UploadUser.class);
          導(dǎo)出: File file = new File(String.format("%s%s", path, "text.xlsx"));
          OutputStream os = new FileOutputStream(file);
          excelUtil.export(os, list, maps, null);
          }

          #就只要倆個步驟就可以實現(xiàn)導(dǎo)出導(dǎo)入,而且支持大數(shù)據(jù)的導(dǎo)出導(dǎo)入,還有可以個性化處理每一列的數(shù)據(jù)。

          瀏覽 24
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  欧美日韩视频伦理网页 | 国产精品久久久久久吹潮 | 亚洲欧美一区二区三区在线观看 | 插菊花中文网久久久 | 免费看无码视频 |