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;
}
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;
}
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);
}
}
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;
}
Aggregations