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();
}
}
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;
}
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;
}
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;
}
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;
}
Aggregations