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