package com.app.hxqh.routes;

import psdi.app.route.FldRouteStopAssetNum;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.mbo.MboValue;
import psdi.util.MXException;

import java.rmi.RemoteException;

/**
 * 检修路线选择资产
 * edit 2023-08-29
 */
public class FldAssetnum extends FldRouteStopAssetNum {


    public FldAssetnum(MboValue mbv) throws MXException, RemoteException {
        super(mbv);
    }

    public void init() throws RemoteException, MXException {
        super.init();
    }
    public void action() throws RemoteException, MXException {
        super.action();
    }

    public MboSetRemote getList() throws RemoteException, MXException {
        MboRemote mbo = getMboValue().getMbo();
        MboRemote ownerMbo=mbo.getOwner();
        String str="(";
        MboRemote lineMbo=null;
        MboSetRemote routelineSet=ownerMbo.getMboSet("ROUTE_STOP");
        for(int i=0;i<routelineSet.count();i++){
            str+="'";
            lineMbo=routelineSet.getMbo(i);
            str+=lineMbo.getString("ASSETNUM");
            if(i==routelineSet.count()-1){
            str+=" '";
            }else{
                str+="',";
            }
        }
        str+=")";
//        setListCriteria(" ASSETNUM NOT IN "+str+" and USESTATUS='Running' ");
        setListCriteria(" ASSETNUM NOT IN "+str+" ");//20240408按芦占占要求取消状态限制
        return super.getList();
    }

}