use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class ApiWebServiceImpl method getScorecard2.
@WebMethod
@GET
@Path("/scorecard2/")
@Override
public BscApiServiceResponse getScorecard2(@WebParam(name = "visionId") @QueryParam("visionId") String visionId, @WebParam(name = "startDate") @QueryParam("startDate") String startDate, @WebParam(name = "endDate") @QueryParam("endDate") String endDate, @WebParam(name = "startYearDate") @QueryParam("startYearDate") String startYearDate, @WebParam(name = "endYearDate") @QueryParam("endYearDate") String endYearDate, @WebParam(name = "frequency") @QueryParam("frequency") String frequency, @WebParam(name = "dataFor") @QueryParam("dataFor") String dataFor, @WebParam(name = "measureDataOrganizationId") @QueryParam("measureDataOrganizationId") String measureDataOrganizationId, @WebParam(name = "measureDataEmployeeId") @QueryParam("measureDataEmployeeId") String measureDataEmployeeId, @WebParam(name = "contentFlag") @QueryParam("contentFlag") String contentFlag) throws Exception {
HttpServletRequest request = null;
if (this.getWebServiceContext() != null && this.getWebServiceContext().getMessageContext() != null) {
request = (HttpServletRequest) this.getWebServiceContext().getMessageContext().get(MessageContext.SERVLET_REQUEST);
}
Subject subject = null;
BscApiServiceResponse responseObj = new BscApiServiceResponse();
responseObj.setSuccess(YesNo.NO);
try {
subject = WsAuthenticateUtils.login();
@SuppressWarnings("unchecked") IVisionService<VisionVO, BbVision, String> visionService = (IVisionService<VisionVO, BbVision, String>) AppContext.getBean("bsc.service.VisionService");
@SuppressWarnings("unchecked") IEmployeeService<EmployeeVO, BbEmployee, String> employeeService = (IEmployeeService<EmployeeVO, BbEmployee, String>) AppContext.getBean("bsc.service.EmployeeService");
@SuppressWarnings("unchecked") IOrganizationService<OrganizationVO, BbOrganization, String> organizationService = (IOrganizationService<OrganizationVO, BbOrganization, String>) AppContext.getBean("bsc.service.OrganizationService");
String visionOid = "";
String measureDataOrganizationOid = "";
String measureDataEmployeeOid = "";
DefaultResult<VisionVO> visionResult = visionService.findForSimpleByVisId(visionId);
if (visionResult.getValue() == null) {
throw new Exception(visionResult.getSystemMessage().getValue());
}
visionOid = visionResult.getValue().getOid();
if (StringUtils.isBlank(measureDataOrganizationId)) {
measureDataOrganizationOid = BscBaseLogicServiceCommonSupport.findEmployeeDataByEmpId(employeeService, measureDataOrganizationId).getOid();
}
if (StringUtils.isBlank(measureDataEmployeeId)) {
measureDataEmployeeOid = BscBaseLogicServiceCommonSupport.findOrganizationDataByUK(organizationService, measureDataEmployeeId).getOid();
}
this.processForScorecard(responseObj, request, visionOid, startDate, endDate, startYearDate, endYearDate, frequency, dataFor, measureDataOrganizationOid, measureDataEmployeeOid, contentFlag);
} catch (Exception e) {
responseObj.setMessage(e.getMessage());
} finally {
if (!YesNo.YES.equals(responseObj.getSuccess())) {
responseObj.setMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
}
WsAuthenticateUtils.logout(subject);
}
subject = null;
return responseObj;
}
use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class HistoryItemScoreReportContentQueryAction method getContent.
@SuppressWarnings("unchecked")
private void getContent() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
this.newDateVal = this.getChangeDateVal();
String frequency = this.getFields().get("frequency");
String measureDataTypeName = BscConstants.MEASURE_DATA_FOR_ALL;
String empId = BscConstants.MEASURE_DATA_EMPLOYEE_FULL;
String orgId = BscConstants.MEASURE_DATA_ORGANIZATION_FULL;
String measureDataOrganizationOid = this.getFields().get("measureDataOrganizationOid");
String measureDataEmployeeOid = this.getFields().get("measureDataEmployeeOid");
String dataFor = this.getFields().get("dataFor");
if ("organization".equals(dataFor) && !super.isNoSelectId(measureDataOrganizationOid)) {
OrganizationVO organization = new OrganizationVO();
organization.setOid(measureDataOrganizationOid);
DefaultResult<OrganizationVO> result = this.organizationService.findObjectByOid(organization);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
organization = result.getValue();
orgId = organization.getOrgId();
measureDataTypeName = organization.getOrgId() + " - " + organization.getName();
}
if ("employee".equals(dataFor) && !super.isNoSelectId(measureDataEmployeeOid)) {
EmployeeVO employee = new EmployeeVO();
employee.setOid(measureDataEmployeeOid);
DefaultResult<EmployeeVO> result = this.employeeService.findObjectByOid(employee);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
employee = result.getValue();
empId = employee.getEmpId();
measureDataTypeName = employee.getEmpId() + " - " + employee.getFullName();
}
if ("line".equals(this.getFields().get("chartType"))) {
// Line chart
this.chartData = HistoryItemScoreReportContentQueryUtils.getLineChartData(this.getFields().get("itemType"), frequency, this.newDateVal, orgId, empId);
if (this.chartData == null || this.chartData.size() < 1) {
super.throwMessage("itemType", SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
}
this.chartCategories = HistoryItemScoreReportContentQueryUtils.getLineChartCategoriesFromData(this.newDateVal, this.chartData);
this.subtitle = "Frequency: " + BscMeasureDataFrequency.getFrequencyMap(false).get(frequency) + ", " + "Date range: " + this.chartCategories.get(0) + " ~ " + this.getChartCategories().get(this.getChartCategories().size() - 1) + ", " + "Measure-data for: " + measureDataTypeName;
this.startDate = this.chartCategories.get(0);
this.endDate = this.getChartCategories().get(this.getChartCategories().size() - 1);
this.success = IS_YES;
} else {
// Heat map chart
Map<String, Object> chartDataMap = HistoryItemScoreReportContentQueryUtils.getHartMapChartData(this.getFields().get("itemType"), frequency, this.newDateVal, orgId, empId);
if (chartDataMap == null || chartDataMap.size() != 3) {
super.throwMessage("itemType", SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
}
this.heatMapChartData = (List<List<Object>>) chartDataMap.get("seriesData");
this.xAxisCategories = (List<String>) chartDataMap.get("xAxisCategories");
this.yAxisCategories = (List<String>) chartDataMap.get("yAxisCategories");
this.subtitle = "Frequency: " + BscMeasureDataFrequency.getFrequencyMap(false).get(frequency) + ", " + "Date range: " + this.yAxisCategories.get(0) + " ~ " + this.yAxisCategories.get(this.yAxisCategories.size() - 1) + ", " + "Measure-data for: " + measureDataTypeName;
this.startDate = this.yAxisCategories.get(0);
this.endDate = this.yAxisCategories.get(this.yAxisCategories.size() - 1);
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class CommonOrgChartAction method createOrgChartDataForEmployee.
@SuppressWarnings("unused")
private void createOrgChartDataForEmployee() throws ControllerException, AuthorityException, ServiceException, Exception {
EmployeeVO employee = new EmployeeVO();
employee = this.transformFields2ValueObject(employee, "oid");
DefaultResult<String> result = this.employeeLogicService.createOrgChartData(ApplicationSiteUtils.getBasePath(Constants.getMainSystem(), this.getHttpServletRequest()), employee);
this.uploadOid = super.defaultString(result.getValue());
this.message = result.getSystemMessage().getValue();
if (!StringUtils.isBlank(this.uploadOid)) {
this.loadOrgChartData(this.uploadOid);
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class MeasureDataCalendarUtils method getParameter.
private static Map<String, Object> getParameter(KpiVO kpi, FormulaVO formula, String date, String frequency, String dataFor, String orgaOid, String emplOid) throws ServiceException, Exception {
Map<String, Object> parameter = new HashMap<String, Object>();
parameter.put("date", date);
parameter.put("frequency", frequency);
parameter.put("dataFor", dataFor);
parameter.put("kpi", kpi);
parameter.put("formula", formula);
parameter.put("managementName", BscKpiCode.getManagementMap(false).get(kpi.getManagement()));
//parameter.put("calculationName", BscKpiCode.getCalculationMap(false).get(kpi.getCal()) );
parameter.put("calculationName", AggregationMethodUtils.getNameByAggrId(kpi.getCal()));
parameter.put("orgId", BscConstants.MEASURE_DATA_ORGANIZATION_FULL);
parameter.put("empId", BscConstants.MEASURE_DATA_EMPLOYEE_FULL);
if (BscConstants.MEASURE_DATA_FOR_ORGANIZATION.equals(dataFor)) {
OrganizationVO organization = findOrganization(orgaOid);
parameter.put("orgId", organization.getOrgId());
}
if (BscConstants.MEASURE_DATA_FOR_EMPLOYEE.equals(dataFor)) {
EmployeeVO employee = findEmployee(emplOid);
parameter.put("empId", employee.getEmpId());
}
parameter.put("masureDatas", findMeasureData(kpi, date, frequency, dataFor, (String) parameter.get("orgId"), (String) parameter.get("empId")));
return parameter;
}
use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class PerformanceScoreChainUtils method getContext.
public static Context getContext(String visionOid, String startDate, String endDate, String startYearDate, String endYearDate, String frequency, String dataFor, String measureDataOrganizationOid, String measureDataEmployeeOid) throws ServiceException, Exception {
Context context = new ContextBase();
context.put("visionOid", visionOid);
context.put("startDate", startDate);
context.put("endDate", endDate);
context.put("startYearDate", startYearDate);
context.put("endYearDate", endYearDate);
context.put("frequency", frequency);
context.put("dataFor", dataFor);
context.put("orgId", BscConstants.MEASURE_DATA_ORGANIZATION_FULL);
context.put("empId", BscConstants.MEASURE_DATA_EMPLOYEE_FULL);
context.put("account", "");
if (!Constants.HTML_SELECT_NO_SELECT_ID.equals(measureDataOrganizationOid) && !StringUtils.isBlank(measureDataOrganizationOid)) {
OrganizationVO organization = new OrganizationVO();
organization.setOid(measureDataOrganizationOid);
DefaultResult<OrganizationVO> result = organizationService.findObjectByOid(organization);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
organization = result.getValue();
context.put("orgId", organization.getOrgId());
}
if (!Constants.HTML_SELECT_NO_SELECT_ID.equals(measureDataEmployeeOid) && !StringUtils.isBlank(measureDataEmployeeOid)) {
EmployeeVO employee = new EmployeeVO();
employee.setOid(measureDataEmployeeOid);
DefaultResult<EmployeeVO> result = employeeService.findObjectByOid(employee);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
employee = result.getValue();
context.put("empId", employee.getEmpId());
context.put("account", employee.getAccount());
}
return context;
}
Aggregations