package com.engine.htxc.eseal.counterparty.service.impl;

import com.engine.core.impl.Service;
import com.engine.htxc.eseal.counterparty.convert.CounterpartyDao;
import com.engine.htxc.eseal.counterparty.service.CounterpartyService;
import com.engine.htxc.eseal.counterparty.vo.Counterparty;
import com.engine.integration.util.StringUtils;
import weaver.general.Util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * @author K1810015
 * @version 1.0.0
 * @ClassName CounterpartyServiceImpl.java
 * @createTime 2022年08月02日 16:18:00
 */
public class CounterpartyServiceImpl extends Service implements CounterpartyService  {

    @Override
    public List<Counterparty> getcounterpartyvo(Map<String, Object> map) {
        if(map==null || map.size()<=0){
            return  null;
        }
        String ids= Util.null2String(map.get("ids"));
        if(StringUtils.isBlank(ids)){
            return null;
        }
        List<Counterparty> list=new ArrayList();
        Arrays.stream(ids.split(",")).forEach((item)->{
            Counterparty counterparty= CounterpartyDao.getTabletoVo(item);
            if(counterparty!=null){
                list.add(counterparty);
            }
        });
        return list;
    }
}
