Search in sources :

Example 21 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.

the class BscBaseLogicServiceCommonSupport method findOrganizationData.

public static OrganizationVO findOrganizationData(IOrganizationService<OrganizationVO, BbOrganization, String> service, String oid) throws ServiceException, Exception {
    if (StringUtils.isBlank(oid)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    OrganizationVO organization = new OrganizationVO();
    organization.setOid(oid);
    DefaultResult<OrganizationVO> orgResult = service.findObjectByOid(organization);
    if (orgResult.getValue() == null) {
        throw new ServiceException(orgResult.getSystemMessage().getValue());
    }
    organization = orgResult.getValue();
    return organization;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Example 22 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.

the class SwotDataProvideCommand method findOrganization.

private OrganizationVO findOrganization(String oid) throws Exception {
    OrganizationVO organization = new OrganizationVO();
    organization.setOid(oid);
    DefaultResult<OrganizationVO> result = this.organizationService.findObjectByOid(organization);
    if (result.getValue() == null) {
        return organization;
    }
    organization = result.getValue();
    return organization;
}
Also used : OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Example 23 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.

the class KpiLogicServiceImpl method createKpiOrganization.

private void createKpiOrganization(KpiVO kpi, List<String> organizationOids) throws ServiceException, Exception {
    if (kpi == null || organizationOids == null || organizationOids.size() < 1) {
        return;
    }
    for (String oid : organizationOids) {
        OrganizationVO organization = this.findOrganizationData(oid);
        KpiOrgaVO kpiOrga = new KpiOrgaVO();
        kpiOrga.setKpiId(kpi.getId());
        kpiOrga.setOrgId(organization.getOrgId());
        this.kpiOrgaService.saveObject(kpiOrga);
    }
}
Also used : OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) KpiOrgaVO(com.netsteadfast.greenstep.vo.KpiOrgaVO)

Example 24 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.

the class OrganizationLogicServiceImpl method getTreeData.

/**
	 * 為了組織架構 tree 的呈現用, json 資料
	 * 產生 MAP 與 LIST
	 * 
	 * @param putObject
	 * @param searchList
	 * @param parentOrgId
	 * @throws Exception
	 */
@SuppressWarnings("unchecked")
private void getTreeData(String basePath, boolean checkBox, String appendId, Map<String, Object> putObject, List<OrganizationVO> searchList, String parentOrgId) throws Exception {
    List<String> childList = new LinkedList<String>();
    this.getChildOrgIdLevelOne(searchList, parentOrgId, childList);
    if (childList.size() < 1) {
        return;
    }
    for (String childOrgId : childList) {
        OrganizationVO organization = this.getOrganizationFromSearchList(searchList, childOrgId, false);
        OrganizationVO childOrganization = this.getOrganizationFromSearchList(searchList, childOrgId, true);
        if (organization == null) {
            continue;
        }
        Map<String, Object> thePutObject = null;
        List<Map<String, Object>> childrenList = (List<Map<String, Object>>) putObject.get("children");
        if (childrenList == null) {
            childrenList = new LinkedList<Map<String, Object>>();
        }
        Map<String, Object> nodeMap = new LinkedHashMap<String, Object>();
        nodeMap.put("id", organization.getOid());
        nodeMap.put("name", (checkBox ? getCheckBoxHtmlContent(organization, appendId) : "") + IconUtils.getMenuIcon(basePath, TREE_ICON_ID) + StringEscapeUtils.escapeHtml4(organization.getName()));
        nodeMap.put("orgId", organization.getOrgId());
        childrenList.add(nodeMap);
        putObject.put("children", childrenList);
        if (childOrganization != null) {
            thePutObject = nodeMap;
        } else {
            nodeMap.put("type", "Leaf");
            thePutObject = putObject;
        }
        if (childOrganization != null) {
            this.getTreeData(basePath, checkBox, appendId, thePutObject, searchList, childOrgId);
        }
    }
}
Also used : OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) List(java.util.List) LinkedList(java.util.LinkedList) Map(java.util.Map) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) LinkedList(java.util.LinkedList) LinkedHashMap(java.util.LinkedHashMap)

Example 25 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.

the class OrganizationLogicServiceImpl method getChild.

/**
	 * 去找查出的 BB_ORGANIZATION inner join BB_ORGANIZATION_PAR 資料tree 中的父部門為 parentId 的資料都放入 put 中
	 * 等於找出 parentId 的所有子部門資料
	 * 
	 * @param parentId 		要找的 ORG_ID
	 * @param tree			當前的 BB_ORGANIZATION inner join BB_ORGANIZATION_PAR 資料
	 * @param put			要放入 parentId 的相關子部門
	 * @throws Exception
	 */
private void getChild(String parentId, List<OrganizationVO> tree, List<OrganizationVO> put) throws Exception {
    if (put == null || tree == null) {
        return;
    }
    if (StringUtils.isBlank(parentId) || BscConstants.ORGANIZATION_ZERO_ID.equals(parentId)) {
        return;
    }
    for (OrganizationVO org : tree) {
        if (org.getParId().equals(parentId)) {
            put.add(org);
            this.getChild(org.getOrgId(), tree, put);
        }
    }
}
Also used : OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Aggregations

OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)42 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)17 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)15 HashMap (java.util.HashMap)11 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)5 Map (java.util.Map)5 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)4 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)3 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)3 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)3 List (java.util.List)3 Context (org.apache.commons.chain.Context)3 ContextBase (org.apache.commons.chain.impl.ContextBase)3 Transactional (org.springframework.transaction.annotation.Transactional)3 BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)2 BbOrganization (com.netsteadfast.greenstep.po.hbm.BbOrganization)2 BbPdcaDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaDoc)2 BbPdcaItem (com.netsteadfast.greenstep.po.hbm.BbPdcaItem)2 BbPdcaItemDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaItemDoc)2 PdcaDocVO (com.netsteadfast.greenstep.vo.PdcaDocVO)2