package com.yihu.wlyy.task;

import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.SystemConf;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by lyr-pc on 2016/10/20.
 */
public class SignSsGetTask implements Runnable {
    private static Logger logger = LoggerFactory.getLogger(SignUploadTask.class);

    String idcard = "";

    public SignSsGetTask(String idcard) {
        this.idcard = idcard;
    }

    @Override
    public void run() {
        try {
            Thread.sleep(3000);
            String url = SystemConf.getInstance().getJwUrl();
            String resultStr = HttpUtil.sendPost(url + "/third/sign/LoadSanshiSignFamily?idcard=" + idcard, "");
            JSONObject json = new JSONObject(resultStr);

            if (json.getInt("status") == 200) {
                logger.info("sign_ss_get_success:" + idcard);
            } else {
                logger.error("sign_ss_get_failed:" + idcard);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
