package cn.com.ctop.job.bytedance.handler;

import cn.com.ctop.common.module.utils.HttpUtils2;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component;

@Component
public class CwjsPolicyApprovedNoticeJob {


    @XxlJob("cwjsPolicyApprovedNoticeWxJob")
    public void execute() throws Exception {
        try {
//            String url = "http://gateway.bjhcstszkj.cn/finance/cwjsPolicyInfo/weiXinNotice";
            String url = "http://api.bjhcstszkj.cn/finance/cwjsPolicyInfo/weiXinNotice";
            HttpUtils2.httpGet(url, null, null);
            XxlJobHelper.log("send weixin message success");
        } catch (Exception e) {
            XxlJobHelper.log(e.getMessage());
        }
    }


    /**
     * 财务结算中 给运营发送微信通知 每月1号 早上9点
     * @throws Exception
     */
    @XxlJob("sendMessageToOperate")
    public void sendMessageToOperate() throws Exception {
        try {
//            String url = "http://gateway.bjhcstszkj.cn/finance/cwjsPolicyInfo/weiXinNotice";
            String url = "http://api.bjhcstszkj.cn/finance/exportReportController/sendMessageToOperate";
            HttpUtils2.httpGet(url, null, null);
            XxlJobHelper.log("send CWJS-operate weixin message success");
        } catch (Exception e) {
            XxlJobHelper.log(e.getMessage());
        }
    }

    /**
     * demo
     * @throws Exception
     */
    @XxlJob("sendMessageToOperateDemo")
    public void sendMessageToOperateDemo() throws Exception {
        try {
            String url = "http://api.bjhcstszkj.cn/finance/exportReportController/sendMessageToOperateDemo";
            HttpUtils2.httpGet(url, null, null);
            XxlJobHelper.log("send CWJS-operate weixin message success");
        } catch (Exception e) {
            XxlJobHelper.log(e.getMessage());
        }
    }






}
