Search in sources :

Example 31 with OrganizationVO

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

the class CommonOrgChartAction method createOrgChartDataForOrganization2.

private void createOrgChartDataForOrganization2() throws ControllerException, AuthorityException, ServiceException, Exception {
    OrganizationVO organization = new OrganizationVO();
    organization = this.transformFields2ValueObject(organization, "oid");
    DefaultResult<Map<String, Object>> result = this.organizationLogicService.getOrgChartData(ApplicationSiteUtils.getBasePath(Constants.getMainSystem(), this.getHttpServletRequest()), organization);
    this.rootData = result.getValue();
    this.message = result.getSystemMessage().getValue();
    if (this.rootData != null && this.rootData.size() > 0) {
        this.success = IS_YES;
    }
}
Also used : OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) HashMap(java.util.HashMap) Map(java.util.Map)

Example 32 with OrganizationVO

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

the class MeasureDataCalendarUtils method findOrganization.

private static OrganizationVO findOrganization(String orgOid) throws ServiceException, Exception {
    OrganizationVO organization = new OrganizationVO();
    organization.setOid(orgOid);
    DefaultResult<OrganizationVO> result = organizationService.findObjectByOid(organization);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    organization = result.getValue();
    return organization;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Example 33 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO 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;
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) HashMap(java.util.HashMap) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Example 34 with OrganizationVO

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

the class PerformanceScoreChainUtils method createOrUpdateMonitorItemScoreCurrentDateForOrganizations.

public static void createOrUpdateMonitorItemScoreCurrentDateForOrganizations(String frequency) throws ServiceException, Exception {
    Map<String, String> organizationMap = organizationService.findForMap(false);
    if (null == organizationMap || organizationMap.size() < 1) {
        return;
    }
    Map<String, Object> paramMap = new HashMap<String, Object>();
    for (Map.Entry<String, String> org : organizationMap.entrySet()) {
        OrganizationVO organization = BscBaseLogicServiceCommonSupport.findOrganizationData(organizationService, org.getKey());
        paramMap.put("orgId", organization.getOrgId());
        if (kpiOrgaService.countByParams(paramMap) < 1) {
            continue;
        }
        try {
            createOrUpdateMonitorItemScoreCurrentDate(frequency, "organization", organization.getOid(), "");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Also used : HashMap(java.util.HashMap) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) HashMap(java.util.HashMap) Map(java.util.Map) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 35 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO 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;
}
Also used : AppContext(com.netsteadfast.greenstep.base.AppContext) Context(org.apache.commons.chain.Context) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) ContextBase(org.apache.commons.chain.impl.ContextBase)

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