excel表格数据导入导出

时间:2021-10-06 12:25:04

/**
* 导出数据到excel表格
* Created by shenjianhua on 2018-12-28
*/
package com.luer.comm.excel;

import java.io.FileOutputStream;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.CellRangeAddress;
import org.apache.poi.hssf.util.HSSFColor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; /**
* 导出数据到excel表格
* Created by shenjianhua on 2018-12-28
*/
@RestController
@RequestMapping("exportExcel")
public class ExportexcelUtil { /*
*
* 常用组件: HSSFWorkbook excel的文档对象 HSSFSheet excel的表单 HSSFRow excel的行 HSSFCell excel的格子单元 HSSFFont excel字体 样式: HSSFCellStyle cell样式
*
* */
public static void main(String [] args) throws Exception { //excel的表单名
String sheetName = "操作员数据表1";
//excel的标题名
String titleName = "操作员数据表2";
//提示 没啥用
String fileName = "操作员数据表3";
//int columnNumber = 3;
int columnNumber = 9;
//int[] columnWidth = { 10, 20, 30 };
//int[] columnWidth = {40,20,20,20,20,20,20,20,20};
String[][] dataList = { { "4e7a2bbe5cc24a63b214b3824596cd543","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg"},
{ "4e7a2bbe5cc24a63b214b38296cd543","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg" },
{ "9198a9f1acf74b648b50eee69d312276","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg"},
{ "9198a9f1acf14b648b50eee69d312276","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg"},
{ "9198a9f1acf24b648b50eee69d312276","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg"},
{ "9198a9f1acf34b648b50eee69d312276","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg"},
{ "9198a9f1acf44b648b50eee69d312276","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg"},
{ "9198a9f1acf54b648b50eee69d312276","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg"},
{ "9198a9f1acf64b648b50eee69d312276","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg"},
{ "9198a9f1acf84b648b50eee69d312276","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg"},
{ "9198a9f1acf94b648b50eee69d312276","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg"},
{ "9198a9f1acfw4b648b50eee69d312276","2018-12-27 10:34:19","2018-12-27 10:34:19","usernamedsfsdsf","passwrodsdlkjflsd","nicknamesdgfds","18896876323","1324325432.qq.com","remarkdsgfdg"}
};
String[] columnName = { "操作员id", "创造时间", "更新时间","登录账号","登录密码","昵称","手机号码","邮箱","注释" };
new ExportexcelUtil().ExportNoResponse(sheetName, titleName,
columnNumber, /*columnWidth,*/ columnName, dataList, fileName);
}
/*
* 导出数据到excel表格
* */ /*
* String titleName: excel标题名
*
* String sheetName: excel表单名
*
* int columnNumber: excel标题名的数量
*
* String[] columnName:excel标题名成
*
* String[][] dataList: 导入的数据集合
* */ @RequestMapping("/export")
public void ExportNoResponse( String titleName,String sheetName,
int columnNumber, /*int[] columnWidth,*/
String[] columnName, String[][] dataList,String fileName) throws Exception {
int flag = 0;
int[] columnWidth=new int[columnNumber];
for(flag=0;flag<columnNumber;flag++){
if(flag==0){
columnWidth[flag] = 40;
//System.out.println("columnWidth[i]: "+columnWidth[flag]);
}else{ columnWidth[flag] = 30;
//System.out.println("columnWidth[i]: "+columnWidth[flag]);
}
} if (columnNumber == columnWidth.length&& columnWidth.length == columnName.length) {
// 第一步,创建一个webbook,对应一个Excel文件
HSSFWorkbook wb = new HSSFWorkbook();
// 第二步,在webbook中添加一个sheet,对应Excel文件中的sheet
HSSFSheet sheet = wb.createSheet(sheetName);
// sheet.setDefaultColumnWidth(15); //统一设置列宽
for (int i = 0; i < columnNumber; i++)
{
for (int j = 0; j <= i; j++)
{
if (i == j)
{
sheet.setColumnWidth(i, columnWidth[j] * 256); // 单独设置每列的宽
}
}
}
// 创建第0行 也就是标题
HSSFRow row1 = sheet.createRow((int) 0);
row1.setHeightInPoints(50);// 设备标题的高度
// 第三步创建标题的单元格样式style2以及字体样式headerFont1
HSSFCellStyle style2 = wb.createCellStyle();
style2.setAlignment(HSSFCellStyle.ALIGN_CENTER);
style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
style2.setFillForegroundColor(HSSFColor.LIGHT_TURQUOISE.index);
style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
HSSFFont headerFont1 = (HSSFFont) wb.createFont(); // 创建字体样式
headerFont1.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); // 字体加粗
headerFont1.setFontName("黑体"); // 设置字体类型
headerFont1.setFontHeightInPoints((short) 15); // 设置字体大小
style2.setFont(headerFont1); // 为标题样式设置字体样式 HSSFCell cell1 = row1.createCell(0);// 创建标题第一列
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0,
columnNumber - 1)); // 合并第0到第17列
cell1.setCellValue(titleName); // 设置值标题
cell1.setCellStyle(style2); // 设置标题样式 // 创建第1行 也就是表头
HSSFRow row = sheet.createRow((int) 1);
row.setHeightInPoints(37);// 设置表头高度 // 第四步,创建表头单元格样式 以及表头的字体样式
HSSFCellStyle style = wb.createCellStyle();
style.setWrapText(true);// 设置自动换行
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); // 创建一个居中格式 style.setBottomBorderColor(HSSFColor.BLACK.index);
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style.setBorderRight(HSSFCellStyle.BORDER_THIN);
style.setBorderTop(HSSFCellStyle.BORDER_THIN); HSSFFont headerFont = (HSSFFont) wb.createFont(); // 创建字体样式
headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); // 字体加粗
headerFont.setFontName("黑体"); // 设置字体类型
headerFont.setFontHeightInPoints((short) 10); // 设置字体大小
style.setFont(headerFont); // 为标题样式设置字体样式 // 第四.一步,创建表头的列
for (int i = 0; i < columnNumber; i++)
{
HSSFCell cell = row.createCell(i);
cell.setCellValue(columnName[i]);
cell.setCellStyle(style);
} // 第五步,创建单元格,并设置值
for (int i = 0; i < dataList.length; i++)
{
row = sheet.createRow((int) i + 2);
// 为数据内容设置特点新单元格样式1 自动换行 上下居中
HSSFCellStyle zidonghuanhang = wb.createCellStyle();
zidonghuanhang.setWrapText(true);// 设置自动换行
zidonghuanhang
.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); // 创建一个居中格式 // 设置边框
zidonghuanhang.setBottomBorderColor(HSSFColor.BLACK.index);
zidonghuanhang.setBorderBottom(HSSFCellStyle.BORDER_THIN);
zidonghuanhang.setBorderLeft(HSSFCellStyle.BORDER_THIN);
zidonghuanhang.setBorderRight(HSSFCellStyle.BORDER_THIN);
zidonghuanhang.setBorderTop(HSSFCellStyle.BORDER_THIN); // 为数据内容设置特点新单元格样式2 自动换行 上下居中左右也居中
HSSFCellStyle zidonghuanhang2 = wb.createCellStyle();
zidonghuanhang2.setWrapText(true);// 设置自动换行
zidonghuanhang2
.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); // 创建一个上下居中格式
zidonghuanhang2.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 左右居中 // 设置边框
zidonghuanhang2.setBottomBorderColor(HSSFColor.BLACK.index);
zidonghuanhang2.setBorderBottom(HSSFCellStyle.BORDER_THIN);
zidonghuanhang2.setBorderLeft(HSSFCellStyle.BORDER_THIN);
zidonghuanhang2.setBorderRight(HSSFCellStyle.BORDER_THIN);
zidonghuanhang2.setBorderTop(HSSFCellStyle.BORDER_THIN);
HSSFCell datacell = null;
for (int j = 0; j < columnNumber; j++)
{
datacell = row.createCell(j);
datacell.setCellValue(dataList[i][j]);
datacell.setCellStyle(zidonghuanhang2);
}
} // 第六步,将文件存到指定位置
try {
FileOutputStream fout = new FileOutputStream("D:operator.xls");
wb.write(fout);
String str = "导出" + fileName + "成功!";
System.out.println(str);
fout.close();
} catch (Exception e) {
e.printStackTrace();
String str1 = "导出" + fileName + "失败!";
System.out.println(str1);
}
} else {
System.out.println("列数目长度名称三个数组长度要一致");
} } }
/**
* Excel 导入到mysql
* Created by shenjianhua on 2018-12-28
*/
package com.luer.comm.excel;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List; import com.luer.operator.bean.Operator;
import com.luer.operator.service.OperatorService;
import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; /**
* Excel 导入到mysql
* Created by shenjianhua on 2019-1-3
*/
@RestController
@RequestMapping("/importExcel")
public class ImportexcelUtil { private static Logger logger = Logger.getLogger(ImportexcelUtil.class);
private final static String xls = "xls";
private final static String xlsx = "xlsx"; /**
* 读入excel文件,解析后返回
*
* @param
* @throws IOException
*/ @Autowired
OperatorService operatorService; /*
* 读取excel数据导入数据库
* */
@ResponseBody
@RequestMapping("/readExcel")
public List<String[]> readExcel(MultipartFile file) throws Exception {
//检查文件
checkFile(file);
//获得Workbook工作薄对象
Workbook workbook = getWorkBook(file);
//创建返回对象,把每行中的值作为一个数组,所有行作为一个集合返回
List<String[]> list = new ArrayList<String[]>();
if (workbook != null) {
for (int sheetNum = 0; sheetNum < workbook.getNumberOfSheets(); sheetNum++) {
//获得当前sheet工作表
Sheet sheet = workbook.getSheetAt(sheetNum);
if (sheet == null) {
continue;
}
//获得当前sheet的开始行
int firstRowNum = sheet.getFirstRowNum();
//获得当前sheet的结束行
int lastRowNum = sheet.getLastRowNum();
//循环除了第一行的所有行
for (int rowNum = firstRowNum + 1; rowNum <= lastRowNum; rowNum++) {
//获得当前行
Row row = sheet.getRow(rowNum);
if (row == null) {
continue;
}
//获得当前行的开始列
int firstCellNum = row.getFirstCellNum();
//获得当前行的列数
int lastCellNum = row.getPhysicalNumberOfCells();
String[] cells = new String[row.getPhysicalNumberOfCells()];
//循环当前行
for (int cellNum = firstCellNum; cellNum < lastCellNum; cellNum++) {
Cell cell = row.getCell(cellNum);
cells[cellNum] = getCellValue(cell);
}
list.add(cells);
} }
//workbook.close();
} /*
* 封装对象存入数据库
*
* 修改字段的遍历次数
* */
for(int k=1;k<9;k++) {
Operator operator = new Operator();
if(null != list.get(k)[0]){
operator.setId(list.get(k)[0]);
}
if(null != list.get(k)[1]){
operator.setCreateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(list.get(k)[1]));
/* String string = "2016-10-24 21:59:06";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf.parse(list.get(k)[1]));*/
}
if(null != list.get(k)[2]){
operator.setCreateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(list.get(k)[1]));
}
if(null != list.get(k)[3]){
operator.setUsername(list.get(3)[3]);
}
if(null != list.get(k)[4]){
operator.setPassword(list.get(k)[4]);
}
if(null != list.get(k)[5]){
operator.setNickname(list.get(k)[5]);
}
if(null != list.get(k)[6]){
operator.setPhoneNumber(list.get(k)[6]);
}
if(null != list.get(k)[7]){
operator.setEmail(list.get(k)[8]);
}
if(null != list.get(k)[8]){
operator.setRemark(list.get(k)[8]);
}
operatorService.insertOperator(operator);
} return list;
} @ResponseBody
@RequestMapping("/readExcel2")
public String[] readExcel2(MultipartFile file) throws IOException {
//检查文件
checkFile(file);
//获得Workbook工作薄对象
Workbook workbook = getWorkBook(file);
//创建返回对象,把每行中的值作为一个数组,所有行作为一个集合返回
List<String[]> list = new ArrayList<String[]>();
if (workbook != null) {
for (int sheetNum = 0; sheetNum < workbook.getNumberOfSheets(); sheetNum++) {
//获得当前sheet工作表
Sheet sheet = workbook.getSheetAt(sheetNum);
if (sheet == null) {
continue;
}
//获得当前sheet的开始行
int firstRowNum = sheet.getFirstRowNum();
//获得当前sheet的结束行
int lastRowNum = sheet.getLastRowNum();
//循环除了第一行的所有行
for (int rowNum = firstRowNum + 1; rowNum <= lastRowNum; rowNum++) {
//获得当前行
Row row = sheet.getRow(rowNum);
if (row == null) {
continue;
}
//获得当前行的开始列
int firstCellNum = row.getFirstCellNum();
//获得当前行的列数
int lastCellNum = row.getPhysicalNumberOfCells();
String[] cells = new String[row.getPhysicalNumberOfCells()];
//循环当前行
for (int cellNum = firstCellNum; cellNum < lastCellNum; cellNum++) {
Cell cell = row.getCell(cellNum);
cells[cellNum] = getCellValue(cell);
}
list.add(cells);
}
}
// workbook.close();
} return list.get(0);
} public static void checkFile(MultipartFile file) throws IOException {
//判断文件是否存在
if (null == file) {
logger.error("文件不存在!");
throw new FileNotFoundException("文件不存在!");
}
//获得文件名
String fileName = file.getOriginalFilename();
//判断文件是否是excel文件
if (!fileName.endsWith(xls) && !fileName.endsWith(xlsx)) {
logger.error(fileName + "不是excel文件");
throw new IOException(fileName + "不是excel文件");
}
} public static Workbook getWorkBook(MultipartFile file) {
//获得文件名
String fileName = file.getOriginalFilename();
//创建Workbook工作薄对象,表示整个excel
Workbook workbook = null;
try {
//获取excel文件的io流
InputStream is = file.getInputStream();
//根据文件后缀名不同(xls和xlsx)获得不同的Workbook实现类对象
if (fileName.endsWith(xls)) {
//2003
workbook = new HSSFWorkbook(is);
} else if (fileName.endsWith(xlsx)) {
//2007 及2007以上
workbook = new XSSFWorkbook(is);
}
} catch (IOException e) {
logger.info(e.getMessage());
}
return workbook;
} public static String getCellValue(Cell cell) {
String cellValue = "";
if (cell == null) {
return cellValue;
}
//把数字当成String来读,避免出现1读成1.0的情况
if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
cell.setCellType(Cell.CELL_TYPE_STRING);
}
//判断数据的类型
switch (cell.getCellType()) {
case Cell.CELL_TYPE_NUMERIC: //数字
cellValue = String.valueOf(cell.getNumericCellValue());
break;
case Cell.CELL_TYPE_STRING: //字符串
cellValue = String.valueOf(cell.getStringCellValue());
break;
case Cell.CELL_TYPE_BOOLEAN: //Boolean
cellValue = String.valueOf(cell.getBooleanCellValue());
break;
case Cell.CELL_TYPE_FORMULA: //公式
cellValue = String.valueOf(cell.getCellFormula());
break;
case Cell.CELL_TYPE_BLANK: //空值
cellValue = "";
break;
case Cell.CELL_TYPE_ERROR: //故障
cellValue = "非法字符";
break;
default:
cellValue = "未知类型";
break;
}
return cellValue;
}
} 如果帮助到你 给点鼓励 点个赞吧 谢谢亲

excel表格数据导入导出的更多相关文章

  1. SQL SERVER 与ACCESS、EXCEL的数据导入导出转换

    * 说明:复制表(只复制结构,源表名:a 新表名:b)      select * into b from a where 1<>1 * 说明:拷贝表(拷贝数据,源表名:a 目标表名:b) ...

  2. SQL SERVER 和ACCESS、EXCEL的数据导入导出

    SQL SERVER 与ACCESS.EXCEL之间的数据转换SQL SERVER 和ACCESS的数据导入导出[日期:2007-05-06]     来源:Linux公社  作者:Linux 熟 悉 ...

  3. 将包含经纬度点位信息的Excel表格数据导入到ArcMap中并输出成shapefile

    将包含经纬信息的Excel表格数据,导入到ArcMap中并输出成shapefile,再进行后面的操作.使用这种方法可以将每一个包含经纬信息的数据在ArcMap中点出来. 一.准备数据 新建Excel表 ...

  4. 用多线程优化Excel表格数据导入校验的接口

    公司的需求,当前某个Excel导入功能,流程是:读取Excel数据,传入后台校验每一条数据,判断是否符合导入要求,返回给前端,导入预览展示.(前端等待响应,难点).用户再点击导入按钮,进行异步导入(前 ...

  5. Excel表格数据导入MySQL数据库

    有时候项目需要将存在表格中的批量数据导入数据库,最近自己正好碰到了,总结一下: 1.将excel表格另存为.csv格式文件,excel本身的.xlsx格式导入时可能会报错,为了避免不必要的格式错误,直 ...

  6. excel表格数据导入数据库Oracle

    方法一: 1.创建数据表 CREATE TABLE T_USER (   ID             VARCHAR2(32) primary key,   NAME           VARCH ...

  7. Excel表格的导入导出

    Excel文件的组成: 01.一个Excel文件由N个Sheet组成的 02.一个Sheet由N个Row组成 03.一个Row由N个Cell组成 需求: 把内存中的数据 写入到指定的excel表格中! ...

  8. Excel表格数据导入到SQLServer数据库

    转载:http://blog.csdn.net/lishuangzhe7047/article/details/8797416 步骤: 1,选择要插入的数据库--右键--任务--导入数据 2,点击下一 ...

  9. Excel表格数据导入Mysql数据库的方法

    1.使用Navicat 连接需要导入的数据库. 2.excel 列的名字最好和数据库的名字一致,便于我们直观的查看好理解.   第一步,先创建好表,和准备好对应的excel文件.在Navicat 中选 ...

随机推荐

  1. SQL Server进制

    在项目中,大家可能都遇到过,需要把十进制转换为其他进制的情况,google上一搜,已经有很多2进制.8进制.16进制和十进制的转换方法.但是在一些项目中,这些可能无法满足要求,可能需要17.18甚至是 ...

  2. 微信支付开发&lpar;12&rpar; 认清微信支付v2和v3

    微信支付现在分为v2版和v3版 2014年9月10号之前申请的为v2版,之后申请的为v3版. V2版中的参数有AppIDAppSecret支付专用签名串PaySignKey商户号PartnerID初始 ...

  3. linux如何查看磁盘剩余空间

    [root@Linux var]# df -hl 文件系统 容量 已用 可用 已用% 挂载点 /dev/hdb2 75G 75G 0 100% / /dev/hdb1 99M 9.2M 85M 10% ...

  4. AVL树的旋转实现

    AVL树:带有平衡条件的二叉查找树,即一棵AVL树是其每个节点的左子树和右子树的高度最多相差1的二叉查找树.一般通过Single Rotate和Double Rotate来保持AVL树的平衡.AVL树 ...

  5. 从敏捷开发到小团队SVN

    一.敏捷之惑 敏捷开发,有一个很好的实践,“每天都可以产生一个可用于发布的版本”. 以前对这句话感到非常的困惑,因为我们手中的项目是残缺的,基本只是程序的一个功能片段,在未集成之前如何发布得了?当然这 ...

  6. arcgis 绝对、相对、UNC 和 URL

    您每天都通过路径浏览至数据和工具箱.在共享数据和工具之前,您对此可能没有做太多考虑,其实您也无需考虑.本部分将详细讨论以下方面内容:路径.定义不同类型的路径以及 ArcGIS 对路径的管理方式. 路径 ...

  7. Swift语言学习路线图

  8. 知识点:linux数据库备份

    服务端启用二进制日志 如果日志没有启开,必须启用binlog,要重启mysql,首先,关闭mysql,打开/etc/my.cnf,加入以下几行: [mysqld] log-bin 然后重新启动mysq ...

  9. Python-Analysis-Malware

    Python恶意软件分析应用-PEfile 0x1.前言 要想对恶意代码快速分析,Python是一门必须要掌握的编程技能.因为它是跨平台的,而且容易阅读和编写.许多开源安全工具也是用Python写的. ...

  10. jTemplates

    jTemplates是一个基于JQuery的模板引擎插件,功能强大,有了他你就再不用为使用JS绑定数据集时发愁了. 首先送上jTtemplates的官网地址:http://jtemplates.tpy ...