예제 #1
0
 @Transactional(readOnly = false)
 public void saveSysRole(SysRole sysrole) {
   sysrole.setId(IdUtils.uuid2());
   sysrole.setCreateuser(ShiroDbRealm.getCurrentLoginName());
   sysrole.setDeleteflag(AppConstants.IS_STATUS_DEFAULT);
   sysroleMapper.insert(sysrole);
 }
예제 #2
0
 @Transactional(readOnly = false)
 public void updatePower(SysRoleView sysrole) {
   sysrole.setCreateuser(ShiroDbRealm.getCurrentLoginName());
   for (SysFunctionView sysFunction : sysrole.getFunctions()) {
     sysFunction.setRole_function_id(IdUtils.uuid2());
   }
   SysRole sys = sysroleMapper.findOne(sysrole.getId());
   if (sys != null && !sys.getRoleName().equals(sysrole.getRoleName())) {
     sys.setRoleName(sysrole.getRoleName());
     sys.setModifyuser(ShiroDbRealm.getCurrentLoginName());
     sysroleMapper.update(sys);
   }
   sysroleMapper.deleteRoleFunction(sysrole);
   sysroleMapper.insertRoleFunction(sysrole);
 }
예제 #3
0
 @Transactional(readOnly = false)
 public int saveDevice(DeviceView deviceView) {
   if (deviceView == null
       || deviceView.getAreaid() == null
       || deviceView.getName() == null
       || deviceView.getTypeid() == null
       || deviceView.getIp() == null) {
     return 0;
   }
   String mac = deviceView.getMac();
   if (mac != null) {
     mac = mac.toUpperCase();
     deviceView.setMac(mac);
   }
   deviceView.setId(IdUtils.uuid2());
   deviceView.setCreateuser(ShiroDbRealm.getCurrentLoginName());
   return deviceMapper.insert(deviceView);
 }