package com.app.hxqh.udlld;


import psdi.mbo.MAXTableDomain;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.util.MXException;

import java.rmi.RemoteException;

/**
 * 领料申请单选择仓库编号
 */
public class FldLocnum extends MAXTableDomain{

	public FldLocnum(MboValue mbv) {
		super(mbv);
	    String attr =getMboValue().getAttributeName();
	    setRelationship("LOCATIONS", "SITEID=:SITEID");
		String[] arrayOfString1 = {"LOCNUM"};
		String[] arrayOfString2 = {"LOCATION"};
		setLookupKeyMapInOrder(arrayOfString1, arrayOfString2);
	}

	@Override
	public MboSetRemote getList() throws MXException, RemoteException {
		MboSetRemote set = super.getList();
		MboRemote mbo=getMboValue().getMbo();
		String appName = mbo.getThisMboSet().getApp();
		if("UDLLD".equalsIgnoreCase(appName) || "UDCLLLD".equalsIgnoreCase(appName)) { //领料申请单 || 车辆领料申请单
			set.setWhere(" TYPE='STOREROOM' and ORGID='"+mbo.getString("ORGID")+"' and SITEID='"+mbo.getString("SITEID")+"'");
			set.reset();
		}
		return set;
	}
}

 



