- 浏览: 17243 次
- 性别:
- 来自: 武汉
文章分类
最新评论
/**
* 将数据写入Excel中
*/
public String exportExcel(String filepath,String sheetName,long clientID)throws Exception{
String returnPath = "";
long thistime = new Date().getTime();
OutputStream os;
Connection con = null;
ResultSet rs = null;
PreparedStatement ps = null;
try{
// 生成文件
os = new FileOutputStream(filepath + sheetName + "-" + thistime + ".xls");
WritableWorkbook book = Workbook.createWorkbook(os);
// sheet名称
WritableSheet sheet = book.createSheet(sheetName, 0);
//设置格式
WritableFont wf = new WritableFont(WritableFont.ARIAL, 12,WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE);
WritableCellFormat cellFormat=new WritableCellFormat(wf);
//设置为文本格式
NumberFormat nf = new NumberFormat("#00");
WritableCellFormat cf = new WritableCellFormat(nf);
//设置为金额
NumberFormat nf2 = new NumberFormat("#,##0.00");
WritableCellFormat wcf = new WritableCellFormat(nf2);
cellFormat.setAlignment(Alignment.CENTRE);
cellFormat.setBackground(jxl.format.Colour.SKY_BLUE);//设置单元格的颜色
sheet.setColumnView(0, 20);
sheet.setColumnView(1, 30);
sheet.setColumnView(2, 30);
sheet.setColumnView(3, 20);
sheet.setColumnView(4, 20);
WritableCellFormat cellFormat1=new WritableCellFormat();
cellFormat1.setAlignment(Alignment.CENTRE);
//设置列
Label four_1 = new Label(0, 0, "合同号");
four_1.setCellFormat(cellFormat);
//four_1.setCellFormat(cf);
sheet.addCell(four_1);
Label four_2 = new Label(1, 0, "收款方账户");
four_2.setCellFormat(cellFormat);
//four_2.setCellFormat(cf);
sheet.addCell(four_2);
Label four_3 = new Label(2, 0, "付款方账户");
four_3.setCellFormat(cellFormat);
//four_3.setCellFormat(cf);
sheet.addCell(four_3);
Label four_4 = new Label(3, 0, "金额");
four_4.setCellFormat(cellFormat);
//four_4.setCellFormat(wcf);
sheet.addCell(four_4);
Label four_5 = new Label(4, 0, "摘要");
four_5.setCellFormat(cellFormat);
//four_5.setCellFormat(cf);
sheet.addCell(four_5);
int x=0;
String sql="select * from SETT_CONSIGNRECEIVESET c where c.npayeeclientid="+clientID;
con = Database.getConnection();
ps=con.prepareStatement(sql);
rs = ps.executeQuery();
while(rs.next()){
x++;
Label label1=new Label(0,x,rs.getString("SCONTRACTCODE"),cf);
sheet.addCell(label1);
Label label2=new Label(1,x,NameRef.getAccountNum(rs.getLong("NPAYEEACCTID")),cf);
sheet.addCell(label2);
Label label3=new Label(2,x,NameRef.getAccountNum(rs.getLong("NPAYERACCTID")),cf);
sheet.addCell(label3);
Label label4=new Label(3,x,"",wcf);
sheet.addCell(label4);
Label label5=new Label(4,x,"",cf);
sheet.addCell(label5);
}
book.write();
book.close();
returnPath=filepath + sheetName + "-" + thistime + ".xls";
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (ps != null)
{
ps.close();
ps = null;
}
if (con != null)
{
con.close();
con = null;
}
}
catch (Exception e)
{
;
}
}
return returnPath;
}
/**
* 从Excel中导入数据
* @param mySmartUpload
* @param uploadPath
* @param sessionMng
* @return map
* @throws Exception
*/
public Map importExcel(SmartUpload mySmartUpload, String uploadPath,SessionOB sessionMng) throws Exception {
Vector vector = new Vector();
Map map = new HashMap();
Vector returnVector = new Vector();
String strAdd = "";// 每次从上传文件中读到的一个单元。
short index = 0;
boolean bIsValid = false;
File myfile = mySmartUpload.getFiles().getFile(0);
myfile.saveAs(uploadPath + "special/consignreceive/"+myfile.getFileName());
Connection conn = null;
FileInputStream fis = new FileInputStream(Env.UPLOAD_PATH+"special/consignreceive/"+myfile.getFileName());
ConsignReceiveInfo consignReceiveInfo = null;
if(myfile.getFileName().indexOf(".xls") < 0) {
throw new Exception("选择文档与模板文件不一致,请检查");
}
try {
HSSFWorkbook workbook = new HSSFWorkbook(fis);
HSSFSheet sheet = null;
HSSFRow row = null;
HSSFCell cell = null;
if (workbook != null) {
sheet = workbook.getSheetAt(0);
}
if (sheet == null) {
throw new Exception("不能导入空的Excel文件");
}
if (sheet != null) {
row = sheet.getRow(1);
}
if(row == null){
throw new Exception("不能导入空的Excel文件");
}
for (int j=1; row!=null; j++, row=sheet.getRow(j)) {
bIsValid = true;
consignReceiveInfo = new ConsignReceiveInfo();
//1.合同号 2.收款方账号 3.付款方账号 4.金额 5.摘要
long subTypeId = -1;
for(index = 1; index <= 5; index++){
strAdd = "";
cell = row.getCell((short) (index - 1));
if (cell != null) {
// 在Excel中的类型是文本、常规
if (cell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
strAdd = cell.getStringCellValue();
}
// 在Excel中的类型是数值
else if (cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC) {
strAdd = String.valueOf(cell.getNumericCellValue());
}
System.out.println(strAdd);
}
if (strAdd == null) {
strAdd = "";
}
if(index==1){
consignReceiveInfo.setSContractCode(strAdd);
}
if (index == 2) {
consignReceiveInfo.setNPayeeAcctID((Long)NameRef.getByNoFromSett(strAdd).get("id"));
consignReceiveInfo.setNPayeeClientID((Long)NameRef.getByNoFromSett(strAdd).get("nclientid"));
}
if(index==3){
consignReceiveInfo.setNPayerAcctID((Long)NameRef.getByNoFromSett(strAdd).get("id"));
consignReceiveInfo.setNPayerClientID((Long)NameRef.getByNoFromSett(strAdd).get("nclientid"));
}
if (index == 4) {
if (strAdd.matches("^\\s*([1-9]\\d{0,12}|0)(\\.(\\d){1,2})?\\s*$")) {
consignReceiveInfo.setMAmount(Double.valueOf(strAdd.replaceAll(",", "")).doubleValue());
}
else {
UpLoanReturnInfo upLoanReturnInfo = new UpLoanReturnInfo();
upLoanReturnInfo.setIsOk(true);
upLoanReturnInfo.setPositionCol(index);
upLoanReturnInfo.setPositionRow(j+1);
upLoanReturnInfo.setReason("金额格式不正确");
returnVector.addElement(upLoanReturnInfo);
}
}
if(index==5){
UpLoanReturnInfo upLoanReturnInfo = new UpLoanReturnInfo();
if(strAdd != null && !strAdd.equals("") && strAdd.length() > 0){
if(NameRef.getNAbstractIDByName(strAdd)>0){
consignReceiveInfo.setNAbstractID(NameRef.getNAbstractIDByName(strAdd));
}else{
upLoanReturnInfo.setIsOk(true);
upLoanReturnInfo.setPositionCol(index);
upLoanReturnInfo.setPositionRow(j+1);
upLoanReturnInfo.setReason("摘要不存在,请检查!");
returnVector.addElement(upLoanReturnInfo);
}
}else{
upLoanReturnInfo.setIsOk(true);
upLoanReturnInfo.setPositionCol(index);
upLoanReturnInfo.setPositionRow(j+1);
upLoanReturnInfo.setReason("摘要填写不正确,请检查!");
returnVector.addElement(upLoanReturnInfo);
}
}
}
consignReceiveInfo.setNOfficeID(sessionMng.m_lOfficeID);
consignReceiveInfo.setNCurrencyID(sessionMng.m_lCurrencyID);
consignReceiveInfo.setDTInput(Env.getSystemDate());
consignReceiveInfo.setNInputUserID(sessionMng.m_lUserID);
//consignReceiveInfo.setNPayeeClientID(sessionMng.m_lClientID);
consignReceiveInfo.setNStatus(OBConstant.SettInstrStatus.SAVE);
consignReceiveInfo.setNTransType(31);
vector.add(consignReceiveInfo);
}
//判断格式是否正确 如果正确则插入数据库
if(returnVector.size()==0){
int length=vector.size();
ConsignReceiveInfo[] infos=new ConsignReceiveInfo[length];
if (length > 0) {
for (int i = 0; i < length; i++) {
ConsignReceiveInfo info = (ConsignReceiveInfo) vector.get(i);
infos[i] = info;
}
//插入操作
}
////删除已经插入的操作
conn = Database.getConnection();
conn.setAutoCommit(false);
ConsignReceiveDao consignReceiveDao=new ConsignReceiveDao(conn);
for(int i=0;i<infos.length;i++){
ConsignReceiveInfo dataEntity = infos[i];
consignReceiveDao.add(dataEntity);
}
conn.commit();
conn.close();
//consignReceiveDao.importFromExcel(infos);
} else {
map.put("returnVector", returnVector);
}
}catch(Exception e){
e.printStackTrace();
conn.rollback();
}
return map;
}
}
* 将数据写入Excel中
*/
public String exportExcel(String filepath,String sheetName,long clientID)throws Exception{
String returnPath = "";
long thistime = new Date().getTime();
OutputStream os;
Connection con = null;
ResultSet rs = null;
PreparedStatement ps = null;
try{
// 生成文件
os = new FileOutputStream(filepath + sheetName + "-" + thistime + ".xls");
WritableWorkbook book = Workbook.createWorkbook(os);
// sheet名称
WritableSheet sheet = book.createSheet(sheetName, 0);
//设置格式
WritableFont wf = new WritableFont(WritableFont.ARIAL, 12,WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE);
WritableCellFormat cellFormat=new WritableCellFormat(wf);
//设置为文本格式
NumberFormat nf = new NumberFormat("#00");
WritableCellFormat cf = new WritableCellFormat(nf);
//设置为金额
NumberFormat nf2 = new NumberFormat("#,##0.00");
WritableCellFormat wcf = new WritableCellFormat(nf2);
cellFormat.setAlignment(Alignment.CENTRE);
cellFormat.setBackground(jxl.format.Colour.SKY_BLUE);//设置单元格的颜色
sheet.setColumnView(0, 20);
sheet.setColumnView(1, 30);
sheet.setColumnView(2, 30);
sheet.setColumnView(3, 20);
sheet.setColumnView(4, 20);
WritableCellFormat cellFormat1=new WritableCellFormat();
cellFormat1.setAlignment(Alignment.CENTRE);
//设置列
Label four_1 = new Label(0, 0, "合同号");
four_1.setCellFormat(cellFormat);
//four_1.setCellFormat(cf);
sheet.addCell(four_1);
Label four_2 = new Label(1, 0, "收款方账户");
four_2.setCellFormat(cellFormat);
//four_2.setCellFormat(cf);
sheet.addCell(four_2);
Label four_3 = new Label(2, 0, "付款方账户");
four_3.setCellFormat(cellFormat);
//four_3.setCellFormat(cf);
sheet.addCell(four_3);
Label four_4 = new Label(3, 0, "金额");
four_4.setCellFormat(cellFormat);
//four_4.setCellFormat(wcf);
sheet.addCell(four_4);
Label four_5 = new Label(4, 0, "摘要");
four_5.setCellFormat(cellFormat);
//four_5.setCellFormat(cf);
sheet.addCell(four_5);
int x=0;
String sql="select * from SETT_CONSIGNRECEIVESET c where c.npayeeclientid="+clientID;
con = Database.getConnection();
ps=con.prepareStatement(sql);
rs = ps.executeQuery();
while(rs.next()){
x++;
Label label1=new Label(0,x,rs.getString("SCONTRACTCODE"),cf);
sheet.addCell(label1);
Label label2=new Label(1,x,NameRef.getAccountNum(rs.getLong("NPAYEEACCTID")),cf);
sheet.addCell(label2);
Label label3=new Label(2,x,NameRef.getAccountNum(rs.getLong("NPAYERACCTID")),cf);
sheet.addCell(label3);
Label label4=new Label(3,x,"",wcf);
sheet.addCell(label4);
Label label5=new Label(4,x,"",cf);
sheet.addCell(label5);
}
book.write();
book.close();
returnPath=filepath + sheetName + "-" + thistime + ".xls";
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (ps != null)
{
ps.close();
ps = null;
}
if (con != null)
{
con.close();
con = null;
}
}
catch (Exception e)
{
;
}
}
return returnPath;
}
/**
* 从Excel中导入数据
* @param mySmartUpload
* @param uploadPath
* @param sessionMng
* @return map
* @throws Exception
*/
public Map importExcel(SmartUpload mySmartUpload, String uploadPath,SessionOB sessionMng) throws Exception {
Vector vector = new Vector();
Map map = new HashMap();
Vector returnVector = new Vector();
String strAdd = "";// 每次从上传文件中读到的一个单元。
short index = 0;
boolean bIsValid = false;
File myfile = mySmartUpload.getFiles().getFile(0);
myfile.saveAs(uploadPath + "special/consignreceive/"+myfile.getFileName());
Connection conn = null;
FileInputStream fis = new FileInputStream(Env.UPLOAD_PATH+"special/consignreceive/"+myfile.getFileName());
ConsignReceiveInfo consignReceiveInfo = null;
if(myfile.getFileName().indexOf(".xls") < 0) {
throw new Exception("选择文档与模板文件不一致,请检查");
}
try {
HSSFWorkbook workbook = new HSSFWorkbook(fis);
HSSFSheet sheet = null;
HSSFRow row = null;
HSSFCell cell = null;
if (workbook != null) {
sheet = workbook.getSheetAt(0);
}
if (sheet == null) {
throw new Exception("不能导入空的Excel文件");
}
if (sheet != null) {
row = sheet.getRow(1);
}
if(row == null){
throw new Exception("不能导入空的Excel文件");
}
for (int j=1; row!=null; j++, row=sheet.getRow(j)) {
bIsValid = true;
consignReceiveInfo = new ConsignReceiveInfo();
//1.合同号 2.收款方账号 3.付款方账号 4.金额 5.摘要
long subTypeId = -1;
for(index = 1; index <= 5; index++){
strAdd = "";
cell = row.getCell((short) (index - 1));
if (cell != null) {
// 在Excel中的类型是文本、常规
if (cell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
strAdd = cell.getStringCellValue();
}
// 在Excel中的类型是数值
else if (cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC) {
strAdd = String.valueOf(cell.getNumericCellValue());
}
System.out.println(strAdd);
}
if (strAdd == null) {
strAdd = "";
}
if(index==1){
consignReceiveInfo.setSContractCode(strAdd);
}
if (index == 2) {
consignReceiveInfo.setNPayeeAcctID((Long)NameRef.getByNoFromSett(strAdd).get("id"));
consignReceiveInfo.setNPayeeClientID((Long)NameRef.getByNoFromSett(strAdd).get("nclientid"));
}
if(index==3){
consignReceiveInfo.setNPayerAcctID((Long)NameRef.getByNoFromSett(strAdd).get("id"));
consignReceiveInfo.setNPayerClientID((Long)NameRef.getByNoFromSett(strAdd).get("nclientid"));
}
if (index == 4) {
if (strAdd.matches("^\\s*([1-9]\\d{0,12}|0)(\\.(\\d){1,2})?\\s*$")) {
consignReceiveInfo.setMAmount(Double.valueOf(strAdd.replaceAll(",", "")).doubleValue());
}
else {
UpLoanReturnInfo upLoanReturnInfo = new UpLoanReturnInfo();
upLoanReturnInfo.setIsOk(true);
upLoanReturnInfo.setPositionCol(index);
upLoanReturnInfo.setPositionRow(j+1);
upLoanReturnInfo.setReason("金额格式不正确");
returnVector.addElement(upLoanReturnInfo);
}
}
if(index==5){
UpLoanReturnInfo upLoanReturnInfo = new UpLoanReturnInfo();
if(strAdd != null && !strAdd.equals("") && strAdd.length() > 0){
if(NameRef.getNAbstractIDByName(strAdd)>0){
consignReceiveInfo.setNAbstractID(NameRef.getNAbstractIDByName(strAdd));
}else{
upLoanReturnInfo.setIsOk(true);
upLoanReturnInfo.setPositionCol(index);
upLoanReturnInfo.setPositionRow(j+1);
upLoanReturnInfo.setReason("摘要不存在,请检查!");
returnVector.addElement(upLoanReturnInfo);
}
}else{
upLoanReturnInfo.setIsOk(true);
upLoanReturnInfo.setPositionCol(index);
upLoanReturnInfo.setPositionRow(j+1);
upLoanReturnInfo.setReason("摘要填写不正确,请检查!");
returnVector.addElement(upLoanReturnInfo);
}
}
}
consignReceiveInfo.setNOfficeID(sessionMng.m_lOfficeID);
consignReceiveInfo.setNCurrencyID(sessionMng.m_lCurrencyID);
consignReceiveInfo.setDTInput(Env.getSystemDate());
consignReceiveInfo.setNInputUserID(sessionMng.m_lUserID);
//consignReceiveInfo.setNPayeeClientID(sessionMng.m_lClientID);
consignReceiveInfo.setNStatus(OBConstant.SettInstrStatus.SAVE);
consignReceiveInfo.setNTransType(31);
vector.add(consignReceiveInfo);
}
//判断格式是否正确 如果正确则插入数据库
if(returnVector.size()==0){
int length=vector.size();
ConsignReceiveInfo[] infos=new ConsignReceiveInfo[length];
if (length > 0) {
for (int i = 0; i < length; i++) {
ConsignReceiveInfo info = (ConsignReceiveInfo) vector.get(i);
infos[i] = info;
}
//插入操作
}
////删除已经插入的操作
conn = Database.getConnection();
conn.setAutoCommit(false);
ConsignReceiveDao consignReceiveDao=new ConsignReceiveDao(conn);
for(int i=0;i<infos.length;i++){
ConsignReceiveInfo dataEntity = infos[i];
consignReceiveDao.add(dataEntity);
}
conn.commit();
conn.close();
//consignReceiveDao.importFromExcel(infos);
} else {
map.put("returnVector", returnVector);
}
}catch(Exception e){
e.printStackTrace();
conn.rollback();
}
return map;
}
}
发表评论
-
json数据处理
2016-06-22 15:16 483public static <T> T rea ... -
java的同步异步调用
2016-03-06 18:09 894软件模块之间总是存在着一定的接口,从调用方式上,可以把他们分 ... -
shiro初级认识
2016-02-29 18:21 822一、 介绍: shiro是apache提供的强大而灵活 ... -
校验身份证号码及编码规则
2015-12-10 15:52 861身份证前6位【ABCDEF】为行政区划数字代码(简称数字码) ... -
org.apache.commons.httpclient的jar包的使用
2015-01-21 15:15 27971.创建HttpClient实例 HttpClient ... -
checkbox实现全选
2014-12-12 10:54 658<%@ page contentType=" ... -
servlet实现多文件上传
2014-12-12 10:44 5631.fileupload.jsp<%@ page l ... -
servlet实现文件的下载
2014-12-12 09:53 513public class DownLoadServlet ex ... -
jxl对Excel的操作,包含合并单元格
2014-12-11 15:50 164401.import java.io.*; 02.im ... -
文件的拷贝和转移
2014-10-21 10:16 565package com.wepull.demo; im ...
相关推荐
在Delphi编程环境中,将Excel数据导入到数据库是一项常见的任务,尤其在数据处理和报表生成时。本篇文章将深入探讨如何使用Delphi的COM对象(Component Object Model)接口与Microsoft Excel进行交互,并将数据顺利...
在C#中将Excel数据导入数据库是一个常见的任务,特别是在处理大量结构化数据时。下面将详细解释这个过程,包括步骤、关键代码以及注意事项。 首先,我们需要建立一个连接Excel文件的方法。在提供的代码中,`...
### ASP中导入Excel文件数据到Access数据库 #### 一、项目背景与需求分析 在实际工作中,常常会遇到需要将Excel文件中的数据批量导入到数据库中的场景。例如,对于一个小型的企业管理系统,可能需要用户上传一个...
本文将详细介绍如何利用Qt来实现从数据库导出数据到Excel表格的功能。 首先,我们需要理解Qt中的数据库模块。Qt支持多种数据库系统,如SQLite、MySQL、PostgreSQL等,通过QSqlDatabase类进行连接和操作。在项目开始...
在ASP.NET中将数据库数据导入Excel并打印,根据项目需求和资源限制,可以选择直接利用IE的打印功能、利用水晶报表或其他第三方工具,或是在服务器端或客户端将数据导出到Excel或Word。每种方法都有其优缺点,开发者...
在JavaScript中将数据导入Excel是一项常见的需求,尤其在Web应用中,用户可能希望方便地下载数据到Excel格式以便进一步分析或处理。以下是一些关于如何使用JavaScript实现这一功能的关键知识点: 1. **文件类型理解...
然后,可以创建`CDaoRecordset`对象来表示数据库中的表,并插入从Excel读取的数据。 实现这一过程的具体步骤如下: 1. 初始化COM环境,确保MFC可以调用Excel和Access的相关接口。 2. 使用MFC的COM支持创建Excel...
在VC++编程环境中,将数据导入到自定义的Excel表格并进行打印涉及到多个技术环节,主要包括Excel自动化(Automation)、COM组件交互以及文件操作等。以下是对这个主题的详细阐述: 1. **Excel自动化**:微软提供了...
java注解实现通用Excel中文表格转实体对象列表,支持中文表头,在Excel数据导入使用的通用工具类,代码简洁优雅 。基于注解实现的支持中文表头的读取Excel数据并转换为实体对象列表的工具类,使用该工具类可将Excel...
在这个场景中,我们有一个C#编写的小工具,它的主要功能是从txt文本文件中将数据导入到数据库中。这个工具对于初学者或者需要快速处理小规模数据的用户来说,提供了一个简单易用的解决方案。 首先,我们需要了解...
标题“mssql2000导入excel数据”指的是在Microsoft SQL Server 2000中将数据从Excel文件导入到SQL Server数据库的过程。这个过程在数据迁移、数据分析或数据整合时非常常见,尤其是在处理大量源自电子表格的数据时。...
在C++中将数据库数据分行和列保存到Excel中,主要涉及到两个关键步骤:一是从数据库获取数据,二是使用Microsoft Excel的对象模型将数据写入工作表。以下是对这两种方法的详细说明: ### 方法一:逐格填充数据 ...
SQL Server,MySQL在开发中)中的数据直接导出到打开的任意表格中(支持MS Excel和WPS表格),也可以从任意打开表格中将数据导入到数据库中,还可以将变更前的数据先保存到XML中,数据变化后,可以变化的数据导出到...
4. **处理数据**:将解析的数据保存到数据库或其他存储结构中,可能需要进行数据验证和清洗。 5. **错误处理**:检查读取过程中可能出现的异常,如文件格式不正确、数据无法转换等。 三、示例代码片段 ```java //...
标题 "Excel数据导入SQL Server 2000: for Delphi 7" 涉及的是在Delphi 7开发环境中将Excel数据批量导入到SQL Server 2000数据库的过程。这个操作在数据处理和分析中非常常见,特别是在需要整合不同来源的数据时。...
5. **数据导入**:在ASP脚本中编写SQL插入语句,将读取到的数据插入到Access数据库中。可能需要对数据进行预处理,如转换数据类型或处理日期格式。 6. **错误处理与反馈**:在整个过程中添加错误处理机制,以便在...
在C#编程环境中,将Excel工作表数据导入到PostgreSQL数据库表是一项常见的任务,尤其在数据迁移、数据分析或报表生成的场景中。本教程将详细解释如何使用Npgsql库,这是.NET Framework和.NET Core下的PostgreSQL...
软件最大的功能是将数据库中的数据直接导出到打开的任意表格中,软件还支持从任意打开表格中将数据导入到数据库中、将变更前的数据先保存到XML中、以及数据变化后,可以变化的数据导出到Excel中,将变更的字段标色以...