NC自定义表格加载模板填充弹框

弹窗面板代码:   
select  pk_billtemplet  from pub_billtemplet  where  bill_templetcaption='单据模版名称'
//加载模板
private BillListPanel getBillPanel() {
		if (this.billPanel == null) {
			this.billPanel = new BillListPanel();
			this.billPanel.setName("mpsSplitPanel");
			this.billPanel.loadTemplet("1002A21000000000OJII");
		}
		return this.billPanel;
	}
package nc.ui.fdc_crmbd.h3h080.ace.dlg;
 
import java.awt.BorderLayout;
import java.awt.Container;
import java.util.ArrayList;
import java.util.List;
 
import javax.swing.JPanel;
 
import nc.bs.dao.BaseDAO;
import nc.bs.dao.DAOException;
import nc.bs.framework.common.NCLocator;
import nc.funcnode.ui.AbstractFunclet;
import nc.itf.fdc_crmbd.IH3H080Maintain;
import nc.itf.fdc_pr.IH303100210Maintain;
import nc.itf.fdc_pr.IH3031015Maintain;
import nc.jdbc.framework.processor.ColumnListProcessor;
import nc.ui.pub.beans.MessageDialog;
import nc.ui.pub.beans.UIDialog;
import nc.ui.pub.bill.BillListPanel;
import nc.vo.fdc_pr.h303100210.AggEnterpriseTenant;
import nc.vo.fdc_pr.h3031015.House_customer_b;
import nc.vo.pub.BusinessException;
import nc.vo.pub.CircularlyAccessibleValueObject;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
 
/**
 * 
 * @author: zenglong
 * @ClassName: SplitLineDialog
 * @Description:
 * @date: 2016年12月8日
 */
public class SplitLineDialog extends UIDialog {
 
	private static final long serialVersionUID = 5064747027574608058L;
	private AbstractFunclet parent;
	/** UI JPanel */
	private JPanel uiContentPane;
 
	private BillListPanel billPanel;
 
	// 生产计划编制选择的表体行
	private int row = -1;
 
	// 生产计划编制选择 的表体行vo
	// private MpshbBVO curBody = null;
 
	public SplitLineDialog(AbstractFunclet funclet) {
		super(funclet);
		this.parent = funclet;
		this.initialize();
	}
 
	private void initialize() {
		this.setName("mpsSplitDialog");
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		this.setTitle("房产显示");
		int w = 1000;
		int h = 600;
		this.setBounds(500, 400, w, h);
		this.setResizable(true);
		// 设置模板
		this.setContentPane(this.getUIContentPane());
 
	}
 
	public int  initdata(String pk,String org) {
		CircularlyAccessibleValueObject[] tmpHeadVo = getData(pk,org);
		int result=0;
		if (tmpHeadVo!=null && tmpHeadVo.length>0) {
			if (getBillPanel().getBillListData().isMeataDataTemplate())
				getBillPanel().getBillListData().setHeaderValueObjectByMetaData(
						tmpHeadVo);
			else
				getBillPanel().setHeaderValueVO(tmpHeadVo);
			getBillPanel().getHeadBillModel().execLoadFormula();
			result=1;
		}
		return result;
	}
 
	private Container getUIContentPane() {
		if (null == this.uiContentPane) {
			this.uiContentPane = new JPanel();
			this.uiContentPane.setName("UIDialogContentPane");
			this.uiContentPane.setLayout(new BorderLayout());
			this.getUIContentPane().add(this.getBillPanel(), "Center");
		}
		return this.uiContentPane;
	}
 	/*
	* 重点  加载模板内容
	* **********************************8
	*/
	private BillListPanel getBillPanel() {
		if (this.billPanel == null) {
			this.billPanel = new BillListPanel();
			this.billPanel.setName("mpsSplitPanel");
			this.billPanel.loadTemplet("1002A21000000000OJII");
		}
		return this.billPanel;
	}
 
	public CircularlyAccessibleValueObject[] getData(String pk,String pk_org) {
		IH303100210Maintain personMain = NCLocator.getInstance().lookup(
				IH303100210Maintain.class);
		AggEnterpriseTenant[] aggEnter = null;
		House_customer_b[] vos = null;
		List<House_customer_b> hcutVos=new ArrayList<House_customer_b>();
		try {
		//到租户表中把当前租户主键取出来    + "' and pk_org ='"+pk_org
			aggEnter = personMain
					.querybills(" and nvl(dr,0)=0 and reserve1 = '" + pk+"'");//reservel 集团客户唯一标识
		} catch (BusinessException e) {
			ExceptionUtils.wrappBusinessException("错误:" + e.getMessage());
		}
		if (aggEnter==null) {
			MessageDialog.showErrorDlg(parent,"提示:","该用户未传入租户!");
			return null;
		}else{
		IH3031015Maintain pactMain = NCLocator.getInstance().lookup(
				IH3031015Maintain.class);
		IH3H080Maintain custMain = NCLocator.getInstance().lookup(
				IH3H080Maintain.class);
		for (int i = 0; i < aggEnter.length; i++) {
			//因为一个租户存在多个不同的公司
			vos = pactMain.query(" nvl(dr,0)=0 and pk_customerid = '"//pk_customerid客户主键
					+ aggEnter[i].getParentVO().getPk_head() + "'");
			//将存在不同公司的租户查出来
			for (House_customer_b hc : vos) {
				hcutVos.add(hc);
			}
		}
		if (hcutVos.size()<1) {
			MessageDialog.showErrorDlg(parent,"提示:","该客户未与房间建立关系!");
			return null;
		}
		//通过楼栋主键查找房地产  预留字段3存房地产
		for (int i = 0; i < hcutVos.size(); i++) {
			hcutVos.get(i).setReserve3(custMain.queryFdcxmd(hcutVos.get(i).getReserve1()));
			}
		}
		//list--数据
		return (CircularlyAccessibleValueObject[]) hcutVos.toArray(new CircularlyAccessibleValueObject[] {});
	}
}

代码画的弹框及内容
点击某个行字段 显示参照

//待验证
 bodyItems[list_size].setCaptionLabel(receivedq_label);
 bodyItems[list_size].setComponent(paceRefPane);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值