package afterserviceorder; import baseclass.DataBeanCust; import p2.pao.PaoRemote; import p2.pao.PaoSetRemote; import p2.util.P2AppException; import p2.util.P2Exception; import p2.webclient.system.controller.Utility; import sysmsg.sysmsg; public class AfterserviceordeCreatewkDataBean extends DataBeanCust{ public int createworkorder() throws P2Exception { PaoRemote pao = app.getAppBean().getPao(); String ftype = pao.getString("ftype");// 工单状态 if (ftype==null || ftype.length()==0) { throw new P2AppException("", "选择的工单状态不能为空"); } PaoSetRemote paoset=pao.getPaoSet("HYWORKORDER"); if(!paoset.isEmpty()) { int i=0; PaoRemote paoRemote =null; while ((paoRemote=paoset.getPao(i))!=null) { if(paoRemote.getString("ftype").equals(ftype) && !paoRemote.getString("fstatus").equals("作废")) { throw new P2AppException("", "已存在"+ftype+"类型的工单,无法继续生成此类型的工单"); } i++; } } afterserviceorder afterserviceorder = (afterserviceorder) pao; System.out.println(afterserviceorder.getString("FAGENTNUM")); if (afterserviceorder != null) { System.out.println(888); long l = afterserviceorder.createhyWorkorder(ftype); app.getAppBean().save(); this.sessionContext.queueRefreshEvent(); Utility.sendEvent(sessionContext, app.getCurrentPageId(), "dialogclose", null);// 关闭当前对话框 closeApp("AFTERORDER"); openApp("AFTERORDER", pao.getUniqueIDValue()); openApp("HYORDER",l); byrefresh(); } return 1; } }