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;
}
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;
}
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);
}
}
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);
}
}
}
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);
}
}
}
Aggregations