package afterserviceorder; import baseclass.AppBeanCust; import hyworkorder.hyworkorder; import p2.util.P2AppException; import p2.util.P2Exception; import workorder.workorder; //afterserviceorder.AfterserviceorderAppBean public class AfterserviceorderAppBean extends AppBeanCust { @Override public void initializeApp() throws P2Exception { super.initializeApp(); } /**生成工单**/ public int createhyWorkorder() throws Exception { this.SAVE(); afterserviceorder afterserviceorder = (afterserviceorder) getPao(); if (afterserviceorder != null) { long l = afterserviceorder.createhyWorkorder(); this.SAVE(); this.REFRESH(); byrefresh(); openApp("HYORDER",l); } return 1; } /**退回**/ public int SENDBACK() throws Exception { this.SAVE(); afterserviceorder afterserviceorder = (afterserviceorder) getPao(); if (afterserviceorder.getString("fstatus").equals("待处理")) { if(afterserviceorder.getString("backreason")==null || afterserviceorder.getString("backreason").length()==0) { throw new P2AppException("","退回原因为空不可退回"); }else { afterserviceorder.setValue("fstatus", "新建",11L); afterserviceorder.setValue("submitby", "",11L); afterserviceorder.setValue("submitdate", "",11L); } this.SAVE(); this.REFRESH(); byrefresh(); }else { throw new P2AppException("","非待处理不可退回"); } return 1; } }