Search in sources :

Example 1 with BbDegreeFeedbackLevel

use of com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel in project bamboobsc by billchen198318.

the class DegreeFeedbackProjectScoreSaveOrUpdateAction method fetchScores.

private void fetchScores() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields("fetch");
    BbEmployee rater = this.employeeService.findByAccountOid(this.getAccountOid());
    if (null == rater || StringUtils.isBlank(rater.getOid())) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
    }
    BbEmployee owner = this.employeeService.findByPKng(this.getFields().get("ownerOid"));
    if (null == owner || StringUtils.isBlank(owner.getOid())) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_NO_EXIST));
    }
    String projectOid = this.getFields().get("projectOid");
    DegreeFeedbackAssignVO assing = new DegreeFeedbackAssignVO();
    assing.setProjectOid(projectOid);
    assing.setOwnerId(owner.getEmpId());
    assing.setRaterId(rater.getEmpId());
    DefaultResult<DegreeFeedbackAssignVO> result = this.degreeFeedbackAssignService.findByUK(assing);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    assing = result.getValue();
    Map<String, Object> paramMap = new HashMap<String, Object>();
    paramMap.put("assignOid", assing.getOid());
    paramMap.put("projectOid", projectOid);
    this.projectScores = this.degreeFeedbackScoreService.findListVOByParams(paramMap);
    paramMap.clear();
    paramMap.put("projectOid", projectOid);
    this.projectLevels = this.degreeFeedbackLevelService.findListVOByParams(paramMap);
    paramMap.clear();
    BbDegreeFeedbackLevel minLevel = this.degreeFeedbackLevelService.findForMinByProject(projectOid);
    if (minLevel != null) {
        this.minLevelOid = minLevel.getOid();
    }
    this.success = IS_YES;
}
Also used : BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) DegreeFeedbackAssignVO(com.netsteadfast.greenstep.vo.DegreeFeedbackAssignVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) BbDegreeFeedbackLevel(com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel)

Example 2 with BbDegreeFeedbackLevel

use of com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel in project bamboobsc by billchen198318.

the class DegreeFeedbackScoreCalculateUtils method getProjectScore.

public static DegreeFeedbackProjectVO getProjectScore(String projectOid, String ownerEmployeeOid) throws ServiceException, Exception {
    DegreeFeedbackProjectVO project = new DegreeFeedbackProjectVO();
    project.setOid(projectOid);
    DefaultResult<DegreeFeedbackProjectVO> projectResult = degreeFeedbackProjectService.findObjectByOid(project);
    if (projectResult.getValue() == null) {
        throw new ServiceException(projectResult.getSystemMessage().getValue());
    }
    project = projectResult.getValue();
    EmployeeVO employee = new EmployeeVO();
    employee.setOid(ownerEmployeeOid);
    DefaultResult<EmployeeVO> empResult = employeeService.findObjectByOid(employee);
    if (empResult.getValue() == null) {
        throw new ServiceException(empResult.getSystemMessage().getValue());
    }
    employee = empResult.getValue();
    List<DegreeFeedbackItemVO> items = getItemsScore(project, employee);
    if (items != null && items.size() > 0) {
        project.setEmployee(employee);
        project.setItems(items);
        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("projectOid", project.getOid());
        Map<String, String> orderMap = new HashMap<String, String>();
        orderMap.put("value", "asc");
        List<BbDegreeFeedbackLevel> levels = degreeFeedbackLevelService.findListByParams(paramMap, null, orderMap);
        project.setLevels(wrapLevels(levels));
    }
    return project;
}
Also used : HashMap(java.util.HashMap) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) DegreeFeedbackItemVO(com.netsteadfast.greenstep.vo.DegreeFeedbackItemVO) BbDegreeFeedbackLevel(com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel) DegreeFeedbackProjectVO(com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO)

Example 3 with BbDegreeFeedbackLevel

use of com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel in project bamboobsc by billchen198318.

the class DegreeFeedbackLogicServiceImpl method deleteLevels.

private void deleteLevels(DegreeFeedbackProjectVO project) throws ServiceException, Exception {
    Map<String, Object> paramMap = new HashMap<String, Object>();
    paramMap.put("projectOid", project.getOid());
    List<BbDegreeFeedbackLevel> levels = this.degreeFeedbackLevelService.findListByParams(paramMap);
    for (BbDegreeFeedbackLevel level : levels) {
        this.degreeFeedbackLevelService.delete(level);
    }
}
Also used : HashMap(java.util.HashMap) BbDegreeFeedbackLevel(com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel)

Example 4 with BbDegreeFeedbackLevel

use of com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel 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)

Aggregations

BbDegreeFeedbackLevel (com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel)4 HashMap (java.util.HashMap)3 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)2 BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)1 DegreeFeedbackAssignVO (com.netsteadfast.greenstep.vo.DegreeFeedbackAssignVO)1 DegreeFeedbackItemVO (com.netsteadfast.greenstep.vo.DegreeFeedbackItemVO)1 DegreeFeedbackLevelVO (com.netsteadfast.greenstep.vo.DegreeFeedbackLevelVO)1 DegreeFeedbackProjectVO (com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO)1 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1