import {HttpClient} from "@angular/common/http";
import {Injectable} from "@angular/core";
import {Observable} from "rxjs/Observable";
import {SERVER_API_URL, SERVER_API_WEB} from "../../app/app.constants";
import {HTTP} from "@ionic-native/http";
import {DataFormatService} from "../../core/dataFormat.service";

@Injectable()
export class HomeService {

    constructor(private http: HttpClient, private nativeHttp: HTTP,
                private dataFormat: DataFormatService) {
    }

    //单位信息总揽
    units(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/statis/units.do', data);
    }

    //通讯录
    getOrgList(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/user/addressinfo.do',data);
    }

    //部门人员
    getPersonList(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/user/getPersonList.do',data);
    }

    //事项督办
    searchDb(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/schedule/search_db.do', data);
    }

    //督办操作
    dbSuper(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/schedule/super.do', data);
    }

    //获取附件信息接口
    fileAttach(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/user/Attach.do', data);
    }

    //获取系统中区划信息的接口
    getArea(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/user/area.do', data);
    }

    //实名制上报率排行榜
    shangbaolv(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/statis/shangbaolv.do', data);
    }

    //事业单位信息查询
    unitfind(data): Observable<any> {
        return this.http.post(SERVER_API_WEB + '/infomation/unitfind.do', data);
    }

    //机关群团信息查询
    creditorgan(data): Observable<any> {
        return this.http.post(SERVER_API_WEB + '/infomation/creditorgan.do', data);
    }

    //年度报告
    yearreportdetail(data): Observable<any> {
        return this.http.post(SERVER_API_WEB + '/infomation/yearreportdetail.do', data);
    }

    //事业单位查询 人员信息情况
    statisticPerson(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/statis/statisticPerson.do', data);
    }

    //数据报表
    statisticUnitcatetory(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/statis/statisticUnitcatetory.do', data);
    }

    //行业分类
    getIndustryList(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/user/industry_classification.do', data);
    }

    //经费形式
    getFundingList(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/user/jfxs.do', data);
    }

    //事业单位
    getCauseList(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/user/unit_type.do', data);
    }

    //规格
    getSpecificationsList(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/user/jggg.do', data);
    }

    //机构性质
    getNatureList(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/user/jgxz.do', data);
    }

    //机构类别
    getCategoryList(data): Observable<any> {
        return this.http.post(SERVER_API_URL + '/user/jglb.do', data);
    }

}