团队作业4-第7篇Scrum博客

这个作业属于哪个课程 网工1934-软件工程
这个作业要求在哪里 团队作业4

1 站立式会议

1.1 会议照片

1.2 会议内容

昨天已完成的工作:

昨天已基本实现用条形图,折线图,饼图展示数据界面功能。

今天计划完成的工作

项目模块 需要实现的功能 负责人 预计用时
主界面模块 整合代码,查漏补缺 李晓兰 5h
主界面模块 主界面设计 郭海燕 2h
主界面模块 查询界面功能 周凤秀 2h
主界面模块 账目展示功能 苏培霓 2h
主界面模块 用户信息界面 杨芳 5h

工作中遇到的困难:经过这几天的努力,今天基本没有出现大问题。只是在最后整合的时候,有队友修改了一点小细节,但是忘记commit,导致出现bug。好在迅速找到问题,并且解决了。

2.项目燃尽图

3 代码/文档签入记录

4 模块的最新(运行)截图:

添加分类功能:(由于添加收入分类,支出分类同理,这里仅列举支出类别)
“添加支出”监听器代码如下

 /**
     * ”添加支出“按钮的事件监听器
     *
     * @param event 事件
     */
    public void addOutputButtonEvent(ActionEvent event) {
        // 获取用户输入的支出分类名称
        String output = outputClassificationNameTextField.getText();
        // 判断用户是否输入为空
        if (null == output || "".equals(output)) {
            SimpleTools.informationDialog(Alert.AlertType.WARNING, "提示", "警告", "文本框内容不能为空!");
        } else {
            // 列表视图添加用户输入的支出分类重名
            outputClassificationListView.getItems().add(output);
            // 封装要添加的分类实体类数据
            Classification classification = new Classification(output, "支出");
            // 进行添加操作
            boolean b = classificationDao.addClassification(classification);
            outputClassificationNameTextField.setText("");
        }
​
    }

“删除支出”监听器代码如下

/**
     * “支出”右键菜单“删除”的事件监听器
     *
     * @param event 事件
     */
    public void output_deleteMenuItemEvent(ActionEvent event) {
        // 获取用户选中的支出分类
        String outputItem = (String) outputClassificationListView.getSelectionModel().getSelectedItem();
        // 确认用户是否要删除
        boolean b = SimpleTools.informationDialog(Alert.AlertType.CONFIRMATION, "确认", "确认", "请问是否确认删除名为" + outputItem + "的支出分类?");
        if (b) {
            // 从列表视图中移除该分类
            outputClassificationListView.getItems().remove(outputItem);
            // 从数据库中删除该分类
            classificationDao.deleteClassification(new Classification(outputItem, "支出"));
        }
    }

“编辑支出”监听器代码如下

  /**
     * “支出”右键菜单“编辑”的事件监听器
     *
     * @param event 事件
     */
    public void output_editContextMenuEvent(ActionEvent event) {
        outputClassificationListView.setCellFactory(TextFieldListCell.forListView());
        outputClassificationListView.setEditable(true);
        outputClassificationListView.setFocusTraversable(true);
    }
​
    /**
     * “支出”分类列表视图编辑完成的事件监听器
     *
     * @param stringEditEvent 事件
     */
    public void outputClassificationListViewCommitEvent(ListView.EditEvent<String> stringEditEvent) {
        // 获取列表视图选中的原值
        String sourceValue = stringEditEvent.getSource().getSelectionModel().getSelectedItem();
        // 获取列表视图编辑后的新值
        String newValue = stringEditEvent.getNewValue();
        // 向列表视图移除原值
        outputClassificationListView.getItems().remove(sourceValue);
        // 向列表视图添加新值
        outputClassificationListView.getItems().add(newValue);
        // 向数据库更新值
        classificationDao.updateClassification(newValue, sourceValue);
    }

用户信息界面功能
将用户信息显示出来

  /**
     * 初始化界面
     */
    public void initialize() {
        // 获取用户信息
        User user = userDao.selectUserById(Session.getUser().getUserId());
        userImage.setImage(new Image("file:/" + user.getUserImagePath()));
        nameTextField.setText(user.getUserName());
        idTextField.setText(String.valueOf(user.getUserId()));
        passwordTextField.setText(user.getUserPassword());
    }

修改密码,将用户输入的新密码更新在数据库表中

   /**
     * ”修改“按钮的事件监听器
     *
     * @param event 事件
     */
    public void alterButtonEvent(ActionEvent event) {
        if (newPasswordTextField.getText().length() == 0) {
            SimpleTools.informationDialog(Alert.AlertType.WARNING, "提示", "警告", "新密码不能为空!");
        }
        if (confirmNewPasswordTextField.getText().length() == 0) {
            SimpleTools.informationDialog(Alert.AlertType.WARNING, "提示", "警告", "确认密码不能为空!");
        }
        if (SimpleTools.MD5(newPasswordTextField.getText()).equals(SimpleTools.MD5(confirmNewPasswordTextField.getText()))) {
            String password = SimpleTools.MD5(confirmNewPasswordTextField.getText());
            boolean b = userDao.updateUser(new User(Session.getUser().getUserId(), Session.getUser().getUserName(), password, Session.getUser().getUserImagePath()));
            if (b) {
                boolean isSuccess = SimpleTools.informationDialog(Alert.AlertType.INFORMATION, "提示", "信息", "密码修改成功!");
                if (isSuccess) {
                    alterPasswordVBox.setVisible(false);
                    alterPasswordCheckBox.setSelected(false);
                }
            } else {
                SimpleTools.informationDialog(Alert.AlertType.ERROR, "提示", "错误", "密码修改失败!");
            }
        } else {
            SimpleTools.informationDialog(Alert.AlertType.WARNING, "提示", "警告", "新密码和确认密码必须相同!");
        }
​
    }

更改用户头像

/**
     * 点击图片更改图片
     *
     * @param mouseEvent 事件
     */
    public void alterImageViewEvent(MouseEvent mouseEvent) {
        String importPath = null;
        //实例化文件选择器
        FileChooser fileChooser = new FileChooser();
        //设置默认文件过滤器
        fileChooser.setSelectedExtensionFilter(new FileChooser.ExtensionFilter("图片", "jpg", "jpeg", "png"));
        //打开文件选择框,并得到选中的文件
        File result = fileChooser.showOpenDialog(null);
        // 判断用户是否选中文件
        if (result != null) {
            importPath = result.getAbsolutePath();
            // 数据库保存路径需要进行转义,否则斜杠会消失
            String s = importPath.replaceAll("\\\\", "\\\\\\\\");
            userImage.setImage(new Image("file:/" + importPath));
            // 封装要更新的实体类对象
            User user = new User(Session.getUser().getUserId(), Session.getUser().getUserName(), Session.getUser().getUserPassword(), s);
            userDao.updateUser(user);
        }
    }

5 每人每日总结

成员 总结
郭海燕 化压力为动力,冲啊!
李晓兰 继续加油啊啊啊
苏培霓 再接再厉,继续努力
杨芳 想不到最后还是在改bug
周凤秀 胜利就在眼前,加油!
posted @ 2021-11-27 15:17  素筑锍湐  Views(42)  Comments(0Edit  收藏  举报