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

高階軟體工程第七次作業:LLS戰隊Alpha敏捷衝刺5

召開迭代會議照片:

 

會議內容:繼續對昨天的工作進行完善,將剩下的活動行為完成,並做明天的工作計劃。

任務分配:宋非隊長:201810812006  RuleAction程式碼編寫

    羅建彪隊員:201810812005  ScoreAction程式碼編寫

    羅遠雲隊員:201810775002  UserAction程式碼編寫

 需要注意的細節(使用者行為):新增和修改要注意引數的資料型別,格式要一致;刪除要注意刪除的條件。

任務分解圖:

任務燃盡圖:

conding程式碼連結:https://git.coding.net/Ssl_dhlg18/SIMsystem.git

部分程式碼截圖:

package com.ms.action;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.ServletActionContext;
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.ActivitylistInterface; import com.ms.model.Userform; import com.ms.service.UserServiceI; import com.ms.utils.getPageUtil; import com.opensymphony.xwork2.ModelDriven; /** * @Description : 活動列表的Action實現 * @author LSS * @Date 2018-11-28 *
*/ @SuppressWarnings("serial") public class UserAction extends BaseAction implements ModelDriven<Userform>{ @Autowired private UserServiceI userService; @Autowired @Qualifier("activityDao") private ActivitylistInterface activityDao; private Userform user = new Userform(); private List<Userform> list_users= new ArrayList<Userform>(); private List<Integer> pages = new ArrayList<Integer>(); /** * @Description : 查詢所有的使用者 * @author LLS * @Date 2018-11-28 * */ @Action(value = "getUsers" , results = {@Result(name = "success", type = "json",params = {"root","jsoMap"})}) public String getUsers(){ String page=ServletActionContext.getRequest().getParameter("page"); String rows=ServletActionContext.getRequest().getParameter("rows"); pages = getPageUtil.getPage(page, rows);//獲取int值得頁碼和頁數 jsoMap.put("rows", userService.getAllUser(pages.get(0),pages.get(1))); int total = userService.getUserCounts(); jsoMap.put("total", total); return "success"; } /** * @Description : 增加使用者 * @author LSS * @Date 2018-11-28 * */ @Action(value = "addUser" , results = {@Result(name = "success", type = "json",params = {"root","jsoMap"})}) public String addUser(){ jsoMap.put("msg", userService.addUser(user)); return "success"; } /** * @Description : 修改使用者 * @author LSS * @Date 2018-11-28 * */ @Action(value = "updateUser" , results = {@Result(name = "success", type = "json",params = {"root","jsoMap"})}) public String updateUser(){ jsoMap.put("msg", userService.updateUser(user)); return "success"; } /** * @Description : 刪除使用者 * @author LSS * @Date 2018-11-28 * */ @Action(value = "deleteUser" , results = {@Result(name = "success", type = "json",params = {"root","jsoMap"})}) public String deleteUser(){ jsoMap.put("msg", userService.deleteUser(user.getUserId())); return "success"; } /** * @Description : 查詢評委 * @author LSS * @Date 2018-11-28 * */ @Action(value = "getJudges" , results = {@Result(name = "success", type = "json",params = {"root","jsoMap"})}) public String getJudges(){ jsoMap.put("rows", userService.getJudge(2)); return "success"; } /** * @Description : 通過活動ID查詢評委 * @author LSS * @Date 2018-11-28 * */ @Action(value = "getJudgesByActivId" , results = {@Result(name = "success", type = "json",params = {"root","jsoMap"})}) public String getJudgesByActivId(){ int activityId = Integer.parseInt(ServletActionContext.getRequest().getParameter("activityId")); jsoMap.put("msg", true); jsoMap.put("rows", userService.getJudgeById(2, activityId)); return "success"; } /** * @Description : 通過已啟動活動的ID查詢評委 * @author LSS * @Date 2018-11-28 * */ @Action(value = "getJudgesByStartActivId" , results = {@Result(name = "success", type = "json",params = {"root","jsoMap"})}) public String getJudgesByStartActivId(){ int activityId = activityDao.getStartActivity(true).getActivityId(); jsoMap.put("rows", userService.getJudgeById(2, activityId)); return "success"; } /** * @Description : 一鍵新增評委到活動中 * @author LSS * @Date 2018-11-28 * */ @Action(value = "addAllJudge2Activ" , results = {@Result(name = "success", type = "json",params = {"root","jsoMap"})}) public String addAllJudge2Activ(){ int activityId = Integer.parseInt(ServletActionContext.getRequest().getParameter("activityId")); jsoMap.put("msg", userService.addAllJudgeToActiv(activityId, 2)); return "success"; } /** * @Description : 一鍵移除評委到活動中 * @author LLS * @Date 2018-11-28 * */ @Action(value = "removeAllJudgeFromActiv" , results = {@Result(name = "success", type = "json",params = {"root","jsoMap"})}) public String removeAllJudgeFromActiv(){ int activityId = Integer.parseInt(ServletActionContext.getRequest().getParameter("activityId")); jsoMap.put("msg", userService.removeAllJudgeToActiv(activityId, 2)); return "success"; } /** * @Description : 單個新增(移除)評委到活動中 * @author LSS * @Date 2018-11-28 * */ @Action(value = "addSingleJudge2Activ" , results = {@Result(name = "success", type = "json",params = {"root","jsoMap"})}) public String addSingleJudge2Activ(){ int activityId = Integer.parseInt(ServletActionContext.getRequest().getParameter("activityId")); int userId = Integer.parseInt(ServletActionContext.getRequest().getParameter("userId")); jsoMap.put("msg", userService.addSingleJudgeToActiv(activityId, userId)); return "success"; } @Override public Userform getModel() { return user; } public Userform getUser() { return user; } public void setUser(Userform user) { this.user = user; } public List<Userform> getList_users() { return list_users; } public void setList_users(List<Userform> list_users) { this.list_users = list_users; } }