use of com.netsteadfast.greenstep.vo.AccountVO in project bamboobsc by billchen198318.
the class ShiroLoginSupport method queryUser.
public AccountVO queryUser(String account) throws Exception {
if (StringUtils.isBlank(account)) {
return null;
}
if (accountService == null) {
logger.error("no service bean: core.service.AccountService");
throw new Exception("no service bean: core.service.AccountService");
}
AccountVO accountObj = new AccountVO();
accountObj.setAccount(account);
DefaultResult<AccountVO> result = accountService.findByUK(accountObj);
if (result.getValue() == null) {
return null;
}
accountObj = result.getValue();
return accountObj;
}
use of com.netsteadfast.greenstep.vo.AccountVO in project bamboobsc by billchen198318.
the class SystemMessageNoticeLogicServiceImpl method update.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysMsgNoticeVO> update(SysMsgNoticeVO notice, String accountOid) throws ServiceException, Exception {
if (notice == null || super.isBlank(notice.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<SysMsgNoticeVO> oldResult = this.sysMsgNoticeService.findObjectByOid(notice);
if (oldResult.getValue() == null) {
throw new ServiceException(oldResult.getSystemMessage().getValue());
}
notice.setNoticeId(oldResult.getValue().getNoticeId());
notice.setMsgId(oldResult.getValue().getMsgId());
notice.setToAccount("*");
if (!super.isNoSelectId(accountOid) && !"*".equals(accountOid)) {
AccountVO account = new AccountVO();
account.setOid(accountOid);
DefaultResult<AccountVO> aResult = this.accountService.findObjectByOid(account);
if (aResult.getValue() == null) {
throw new ServiceException(aResult.getSystemMessage().getValue());
}
account = aResult.getValue();
notice.setToAccount(account.getAccount());
}
if (super.defaultString(notice.getMessage()).length() > MAX_MESSAGE_LENGTH) {
notice.setMessage(notice.getMessage().substring(0, MAX_MESSAGE_LENGTH));
}
return this.sysMsgNoticeService.updateObject(notice);
}
use of com.netsteadfast.greenstep.vo.AccountVO in project bamboobsc by billchen198318.
the class SystemCalendarNoteManagementAction method loadSysCalendarNoteData.
/**
* 載入編輯mode需要的資料
*
* @throws ServiceException
* @throws Exception
*/
private void loadSysCalendarNoteData() throws ServiceException, Exception {
this.transformFields2ValueObject(this.sysCalendarNote, new String[] { "oid" });
DefaultResult<SysCalendarNoteVO> result = this.sysCalendarNoteService.findObjectByOid(sysCalendarNote);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
this.sysCalendarNote = result.getValue();
AccountVO account = new AccountVO();
account.setAccount(sysCalendarNote.getAccount());
DefaultResult<AccountVO> aResult = this.accountService.findByUK(account);
if (aResult.getValue() == null) {
throw new ServiceException(aResult.getSystemMessage().getValue());
}
account = aResult.getValue();
this.accountOid = account.getOid();
this.calendarNoteDate = sysCalendarNote.getDate().substring(0, 4) + "-" + sysCalendarNote.getDate().substring(4, 6) + "-" + sysCalendarNote.getDate().substring(6, 8);
String[] time = this.sysCalendarNote.getTime().split(Constants.DATETIME_DELIMITER);
this.startHour = time[0].substring(0, 2);
this.startMinutes = time[0].substring(2, 4);
this.endHour = time[1].substring(0, 2);
this.endMinutes = time[1].substring(2, 4);
}
use of com.netsteadfast.greenstep.vo.AccountVO in project bamboobsc by billchen198318.
the class EmployeeLogicServiceImpl method updatePassword.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<AccountVO> updatePassword(EmployeeVO employee, String newPassword) throws ServiceException, Exception {
if (employee == null || super.isBlank(employee.getOid()) || super.isBlank(employee.getPassword()) || super.isBlank(newPassword)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
EmployeeVO dbEmployee = this.findEmployeeData(employee.getOid());
AccountVO account = this.findAccountData(dbEmployee.getAccount());
if (!account.getPassword().equals(this.getAccountService().tranPassword(employee.getPassword()))) {
throw new ServiceException("The current password(old password) is incorrect!");
}
account.setPassword(this.getAccountService().tranPassword(newPassword));
return getAccountService().updateObject(account);
}
use of com.netsteadfast.greenstep.vo.AccountVO in project bamboobsc by billchen198318.
the class EmployeeLogicServiceImpl method tranAccount.
private AccountVO tranAccount(EmployeeVO employee) throws Exception {
AccountVO account = new AccountVO();
account.setAccount(employee.getAccount());
account.setOnJob(YesNo.YES);
account.setPassword(this.getAccountService().tranPassword(employee.getPassword()));
return account;
}
Aggregations