Search in sources :

Example 6 with BbEmployee

use of com.netsteadfast.greenstep.po.hbm.BbEmployee in project bamboobsc by billchen198318.

the class BscBaseLogicServiceCommonSupport method findEmployeeDataByAccountId.

public static EmployeeVO findEmployeeDataByAccountId(IEmployeeService<EmployeeVO, BbEmployee, String> service, String accountId) throws ServiceException, Exception {
    if (StringUtils.isBlank(accountId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    BbEmployee poEmployee = service.findByAccountId(accountId);
    EmployeeVO employeeObj = new EmployeeVO();
    service.doMapper(poEmployee, employeeObj, IEmployeeService.MAPPER_ID_PO2VO);
    return employeeObj;
}
Also used : BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 7 with BbEmployee

use of com.netsteadfast.greenstep.po.hbm.BbEmployee in project bamboobsc by billchen198318.

the class EmployeeServiceImpl method findForMap.

@Override
public Map<String, String> findForMap(boolean pleaseSelect) throws ServiceException, Exception {
    Map<String, String> dataMap = this.providedSelectZeroDataMap(pleaseSelect);
    Map<String, String> orderParams = new HashMap<String, String>();
    orderParams.put("empId", "asc");
    List<BbEmployee> searchList = this.findListByParams(null, null, orderParams);
    for (BbEmployee employee : searchList) {
        dataMap.put(employee.getOid(), employee.getFullName());
    }
    return dataMap;
}
Also used : BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) HashMap(java.util.HashMap)

Example 8 with BbEmployee

use of com.netsteadfast.greenstep.po.hbm.BbEmployee in project bamboobsc by billchen198318.

the class ReportRoleViewLogicServiceImpl method findForEmployeeMap.

@ServiceMethodAuthority(type = { ServiceMethodType.SELECT })
@Override
public Map<String, String> findForEmployeeMap(boolean pleaseSelect, String accountId) throws ServiceException, Exception {
    if (super.isBlank(accountId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    Map<String, String> dataMap = new LinkedHashMap<String, String>();
    if (pleaseSelect) {
        dataMap.put(Constants.HTML_SELECT_NO_SELECT_ID, Constants.HTML_SELECT_NO_SELECT_NAME);
    }
    List<TbUserRole> roles = this.getUserRoles(accountId);
    for (int i = 0; roles != null && i < roles.size(); i++) {
        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("role", roles.get(i).getRole());
        paramMap.put("type", ReportRoleViewTypes.IS_EMPLOYEE);
        List<BbReportRoleView> views = this.reportRoleViewService.findListByParams(paramMap);
        for (int j = 0; views != null && j < views.size(); j++) {
            paramMap.clear();
            paramMap.put("account", views.get(j).getIdName());
            List<BbEmployee> employees = this.getEmployeeService().findListByParams(paramMap);
            for (int e = 0; employees != null && e < employees.size(); e++) {
                BbEmployee employee = employees.get(e);
                if (dataMap.get(employee.getOid()) != null) {
                    continue;
                }
                dataMap.put(employee.getOid(), employee.getFullName());
            }
        }
    }
    return dataMap;
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) BbReportRoleView(com.netsteadfast.greenstep.po.hbm.BbReportRoleView) TbUserRole(com.netsteadfast.greenstep.po.hbm.TbUserRole) LinkedHashMap(java.util.LinkedHashMap) BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)

Example 9 with BbEmployee

use of com.netsteadfast.greenstep.po.hbm.BbEmployee 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;
}
Also used : IVisionService(com.netsteadfast.greenstep.bsc.service.IVisionService) IOrganizationService(com.netsteadfast.greenstep.bsc.service.IOrganizationService) BbVision(com.netsteadfast.greenstep.po.hbm.BbVision) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO) Subject(org.apache.shiro.subject.Subject) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) HttpServletRequest(javax.servlet.http.HttpServletRequest) BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) BscApiServiceResponse(com.netsteadfast.greenstep.bsc.vo.BscApiServiceResponse) BbOrganization(com.netsteadfast.greenstep.po.hbm.BbOrganization) IEmployeeService(com.netsteadfast.greenstep.bsc.service.IEmployeeService) WebMethod(javax.jws.WebMethod) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 10 with BbEmployee

use of com.netsteadfast.greenstep.po.hbm.BbEmployee in project bamboobsc by billchen198318.

the class CommonLoadDataAction method loadMeasureDataOptions.

private void loadMeasureDataOptions() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.transformFields2ValueObject(this.kpi, new String[] { "oid" });
    DefaultResult<KpiVO> result = this.kpiService.findObjectByOid(kpi);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.kpi = result.getValue();
    DefaultResult<List<BbOrganization>> orgResult = this.organizationService.findForInKpiOrga(this.kpi.getId());
    DefaultResult<List<BbEmployee>> empResult = this.employeeService.findForInKpiEmpl(this.kpi.getId());
    Map<String, String> firstMap = new HashMap<String, String>();
    firstMap.put("key", Constants.HTML_SELECT_NO_SELECT_ID);
    firstMap.put("value", Constants.HTML_SELECT_NO_SELECT_NAME);
    this.resetPleaseSelectDataMapFromLocaleLang(firstMap);
    this.kpiOrga.add(firstMap);
    this.kpiEmpl.add(firstMap);
    if (orgResult.getValue() != null) {
        for (BbOrganization organization : orgResult.getValue()) {
            Map<String, String> dataMap = new HashMap<String, String>();
            dataMap.put("key", organization.getOid());
            dataMap.put("value", organization.getName());
            this.kpiOrga.add(dataMap);
        }
    }
    if (empResult.getValue() != null) {
        for (BbEmployee employee : empResult.getValue()) {
            Map<String, String> dataMap = new HashMap<String, String>();
            dataMap.put("key", employee.getOid());
            dataMap.put("value", employee.getFullName());
            this.kpiEmpl.add(dataMap);
        }
    }
    this.success = IS_YES;
}
Also used : BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) HashMap(java.util.HashMap) BbOrganization(com.netsteadfast.greenstep.po.hbm.BbOrganization) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) LinkedList(java.util.LinkedList) List(java.util.List)

Aggregations

BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)11 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)8 HashMap (java.util.HashMap)5 BbOrganization (com.netsteadfast.greenstep.po.hbm.BbOrganization)3 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)3 List (java.util.List)3 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)2 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)2 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)2 DegreeFeedbackAssignVO (com.netsteadfast.greenstep.vo.DegreeFeedbackAssignVO)2 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)2 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)2 ArrayList (java.util.ArrayList)2 LinkedHashMap (java.util.LinkedHashMap)2 IEmployeeService (com.netsteadfast.greenstep.bsc.service.IEmployeeService)1 IOrganizationService (com.netsteadfast.greenstep.bsc.service.IOrganizationService)1 IVisionService (com.netsteadfast.greenstep.bsc.service.IVisionService)1 BscApiServiceResponse (com.netsteadfast.greenstep.bsc.vo.BscApiServiceResponse)1 BbDegreeFeedbackLevel (com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackLevel)1 BbKpi (com.netsteadfast.greenstep.po.hbm.BbKpi)1