package com.elephant.framework.galaxy.aroad.trafficbasic.infodata;

import com.elephant.framework.galaxy.aroad.trafficbasic.domain.LuKeBridge;
import com.elephant.framework.galaxy.aroad.trafficbasic.domain.LuKeHighWay;
import com.elephant.framework.galaxy.aroad.trafficbasic.utils.EsUtil_fanshe;

import java.util.ArrayList;

/**
 * @program: pingxiang_basedata
 * @description: ${description}
 * @author: dongjili
 * @create: 2019-03-21 11:15
 **/
public class ReadExcelBridge {
    public static void main(String[] args) throws Exception {
        createIndexAnd2Hbase();
    }

    public static void createIndexAnd2Hbase() throws Exception {
        //解析excel封装成list集合返回
        // List<LuKeBridge> luKeBridges = ExcelUtil_fanshe.readPathBridge("D:\\路科基础数据\\2018年桥梁明细表（带GUID）.xlsx");
       /*for (LuKeBridge luKeBridge : luKeBridges) {
            System.out.println(luKeBridge.toString());
        }*/
        //解析excel封装成list集合返回
        //List<LuKeHighWay> luKeHighWays = ExcelUtil_fanshe.readPathHighWay("D:\\路科基础数据\\2018年路段信息表（带GUID）.xlsx");
      /*  for (LuKeHighWay luKeHighWay : luKeHighWays) {
            System.out.println(luKeHighWay.toString());
        }*/
        //elasticsearch索引中插入数据
        //EsUtil_fanshe.indexBridge(luKeBridges);
        //EsUtil_fanshe.indexHighWay(luKeHighWays);
//分词查询桥梁数据返回list集合
        ArrayList<LuKeBridge> luKeBridges = EsUtil_fanshe.queryBridge("曹县", "basicbridgedata", "2018", 0, 2000000000);
       /* for (LuKeBridge luKeBridge : luKeBridges) {
            System.out.println(luKeBridge.toString());
        }*/
        //分词查询路段数据返回list集合
      ArrayList<LuKeHighWay> lukehighways = EsUtil_fanshe.queryHighWay("曹县", "basichighwaydata", "2018", 0, 2000000000);
       /* for (LuKeHighWay lukehighway : lukehighways) {
            System.out.println(lukehighway.toString());
        }*/
        //查询索引库中所有的桥梁id
        ArrayList<String> basicbridgeIds = EsUtil_fanshe.queryIds("basicbridgedata", "2018", 0, 2000000000);
       /* for (String basicbridgeId : basicbridgeIds) {
            System.out.println(basicbridgeId);
        }*/
        //查询索引库中所有的路段id
        ArrayList<String> basichighwayIds = EsUtil_fanshe.queryIds("basichighwaydata", "2018", 0, 2000000000);
//分词检索出来的数据是否是路段数据或者桥梁数据
        String s = EsUtil_fanshe.ifInclude(basicbridgeIds, basichighwayIds, luKeBridges, lukehighways);
        System.out.println(s);
    }
}
