package hyconfirmationorder; import baseclass.PaoCust; import p2.p2server.P2Server; import p2.pao.PaoRemote; import p2.pao.PaoSet; import p2.pao.PaoSetRemote; import p2.util.P2Exception; import tmaxbillnum.tmaxbillnum; import java.util.Date; public class hyconfirmationorder extends PaoCust { /** * 构造函数 * * @param arg0 */ public hyconfirmationorder(PaoSet arg0) { super(arg0); } @Override protected void save() throws P2Exception { super.save(); } @Override public void init() throws P2Exception { super.init(); } @Override public void add() throws P2Exception { super.add(); PaoSetRemote hyordernode = getOwner().getPaoSet("HYORDERNODE"); hyordernode.setWhere("ischilden=0"); hyordernode.setOrderBy("FROWNUM desc"); hyordernode.reset(); if(!hyordernode.isEmpty()) setValue("fnotes",hyordernode.getPao(0).getString("fnotes"),11l); setValue("fbillnum",getbillnum(),11l); setValue("fstatus","新建",11l); } public String getbillnum() throws P2Exception { PaoSetRemote maxbill = P2Server.getP2Server().getPaoSet("tmaxbillnum", getUserInfo()); maxbill.setInsertSite(getSite()); maxbill.setWhere("app='hyconfirmationorder' and siteid='" + getString("siteid") + "'"); maxbill.reset(); PaoRemote pao = null; if (maxbill.isEmpty()) { pao = maxbill.addAtEnd(); pao.setValue("FSERIALNUM", 1); pao.setValue("APP", "hyconfirmationorder"); pao.setValue("FLENGTH", 10); } else { pao = maxbill.getPao(0); } String billnum = ((tmaxbillnum) pao).getBillNum(); maxbill.save(); return billnum; } @Override public void fieldAction(Object paoField, String fieldname) throws P2Exception { super.fieldAction(paoField, fieldname); } @Override public void fieldValidate(Object paoField, String fieldname) throws P2Exception { super.fieldValidate(paoField, fieldname); } @Override public void delete() throws P2Exception { super.delete(); } public void submit(boolean issubmit,String hrid) throws P2Exception { super.submit(issubmit); if(issubmit){ setValue("fstatus","提交",11l); setValue("submitdate",new Date(),11l); setValue("submitby",hrid,11l); } } }