Search in sources :

Example 1 with BbKpi

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

the class WeightLogicServiceImpl method update.

@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<Boolean> update(List<PerspectiveVO> perspectives, List<ObjectiveVO> objectives, List<KpiVO> kpis) throws ServiceException, Exception {
    if (perspectives == null || perspectives.size() < 1 || objectives == null || objectives.size() < 1 || kpis == null || kpis.size() < 1) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    for (PerspectiveVO perspective : perspectives) {
        BbPerspective entity = this.perspectiveService.findByPKng(perspective.getOid());
        entity.setWeight(perspective.getWeight());
        this.perspectiveService.update(entity);
    }
    for (ObjectiveVO objective : objectives) {
        BbObjective entity = this.objectiveService.findByPKng(objective.getOid());
        entity.setWeight(objective.getWeight());
        this.objectiveService.update(entity);
    }
    for (KpiVO kpi : kpis) {
        BbKpi entity = this.kpiService.findByPKng(kpi.getOid());
        entity.setWeight(kpi.getWeight());
        this.kpiService.update(entity);
    }
    DefaultResult<Boolean> result = new DefaultResult<Boolean>();
    result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_SUCCESS)));
    result.setValue(Boolean.TRUE);
    return result;
}
Also used : SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) BbObjective(com.netsteadfast.greenstep.po.hbm.BbObjective) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) BbPerspective(com.netsteadfast.greenstep.po.hbm.BbPerspective) BbKpi(com.netsteadfast.greenstep.po.hbm.BbKpi) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with BbKpi

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

the class LoadPdcaDataCommand method execute.

@SuppressWarnings("unchecked")
@Override
public boolean execute(Context context) throws Exception {
    pdcaService = (IPdcaService<PdcaVO, BbPdca, String>) AppContext.getBean("bsc.service.PdcaService");
    pdcaDocService = (IPdcaDocService<PdcaDocVO, BbPdcaDoc, String>) AppContext.getBean("bsc.service.PdcaDocService");
    pdcaItemService = (IPdcaItemService<PdcaItemVO, BbPdcaItem, String>) AppContext.getBean("bsc.service.PdcaItemService");
    pdcaItemDocService = (IPdcaItemDocService<PdcaItemDocVO, BbPdcaItemDoc, String>) AppContext.getBean("bsc.service.PdcaItemDocService");
    pdcaAuditService = (IPdcaAuditService<PdcaAuditVO, BbPdcaAudit, String>) AppContext.getBean("bsc.service.PdcaAuditService");
    employeeService = (IEmployeeService<EmployeeVO, BbEmployee, String>) AppContext.getBean("bsc.service.EmployeeService");
    organizationService = (IOrganizationService<OrganizationVO, BbOrganization, String>) AppContext.getBean("bsc.service.OrganizationService");
    kpiService = (IKpiService<KpiVO, BbKpi, String>) AppContext.getBean("bsc.service.KpiService");
    String pdcaOid = (String) context.get("pdcaOid");
    PdcaVO pdca = new PdcaVO();
    pdca.setOid(pdcaOid);
    DefaultResult<PdcaVO> result = pdcaService.findObjectByOid(pdca);
    if (result.getValue() == null) {
        this.setMessage(context, result.getSystemMessage().getValue());
    } else {
        pdca = result.getValue();
        this.loadDetail(pdca);
        this.loadPdcaItems(pdca);
        this.loadAudit(pdca);
        this.setResult(context, pdca);
        // Action 輸出可能會要用到
        context.put("pdca", pdca);
    }
    return false;
}
Also used : PdcaItemDocVO(com.netsteadfast.greenstep.vo.PdcaItemDocVO) PdcaDocVO(com.netsteadfast.greenstep.vo.PdcaDocVO) BbPdcaItemDoc(com.netsteadfast.greenstep.po.hbm.BbPdcaItemDoc) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) BbPdcaDoc(com.netsteadfast.greenstep.po.hbm.BbPdcaDoc) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) BbKpi(com.netsteadfast.greenstep.po.hbm.BbKpi) BbPdcaAudit(com.netsteadfast.greenstep.po.hbm.BbPdcaAudit) BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) BbOrganization(com.netsteadfast.greenstep.po.hbm.BbOrganization) PdcaVO(com.netsteadfast.greenstep.vo.PdcaVO) BbPdca(com.netsteadfast.greenstep.po.hbm.BbPdca) PdcaItemVO(com.netsteadfast.greenstep.vo.PdcaItemVO) BbPdcaItem(com.netsteadfast.greenstep.po.hbm.BbPdcaItem) PdcaAuditVO(com.netsteadfast.greenstep.vo.PdcaAuditVO)

Aggregations

BbKpi (com.netsteadfast.greenstep.po.hbm.BbKpi)2 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)2 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)1 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)1 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)1 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)1 BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)1 BbObjective (com.netsteadfast.greenstep.po.hbm.BbObjective)1 BbOrganization (com.netsteadfast.greenstep.po.hbm.BbOrganization)1 BbPdca (com.netsteadfast.greenstep.po.hbm.BbPdca)1 BbPdcaAudit (com.netsteadfast.greenstep.po.hbm.BbPdcaAudit)1 BbPdcaDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaDoc)1 BbPdcaItem (com.netsteadfast.greenstep.po.hbm.BbPdcaItem)1 BbPdcaItemDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaItemDoc)1 BbPerspective (com.netsteadfast.greenstep.po.hbm.BbPerspective)1 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)1 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)1 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)1 PdcaAuditVO (com.netsteadfast.greenstep.vo.PdcaAuditVO)1 PdcaDocVO (com.netsteadfast.greenstep.vo.PdcaDocVO)1