201771030123- Wang Shuang software engineering experiment two individual events - "Northwest Normal University student epidemic reporting system" project report

project content
Course class blog link https://edu.cnblogs.com/campus/xbsf/nwnu2020SE
This job requires link https://www.cnblogs.com/nwnu-daizh/p/12416880.html
My course learning objectives (1) personal project control software development process.
(2) master methods of operation Github publishing software projects.
This job helped me achieve learning objectives in what areas Familiar with the personal software project planning process in accordance with PSP
Github repository link project https://github.com/JzyWs/wangS.git

Task 2: PSP processes in conjunction with the development of individual projects

Project development background:

     2019年12月末,中国武汉发生新型冠状病毒(2019-nCoV) 感染的肺炎疫情,为遏制疫情蔓延,有效切断病毒传播途径,在中央政府指导下,各级政府部分采取了一系列防控措施: 2020年1 月23 日10时起对武汉“封城”,全国 31个省市也相继实施了严格的防控措施;全国各省市向武汉和湖北派遣医疗队参与救治工作;在全国范围内调配口罩、防护服、药品等急需的医疗资源支援武汉;指导和督促全国范围内拥有医疗物资生产资质的企业尽快恢复生产能力;定向拨付专项财政资金用于疾病防控;从其他省份调集物资保障武汉市民日常生活。

   值得一提的是,中国互联网企业在此次疫情防控中发挥了社会治理方面的重要作用。以腾讯为例,围绕应对疫情管控需求开发了十一款产品。其中疫情在线问诊功能,对于减少发热病人之间的相互交叉感染具有重要的作用,患者在家通过互联网向在线医生问诊,减少了病毒传播或感染的风险;谣言粉碎对于公众采取理性态度看待疫情的发展具有重要意义。滴滴出行还在武汉专门组建车队,服务于医护人员的通勤,这在实施交通管制的武汉具有重要作用。此外,还有新型肺炎确诊患者同行程查询工具,用户只需要输入自己所乘坐交通工具的时间和班次,就可以确认是否与被确诊感染者同行,提前做好自我隔离和就诊工作。在疫情防控中,中国互联网企业不仅发展壮大,在承担社会责任方面也越来越成熟。

   为有效配合防控机构有关疫情信息的采集、统计与排查,我校开发了教职工/学生疫情上报系统,该系统由教职工疫情每日上报、学生疫情每日上报、二级部门疫情每日汇总表、疫情防控填报统计四个子系统组成。实现对我校各类人员基本情况、所在区域及活动轨迹及健康状况的信息收集。师生通过我校企业微信服务大厅访问该系统进行远程信息填报。

Project Development Requirements:

The first development requirements:
a data file, saving 100 days 2000 faculty / student all immunization information, please design a command line program that supports queries in person one day the epidemic situation, some kind of query data Week epidemic statistics / month, and displays statistical results histogram.

1: needs analysis

  • Non-functional requirements
    now as the new coronavirus epidemic, all the city's schools have agreed to delay the start time, but despite the delay time, but the school also hope that we can return to school as soon as possible, so before we are required to fill in schools on a daily epidemic reports. After all filled out, hope can clearly see the situation of students according to the school's requirements, so you can now simulate a small epidemic summary table, operated by 100 days of 2000 personal information to obtain a columnar made according to various requirements Fig.
  • Functional Requirements
    • Queries epidemic situation in someone's day
    • Epidemic statistics query some data week / month, and display the results as a histogram

2: Functional Design

Needs analysis and project functions to be achieved by different projects I have done to achieve the following functions:
- to query 100 days of the epidemic situation of a student by student number, and a histogram.
- able to query the 2000 student day of the epidemic situation, and a histogram display.

3: Design and Implementation

  • Two files: test2, test3, two documents have a master class were: Barchart
    - (Note: Since I am in the process of reading the data to date have not obstacles, and try a lot of ways still could not solve, in the follow-up the report will show out where the problem lies. so separate the two files to achieve the above functional design requirements to achieve .test2 second function, implemented using the file test.xls.test3 first function, using the file test1.xls)
    • Jxl.jar-- to use to read data from the Excel file.
      • Workbook book = Workbook.getWorkbook (new File ( "D: \ test1.xls")); - important in reading the statement in Excel
      • . String name = sheet.getCell (x, y) .getContents () trim (); - Excel file for reading row y, column data of x
    • Use the gnujaxp.jar, jcommon.jar, jfreechart.jar-- for the production of a histogram.
      • JFreeChart chart = ChartFactory.createBarChart3D (); - for constructing a bar graph, a bar graph on the content parameters to fill
      • CategoryPlot plot = chart.getCategoryPlot (); - the object for obtaining the chart area.
3.1: Design specific ideas
首先数据准备,需要编写小程序来随机产生2000姓名及性别和其他信息,将数据存于Excel文件中(注意:保存的Excel文件后缀名为.xls),这样数据就准备好了。接下来就开始进行实验,将数据按行读取,在读的过程中就判断各项内容,如“是否出现疑似症状情况”内容为“是”,设置临时变量count1自增1。这样再遍历完整个文件之后就完成了各项内容的统计,将统计的几个临时变量传给Dateset中作为数据,接下来就可实现这一天的2000个人的疫情统计柱状图。
其次,跟上述思想相似,一开始输入需要查询的学生的学号,通过在遍历文件的过程中将输入的变量与读取的学号列进行匹配,如果相等就输出信息,并且同时统计各项内容数据,方法同上。这样就可在命令行窗口看到该学生100天的疫情情况,也可以看到这100天内的情况统计柱状图。

4: Run the test

  • The main categories are as follows:

Test2 runs in BarChart Statistics epidemic situation can be achieved one day of 2000 students, the test results are as follows:


First of all, you can see in the console window you can see specific data in the various statistical projects, and secondly, using java graphical user interface has made these histograms of data.

Test3 run the query can be achieved BarChart 100 days a student epidemic situation and draw a histogram, test results are as follows:


You can see the number of school student can get the 100 days of the epidemic situation and the bar graph in the form of the command line input.

5: the main code

/*
该主要代码是用于从Excel中边读数据边进行统计得到柱状图所需要的数据的过程
*/
private static CategoryDataset getDataSet() throws ParseException
    {
    int count1=0;
        int count2=0;
        int count3=0;
        int count4=0;
        Scanner sc = new Scanner(System.in);
        try {
            Workbook book = Workbook.getWorkbook(new File("D:\\test1.xls"));
            Sheet sheet =book.getSheet(0);
            int rows =sheet.getRows();
            int cols =sheet.getColumns();
            System.out.println("请输入学号:");
            String Id = sc.nextLine();
            for(int i=1;i<rows;i++)
            {
                String id = sheet.getCell(0, i).getContents().trim();
                if(id.equals(Id))
                {
                    String name =sheet.getCell(1, i).getContents().trim();
                    String sex =sheet.getCell(2, i).getContents().trim();
                    String date =sheet.getCell(3, i).getContents().trim();
                    String a1 =sheet.getCell(4, i).getContents();
                    String a2 =sheet.getCell(5, i).getContents();
                    String a3 =sheet.getCell(6, i).getContents();
                    String a4 =sheet.getCell(7, i).getContents();
                    System.out.println(id+"   "+name+"    "+sex+"  "+date+"    "+a1+"  "+a2+"   "+a3+"   "+a4);
                    if(a1.equals("是"))
                        count1++;
                    if(a2.equals("是"))
                        count2++;
                    if(a3.equals("是"))
                        count3++;
                    if(a4.equals("是"))
                        count4++;
                }
            }
            
            
        } catch (BiffException e) {
            // TODO 自动生成的 catch 块
            e.printStackTrace();
        } catch (IOException e) {
            // TODO 自动生成的 catch 块
            e.printStackTrace();
        }
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        dataset.addValue(count1, "是否在武汉", "是否在武汉");
        dataset.addValue(count2, "是否湖北(不含武汉)", "是否湖北(不含武汉)");
        dataset.addValue(count3, "是否有疫情疑似症状", "是否有疫情疑似症状");
        dataset.addValue(count4, "是否已确认被感染", "是否已确认被感染");
        return dataset;
    }

6: problems encountered

During the experiment, I have a problem I encountered several, and some have been resolved, and some have not yet been resolved.

1: Read Excel files

Here, we all know that this is used to read Excel files, but I did not notice the beginning of the file type should be read test.xls, and the default suffix when we used Excel to save is test.xlsx, because I initially did not pay attention, resulting in failure to read the file. Behind after check online to know when operating jxl Excel .xls file is to be read, which is a large part of their carelessness, the future will pay more attention to some of the details.

2: Data type conversion

These three issues are after reading the Excel file will be used to judge whether I am equal to the variable does not match the first thought is of different data types, to compare the same type to String, so use a cast, will Two types of conversion, no matter what kind of conversion are not feasible to another, even if no syntax error is not an error but still no results. By check online, and then ask the students first and second question I have been resolved, the first problem is the need to read this String id = sheet.getCell data of the line (0, i) .getContents () .trim (); behind .trim () is converted into String type of the data, so that after Id id and can compare the input; second problem is because I need to determine the content of "yES", a I started the "Yes" convert this into a char type String type, or vice versa. Although this is not an error, but we did not get the results I want to know after after inquiry to determine whether the two can not equal "==" to determine the need to use a1.equals ( "Yes") such statement to determine . These two issues have been resolved, but the third problem is still not resolved, regardless of the type or convert various methods have been tried, still not resolved, resulting in experimental feature is not achieved by week / month to draw a histogram. In a subsequent study also we need to complete this project and improve their knowledge!

7: Experiment summary

In this experiment because the process of learning the PSP and PSP use the process to strictly enforce the implementation of the software inside the process, think it is a new experience, learning more aware of the importance of this class of software engineering and a project development plan and estimate how important, PSP will make people do the process more clear and specific idea of ​​the entire project, in short, PSP really taught me to be more standardized software development. Secondly, the harvest in this experiment also read Excel files, and a histogram with java language method! But unfortunately, we could not be more complete implementation of the project to be achieved within a limited time function. In a later study will work harder, hope will get better and better!

8: Display PSP

PSP2.1 SUMMARY Planning time needed (hours) completed The actual time required to complete (hours)
Planning plan 3 4
Estimate It estimated that the task requires much time and planning generally work steps 100 150
Development Develop 150 160
Analysis Needs analysis (including learning new technologies) 3 3
Design Spec Generate design documents 2 2
Design Review Design review (and colleagues reviewed the design documents) 0 0
Coding Standard Code specifications (development of appropriate norms for the current development) 2 2
Design Specific design 10 15
Coding Specific coding 300 290
Code Review Code Review 10 12
Test Test (self-test, modify the code, submit modifications) 15 14
Reporting report 6 6
Size Measurement Computing workload 3 42
Postmortem & Process Improvement Plan Later summarized, and process improvement plan 2 3

9: Upload projects to Github

Guess you like

Origin www.cnblogs.com/JZYWS/p/12511836.html