/**
 * output package name
 */
package com.kingdee.eas.custom.htjd.client;

import java.awt.event.ActionEvent;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;

import org.apache.log4j.Logger;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.ctrl.kdf.table.KDTable;
import com.kingdee.bos.ctrl.swing.KDTextField;
import com.kingdee.bos.ctrl.swing.event.DataChangeEvent;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.metadata.entity.FilterInfo;
import com.kingdee.bos.metadata.entity.FilterItemInfo;
import com.kingdee.bos.metadata.query.util.CompareType;
import com.kingdee.bos.ui.face.CoreUIObject;
import com.kingdee.bos.ui.face.UIRuleUtil;
import com.kingdee.eas.base.permission.UserInfo;
import com.kingdee.eas.basedata.master.cssp.SupplierFactory;
import com.kingdee.eas.basedata.master.cssp.SupplierInfo;
import com.kingdee.eas.basedata.org.AdminOrgUnitInfo;
import com.kingdee.eas.basedata.org.CompanyOrgUnitInfo;
import com.kingdee.eas.basedata.person.PersonFactory;
import com.kingdee.eas.basedata.person.PersonInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.common.client.SysContext;
import com.kingdee.eas.custom.htjd.ContractEndFactory;
import com.kingdee.eas.custom.htjd.ContractEndInfo;
import com.kingdee.eas.fdc.contract.ContractBillInfo;
import com.kingdee.eas.scm.sm.pur.PurContractInfo;
import com.kingdee.eas.xr.XRSQLFacadeFactory;
import com.kingdee.eas.xr.helper.PersonXRHelper;
import com.kingdee.jdbc.rowset.IRowSet;

/**
 * output class name
 * 快速复制类
 * by Sera on 2019
 */
public class ContractEndEditUI extends AbstractContractEndEditUI {
	private static final Logger logger = CoreUIObject
			.getLogger(ContractEndEditUI.class);

	/**
	 * output class constructor
	 */
	public ContractEndEditUI() throws Exception {
		super();
	}
	/**
	 * 数据加载方法
	 */
	public void onLoad() throws Exception {
		// TODO Auto-generated method stub
		super.onLoad();
		actionRemove.setVisible(false);		//隐藏删除按钮
		actionCopy.setVisible(false);		//隐藏复制按钮
		actionAddNew.setVisible(false); 	// 隐藏新增按钮
		conthtId.setVisible(false); 		// 隐藏上游合同的id设置为不可见，htid
		
		prmtmanager.setRequired(true);
		prmtpurCompany.setRequired(true);
		prmtpurDepartment.setRequired(true);
		prmtpreCompany.setRequired(true);			//设置必输字段的颜色
		prmtpreDepartment.setRequired(true);
		prmtprePerson.setRequired(true);
		txttitle.setRequired(true);
		txtkeyPoint.setRequired(true);
		
		prmtsuppiler.setEnabled(false);				//设置不可用的字段
		conthtNumber.setEnabled(false);
		txthtName.setEnabled(false);				//控件前缀
		
		
		EntityViewInfo view = new EntityViewInfo();
		FilterInfo filInfo = new FilterInfo();		//建立过滤条件
		filInfo.getFilterItems().add(				//加入过滤条件
				new FilterItemInfo("isBizUnit", "1", CompareType.EQUALS));	//	isBizUnit是否实体，（1，实体）																	
		view.setFilter(filInfo);					//将过滤条件加入到view中
		prmtpreCompany.setEntityViewInfo(view);		//也可将过滤条件加入到query中
		prmtpreCompany.setEntityViewInfo(view);		//过滤公司字段
		prmtpurCompany.setEntityViewInfo(view);		//过滤公司字段
		
		/**
		 * 
		 */
		Timestamp 	  myTimeS = new Timestamp(System.currentTimeMillis());  //时间戳
		Date 		  myDate = new Date();									//日期
		StringBuffer  myBufStr = new StringBuffer();                     	//可变字符串
		String   	  myString=null;										//字符串
		
		int    		  myInt=UIRuleUtil.getInt("0.00");						//整形
		BigDecimal    myBigDec=UIRuleUtil.getBigDecimal("0.00");			//数量
		
		/**
		 * F7还原
		 */
		ContractEndInfo contractEndinfo=ContractEndFactory.getRemoteInstance().getContractEndInfo(new ObjectUuidPK(editData.getId()));
		String myId=editData.getId().toString();
		PersonInfo personinfo=(PersonInfo)prmtmanager.getValue();			//控件值	还原
		ObjectUuidPK mypk=new ObjectUuidPK(editData.getManager().getId());	//主键还原
		PersonInfo myPersoninfo=PersonFactory.getRemoteInstance().getPersonInfo(mypk);
		ContractEndInfo contractinfo= ContractEndFactory.getRemoteInstance().getContractEndInfo(new ObjectUuidPK(editData.getId()));
		ObjectUuidPK personPK=new ObjectUuidPK(contractinfo.getPrePerson().getId());
		PersonInfo herPersonInfo=PersonFactory.getRemoteInstance().getPersonInfo(personPK);
		
	}

	public void onShow() throws Exception {
		// TODO Auto-generated method stub

	}

	/**
	 * output loadFields method
	 */
	public void loadFields() {
		super.loadFields();

	}

	/**
	 * output loadFields method
	 * 申请人的值更改变事件
	 */
	protected void prmtprePerson_dataChanged(DataChangeEvent e)
			throws Exception {
		// TODO Auto-generated method stub
		
		super.prmtprePerson_dataChanged(e);
		
		//sql语句的执行
//		if(prmtprePerson != null){
//			PersonInfo perPersoninfo=(PersonInfo)prmtprePerson.getValue();
//			AdminOrgUnitInfo preAdminInfo=PersonXRHelper.getPosiMemByDeptUser(perPersoninfo);
//			
//			StringBuffer sql0 = new StringBuffer();
//			String sqlFId=editData.getId().toString();
//			sql0.append("SELECT CFSALECONTRACTID myId FROM T_SM_PurRequest where FID ='"+ sqlFId + "'");
//			IRowSet rowset0 = XRSQLFacadeFactory.getRemoteInstance().executeQuery(sql0.toString(), null);
//			while(rowset0.next()){
//				String sqlType =rowset0.getString("type");
//				String sqlDate =rowset0.getString("type");
//				BigDecimal FQty=UIRuleUtil.getBigDecimal("0.00");		//数量
//
//			}

	}
	

	/**
	 * output loadFields method
	 * 部门经理的值更改变事件
	 */
	protected void prmtmanager_dataChanged(DataChangeEvent e) throws Exception {
		// TODO Auto-generated method stub
		super.prmtmanager_dataChanged(e);
		if (prmtmanager.getValue() != null) {							//由F7控件值可强转得到F7对象
			PersonInfo personInfo = (PersonInfo) prmtmanager.getValue();// 由部门经理带出供应商，部门经理的控件prmtmanager_dataChanged
			AdminOrgUnitInfo adminInfo = PersonXRHelper.getPosiMemByDeptUser(personInfo);//由人员得到部门
			prmtpurDepartment.setValue(adminInfo);						//设置提交部门			

		}
	}

	/**
	 * output storeFields method 
	 * 值的写入方法
	 */
	public void storeFields() {
		super.storeFields();
	}

	/**
	 * output btnAddLine_actionPerformed method
	 */
	protected void btnAddLine_actionPerformed(java.awt.event.ActionEvent e)
			throws Exception {
		super.btnAddLine_actionPerformed(e);
	}

	/**
	 * output menuItemEnterToNextRow_itemStateChanged method
	 */
	protected void menuItemEnterToNextRow_itemStateChanged(
			java.awt.event.ItemEvent e) throws Exception {
		super.menuItemEnterToNextRow_itemStateChanged(e);
	}

	/**
	 * output actionPageSetup_actionPerformed
	 */
	public void actionPageSetup_actionPerformed(ActionEvent e) throws Exception {
		super.actionPageSetup_actionPerformed(e);
	}

	/**
	 * output actionExitCurrent_actionPerformed
	 */
	public void actionExitCurrent_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionExitCurrent_actionPerformed(e);
	}

	/**
	 * output actionHelp_actionPerformed
	 */
	public void actionHelp_actionPerformed(ActionEvent e) throws Exception {
		super.actionHelp_actionPerformed(e);
	}

	/**
	 * output actionAbout_actionPerformed
	 */
	public void actionAbout_actionPerformed(ActionEvent e) throws Exception {
		super.actionAbout_actionPerformed(e);
	}

	/**
	 * output actionOnLoad_actionPerformed
	 */
	public void actionOnLoad_actionPerformed(ActionEvent e) throws Exception {
		super.actionOnLoad_actionPerformed(e);
	}

	/**
	 * output actionSendMessage_actionPerformed
	 */
	public void actionSendMessage_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionSendMessage_actionPerformed(e);
	}

	/**
	 * output actionCalculator_actionPerformed
	 */
	public void actionCalculator_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionCalculator_actionPerformed(e);
	}

	/**
	 * output actionExport_actionPerformed
	 */
	public void actionExport_actionPerformed(ActionEvent e) throws Exception {
		super.actionExport_actionPerformed(e);
	}

	/**
	 * output actionExportSelected_actionPerformed
	 */
	public void actionExportSelected_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionExportSelected_actionPerformed(e);
	}

	/**
	 * output actionRegProduct_actionPerformed
	 */
	public void actionRegProduct_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionRegProduct_actionPerformed(e);
	}

	/**
	 * output actionPersonalSite_actionPerformed
	 */
	public void actionPersonalSite_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionPersonalSite_actionPerformed(e);
	}

	/**
	 * output actionProcductVal_actionPerformed
	 */
	public void actionProcductVal_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionProcductVal_actionPerformed(e);
	}

	/**
	 * output actionExportSave_actionPerformed
	 */
	public void actionExportSave_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionExportSave_actionPerformed(e);
	}

	/**
	 * output actionExportSelectedSave_actionPerformed
	 */
	public void actionExportSelectedSave_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionExportSelectedSave_actionPerformed(e);
	}

	/**
	 * output actionKnowStore_actionPerformed
	 */
	public void actionKnowStore_actionPerformed(ActionEvent e) throws Exception {
		super.actionKnowStore_actionPerformed(e);
	}

	/**
	 * output actionAnswer_actionPerformed
	 */
	public void actionAnswer_actionPerformed(ActionEvent e) throws Exception {
		super.actionAnswer_actionPerformed(e);
	}

	/**
	 * output actionRemoteAssist_actionPerformed
	 */
	public void actionRemoteAssist_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionRemoteAssist_actionPerformed(e);
	}

	/**
	 * output actionPopupCopy_actionPerformed
	 */
	public void actionPopupCopy_actionPerformed(ActionEvent e) throws Exception {
		super.actionPopupCopy_actionPerformed(e);
	}

	/**
	 * output actionHTMLForMail_actionPerformed
	 */
	public void actionHTMLForMail_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionHTMLForMail_actionPerformed(e);
	}

	/**
	 * output actionExcelForMail_actionPerformed
	 */
	public void actionExcelForMail_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionExcelForMail_actionPerformed(e);
	}

	/**
	 * output actionHTMLForRpt_actionPerformed
	 */
	public void actionHTMLForRpt_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionHTMLForRpt_actionPerformed(e);
	}

	/**
	 * output actionExcelForRpt_actionPerformed
	 */
	public void actionExcelForRpt_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionExcelForRpt_actionPerformed(e);
	}

	/**
	 * output actionLinkForRpt_actionPerformed
	 */
	public void actionLinkForRpt_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionLinkForRpt_actionPerformed(e);
	}

	/**
	 * output actionPopupPaste_actionPerformed
	 */
	public void actionPopupPaste_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionPopupPaste_actionPerformed(e);
	}

	/**
	 * output actionToolBarCustom_actionPerformed
	 */
	public void actionToolBarCustom_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionToolBarCustom_actionPerformed(e);
	}

	/**
	 * output actionCloudFeed_actionPerformed
	 */
	public void actionCloudFeed_actionPerformed(ActionEvent e) throws Exception {
		super.actionCloudFeed_actionPerformed(e);
	}

	/**
	 * output actionCloudShare_actionPerformed
	 */
	public void actionCloudShare_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionCloudShare_actionPerformed(e);
	}

	/**
	 * output actionCloudScreen_actionPerformed
	 */
	public void actionCloudScreen_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionCloudScreen_actionPerformed(e);
	}

	/**
	 * output actionXunTongFeed_actionPerformed
	 */
	public void actionXunTongFeed_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionXunTongFeed_actionPerformed(e);
	}

	/**
	 * output actionSave_actionPerformed
	 */
	public void actionSave_actionPerformed(ActionEvent e) throws Exception {
		super.actionSave_actionPerformed(e);
	}

	/**
	 * output actionSubmit_actionPerformed
	 */
	public void actionSubmit_actionPerformed(ActionEvent e) throws Exception {
		super.actionSubmit_actionPerformed(e);
	}

	/**
	 * output actionCancel_actionPerformed
	 */
	public void actionCancel_actionPerformed(ActionEvent e) throws Exception {
		super.actionCancel_actionPerformed(e);
	}

	/**
	 * output actionCancelCancel_actionPerformed
	 */
	public void actionCancelCancel_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionCancelCancel_actionPerformed(e);
	}

	/**
	 * output actionFirst_actionPerformed
	 */
	public void actionFirst_actionPerformed(ActionEvent e) throws Exception {
		super.actionFirst_actionPerformed(e);
	}

	/**
	 * output actionPre_actionPerformed
	 */
	public void actionPre_actionPerformed(ActionEvent e) throws Exception {
		super.actionPre_actionPerformed(e);
	}

	/**
	 * output actionNext_actionPerformed
	 */
	public void actionNext_actionPerformed(ActionEvent e) throws Exception {
		super.actionNext_actionPerformed(e);
	}

	/**
	 * output actionLast_actionPerformed
	 */
	public void actionLast_actionPerformed(ActionEvent e) throws Exception {
		super.actionLast_actionPerformed(e);
	}

	/**
	 * output actionPrint_actionPerformed
	 */
	public void actionPrint_actionPerformed(ActionEvent e) throws Exception {
		super.actionPrint_actionPerformed(e);
	}

	/**
	 * output actionPrintPreview_actionPerformed
	 */
	public void actionPrintPreview_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionPrintPreview_actionPerformed(e);
	}

	/**
	 * output actionCopy_actionPerformed
	 */
	public void actionCopy_actionPerformed(ActionEvent e) throws Exception {
		super.actionCopy_actionPerformed(e);
	}

	/**
	 * output actionAddNew_actionPerformed
	 */
	public void actionAddNew_actionPerformed(ActionEvent e) throws Exception {
		super.actionAddNew_actionPerformed(e);
	}

	/**
	 * output actionEdit_actionPerformed
	 */
	public void actionEdit_actionPerformed(ActionEvent e) throws Exception {
		super.actionEdit_actionPerformed(e);
	}

	/**
	 * output actionRemove_actionPerformed
	 */
	public void actionRemove_actionPerformed(ActionEvent e) throws Exception {
		super.actionRemove_actionPerformed(e);
	}

	/**
	 * output actionAttachment_actionPerformed
	 */
	public void actionAttachment_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionAttachment_actionPerformed(e);
	}

	/**
	 * output actionSubmitOption_actionPerformed
	 */
	public void actionSubmitOption_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionSubmitOption_actionPerformed(e);
	}

	/**
	 * output actionReset_actionPerformed
	 */
	public void actionReset_actionPerformed(ActionEvent e) throws Exception {
		super.actionReset_actionPerformed(e);
	}

	/**
	 * output actionMsgFormat_actionPerformed
	 */
	public void actionMsgFormat_actionPerformed(ActionEvent e) throws Exception {
		super.actionMsgFormat_actionPerformed(e);
	}

	/**
	 * output actionAddLine_actionPerformed
	 */
	public void actionAddLine_actionPerformed(ActionEvent e) throws Exception {
		super.actionAddLine_actionPerformed(e);
	}

	/**
	 * output actionCopyLine_actionPerformed
	 */
	public void actionCopyLine_actionPerformed(ActionEvent e) throws Exception {
		super.actionCopyLine_actionPerformed(e);
	}

	/**
	 * output actionInsertLine_actionPerformed
	 */
	public void actionInsertLine_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionInsertLine_actionPerformed(e);
	}

	/**
	 * output actionRemoveLine_actionPerformed
	 */
	public void actionRemoveLine_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionRemoveLine_actionPerformed(e);
	}

	/**
	 * output actionCreateFrom_actionPerformed
	 */
	public void actionCreateFrom_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionCreateFrom_actionPerformed(e);
	}

	/**
	 * output actionCopyFrom_actionPerformed
	 * 复制事件
	 */
	public void actionCopyFrom_actionPerformed(ActionEvent e) throws Exception {
		super.actionCopyFrom_actionPerformed(e);
	}

	/**
	 * output actionAuditResult_actionPerformed
	 * 审批结果事件
	 */
	public void actionAuditResult_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionAuditResult_actionPerformed(e);
	}
	
	/**
	 * output actionTraceUp_actionPerformed
	 * 上游单据事件
	 */
	public void actionTraceUp_actionPerformed(ActionEvent e) throws Exception {
		super.actionTraceUp_actionPerformed(e);
	}

	/**
	 * output actionTraceDown_actionPerformed
	 * 下游单据事件
	 */
	public void actionTraceDown_actionPerformed(ActionEvent e) throws Exception {
		super.actionTraceDown_actionPerformed(e);
	}

	/**
	 * output actionViewSubmitProccess_actionPerformed
	 */
	public void actionViewSubmitProccess_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionViewSubmitProccess_actionPerformed(e);
	}

	/**
	 * output actionViewDoProccess_actionPerformed
	 */
	public void actionViewDoProccess_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionViewDoProccess_actionPerformed(e);
	}

	/**
	 * output actionMultiapprove_actionPerformed
	 */
	public void actionMultiapprove_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionMultiapprove_actionPerformed(e);
	}

	/**
	 * output actionNextPerson_actionPerformed
	 */
	public void actionNextPerson_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionNextPerson_actionPerformed(e);
	}

	/**
	 * output actionStartWorkFlow_actionPerformed
	 */
	public void actionStartWorkFlow_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionStartWorkFlow_actionPerformed(e);
	}

	/**
	 * output actionVoucher_actionPerformed
	 */
	public void actionVoucher_actionPerformed(ActionEvent e) throws Exception {
		super.actionVoucher_actionPerformed(e);
	}

	/**
	 * output actionDelVoucher_actionPerformed
	 */
	public void actionDelVoucher_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionDelVoucher_actionPerformed(e);
	}

	/**
	 * output actionWorkFlowG_actionPerformed
	 */
	public void actionWorkFlowG_actionPerformed(ActionEvent e) throws Exception {
		super.actionWorkFlowG_actionPerformed(e);
	}

	/**
	 * output actionCreateTo_actionPerformed
	 */
	public void actionCreateTo_actionPerformed(ActionEvent e) throws Exception {
		super.actionCreateTo_actionPerformed(e);
	}

	/**
	 * output actionSendingMessage_actionPerformed
	 */
	public void actionSendingMessage_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionSendingMessage_actionPerformed(e);
	}

	/**
	 * output actionSignature_actionPerformed
	 */
	public void actionSignature_actionPerformed(ActionEvent e) throws Exception {
		super.actionSignature_actionPerformed(e);
	}

	/**
	 * output actionWorkflowList_actionPerformed
	 */
	public void actionWorkflowList_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionWorkflowList_actionPerformed(e);
	}

	/**
	 * output actionViewSignature_actionPerformed
	 */
	public void actionViewSignature_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionViewSignature_actionPerformed(e);
	}

	/**
	 * output actionSendMail_actionPerformed
	 * 发送邮件事件
	 */
	public void actionSendMail_actionPerformed(ActionEvent e) throws Exception {
		super.actionSendMail_actionPerformed(e);
	}

	/**
	 * output actionLocate_actionPerformed
	 */
	public void actionLocate_actionPerformed(ActionEvent e) throws Exception {
		super.actionLocate_actionPerformed(e);
	}

	/**
	 * output actionNumberSign_actionPerformed
	 */
	public void actionNumberSign_actionPerformed(ActionEvent e)
			throws Exception {
		super.actionNumberSign_actionPerformed(e);
	}

	/**
	 * output actionAudit_actionPerformed
	 * 审批事件
	 */
	public void actionAudit_actionPerformed(ActionEvent e) throws Exception {
		super.actionAudit_actionPerformed(e);
	}

	/**
	 * output actionUnAudit_actionPerformed
	 * 反审批事件
	 */
	public void actionUnAudit_actionPerformed(ActionEvent e) throws Exception {
		super.actionUnAudit_actionPerformed(e);
	}

	/**
	 * output getBizInterface method
	 * 返回相关的业务对象的方法
	 */
	protected com.kingdee.eas.framework.ICoreBase getBizInterface()
			throws Exception {
		return com.kingdee.eas.custom.htjd.ContractEndFactory
				.getRemoteInstance();
	}

	/**
	 * output createNewDetailData method
	 */
	protected IObjectValue createNewDetailData(KDTable table) {

		return null;
	}

	/**
	 * output createNewData method
	 * 新增单据调用的方法
	 */
	protected com.kingdee.bos.dao.IObjectValue createNewData() {
		com.kingdee.eas.custom.htjd.ContractEndInfo objectValue = new com.kingdee.eas.custom.htjd.ContractEndInfo();
		UserInfo userInfo = com.kingdee.eas.common.client.SysContext
				.getSysContext().getCurrentUserInfo();
		objectValue.setBizDate(new Date()); 					// 设置提交日期/bizDate
		CompanyOrgUnitInfo companyInfo = SysContext.getSysContext()
				.getCurrentFIUnit();							//得到当前系统的公司

		if (companyInfo != null) {
			objectValue.setPreCompany(companyInfo); 			// 设置提交人公司/preCompany
			objectValue.setPurCompany(companyInfo); 			// 设置申请公司/purCompany
		}

		if (userInfo.getPerson() != null) {
			objectValue.setPrePerson(userInfo.getPerson()); 	//设置单据的提交人/prePerson
			AdminOrgUnitInfo adminInfo = PersonXRHelper
					.getPosiMemByDeptUser(userInfo.getPerson());
			objectValue.setPreDepartment(adminInfo); 			// 设置单据的提交部门/preDepartment
		}

		if (getUIContext().get("contractInfo") != null) { 		// 合同管理的合同交底ContractBill的信息
			ContractBillInfo contractInfo = (ContractBillInfo) getUIContext()
					.get("contractInfo");
			objectValue.setHtNumber(contractInfo.getNumber()); 	//设置合同编号/htNumber
			objectValue.setHtName(contractInfo.getName()); 		// 设置合同名/htName
			objectValue.setHtId(contractInfo.getId().toString()); // 设置合同id/htId
			if (contractInfo.getPartB() != null) {
				try {
					SupplierInfo supplierInfo = SupplierFactory
							.getRemoteInstance().getSupplierInfo(
									new ObjectUuidPK(contractInfo.getPartB()
											.getId()));			//由id还原供应商对象
					objectValue.setSuppiler(supplierInfo); 		// 设置供应商/suppiler
				} catch (EASBizException e) {
					e.printStackTrace();
				} catch (BOSException e) {
					e.printStackTrace();
				}
			}

		} else if (getUIContext().get("PurContractInfo") != null) { // 设置来之PurContract采购合同的单据的信息
			PurContractInfo purContractinfo = (PurContractInfo) getUIContext()
					.get("PurContractInfo");
			objectValue.setHtNumber(purContractinfo.getNumber());
			objectValue.setHtName(purContractinfo.getString("htmc"));
			objectValue.setHtId(purContractinfo.getId().toString());
			if (purContractinfo.getSupplier() != null) {
				try {
					SupplierInfo supplierInfo = SupplierFactory
							.getRemoteInstance().getSupplierInfo(
									new ObjectUuidPK(purContractinfo
											.getSupplier().getId()));
					objectValue.setSuppiler(supplierInfo);
				} catch (EASBizException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (BOSException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

			}

		}
		return objectValue;
	}

	@Override
	protected void attachListeners() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void detachListeners() {
		// TODO Auto-generated method stub

	}

	@Override
	protected KDTextField getNumberCtrl() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	/**
	 * 保存调用的检验方法
	 */
	protected void verifyInputForSave() throws Exception {
		// TODO Auto-generated method stub

	}

	@Override
	/**
	 * 提交调用的检验方法
	 */
	protected void verifyInputForSubmit() throws Exception {
		// TODO Auto-generated method stub

	}
	/**
	 * 单据保存和提交调用的校验方法
	 */
	protected void verifyInput(ActionEvent e) throws Exception {
																						//必输字段的校验方法
		if (com.kingdee.bos.ui.face.UIRuleUtil.isNull(prmtmanager.getText())) {
			throw new com.kingdee.eas.common.EASBizException(com.kingdee.eas.common.EASBizException.CHECKBLANK,new Object[] {"申购部门经理"});
			}
		if (com.kingdee.bos.ui.face.UIRuleUtil.isNull(prmtpreCompany.getText())) {
			throw new com.kingdee.eas.common.EASBizException(com.kingdee.eas.common.EASBizException.CHECKBLANK,new Object[] {"提交人公司"});
			}
		if (com.kingdee.bos.ui.face.UIRuleUtil.isNull(prmtpreDepartment.getValue())) {
			throw new com.kingdee.eas.common.EASBizException(com.kingdee.eas.common.EASBizException.CHECKBLANK,new Object[] {"提交部门"});
			}
		if (com.kingdee.bos.ui.face.UIRuleUtil.isNull(prmtprePerson.getText())) {
			throw new com.kingdee.eas.common.EASBizException(com.kingdee.eas.common.EASBizException.CHECKBLANK,new Object[] {"提交人"});
			}
		if (com.kingdee.bos.ui.face.UIRuleUtil.isNull(prmtpurCompany.getText())) {
			throw new com.kingdee.eas.common.EASBizException(com.kingdee.eas.common.EASBizException.CHECKBLANK,new Object[] {"申请公司"});
			}
		if (com.kingdee.bos.ui.face.UIRuleUtil.isNull(prmtpurDepartment.getText())) {
			throw new com.kingdee.eas.common.EASBizException(com.kingdee.eas.common.EASBizException.CHECKBLANK,new Object[] {"申请部门"});
			}
		if (com.kingdee.bos.ui.face.UIRuleUtil.isNull(prmtpurCompany.getText())) {
			throw new com.kingdee.eas.common.EASBizException(com.kingdee.eas.common.EASBizException.CHECKBLANK,new Object[] {"申请公司"});
			}
		if (com.kingdee.bos.ui.face.UIRuleUtil.isNull(txttitle.getText())) {
			throw new com.kingdee.eas.common.EASBizException(com.kingdee.eas.common.EASBizException.CHECKBLANK,new Object[] {"标题"});
			}
		if (com.kingdee.bos.ui.face.UIRuleUtil.isNull(txtkeyPoint.getText())) {
			throw new com.kingdee.eas.common.EASBizException(com.kingdee.eas.common.EASBizException.CHECKBLANK,new Object[] {"合同交底要点"});
			}
		
		
				
	}
	 /**
	  * 在数据存储前使用，可以编辑当前数据editData
	  */
	protected void beforeStoreFields(ActionEvent e) throws Exception {
		// TODO Auto-generated method stub
		super.beforeStoreFields(e);
	}
	/**
	 * 设置单据状态方法
	 */
	public void setOprtState(String oprtType) {
		// TODO Auto-generated method stub
		super.setOprtState(oprtType);
	}

}