EAS BOS 不常用方法介绍
2016-11-29 13:49
204 查看
/************************************* 所有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先执行你的操作然后在提示和删除。
/************************************* 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等
/**************************** 有时候某些方法不进时可以在这里进行操作 ********************************/
@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先执行你的操作然后在提示和删除。
@Override 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) {
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常用控件属性方法事件
- EAS-BOS常用控件属性方法事件
- BOS_EAS_UI类常用方法说明
- EAS BOS 常用的需覆盖的方法和作用
- 恢复Cisco路由器密码的两种常用方法介绍
- Sqlite3 数据库介绍及常用方法的简单封装
- Java中String类的常用方法介绍
- Jmail组件常用类属性和方法介绍
- 常用软件的静默安装方法介绍
- Android MediaPlayer 常用方法介绍
- Socket网络编程学习笔记(1):常用方法介绍
- Sqlite3 数据库介绍及常用方法的简单封装
- StringUtils常用方法+StringUtils详细介绍
- Jakarta Commnos lang学习 - ToStringBuilder类常用方法介绍
- MediaPlayer 常用方法介绍
- Android MediaPlayer 常用方法介绍
- Fedora 7下常用软件及字体的安装方法介绍
- VC6.0常用控件常用方法介绍
- Android MediaPlayer 常用方法介绍
- EAS BOS 安装插件方法