Search in sources :

Example 61 with ServiceException

use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.

the class PdcaType method loadMapData.

private static void loadMapData() {
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("type", CODE_TYPE);
    Map<String, String> orderParams = new HashMap<String, String>();
    orderParams.put("code", "ASC");
    try {
        List<TbSysCode> codes = sysCodeService.findListByParams(params, null, orderParams);
        for (TbSysCode code : codes) {
            if (code.getCode().equals(PLAN_CODE)) {
                pdcaMap.put(PLAN, code.getName());
            }
            if (code.getCode().equals(DO_CODE)) {
                pdcaMap.put(DO, code.getName());
            }
            if (code.getCode().equals(CHECK_CODE)) {
                pdcaMap.put(CHECK, code.getName());
            }
            if (code.getCode().equals(ACTION_CODE)) {
                pdcaMap.put(ACTION, code.getName());
            }
        }
    } catch (ServiceException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) LinkedHashMap(java.util.LinkedHashMap) HashMap(java.util.HashMap) TbSysCode(com.netsteadfast.greenstep.po.hbm.TbSysCode) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 62 with ServiceException

use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.

the class AggregationMethodServiceImpl method findSimpleById.

@Override
public DefaultResult<AggregationMethodVO> findSimpleById(String aggrId) throws ServiceException, Exception {
    if (StringUtils.isBlank(aggrId) || super.isNoSelectId(aggrId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    AggregationMethodVO aggr = this.aggregationMethodDAO.findSimpleById(aggrId);
    DefaultResult<AggregationMethodVO> result = new DefaultResult<AggregationMethodVO>();
    if (aggr != null && !StringUtils.isBlank(aggr.getOid())) {
        result.setValue(aggr);
    } else {
        result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
    }
    return result;
}
Also used : SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) AggregationMethodVO(com.netsteadfast.greenstep.vo.AggregationMethodVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult)

Example 63 with ServiceException

use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.

the class DegreeFeedbackProjectServiceImpl method findByPublishFlag.

@Override
public DefaultResult<List<BbDegreeFeedbackProject>> findByPublishFlag(String publishFlag, String raterId) throws Exception {
    if (StringUtils.isBlank(raterId) || StringUtils.isBlank(publishFlag)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    if (!YesNo.YES.equals(publishFlag) && !YesNo.NO.equals(publishFlag)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_INCORRECT));
    }
    DefaultResult<List<BbDegreeFeedbackProject>> result = new DefaultResult<List<BbDegreeFeedbackProject>>();
    List<BbDegreeFeedbackProject> list = this.degreeFeedbackProjectDAO.findByPublishFlag(publishFlag, raterId);
    if (null != list && list.size() > 0) {
        result.setValue(list);
    } else {
        result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
    }
    return result;
}
Also used : SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) BbDegreeFeedbackProject(com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackProject) ArrayList(java.util.ArrayList) List(java.util.List) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult)

Example 64 with ServiceException

use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.

the class BaseWorkspaceCompoment method loadFromId.

@Override
public CompomentsModel loadFromId(String compomentId) throws ServiceException, Exception {
    if (StringUtils.isBlank(compomentId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    WorkspaceCompomentVO compoment = new WorkspaceCompomentVO();
    compoment.setCompId(compomentId);
    DefaultResult<WorkspaceCompomentVO> result = workspaceCompomentService.findByUK(compoment);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    compoment = result.getValue();
    CompomentsModel model = new CompomentsModel();
    this.setModel(model);
    model.setId(compoment.getCompId());
    model.setName(compoment.getName());
    model.setResource(this.getResource());
    model.setParameters(this.getParameters());
    model.setContent("");
    return model;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) WorkspaceCompomentVO(com.netsteadfast.greenstep.vo.WorkspaceCompomentVO) CompomentsModel(com.netsteadfast.greenstep.compoments.CompomentsModel)

Example 65 with ServiceException

use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.

the class OrganizationServiceImpl method findForInKpiOrga.

@Override
public DefaultResult<List<BbOrganization>> findForInKpiOrga(String kpiId) throws ServiceException, Exception {
    if (StringUtils.isBlank(kpiId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    DefaultResult<List<BbOrganization>> result = new DefaultResult<List<BbOrganization>>();
    List<BbOrganization> searchList = this.organizationDAO.findForInKpiOrga(kpiId);
    if (searchList != null && searchList.size() > 0) {
        result.setValue(searchList);
    } else {
        result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
    }
    return result;
}
Also used : SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) BbOrganization(com.netsteadfast.greenstep.po.hbm.BbOrganization) ArrayList(java.util.ArrayList) List(java.util.List) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult)

Aggregations

ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)291 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)91 Transactional (org.springframework.transaction.annotation.Transactional)89 HashMap (java.util.HashMap)65 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)49 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)48 SysVO (com.netsteadfast.greenstep.vo.SysVO)30 IOException (java.io.IOException)24 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)20 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)19 List (java.util.List)19 Map (java.util.Map)19 ArrayList (java.util.ArrayList)17 LinkedHashMap (java.util.LinkedHashMap)17 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)16 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)15 PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)15 SysUploadVO (com.netsteadfast.greenstep.vo.SysUploadVO)14 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)13 AccountVO (com.netsteadfast.greenstep.vo.AccountVO)12