EAS BOS 不常用方法介绍

2024-03-16 07:32
文章标签 方法 介绍 常用 eas bos

本文主要是介绍EAS BOS 不常用方法介绍,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

/************************************* 所有action方法前  ************************************************/

/**************************** 有时候某些方法不进时可以在这里进行操作 ********************************/

 

@Override

public void afterAction(BatchActionEnum arg0, BatchSelectionEntries arg1, int arg2) {

if (BatchActionEnum.DELETE.equals(arg0)) {  //DELETE  action的动作
try {
ArrayList<KDTSelectBlock> blocks = tblMain.getSelectManager().getBlocks();
Iterator<KDTSelectBlock> iterator = blocks.iterator();
String purEntryids="";
String purids="";
while(iterator.hasNext()){
KDTSelectBlock block = (KDTSelectBlock)iterator.next();
int top = block.getTop();
int bottom = block.getBottom();
for(int i=top;i <= bottom;i++ ){
purids += "'"+tblMain.getRow(i).getCell("id").getValue()+"',";
purEntryids += "'"+tblMain.getRow(i).getCell("entry.id").getValue()+"',";
}
}
purEntryids = purEntryids.substring(0, purEntryids.length()-1);
purids = purids.substring(0, purids.length()-1);
PurReceivalBatchEntryFactory.getRemoteInstance().deleteBatch(purids,purEntryids);
} catch (Exception e) {
handUIException(e);
}
}

super.afterAction(arg0, arg1, arg2);
}

 

 

/************************************* 所有action方法前  ************************************************/

/**************************** 有时候某些方法不进时可以在这里进行操作 ******************************/

 

与 afterAction 的区别:例如删除的时候afterAction 先提示确认执行你的操作然后再删除

beforeAction先执行你的操作然后在提示和删除。

 

 @Overridepublic boolean beforeAction(BatchActionEnum bizAction,BatchSelectionEntries selectionEntries, ActionEvent event) {if (BatchActionEnum.DELETE.equals(bizAction)) {try {你的逻辑!} catch (Exception e) {handUIException(e);}}return super.beforeAction(bizAction, selectionEntries, event);}	public boolean beforeAction(BatchActionEnum bizAction,BatchSelectionEntries selectionEntries, ActionEvent event) {if (BatchActionEnum.DELETE.equals(bizAction)) {try {你的逻辑!} catch (Exception e) {handUIException(e);}}return super.beforeAction(bizAction, selectionEntries, event);}
 
 

/************************************* batchExecute 方法 ************************************************/

/****************************  不知道什么时候执行,只知道不进审核的时候回进这里  ******************************/

 @Override     public void batchExecute(Context ctx, BatchActionEnum batchAction,     BatchActionResults batchResults) throws BOSException, EASBizException {     super.batchExecute(ctx, batchAction, batchResults);     String idStr = SQLUtil.arrayToString(batchResults.getToDoIdsArray()); // AUDIT 操作动作 也可是CLOSED、UNCLOSED、RELEASED等

    	if ("AUDIT".equals(batchAction.getBizAction())&&idStr.length()>0) {  	if ("AUDIT".equals(batchAction.getBizAction())&&idStr.length()>0) {  
AuditUpdateDate(ctx, idStr);}}/*** * @Title: AuditUpdateDate * @Description: TODO(审核时反写采购申请单的数据) */private void AuditUpdateDate(Context ctx, String pk) {PurOrderInfo info;try {info = PurOrderFactory.getLocalInstance(ctx).getPurOrderInfo(pk);PurOrderEntryCollection entryColl = info.getEntries();for(int i=0;i<entryColl.size();i++){PurOrderEntryInfo entryInfo = entryColl.get(i);}ArrayList<Object[]> list = new ArrayList<Object[]>();StringBuffer buffer = new StringBuffer();buffer.append(" SELECT poEntry.fid pofid,prEntry.fid preid,prEntry.FQty auditQty,poEntry.cfroll roll, \n");buffer.append(" prEntry.CFCREATETOTAL total,prentry.CFCREATENOTTOTAL notTotal FROM T_SM_PurORderEntry poEntry \n");buffer.append(" JOIN T_SM_PurOrder pur ON pur.fid=poEntry.FParentID \n");buffer.append(" JOIN T_SM_PurRequestEntry prEntry ON prEntry.fid=poEntry.FSourceBillEntryID \n");buffer.append(" WHERE poEntry.FParentID='"+pk.toString()+"' \n");IRowSet rs = DBUtil.executeQuery(ctx, buffer.toString());while(rs.next()){int createTotal = rs.getInt("roll")+rs.getInt("total"); //已生成PO的数量int createNotTotal = rs.getInt("notTotal")-rs.getInt("roll");//未生成PO的数量list.add(new Object []{createTotal,createNotTotal,rs.getString("preid")});}String updateSql = " UPDATE T_SM_PurRequestEntry SET CFCreateTotal=? ,CFCreateNotTotal=? WHERE Fid=? ";DBUtil.executeBatch(ctx, updateSql, list);} catch (EASBizException e1) {e1.printStackTrace();} catch (BOSException e1) {e1.printStackTrace();} catch (SQLException e) {e.printStackTrace();}}
		AuditUpdateDate(ctx, idStr);}}/*** * @Title: AuditUpdateDate * @Description: TODO(审核时反写采购申请单的数据) */private void AuditUpdateDate(Context ctx, String pk) {PurOrderInfo info;try {info = PurOrderFactory.getLocalInstance(ctx).getPurOrderInfo(pk);PurOrderEntryCollection entryColl = info.getEntries();for(int i=0;i<entryColl.size();i++){PurOrderEntryInfo entryInfo = entryColl.get(i);}ArrayList<Object[]> list = new ArrayList<Object[]>();StringBuffer buffer = new StringBuffer();buffer.append(" SELECT poEntry.fid pofid,prEntry.fid preid,prEntry.FQty auditQty,poEntry.cfroll roll, \n");buffer.append(" prEntry.CFCREATETOTAL total,prentry.CFCREATENOTTOTAL notTotal FROM T_SM_PurORderEntry poEntry \n");buffer.append(" JOIN T_SM_PurOrder pur ON pur.fid=poEntry.FParentID \n");buffer.append(" JOIN T_SM_PurRequestEntry prEntry ON prEntry.fid=poEntry.FSourceBillEntryID \n");buffer.append(" WHERE poEntry.FParentID='"+pk.toString()+"' \n");IRowSet rs = DBUtil.executeQuery(ctx, buffer.toString());while(rs.next()){int createTotal = rs.getInt("roll")+rs.getInt("total"); //已生成PO的数量int createNotTotal = rs.getInt("notTotal")-rs.getInt("roll");//未生成PO的数量list.add(new Object []{createTotal,createNotTotal,rs.getString("preid")});}String updateSql = " UPDATE T_SM_PurRequestEntry SET CFCreateTotal=? ,CFCreateNotTotal=? WHERE Fid=? ";DBUtil.executeBatch(ctx, updateSql, list);} catch (EASBizException e1) {e1.printStackTrace();} catch (BOSException e1) {e1.printStackTrace();} catch (SQLException e) {e.printStackTrace();}}

这篇关于EAS BOS 不常用方法介绍的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/814755

相关文章

Python中pywin32 常用窗口操作的实现

《Python中pywin32常用窗口操作的实现》本文主要介绍了Python中pywin32常用窗口操作的实现,pywin32主要的作用是供Python开发者快速调用WindowsAPI的一个... 目录获取窗口句柄获取最前端窗口句柄获取指定坐标处的窗口根据窗口的完整标题匹配获取句柄根据窗口的类别匹配获取句

Java 中的 @SneakyThrows 注解使用方法(简化异常处理的利与弊)

《Java中的@SneakyThrows注解使用方法(简化异常处理的利与弊)》为了简化异常处理,Lombok提供了一个强大的注解@SneakyThrows,本文将详细介绍@SneakyThro... 目录1. @SneakyThrows 简介 1.1 什么是 Lombok?2. @SneakyThrows

判断PyTorch是GPU版还是CPU版的方法小结

《判断PyTorch是GPU版还是CPU版的方法小结》PyTorch作为当前最流行的深度学习框架之一,支持在CPU和GPU(NVIDIACUDA)上运行,所以对于深度学习开发者来说,正确识别PyTor... 目录前言为什么需要区分GPU和CPU版本?性能差异硬件要求如何检查PyTorch版本?方法1:使用命

Qt实现网络数据解析的方法总结

《Qt实现网络数据解析的方法总结》在Qt中解析网络数据通常涉及接收原始字节流,并将其转换为有意义的应用层数据,这篇文章为大家介绍了详细步骤和示例,感兴趣的小伙伴可以了解下... 目录1. 网络数据接收2. 缓冲区管理(处理粘包/拆包)3. 常见数据格式解析3.1 jsON解析3.2 XML解析3.3 自定义

SpringMVC 通过ajax 前后端数据交互的实现方法

《SpringMVC通过ajax前后端数据交互的实现方法》:本文主要介绍SpringMVC通过ajax前后端数据交互的实现方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价... 在前端的开发过程中,经常在html页面通过AJAX进行前后端数据的交互,SpringMVC的controll

Java中的工具类命名方法

《Java中的工具类命名方法》:本文主要介绍Java中的工具类究竟如何命名,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录Java中的工具类究竟如何命名?先来几个例子几种命名方式的比较到底如何命名 ?总结Java中的工具类究竟如何命名?先来几个例子JD

Spring Security自定义身份认证的实现方法

《SpringSecurity自定义身份认证的实现方法》:本文主要介绍SpringSecurity自定义身份认证的实现方法,下面对SpringSecurity的这三种自定义身份认证进行详细讲解,... 目录1.内存身份认证(1)创建配置类(2)验证内存身份认证2.JDBC身份认证(1)数据准备 (2)配置依

C#使用StackExchange.Redis实现分布式锁的两种方式介绍

《C#使用StackExchange.Redis实现分布式锁的两种方式介绍》分布式锁在集群的架构中发挥着重要的作用,:本文主要介绍C#使用StackExchange.Redis实现分布式锁的... 目录自定义分布式锁获取锁释放锁自动续期StackExchange.Redis分布式锁获取锁释放锁自动续期分布式

python获取网页表格的多种方法汇总

《python获取网页表格的多种方法汇总》我们在网页上看到很多的表格,如果要获取里面的数据或者转化成其他格式,就需要将表格获取下来并进行整理,在Python中,获取网页表格的方法有多种,下面就跟随小编... 目录1. 使用Pandas的read_html2. 使用BeautifulSoup和pandas3.

Spring 中的循环引用问题解决方法

《Spring中的循环引用问题解决方法》:本文主要介绍Spring中的循环引用问题解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录什么是循环引用?循环依赖三级缓存解决循环依赖二级缓存三级缓存本章来聊聊Spring 中的循环引用问题该如何解决。这里聊