Search in sources :

Example 1 with DegreeFeedbackProjectVO

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;
}
Also used : BbDegreeFeedbackProject(com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackProject) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult) DegreeFeedbackProjectVO(com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO)

Example 2 with DegreeFeedbackProjectVO

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;
}
Also used : SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) HashMap(java.util.HashMap) BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) DegreeFeedbackAssignVO(com.netsteadfast.greenstep.vo.DegreeFeedbackAssignVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) DegreeFeedbackScoreVO(com.netsteadfast.greenstep.vo.DegreeFeedbackScoreVO) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult) DegreeFeedbackProjectVO(com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with DegreeFeedbackProjectVO

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);
    }
}
Also used : BusinessProcessManagementTaskVO(com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) DegreeFeedbackProjectVO(com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 4 with DegreeFeedbackProjectVO

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;
}
Also used : BusinessProcessManagementTaskVO(com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO) SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) DegreeFeedbackProjectVO(com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with DegreeFeedbackProjectVO

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

Aggregations

DegreeFeedbackProjectVO (com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO)9 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)4 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)3 Transactional (org.springframework.transaction.annotation.Transactional)3 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)2 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)2 BusinessProcessManagementTaskVO (com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO)2 HashMap (java.util.HashMap)2 BbDegreeFeedbackLevel (com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel)1 BbDegreeFeedbackProject (com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackProject)1 BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)1 DegreeFeedbackAssignVO (com.netsteadfast.greenstep.vo.DegreeFeedbackAssignVO)1 DegreeFeedbackItemVO (com.netsteadfast.greenstep.vo.DegreeFeedbackItemVO)1 DegreeFeedbackScoreVO (com.netsteadfast.greenstep.vo.DegreeFeedbackScoreVO)1 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1