package com.ruoyi.spider.ie;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.db.DbUtil;
import cn.hutool.db.Entity;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.enums.ProcessDataType;
import com.ruoyi.spider.helper.StringUtils;
import com.ruoyi.spider.utils.DBUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;

import java.io.DataOutput;
import java.sql.SQLException;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

/**
 * 院校
 *
 * @author duzj
 */
public class CollegeService extends AuthService {
    private String tableName = "csdhe_college_%s";

    private String getTableName(Integer provinceId){
        return String.format("csdhe_college_%s",provinceId);
    }

    /**
     * 获取院校的分数及招生计划
     * @param provinceId
     * @param dataType:profession/plan，专业线/计划
     */
    public void getCollegePlanEnroll(Integer provinceId,String insertCollegeIds,String dataType,List<Integer> yearList){
        List<Entity> collegeList = getCollegeByDb(provinceId);

        //院校分数及计划
        List<Integer> collegeIdList = new ArrayList<>();
        if(com.ruoyi.common.utils.StringUtils.isNotBlank(insertCollegeIds)){
            collegeIdList = Arrays.stream(insertCollegeIds.split(",")).map(Integer::parseInt) .collect(Collectors.toList());
        }
        List<Integer> alreadyCollegeList = Arrays.asList();
        for (Entity row : collegeList) {
            Integer collegeId = row.getInt("id");
            //跳过已经存在的collegeId
            if(alreadyCollegeList.contains(collegeId)){
                logger.info("跳过学校 {}",collegeId);
                continue;
            }
//            if(collegeId<9848){
//            if(null!=insertCollegeId&&collegeId<insertCollegeId){
//                continue;
//            }
            if(null!=collegeId&&CollectionUtils.isNotEmpty(collegeIdList)&&!collegeIdList.contains(collegeId)){
                logger.info("跳过学校 {}",collegeId);
                continue;
            }

            String collegeName = row.getStr("title");
            getProfessionFilter( collegeId, provinceId, collegeName,dataType,yearList);
            ThreadUtil.sleep(1000);
        }
    }

    List<Integer> addCollegeList = Arrays.asList(10602,10601,10599,10598,10597);
    public void getCollegeListByProvince(Integer provinceId) {
        AtomicInteger page = new AtomicInteger(1);
        tableName = getTableName(provinceId);
        //院校详情
        while (true) {
            JSONArray list = getList(provinceId, page.getAndIncrement());
            if (list.isEmpty()) {
                break;
            }
            for (int i = 0; i < list.size(); i++) {
                JSONObject row = list.getJSONObject(i);
                Integer collegeId=row.getInteger("id");
                if(!addCollegeList.contains(collegeId)){
                    continue;
                }
                Entity entity = Entity.create(tableName).parseBean(row);
                for (String key : new String[]{"grade", "doublehigh", "recruitstudenttype", "show_self_tags"}) {
                    entity.set(key, row.getString(key));
                    entity.set("updateTime",new Date());
                    entity.set("new_id",collegeId+11111);
                }
//                entity.set("province_id",provinceId);
                insertOrUpdate(entity, "id");

                //更新详情
                getDetail(collegeId);
                ThreadUtil.sleep(1000);
            }
        }

    }

    public JSONArray getList(Integer provinceId, Integer page) {
        Dict params = Dict.create().set("app_type", "senioriup");
        params.set("good_app_type", "senioriup").set("province_id", "" + provinceId);
        params.set("platform", "android");
        params.set("deviceid", "senioriup2d3011f34b0a8dc8").set("channel", "ali");
        params.set("version", "v1.6.6").set("oaid", "2d3011f34b0a8dc8");
        params.set("enrollment_scope_ids", "1,2");
        /**
         * <code>
         params.set("recruit_student_type_ids", "1");
         params.set("double_high_type_ids", "").set("star_json", "");
         params.set("nature_ids", "") .set("major_id", "");
         params.set("grade_ids", "").set("type_ids", "");
         params.set("from_module", "");
         </code>
         **/
        params.set("page", "" + page);
        params.set("subject_id", "1402").set("cate_id", "1399");
        JSONObject json = getJson("/api/v1.6.5/college", params);
        JSONObject data = json.getJSONObject("data");
        JSONArray list = data.getJSONObject("list").getJSONArray("data");
        // System.out.println(data.getString("total"));
        // System.out.println(list.size());
        // System.out.println(list.getJSONObject(0));
        return list;
    }


    public List<Entity> getCollegeByDb(Integer provinceId) {
        String tableNameCollege = getTableName(provinceId);

        List<Entity> coll = find(Entity.create(tableNameCollege));
        return coll;
    }

    public void getDetail(Integer collegeId) {
        Dict params = Dict.create().set("app_type", "senioriup");
        params.set("good_app_type", "senioriup");
        params.set("platform", "android");
        params.set("deviceid", "senioriup2d3011f34b0a8dc8").set("channel", "ali");
        params.set("version", "v1.6.6").set("oaid", "2d3011f34b0a8dc8");
        JSONObject json = getJson("/api/v1.6.5/college/detail/" + collegeId, params);
        JSONObject data = json.getJSONObject("data");
        Entity record = Entity.create(tableName).set("id", data.getLong("id"));
        for (String key : new String[]{"hotline", "weburl", "origin", "remark", "status", "score", "collect_popularity"}) {
            record.set(key, data.getString(key));
        }
        updateById(record);
        // 学校概况,招生简章,考试安排
        for (String key : new String[]{"cms", "recruit_student_cms", "test_cms"}) {
            JSONObject cms = data.getJSONObject(key);
            if (null != cms && cms.containsKey("content")) {
                Entity row = Entity.create("csdhe_cms_2024").parseBean(cms);
                insertOrUpdate(row, "id");
            }
        }
        // 专业
        JSONArray majors = data.getJSONArray("major");
        for (int i = 0; i < majors.size(); i++) {
            JSONObject row = majors.getJSONObject(i);
            Entity entity = Entity.create("csdhe_major");
            entity.set("id", row.getLong("id"));
            entity.set("title", row.getString("title"));
            entity.set("name", row.getString("name"));
            entity.set("count", row.getString("school_count"));
            entity.set("updateTime", new Date());
            insertOrUpdate(entity, "id");
//            if (row.getLongValue("rank", 0L) > 0) {
                Entity ref = Entity.create("csdhe_college_major");
                ref.set("college_id", data.getLong("id"));
                ref.set("major_id", row.getLong("id"));
                ref.set("rank", row.getLong("rank"));
                ref.set("updateTime", new Date());
                insertOrUpdate(ref, "college_id", "major_id");
//            }
        }
    }

    // 同步资讯
    public void syncCms(Integer provinceId) {
        tableName = getTableName(provinceId);;
        List<Entity> coll = find(Entity.create(tableName));
        for (Entity row : coll) {
            getCmsList(row.getLong("id"),provinceId);
            ThreadUtil.sleep(500);
        }
    }

    /**
     * 院校内的资讯
     */
    int pageSize = 10;
    public void getCmsList(Long collegeId,Integer provinceId) {
        AtomicInteger page = new AtomicInteger(1);
        while (true) {
            //https://120.26.169.242/api/v1.6.5/college/9043/cms?app_type=senioriup
            // &good_app_type=senioriup&province_id=5604&platform=android
            // &timestrap=1739189263&deviceid=senioriup38b95eb5c97cbd40
            // &channel=upgrade&version=v1.9.1&oaid=38b95eb5c97cbd40
            // &sign=9fe958ecb8e3ce80aef077a83c0f9c5d&id=9043&page=1&limit=10
            // &subject_id=1401&cate_id=1399
            Dict params = Dict.create().set("app_type", "senioriup");
            params.set("good_app_type", "senioriup");
            params.set("province_id", provinceId);
            params.set("platform", "android");
            params.set("deviceid", "senioriup38b95eb5c97cbd40").set("channel", "upgrade");
//            params.set("version", "v1.6.6").set("oaid", "2d3011f34b0a8dc8");
            params.set("version", "v1.9.1").set("oaid", "38b95eb5c97cbd40");
            params.set("id", collegeId);
            params.set("page", page.getAndIncrement()).set("limit", pageSize);
            params.set("subject_id", 1401).set("cate_id", 1399);
            JSONObject json = getJson("/api/v1.6.5/college/" + collegeId + "/cms", params, authorization);
            JSONArray arr = json.getJSONObject("data").getJSONArray("data");
            for (int i = 0; i < arr.size(); i++) {
                JSONObject row = arr.getJSONObject(i);
                logger.info("data: {}",row.getString("title"));
                if(!row.getString("title").contains("2025")){
                    logger.info("跳过非2025：{}",row.getString("title"));
                    continue;
                }
                getCmsInfo(provinceId,collegeId, row.getLong("id"), row.getString("created_at"));
                ThreadUtil.sleep(100);
            }
            if (arr.size() < pageSize) {
                break;
            }
        }
    }

    public void getCmsInfo(Integer provinceId ,Long collegeId, Long cmsId, String created_at) {
        Dict params = Dict.create().set("app_type", "senioriup");
        params.set("good_app_type", "senioriup");
        params.set("platform", "android");
        params.set("deviceid", "senioriup2d3011f34b0a8dc8").set("channel", "ali");
        params.set("version", "v1.6.6").set("oaid", "2d3011f34b0a8dc8");
        params.set("cms_id", cmsId);
        JSONObject json = getJson("/api/v1/college/cms/" + collegeId, params);
        JSONObject info = json.getJSONObject("data").getJSONObject("info");

        Entity entity = Entity.create("csdhe_cms_2024").parseBean(info);
        entity.set("created_at", created_at).remove("college");
        entity.set("province_id",provinceId);
        insertOrUpdate(entity, "id");
    }

    public void transform() {
        List<Entity> list = find(Entity.create("csdhe_college_5604"));
        for (Entity row : list) {
            Entity entity = Entity.create("b_busi_wish_universities");
            entity.set("name", row.getStr("title"));
            entity.set("logo", row.getStr("image"));
            entity.set("location", row.getStr("province_name"));
            entity.set("cityName", row.getStr("city_name"));
            entity.set("createdYear", row.get("created_year"));
            entity.set("ranking", row.get("collect_popularity"));
            entity.set("webSite", row.get("weburl"));
            entity.set("zhaoBanDH", row.get("hotline"));
            entity.set("introduction", row.get("remark"));
            entity.set("hits", row.get("hot_total"));
            DBUtil.insertOrUpdate(DBUtil.target, entity);
        }
    }

    /**
     * 分数线过滤条件：https://120.26.169.242/api/v1.8.5/college/filter?
     * app_type=senioriup&good_app_type=senioriup&province_id=5604&platform=android&timestrap=1734170116&deviceid=senioriupf9e74a91988cd4a5&channel=upgrade&version=v1.8.9&oaid=f9e74a91988cd4a5&sign=44d61065d2bf09bb9e5beac0c9b16178&college_id=9043&type=2&subject_id=1401&cate_id=1399
     * 招生计划过滤条件：https://120.26.169.242/api/v1.8.5/college/filter?
     * app_type=senioriup&good_app_type=senioriup&province_id=5310&platform=android&timestrap=1731988414&deviceid=senioriupf9e74a91988cd4a5&channel=upgrade&version=v1.8.9&oaid=f9e74a91988cd4a5&sign=48f82b2be095e09590ab17532fd16114&college_id=9719&type=4&subject_id=1401&cate_id=1399
     *
     * @param collegeId
     * @param provinceId
     */
    private void getProfessionFilter(Integer collegeId,Integer provinceId,String collegeName,String dataType,List<Integer> yearList) {
//        String authorization2="BearereyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvdWMuY3NkaGUuY29tXC92MVwvYXV0aFwvYmluZF9ndWVzdF9ub19wYXNzIiwiaWF0IjoxNzM0MzEyODI5LCJleHAiOjE3MzY5MDQ4MjksIm5iZiI6MTczNDMxMjgyOSwianRpIjoiV1UwWVQ1OW82dlFJTzB0YiIsInN1YiI6NjMyNDI2MiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.p4TrzZeMMXiUNMBz36ApWGQKKvKTPlJhFYJ46roBQU0";
        ProcessDataType dataTypes = ProcessDataType.getByCode(dataType);
        String dataTypeCode = StringUtils.EMPTY;
        switch (dataTypes){
            //2表示分数，4表示计划
            case profession:
                dataTypeCode="2";
                break;
            case plan:
                dataTypeCode="4";
                break;
            default:
                return;
        }
        String api = "/api/v1.8.5/college/filter";
        // ?app_type=senioriup&good_app_type=senioriup&province_id=5604&platform=android
        // &timestrap=1734170116&deviceid=senioriupf9e74a91988cd4a5&channel=upgrade
        // &version=v1.8.9&oaid=f9e74a91988cd4a5&sign=44d61065d2bf09bb9e5beac0c9b16178
        // &college_id=9043&type=2&subject_id=1401&cate_id=1399
        Dict params = Dict.create();
        params.set("app_type", "senioriup");
        params.set("good_app_type", "senioriup");
        params.set("province_id", provinceId);
        params.set("platform", "android");
//        params.set("timestrap", System.currentTimeMillis()/1000);
        params.set("deviceid", "senioriupf9e74a91988cd4a5");
        params.set("channel", "upgrade");
        params.set("version", "v1.8.9");
        params.set("college_id", collegeId);
        params.set("oaid", "f9e74a91988cd4a5");
        params.set("type", dataTypeCode);//2表示分数，4表示计划
        params.set("subject_id", "1401");
        params.set("cate_id", "1399");
        JSONObject res = getJson(api, params, authorization);
        System.out.println("筛选条件："+res);
        JSONObject data = res.getJSONObject("data");
        JSONArray years = data.getJSONArray("years");

        JSONArray cates = data.getJSONArray("cates");
        for (Object object : cates) {
            JSONObject cate= (JSONObject) object;
            Integer dzsCateId = cate.getInteger("id");
            String dzsCateName = cate.getString("name");
            JSONArray attrs = cate.getJSONArray("attrs");
            for (Object objAttr : attrs){
                JSONObject attr= (JSONObject) objAttr;
                Integer attrId = attr.getInteger("id");
                String attrName = attr.getString("name");
                for (Object y : years) {
                    Integer year = (Integer) y;
                    if(CollectionUtils.isNotEmpty(yearList)&&!yearList.contains(year)){
                        continue;
                    }
                    getProfessionDetail( year, attrId,attrName, dzsCateId,dzsCateName, collegeId, provinceId,collegeName,dataTypes);
                }
            }

            JSONArray childrenArray = cate.getJSONArray("children");
            for (Object objAttr : childrenArray){
                JSONObject attr= (JSONObject) objAttr;
                Integer attrId = attr.getInteger("id");
                String attrName = attr.getString("name");
                Integer pid = attr.getInteger("pid");
                for (Object y : years) {
                    Integer year = (Integer) y;
                    if(CollectionUtils.isNotEmpty(yearList)&&!yearList.contains(year)){
                        continue;
                    }
                    getProfessionDetail( year, attrId,attrName, dzsCateId,dzsCateName, collegeId, provinceId,collegeName,dataTypes);
                }
            }
        }
    }

    /**
     * 分数线
     * https://120.26.169.242/api/v1.8.5/college/9043/line?app_type=senioriup&good_app_type=senioriup&province_id=5604&platform=android&timestrap=1734170116&deviceid=senioriupf9e74a91988cd4a5&channel=upgrade&version=v1.8.9&oaid=f9e74a91988cd4a5&sign=91b73f5baedc355a1fe455ba8c05f8c5&id=9043&year=2024&attr_id=1&dzs_cate_id=7079&purpose=0&subject_id=1401&cate_id=1399
     * https://120.26.169.242/api/v1.8.5/college/9719/plan?app_type=senioriup&good_app_type=senioriup&province_id=5310&platform=android&timestrap=1731988415&deviceid=senioriupf9e74a91988cd4a5&channel=upgrade&version=v1.8.9&oaid=f9e74a91988cd4a5&sign=333d42130f0a6dba30659d1295e08c66&id=9719&year=2024&attr_id=2&dzs_cate_id=7313&purpose=0&subject_id=1401&cate_id=1399
     * @param collegeId
     * @param provinceId  year, attrId,attrName, dzs_cate_id, collegeId, provinceId
     */
    private void getProfessionDetail(Integer year,Integer attrId,String attrName,Integer dzsCateId,String dzsCateName,Integer collegeId,Integer provinceId,String collegeName,ProcessDataType dataTypes) {
//        String authorization2="BearereyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvdWMuY3NkaGUuY29tXC92MVwvYXV0aFwvYmluZF9ndWVzdF9ub19wYXNzIiwiaWF0IjoxNzM0MzEyODI5LCJleHAiOjE3MzY5MDQ4MjksIm5iZiI6MTczNDMxMjgyOSwianRpIjoiV1UwWVQ1OW82dlFJTzB0YiIsInN1YiI6NjMyNDI2MiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.p4TrzZeMMXiUNMBz36ApWGQKKvKTPlJhFYJ46roBQU0";
        String api = StringUtils.EMPTY;
        String label = StringUtils.EMPTY;
        String tableNameInsert = StringUtils.EMPTY;
        int dataType = 0;
        switch (dataTypes){
            //2表示分数，4表示计划
            case profession:
                api = "/api/v1.8.5/college/%s/line";
                label = "专业线数据：";
                tableNameInsert = "csdhe_college_enroll";
                dataType=2;
                break;
            case plan:
                api = "/api/v1.8.5/college/%s/plan";
                label = "招生计划数据：";
                tableNameInsert = "csdhe_college_plan";
                dataType=4;
                break;
            default:
                return;
        }
        api= String.format(api,collegeId);
        // ?app_type=senioriup&good_app_type=senioriup&province_id=5604&platform=android
        // &timestrap=1734170116&deviceid=senioriupf9e74a91988cd4a5&channel=upgrade
        // &version=v1.8.9&oaid=f9e74a91988cd4a5&sign=91b73f5baedc355a1fe455ba8c05f8c5
        // &id=9043&year=2024&attr_id=1&dzs_cate_id=7079&purpose=0&subject_id=1401&cate_id=1399
        Dict params = Dict.create();
        params.set("app_type", "senioriup");
        params.set("good_app_type", "senioriup");
        params.set("province_id", provinceId);
        params.set("platform", "android");
        params.set("deviceid", "senioriupf9e74a91988cd4a5");
        params.set("channel", "upgrade");
        params.set("version", "v1.8.9");
        params.set("oaid", "f9e74a91988cd4a5");
        params.set("id", collegeId);
        params.set("year", year);
        params.set("attr_id", attrId);
        params.set("dzs_cate_id", dzsCateId);
        params.set("purpose", "0");
        params.set("subject_id", "1401");
        params.set("cate_id", "1399");
        JSONObject res = getJson(api, params, authorization);
        Set<Entity> insertDataSet= new HashSet<>();

        if(dataType==2){
            JSONObject data = res.getJSONObject("data").getJSONObject("data");

            JSONArray enrolls = data.getJSONArray("enroll");
            if(CollUtil.isNotEmpty(enrolls)){
                System.out.println(label+res);
            }
            for (Object object : enrolls) {
                JSONObject enroll= (JSONObject) object;
                Integer majorId = enroll.getInteger("id");
                String majorName = enroll.getString("title");
                String score = enroll.getString("score");
                String relation_params = enroll.getString("relation_params");

                JSONObject insert = new JSONObject();
                insert.put("majorId",majorId);
                insert.put("majorName",majorName);
                insert.put("score",score);
                insert.put("relationParams",relation_params);

                insert.put("year",year);
                insert.put("attrId",attrId);
                insert.put("attrName",attrName);
                insert.put("dzsCateId",dzsCateId);
                insert.put("dzsCateName",dzsCateName);
                insert.put("collegeId",collegeId);
                insert.put("collegeName",collegeName);
                insert.put("provinceId",provinceId);
                insert.put("location",provinceId==5604?"湖南":(provinceId==5310?"河南":provinceId));
                insert.put("updateTime",new Date());

//            Entity record = Entity.create("csdhe_college_enroll");
                Entity record = Entity.create(tableNameInsert);
                record.putAll(insert);
                insertDataSet.add(record);
                //单个插入
//            try {
//                DbUtil.use().insert(insert);
//                logger.info("插入分数数据");
//            } catch (SQLException e) {
//                e.printStackTrace();
//            }
            }
        }else if (dataType == 4) {
            JSONArray datas = res.getJSONObject("data").getJSONArray("data");
            if(CollUtil.isNotEmpty(datas)){
                System.out.println(label+res);
            }
            for (Object object : datas) {
                JSONObject enroll= (JSONObject) object;
                Integer majorId = enroll.getInteger("id");
                String majorName = enroll.getString("title");
                String majorGroup = enroll.getString("major_group");
                String tags = enroll.getString("tags");
                String planCount = enroll.getString("plan_count");
                String tuitionFee = enroll.getString("tuition_fee");
                String other_description = enroll.getString("other_description");

                JSONObject insert = new JSONObject();
                insert.put("description",other_description);
                insert.put("majorId",majorId);
                insert.put("majorName",majorName);
                insert.put("planCount",planCount);
                insert.put("majorGroup",majorGroup);
                insert.put("tags",tags);
                insert.put("tuitionFee",tuitionFee);

                insert.put("year",year);
                insert.put("attrId",attrId);
                insert.put("attrName",attrName);
                insert.put("dzsCateId",dzsCateId);
                insert.put("dzsCateName",dzsCateName);
                insert.put("collegeId",collegeId);
                insert.put("collegeName",collegeName);
                insert.put("provinceId",provinceId);
                insert.put("location",provinceId==5604?"湖南":(provinceId==5310?"河南":provinceId));
                insert.put("updateTime",new Date());

                Entity record = Entity.create(tableNameInsert);
                record.putAll(insert);
                insertDataSet.add(record);
                //单个插入
//            try {
//                DbUtil.use().insert(insert);
//                logger.info("插入分数数据");
//            } catch (SQLException e) {
//                e.printStackTrace();
//            }
            }


        }
        if (insertDataSet.size() > 0) {
            try {
                DbUtil.use().insert(insertDataSet);
                logger.info("批量插入{}年 {} {} {} {} 数据成功：{}" ,year,collegeId,collegeName,attrName,label,insertDataSet.size());
            } catch (Exception e) {
                logger.error(JSONObject.toJSONString(insertDataSet));
                e.printStackTrace();
            }
        }
        long sleep= RandomUtil.randomInt(1, 6) * 800;
        ThreadUtil.safeSleep(sleep);
        logger.info("{}-{}休眠{}毫秒后继续！！！",collegeId,collegeName,sleep);
    }


    /**
     * 招生计划过滤条件：https://120.26.169.242/api/v1.8.5/college/filter?
     * app_type=senioriup&good_app_type=senioriup&province_id=5310&platform=android&timestrap=1731988414&deviceid=senioriupf9e74a91988cd4a5&channel=upgrade&version=v1.8.9&oaid=f9e74a91988cd4a5&sign=48f82b2be095e09590ab17532fd16114&college_id=9719&type=4&subject_id=1401&cate_id=1399
     * @param args
     */


    /**
     * 招生计划：
     * https://120.26.169.242/api/v1.8.5/college/9719/plan?app_type=senioriup&good_app_type=senioriup&province_id=5310&platform=android&timestrap=1731988415&deviceid=senioriupf9e74a91988cd4a5&channel=upgrade&version=v1.8.9&oaid=f9e74a91988cd4a5&sign=333d42130f0a6dba30659d1295e08c66&id=9719&year=2024&attr_id=2&dzs_cate_id=7313&purpose=0&subject_id=1401&cate_id=1399
     * @param args
     */


    public static void main(String[] args) {
        // 湖南省 5604，河南 5310
//        Integer provinceId = 5310;
        Integer provinceId = 5604;
        CollegeService service = new CollegeService();
//        service.getCollegePlanEnroll(provinceId,null,"profession");//院校分数线
//        service.getCollegePlanEnroll(provinceId,"9902,10372,10384","plan");//院校计划
        //plan、profession
        service.getCollegePlanEnroll(provinceId,"9858,9865,9879,9902,9835,9849","profession",Arrays.asList());//院校计划
//        service.getCollegePlanEnroll(provinceId,"9838","plan",Arrays.asList());//院校计划
//        service.getProfessionFilter(9043,provinceId,"");//院校过滤条件
//        service.getProfessionDetail(9043,provinceId);//院校分数
        System.out.println("完成【"+provinceId+"】学校分数线");
//        service.getCollegeListByProvince(provinceId);
//        service.syncCms(provinceId);
//        System.out.println("完成学校及资讯");
    }

}
