java 数据生成 图片

package cn.luxin.托尔斯泰;import java.util.List;/*** @ClassName: ChildrenInfo* @Description:* @Author* @Date 2019/5/16 15:37* @Version V1.0**/
public class ChildrenInfo {//人或公司idprivate String id;//名称private String name;//H 人 C公司private String type;//金额private String amount;//占比private String percent;//股东类型private String sh_type;//子节点private List  children;//private String regCapital;//父节点名称private String parentName;public String getId() {return id;}public void setId(String id) {this.id = id;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getType() {return type;}public void setType(String type) {this.type = type;}public String getAmount() {return amount;}public void setAmount(String amount) {this.amount = amount;}public String getPercent() {return percent;}public void setPercent(String percent) {this.percent = percent;}public String getSh_type() {return sh_type;}public void setSh_type(String sh_type) {this.sh_type = sh_type;}public List  getChildren() {return children;}public void setChildren(List  children) {this.children = children;}public String getRegCapital() {return regCapital;}public void setRegCapital(String regCapital) {this.regCapital = regCapital;}public String getParentName() {return parentName;}public void setParentName(String parentName) {this.parentName = parentName;}
}

 

package cn.luxin.托尔斯泰;import java.util.List;/*** 结构体信息* @ClassName: StructureInfo* @Description:* @Author* @Date 2019/5/16 15:24* @Version V1.0**/
public class StructureInfo {//公司idprivate String id;//公司名private String name;//H 人 C公司private String type;//金额private String amount;//占比private String percent;//股东类型private String sh_type;//子节点private List  children;//X轴private int X;//X轴private int Y;public String getId() {return id;}public void setId(String id) {this.id = id;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getType() {return type;}public void setType(String type) {this.type = type;}public String getAmount() {return amount;}public void setAmount(String amount) {this.amount = amount;}public String getPercent() {return percent;}public void setPercent(String percent) {this.percent = percent;}public String getSh_type() {return sh_type;}public void setSh_type(String sh_type) {this.sh_type = sh_type;}public List  getChildren() {return children;}public void setChildren(List  children) {this.children = children;}public int getX() {return X;}public void setX(int x) {X = x;}public int getY() {return Y;}public void setY(int y) {Y = y;}
}
package cn.luxin;import club.newepoch.utils.JsonUtils;
import cn.luxin.托尔斯泰.StructureInfo;
import com.alibaba.fastjson.JSONObject;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;/*** 数据转换图片** @ClassName: PictureGeneration* @Description:* @Author* @Date 2019/5/16 21:01* @Version V1.0**/
public class PictureGeneration  {//用于接受最大的Y轴数值int YTotal = 0;/*** 生成图片** @param cellsValue 表格里面的值*/public String myGraphicsGeneration(String cellsValue) {//初始化List  allChildNodes = new ArrayList <>();// 字体大小int fontTitileSize = 15;// 图片宽度int imageWidth = 900;// 图片高度int imageHeight = cellsValue.length() / 15 + 300;//生成空图片BufferedImage image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);//初始化绘画工具到空图片上Graphics graphics = image.getGraphics();//绘制背景颜色
        graphics.setColor(Color.WHITE);//填充矩形graphics.fillRect(0, 0, imageWidth, imageHeight);graphics.setColor(new Color(0, 0, 0));//设置字体Font font = new Font("微软雅黑", Font.BOLD, fontTitileSize);graphics.setFont(font);//写入内容int x = 30;int y = 60;List  object = null;List  structureList = new ArrayList <>();List  pathLst = new ArrayList <>();//获取整个json数据并且将json数据转为Map类型Map  stringObjectMap = JsonUtils.parseJson2Map(cellsValue);for (String key : stringObjectMap.keySet()) {//获取key为result的所有Dataif ("result".equals(key)) {//将result的数据全部转为Map类型Map  stringObjectMap1 = JsonUtils.parseJson2Map(JsonUtils.toJSONString(stringObjectMap.get(key)));for (String key1 : stringObjectMap1.keySet()) {//获取主要控股的公司或者人if ("path".equals(key1)) {//获取path的所有子节点List  pathAllChildNodes = JsonUtils.parseJson2List(JsonUtils.toJSONString(stringObjectMap1.get(key1)));for (Object pathAllChildNodesInfo : pathAllChildNodes) {//将path的子节点转换成JSONObjectJSONObject str1 = (JSONObject) pathAllChildNodesInfo;Object cellsValueinfo111 = str1.get("value");font = new Font("微软雅黑", Font.PLAIN, fontTitileSize);pathLst.add(cellsValueinfo111.toString());graphics.setFont(font);graphics.setColor(Color.blue);}graphics.drawString(pathLst.toString(), x, y);}//获取股权结构if ("structure".equals(key1)) {//将股权结构的数据全部转为Map类型Map  equityStructure = JsonUtils.parseJson2Map(JsonUtils.toJSONString(stringObjectMap1.get(key1)));//公司名structureList.add(equityStructure.get("name").toString());//金额structureList.add(equityStructure.get("amount").toString());//占比structureList.add(equityStructure.get("percent").toString());//设置字体以及颜色
                        graphics.setFont(font);graphics.setColor(Color.MAGENTA);//将X和Y轴增加30x = 30 + x;y = 30 + y;graphics.drawString(structureList.toString(), x, y);//若股权结构子节点不为空时if (!equityStructure.get("children").toString().equals("[]")) {//获取全部children子节点object = JsonUtils.parseJson2List(JsonUtils.toJSONString(equityStructure.get("children")));//将当前的Y轴数值赋值给最大的Y轴变量YTotal = y;//将全部股权结构子节点和XY轴数据传到递归方法// 这里是提前x 方向 偏移30 ,然后在递归方法里面如果有子节点,在往 y 方向偏移 30  ,这里的偏移 的只是距离 ,没有正负轴之说。Recursive(allChildNodes, object, x + 30, y );
//                            int r = 0;for (StructureInfo i : allChildNodes) {List  asdaASDsd = new ArrayList <>();String naem = i.getName();String amount = i.getAmount();String percent = i.getPercent();int X = i.getX();int Y = i.getY();asdaASDsd.add(naem);asdaASDsd.add(amount);asdaASDsd.add(percent);font = new Font("微软雅黑", Font.PLAIN, fontTitileSize);graphics.setFont(font);graphics.setColor(Color.red);graphics.drawString(asdaASDsd.toString(), X, Y);
//                                r++;
                            }}}}}}String savePath = "D:\\uploadTest" ;String companyName = structureList.get(0);//写标题String title = companyName + "股权结构图";graphics.drawString(title, 30, 30);// 保存图片String savePicture = createImage(image, savePath + "\\" + companyName + ".jpg", companyName);return savePicture;}/*** 将图片保存到指定位置** @param image        缓冲文件类* @param fileLocation 文件位置* @param fileName     文件名称*/public String createImage(BufferedImage image, String fileLocation, String fileName) {
//        try {
//            FileOutputStream fos = new FileOutputStream(fileLocation);
//            BufferedOutputStream bos = new BufferedOutputStream(fos);
//            JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos);
//            encoder.encode(image);
//            bos.close();
//            // 保存文件信息到文件表
//            String fileUuid = StringUtils.randomUuid();
//            File file = new File(fileLocation);
//            FileInfo fileInfo = new FileInfo();
//            fileInfo.setFile(file);
//
//            fileInfo.setOriginalFileName(fileName);
//            SysFile saveFile = SysFileUtils.fileInfo2SysFile(fileInfo, null);
//            saveFile.set("uuid", fileUuid);
//            boolean isTrue = saveFile.save();
//            if (isTrue) {
//                // 保存成功
//                // 文件上传云端
//                FileInfo UpFileInfo = this.getFileInfoByUuid(fileUuid);
//                this.upload2cloud(UpFileInfo, false);
//            }
//            return fileUuid;
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        return null;try {FileOutputStream fos = new FileOutputStream(fileLocation);BufferedOutputStream bos = new BufferedOutputStream(fos);JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos);encoder.encode(image);bos.close();} catch (Exception e) {e.printStackTrace();}return null;}/*** 判断当前children节点是否有子节点* 主要目的是获取 所有的 children 的个数** @param list      空的List对象* @param Structure List对象* @param x         X轴* @param y         Y轴*//*** 总的思路:提前把: x的偏移量 30 ,偏移, 然后在 获取 “children” 的子节点的时候,在偏移 y  30*  如果有“ children” 有子节点 ,就设置当前的children 的x,y 到list  中去 ,在去找 “children”  的字节点的个数,也就是 调用自己本身的方法*  如果“children”  没有字节点 ,就设置当前 children 的x,y 到list  中去* @param list* @param Structure* @param x* @param y*/public void Recursive(List  list, List  Structure, int x, int y) {for (Object Structure1 : Structure) {//获取当前子节点的数据JSONObject str = (JSONObject) Structure1;//初始化结构体信息StructureInfo structureInfo = new StructureInfo();//公司名字structureInfo.setName(str.get("name").toString());//金额structureInfo.setAmount(str.get("amount").toString());//占比structureInfo.setPercent(str.get("percent").toString());//获取当前节点的子节点List  list1 = JsonUtils.parseJson2List(str.get("children").toString());//将Y轴加30y = YTotal + 30;//将最大的Y轴数值也增加30YTotal = YTotal + 30;//当前股权结构是否有子节点if (list1.size() != 0) {structureInfo.setX(x);structureInfo.setY(y);list.add(structureInfo);//如果当前循环的子节点中,“children”的不为空的话 ,就再次调用自己,并且在调用的同时,还是要提前把 ,x偏移 30Recursive(list, list1, x + 30, y);} else {structureInfo.setX(x);structureInfo.setY(y);list.add(structureInfo);}}}
}   
package cn.luxin;import club.newepoch.persistent.db.exception.ActiveRecordException;
import org.eclipse.jdt.internal.compiler.batch.Main;import java.io.IOException;public class TYCInterfaceController  {public static void main(String[] args) {try {new TYCInterfaceService().enterpriseInformationFile();} catch (IOException e) {e.printStackTrace();} catch (ActiveRecordException e) {e.printStackTrace();}}}
package cn.luxin;import club.newepoch.persistent.db.exception.ActiveRecordException;
import club.newepoch.utils.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.xssf.usermodel.*;
import java.awt.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;/*** 天眼查接口Service** @ClassName: TYCInterfaceService* @Description:* @Author 李宏凯* @Date 2019/5/15 14:15* @Version V1.0**/
public class TYCInterfaceService   {/*** 获取企业基本信息并且生成文件** @param ctl* @return*/
//    public boolean getBusinessInfo(QhyfController ctl) throws IOException {
//        String result = "";
//        boolean basicFileInfo = false;
//        try {
//            List  params = new ArrayList ();
//            String id = ctl.getPara("id");
//            if (StringUtils.notBlank(id)) {
//                params.add(new BasicNameValuePair("id", id));
//            }
//            String name = ctl.getPara("name");
//            if (StringUtils.notBlank(name)) {
//                params.add(new BasicNameValuePair("name", name));
//            }
//            Date startTime = new Date();
//            String str = EntityUtils.toString(new UrlEncodedFormEntity(params, Consts.UTF_8));
//            String token = "21416d43-62b5-4522-9d6b-1072ff89bc54";
//            String url = "http://open.api.tianyancha.com/services/v4/open/";
//            String interfaceName = "baseinfo";
//            // 根据地址获取请求
//            HttpGet request = new HttpGet(url + interfaceName + "?" + str);//这里发送get请求
//            // 获取当前客户端对象
//            request.setHeader("Authorization", token);
//            HttpClient httpClient = new DefaultHttpClient();
//            // 通过请求对象获取响应对象
//            HttpResponse response = httpClient.execute(request);
//            // 判断网络连接状态码是否正常(0--200都数正常)
//            if (response.getStatusLine().getStatusCode() >= 0 && response.getStatusLine().getStatusCode() <= HttpStatus.SC_OK) {
//                result = EntityUtils.toString(response.getEntity(), "utf-8");
//            }
//            updateTycHistory(response, startTime, interfaceName, url);
//            JSONObject results = JSONObject.fromObject(result);
//            if (!results.get("error_code").equals("0")) {
//                //AssertUtils.isTrue(false, results.get("reason").toString());
//            }
//            // 企业基本信息文件生成
//            //basicFileInfo = enterpriseInformationFile(ctl, results, id, token);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        return basicFileInfo;
//    }/*** 企业基本信息文件生成*/public void enterpriseInformationFile(/*, JSONObject flieInfo, String id, String token*/) throws IOException, ActiveRecordException {/*//公司名称Object name = flieInfo.getJSONObject("result").get("name");//统一社会信用代码Object creditCode = flieInfo.getJSONObject("result").get("creditCode");//核准日期Object approvedTime = flieInfo.getJSONObject("result").get("approvedTime");*/Object name = "某某供应商";Object creditCode = "TYSHXYDM";Object approvedTime = "2019-05-05";//数据抓取时间Date date = new Date();SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");String dataCaptureTime = sdf.format(date);//股权结构图//String structureChartJosnInfo = getMessageByUrlToken(ctl, id, token);String jsonStr = "{\"error_code\":0, " +"\"reason\":\"ok\"," +"\"result\":{" +"     \"path\":[" +"           {" +"           \"type\":\"name\"," +"           \"value\":\"李彦宏\"," +"           \"id\":\"1984012283\"," +"           \"cid\":\"22822\" " +"            }," +"           {" +"           \"type\":\"percent\"," +"           \"value\":\"99.50%\"" +"            }," +"           {" +"           \"type\":\"name\"," +"           \"value\":\"北京百度网讯科技有限公司\"" +"            }" +"              ]," +"     \"structure\":{" +"          \"id\":\"22822\"," +"          \"name\":\"北京百度网讯科技有限公司\"," +"          \"type\":\"C\"," +"          \"amount\":\"216042.36\"," +"          \"percent\":\"99.50%\"," +"          \"sh_type\":null," +"          \"children\":[" +"                  {" +"                      \"id\":\"1984012283\"," +"                      \"name\":\"李彦宏1\"," +"                      \"type\":\"H\"," +"                      \"amount\":\"216042.36\"," +"                      \"percent\":\"99.50%\"," +"                      \"sh_type\":\"工商股东\"," +"                      \"children\":[ " +"                                  {" +"                                 \"id\":\"1984012283\"," +"                                 \"name\":\"李彦宏2\"," +"                                 \"type\":\"H\"," +"                                 \"amount\":\"216042.36\"," +"                                 \"percent\":\"99.50%\"," +"                                 \"sh_type\":\"工商股东\"," +"                                 \"children\":["+"                                               {" +"                                              \"id\":\"1984012283\"," +"                                              \"name\":\"李彦宏3\"," +"                                              \"type\":\"H\"," +"                                              \"amount\":\"216042.36\"," +"                                              \"percent\":\"99.50%\"," +"                                              \"sh_type\":\"工商股东\"," +"                                              \"children\":[ ]," +"                                              \"regCapital\":null," +"                                              \"parentName\":\"children\"," +"                                              \"actualHolding\":true" +"                                               }," +"                                               {" +"                                              \"id\":\"1839080315\"," +"                                              \"name\":\"向海龙1\"," +"                                              \"type\":\"H\"," +"                                              \"amount\":\"1085.64\"," +"                                              \"percent\":\"0.50%\"," +"                                              \"sh_type\":\"工商股东\"," +"                                              \"children\":[" +"                                                            {" +"                                                           \"id\":\"1839080315\"," +"                                                           \"name\":\"向海龙1\"," +"                                                           \"type\":\"H\"," +"                                                           \"amount\":\"1085.64\"," +"                                                           \"percent\":\"0.50%\"," +"                                                           \"sh_type\":\"工商股东\"," +"                                                           \"children\":[]," +"                                                           \"regCapital\":null," +"                                                           \"parentName\":\"children\"," +"                                                           \"actualHolding\":false" +"                                                             }" +"                                                           ]," +"                                              \"regCapital\":null," +"                                              \"parentName\":\"children\"," +"                                              \"actualHolding\":false" +"                                               }," +"                                               {" +"                                              \"id\":\"1984012283\"," +"                                              \"name\":\"李彦宏4\"," +"                                              \"type\":\"H\"," +"                                              \"amount\":\"216042.36\"," +"                                              \"percent\":\"99.50%\"," +"                                              \"sh_type\":\"工商股东\"," +"                                              \"children\":[ ]," +"                                              \"regCapital\":null," +"                                              \"parentName\":\"children\"," +"                                              \"actualHolding\":true" +"                                               }" +"                                                ]," +"                                 \"regCapital\":null," +"                                 \"parentName\":\"children\"," +"                                 \"actualHolding\":true" +"                                   }" +"                                  ]," +"                      \"regCapital\":null," +"                      \"parentName\":\"children\"," +"                      \"actualHolding\":true" +"                  }," +"                  {" +"                       \"id\":\"1984012283\"," +"                       \"name\":\"李彦宏5\"," +"                       \"type\":\"H\"," +"                       \"amount\":\"216042.36\"," +"                       \"percent\":\"99.50%\"," +"                       \"sh_type\":\"工商股东\"," +"                       \"children\":[ ]," +"                       \"regCapital\":null," +"                       \"parentName\":\"children\"," +"                       \"actualHolding\":true" +"                   }," +"         ]," +"      \"regCapital\":\"217128\"," +"      \"parentName\":\"structure\"," +"      \"actualHolding\":true" +"     }"+"   }" +"}";//图片生成PictureGeneration pictureGeneration = new PictureGeneration();pictureGeneration.myGraphicsGeneration(jsonStr);// 设置导出时间SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");String exportTime = sd.format(new Date());// 创建表头XSSFWorkbook workbook = new XSSFWorkbook();String savePath =  "D:\\uploadTest\\";File save = new File(savePath);if (!save.exists() && !save.isDirectory()) {save.mkdirs();}String fileName = "某某供应商信息.xlsx";savePath = savePath + File.separator + fileName;FileOutputStream fout = new FileOutputStream(savePath);// 创建检测结果sheetXSSFSheet sheetPay = workbook.createSheet("供应商信息");sheetPay.createFreezePane(0, 1, 0, 1);// 设置付款单信息筛选
//        CellRangeAddress payChoose = CellRangeAddress.valueOf("B1:V1");
//        sheetPay.setAutoFilter(payChoose);XSSFRow headPayRow = sheetPay.createRow(0);// 设置付款单sheet行高sheetPay.setDefaultRowHeightInPoints(3 * 10);// 定义付款单sheet表头String[] headPayArr = {"公司名称", "统一社会信用代码", "核准日期", "数据抓取时间", "股权结构图"};// 单元格XSSFCell headPayCell = null;XSSFCellStyle style = workbook.createCellStyle();// 表头样式设置
        style.setBorderBottom(XSSFCellStyle.BORDER_THIN);style.setBorderLeft(XSSFCellStyle.BORDER_THIN);style.setBorderTop(XSSFCellStyle.BORDER_THIN);style.setBorderRight(XSSFCellStyle.BORDER_THIN);// 设置背景色style.setFillForegroundColor(new XSSFColor(new Color(216, 216, 216)));style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 水平居中style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
        style.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);// 设置表头字体XSSFFont headFont = workbook.createFont();// 字体样式headFont.setFontName("宋体");// 字体大小headFont.setFontHeightInPoints((short) 9);// 加粗headFont.setBold(true);style.setFont(headFont);// 列宽设置sheetPay.setColumnWidth(0, 2 * 256);// 公司名称sheetPay.setColumnWidth(1, 10 * 256);// 统一社会信用代码sheetPay.setColumnWidth(2, 15 * 256);// 核准日期sheetPay.setColumnWidth(3, 10 * 256);// 数据抓取时间sheetPay.setColumnWidth(4, 40 * 256);// 股权结构图// 写入付款通知书表头for (int i = 0; i < headPayArr.length; i++) {sheetPay.autoSizeColumn(i + 1);headPayCell = headPayRow.createCell(i + 1);headPayCell.setCellValue(headPayArr[i]);headPayCell.setCellStyle(style);}// 设置单元格样式XSSFCellStyle cellStyle = workbook.createCellStyle();// 边框
        cellStyle.setBorderBottom(XSSFCellStyle.BORDER_THIN);cellStyle.setBorderLeft(XSSFCellStyle.BORDER_THIN);cellStyle.setBorderTop(XSSFCellStyle.BORDER_THIN);cellStyle.setBorderRight(XSSFCellStyle.BORDER_THIN);// 内容换行cellStyle.setWrapText(true);// 垂直居中
        cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 设置单元格字体XSSFFont font = workbook.createFont();// 字体样式font.setFontName("微软雅黑");// 字体大小font.setFontHeightInPoints((short) 9);cellStyle.setFont(font);// 加粗XSSFCell cellPay = null;XSSFRow rowPay = null;// 对各元素设值rowPay = sheetPay.createRow( 1);cellPay = rowPay.createCell(1);cellPay.setCellValue(name.toString());cellPay.setCellStyle(cellStyle);cellPay = rowPay.createCell(2);cellPay.setCellValue(creditCode.toString());cellPay.setCellStyle(cellStyle);cellPay = rowPay.createCell(3);cellPay.setCellValue(approvedTime.toString());cellPay.setCellStyle(cellStyle);cellPay = rowPay.createCell(4);cellPay.setCellValue(dataCaptureTime);cellPay.setCellStyle(cellStyle);cellPay = rowPay.createCell(5);cellPay.setCellStyle(cellStyle);// 保存到文件
        workbook.write(fout);fout.close();// 保存文件信息到文件表String fileUuid = StringUtils.randomUuid();File file = new File(savePath);
//        FileInfo UpFileInfo = this.getFileInfoByUuid(fileUuid);
//        this.upload2cloud(UpFileInfo, true);
//        FileInfo fileInfo = new FileInfo();
//        fileInfo.setFile(file);
//        fileInfo.setOriginalFileName(fileName);
//        SysFile saveFile = SysFileUtils.fileInfo2SysFile(fileInfo, null);
//        saveFile.set("uuid", fileUuid);
//        boolean isTrue = saveFile.save();
//        if (isTrue) {
//            // 保存成功
//            // 文件上传云端
//            FileInfo UpFileInfo = this.getFileInfoByUuid(fileUuid);
//            this.upload2cloud(UpFileInfo, true);
//            // 更新绿城付款单数据表对应导出状态为已导出
//            return fileUuid;
//        } else {
//            return null;
//        }
    }/*** 获取股权结构图数据** @param* @return*/
//    public String getMessageByUrlToken(  String id, String token) {
//        String result = "";
//        JSONObject results = null;
//        try {
//            List  params = new ArrayList ();
//            if (StringUtils.notBlank(id)) {
//                params.add(new BasicNameValuePair("id", id));
//            }
//            Date startTime = new Date();
//            String str = EntityUtils.toString(new UrlEncodedFormEntity(params, Consts.UTF_8));
//            String url = "http://open.api.tianyancha.com/services/v4/open/";
//            String interfaceName = "equityRatio";
//            // 根据地址获取请求
//            HttpGet request = new HttpGet(url + interfaceName + "?" + str);
//            // 获取当前客户端对象
//            request.setHeader("Authorization", token);
//            HttpClient httpClient = new DefaultHttpClient();
//            // 通过请求对象获取响应对象
//            HttpResponse response = httpClient.execute(request);
//            // 判断网络连接状态码是否正常(0--200都数正常)
//            if (response.getStatusLine().getStatusCode() >= 0 && response.getStatusLine().getStatusCode() <= HttpStatus.SC_OK) {
//                result = EntityUtils.toString(response.getEntity(), "utf-8");
//            }
//            updateTycHistory(response, startTime, interfaceName, url);
//
//            if (!results.get("error_code").equals("0")) {
//                //AssertUtils.isTrue(false, results.get("reason").toString());
//            }
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        return result;
//    }/*** 保存天眼查接口履历** @throws Exception*/
//    public void updateTycHistory(HttpResponse response, Date startTime, String interfaceName, String url) throws Exception {
//        // 设置接口信息
//        ApiCallInfo apiCallInfo = new ApiCallInfo(Thread.currentThread().getStackTrace()[2].getMethodName());
//        if (response.getStatusLine().getStatusCode() >= 0 && response.getStatusLine().getStatusCode() <= HttpStatus.SC_OK) {
//            // 是否调用成功
//            apiCallInfo.setCalled(true);
//            apiCallInfo.setResult(response);
//        } else {
//            // 是否调用成功
//            apiCallInfo.setCalled(false);
//            // 设置返回信息
//            apiCallInfo.setError(response.toString());
//        }
//        // 接口名称
//        apiCallInfo.setApi(interfaceName);
//        // 接口名称
//        apiCallInfo.setSendApi(url + interfaceName);
//        // 履历接口调用类名
//        apiCallInfo.setLocation(Thread.currentThread().getStackTrace()[2].getClassName());
//        // 调用开始时间
//
//        apiCallInfo.setStartTime(startTime);
//        // 调用结束时间
//        apiCallInfo.setEndTime(new Date());
//        // 调用者
//        apiCallInfo.setCallUser(BlConstant.FIELD_DB_CURRENT_SYSTEM_USER_ID);
//        // 保存风报接口调用履历
//        IApiCallResultHandle callResult = new ApiCallResult2DbHandleImpl();
//        callResult.handle(apiCallInfo, "biz_tyc_api_history");
//    }

}
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">4.0.0com.qhyfqhyf1.0.80-betaQhyf-WEBhttp://ISCWX.newepoch.club1.7.71.1.31.5.13-release1.0.63-qhyf1.3.46-release1.2.41-release1.0.710.0.31.0.190.0.1220.0.70-SNAPSHOT2.2.1tommylee@leebing.comleebingNewEpoch@intasectnewepoch@intasect.com.cncom.github.junrarjunrar0.7org.apache.commonscommons-pool22.4.2redis.clientsjedis2.7.2com.aliyun.ossaliyun-sdk-oss${aliyun-version}org.docx4jdocx4j3.2.2org.slf4jslf4j-log4j12org.apache.poipoi-scratchpadorg.apache.poipoicom.hynnetjacob1.18com.itextpdfitextpdf5.5.9club.newepochBaseProject${nebase.version}javax.servletservlet-apiorg.docx4jdocx4j3.2.2org.slf4jslf4j-log4j12org.apache.poipoi3.9org.apache.poipoi-scratchpad3.9org.apache.poipoi-ooxml3.9club.newepochiwx${iwx.version}club.newepochiweb${iweb.version}club.newepoch.cordysCordysClient${cordysclient.version}club.newepochNeNio${nenio.version}com.jfinaljetty-server8.1.8compileorg.eclipse.jettyjetty-jsp8.1.8.v20121106providedcom.github.jknackhandlebars2.2.2com.jfinalcos26Dec2008junitjunit3.8.1testcommons-loggingcommons-logging1.1.3club.newepochNewEpochMQ1.0.9-releaseclub.newepoch.NotifyNotify-impl-nemq0.0.3club.newepochSpringAmqpImpl1.0.4-releaseclub.newepochIJfinal${ijfinal-version}club.newepochNewEpochDBnet.sf.ehcacheehcache-coreclub.newepochNewEpochDB${nedb.version}club.newepochNeNiocom.alibabadruid1.0.14org.beetlbeetl-core2.2.3commons-loggingcommons-logging1.1.3org.slf4jslf4j-api${slf4j.version}org.slf4jjcl-over-slf4j${slf4j.version}testorg.slf4jjcl-over-slf4j${slf4j.version}testch.qos.logbacklogback-classic${logback.version}ch.qos.logbacklogback-core${logback.version}mysqlmysql-connector-java5.1.36net.sf.ehcacheehcache-core2.6.6org.apache.antant1.9.6com.sun.mediajai_codec1.1.2com.lowagieitext2.0.7javax.mediajai_core1.1.3club.newepochNewEpochCodeGenerator${codeGenerator.version}com.aliyun.ossaliyun-sdk-oss${aliyun-version}jaxenjaxen1.1.6com.aliyunaliyun-java-sdk-core3.2.8com.aliyunaliyun-java-sdk-dysmsapi1.0.0club.newepochijfinal-ext0.0.3org.apache.pdfboxpdfbox2.0.13com.google.zxingcore3.2.1commons-discoverycommons-discovery0.2org.apache.axisaxis1.4javax.xml.rpcjavax.xml.rpc-api1.1.1wsdl4jwsdl4j1.5.1javax.activationactivation1.1.1javax.xml.soapsaaj-api1.3javax.activationactivationcom.qhyfaxis0.0.1com.qhyfmyencrypt0.0.1com.qhyfxfire0.0.1club.newepoch.financeFinanceHttpApi2.6-SNAPSHOT${project.basedir}/src/main/java${project.basedir}/src/test/java${project.basedir}/src/main/resourcesfalse**/*.java${project.basedir}/src/test/javafalse**/*.java${project.basedir}/targetmaven-war-plugin${basedir}/src/main/webapp${basedir}/src/main/webappfalseorg.apache.maven.pluginsmaven-compiler-plugin2.51.81.8intasectintasecthttp://nemq.newepoch.club:7001/content/groups/intasect/truetrueintasectintasecthttp://nemq.newepoch.club:7001/content/groups/intasect/truefalse

 

转载于:https://www.cnblogs.com/xiaowoniulx/p/10931447.html


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章