use of com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO in project bamboobsc by billchen198318.
the class DegreeFeedbackProjectServiceImpl method findByPublishFlag2ValueObject.
@Override
public DefaultResult<List<DegreeFeedbackProjectVO>> findByPublishFlag2ValueObject(String publishFlag, String raterId) throws Exception {
DefaultResult<List<BbDegreeFeedbackProject>> queryResult = this.findByPublishFlag(publishFlag, raterId);
DefaultResult<List<DegreeFeedbackProjectVO>> result = new DefaultResult<List<DegreeFeedbackProjectVO>>();
if (queryResult.getValue() == null) {
result.setSystemMessage(queryResult.getSystemMessage());
return result;
}
List<DegreeFeedbackProjectVO> datas = new ArrayList<DegreeFeedbackProjectVO>();
List<BbDegreeFeedbackProject> queryList = queryResult.getValue();
for (BbDegreeFeedbackProject entity : queryList) {
DegreeFeedbackProjectVO obj = new DegreeFeedbackProjectVO();
this.doMapper(entity, obj, this.getMapperIdPo2Vo());
datas.add(obj);
}
result.setValue(datas);
return result;
}
use of com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO in project bamboobsc by billchen198318.
the class DegreeFeedbackLogicServiceImpl method updateScore.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<DegreeFeedbackProjectVO> updateScore(String projectOid, String ownerEmployeeOid, String raterEmployeeOid, List<DegreeFeedbackScoreVO> scores) throws ServiceException, Exception {
if (super.isBlank(projectOid) || super.isNoSelectId(ownerEmployeeOid) || super.isBlank(raterEmployeeOid) || null == scores || scores.size() < 1) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DegreeFeedbackProjectVO project = new DegreeFeedbackProjectVO();
project.setOid(projectOid);
DefaultResult<DegreeFeedbackProjectVO> projectResult = this.degreeFeedbackProjectService.findObjectByOid(project);
if (projectResult.getValue() == null) {
throw new ServiceException(projectResult.getSystemMessage().getValue());
}
project = projectResult.getValue();
DefaultResult<DegreeFeedbackProjectVO> result = new DefaultResult<DegreeFeedbackProjectVO>();
BbEmployee rater = this.getEmployeeService().findByAccountOid(raterEmployeeOid);
if (null == rater || super.isBlank(rater.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
}
BbEmployee owner = this.getEmployeeService().findByPKng(ownerEmployeeOid);
if (null == owner || super.isBlank(owner.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_NO_EXIST));
}
DegreeFeedbackAssignVO assign = this.findAssign(projectOid, rater.getEmpId(), owner.getEmpId());
this.deleteScoreWithAssign(project, assign);
Map<String, Object> paramMap = new HashMap<String, Object>();
for (DegreeFeedbackScoreVO score : scores) {
paramMap.put("oid", score.getItemOid());
if (this.degreeFeedbackItemService.countByParams(paramMap) != 1) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_NO_EXIST));
}
score.setAssignOid(assign.getOid());
super.setStringValueMaxLength(score, "memo", MAX_DESCRIPTION_OR_MEMO_LENGTH);
DefaultResult<DegreeFeedbackScoreVO> insertResult = this.degreeFeedbackScoreService.saveObject(score);
if (insertResult.getValue() == null) {
throw new ServiceException(insertResult.getSystemMessage().getValue());
}
result.setSystemMessage(insertResult.getSystemMessage());
}
paramMap.clear();
paramMap = null;
result.setValue(project);
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_SUCCESS)));
return result;
}
use of com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO in project bamboobsc by billchen198318.
the class DegreeFeedbackLogicServiceImpl method confirmTask.
@ServiceMethodAuthority(type = { ServiceMethodType.SELECT, ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public void confirmTask(String projectOid, String taskId, String reason, String confirm) throws ServiceException, Exception {
if (super.isBlank(projectOid) || super.isBlank(taskId) || super.isBlank(confirm)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DegreeFeedbackProjectVO project = new DegreeFeedbackProjectVO();
project.setOid(projectOid);
DefaultResult<DegreeFeedbackProjectVO> result = this.degreeFeedbackProjectService.findObjectByOid(project);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().toString());
}
project = result.getValue();
this.completeTask(taskId, this.getProcessFlowParam(projectOid, confirm, reason));
List<BusinessProcessManagementTaskVO> tasks = this.queryTaskByVariableProjectOid(projectOid);
if (null != tasks && tasks.size() > 0) {
return;
}
// 流程跑完了, 更新專案flag , 讓專案發佈
if (YesNo.YES.equals(confirm)) {
project.setPublishFlag(YesNo.YES);
this.degreeFeedbackProjectService.updateObject(project);
}
}
use of com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO in project bamboobsc by billchen198318.
the class DegreeFeedbackLogicServiceImpl method startProcess.
@ServiceMethodAuthority(type = { ServiceMethodType.SELECT, ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<DegreeFeedbackProjectVO> startProcess(DegreeFeedbackProjectVO project) throws ServiceException, Exception {
if (null == project || super.isBlank(project.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<DegreeFeedbackProjectVO> result = this.degreeFeedbackProjectService.findObjectByOid(project);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
project = result.getValue();
if (YesNo.YES.equals(project.getPublishFlag())) {
throw new ServiceException("The project is published, cannot start audit processing!");
}
List<BusinessProcessManagementTaskVO> tasks = this.queryTaskByVariableProjectOid(project.getOid());
if (null != tasks && tasks.size() > 0) {
throw new ServiceException("Audit processing has been started!");
}
this.startProcess(this.getProcessFlowParam(project.getOid(), YesNo.YES, "start apply." + project.getName()));
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_SUCCESS)));
return result;
}
use of com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO in project bamboobsc by billchen198318.
the class DegreeFeedbackProjectSaveOrUpdateAction method save.
private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
DegreeFeedbackProjectVO project = new DegreeFeedbackProjectVO();
this.transformFields2ValueObject(project, new String[] { "name", "year", "description" });
DefaultResult<DegreeFeedbackProjectVO> result = this.degreeFeedbackLogicService.createProject(project, this.fillItems(), this.fillLevels(), this.transformAppendIds2List(this.getFields().get("ownerOids")), this.transformAppendIds2List(this.getFields().get("raterOids")));
if (result.getValue() != null) {
this.success = IS_YES;
}
this.message = result.getSystemMessage().getValue();
}
Aggregations