Browse Source

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@849 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d

administrator 11 years ago
parent
commit
6471beeb71

+ 2 - 2
src/main/java/com/uas/platform/b2b/dao/AuthorityDao.java

@@ -3,9 +3,9 @@ package com.uas.platform.b2b.dao;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
 
-import com.uas.platform.b2b.model.Authority;
+import com.uas.platform.b2b.model.Resource;
 
 @Repository
-public interface AuthorityDao extends JpaRepository<Authority, Long> {
+public interface AuthorityDao extends JpaRepository<Resource, Long> {
 
 }

+ 2 - 2
src/main/java/com/uas/platform/b2b/dao/ResourceDao.java

@@ -3,9 +3,9 @@ package com.uas.platform.b2b.dao;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
 
-import com.uas.platform.b2b.model.Resource;
+import com.uas.platform.b2b.model.ResourceItem;
 
 @Repository
-public interface ResourceDao extends JpaRepository<Resource, Long> {
+public interface ResourceDao extends JpaRepository<ResourceItem, Long> {
 
 }

+ 5 - 11
src/main/java/com/uas/platform/b2b/filter/SecurityInterceptor.java

@@ -36,8 +36,7 @@ import org.springframework.security.web.context.HttpSessionSecurityContextReposi
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
-import com.uas.platform.b2b.model.Authority;
-import com.uas.platform.b2b.model.Resource;
+import com.uas.platform.b2b.model.ResourceItem;
 import com.uas.platform.b2b.model.Role;
 import com.uas.platform.b2b.model.SigninLog;
 import com.uas.platform.b2b.model.User;
@@ -240,15 +239,10 @@ public class SecurityInterceptor extends AbstractSecurityInterceptor implements
 					user.setIssys(Constant.YES);
 					break;
 				}
-				Set<Authority> authorities = role.getAuthorities();
-				if (!CollectionUtils.isEmpty(authorities)) {
-					for (Authority authority : authorities) {
-						Set<Resource> resources = authority.getResources();
-						if (!CollectionUtils.isEmpty(resources)) {
-							for (Resource res : resources) {
-								authSet.add(new SimpleGrantedAuthority(res.getName()));
-							}
-						}
+				Set<ResourceItem> resourceItems = role.getResourceItems();
+				if (!CollectionUtils.isEmpty(resourceItems)) {
+					for (ResourceItem res : resourceItems) {
+						authSet.add(new SimpleGrantedAuthority(res.getName()));
 					}
 				}
 			}

+ 0 - 108
src/main/java/com/uas/platform/b2b/model/Authority.java

@@ -1,108 +0,0 @@
-package com.uas.platform.b2b.model;
-
-import java.util.Set;
-
-import javax.persistence.Cacheable;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.OrderBy;
-import javax.persistence.SequenceGenerator;
-import javax.persistence.Table;
-
-import org.hibernate.annotations.Cache;
-import org.hibernate.annotations.CacheConcurrencyStrategy;
-
-/**
- * 权限
- * 
- * @author yingp
- *
- */
-@Table(name = "sec$authorities")
-@Entity
-@Cacheable
-@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "com.uas.platform.b2b.model.Authority")
-public class Authority {
-
-	@Id
-	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sec$authorities_gen")
-	@SequenceGenerator(name = "sec$authorities_gen", sequenceName = "sec$authorities_seq", allocationSize = 1)
-	@Column(name = "auth_id")
-	private Long id;
-
-	/**
-	 * 权限名称
-	 */
-	@Column(name = "auth_name")
-	private String name;
-
-	/**
-	 * 权限的具体作业范围描述
-	 */
-	@Column(name = "auth_desc")
-	private String desc;
-
-	/**
-	 * 权限可操控的资源
-	 */
-	@ManyToMany(cascade = { CascadeType.REFRESH }, fetch = FetchType.EAGER)
-	@JoinTable(name = "sec$authorityresource", joinColumns = @JoinColumn(name = "auth_id", referencedColumnName = "auth_id"), inverseJoinColumns = @JoinColumn(name = "res_id", referencedColumnName = "res_id"))
-	@OrderBy("id")
-	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
-	private Set<Resource> resources;
-	
-	/**
-	 * 所属企业UU
-	 */
-	@Column(name = "auth_enuu")
-	private Long enUU;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getDesc() {
-		return desc;
-	}
-
-	public void setDesc(String desc) {
-		this.desc = desc;
-	}
-
-	public Set<Resource> getResources() {
-		return resources;
-	}
-
-	public void setResources(Set<Resource> resources) {
-		this.resources = resources;
-	}
-
-	public Long getEnUU() {
-		return enUU;
-	}
-
-	public void setEnUU(Long enUU) {
-		this.enUU = enUU;
-	}
-
-}

+ 28 - 29
src/main/java/com/uas/platform/b2b/model/Resource.java

@@ -1,11 +1,18 @@
 package com.uas.platform.b2b.model;
 
+import java.util.Set;
+
 import javax.persistence.Cacheable;
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
 import javax.persistence.SequenceGenerator;
 import javax.persistence.Table;
 
@@ -13,10 +20,10 @@ import org.hibernate.annotations.Cache;
 import org.hibernate.annotations.CacheConcurrencyStrategy;
 
 /**
- * 系统可请求资源
+ * 资源表-主表
  * 
  * @author yingp
- * 
+ *
  */
 @Table(name = "sec$resources")
 @Entity
@@ -35,22 +42,22 @@ public class Resource {
 	 */
 	@Column(name = "res_name")
 	private String name;
+
 	/**
-	 * 资源类型GET、POST、PUT、DELETE等
-	 */
-	@Column(name = "res_method")
-	private String method;
-	/**
-	 * 资源请求URL链接
-	 */
-	@Column(name = "res_url")
-	private String url;
-	/**
-	 * 对资源的具体操作对象及行为的描述
+	 * 资源的具体作业描述
 	 */
 	@Column(name = "res_desc")
 	private String desc;
 
+	/**
+	 * 资源的详细清单
+	 */
+	@OneToMany(cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE }, fetch = FetchType.EAGER)
+	@JoinColumn(name = "item_resid")
+	@OrderBy("id")
+	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
+	private Set<ResourceItem> items;
+
 	public Long getId() {
 		return id;
 	}
@@ -67,22 +74,6 @@ public class Resource {
 		this.name = name;
 	}
 
-	public String getMethod() {
-		return method == null ? "" : method;
-	}
-
-	public void setMethod(String method) {
-		this.method = method;
-	}
-
-	public String getUrl() {
-		return url;
-	}
-
-	public void setUrl(String url) {
-		this.url = url;
-	}
-
 	public String getDesc() {
 		return desc;
 	}
@@ -91,4 +82,12 @@ public class Resource {
 		this.desc = desc;
 	}
 
+	public Set<ResourceItem> getItems() {
+		return items;
+	}
+
+	public void setItems(Set<ResourceItem> items) {
+		this.items = items;
+	}
+
 }

+ 94 - 0
src/main/java/com/uas/platform/b2b/model/ResourceItem.java

@@ -0,0 +1,94 @@
+package com.uas.platform.b2b.model;
+
+import javax.persistence.Cacheable;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Cache;
+import org.hibernate.annotations.CacheConcurrencyStrategy;
+
+/**
+ * 系统可请求资源
+ * 
+ * @author yingp
+ * 
+ */
+@Table(name = "sec$resourceitems")
+@Entity
+@Cacheable
+@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "com.uas.platform.b2b.model.ResourceItem")
+public class ResourceItem {
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sec$resourceitems_gen")
+	@SequenceGenerator(name = "sec$resourceitems_gen", sequenceName = "sec$resourceitems_seq", allocationSize = 1)
+	@Column(name = "item_id")
+	private Long id;
+
+	/**
+	 * 资源名称
+	 */
+	@Column(name = "item_name")
+	private String name;
+	/**
+	 * 资源类型GET、POST、PUT、DELETE等
+	 */
+	@Column(name = "item_method")
+	private String method;
+	/**
+	 * 资源请求URL链接
+	 */
+	@Column(name = "item_url")
+	private String url;
+	/**
+	 * 对资源的具体操作对象及行为的描述
+	 */
+	@Column(name = "item_desc")
+	private String desc;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getMethod() {
+		return method == null ? "" : method;
+	}
+
+	public void setMethod(String method) {
+		this.method = method;
+	}
+
+	public String getUrl() {
+		return url;
+	}
+
+	public void setUrl(String url) {
+		this.url = url;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
+}

+ 7 - 7
src/main/java/com/uas/platform/b2b/model/Role.java

@@ -64,11 +64,11 @@ public class Role implements Serializable {
 	 * 角色拥有的权限
 	 */
 	@ManyToMany(cascade = { CascadeType.REFRESH }, fetch = FetchType.EAGER)
-	@JoinTable(name = "sec$roleauthority", joinColumns = @JoinColumn(name = "role_id", referencedColumnName = "role_id"), inverseJoinColumns = @JoinColumn(name = "auth_id", referencedColumnName = "auth_id"))
+	@JoinTable(name = "sec$roleresource", joinColumns = @JoinColumn(name = "role_id", referencedColumnName = "role_id"), inverseJoinColumns = @JoinColumn(name = "res_id", referencedColumnName = "item_id"))
 	@OrderBy("id")
 	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
-	private Set<Authority> authorities;
-	
+	private Set<ResourceItem> resourceItems;
+
 	/**
 	 * 所属企业UU
 	 */
@@ -109,12 +109,12 @@ public class Role implements Serializable {
 		this.issys = issys;
 	}
 
-	public Set<Authority> getAuthorities() {
-		return authorities;
+	public Set<ResourceItem> getResourceItems() {
+		return resourceItems;
 	}
 
-	public void setAuthorities(Set<Authority> authorities) {
-		this.authorities = authorities;
+	public void setResourceItems(Set<ResourceItem> resourceItems) {
+		this.resourceItems = resourceItems;
 	}
 
 	public Long getEnUU() {

+ 3 - 3
src/main/java/com/uas/platform/b2b/support/CustomSecurityMetadataSource.java

@@ -17,7 +17,7 @@ import org.springframework.security.web.access.intercept.FilterInvocationSecurit
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 
 import com.uas.platform.b2b.dao.ResourceDao;
-import com.uas.platform.b2b.model.Resource;
+import com.uas.platform.b2b.model.ResourceItem;
 
 /**
  * 资源数据定义,将所有的资源和权限对应关系建立起来,即定义某一资源可以被哪些角色访问
@@ -44,8 +44,8 @@ public class CustomSecurityMetadataSource implements FilterInvocationSecurityMet
 	private void loadResourceDefine() {
 		if (resourceMap == null) {
 			resourceMap = new HashMap<String, Collection<ConfigAttribute>>();
-			List<Resource> resources = resourceDao.findAll();
-			for (Resource resource : resources) {
+			List<ResourceItem> resources = resourceDao.findAll();
+			for (ResourceItem resource : resources) {
 				Collection<ConfigAttribute> configAttributes = new ArrayList<ConfigAttribute>();
 				ConfigAttribute configAttribute = new SecurityConfig(resource.getName());
 				configAttributes.add(configAttribute);

+ 5 - 11
src/main/java/com/uas/platform/b2b/support/CustomUserDetailsService.java

@@ -14,8 +14,7 @@ import org.springframework.security.core.userdetails.UserDetailsService;
 import org.springframework.security.core.userdetails.UsernameNotFoundException;
 import org.springframework.util.CollectionUtils;
 
-import com.uas.platform.b2b.model.Authority;
-import com.uas.platform.b2b.model.Resource;
+import com.uas.platform.b2b.model.ResourceItem;
 import com.uas.platform.b2b.model.Role;
 import com.uas.platform.b2b.service.UserService;
 import com.uas.platform.core.model.Constant;
@@ -73,15 +72,10 @@ public class CustomUserDetailsService implements UserDetailsService {
 					user.setIssys(Constant.YES);
 					break;
 				}
-				Set<Authority> authorities = role.getAuthorities();
-				if (!CollectionUtils.isEmpty(authorities)) {
-					for (Authority authority : authorities) {
-						Set<Resource> resources = authority.getResources();
-						if (!CollectionUtils.isEmpty(resources)) {
-							for (Resource res : resources) {
-								authSet.add(new SimpleGrantedAuthority(res.getName()));
-							}
-						}
+				Set<ResourceItem> resourceItems = role.getResourceItems();
+				if (!CollectionUtils.isEmpty(resourceItems)) {
+					for (ResourceItem res : resourceItems) {
+						authSet.add(new SimpleGrantedAuthority(res.getName()));
 					}
 				}
 			}

+ 35 - 0
src/main/webapp/resources/css/index.css

@@ -1156,6 +1156,41 @@ a {
   	background: #fff;
   	z-index: 2;
 }
+/*account*/
+.resource-container {
+	padding: 15px;
+}
+
+.simple-list {
+	padding: 10px 15px;
+}
+
+.simple-list>li {
+	clear: both;
+	display: block;
+	height: 26px;
+	line-height: 26px;
+	padding: 8px 10px 8px 15px;
+	position: relative;
+}
+
+.simple-list>li:before {
+	position: absolute;
+	left: 0;
+	top: 5px;
+	content: "."
+}
+
+.simple-list>li .title {
+	width: 200px;
+	float: left;
+}
+
+.simple-list>li .content {
+	float: left;
+	color: #999;
+}
+
 /*attach*/
 .global_icon {
 	background: url("../img/merge/full_ico.png") no-repeat bottom right;

+ 7 - 7
src/main/webapp/resources/css/serve.css

@@ -692,6 +692,13 @@ a {
 	color: #2a6496;
 }
 
+.simple-list>li:before {
+	position: absolute;
+	left: 0;
+	top: 5px;
+	content: "."
+}
+
 .self-list {
 	padding: 0 20px;
 }
@@ -716,13 +723,6 @@ a {
 	text-align: center;
 }
 
-.simple-list>li:before {
-	position: absolute;
-	left: 0;
-	top: 5px;
-	content: "."
-}
-
 .contact-container .inner {
 	height: 500px;
 	padding: 20px;

+ 24 - 21
src/main/webapp/resources/js/index/app.js

@@ -470,7 +470,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 			$scope.count = date;
 		});
 	});
-	app.controller('CustomerCtrl', function($scope, $rootScope, VendorService, BaseService, ngTableParams){
+	app.controller('CustomerCtrl', function($scope, VendorService, BaseService, ngTableParams){
 		$scope.customerParams = new ngTableParams({
 			page : 1, 
 			count : 10,
@@ -505,7 +505,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		}
 		return fn;
 	};
-	app.controller('SaleOrderCtrl', function($scope, $rootScope, $filter, PurcOrderItem, ngTableParams, 
+	app.controller('SaleOrderCtrl', function($scope, $filter, PurcOrderItem, ngTableParams, 
 		toaster, ReportService, BaseService, PurcOrderItemHis){
 		$scope.active = 'todo';
 		$scope.dateZoneText = '一个月内';
@@ -700,7 +700,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 			}
 		};
 	});
-	app.controller('SaleChangeCtrl', function($scope, $rootScope, $filter, PurcChange, ngTableParams, toaster, BaseService, PurcChangeHis){
+	app.controller('SaleChangeCtrl', function($scope, $filter, PurcChange, ngTableParams, toaster, BaseService, PurcChangeHis){
 		$scope.active = 'todo';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -794,7 +794,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 			}
 		};
 	});
-	app.controller('SaleInquiryCtrl', function($scope, $rootScope, $filter, PurcInquiry, ngTableParams, toaster, BaseService, PurcInquiryHis){
+	app.controller('SaleInquiryCtrl', function($scope, $filter, PurcInquiry, ngTableParams, toaster, BaseService, PurcInquiryHis){
 		$scope.active = 'todo';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -1008,7 +1008,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 			}
 		};
 	});
-	app.controller('SaleNoticeCtrl', function($scope, $rootScope, $filter, PurcNotice, ngTableParams, toaster, BaseService, PurcNoticeHis, $modal){
+	app.controller('SaleNoticeCtrl', function($scope, $filter, PurcNotice, ngTableParams, toaster, BaseService, PurcNoticeHis, $modal){
 		$scope.active = 'todo';
 		$scope.dateZoneText = '一个月内';
 		$scope.condition = {dateZone: 1};
@@ -1202,7 +1202,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 发货单
 	 */
-	app.controller('SaleSendCtrl', function($scope, $rootScope, $filter, SaleSend, ngTableParams, toaster, BaseService, Symbol){
+	app.controller('SaleSendCtrl', function($scope, $filter, SaleSend, ngTableParams, toaster, BaseService, Symbol){
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -1263,7 +1263,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 客户打样申请
 	 */
-	app.controller('SaleSampleCtrl', function($scope, $rootScope, $filter, PurcSample, ngTableParams, toaster, $modal, BaseService, Symbol){
+	app.controller('SaleSampleCtrl', function($scope, $filter, PurcSample, ngTableParams, toaster, $modal, BaseService, Symbol){
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -1384,7 +1384,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 客户认定单
 	 */
-	app.controller('SaleApprovalCtrl', function($scope, $rootScope, $filter, PurcApproval, ngTableParams, toaster, BaseService, Symbol){
+	app.controller('SaleApprovalCtrl', function($scope, $filter, PurcApproval, ngTableParams, toaster, BaseService, Symbol){
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -1445,7 +1445,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 客户采购预测
 	 */
-	app.controller('SaleForecastCtrl', function($scope, $rootScope, $filter, PurcForecast, ngTableParams, toaster, BaseService, Symbol){
+	app.controller('SaleForecastCtrl', function($scope, $filter, PurcForecast, ngTableParams, toaster, BaseService, Symbol){
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -1506,7 +1506,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 客户采购验收
 	 */
-	app.controller('SaleAcceptCtrl', function($scope, $rootScope, $filter, PurcAccept, ngTableParams, toaster, BaseService, Symbol){
+	app.controller('SaleAcceptCtrl', function($scope, $filter, PurcAccept, ngTableParams, toaster, BaseService, Symbol){
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -1567,7 +1567,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 客户采购验退
 	 */
-	app.controller('SaleReturnsCtrl', function($scope, $rootScope, $filter, PurcReturn, ngTableParams, toaster, BaseService, Symbol){
+	app.controller('SaleReturnsCtrl', function($scope, $filter, PurcReturn, ngTableParams, toaster, BaseService, Symbol){
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -1627,7 +1627,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 客户不良品入库
 	 */
-	app.controller('SaleBadInCtrl', function($scope, $rootScope, $filter, PurcBadIn, ngTableParams, toaster, BaseService, Symbol){
+	app.controller('SaleBadInCtrl', function($scope, $filter, PurcBadIn, ngTableParams, toaster, BaseService, Symbol){
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -1687,7 +1687,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 客户不良品出库
 	 */
-	app.controller('SaleBadOutCtrl', function($scope, $rootScope, $filter, PurcBadOut, ngTableParams, toaster, BaseService, Symbol){
+	app.controller('SaleBadOutCtrl', function($scope, $filter, PurcBadOut, ngTableParams, toaster, BaseService, Symbol){
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -1747,7 +1747,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 客户MRB
 	 */
-	app.controller('SaleMRBCtrl', function($scope, $rootScope, $filter, PurcMRB, ngTableParams, toaster, BaseService, Symbol){
+	app.controller('SaleMRBCtrl', function($scope, $filter, PurcMRB, ngTableParams, toaster, BaseService, Symbol){
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -1807,7 +1807,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 客户应付发票
 	 */
-	app.controller('SaleApBillCtrl', function($scope, $rootScope, $filter, PurcApBill, ngTableParams, toaster, BaseService, Symbol){
+	app.controller('SaleApBillCtrl', function($scope, $filter, PurcApBill, ngTableParams, toaster, BaseService, Symbol){
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -1865,7 +1865,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		
 	});
 	
-	app.controller('EnterpriseCtrl', function($scope, $rootScope, AccountEnterprise){
+	app.controller('EnterpriseCtrl', function($scope, AccountEnterprise){
 		AccountEnterprise.get({}, function(data){
 			$scope.enterprise = data;
 		});
@@ -1886,7 +1886,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		});
 	});
 	
-	app.controller('UserCtrl', function($scope, $rootScope, $filter, AuthenticationService, AccountUser, BaseService, ngTableParams, toaster, $modal, $http){
+	app.controller('UserCtrl', function($scope, $filter, AuthenticationService, AccountUser, BaseService, ngTableParams, toaster, $modal, $http){
 		$scope.editing = false;
 		$scope.loading = true;
 		AuthenticationService.getAuthentication().success(function(data) {
@@ -2099,7 +2099,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
   		};
 	});
 	
-	app.controller('LogCtrl', function($scope, $rootScope, BaseService, ngTableParams, ErpLog, UsageLog){
+	app.controller('LogCtrl', function($scope, BaseService, ngTableParams, ErpLog, UsageLog){
 		$scope.erpParams = new ngTableParams({
 			page : 1, 
 			count : 5,
@@ -2142,13 +2142,16 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		});
 	});
 	
-	app.controller('ResourceCtrl', function($scope, $rootScope){
+	app.controller('ResourceCtrl', function($scope, AccountResource){
+		AccountResource.getAll({}, function(data){
+			$scope.resources = data;
+		});
 	});
 	
-	app.controller('AuthorityCtrl', function($scope, $rootScope){
+	app.controller('AuthorityCtrl', function($scope){
 	});
 	
-	app.controller('RoleCtrl', function($scope, $rootScope){
+	app.controller('RoleCtrl', function($scope){
 	});
 	
 	/**

+ 6 - 0
src/main/webapp/resources/js/index/services/Account.js

@@ -44,5 +44,11 @@ define([ 'ngResource' ], function() {
 		return $resource('log/erp', {});
 	}).factory('UsageLog', function($resource) {
 		return $resource('log/usage', {});
+	}).factory('AccountResource', function($resource) {
+		return $resource('account/resource', {}, {
+			getAll: {
+				isArray: true
+			}
+		});
 	});
 });

+ 15 - 1
src/main/webapp/resources/tpl/index/account/resource.html

@@ -1 +1,15 @@
-资源
+<div class="block resource-container">
+	<div ng-repeat="resource in resources track by resource.id">
+		<div class="headerline">
+			<div class="index" ng-bind="$index+1"></div>
+			<div class="content" ng-bind="::resource.name"></div>
+			<div class="end text-simple f12" ng-bind="::resource.desc"></div>
+		</div>
+		<ul class="list-unstyled list-inline simple-list">
+			<li ng-repeat="item in resource.items track by item.id">
+				<div class="title" ng-bind="::item.name"></div>
+				<div class="content" ng-bind="::item.desc"></div>
+			</li>
+		</ul>
+	</div>
+</div>