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