Search in sources :

Example 1 with BbOrganization

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

the class OrganizationServiceImpl method findForInKpiOrga.

@Override
public DefaultResult<List<BbOrganization>> findForInKpiOrga(String kpiId) throws ServiceException, Exception {
    if (StringUtils.isBlank(kpiId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    DefaultResult<List<BbOrganization>> result = new DefaultResult<List<BbOrganization>>();
    List<BbOrganization> searchList = this.organizationDAO.findForInKpiOrga(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 : SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) BbOrganization(com.netsteadfast.greenstep.po.hbm.BbOrganization) ArrayList(java.util.ArrayList) List(java.util.List) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult)

Example 2 with BbOrganization

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

the class OrganizationServiceImpl method findForMap.

@Override
public Map<String, String> findForMap(boolean pleaseSelect) throws ServiceException, Exception {
    Map<String, String> dataMap = this.providedSelectZeroDataMap(pleaseSelect);
    Map<String, String> orderParams = new HashMap<String, String>();
    orderParams.put("orgId", "asc");
    List<BbOrganization> organizationList = this.findListByParams(null, null, orderParams);
    for (BbOrganization organization : organizationList) {
        dataMap.put(organization.getOid(), organization.getName());
    }
    return dataMap;
}
Also used : HashMap(java.util.HashMap) BbOrganization(com.netsteadfast.greenstep.po.hbm.BbOrganization)

Example 3 with BbOrganization

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

the class ReportRoleViewLogicServiceImpl method findForOrganization.

@ServiceMethodAuthority(type = { ServiceMethodType.SELECT })
@Override
public List<BbOrganization> findForOrganization(String accountId) throws ServiceException, Exception {
    if (super.isBlank(accountId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    List<BbOrganization> searchList = new ArrayList<BbOrganization>();
    List<TbUserRole> roles = this.getUserRoles(accountId);
    for (int i = 0; roles != null && i < roles.size(); i++) {
        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("role", roles.get(i).getRole());
        paramMap.put("type", ReportRoleViewTypes.IS_ORGANIZATION);
        List<BbReportRoleView> views = this.reportRoleViewService.findListByParams(paramMap);
        for (int j = 0; views != null && j < views.size(); j++) {
            BbOrganization organization = new BbOrganization();
            organization.setOrgId(views.get(j).getIdName());
            organization = this.getOrganizationService().findByEntityUK(organization);
            if (organization == null) {
                continue;
            }
            boolean isFound = false;
            for (BbOrganization entity : searchList) {
                if (entity.getOid().equals(organization.getOid())) {
                    isFound = true;
                }
            }
            if (!isFound) {
                searchList.add(organization);
            }
        }
    }
    return searchList;
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) ArrayList(java.util.ArrayList) BbReportRoleView(com.netsteadfast.greenstep.po.hbm.BbReportRoleView) TbUserRole(com.netsteadfast.greenstep.po.hbm.TbUserRole) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) BbOrganization(com.netsteadfast.greenstep.po.hbm.BbOrganization) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)

Example 4 with BbOrganization

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

the class ReportRoleViewLogicServiceImpl method findForOrganizationMap.

@ServiceMethodAuthority(type = { ServiceMethodType.SELECT })
@Override
public Map<String, String> findForOrganizationMap(boolean pleaseSelect, String accountId) throws ServiceException, Exception {
    if (super.isBlank(accountId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    Map<String, String> dataMap = new LinkedHashMap<String, String>();
    if (pleaseSelect) {
        dataMap.put(Constants.HTML_SELECT_NO_SELECT_ID, Constants.HTML_SELECT_NO_SELECT_NAME);
    }
    /*
		List<TbUserRole> roles = this.getUserRoles(accountId);
		for (int i=0; roles!=null && i<roles.size(); i++) {
			Map<String, Object> paramMap = new HashMap<String, Object>();
			paramMap.put("role", roles.get(i).getRole());
			paramMap.put("type", ReportRoleViewTypes.IS_ORGANIZATION);
			List<BbReportRoleView> views = this.reportRoleViewService.findListByParams(paramMap);
			for (int j=0; views!=null && j<views.size(); j++) {
				BbOrganization organization = new BbOrganization();
				organization.setOrgId(views.get(j).getIdName());
				organization = this.organizationService.findByEntityUK(organization);
				if ( organization == null ) {
					continue;
				}
				if ( dataMap.get(organization.getOid()) != null ) {
					continue;
				}
				dataMap.put(organization.getOid(), organization.getName());				
			}
		}		
		*/
    List<BbOrganization> organizations = this.findForOrganization(accountId);
    for (BbOrganization entity : organizations) {
        if (dataMap.get(entity.getOid()) != null) {
            continue;
        }
        dataMap.put(entity.getOid(), entity.getName());
    }
    return dataMap;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) BbOrganization(com.netsteadfast.greenstep.po.hbm.BbOrganization) LinkedHashMap(java.util.LinkedHashMap) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)

Example 5 with BbOrganization

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

BbOrganization (com.netsteadfast.greenstep.po.hbm.BbOrganization)7 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)5 BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)3 HashMap (java.util.HashMap)3 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)2 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)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 List (java.util.List)2 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)1 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)1 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 BbKpi (com.netsteadfast.greenstep.po.hbm.BbKpi)1 BbPdca (com.netsteadfast.greenstep.po.hbm.BbPdca)1 BbPdcaAudit (com.netsteadfast.greenstep.po.hbm.BbPdcaAudit)1