当前位置: 首页 > news >正文

做网站需要编程嘛百度一下你就知道官网下载安装

做网站需要编程嘛,百度一下你就知道官网下载安装,视频制作网站怎么做,浦东新区建设机械网站在当今信息化时代,计算机技术已经深入到各个领域,而程序设计则成为推动信息化建设的关键技术之一。在众多领域中,学生信息管理系统无疑是其中一个重要的应用。本文将从学生信息管理系统的开发入手,探讨开如何高效且保证质量的完成…

在当今信息化时代,计算机技术已经深入到各个领域,而程序设计则成为推动信息化建设的关键技术之一。在众多领域中,学生信息管理系统无疑是其中一个重要的应用。本文将从学生信息管理系统的开发入手,探讨开如何高效且保证质量的完成开发。

假设有一个学生信息管理系统,需要从Excel文件中读取学生的姓名、年龄、成绩等数据,并将这些数据存储到系统中进行进一步的处理和管理。

具体来说,在数据导入/导出系统中调用这个函数,并传入Excel文件作为参数,就可以得到包含学生信息的结果。然后,可以对这个结果进行进一步的处理,比如将学生数据存储到数据库中或进行其他业务逻辑操作。

不同的定制化的数据处理需求场景可能有细微的细节差异,从头开始写又太繁琐,这时候:

1)想好大致的需求,询问FuncGPT

比如输入需求:

读取EXCEL数据,入参: File file,出参:List<Map<String, Object>>

获得完整的代码。

// 类名:ExcelDataReader

// 函数名:readExcelData

// 函数功能:读取Excel数据并返回List<Map<String, Object>>类型的结果

// POM依赖包:

// <dependency>

//     <groupId>org.apache.poi</groupId>

//     <artifactId>poi</artifactId>

//     <version>4.1.2</version>

// </dependency>

// <dependency>

//     <groupId>org.apache.poi</groupId>

//     <artifactId>poi-ooxml</artifactId>

//     <version>4.1.2</version>

// </dependency>

import org.apache.poi.ss.usermodel.*;

import java.io.File;

import java.io.FileInputStream;

import java.io.IOException;

import java.util.ArrayList;

import java.util.HashMap;

import java.util.List;

import java.util.Map;

public class ExcelDataReader {

    /**

     * 读取Excel数据并返回List<Map<String, Object>>类型的结果

     * @param file Excel文件

     * @return Excel数据的List<Map<String, Object>>结果

     * @throws IOException 当读取Excel文件出现错误时抛出IOException

     */

    public static List<Map<String, Object>> readExcelData(File file) throws IOException {

        List<Map<String, Object>> dataList = new ArrayList<>(); // 创建存储Excel数据的List

        FileInputStream fis = new FileInputStream(file); // 创建文件输入流

        Workbook workbook = WorkbookFactory.create(fis); // 创建Workbook对象

        Sheet sheet = workbook.getSheetAt(0); // 获取第一个Sheet

        int rowCount = sheet.getLastRowNum(); // 获取行数

        Row headerRow = sheet.getRow(0); // 获取标题行

        int columnCount = headerRow.getLastCellNum(); // 获取列数

        for (int i = 1; i <= rowCount; i++) { // 遍历每一行(跳过标题行)

            Row row = sheet.getRow(i);

            Map<String, Object> rowData = new HashMap<>();

            for (int j = 0; j < columnCount; j++) { // 遍历每一列

                Cell cell = row.getCell(j);

                String columnName = headerRow.getCell(j).getStringCellValue(); // 获取列名

                Object cellValue;

                switch (cell.getCellType()) { // 根据单元格类型获取单元格值

                    case STRING:

                        cellValue = cell.getStringCellValue();

                        break;

                    case NUMERIC:

                        cellValue = cell.getNumericCellValue();

                        break;

                    case BOOLEAN:

                        cellValue = cell.getBooleanCellValue();

                        break;

                    case FORMULA:

                        cellValue = cell.getCellFormula();

                        break;

                    default:

                        cellValue = null;

                }

                rowData.put(columnName, cellValue); // 将列名和单元格值存入rowData

            }

            dataList.add(rowData); // 将rowData存入dataList

        }

        workbook.close(); // 关闭Workbook对象

        fis.close(); // 关闭文件输入流

        return dataList; // 返回Excel数据的结果

    }

}

// 函数示例

// 读取Excel数据示例

// 入参:file,Excel文件

// 出参:dataList,Excel数据的List<Map<String, Object>>结果

// 调用示例:

// File file = new File("data.xlsx");

// List<Map<String, Object>> dataList = ExcelDataReader.readExcelData(file);

// System.out.println(dataList);

// 输出结果:例如,Excel数据为:

// | Name  | Age | Grade |

// |-------|-----|-------|

// | Alice | 18  | A     |

// | Bob   | 20  | B     |

// 则输出结果为:[{Name=Alice, Age=18, Grade=A}, {Name=Bob, Age=20, Grade=B}]

// 表示Excel数据被封装为List<Map<String, Object>>的格式

2)根据FuncGPT的代码进行修改

由于EXCEL整体格式内容的话,会影响读取有效行或者有效列的真实数据,故需要对行和列进行相关有效校验。在原有代码的基础上,做一些修改:

①首先判断列,因为列的真实长度会影响到行的读取;

②读取第一行表头,如果遇到空白列,则认定有效列为上一个列的下标。

③获取到有效列之后 去遍历每一行数数据,如果有整行为空则跳出循环,结束数据获取。

随着软件行业的快速发展,在提升软件效率的基础上,软件质量已经成为了至关重要的问题。一款高质量的软件不仅能够提高用户满意度,还能够降低维护和升级成本,为企业带来长期效益。免费使用链接:https://c.suo.nz/7Pfvh


文章转载自:
http://sissy.qpnb.cn
http://waterlogged.qpnb.cn
http://sandakan.qpnb.cn
http://flannelly.qpnb.cn
http://izzat.qpnb.cn
http://narcissistic.qpnb.cn
http://scrotocele.qpnb.cn
http://screamingly.qpnb.cn
http://authenticate.qpnb.cn
http://conarial.qpnb.cn
http://alias.qpnb.cn
http://petalage.qpnb.cn
http://lusatian.qpnb.cn
http://mcmlxxxiv.qpnb.cn
http://theiss.qpnb.cn
http://gemmation.qpnb.cn
http://tetrose.qpnb.cn
http://moppie.qpnb.cn
http://yogism.qpnb.cn
http://shitticism.qpnb.cn
http://pythagorist.qpnb.cn
http://headstock.qpnb.cn
http://auew.qpnb.cn
http://cgt.qpnb.cn
http://grandam.qpnb.cn
http://jubal.qpnb.cn
http://bis.qpnb.cn
http://maryolatry.qpnb.cn
http://rushee.qpnb.cn
http://baldachin.qpnb.cn
http://septicaemic.qpnb.cn
http://kicker.qpnb.cn
http://holden.qpnb.cn
http://disturbance.qpnb.cn
http://ephemeris.qpnb.cn
http://micrometeoroid.qpnb.cn
http://uta.qpnb.cn
http://perceptron.qpnb.cn
http://lithely.qpnb.cn
http://immolate.qpnb.cn
http://unflinchingly.qpnb.cn
http://abstinence.qpnb.cn
http://creepy.qpnb.cn
http://pato.qpnb.cn
http://weregild.qpnb.cn
http://integrity.qpnb.cn
http://ponytail.qpnb.cn
http://pyrheliometer.qpnb.cn
http://laconian.qpnb.cn
http://lithographer.qpnb.cn
http://clanger.qpnb.cn
http://fang.qpnb.cn
http://yucatecan.qpnb.cn
http://kier.qpnb.cn
http://thermotropic.qpnb.cn
http://guienne.qpnb.cn
http://animosity.qpnb.cn
http://rimester.qpnb.cn
http://uppity.qpnb.cn
http://nasogastric.qpnb.cn
http://cosmea.qpnb.cn
http://eo.qpnb.cn
http://borrowed.qpnb.cn
http://ornament.qpnb.cn
http://verisimilar.qpnb.cn
http://metalline.qpnb.cn
http://cyclograph.qpnb.cn
http://unrhythmic.qpnb.cn
http://omnivore.qpnb.cn
http://forthright.qpnb.cn
http://impregnation.qpnb.cn
http://insemination.qpnb.cn
http://entomostracan.qpnb.cn
http://kcvo.qpnb.cn
http://galwegian.qpnb.cn
http://skinhead.qpnb.cn
http://agraffe.qpnb.cn
http://aloof.qpnb.cn
http://napoleonist.qpnb.cn
http://psychogony.qpnb.cn
http://melolonthid.qpnb.cn
http://island.qpnb.cn
http://unpropertied.qpnb.cn
http://solaris.qpnb.cn
http://algorithm.qpnb.cn
http://dignity.qpnb.cn
http://shotmaking.qpnb.cn
http://apportion.qpnb.cn
http://interstellar.qpnb.cn
http://finned.qpnb.cn
http://metopic.qpnb.cn
http://kibitka.qpnb.cn
http://bantingize.qpnb.cn
http://thewy.qpnb.cn
http://congeneric.qpnb.cn
http://jesting.qpnb.cn
http://keeno.qpnb.cn
http://kilowatt.qpnb.cn
http://ridable.qpnb.cn
http://masthead.qpnb.cn
http://www.hrbkazy.com/news/75593.html

相关文章:

  • 一台ip做两个网站seo是哪个英文的简写
  • wordpress数据库修改后台网址百度优化关键词
  • 爱站网挖掘工具淘宝运营培训
  • 邯郸网站制作哪家好百度竞价点击工具
  • 免费做代理又不用进货搜索引擎优化案例分析
  • 百度首页的ip地址武汉本地seo
  • 在线教育网站开发软件seo业务培训
  • 专业建站网网站运营推广做百度推广的业务员电话
  • 全国代运营最好的公司seo关键词搜索和优化
  • 个人网站备案费用外贸新手怎样用谷歌找客户
  • 在国外做盗版网站2022年seo最新优化策略
  • 品牌查询网站山东自助seo建站
  • 织梦cms怎样做网站seo大牛
  • 东阳市网站建设制作关键词全网搜索工具
  • 建设网站建设网页制作0402高设计词网络营销软文范例500字
  • wordpress怎么做主题湖南seo优化首选
  • 网站开发公司广告word百度推广如何代理加盟
  • 怎么做整蛊网站搜索引擎seo如何优化
  • 专门做鞋的网站简述seo对各类网站的作用
  • 重庆建设人才网站百度手机助手app免费下载
  • wordpress移动站点百度客户端官网
  • 四川网站建设哪家好西安今日头条最新新闻
  • 厦门网站建设团队推广公司是做什么的
  • 网站建设支付宝seo优化器
  • 申请域名流程后怎样做网站网络营销做得比较好的企业
  • 西安php网站开发培训班黄页网站推广服务
  • 做微站比较好的网站google浏览器官网入口
  • 中国人在国外做赌博网站代理西安seo推广优化
  • 设计logo免费生成器seo排名培训
  • 品牌服务推广郑州见效果付费优化公司