use of com.netsteadfast.greenstep.vo.SysCodeVO in project bamboobsc by billchen198318.
the class SystemSettingConfigureUtils method updateParam1.
public static void updateParam1(String code, String value) throws ServiceException, Exception {
SysCodeVO sysCode = new SysCodeVO();
sysCode.setType(CODE_TYPE);
sysCode.setCode(code);
DefaultResult<SysCodeVO> result = sysCodeService.findByUK(sysCode);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
sysCode = result.getValue();
sysCode.setParam1(value);
result = sysCodeService.updateObject(sysCode);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
}
use of com.netsteadfast.greenstep.vo.SysCodeVO in project bamboobsc by billchen198318.
the class SystemSettingConfigureUtils method getCode.
public static SysCodeVO getCode(String code) {
SysCodeVO sysCode = new SysCodeVO();
sysCode.setType(CODE_TYPE);
sysCode.setCode(code);
try {
DefaultResult<SysCodeVO> result = sysCodeService.findByUK(sysCode);
if (result.getValue() != null) {
sysCode = result.getValue();
}
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return sysCode;
}
use of com.netsteadfast.greenstep.vo.SysCodeVO in project bamboobsc by billchen198318.
the class RoleLogicServiceImpl method getDefaultUserRole.
/**
* 使用者設的role-id(角色), 它設定在 tb_sys_code中
*
* @return
* @throws ServiceException
* @throws Exception
*/
@ServiceMethodAuthority(type = { ServiceMethodType.SELECT })
public String getDefaultUserRole() throws ServiceException, Exception {
String role = "";
SysCodeVO sysCode = new SysCodeVO();
sysCode.setType(DEFAULT_ROLE_CODE_TYPE);
sysCode.setCode(DEFAULT_ROLE_CODE);
DefaultResult<SysCodeVO> result = this.sysCodeService.findByUK(sysCode);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
sysCode = result.getValue();
role = sysCode.getParam1();
if (super.isBlank(role)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
}
Map<String, Object> params = new HashMap<String, Object>();
params.put("role", role);
if (this.roleService.countByParams(params) != 1) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
}
return role;
}
Aggregations