测试 用electron + springboot 构建桌面应用
whyczh
2022-03-19 802cf2676ba3fb4a813027bd54c65832e136aff4
更新
1个文件已修改
35 ■■■■ 已修改文件
src/main/java/testElectronJ/TestController.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/testElectronJ/TestController.java
@@ -22,7 +22,8 @@
public class TestController {
    //@Autowired
    //private FboDataInf fboDataInf;
    public static String fileUrl = "";
    public String fileUrl = "";
    public FboDataInf fboDataInf;
    @GetMapping("/hello")
    public Response hello(){
@@ -30,11 +31,11 @@
    }
    @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);
    }
@@ -48,11 +49,13 @@
        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后的数据
@@ -154,15 +157,13 @@
        //数据栏
        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++;
        }