1. 程式人生 > >高階軟體工程第七次作業:LLS戰隊Alpha敏捷衝刺4

高階軟體工程第七次作業: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; } }