Search in sources :

Example 36 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO 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 37 with OrganizationVO

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

the class OrganizationSaveOrUpdateAction method updateParent.

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

Example 38 with OrganizationVO

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

the class OrganizationSaveOrUpdateAction method update.

private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    OrganizationVO organization = new OrganizationVO();
    this.transformFields2ValueObject(organization, new String[] { "oid", "orgId", "name", "address", "lat", "lng", "description" });
    DefaultResult<OrganizationVO> result = this.organizationLogicService.update(organization);
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
    }
}
Also used : OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Example 39 with OrganizationVO

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

the class OrganizationSaveOrUpdateAction method save.

private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    OrganizationVO organization = new OrganizationVO();
    this.transformFields2ValueObject(organization, new String[] { "orgId", "name", "address", "lat", "lng", "description" });
    DefaultResult<OrganizationVO> result = this.organizationLogicService.create(organization);
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
    }
}
Also used : OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Example 40 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO 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

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