Search in sources :

Example 46 with EmployeeVO

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

the class PersonalReportContentQueryAction method getChainContext.

@SuppressWarnings("unchecked")
private Context getChainContext() throws Exception {
    Context context = new ContextBase();
    context.put("visionOid", this.getFields().get("visionOid"));
    context.put("frequency", this.getFields().get("frequency"));
    context.put("startYearDate", this.getFields().get("year"));
    context.put("endYearDate", this.getFields().get("year"));
    context.put("dateType", this.getFields().get("dateType"));
    context.put("dataFor", BscConstants.MEASURE_DATA_FOR_EMPLOYEE);
    EmployeeVO employee = new EmployeeVO();
    employee.setOid(this.getFields().get("employeeOid"));
    DefaultResult<EmployeeVO> result = this.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());
    context.put("orgId", BscConstants.MEASURE_DATA_ORGANIZATION_FULL);
    context.put("uploadSignatureOid", this.getFields().get("uploadSignatureOid"));
    return context;
}
Also used : Context(org.apache.commons.chain.Context) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) ContextBase(org.apache.commons.chain.impl.ContextBase)

Example 47 with EmployeeVO

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

the class TsaManagementAction method fetchData.

private void fetchData() throws ServiceException, Exception {
    // ==========================================================================================
    // main
    this.tsa = new TsaVO();
    this.transformFields2ValueObject(this.tsa, "oid");
    DefaultResult<TsaVO> result = this.tsaService.findObjectByOid(this.tsa);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.tsa = result.getValue();
    // ==========================================================================================
    // ==========================================================================================
    // measure - freq
    this.measureFreq = new TsaMeasureFreqVO();
    this.measureFreq.setTsaOid(this.tsa.getOid());
    DefaultResult<TsaMeasureFreqVO> mfResult = this.tsaMeasureFreqService.findByUK(this.measureFreq);
    if (mfResult.getValue() == null) {
        throw new ServiceException(mfResult.getSystemMessage().getValue());
    }
    this.measureFreq = mfResult.getValue();
    this.measureFreq.setEmployeeOid("");
    if (!BscConstants.MEASURE_DATA_EMPLOYEE_FULL.equals(this.measureFreq.getEmpId()) && !StringUtils.isBlank(this.measureFreq.getEmpId())) {
        EmployeeVO employee = BscBaseLogicServiceCommonSupport.findEmployeeDataByEmpId(this.employeeService, this.measureFreq.getEmpId());
        this.measureFreq.setEmployeeOid(employee.getOid());
    }
    this.measureFreq.setOrganizationOid("");
    if (!BscConstants.MEASURE_DATA_ORGANIZATION_FULL.equals(this.measureFreq.getOrgId()) && !StringUtils.isBlank(this.measureFreq.getOrgId())) {
        OrganizationVO organization = new OrganizationVO();
        organization.setOrgId(this.measureFreq.getOrgId());
        DefaultResult<OrganizationVO> orgResult = this.organizationService.findByUK(organization);
        if (orgResult.getValue() != null) {
            this.measureFreq.setOrganizationOid(orgResult.getValue().getOid());
        }
    }
    this.getFields().put("measureFreqStartDate", "");
    this.getFields().put("measureFreqEndDate", "");
    this.getFields().put("measureFreqStartYearDate", this.measureFreq.getStartDateTextBoxValue());
    this.getFields().put("measureFreqEndYearDate", this.measureFreq.getEndDateTextBoxValue());
    if (BscMeasureDataFrequency.FREQUENCY_DAY.equals(measureFreq.getFreq()) || BscMeasureDataFrequency.FREQUENCY_WEEK.equals(measureFreq.getFreq()) || BscMeasureDataFrequency.FREQUENCY_MONTH.equals(measureFreq.getFreq())) {
        this.getFields().put("measureFreqStartDate", this.measureFreq.getStartDateTextBoxValue());
        this.getFields().put("measureFreqEndDate", this.measureFreq.getEndDateTextBoxValue());
        this.getFields().put("measureFreqStartYearDate", "");
        this.getFields().put("measureFreqEndYearDate", "");
    }
    //1-DEPT,2-EMP,3-Both
    this.getFields().put("measureFreqDataFor", "all");
    if ("1".equals(this.measureFreq.getDataType())) {
        this.getFields().put("measureFreqDataFor", "organization");
    }
    if ("2".equals(this.measureFreq.getDataType())) {
        this.getFields().put("measureFreqDataFor", "employee");
    }
    // ==========================================================================================
    // ==========================================================================================
    // coefficients
    this.coefficient1 = new TsaMaCoefficientsVO();
    this.coefficient2 = new TsaMaCoefficientsVO();
    this.coefficient3 = new TsaMaCoefficientsVO();
    this.coefficient1.setTsaOid(this.tsa.getOid());
    this.coefficient1.setSeq(1);
    this.coefficient2.setTsaOid(this.tsa.getOid());
    this.coefficient2.setSeq(2);
    this.coefficient3.setTsaOid(this.tsa.getOid());
    this.coefficient3.setSeq(3);
    DefaultResult<TsaMaCoefficientsVO> cResult1 = this.tsaMaCoefficientsService.findByUK(this.coefficient1);
    DefaultResult<TsaMaCoefficientsVO> cResult2 = this.tsaMaCoefficientsService.findByUK(this.coefficient2);
    DefaultResult<TsaMaCoefficientsVO> cResult3 = this.tsaMaCoefficientsService.findByUK(this.coefficient3);
    if (cResult1.getValue() == null) {
        throw new ServiceException(cResult1.getSystemMessage().getValue());
    }
    if (cResult2.getValue() == null) {
        throw new ServiceException(cResult2.getSystemMessage().getValue());
    }
    if (cResult3.getValue() == null) {
        throw new ServiceException(cResult3.getSystemMessage().getValue());
    }
    this.coefficient1 = cResult1.getValue();
    this.coefficient2 = cResult2.getValue();
    this.coefficient3 = cResult3.getValue();
// ==========================================================================================
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) TsaMeasureFreqVO(com.netsteadfast.greenstep.vo.TsaMeasureFreqVO) TsaMaCoefficientsVO(com.netsteadfast.greenstep.vo.TsaMaCoefficientsVO) TsaVO(com.netsteadfast.greenstep.vo.TsaVO)

Example 48 with EmployeeVO

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

the class TsaQueryForecastAction method fetchParamMeasureFreqData.

private void fetchParamMeasureFreqData() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.getCheckFieldHandler().add("tsaOid", SelectItemFieldCheckUtils.class, "Please select param!").process().throwMessage();
    this.tsa = TimeSeriesAnalysisUtils.getParam(this.getFields().get("tsaOid"));
    this.measureFreq = TimeSeriesAnalysisUtils.getMeasureFreq(this.tsa);
    this.measureFreq.setEmployeeOid("");
    if (!BscConstants.MEASURE_DATA_EMPLOYEE_FULL.equals(this.measureFreq.getEmpId()) && !StringUtils.isBlank(this.measureFreq.getEmpId())) {
        EmployeeVO employee = BscBaseLogicServiceCommonSupport.findEmployeeDataByEmpId(this.employeeService, this.measureFreq.getEmpId());
        this.measureFreq.setEmployeeOid(employee.getOid());
    }
    this.measureFreq.setOrganizationOid("");
    if (!BscConstants.MEASURE_DATA_ORGANIZATION_FULL.equals(this.measureFreq.getOrgId()) && !StringUtils.isBlank(this.measureFreq.getOrgId())) {
        OrganizationVO organization = new OrganizationVO();
        organization.setOrgId(this.measureFreq.getOrgId());
        DefaultResult<OrganizationVO> orgResult = this.organizationService.findByUK(organization);
        if (orgResult.getValue() != null) {
            this.measureFreq.setOrganizationOid(orgResult.getValue().getOid());
        }
    }
    this.success = IS_YES;
    this.message = "Success!";
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Aggregations

EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)48 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)21 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)15 HashMap (java.util.HashMap)13 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)7 LinkedHashMap (java.util.LinkedHashMap)5 Transactional (org.springframework.transaction.annotation.Transactional)5 Map (java.util.Map)4 BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)3 AccountVO (com.netsteadfast.greenstep.vo.AccountVO)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 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)2 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)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