高级软件工程第七次作业:LLS战队Alpha敏捷冲刺4

召开迭代会议照片:

会议内容:总结前三天冲刺做的不足的地方,讨论如何将系统数据库表做的更为详细,完善。对系统进一步进行功能完善化,具体化。对系统的一些活动行为进行代码编写。

任务分配:宋非队长:201810812006   ActivityAction代码编写

    罗建彪队员:201810812005   BaseAction代码编写

    罗远云队员:201810775002  LoginAction代码编写

 遇到的问题:在做登录功能的时候遇到过账号不存在,账号和密码不匹配的问题,后来经过修改,已经解决了这两个问题。

任务分解图:

任务燃尽图:

conding代码链接:https://git.coding.net/Ssl_dhlg18/SIMsystem.git

部分代码截图:

package com.ms.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import com.ms.dao.UserFormInterface;
import com.ms.model.Userform;
import com.opensymphony.xwork2.ModelDriven;

/**
 * @description 系统登入ACtion
 * @author LSS
 * @date 2018-11-27
 * 
 */
@SuppressWarnings("serial")
public class LoginAction extends BaseAction implements ModelDriven<Userform> {
    @Autowired
    @Qualifier("userDao")
    private UserFormInterface userDao;
    String msg;
    private Userform user = new Userform();

    @Action(value = "login", results = {
            @Result(name = "admin", type = "redirect", location = "/Main.jsp"),
            @Result(name = "judge", type = "redirect", location = "/JudgeScore.jsp"),
            @Result(name = "error", location = "/Login.jsp") })
    public String login() {
        Userform user1 = new Userform();
        user1 = userDao.select(user.getAccount());
        System.out.println(user1);
        if (user1 != null
                && user.getPassword().equalsIgnoreCase(user1.getPassword())
                && user1.getUserType() == 1) {// 管理员
            session.put("account", user.getAccount());
            session.put("password", user.getPassword());
            return "admin";
        } else if (user1 != null
                && user.getPassword().equalsIgnoreCase(user1.getPassword())
                && user1.getUserType() == 2) {// 评委
            session.put("account", user.getAccount());
            session.put("password", user.getPassword());
            return "judge";
        }else if (user1 != null && user1.getPassword() != user.getPassword()) {// 密码错误
            msg = "用户名密码错误";
            return "error";
        }
        msg = "系统中没有这个用户";
        return "error";
    }

    @Override
    public Userform getModel() {
        return user;
    }

    public Userform getUser() {
        return user;
    }

    public void setUser(Userform user) {
        this.user = user;
    }
    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}

 

 

猜你喜欢

转载自www.cnblogs.com/luoyy/p/10028160.html
今日推荐