package com.yinet.system.service.impl;


import com.alibaba.fastjson.JSONObject;
import com.yinet.common.utils.HttpClientUtils;
import com.yinet.system.service.BjcxService;
import org.apache.http.client.CookieStore;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.impl.client.BasicCookieStore;
import org.springframework.stereotype.Service;

@Service
public class BjcxServiceImpl implements BjcxService {

    @Override
    public String bjcx(String sbh, String password) {
        String url = "http://zwfw.hebei.gov.cn/hbzw/bjcx/askWdbjDetail.do";
        HttpClientContext clientContext = HttpClientContext.create();
        CookieStore cookieStore = new BasicCookieStore();
        clientContext.setCookieStore(cookieStore);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("projid", sbh);
        jsonObject.put("pwd", password);
        String s = HttpClientUtils.httpPost(url, null, jsonObject, 6000, false, clientContext);
        return s;
    }
}
