package com.app.hxqh.pr;

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

import java.rmi.RemoteException;

/**
 * 工厂级需求申请选择流程ID
 * edit 20230419
 */
public class FldUdOaId extends MAXTableDomain {
    public FldUdOaId(MboValue mbv) {
        super(mbv);
        String thisAttr = getMboValue().getAttributeName();
        setRelationship("UDQLPZB", "");
        String[] FromStr = { "KEY_CODE" };
        String[] ToStr = { thisAttr };
        setLookupKeyMapInOrder(ToStr, FromStr);
    }

    public MboSetRemote getList() throws MXException, RemoteException {
        String orgid=getMboValue().getMbo().getString("ORGID");
        String appName = getMboValue().getMbo().getThisMboSet().getApp();
        if("UDPRGATHER".equalsIgnoreCase(appName)) { //工厂需求申请
            if("TILE".equalsIgnoreCase(orgid)){
                setListCriteria(" FIELD_NAME='工作流ID' and KEY_CODE in('3601','3623')");
            }else{
                setListCriteria("FIELD_NAME='工作流ID' and KEY_CODE in('1201','0735')");
            }

        }
        return super.getList();
    }


}
