Search in sources :

Example 6 with SysMsgNoticeConfigVO

use of com.netsteadfast.greenstep.vo.SysMsgNoticeConfigVO in project bamboobsc by billchen198318.

the class SystemMessageNoticeConfigSaveOrUpdateAction method save.

private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    SysMsgNoticeConfigVO config = new SysMsgNoticeConfigVO();
    this.transformFields2ValueObject(config, new String[] { "msgId", "className" });
    DefaultResult<SysMsgNoticeConfigVO> result = this.systemMessageNoticeLogicService.createConfig(config, this.getFields().get("systemOid"));
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() == null) {
        return;
    }
    this.success = IS_YES;
}
Also used : SysMsgNoticeConfigVO(com.netsteadfast.greenstep.vo.SysMsgNoticeConfigVO)

Example 7 with SysMsgNoticeConfigVO

use of com.netsteadfast.greenstep.vo.SysMsgNoticeConfigVO in project bamboobsc by billchen198318.

the class SystemMessageNoticeManagementAction method loadSysMsgNoticeData.

private void loadSysMsgNoticeData() throws ServiceException, Exception {
    this.transformFields2ValueObject(this.sysMsgNotice, new String[] { "oid" });
    DefaultResult<SysMsgNoticeVO> result = this.sysMsgNoticeService.findObjectByOid(this.sysMsgNotice);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.sysMsgNotice = result.getValue();
    String[] dateTmp = sysMsgNotice.getDate().split(Constants.DATETIME_DELIMITER);
    this.date1 = dateTmp[0].substring(0, 4) + "-" + dateTmp[0].substring(4, 6) + "-" + dateTmp[0].substring(6, 8);
    this.date2 = dateTmp[1].substring(0, 4) + "-" + dateTmp[1].substring(4, 6) + "-" + dateTmp[1].substring(6, 8);
    String[] time = sysMsgNotice.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);
    SysMsgNoticeConfigVO config = new SysMsgNoticeConfigVO();
    config.setMsgId(sysMsgNotice.getMsgId());
    DefaultResult<SysMsgNoticeConfigVO> configResult = this.sysMsgNoticeConfigService.findByUK(config);
    if (configResult.getValue() == null) {
        throw new ServiceException(configResult.getSystemMessage().getValue());
    }
    config = configResult.getValue();
    this.selectConfigOid = config.getOid();
    AccountVO account = new AccountVO();
    if (!"*".equals(sysMsgNotice.getToAccount())) {
        account.setAccount(sysMsgNotice.getToAccount());
        DefaultResult<AccountVO> aResult = this.accountService.findByUK(account);
        if (aResult.getValue() == null) {
            throw new ServiceException(aResult.getSystemMessage().getValue());
        }
        account = aResult.getValue();
        this.selectAccountOid = account.getOid();
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysMsgNoticeConfigVO(com.netsteadfast.greenstep.vo.SysMsgNoticeConfigVO) AccountVO(com.netsteadfast.greenstep.vo.AccountVO) SysMsgNoticeVO(com.netsteadfast.greenstep.vo.SysMsgNoticeVO)

Aggregations

SysMsgNoticeConfigVO (com.netsteadfast.greenstep.vo.SysMsgNoticeConfigVO)7 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)4 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)2 AccountVO (com.netsteadfast.greenstep.vo.AccountVO)2 SysVO (com.netsteadfast.greenstep.vo.SysVO)2 Transactional (org.springframework.transaction.annotation.Transactional)2 SysMsgNoticeVO (com.netsteadfast.greenstep.vo.SysMsgNoticeVO)1