use of com.netsteadfast.greenstep.vo.AccountVO 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;
}
use of com.netsteadfast.greenstep.vo.AccountVO in project bamboobsc by billchen198318.
the class AccountServiceImpl method findForAllMap.
/**
* 下拉Select 要用
*
* @return
* @throws ServiceException
* @throws Exception
*/
@Override
public Map<String, String> findForAllMap(boolean pleaseSelect) throws ServiceException, Exception {
List<AccountVO> searchList = this.findForAll();
Map<String, String> dataMap = new LinkedHashMap<String, String>();
if (pleaseSelect) {
dataMap.put(Constants.HTML_SELECT_NO_SELECT_ID, Constants.HTML_SELECT_NO_SELECT_NAME);
}
if (searchList == null || searchList.size() < 1) {
return dataMap;
}
for (AccountVO account : searchList) {
dataMap.put(account.getOid(), account.getAccount());
}
return dataMap;
}
use of com.netsteadfast.greenstep.vo.AccountVO in project bamboobsc by billchen198318.
the class CoreBaseLogicService method findAccountData.
public AccountVO findAccountData(String accountId) throws ServiceException, Exception {
if (super.isBlank(accountId)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
AccountVO accountObj = new AccountVO();
accountObj.setAccount(accountId);
DefaultResult<AccountVO> result = this.accountService.findByUK(accountObj);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().toString());
}
accountObj = result.getValue();
return accountObj;
}
use of com.netsteadfast.greenstep.vo.AccountVO in project bamboobsc by billchen198318.
the class GreenStepBaseAuthorizingRealm method doGetAuthenticationInfo.
/**
* 認證
*/
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
GreenStepBaseUsernamePasswordToken token = (GreenStepBaseUsernamePasswordToken) authenticationToken;
String account = token.getUsername();
AccountVO accountObj = new AccountVO();
accountObj.setAccount(account);
try {
DefaultResult<AccountVO> result = accountService.findByUK(accountObj);
if (result.getValue() == null) {
return null;
}
accountObj = result.getValue();
return new SimpleAuthenticationInfo(accountObj.getAccount(), accountObj.getPassword(), this.getName());
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
use of com.netsteadfast.greenstep.vo.AccountVO in project bamboobsc by billchen198318.
the class GreenStepBaseFormAuthenticationFilter method loginUseCurrentCookieForGeneralPackage.
/**
* 非 core-web 登入方式 , 給 gsbsc-web, qcharts-web 用的
*
* @param request
* @param response
* @return
* @throws Exception
*/
private boolean loginUseCurrentCookieForGeneralPackage(ServletRequest request, ServletResponse response) throws Exception {
Map<String, String> dataMap = UserCurrentCookie.getCurrentData((HttpServletRequest) request);
if (dataMap == null) {
return false;
}
String currentId = dataMap.get("currentId");
String accountId = dataMap.get("account");
if (StringUtils.isBlank(currentId) || StringUtils.isBlank(accountId)) {
return false;
}
// 先去 tb_sys_usess 用 current_id與帳戶 去查有沒有存在 db
if (this.uSessLogHelper.countByCurrent(accountId, currentId) < 1) {
// 沒有在 core-web 登入, 所以沒有 TB_SYS_USESS 的資料
return false;
}
// 這理的 captcha 不須要比對了 , 因為不是 core-web 的登入畫面
String captchaStr = "0123";
request.setAttribute(this.captchaParam, captchaStr);
((HttpServletRequest) request).getSession().setAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY, captchaStr);
ShiroLoginSupport loginSupport = new ShiroLoginSupport();
AccountVO account = loginSupport.queryUserValidate(accountId);
loginSupport.forceCreateLoginSubject((HttpServletRequest) request, (HttpServletResponse) response, accountId, captchaStr);
// set session
this.setUserSession((HttpServletRequest) request, (HttpServletResponse) response, account);
return true;
}
Aggregations