Search in sources :

Example 1 with BbEmployee

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

the class EmployeeServiceImpl method findForInKpiEmpl.

@Override
public DefaultResult<List<BbEmployee>> findForInKpiEmpl(String kpiId) throws ServiceException, Exception {
    if (StringUtils.isBlank(kpiId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    DefaultResult<List<BbEmployee>> result = new DefaultResult<List<BbEmployee>>();
    List<BbEmployee> searchList = this.employeeDAO.findForInKpiEmpl(kpiId);
    if (searchList != null && searchList.size() > 0) {
        result.setValue(searchList);
    } else {
        result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
    }
    return result;
}
Also used : BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) ArrayList(java.util.ArrayList) List(java.util.List) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult)

Example 2 with BbEmployee

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

the class EmployeeServiceImpl method findForMapByDegreeFeedbackProjectOwner.

@Override
public Map<String, String> findForMapByDegreeFeedbackProjectOwner(boolean pleaseSelect, String projectOid) throws ServiceException, Exception {
    Map<String, String> dataMap = this.providedSelectZeroDataMap(pleaseSelect);
    List<String> oids = this.findForAppendEmployeeOidsByDegreeFeedbackProjectOwner(projectOid);
    for (String oid : oids) {
        BbEmployee employee = this.findByPKng(oid);
        if (null == employee || StringUtils.isBlank(employee.getOid())) {
            logger.warn("Lost bb_employee data OID: " + oid);
            continue;
        }
        dataMap.put(employee.getOid(), employee.getEmpId() + " - " + employee.getFullName());
    }
    return dataMap;
}
Also used : BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee)

Example 3 with BbEmployee

use of com.netsteadfast.greenstep.po.hbm.BbEmployee 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 4 with BbEmployee

use of com.netsteadfast.greenstep.po.hbm.BbEmployee 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 5 with BbEmployee

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

the class LoadPdcaDataCommand method execute.

@SuppressWarnings("unchecked")
@Override
public boolean execute(Context context) throws Exception {
    pdcaService = (IPdcaService<PdcaVO, BbPdca, String>) AppContext.getBean("bsc.service.PdcaService");
    pdcaDocService = (IPdcaDocService<PdcaDocVO, BbPdcaDoc, String>) AppContext.getBean("bsc.service.PdcaDocService");
    pdcaItemService = (IPdcaItemService<PdcaItemVO, BbPdcaItem, String>) AppContext.getBean("bsc.service.PdcaItemService");
    pdcaItemDocService = (IPdcaItemDocService<PdcaItemDocVO, BbPdcaItemDoc, String>) AppContext.getBean("bsc.service.PdcaItemDocService");
    pdcaAuditService = (IPdcaAuditService<PdcaAuditVO, BbPdcaAudit, String>) AppContext.getBean("bsc.service.PdcaAuditService");
    employeeService = (IEmployeeService<EmployeeVO, BbEmployee, String>) AppContext.getBean("bsc.service.EmployeeService");
    organizationService = (IOrganizationService<OrganizationVO, BbOrganization, String>) AppContext.getBean("bsc.service.OrganizationService");
    kpiService = (IKpiService<KpiVO, BbKpi, String>) AppContext.getBean("bsc.service.KpiService");
    String pdcaOid = (String) context.get("pdcaOid");
    PdcaVO pdca = new PdcaVO();
    pdca.setOid(pdcaOid);
    DefaultResult<PdcaVO> result = pdcaService.findObjectByOid(pdca);
    if (result.getValue() == null) {
        this.setMessage(context, result.getSystemMessage().getValue());
    } else {
        pdca = result.getValue();
        this.loadDetail(pdca);
        this.loadPdcaItems(pdca);
        this.loadAudit(pdca);
        this.setResult(context, pdca);
        // Action 輸出可能會要用到
        context.put("pdca", pdca);
    }
    return false;
}
Also used : PdcaItemDocVO(com.netsteadfast.greenstep.vo.PdcaItemDocVO) PdcaDocVO(com.netsteadfast.greenstep.vo.PdcaDocVO) BbPdcaItemDoc(com.netsteadfast.greenstep.po.hbm.BbPdcaItemDoc) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) BbPdcaDoc(com.netsteadfast.greenstep.po.hbm.BbPdcaDoc) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) BbKpi(com.netsteadfast.greenstep.po.hbm.BbKpi) BbPdcaAudit(com.netsteadfast.greenstep.po.hbm.BbPdcaAudit) BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) BbOrganization(com.netsteadfast.greenstep.po.hbm.BbOrganization) PdcaVO(com.netsteadfast.greenstep.vo.PdcaVO) BbPdca(com.netsteadfast.greenstep.po.hbm.BbPdca) PdcaItemVO(com.netsteadfast.greenstep.vo.PdcaItemVO) BbPdcaItem(com.netsteadfast.greenstep.po.hbm.BbPdcaItem) PdcaAuditVO(com.netsteadfast.greenstep.vo.PdcaAuditVO)

Aggregations

BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)11 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)8 HashMap (java.util.HashMap)5 BbOrganization (com.netsteadfast.greenstep.po.hbm.BbOrganization)3 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)3 List (java.util.List)3 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)2 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)2 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)2 DegreeFeedbackAssignVO (com.netsteadfast.greenstep.vo.DegreeFeedbackAssignVO)2 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)2 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)2 ArrayList (java.util.ArrayList)2 LinkedHashMap (java.util.LinkedHashMap)2 IEmployeeService (com.netsteadfast.greenstep.bsc.service.IEmployeeService)1 IOrganizationService (com.netsteadfast.greenstep.bsc.service.IOrganizationService)1 IVisionService (com.netsteadfast.greenstep.bsc.service.IVisionService)1 BscApiServiceResponse (com.netsteadfast.greenstep.bsc.vo.BscApiServiceResponse)1 BbDegreeFeedbackLevel (com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel)1 BbKpi (com.netsteadfast.greenstep.po.hbm.BbKpi)1