package com.engine.htsc.subcompany.service.impl;

import com.engine.htsc.subcompany.model.ReportSequenceVO;
import com.engine.htsc.subcompany.model.UfZgsspl;
import com.engine.htsc.subcompany.tools.ZgtyUfzgsServiceTools;

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

public class ZgtySubCompanyLinkServiceImpl extends SubCompanyLinkServiceImpl{

    protected ZgtyUfzgsServiceTools zgtyUfzgsServiceTools = new ZgtyUfzgsServiceTools();

    @Override
    protected List<ReportSequenceVO> getReportVO(String unumbercode, List<Map<String,String>> reqMapList) {
        List<ReportSequenceVO> respListBefore = new ArrayList<>();
        for(Map<String,String> mingxiMap : reqMapList) {
            //根据不同业务获取Dao层入参
            Map<String,String> mapReqSql = this.getMapReqSql(unumbercode, mingxiMap);
            //查询初步符合条件的审批链
            List<UfZgsspl> ufFzjgsplList = ufZgssplDao.getUfzgsspl(mapReqSql);
            //条件过滤并赋值
            List<ReportSequenceVO> fzjgsplVoList = zgtyUfzgsServiceTools.convertModelToVO(ufFzjgsplList,mingxiMap.get("bxry"),(HashMap)mingxiMap,unumbercode);
            respListBefore.addAll(fzjgsplVoList);
        }
        return respListBefore;
    }
}
