public String execute() throws Exception { if (super.perExecute(null) != null) return returnCommand(); RoleManager roleMgr = (RoleManager) SpringContextHolder.getBean(Role.class); Filter filter = FilterFactory.getSimpleFilter("roleName", role.getRoleName(), Filter.OPERATOR_EQ); List<Role> roles = roleMgr.getObjects(filter); if ((role.getId() == null && roles.size() > 0) || (role.getId() != null && roles.size() > 1)) throw new BusinessException( I18NUtil.getStringByParameter("½ÇÉ«ÃûÖظ´", "Role", role.getRoleName())); String[] indexs = null; if (roleAuthorityIndex != null) indexs = roleAuthorityIndex.split(","); if (roles.size() == 0) { if (role.getId() == null) roles.add(new Role()); else { roles.add(role); } } Role _role = roles.get(0); _role.setDescription(role.getDescription()); _role.setDisplayRef(role.getDisplayRef()); _role.setRoleName(role.getRoleName()); // _role.setVersion(role.getVersion()); roleMgr.saveRoleAndAuthority(_role, roleAuthorities, indexs); super.postExecute(null); return returnCommand(); }
/** 新增/修改保存库存管理 */ public String saveGoodsKc() throws Exception { GoodsInfoManager goodsInfoMgr = (GoodsInfoManager) SpringContextHolder.getBean(GoodsInfo.class); if (super.perExecute(goodsInfo) != null) return returnCommand(); goodsInfoMgr.saveGoodsInfo(goodsInfo); super.postExecute(goodsInfo); return returnCommand(); }
/** 新增/修改保存商户支付配置 */ public String saveTblMchtPaymentConfig() throws Exception { TblMchtPaymentConfigManager tblMchtPaymentConfigMgr = (TblMchtPaymentConfigManager) SpringContextHolder.getBean(TblMchtPaymentConfig.class); if (super.perExecute(tblMchtPaymentConfig) != null) return returnCommand(); tblMchtPaymentConfigMgr.saveTblMchtPaymentConfig(tblMchtPaymentConfig); super.postExecute(tblMchtPaymentConfig); return returnCommand(); }