21.ArrayUtils 判断集合是否为空
ArrayUtils.isNotEmpty(facVOs)
22.数据库查询工具(查询一个数组)
DataAccessUtils dao = new DataAccessUtils();
IRowSet rowset = (IRowSet) dao.query(sql.toString());
if(rowset != null && rowset.size() > 0){
String[] result1 = rowset.toOneDimensionStringArray();
return result1[0];
}
23.刷新调用
nc.ui.pubapp.uif2app.actions.RefreshSingleAction refreshaction=new RefreshSingleAction();
refreshaction.doAction(e1);
24.根据id查询sm_user表的vo
IUserManageQuery userQry = NCLocator.getInstance().lookup(IUserManageQuery.class);
UserVO user = userQry.getUser(cuserid);
25.根据cuserid,明文密码校验
Boolean flag =RbacUserPwdUtil.checkUserPassword(user, oldpwd2);//根据cuserid,明文密码校验
26.根据明文密码和UserVO修改密码
IUserPasswordManage mange = NCLocator.getInstance().lookup(IUserPasswordManage.class);
mange.changeUserPassWord(user, newpwd);
27.生成单据pk和单据号
String pk = NCLocator.getInstance().lookup(OidGenerator.class).nextOid("0001");
import nc.jdbc.framework.generator.IdGenerator;
import nc.jdbc.framework.generator.SequenceGenerator;
IdGenerator idGenerator = new SequenceGenerator();
String pk = idGenerator.generate();
批量单据号和pk
nc.bs.pub.billcodemanage.BillcodeGenerater gene = new nc.bs.pub.billcodemanage.BillcodeGenerater();
String[] codes = gene.getBatchBillCodes("WGD", "1001", null, costarr.size());//批量单据号
String[] pks = new SequenceGenerator().generate("1001", costarr.size());//批量pk
单据号
前置任务:配置单据号规则
创建单据号:new HYPubBO().getBillNo(单据类型, 组织, null, null);
或者:getVbillCode(单据类型,组织);
new BillcodeGenerater ().getBillCode (单据类型, 组织,null,null);
28.持久化查询服务接口(uapbs)
IMDPersistenceQueryService
29.用户密码工具类
//uservo,密码
Boolean flag =RbacUserPwdUtil.checkUserPassword(uservo, passWord);
30.根据数据源和usercode获得uservo
INCUserQueryService service = NCLocator.getInstance().lookup(INCUserQueryService.class);
UserVO uservo = service.findUserVO("nc65", userCode);
31.查询审批流表里面的信息
FlowHistoryQryResult result = NCLocator.getInstance().lookup(IPFWorkflowQry.class).queryFlowHistoryQryResult(billtype, billid, 2);
32.按钮里面调刷新
//new一个按钮
nc.ui.pubapp.uif2app.actions.RefreshSingleAction refreshaction=new RefreshSingleAction();
//传数据给这个按钮
refreshaction.setModel(this.gethModel());
//新增一个事件。。。模拟这个按钮事件
ActionEvent e1=new ActionEvent(refreshaction, 1001, "刷新");
//执行这个按钮的doAction方法,把这个模拟事件传进去
refreshaction.doAction(e1);
33.NC单据每次提交必走的地方
nc.bs.pub.taskmanager.TaskManagerDMO.insertWorkitemsOfTask
WorkflownoteVO 会有你要的数据
34.工作流查询接口
//工作流查询接口
FlowHistoryQryResult result = NCLocator .getInstance().lookup(IPFWorkflowQry.class).queryFlowHistoryQryResult(billtype, billid, 2);
MessageMetaVO[] metavos = result.getMessageMetaVOs();
35.提交和审批会走的地方
nc.bs.pub.taskmanager.TaskManagerDMO
public void insertWorkitemsOfTask(String[] userIds, WFTask task, IWorkitemDistributor... dists)
36.approve脚本中
注释:这个类中,在状态传0或者2时,都是不批准的接口方法,这时就会驳回至制单人
if ("0".equals(result)) {
// 不批准
notevo.setApproveresult("N");
} else if ("1".equals(result)) {
// 批准
notevo.setApproveresult("Y");
} else if ("2".equals(result)) {
// 驳回
notevo.setApproveresult("R");
WFTask currTask = notevo.getTaskInfo().getTask();
currTask.setBackToFirstActivity(true);
currTask.setTaskType(4);
}
37.获取选中行得到选中行的VO,获取字段值
String tabCode = panel.getCurrentBodyTableCode();
int[] rows = panel.getBillTable().getSelectedRows();//获取选中的那一行
CombinePriceVO bvo = (CombinePriceVO) panel.getBodyPanel(tabCode).getTableModel().getBodyValueRowVO(rows[0],CombinePriceVO.class.getName());//得到选中那一行的VO
UFBoolean isgrad = bvo.getIsgrad();//是否梯度计价
38.报错方法
MessageDialog.showErrorDlg(null, "提示", " 本次付款金额("+jiemianMoney+") + 累计付款金额("+addallmoney+") > 采购付款计划金额("+allmoney+")\n");
ExceptionUtils.wrappBusinessException(" 本次付款金额("+jiemianMoney+") + 累计付款金额("+addallmoney+") > 采购付款计划金额("+allmoney+")\n");
39.更新实体中变化的字段到到数据库中
VOUpdate<CzyPayPlanBVO> update = new VOUpdate<CzyPayPlanBVO>();
update.update(planBVOs, new String[]{"occupationmny"});
40.将list转出 in 的 SQL
import nc.ui.bd.ref.RefPubUtil;
RefPubUtil.getInSubSql("pk_material",list.toArray(new String[0]))
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/111710.html