| | |
| | | BaseRolePageDao baseRolePageDao; |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public List<BaseRolePage> getBaseRolePageList(String roleId, String pageId) { |
| | | public List<BaseRolePage> getBaseRolePageList(Long roleId, Long pageId) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | if (StringUtils.isNotBlank(roleId)) { |
| | | if (roleId!=null) { |
| | | params.put("roleId", roleId); |
| | | } |
| | | if (StringUtils.isNotBlank(pageId)) { |
| | | if (pageId!=null) { |
| | | params.put("pageId", pageId); |
| | | } |
| | | return this.baseRolePageDao.getBaseRolePageList(params); |
| | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public BaseRolePage insertBaseRolePage(BaseRolePage baseRolePage) { |
| | | try { |
| | | if (baseRolePage.getId() == null) { |
| | | baseRolePage.setId(IDUtils.uuid()); |
| | | } |
| | | // if (baseRolePage.getId() == null) { |
| | | // baseRolePage.setId(IDUtils.uuid()); |
| | | // } |
| | | this.baseRolePageDao.insertBaseRolePage(baseRolePage); |
| | | return baseRolePage; |
| | | } catch (DuplicateKeyException ex) { |
| | |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public boolean deleteBaseRolePage(String roleId) { |
| | | public void batchInsertBaseRolePage(List<BaseRolePage> baseRolePages) { |
| | | try { |
| | | // if (baseRolePage.getId() == null) { |
| | | // baseRolePage.setId(IDUtils.uuid()); |
| | | // } |
| | | this.baseRolePageDao.batchInsertBaseRolePage(baseRolePages); |
| | | } catch (DuplicateKeyException ex) { |
| | | logger.warn(ex.getMessage(), ex); |
| | | throw new AlarmException(AlarmCode.DATA_DUPLICATE, MessageUtil.getMessage(AlarmCode.DATA_DUPLICATE.getCode())); |
| | | } catch (DataIntegrityViolationException ex) { |
| | | logger.warn(ex.getMessage(), ex); |
| | | throw new AlarmException(AlarmCode.DATA_CONFICT, MessageUtil.getMessage(AlarmCode.DATA_CONFICT.getCode())); |
| | | } catch (DataAccessException ex) { |
| | | logger.error(ex.getMessage(), ex); |
| | | throw new BusinessException(ExceptionEnumCode.DB_ERR, MessageUtil.getMessageByCode(ExceptionEnumCode.DB_ERR.getCode()), ex); |
| | | } |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public boolean deleteBaseRolePage(Long roleId) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("roleId", roleId); |