Search in sources :

Example 41 with EmployeeVO

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

the class EmployeeSaveOrUpdateAction method updateSupervisor.

private void updateSupervisor() throws ControllerException, AuthorityException, ServiceException, Exception {
    EmployeeVO employee = new EmployeeVO();
    this.transformFields2ValueObject(employee, new String[] { "oid" });
    DefaultResult<Boolean> result = this.employeeLogicService.updateSupervisor(employee, this.getFields().get("supOid"));
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null && result.getValue()) {
        this.success = IS_YES;
    }
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO)

Example 42 with EmployeeVO

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

the class EmployeeSaveOrUpdateAction method updatePassword.

private void updatePassword() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFieldsForUpdatePassword();
    EmployeeVO employee = new EmployeeVO();
    this.transformFields2ValueObject(employee, new String[] { "oid", "password" });
    DefaultResult<AccountVO> result = this.employeeLogicService.updatePassword(employee, this.getFields().get("password2"));
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
    }
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) AccountVO(com.netsteadfast.greenstep.vo.AccountVO)

Example 43 with EmployeeVO

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

the class EmployeeSaveOrUpdateAction method update.

private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFieldsForUpdate();
    EmployeeVO employee = new EmployeeVO();
    this.transformFields2ValueObject(employee, new String[] { "oid", "fullName", "jobTitle" });
    DefaultResult<EmployeeVO> result = this.employeeLogicService.update(employee, this.transformAppendIds2List(this.getFields().get("appendId")));
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
    }
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO)

Example 44 with EmployeeVO

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

the class KpiReportContentQueryAction method getChainContext.

@SuppressWarnings("unchecked")
private Context getChainContext() throws Exception {
    Context context = new ContextBase();
    context.put("visionOid", this.getFields().get("visionOid"));
    context.put("startDate", this.getFields().get("startDate"));
    context.put("endDate", this.getFields().get("endDate"));
    context.put("startYearDate", this.getFields().get("startYearDate"));
    context.put("endYearDate", this.getFields().get("endYearDate"));
    context.put("frequency", this.getFields().get("frequency"));
    context.put("dataFor", this.getFields().get("dataFor"));
    context.put("orgId", BscConstants.MEASURE_DATA_ORGANIZATION_FULL);
    context.put("empId", BscConstants.MEASURE_DATA_EMPLOYEE_FULL);
    context.put("account", "");
    context.put("pieCanvasToData", SimpleUtils.deHex(this.defaultString(this.getFields().get("pieCanvasToData"))));
    context.put("barCanvasToData", SimpleUtils.deHex(this.defaultString(this.getFields().get("barCanvasToData"))));
    context.put("uploadSignatureOid", this.getFields().get("uploadSignatureOid"));
    context.put("ngVer", YesNo.NO);
    if ("Y".equals(this.getFields().get("ngVer"))) {
        // 有 javascript click 事件 kpi-report-body-ng.ftl 版本
        context.put("ngVer", YesNo.YES);
    }
    if (!this.isNoSelectId(this.getFields().get("measureDataOrganizationOid"))) {
        OrganizationVO organization = new OrganizationVO();
        organization.setOid(this.getFields().get("measureDataOrganizationOid"));
        DefaultResult<OrganizationVO> result = this.organizationService.findObjectByOid(organization);
        if (result.getValue() == null) {
            throw new ServiceException(result.getSystemMessage().getValue());
        }
        organization = result.getValue();
        context.put("orgId", organization.getOrgId());
    }
    if (!this.isNoSelectId(this.getFields().get("measureDataEmployeeOid"))) {
        EmployeeVO employee = new EmployeeVO();
        employee.setOid(this.getFields().get("measureDataEmployeeOid"));
        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());
    }
    this.setContextForSingleObject(context);
    return context;
}
Also used : 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)

Example 45 with EmployeeVO

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

the class PdcaManagementAction method loadPdcaData.

private void loadPdcaData() throws ServiceException, Exception {
    // ------------------------------------------------------------------------------
    // PDCA main
    this.loadPdcaDataSimple("oid");
    // ------------------------------------------------------------------------------
    // ------------------------------------------------------------------------------
    // measure frequency
    this.measureFreq.setPdcaOid(pdca.getOid());
    DefaultResult<PdcaMeasureFreqVO> measureFreqResult = this.pdcaMeasureFreqService.findByUK(measureFreq);
    if (measureFreqResult.getValue() == null) {
        throw new ServiceException(measureFreqResult.getSystemMessage().getValue());
    }
    this.measureFreq = measureFreqResult.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");
    }
    // ------------------------------------------------------------------------------
    // ------------------------------------------------------------------------------
    // PDCA organization, Owner, KPIs, DOC
    List<String> appendOrgaOidsPdcaOrga = this.organizationService.findForAppendOrganizationOidsByPdcaOrga(this.pdca.getOid());
    List<String> appendOrgaNamesPdcaOrga = this.organizationService.findForAppendNames(appendOrgaOidsPdcaOrga);
    this.getFields().put("appendOrgaOidsForPdcaOrga", this.joinAppend2String(appendOrgaOidsPdcaOrga));
    this.getFields().put("appendOrgaNamesForPdcaOrga", this.joinAppend2String(appendOrgaNamesPdcaOrga));
    List<String> appendEmplOidsPdcaOwner = this.employeeService.findForAppendEmployeeOidsByPdcaOwner(pdca.getOid());
    List<String> appendEmplNamesPdcaOwner = this.employeeService.findForAppendNames(appendEmplOidsPdcaOwner);
    this.getFields().put("appendOwnerOidsForPdcaOwner", this.joinAppend2String(appendEmplOidsPdcaOwner));
    this.getFields().put("appendOwnerNamesForPdcaOwner", this.joinAppend2String(appendEmplNamesPdcaOwner));
    List<String> appendKpiOidsPdcaKpis = this.kpiService.findForAppendOidsByPdcaKpis(pdca.getOid());
    List<String> appendKpiNamesPdcaKpis = this.kpiService.findForAppendNames(appendKpiOidsPdcaKpis);
    this.getFields().put("appendKpiOidsForPdcaKpis", this.joinAppend2String(appendKpiOidsPdcaKpis));
    this.getFields().put("appendKpiNamesForPdcaKpis", this.joinAppend2String(appendKpiNamesPdcaKpis));
    Map<String, Object> paramMap = new HashMap<String, Object>();
    paramMap.put("pdcaOid", pdca.getOid());
    this.pdcaDocs = this.pdcaDocService.findListVOByParams(paramMap);
    for (int i = 0; this.pdcaDocs != null && i < this.pdcaDocs.size(); i++) {
        PdcaDocVO pdcaDoc = this.pdcaDocs.get(i);
        pdcaDoc.setShowName("unknown-" + pdcaDoc.getUploadOid());
        DefaultResult<SysUploadVO> upResult = this.sysUploadService.findForNoByteContent(pdcaDoc.getUploadOid());
        if (upResult.getValue() != null) {
            pdcaDoc.setShowName(upResult.getValue().getShowName());
        }
    }
    // ------------------------------------------------------------------------------
    // ------------------------------------------------------------------------------
    // PDCA Items
    this.loadPdcaItemsData();
// ------------------------------------------------------------------------------
}
Also used : HashMap(java.util.HashMap) PdcaDocVO(com.netsteadfast.greenstep.vo.PdcaDocVO) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) SysUploadVO(com.netsteadfast.greenstep.vo.SysUploadVO) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) PdcaMeasureFreqVO(com.netsteadfast.greenstep.vo.PdcaMeasureFreqVO)

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