Search in sources :

Example 1 with WebMessagePublishBaseObj

use of com.netsteadfast.greenstep.model.WebMessagePublishBaseObj in project bamboobsc by billchen198318.

the class SystemMessagePublishServiceImpl method execute.

@Override
public WebMessagePublishBaseObj execute(SysMsgNoticeConfigVO config, ServletRequest request) throws ServiceException, Exception {
    this.request = request;
    WebMessagePublishBaseObj publishObj = new WebMessagePublishBaseObj();
    String account = request.getParameter("account");
    String refreshUUID = StringUtils.defaultString(request.getParameter("refreshUUID")).trim();
    String sessionId = ((HttpServletRequest) request).getSession().getId();
    AccountVO accountObj = (AccountVO) UserAccountHttpSessionSupport.get((HttpServletRequest) request);
    if (StringUtils.isBlank(this.getId()) || StringUtils.isBlank(account) || accountObj == null) {
        // no login
        return publishObj;
    }
    if (!account.equals(accountObj.getAccount())) {
        // not same account request
        return publishObj;
    }
    List<TbSysMsgNotice> globalSysMsgNoticeList = this.loadGlobalSysMsgNoticeData(config.getMsgId(), "*");
    List<TbSysMsgNotice> accountSysMsgNoticeList = this.loadAccountSysMsgNoticeData(config.getMsgId(), account);
    String globalMsg = this.process(sessionId, refreshUUID, globalSysMsgNoticeList);
    String personalMsg = this.process(sessionId, refreshUUID, accountSysMsgNoticeList);
    publishObj.setIsAuthorize(YesNo.YES);
    publishObj.setLogin(YesNo.YES);
    publishObj.setSuccess(YesNo.YES);
    publishObj.setMessage(globalMsg + personalMsg);
    return publishObj;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) TbSysMsgNotice(com.netsteadfast.greenstep.po.hbm.TbSysMsgNotice) WebMessagePublishBaseObj(com.netsteadfast.greenstep.model.WebMessagePublishBaseObj) AccountVO(com.netsteadfast.greenstep.vo.AccountVO)

Aggregations

WebMessagePublishBaseObj (com.netsteadfast.greenstep.model.WebMessagePublishBaseObj)1 TbSysMsgNotice (com.netsteadfast.greenstep.po.hbm.TbSysMsgNotice)1 AccountVO (com.netsteadfast.greenstep.vo.AccountVO)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1