Search in sources :

Example 1 with DegreeFeedbackLevelVO

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);
    }
}
Also used : DegreeFeedbackLevelVO(com.netsteadfast.greenstep.vo.DegreeFeedbackLevelVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 2 with DegreeFeedbackLevelVO

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;
}
Also used : DegreeFeedbackLevelVO(com.netsteadfast.greenstep.vo.DegreeFeedbackLevelVO) BbDegreeFeedbackLevel(com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel) LinkedList(java.util.LinkedList)

Example 3 with DegreeFeedbackLevelVO

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;
}
Also used : DegreeFeedbackLevelVO(com.netsteadfast.greenstep.vo.DegreeFeedbackLevelVO) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Aggregations

DegreeFeedbackLevelVO (com.netsteadfast.greenstep.vo.DegreeFeedbackLevelVO)3 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)1 BbDegreeFeedbackLevel (com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Map (java.util.Map)1