package com.brilliance.isc.esb.model.inner;

import com.alibaba.fastjson2.annotation.JSONField;
import com.brilliance.isc.esb.model.ErrorData;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.ArrayList;
import java.util.List;

/**
 * 0930 对内客户管户信息列表查询响应对象
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class InnerRes0930 extends ErrorData {

    /**
     * 客户号[0,30]
     */
    public String orgNo;

    public List<Item0930> lst0930 = new ArrayList<>();

    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class Item0930 {
        /**
         * 管户编号[0,30]
         */
        public String manageSeqId;
        /**
         * 管户类型[0,10]
         */
        public String manageType;
        /**
         * 客户经理[0,50]
         */
        public String custManager;
        /**
         * 机构代码[0,50]
         */
        public String orgId;
        /**
         * 记录创建时间[0,26]
         */
        public String createdTime;
        /**
         * 记录修改时间[0,26]
         */
        public String updatedTime;
        /**
         * 记录失效时间[0,26]
         */
        public String endTime;

    }

    public InnerRes0930() {
    }

    public InnerRes0930(String orgNo, List<Item0930> lst0930) {
        this.orgNo = orgNo;
        this.lst0930 = lst0930;
    }

    /**
     * 获取主办机构
     * @return zbObject
     */
    @JsonIgnore
    @JSONField(serialize = false)
    public Item0930 getZbObject() {
        Item0930 zbObject = new Item0930();
        if (lst0930 != null && lst0930.size()>0 ) {
            for (Item0930 item0930 : lst0930) {
                if ("1".equals(item0930.manageType)){
                    zbObject = item0930;
                    break;
                }
            }
        }
        return zbObject;
    }

    /**
     * 获取协办机构
     * @return xbObject
     */
    @JsonIgnore
    @JSONField(serialize = false)
    public List<Item0930> getXbObject() {
        List<Item0930> xbObject = new ArrayList<>();
        if (lst0930 != null && lst0930.size()>0 ) {
            for (Item0930 item0930 : lst0930) {
                if ("2".equals(item0930.manageType)){
                    xbObject.add(item0930);
                }
            }
        }
        return xbObject;
    }
}
