Search in sources :

Example 1 with BbDegreeFeedbackProject

use of com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackProject 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 2 with BbDegreeFeedbackProject

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

the class DegreeFeedbackProjectServiceImpl method findByPublishFlag2ValueObject.

@Override
public DefaultResult<List<DegreeFeedbackProjectVO>> findByPublishFlag2ValueObject(String publishFlag, String raterId) throws Exception {
    DefaultResult<List<BbDegreeFeedbackProject>> queryResult = this.findByPublishFlag(publishFlag, raterId);
    DefaultResult<List<DegreeFeedbackProjectVO>> result = new DefaultResult<List<DegreeFeedbackProjectVO>>();
    if (queryResult.getValue() == null) {
        result.setSystemMessage(queryResult.getSystemMessage());
        return result;
    }
    List<DegreeFeedbackProjectVO> datas = new ArrayList<DegreeFeedbackProjectVO>();
    List<BbDegreeFeedbackProject> queryList = queryResult.getValue();
    for (BbDegreeFeedbackProject entity : queryList) {
        DegreeFeedbackProjectVO obj = new DegreeFeedbackProjectVO();
        this.doMapper(entity, obj, this.getMapperIdPo2Vo());
        datas.add(obj);
    }
    result.setValue(datas);
    return result;
}
Also used : BbDegreeFeedbackProject(com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackProject) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult) DegreeFeedbackProjectVO(com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO)

Aggregations

DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)2 BbDegreeFeedbackProject (com.netsteadfast.greenstep.po.hbm.BbDegreeFeedbackProject)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)1 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)1 DegreeFeedbackProjectVO (com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO)1