EasyPoi 匯入校驗使用

2021-10-18 13:26:22 字數 2649 閱讀 1665

因工作需要,使用easypoi匯入**,並進行校驗,將**中有問題的地方,給出提示資訊,以**形式返回.

本篇,直接講述excel匯入校驗,基本介紹後續補上.

>

>

cn.afterturngroupid

>

>

easypoi-spring-boot-starterartifactid

>

>

4.1.2version

>

dependency

>

/**

* @author chengfei

* @description 手機類

* @date 2021/1/30

*/@data

@allargsconstructor

@noargsconstructor

public

class

phonedto

public

class

excelutils

/** * 預設的 excel 匯出

** @param list 資料

* @param pojoclass pojo型別

* @param filename 檔名稱

* @param response

* @param exportparams 匯出引數

* @param filename 檔名稱

* @param response

* @param workbook excel資料

* excel 型別列舉

*/enum exceltypeenum

public string getvalue()

}}

/**

* @author chengfei

* @description

* @date 2021/1/30

*/@component

public

class

phoneexcelverifiyname

implements

iexcelverifyhandler

// 手機名為小公尺 則為重複錄入if(

"小公尺"

.equals

(phonedto.

getphonename()

))else

} excelverifyhandlerresult.

setmsg

(str.

tostring()

);}return excelverifyhandlerresult;

}}

/**

* @author chengfei

* @description

* @date 2021/1/30

*/@controller

("/phone"

)public

class

phonecontroller

@autowired

private phoneexcelverifiyname phoneexcelverifiyname;

/** * 檔案校驗匯入

要求對匯入的**字段進行校驗,並將錯誤的列,給出提示返回,如沒有錯誤,返回**內容.

要求:

EasyPOI關於日期匯入問題

cn.afterturn easypoi spring boot starter 3.3.0 或者引用 cn.afterturn easypoi base 3.0.3 cn.afterturn easypoi web 3.0.3 cn.afterturn easypoi annotation 3.0...

EasyPoi使用入門

本文非原創,來自新增鏈結描述 cn.afterturn easypoi base 3.2.0 cn.afterturn easypoi web 3.2.0 cn.afterturn easypoi annotation 3.2.0 2.準備乙個類 excel 代表這個欄位要生成到excel中去 na...

easypoi實現excel的匯出 匯入

我之前一直用poi匯入匯出,寫起來還是挺麻煩的,雖然可以貼上複製相同 但是畢竟有好大一坨。所以嘗試用easypoi做excel的匯入匯出。閒言少敘,開始幹活 第一步 導包 easypoi需要導包的 cn.afterturn groupid easypoi base artifactid 3.2.0 ...