Search in sources :

Example 1 with OrganizationVO

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

the class SwotDataProvideCommand method execute.

@Override
public boolean execute(Context context) throws Exception {
    String visionOid = (String) context.get("visionOid");
    String organizationOid = (String) context.get("organizationOid");
    VisionVO vision = this.findVision(visionOid);
    OrganizationVO organization = this.findOrganization(organizationOid);
    if (StringUtils.isBlank(vision.getVisId()) || StringUtils.isBlank(organization.getOrgId())) {
        this.setMessage(context, SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
        return false;
    }
    Map<String, Object> params = new HashMap<String, Object>();
    Map<String, String> orderParams = new HashMap<String, String>();
    params.put("visId", vision.getVisId());
    orderParams.put("perId", "asc");
    List<BbPerspective> perspectives = this.perspectiveService.findListByParams(params, null, orderParams);
    if (perspectives == null || perspectives.size() < 1) {
        this.setMessage(context, SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
        return false;
    }
    params.put("orgId", organization.getOrgId());
    List<BbSwot> swots = this.swotService.findListByParams(params, null, orderParams);
    SwotDataVO swotData = new SwotDataVO();
    swotData.setVision(vision);
    swotData.setOrganization(organization);
    swotData.setContents(swots);
    swotData.setPerspectives(perspectives);
    this.initIssues(swotData, vision.getVisId(), organization.getOrgId());
    this.setResult(context, swotData);
    return false;
}
Also used : HashMap(java.util.HashMap) BbSwot(com.netsteadfast.greenstep.po.hbm.BbSwot) SwotDataVO(com.netsteadfast.greenstep.bsc.vo.SwotDataVO) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) BbPerspective(com.netsteadfast.greenstep.po.hbm.BbPerspective) VisionVO(com.netsteadfast.greenstep.vo.VisionVO)

Example 2 with OrganizationVO

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

the class CommonOrgChartAction method createOrgChartDataForOrganization.

@SuppressWarnings("unused")
private void createOrgChartDataForOrganization() throws ControllerException, AuthorityException, ServiceException, Exception {
    OrganizationVO organization = new OrganizationVO();
    organization = this.transformFields2ValueObject(organization, "oid");
    DefaultResult<String> result = this.organizationLogicService.createOrgChartData(ApplicationSiteUtils.getBasePath(Constants.getMainSystem(), this.getHttpServletRequest()), organization);
    this.uploadOid = super.defaultString(result.getValue());
    this.message = result.getSystemMessage().getValue();
    if (!StringUtils.isBlank(this.uploadOid)) {
        this.loadOrgChartData(this.uploadOid);
        this.success = IS_YES;
    }
}
Also used : OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Example 3 with OrganizationVO

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

the class DepartmentReportContentQueryAction 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_ORGANIZATION);
    OrganizationVO organization = new OrganizationVO();
    organization.setOid(this.getFields().get("organizationOid"));
    DefaultResult<OrganizationVO> result = this.organizationService.findObjectByOid(organization);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    organization = result.getValue();
    context.put("empId", BscConstants.MEASURE_DATA_EMPLOYEE_FULL);
    context.put("orgId", organization.getOrgId());
    context.put("uploadSignatureOid", this.getFields().get("uploadSignatureOid"));
    return context;
}
Also used : Context(org.apache.commons.chain.Context) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) ContextBase(org.apache.commons.chain.impl.ContextBase)

Example 4 with OrganizationVO

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

the class BscBaseLogicServiceCommonSupport method findOrganizationDataByUK.

public static OrganizationVO findOrganizationDataByUK(IOrganizationService<OrganizationVO, BbOrganization, String> service, String orgId) throws ServiceException, Exception {
    if (StringUtils.isBlank(orgId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    OrganizationVO organization = new OrganizationVO();
    organization.setOrgId(orgId);
    DefaultResult<OrganizationVO> orgResult = service.findByUK(organization);
    if (orgResult.getValue() == null) {
        throw new ServiceException(orgResult.getSystemMessage().getValue());
    }
    organization = orgResult.getValue();
    return organization;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Example 5 with OrganizationVO

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

the class OrganizationLogicServiceImpl method updateParent.

@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<Boolean> updateParent(OrganizationVO organization, String parentOid) throws ServiceException, Exception {
    if (organization == null || super.isBlank(organization.getOid()) || super.isBlank(parentOid)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    DefaultResult<Boolean> result = new DefaultResult<Boolean>();
    result.setValue(Boolean.FALSE);
    result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_FAIL)));
    organization = this.findOrganizationData(organization.getOid());
    this.deleteParent(organization);
    if ("root".equals(parentOid) || "r".equals(parentOid)) {
        this.createParent(organization, BscConstants.ORGANIZATION_ZERO_ID);
    } else {
        OrganizationVO newParOrganization = this.findOrganizationData(parentOid);
        // 找當前部門的子部門中的資料, 不因該存在要update的新父部門
        if (this.foundChild(organization.getOrgId(), newParOrganization.getOrgId())) {
            throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
        }
        this.createParent(organization, newParOrganization.getOrgId());
    }
    result.setValue(Boolean.TRUE);
    result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_SUCCESS)));
    return result;
}
Also used : SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

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