package com.jeeplus.modules.supply.utils;

import com.google.common.collect.Lists;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.supply.judgementBills.entity.SupplyJudgementBills;
import com.jeeplus.modules.supply.judgementBills.mapper.SupplyJudgementBillsMapper;

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

/**
 * 公共验证方法
 * @author: 徐滕
 * @create: 2022-03-03 09:21
 **/
public class CommonUtil {

    /**
     * 对比项目定义号信息
     * @param projectDefinitionInfoList 项目信息表中的项目定义号
     * @param projectDefinitionList 导入数据中的项目定义号
     * @return
     */
    public static String comparisonProjectDefinition (List<String> projectDefinitionInfoList, List<String> projectDefinitionList){

        List<String> nonentityProjectDefinitionList = Lists.newArrayList();
        String projectDefinitions = StringUtils.join(projectDefinitionInfoList);

        for (String projectDefinition : projectDefinitionList) {
            //判定上传的信息中的项目定义号是否包含在数据库中
            if(!projectDefinitions.contains(projectDefinition)){
                nonentityProjectDefinitionList.add(projectDefinition);
            }
        }
        String nonentityProjectDefinitions = StringUtils.join(nonentityProjectDefinitionList);
        return nonentityProjectDefinitions;
    }
}
