use of com.netsteadfast.greenstep.vo.DegreeFeedbackLevelVO in project bamboobsc by billchen198318.
the class DegreeFeedbackLogicServiceImpl method createLevels.
private void createLevels(DegreeFeedbackProjectVO project, List<DegreeFeedbackLevelVO> levels) throws ServiceException, Exception {
for (DegreeFeedbackLevelVO level : levels) {
if (super.isBlank(level.getName())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
if (level.getValue() < 1) {
// 等級評分分數設定不能小於1
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_INCORRECT));
}
level.setProjectOid(project.getOid());
this.degreeFeedbackLevelService.saveObject(level);
}
}
use of com.netsteadfast.greenstep.vo.DegreeFeedbackLevelVO in project bamboobsc by billchen198318.
the class DegreeFeedbackScoreCalculateUtils method wrapLevels.
private static List<DegreeFeedbackLevelVO> wrapLevels(List<BbDegreeFeedbackLevel> levels) throws Exception {
List<DegreeFeedbackLevelVO> newLevels = new LinkedList<DegreeFeedbackLevelVO>();
for (BbDegreeFeedbackLevel level : levels) {
DegreeFeedbackLevelVO obj = new DegreeFeedbackLevelVO();
degreeFeedbackLevelService.copyProperties(level, obj);
newLevels.add(obj);
}
return newLevels;
}
use of com.netsteadfast.greenstep.vo.DegreeFeedbackLevelVO in project bamboobsc by billchen198318.
the class DegreeFeedbackProjectSaveOrUpdateAction method fillLevels.
private List<DegreeFeedbackLevelVO> fillLevels() throws Exception {
List<DegreeFeedbackLevelVO> levels = new ArrayList<DegreeFeedbackLevelVO>();
Map<String, List<Map<String, Object>>> dataMap = this.fillJsonData(this.getFields().get("levelData"));
List<Map<String, Object>> nodes = dataMap.get("data");
for (Map<String, Object> node : nodes) {
DegreeFeedbackLevelVO obj = new DegreeFeedbackLevelVO();
obj.setName(String.valueOf(node.get("name")));
obj.setValue(NumberUtils.toInt(String.valueOf(node.get("value")), 1));
levels.add(obj);
}
return levels;
}
Aggregations