use of com.netsteadfast.greenstep.base.model.DefaultResult in project bamboobsc by billchen198318.
the class BaseService method ibatisSelectListByParams.
// ------------------------------------------------------------------------------------
@Transactional(isolation = Isolation.READ_COMMITTED, timeout = 25, readOnly = true)
public DefaultResult<List<E>> ibatisSelectListByParams(Map<String, Object> params) throws ServiceException, Exception {
if (params == null) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.OBJ_NULL));
}
DefaultResult<List<E>> result = new DefaultResult<List<E>>();
List<E> searchList = (List<E>) this.getBaseDataAccessObject().ibatisSelectListByParams(params);
if (searchList != null && searchList.size() > 0) {
result.setValue(searchList);
} else {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
}
return result;
}
use of com.netsteadfast.greenstep.base.model.DefaultResult in project bamboobsc by billchen198318.
the class BaseService method deleteObject.
@SuppressWarnings({ "unchecked", "rawtypes" })
@ServiceMethodAuthority(type = { ServiceMethodType.DELETE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
public DefaultResult<Boolean> deleteObject(T object) throws ServiceException, Exception {
if (object == null || !(object instanceof BaseValueObj)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.OBJ_NULL));
}
DefaultResult<Boolean> result = new DefaultResult<Boolean>();
Class<E> entityObjectClass = GenericsUtils.getSuperClassGenricType(getClass(), 1);
E entityObject = entityObjectClass.newInstance();
((BaseEntity) entityObject).setOid(((BaseValueObj) object).getOid());
boolean status = false;
if (this.countByOid(entityObject) > 0) {
this.delete(entityObject);
status = true;
}
result.setValue(status);
if (status) {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.DELETE_SUCCESS)));
} else {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.DELETE_FAIL)));
}
return result;
}
use of com.netsteadfast.greenstep.base.model.DefaultResult in project bamboobsc by billchen198318.
the class DegreeFeedbackScoreServiceImpl method findResultsByProjectAndOwner.
@Override
public DefaultResult<List<BbDegreeFeedbackScore>> findResultsByProjectAndOwner(String projectOid, String ownerId) throws Exception {
if (StringUtils.isBlank(projectOid) || StringUtils.isBlank(ownerId)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
List<BbDegreeFeedbackScore> searchList = this.degreeFeedbackScoreDAO.findForListByProjectAndOwner(projectOid, ownerId);
DefaultResult<List<BbDegreeFeedbackScore>> result = new DefaultResult<List<BbDegreeFeedbackScore>>();
if (null != searchList && searchList.size() > 0) {
result.setValue(searchList);
} else {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
}
return result;
}
use of com.netsteadfast.greenstep.base.model.DefaultResult in project bamboobsc by billchen198318.
the class AggregationMethodServiceImpl method findSimpleByOid.
@Override
public DefaultResult<AggregationMethodVO> findSimpleByOid(String aggrOid) throws ServiceException, Exception {
if (StringUtils.isBlank(aggrOid) || super.isNoSelectId(aggrOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
AggregationMethodVO aggr = this.aggregationMethodDAO.findSimpleByOid(aggrOid);
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.model.DefaultResult in project bamboobsc by billchen198318.
the class AggregationMethodServiceImpl method findForSimple.
@Override
public DefaultResult<List<AggregationMethodVO>> findForSimple() throws ServiceException, Exception {
DefaultResult<List<AggregationMethodVO>> result = new DefaultResult<List<AggregationMethodVO>>();
List<AggregationMethodVO> searchList = this.aggregationMethodDAO.findForSimple();
if (searchList != null && searchList.size() > 0) {
result.setValue(searchList);
} else {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
}
return result;
}
Aggregations