package cn.updev.EventWeight.Rate;

import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by hypo on 15-11-24.
 */
public class EventGroupRateManage {

    HttpServletRequest request;
    HttpSession session;

    public EventGroupRateManage() {
        this.request = ServletActionContext.getRequest();
        this.session = request.getSession();
    }

    public void setEventGroupRate(List<Integer> groupIds){

        List<EventGroupRate> list = new ArrayList<EventGroupRate>();

        for(Integer groupId : groupIds){
            EventGroupRate groupRate = new EventGroupRate(groupId);
            if(groupRate.getGroupRate() != 100){

                list.add(groupRate);
            }
        }

        session.setAttribute("eventGroupRate", list);
    }
}

@@ -906,11 +906,422 @@
 );%0A    %7D
+%0A%0A    public void setTeamEventGroupRate(List%3CInteger%3E groupIds)%7B%0A%0A        List%3CEventGroupRate%3E list = new ArrayList%3CEventGroupRate%3E();%0A%0A        for(Integer groupId : groupIds)%7B%0A            EventGroupRate groupRate = new EventGroupRate(groupId);%0A            if(groupRate.getGroupRate() != 100)%7B%0A%0A                list.add(groupRate);%0A            %7D%0A        %7D%0A%0A        session.setAttribute(%22groupTask%22, list);%0A    %7D
 %0A%7D%0A

update team task rate