CGModelParamsLog.java 3.08 KB
package com.lhcredit.project.business.creditGrantingInfo.domain;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CGModelParamsLog {
    public static final Logger log= LoggerFactory.getLogger("cgModel_params");
    public static void idx(String modelIdx,Object value,String other){
        log.info("指标名称:{},value:{},other:{}",modelIdx,value,other);
    }
    public static void sout(String msg){
        log.info(msg);
    }
    public static void title(String msg){
        log.info("=================="+msg+"==================================== " );
    }
    public static void h1(String msg){
        log.info("------------"+msg+"------------" );
    }

    public static void main(String[] args) {
        String token="9c090113e7144424b3942c982a42f7a8";
        String sss="福建三宝钢铁有限公司:民营企业, 迁安市九江线材有限责任公司:民营企业, 陕西钢铁集团有限公司:省国有企业, 辽宁澎辉铸业有限公司:民营企业, 山西建龙实业有限公司:民营企业, 山西建龙钢铁有限公司:民营企业, 德龙钢铁有限公司:民营企业, 北京燕钢钢铁有限公司:民营企业, 广西盛隆冶金有限公司:民营企业, 福建大东海实业集团有限公司:民营企业, 河北东海特钢集团有限公司:民营企业, 日照钢铁有限公司:其他, 日照宝华新材料有限公司:其他, 日照钢铁控股集团有限公司:民营企业, 湖南华菱涟源钢铁有限公司:省国有企业, 甘肃酒钢集团宏兴钢铁股份有限公司:省国有企业, 内蒙古包钢钢联股份有限公司:省国有企业, 新余钢铁股份有限公司:上市企业, 宝武集团鄂城钢铁有限公司:民营企业, 安阳钢铁股份有限公司:上市企业";
        String[] split = sss.replaceAll(" ", "").split(",");
        for (String str : split) {
            String[] split1 = str.split(":");
            String s = HttpRequest.get("http://localhost:8082/web/creditGrantingInfo/getBasic?name=" +split1[0]).header("authorization",token).execute().body();
            JSONObject jsonObject = JSONObject.parseObject(s);
            CreditGrantingInfo creditGrantingInfo = jsonObject.getJSONObject("data").toJavaObject(CreditGrantingInfo.class);
            creditGrantingInfo.setCompanyNature(split1[1]);
            creditGrantingInfo.setCompanyType("生产型企业");
            String s2 = HttpUtil.post("http://localhost:8082/web/creditGrantingInfo/add", JSON.toJSONString(creditGrantingInfo));
            HttpRequest.post("http://localhost:8082/web/creditGrantingInfo/add").body(JSON.toJSONString(creditGrantingInfo)).execute().header("authorization",token).body();
            Long id = JSONObject.parseObject(s2).getLong("data");
            String s3 =HttpRequest.get("http://localhost:8082/web/creditGrantingInfo/genPdf?cgId="+id).header("authorization",token).execute().body();
            System.out.println(s3);
        }


    }
}