hyconfirmationorder.java 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package hyconfirmationorder;
  2. import baseclass.PaoCust;
  3. import p2.p2server.P2Server;
  4. import p2.pao.PaoRemote;
  5. import p2.pao.PaoSet;
  6. import p2.pao.PaoSetRemote;
  7. import p2.util.P2Exception;
  8. import tmaxbillnum.tmaxbillnum;
  9. import java.util.Date;
  10. public class hyconfirmationorder extends PaoCust {
  11. /**
  12. * ¹¹Ô캯Êý
  13. *
  14. * @param arg0
  15. */
  16. public hyconfirmationorder(PaoSet arg0) {
  17. super(arg0);
  18. }
  19. @Override
  20. protected void save() throws P2Exception {
  21. super.save();
  22. }
  23. @Override
  24. public void init() throws P2Exception {
  25. super.init();
  26. }
  27. @Override
  28. public void add() throws P2Exception {
  29. super.add();
  30. PaoSetRemote hyordernode = getOwner().getPaoSet("HYORDERNODE");
  31. hyordernode.setWhere("ischilden=0");
  32. hyordernode.setOrderBy("FROWNUM desc");
  33. hyordernode.reset();
  34. if(!hyordernode.isEmpty())
  35. setValue("fnotes",hyordernode.getPao(0).getString("fnotes"),11l);
  36. setValue("fbillnum",getbillnum(),11l);
  37. setValue("fstatus","н¨",11l);
  38. }
  39. public String getbillnum() throws P2Exception {
  40. PaoSetRemote maxbill = P2Server.getP2Server().getPaoSet("tmaxbillnum",
  41. getUserInfo());
  42. maxbill.setInsertSite(getSite());
  43. maxbill.setWhere("app='hyconfirmationorder' and siteid='" + getString("siteid") + "'");
  44. maxbill.reset();
  45. PaoRemote pao = null;
  46. if (maxbill.isEmpty()) {
  47. pao = maxbill.addAtEnd();
  48. pao.setValue("FSERIALNUM", 1);
  49. pao.setValue("APP", "hyconfirmationorder");
  50. pao.setValue("FLENGTH", 10);
  51. } else {
  52. pao = maxbill.getPao(0);
  53. }
  54. String billnum = ((tmaxbillnum) pao).getBillNum();
  55. maxbill.save();
  56. return billnum;
  57. }
  58. @Override
  59. public void fieldAction(Object paoField, String fieldname) throws P2Exception {
  60. super.fieldAction(paoField, fieldname);
  61. }
  62. @Override
  63. public void fieldValidate(Object paoField, String fieldname) throws P2Exception {
  64. super.fieldValidate(paoField, fieldname);
  65. }
  66. @Override
  67. public void delete() throws P2Exception {
  68. super.delete();
  69. }
  70. public void submit(boolean issubmit,String hrid) throws P2Exception {
  71. super.submit(issubmit);
  72. if(issubmit){
  73. setValue("fstatus","Ìá½»",11l);
  74. setValue("submitdate",new Date(),11l);
  75. setValue("submitby",hrid,11l);
  76. }
  77. }
  78. }