use of com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackScore in project bamboobsc by billchen198318.
the class DegreeFeedbackLogicServiceImpl method deleteScoreWithAssign.
private void deleteScoreWithAssign(DegreeFeedbackProjectVO project, DegreeFeedbackAssignVO assign) throws ServiceException, Exception {
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("projectOid", project.getOid());
paramMap.put("assignOid", assign.getOid());
List<BbDegreeFeedbackScore> scores = this.degreeFeedbackScoreService.findListByParams(paramMap);
for (BbDegreeFeedbackScore score : scores) {
this.degreeFeedbackScoreService.delete(score);
}
}
use of com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackScore in project bamboobsc by billchen198318.
the class DegreeFeedbackLogicServiceImpl method deleteScore.
private void deleteScore(DegreeFeedbackProjectVO project) throws ServiceException, Exception {
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("projectOid", project.getOid());
List<BbDegreeFeedbackScore> scores = this.degreeFeedbackScoreService.findListByParams(paramMap);
for (BbDegreeFeedbackScore score : scores) {
this.degreeFeedbackScoreService.delete(score);
}
}
use of com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackScore in project bamboobsc by billchen198318.
the class DegreeFeedbackScoreCalculateUtils method setItemScoreCalculate.
private static void setItemScoreCalculate(DegreeFeedbackProjectVO project, List<DegreeFeedbackItemVO> items, List<BbDegreeFeedbackScore> scores) throws ServiceException, Exception {
// 拿來放真的有評分的評分者數量
List<String> assigns = new ArrayList<String>();
for (BbDegreeFeedbackScore scoreData : scores) {
if (!assigns.contains(scoreData.getAssignOid())) {
assigns.add(scoreData.getAssignOid());
}
}
for (DegreeFeedbackItemVO item : items) {
int sumScore = 0;
float avgScore = 0.0f;
for (BbDegreeFeedbackScore scoreData : scores) {
if (scoreData.getItemOid().equals(item.getOid())) {
sumScore += scoreData.getScore();
}
}
if (sumScore > 0 && assigns.size() > 0) {
// 得分 = 總計/評分者
avgScore = Float.valueOf(sumScore) / Float.valueOf(assigns.size());
BigDecimal bd = new BigDecimal(avgScore);
avgScore = bd.setScale(1, BigDecimal.ROUND_HALF_UP).floatValue();
}
item.setSumScore(sumScore);
item.setAvgScore(avgScore);
}
assigns.clear();
assigns = null;
}
use of com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackScore in project bamboobsc by billchen198318.
the class DegreeFeedbackScoreServiceImpl method findResultsByProjectAndOwner.
@Override
public DefaultResult<List<BbDegreeFeedbackScore>> findResultsByProjectAndOwner(String projectOid, String ownerId) throws Exception {
if (StringUtils.isBlank(projectOid) || StringUtils.isBlank(ownerId)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
List<BbDegreeFeedbackScore> searchList = this.degreeFeedbackScoreDAO.findForListByProjectAndOwner(projectOid, ownerId);
DefaultResult<List<BbDegreeFeedbackScore>> result = new DefaultResult<List<BbDegreeFeedbackScore>>();
if (null != searchList && searchList.size() > 0) {
result.setValue(searchList);
} else {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
}
return result;
}
Aggregations