AfterserviceorderAppBean.java 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package afterserviceorder;
  2. import baseclass.AppBeanCust;
  3. import hyworkorder.hyworkorder;
  4. import p2.util.P2AppException;
  5. import p2.util.P2Exception;
  6. import workorder.workorder;
  7. //afterserviceorder.AfterserviceorderAppBean
  8. public class AfterserviceorderAppBean extends AppBeanCust {
  9. @Override
  10. public void initializeApp() throws P2Exception {
  11. super.initializeApp();
  12. }
  13. /**生成工单**/
  14. public int createhyWorkorder() throws Exception {
  15. this.SAVE();
  16. afterserviceorder afterserviceorder = (afterserviceorder) getPao();
  17. if (afterserviceorder != null) {
  18. long l = afterserviceorder.createhyWorkorder();
  19. this.SAVE();
  20. this.REFRESH();
  21. byrefresh();
  22. openApp("HYORDER",l);
  23. }
  24. return 1;
  25. }
  26. /**退回**/
  27. public int SENDBACK() throws Exception {
  28. this.SAVE();
  29. afterserviceorder afterserviceorder = (afterserviceorder) getPao();
  30. if (afterserviceorder.getString("fstatus").equals("待处理")) {
  31. if(afterserviceorder.getString("backreason")==null || afterserviceorder.getString("backreason").length()==0) {
  32. throw new P2AppException("","退回原因为空不可退回");
  33. }else {
  34. afterserviceorder.setValue("fstatus", "新建",11L);
  35. afterserviceorder.setValue("submitby", "",11L);
  36. afterserviceorder.setValue("submitdate", "",11L);
  37. }
  38. this.SAVE();
  39. this.REFRESH();
  40. byrefresh();
  41. }else {
  42. throw new P2AppException("","非待处理不可退回");
  43. }
  44. return 1;
  45. }
  46. }