Requirements
? xmpp ????? ???/???? ??? ??? ???? ?????. ?? ?(??? ?? + ? ??), ????? ? ??? ? ???? ???? ??? ?????.
?? ????
?? ?? ????# ????#
- ????? ?? ??? ?? ???????? ???? ??? ?????.
package?com.onewaveinc.utils; import?java.util.List; import?org.apache.poi.hssf.usermodel.HSSFCell; import?org.apache.poi.hssf.usermodel.HSSFCellStyle; import?org.apache.poi.hssf.usermodel.HSSFRow; import?org.apache.poi.hssf.usermodel.HSSFSheet; import?org.apache.poi.hssf.usermodel.HSSFWorkbook; import?com.onewaveinc.mip.log.Logger; import?com.onewaveinc.user.entity.UserInfo; /** ?*?生成Excel文件工具類 ?*?@author?wxin ?* ?*/ public?class?ExcelUtil?{ ????private?static?Logger?logger?=?Logger.getInstance(ExcelUtil.class); ????/** ?????*?導(dǎo)出Excel ?????*?@param?sheetName?sheet名稱 ?????*?@param?title?標(biāo)題 ?????*?@param?values?內(nèi)容 ?????*?@param?wb?HSSFWorkbook對象 ?????*?@return ?????*/ ????public?static?HSSFWorkbook?getHSSFWorkbook(String?sheetName,String?[]title,List<userinfo>?valueList,?HSSFWorkbook?wb){ ????????//?第一步,創(chuàng)建一個HSSFWorkbook,對應(yīng)一個Excel文件 ????????if(wb?==?null){ ????????????wb?=?new?HSSFWorkbook(); ????????} ????????//?第二步,在workbook中添加一個sheet,對應(yīng)Excel文件中的sheet ????????HSSFSheet?sheet?=?wb.createSheet(sheetName); ????????//?第三步,在sheet中添加表頭第0行,注意老版本poi對Excel的行數(shù)列數(shù)有限制 ????????HSSFRow?row?=?sheet.createRow(0); ????????//?第四步,創(chuàng)建單元格,并設(shè)置值表頭?設(shè)置表頭居中 ????????HSSFCellStyle?style?=?wb.createCellStyle(); ????????//?創(chuàng)建一個居中格式 ????????style.setAlignment(HSSFCellStyle.ALIGN_CENTER);? ????????//聲明列對象 ????????HSSFCell?cell?=?null; ????????//創(chuàng)建標(biāo)題 ????????for(int?i=0;i<title.length>?0)?{ ????????????for(int?i=0;i<valuelist.size><br>2. Excel ?? ?? ??<pre class="brush:php;toolbar:false">????public?void?run()?throws?InterruptedException,?IOException?{ ?????????ExportExcel(); ???} ????/** ?????*?定時導(dǎo)出XMPP每個機房(一個集群)的在線用戶的信息 ?????*?導(dǎo)出信息:用戶賬號,mac地址,登陸的IP,登陸域名,機頂盒的型號,版本,和以及登陸所在節(jié)點的ip, ?????*?顯示?登陸的時間,登陸的時長(現(xiàn)在的時間減去登陸的時間)。 ?????*/ ????public??String?ExportExcel()?{ ????????String?result?=?""; ????????try?{ ????????????... ????????????result?=?ImportDataExcel(offlineUserInfoList,?serverName,?false); ????????????logger.info("**此次處理離線結(jié)果為:"+result); ????????????... ???????????? ????????}?catch?(Exception?e)?{ ????????????result?=?"failed"; ????????????e.printStackTrace(); ????????} ????????return?result; ???????? ????} ????/** ?????*?導(dǎo)出用戶信息數(shù)據(jù)到Excel表格 ?????*?@param?userInfoList ?????*?@return?msg?“failed”?or?“success” ?????*/ ????public?String?ImportDataExcel(List<userinfo>?userInfoList,?String?serverName?,?boolean?isOnline)?{ ????????String?msg?=?""; ????????String?fileName?=?""; ????????String?sheetName?=?""; ????????String[]?title?=?{"用戶賬號","mac地址","登陸IP","登陸域名","機頂盒型號",?"機頂盒版本", ????????????????"登錄所在節(jié)點的IP",?"登陸時間",?"登陸時長"}; ????????//設(shè)置日期格式 ????????SimpleDateFormat?df?=?new?SimpleDateFormat("yyyyMMddHHmmss"); ????????//?new?Date()為獲取當(dāng)前系統(tǒng)時間,也可使用當(dāng)前時間戳 ????????String?date?=?df.format(new?Date()); ????????if?(isOnline)?{ ????????????fileName?=?serverName+"-online-usersInfo-"+date+".xls"; ????????????sheetName?=?serverName+"在線用戶信息表"; ????????}?else?{ ????????????fileName?=?serverName+"-offline-usersInfo-"+date+".xls"; ????????????sheetName?=?serverName+"離線用戶信息表"; ????????} ????????HSSFWorkbook?wb?=?new?HSSFWorkbook(); ????????wb?=?ExcelUtil.getHSSFWorkbook(sheetName,?title,?userInfoList,?null); ????????ByteArrayOutputStream?os?=?new?ByteArrayOutputStream(); ????????try{ ????????????wb.write(os); ????????} ????????catch?(IOException?e){ ????????????msg?=?"failed"; ????????????e.printStackTrace(); ????????} ????????byte[]?content?=?os.toByteArray(); ????????//Excel文件生成后存儲的位置。 ????????File?file?=?new?File(path+"/"+fileName); ????????OutputStream?fos??=?null; ????????try{ ????????????fos?=?new?FileOutputStream(file); ????????????fos.write(content); ????????????os.close(); ????????????fos.close(); ????????????if?("".equals(msg))?{ ????????????????msg?=?"success"; ????????????} ????????????logger.info("生成用戶信息Excel表格成功:"+?fileName); ????????} ????????catch?(Exception?e){ ????????????msg?=?"failed"; ????????????logger.error("生成用戶信息Excel表格失敗:"+?fileName); ????????????e.printStackTrace(); ????????} ????????return?msg; ????}</userinfo>
3. ?? ??
@SuppressWarnings("deprecation") @Resource("userLoginService") @Bean("contbiz.imoss.userloginservice") public?class?UserChannelLoginService?{ ... ????@Post ????@Path("exportExcel") ????public?String?ExportExcel()?{ ????????String?result?=?""; ????????result?=?exportXMPPUserInfo.ExportExcel(); ????????return?result; ????} ... }
#導(dǎo)出文件路徑:導(dǎo)出XMPP各個機房的在線用戶信息Excel表, #<require> /spring/config.properties|xmpp.export.excel.path=D:\Doc\test111 #定時任務(wù)時間:導(dǎo)出XMPP各個機房的在線用戶信息Excel表, #<require> /spring/config.properties|xmpp.export.excel.time=0?44,45,46,47?20?11?*??</require></require>
5. ??? ??
<!-- 指定執(zhí)行的目標(biāo)類、方法 --> ????<bean> ?????????????<!-- 指定任務(wù)類 --> ?????????????<property></property> ????????????<!-- 指定任務(wù)方法 --> ?????????????<property></property> ?????????????<property></property> ?????</bean> ????<!-- 設(shè)置執(zhí)行任務(wù)以及時間 --> ?????<bean> ?????????????<property> ????????????????????<ref></ref> ?????????????</property> ?????????????<property> ????????????????????<value>${xmpp.export.excel.time}</value> ?????????????</property> ??????</bean> ??????<!-- 啟動定時器 --> ??????<bean> ?????????????<property> ????????????????????<list> ???????????????????????????<!-- <ref bean="autoSmsB2cJobDetailSimpleTrigger" /> --> ???????????????????????????<ref></ref> ????????????????????</list> ?????????????</property> ???????</bean>
? ??? Java? Excel ??? ???? ?? ??(?? ?)? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

JDBC ????? ???? ????? ?? ?? ?? ??? ?? ?? ??? ?? ? ?? ??? ?? ?? ?? ??? ???????. 1. ????? ????? Conn.SetAutoCommit (False)?? ??????. 2. ??? ? ????? ?? ?? SQL ??? ?????. 3. ?? ??? ??? ?? Conn.commit ()?? ???? ??? ???? ???? ?? ??? ???? Conn.Rollback ()?? ??????. ???, ? ??? ???? ????, ??? ???? ????, ?? ??? ??? ?? ??? ??? ???? ? ???????. ?? ?? ?? ???? ????? ??? ???? ?? ?? ???? ???? ??? ????? ?? ??? ??? ? ?? ???? ?? ????.

?? ?? ? ?? ???? ???? ?? Java.Time ???? ???? ??????. 2. LocalDate, LocalDateTime ? LocalTime? ?? ?? ??? ??? ?????. 3. () ???? ???? ?? ??? ??? ????. 4. ???/???? ??? ???? ??? ????? ??? ??????. 5. ZonedDateTime ? Zoneid? ???? ???? ??????. 6. DateTimeFormatter? ?? ?? ? ?? ?? ?? ???; 7. ??? ?? ?? ?? ??? ????? ?? ??????. ?? Java? ?? ??? ???? ??? ??? ???? Java.Timeapi ??? ?? ??? ???????.

Pre-FormancetArtUptimeMoryUsage, Quarkusandmicronautleadduetocompile-timeprocessingandgraalvsupport, withquarkusoftenperforminglightbetterine serverless sinarios.2.thyvelopecosyste,

NetworkPortSandfirewallsworkTogetToenableCommunication whileensuringsecurity.1.networkportSarevirtualendpointsnumbered0–65535, Withwell-nownports like80 (http), 443 (https), 22 (ssh) ? 25 (smtp) ?? (specservices

Java 's Garbage Collection (GC)? ???? ???? ???? ??????, ?? ? ??? ??? ? ??? ??? ??? ??? ????. 1.GC? ?? ?? (? : ?? ??, ?? ???, ?? ?? ?)?? ??? ???? ????, ?? ? ??? ??? ???? ?????. 2. ?? ???? ????? ????, ?? ?? ??? ??? ???? ?? ??? ??????. 3. ?? ?? ?? ?? : ??? ?? (Eden, S0, S1)? ?? ????? ?????. ??? ??? ?? ? MajorGC? ???? ? ??? ? ????. Metaspace? ??? ?? ???? ?????. 4. JVM? ??? GC ??? ?????. SerialGC? ??? ?? ????? ?????. ParallelGC? ???? ??????. CMS? ?? ???

??? htmlinput ??? ???? ??? ???? ????? ??? ??? ?? ??? ???? ???? ? ????. 1. ???, ???, ??, ?? ? ??? ?? ??? ??? ?? ?? ?? ??? ???? ???? ??? ? ???? ??? ? ????. 2. HTML5? ?????? ??? ? ?? ?? ??? ?? ? ??? URL, ??, ?? ? ??? ?? ??? ??? ??????. 3. ?? ?? ? ? ??? ??? ???? ?? ??? ???? ???? ?? ???? ?? ???? ???? ?? ? ? ??? ?? ???????.

GradleisBetTerChoiceFormostNewProjectSduetoitssuperiorflexible, Performance, and ModernToolingsupport.1.Gradle'Sgroovy/kotlindslismoreConcisENDEXPRESSIVETHANMAVEN'SVOSEXML.2.GradleOutsMaveninbuildweedweedweedweedweedweedweedweedweedweedweedweedweedweede

DEFER? ??? ???? ?? ??? ??? ???? ? ?????. ?? ??? ?? ? ? ?? ????, ??? ??? ? ?? ?? (LIFO)? ??? ?????. 1. ?? ??? ??? ? ??? ?????. 2. ?? ??? ?? ??? ??? ????? ?????. 3. ?? ? ?? ?? ??? ? ????. 4. ??? ?????? ??? ??? ???? ?????. 5. ?? ??? ???? ?? ??? ?? ??? ?????. ??? ??? ?? ?? ? ???? ???? ? ????.
