| | |
| | | public class TestController { |
| | | //@Autowired |
| | | //private FboDataInf fboDataInf; |
| | | public static String fileUrl = ""; |
| | | public String fileUrl = ""; |
| | | public FboDataInf fboDataInf; |
| | | |
| | | @GetMapping("/hello") |
| | | public Response hello(){ |
| | |
| | | } |
| | | |
| | | @PostMapping("/readFboFile") |
| | | public Response readFboFile(@RequestParam String filePath) throws UnsupportedEncodingException { |
| | | FboDataInf fboDataInf = new FboDataInf(); |
| | | public Response readFboFile(@RequestParam String filePath){ |
| | | fboDataInf = new FboDataInf(); |
| | | //String filePath1 = java.net.URLDecoder.decode(filePath,"utf-8"); |
| | | fboDataInf.readFboFile(filePath); |
| | | TestController.fileUrl = filePath; |
| | | fileUrl = filePath; |
| | | return new Response().set(1,fboDataInf,filePath); |
| | | } |
| | | |
| | |
| | | String vol_echart = req.getParameter("vol_echart"); //单体电压折线图 |
| | | |
| | | String filePath = req.getParameter("filePath"); |
| | | FboDataInf fboDataInf = new FboDataInf(); |
| | | if (filePath==null || "".equals(filePath)){ |
| | | filePath = fileUrl; |
| | | if (fboDataInf==null){ |
| | | fboDataInf = new FboDataInf(); |
| | | if (filePath==null || "".equals(filePath)){ |
| | | filePath = fileUrl; |
| | | } |
| | | fboDataInf.readFboFile(filePath); |
| | | } |
| | | fboDataInf.readFboFile(filePath); |
| | | //从文件中获取数据 |
| | | List<FboData> list = fboDataInf.fboData; |
| | | //图片base64后的数据 |
| | |
| | | //数据栏 |
| | | for (int i = 0; i < list.size(); i++) { |
| | | sheet1.createRow(rowNum); //创建行 |
| | | for(int j=0;j<5;j++){ |
| | | FboData fbo=list.get(i); |
| | | sheet1.getRow(rowNum).createCell(0).setCellValue(fbo.m_TestTime.hms()); |
| | | sheet1.getRow(rowNum).createCell(1).setCellValue(fbo.SumVoltage); |
| | | sheet1.getRow(rowNum).createCell(2).setCellValue(fbo.testCap); |
| | | sheet1.getRow(rowNum).createCell(3).setCellValue(fbo.residualCap); |
| | | for (int k = 0;k<list.get(0).SingleVol.length;k++){ |
| | | sheet1.getRow(rowNum).createCell(4+k).setCellValue(fbo.SingleVol[k]); |
| | | } |
| | | FboData fbo=list.get(i); |
| | | sheet1.getRow(rowNum).createCell(0).setCellValue(fbo.m_TestTime.hms()); |
| | | sheet1.getRow(rowNum).createCell(1).setCellValue(fbo.SumVoltage); |
| | | sheet1.getRow(rowNum).createCell(2).setCellValue(fbo.testCap); |
| | | sheet1.getRow(rowNum).createCell(3).setCellValue(fbo.residualCap); |
| | | for (int k = 0;k<list.get(0).SingleVol.length;k++){ |
| | | sheet1.getRow(rowNum).createCell(4+k).setCellValue(fbo.SingleVol[k]); |
| | | } |
| | | rowNum++; |
| | | } |