金蝶EAS·BOS,客户端操作添加进度栏,进度条
2017-06-01 15:31
363 查看
金蝶EAS客户端中,数据导入等操作,需要等待较长时间时,添加进度栏相关代码。
仅供参考。
/**
* 引入模板
* 将科目余额数据从电子表格中读取到序时簿
*/
public void actionExcelImport_actionPerformed(ActionEvent e) throws Exception {
JFileChooser chooser = new JFileChooser();
chooser.showOpenDialog(this); //文件选择窗口
if(chooser.getSelectedFile() == null){
return;
}
String fileName = chooser.getSelectedFile().getName(); //获取文件名
if(!(fileName.indexOf(".xls") == (fileName.length() - 4) || fileName.indexOf(".XLS") == (fileName.length() - 4))){
MsgBox.showWarning(this, "选取的数据文件应为.xls格式。");
return;
}
comp = this; //用于指定父窗口
filePath = chooser.getSelectedFile().getPath(); //文件路径
LongTimeDialog dialog = new LongTimeDialog((Frame) SwingUtilities.getWindowAncestor(this)); //进度栏
dialog.setLongTimeTask(new ILongTimeTask() {
public void afterExec(Object obj) throws Exception {}
public Object exec() throws Exception {
long start = System.currentTimeMillis(); //开始计时
dataList = AccountBalanceUtil.parseExcel(filePath, 3, 9); //解析电子表格
initMappingData(); //初始化映射基础数据缓存
verifyDataList(dataList); //数据队列校验
verifyArticlan(dataList); //勾稽关系校验
fillData(dataList); //填充数据到序时簿表格
long end = System.currentTimeMillis(); //结束计时
String msg = "成功引入模板!共" + dataList.size() + "行数据,耗时" + (end - start) / 1000 + "秒。";
MsgBox.showInfo(comp, msg);
return null;
}
});
dialog.setTitle("正在引入模板,请稍等......");
dialog.show();
}
仅供参考。
/**
* 引入模板
* 将科目余额数据从电子表格中读取到序时簿
*/
public void actionExcelImport_actionPerformed(ActionEvent e) throws Exception {
JFileChooser chooser = new JFileChooser();
chooser.showOpenDialog(this); //文件选择窗口
if(chooser.getSelectedFile() == null){
return;
}
String fileName = chooser.getSelectedFile().getName(); //获取文件名
if(!(fileName.indexOf(".xls") == (fileName.length() - 4) || fileName.indexOf(".XLS") == (fileName.length() - 4))){
MsgBox.showWarning(this, "选取的数据文件应为.xls格式。");
return;
}
comp = this; //用于指定父窗口
filePath = chooser.getSelectedFile().getPath(); //文件路径
LongTimeDialog dialog = new LongTimeDialog((Frame) SwingUtilities.getWindowAncestor(this)); //进度栏
dialog.setLongTimeTask(new ILongTimeTask() {
public void afterExec(Object obj) throws Exception {}
public Object exec() throws Exception {
long start = System.currentTimeMillis(); //开始计时
dataList = AccountBalanceUtil.parseExcel(filePath, 3, 9); //解析电子表格
initMappingData(); //初始化映射基础数据缓存
verifyDataList(dataList); //数据队列校验
verifyArticlan(dataList); //勾稽关系校验
fillData(dataList); //填充数据到序时簿表格
long end = System.currentTimeMillis(); //结束计时
String msg = "成功引入模板!共" + dataList.size() + "行数据,耗时" + (end - start) / 1000 + "秒。";
MsgBox.showInfo(comp, msg);
return null;
}
});
dialog.setTitle("正在引入模板,请稍等......");
dialog.show();
}
相关文章推荐
- 如何在客户端对ListBox进行添加删除操作
- ListBox在客户端添加删除操作
- 带有选择框的WEBTREE控件,添加了一些客户端操作的功能
- EAS BOS开发EditUI、ListUI添加审核反审核操作流程
- EAS BOS开发editUI添加审核反审核操作流程
- 在ASP.NET 2.0中操作数据::为删除数据添加客户端确认
- DropDownList添加客户端下拉事件操作
- Android客户端添加正式签名文件的操作说明
- Solr客户端 SolrJ单机 添加查询操作
- ListBox在客户端添加删除操作
- 金蝶EAS BOS二次开发_客户端语言设置
- 在ASP.NET 2.0中操作数据之二十二:为删除数据添加客户端确认
- DropDownList添加客户端下拉事件操作
- EAS BOS进度条(针对耗时长的操作)
- 在ASP.NET 2.0中操作数据之二十二:为删除数据添加客户端确认
- ListBox的客户端添加删除操作
- 添加文件操作进度对话框
- Zookeeper客户端基本操作java实现——创建连接、创建节点、添加修改节点内容、获取子节点、获取节点数据、删除节点
- DropDownList添加客户端下拉事件操作
- 最近几天进度有一些慢,主要时间花费在如何在vc7.0中添加消息映射的问题上。