package cn.updev.EventWeight.Rate;

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

@@ -33,76 +33,2137 @@
 e;%0A%0A
-/**%0A * Created by hypo on 15-11-24.%0A */%0Apublic class EventGroupRate %7B
+import cn.updev.Events.Event.EventDAO;%0Aimport cn.updev.Events.Group.EventGroupDAO;%0Aimport cn.updev.Events.Group.EventGroupInfo;%0Aimport cn.updev.Events.Static.EventWeight;%0Aimport cn.updev.Events.Static.IEvent;%0A%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.List;%0A%0A/**%0A * Created by hypo on 15-11-24.%0A */%0Apublic class EventGroupRate %7B%0A%0A    private Integer eventGroupId;%0A    private String eventGroupTitle;%0A    private Integer evnetNum;%0A    private Integer finishEventNum;%0A    private Integer groupRate;%0A    private EventWeight weight;%0A    private String createTime;%0A    private String groupExpect;%0A%0A    public EventGroupRate(Integer eventGroupId) %7B%0A        this.eventGroupId = eventGroupId;%0A        EventGroupDAO groupDAO = new EventGroupDAO();%0A        EventDAO eventDAO = new EventDAO();%0A        EventGroupInfo groupInfo = groupDAO.getEventGroupInfo(eventGroupId);%0A        this.eventGroupTitle = groupInfo.getGroupTitle();%0A        this.weight = groupInfo.getWeight();%0A%0A        SimpleDateFormat dateFormat = new SimpleDateFormat(%22yyyy-MM-dd%22);%0A        this.createTime = dateFormat.format(groupInfo.getCreateTime());%0A        this.groupExpect = dateFormat.format(groupInfo.getGroupExpect());%0A%0A        List%3CIEvent%3E events = eventDAO.getEventByEventGroupId(eventGroupId);%0A        this.evnetNum = events.size();%0A        this.finishEventNum = 0;%0A%0A        for(IEvent event : events)%7B%0A            if(event.isFinish())%7B%0A                this.finishEventNum++;%0A            %7D%0A        %7D%0A        this.groupRate = 100 * this.finishEventNum / this.evnetNum;%0A    %7D%0A%0A    public Integer getEventGroupId() %7B%0A        return eventGroupId;%0A    %7D%0A%0A    public String getEventGroupTitle() %7B%0A        return eventGroupTitle;%0A    %7D%0A%0A    public Integer getEvnetNum() %7B%0A        return evnetNum;%0A    %7D%0A%0A    public Integer getFinishEventNum() %7B%0A        return finishEventNum;%0A    %7D%0A%0A    public Integer getGroupRate() %7B%0A        return groupRate;%0A    %7D%0A%0A    public String getCreateTime() %7B%0A        return createTime;%0A    %7D%0A%0A    public String getGroupExpect() %7B%0A        return groupExpect;%0A    %7D%0A%0A    public EventWeight getWeight() %7B%0A        return weight;%0A    %7D
 %0A%7D%0A

update EventGroupRate