use of com.netsteadfast.greenstep.base.model.DefaultResult in project bamboobsc by billchen198318.
the class VisionServiceImpl method findForSimpleByVisId.
@Override
public DefaultResult<VisionVO> findForSimpleByVisId(String visId) throws ServiceException, Exception {
if (StringUtils.isBlank(visId)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<VisionVO> result = new DefaultResult<VisionVO>();
VisionVO vision = this.visionDAO.findForSimpleByVisId(visId);
if (vision != null) {
result.setValue(vision);
} else {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
}
return result;
}
use of com.netsteadfast.greenstep.base.model.DefaultResult in project bamboobsc by billchen198318.
the class KpiServiceImpl method findForMixData.
@Override
public DefaultResult<List<BscMixDataVO>> findForMixData(String visionOid, String orgId, String empId, String nextType, String nextId, List<String> kpiIds) throws ServiceException, Exception {
DefaultResult<List<BscMixDataVO>> result = new DefaultResult<List<BscMixDataVO>>();
List<BscMixDataVO> searchList = this.kpiDAO.findForMixData(this.getMixDataQueryParam(visionOid, orgId, empId, nextType, nextId, kpiIds));
if (null != searchList && searchList.size() > 0) {
result.setValue(searchList);
} else {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
}
return result;
}
use of com.netsteadfast.greenstep.base.model.DefaultResult in project bamboobsc by billchen198318.
the class EmployeeLogicServiceImpl method createOrgChartData.
/**
* 這個 Method 的 ServiceMethodAuthority 權限給查詢狀態
* 這裡的 basePath 只是要取 getTreeData 時參數要用, 再這是沒有用處的
*/
@ServiceMethodAuthority(type = { ServiceMethodType.SELECT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<String> createOrgChartData(String basePath, EmployeeVO currentEmployee) throws ServiceException, Exception {
if (null != currentEmployee && !super.isBlank(currentEmployee.getOid())) {
currentEmployee = this.findEmployeeData(currentEmployee.getOid());
}
List<Map<String, Object>> treeMap = this.getTreeData(basePath);
if (null == treeMap || treeMap.size() < 1) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
}
this.resetTreeMapContentForOrgChartData(treeMap, currentEmployee);
Map<String, Object> rootMap = new HashMap<String, Object>();
rootMap.put("name", "Employee hierarchy");
rootMap.put("title", "hierarchy structure");
rootMap.put("children", treeMap);
ObjectMapper objectMapper = new ObjectMapper();
String jsonData = objectMapper.writeValueAsString(rootMap);
String uploadOid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, jsonData.getBytes(), SimpleUtils.getUUIDStr() + ".json");
DefaultResult<String> result = new DefaultResult<String>();
result.setValue(uploadOid);
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.INSERT_SUCCESS)));
return result;
}
use of com.netsteadfast.greenstep.base.model.DefaultResult in project bamboobsc by billchen198318.
the class EmployeeLogicServiceImpl method getOrgChartData.
/**
* 這個 Method 的 ServiceMethodAuthority 權限給查詢狀態
* 這裡的 basePath 只是要取 getTreeData 時參數要用, 再這是沒有用處的
*/
@ServiceMethodAuthority(type = { ServiceMethodType.SELECT })
@Override
public DefaultResult<Map<String, Object>> getOrgChartData(String basePath, EmployeeVO currentEmployee) throws ServiceException, Exception {
if (null != currentEmployee && !super.isBlank(currentEmployee.getOid())) {
currentEmployee = this.findEmployeeData(currentEmployee.getOid());
}
List<Map<String, Object>> treeMap = this.getTreeData(basePath);
if (null == treeMap || treeMap.size() < 1) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
}
this.resetTreeMapContentForOrgChartData(treeMap, currentEmployee);
Map<String, Object> rootMap = new HashMap<String, Object>();
rootMap.put("name", "Employee hierarchy");
rootMap.put("title", "hierarchy structure");
rootMap.put("children", treeMap);
DefaultResult<Map<String, Object>> result = new DefaultResult<Map<String, Object>>();
result.setValue(rootMap);
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.INSERT_SUCCESS)));
return result;
}
use of com.netsteadfast.greenstep.base.model.DefaultResult in project bamboobsc by billchen198318.
the class OrganizationLogicServiceImpl method createOrgChartData.
/**
* 這個 Method 的 ServiceMethodAuthority 權限給查詢狀態
* 這裡的 basePath 只是要取 getTreeData 時參數要用, 再這是沒有用處的
*/
@ServiceMethodAuthority(type = { ServiceMethodType.SELECT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<String> createOrgChartData(String basePath, OrganizationVO currentOrganization) throws ServiceException, Exception {
if (null != currentOrganization && !super.isBlank(currentOrganization.getOid())) {
currentOrganization = this.findOrganizationData(currentOrganization.getOid());
}
List<Map<String, Object>> treeMap = this.getTreeData(basePath, false, "");
if (null == treeMap || treeMap.size() < 1) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
}
this.resetTreeMapContentForOrgChartData(treeMap, currentOrganization);
Map<String, Object> rootMap = new HashMap<String, Object>();
rootMap.put("name", "Organization / Department hierarchy");
rootMap.put("title", "hierarchy structure");
rootMap.put("children", treeMap);
ObjectMapper objectMapper = new ObjectMapper();
String jsonData = objectMapper.writeValueAsString(rootMap);
String uploadOid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, jsonData.getBytes(), SimpleUtils.getUUIDStr() + ".json");
DefaultResult<String> result = new DefaultResult<String>();
result.setValue(uploadOid);
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.INSERT_SUCCESS)));
return result;
}
Aggregations