召开冲刺会议
会议内容:商讨第二次冲刺计划,更多功能添加。
分配任务:
宋非:dao层设计
罗建彪:接口设计以及实现
罗远云:model设计及service接口及实现
遇到的困难:
评委评分集合获取总是失败,getScoreById方法总是出错。
任务分解图
燃尽图
代码记录:
部分代码:
package com.ms.service.impl;import java.util.ArrayList;import java.util.Arrays;import java.util.HashMap;import java.util.List;import java.util.Map;import org.apache.log4j.Logger;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.beans.factory.annotation.Qualifier;import org.springframework.stereotype.Service;import com.alibaba.fastjson.JSONObject;import com.ms.dao.ActivitylistInterface;import com.ms.dao.AudienceInterface;import com.ms.dao.ItemFormInterface;import com.ms.dao.JudgeScoreInterface;import com.ms.dao.RuleInterface;import com.ms.dao.ScoreInterface;import com.ms.dao.UserFormInterface;import com.ms.model.Activityform;import com.ms.model.Audiencescoring;import com.ms.model.GradingRule;import com.ms.model.Judgescoring;import com.ms.model.Userform;import com.ms.service.scoreServiceI;@Service("scoreService")public class ScoreServiceImpl implements scoreServiceI { @Autowired @Qualifier("activityDao") private ActivitylistInterface activityDao; @Autowired @Qualifier("ruleDao") private RuleInterface ruleDao; @Autowired @Qualifier("itemDao") private ItemFormInterface itemDao; @Autowired @Qualifier("userDao") private UserFormInterface userDao; @Autowired @Qualifier("audienceDao") private AudienceInterface audienceDao; @Autowired @Qualifier("judgeScoreDao") private JudgeScoreInterface judgeScoreDao; @Autowired @Qualifier("scoreDao") private ScoreInterface scoreDao; private Activityform activityForm = new Activityform(); private Mapmap = new HashMap (); private static final Logger logger = Logger.getLogger(ScoreServiceImpl.class); java.text.DecimalFormat df =new java.text.DecimalFormat("#.00"); /** * @description 根据项目ID获取评委评分分数 * @date 2016-11-09 */@Override public Map getJudgeScoreById(int item_id) { //1.获得已启动活动的评分细则 activityForm = activityDao.getStartActivity(true);// 查询已经启动的活动 List list_rule= ruleDao.selectRulesByActivId(activityForm.getActivityId()); //2.获取已启动活动的评委 List judges = new ArrayList (); judges = userDao.getJudgeById(2, activityForm.getActivityId()); int n = 0; int s = 0; int j = 0; int[] score = new int[judges.size()]; List list2= new ArrayList (); for(Userform c : judges){ list2 = judgeScoreDao.getScores1(c.getUserId(), item_id); if(!list2.isEmpty() ){ for(Judgescoring s1 : list2){ score[n] += s1.getScore(); s++; } if(s == list_rule.size()){ j++; } s=0; n++; } } for(int i=0;i score[i+1]){ t=score[i+1]; score[i+1]=score[i]; score[i]=t; i=-1; } } JSONObject json = new JSONObject(); Audiencescoring audienceScoring = new Audiencescoring(); if(n == judges.size()){ //获取观众评分 audienceScoring = audienceDao.getAudScoring(item_id, activityForm.getActivityId()); //评委平均分 float judgeScore = 0; for(int t=1;t getJudgeScore(int userId, int itemId) { try { return scoreDao.getScoreById(itemId, userId); } catch (Exception e) { logger.info("获取评委评分分数失败", e); return null; } }}