Search in sources :

Example 26 with SysVO

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

the class ApplicationSystemManagementAction method loadSysData.

private void loadSysData() throws ServiceException, Exception {
    this.transformFields2ValueObject(this.sys, new String[] { "oid" });
    DefaultResult<SysVO> result = this.sysService.findObjectByOid(this.sys);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.sys = result.getValue();
    TbSysIcon sysIcon = new TbSysIcon();
    sysIcon.setIconId(sys.getIcon());
    sysIcon = this.sysIconService.findByEntityUK(sysIcon);
    if (sysIcon != null) {
        this.editIconValue = super.defaultString(sysIcon.getOid());
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) TbSysIcon(com.netsteadfast.greenstep.po.hbm.TbSysIcon) SysVO(com.netsteadfast.greenstep.vo.SysVO)

Example 27 with SysVO

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

the class ApplicationSystemManagementSaveOrUpdateAction method update.

/**
	 * 更新 TB_SYS
	 * 
	 * @throws ControllerException
	 * @throws AuthorityException
	 * @throws ServiceException
	 * @throws Exception
	 */
private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    SysVO sys = new SysVO();
    sys.setOid(this.getFields().get("oid"));
    this.transformFields2ValueObject(sys, new String[] { "sysId", "name", "host", "contextPath" });
    if ("true".equals(super.getFields().get("isLocal"))) {
        sys.setIsLocal(YesNo.YES);
    } else {
        sys.setIsLocal(YesNo.NO);
    }
    DefaultResult<SysVO> result = this.applicationSystemLogicService.update(sys, super.getFields().get("icon"));
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() == null) {
        return;
    }
    this.success = IS_YES;
}
Also used : SysVO(com.netsteadfast.greenstep.vo.SysVO)

Example 28 with SysVO

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

the class SystemExpressionJobManagementAction method loadSysExprJobData.

private void loadSysExprJobData() throws ServiceException, Exception {
    this.transformFields2ValueObject(this.sysExprJob, new String[] { "oid" });
    DefaultResult<SysExprJobVO> result = this.sysExprJobService.findObjectByOid(this.sysExprJob);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.sysExprJob = result.getValue();
    SysVO sys = new SysVO();
    sys.setSysId(this.sysExprJob.getSystem());
    DefaultResult<SysVO> sysResult = this.sysService.findByUK(sys);
    if (sysResult.getValue() == null) {
        throw new ServiceException(sysResult.getSystemMessage().getValue());
    }
    sys = sysResult.getValue();
    this.getFields().put("systemOid", sys.getOid());
    SysExpressionVO expression = new SysExpressionVO();
    expression.setExprId(this.sysExprJob.getExprId());
    DefaultResult<SysExpressionVO> expressionResult = this.sysExpressionService.findByUK(expression);
    if (expressionResult.getValue() == null) {
        throw new ServiceException(expressionResult.getSystemMessage().getValue());
    }
    expression = expressionResult.getValue();
    this.getFields().put("expressionOid", expression.getOid());
}
Also used : SysExprJobVO(com.netsteadfast.greenstep.vo.SysExprJobVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysVO(com.netsteadfast.greenstep.vo.SysVO) SysExpressionVO(com.netsteadfast.greenstep.vo.SysExpressionVO)

Example 29 with SysVO

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

the class ApplicationSystemManagementSaveOrUpdateAction method delete.

/**
	 * 刪除 TB_SYS
	 * 
	 * @throws ControllerException
	 * @throws AuthorityException
	 * @throws ServiceException
	 * @throws Exception
	 */
private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
    SysVO sys = new SysVO();
    DefaultResult<Boolean> result = this.applicationSystemLogicService.delete(this.transformFields2ValueObject(sys, new String[] { "oid" }));
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() == null || !result.getValue()) {
        return;
    }
    this.success = IS_YES;
}
Also used : SysVO(com.netsteadfast.greenstep.vo.SysVO)

Example 30 with SysVO

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

the class CommonSelectItemsDataAction method queryItems.

private void queryItems() throws ServiceException, Exception {
    boolean pleaseSelect = YesNo.YES.equals(this.getFields().get("pleaseSelect"));
    if ("SYS".equals(this.getFields().get("type"))) {
        // 取 sys
        Map<String, String> sysMap = this.sysService.findSysMap(super.getBasePath(), pleaseSelect);
        this.resetPleaseSelectDataMapFromLocaleLang(sysMap);
        for (Map.Entry<String, String> entry : sysMap.entrySet()) {
            Map<String, String> dataMap = new HashMap<String, String>();
            dataMap.put("key", entry.getKey());
            dataMap.put("value", entry.getValue());
            this.items.add(dataMap);
        }
        this.success = IS_YES;
    }
    if ("SYS_PROG".equals(this.getFields().get("type"))) {
        // 取 sys_prog ITEM_TYPE='FOLDER'
        String sysOid = this.getFields().get("sysOid");
        SysVO sys = this.loadSysValueObj(sysOid);
        Map<String, String> sysProgMap = this.sysProgService.findSysProgFolderMap(super.getBasePath(), sys.getSysId(), MenuItemType.FOLDER, pleaseSelect);
        this.resetPleaseSelectDataMapFromLocaleLang(sysProgMap);
        for (Map.Entry<String, String> entry : sysProgMap.entrySet()) {
            Map<String, String> dataMap = new HashMap<String, String>();
            dataMap.put("key", entry.getKey());
            dataMap.put("value", entry.getValue());
            this.items.add(dataMap);
        }
        this.success = IS_YES;
    }
    if ("SYS_PROG_IN_MENU".equals(this.getFields().get("type"))) {
        // 取 sys_prog.prog_id 存在 tb_sys_menu 的資料 
        String sysOid = this.getFields().get("sysOid");
        SysVO sys = this.loadSysValueObj(sysOid);
        List<SysProgVO> menuProgList = this.sysProgService.findForInTheFolderMenuItems(sys.getSysId(), null, null);
        //this.items.add(super.providedSelectZeroDataMap(true));
        Map<String, String> dataMapFirst = new HashMap<String, String>();
        dataMapFirst.put("key", Constants.HTML_SELECT_NO_SELECT_ID);
        dataMapFirst.put("value", Constants.HTML_SELECT_NO_SELECT_NAME);
        this.resetPleaseSelectDataMapFromLocaleLang(dataMapFirst);
        this.items.add(dataMapFirst);
        if (menuProgList != null) {
            for (SysProgVO sysProg : menuProgList) {
                Map<String, String> dataMap = new HashMap<String, String>();
                dataMap.put("key", sysProg.getOid());
                dataMap.put("value", IconUtils.getMenuIcon(super.getBasePath(), sysProg.getIcon()) + StringEscapeUtils.escapeHtml4(sysProg.getName()));
                this.items.add(dataMap);
            }
        }
        this.success = IS_YES;
    }
}
Also used : HashMap(java.util.HashMap) SysProgVO(com.netsteadfast.greenstep.vo.SysProgVO) SysVO(com.netsteadfast.greenstep.vo.SysVO) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

SysVO (com.netsteadfast.greenstep.vo.SysVO)35 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)30 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)13 Transactional (org.springframework.transaction.annotation.Transactional)13 JsonParseException (com.fasterxml.jackson.core.JsonParseException)7 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)7 TbSys (com.netsteadfast.greenstep.po.hbm.TbSys)6 ISysService (com.netsteadfast.greenstep.service.ISysService)6 SysExpressionVO (com.netsteadfast.greenstep.vo.SysExpressionVO)3 HashMap (java.util.HashMap)3 SysCtxBeanVO (com.netsteadfast.greenstep.vo.SysCtxBeanVO)2 SysExprJobVO (com.netsteadfast.greenstep.vo.SysExprJobVO)2 SysIconVO (com.netsteadfast.greenstep.vo.SysIconVO)2 SysMsgNoticeConfigVO (com.netsteadfast.greenstep.vo.SysMsgNoticeConfigVO)2 SysTwitterVO (com.netsteadfast.greenstep.vo.SysTwitterVO)2 SysWsConfigVO (com.netsteadfast.greenstep.vo.SysWsConfigVO)2 TbSysIcon (com.netsteadfast.greenstep.po.hbm.TbSysIcon)1 SysBeanHelpVO (com.netsteadfast.greenstep.vo.SysBeanHelpVO)1 SysProgVO (com.netsteadfast.greenstep.vo.SysProgVO)1 Map (java.util.Map)1