package com.brilliance.isc.common.ordmod.vo;

import com.brilliance.isc.bo.Ord;
import com.brilliance.isc.bo.Ore;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import static com.brilliance.mda.runtime.mda.Constants.NULLSTR;

@Data
public class OrdmodVo extends AbstractCommonVo implements Serializable {

    //INR of registered ORD 'NEW' for new ORD
    private  String ordinr = NULLSTR;
    //Flag to activate ORD system  默认值是X
    //private  String actflg = NULLSTR;
    //收单行处理标志
    private  String sdhflg = NULLSTR;

    //新的复核记录
    private String routxt ;

    private Ord ord;

    private Ore ore;

    private List<Ore> oreList;

    @Override
    public void reset() {
        if (ord == null) {
            ord = new Ord();
        }
        if (ore == null) {
            ore = new Ore();
        }
        if (oreList == null) {
            oreList = new ArrayList<>();
        }
    }

    public static OrdmodVo init(Ord ord){
        OrdmodVo ordmodVo=new OrdmodVo();
        ordmodVo.setOre(new Ore());
        ordmodVo.setOrd(ord);
        ordmodVo.setOrdinr(ord.getInr());
        return ordmodVo;
    }
}
