|
|
@@ -9,6 +9,7 @@ import com.uas.platform.b2c.common.account.service.ResourceService;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
@@ -18,6 +19,12 @@ public class ResourceServiceImpl implements ResourceService {
|
|
|
@Autowired
|
|
|
private ResourceDao resourceDao;
|
|
|
|
|
|
+ /**
|
|
|
+ * 商城运营商企业UU号
|
|
|
+ */
|
|
|
+ @Value("#{sys.enUU}")
|
|
|
+ private Long enUU;
|
|
|
+
|
|
|
/* @Autowired
|
|
|
private MallAdministratorsDao mallAdministratorsDao;*/
|
|
|
|
|
|
@@ -25,18 +32,25 @@ public class ResourceServiceImpl implements ResourceService {
|
|
|
public List<Resource> findAll() {
|
|
|
/* List<MallAdministrators> admins = mallAdministratorsDao
|
|
|
.findByAdenuu(SystemSession.getUser().getEnterprise().getUu());*/
|
|
|
- List<Resource> resources = resourceDao.findAll();
|
|
|
- /*if (!CollectionUtils.isEmpty(resources)) {
|
|
|
- if (CollectionUtils.isEmpty(admins)) {// 如果不存在商城管理员设置权限,这个不显示出来
|
|
|
+ List<Resource> resources = getAllChildResource(0L);
|
|
|
+ if (!CollectionUtils.isEmpty(resources)) {
|
|
|
+ if (!SystemSession.getUser().getEnterprise().getUu().equals(enUU)) {// 如果不存在商城管理员设置权限,这个不显示出来
|
|
|
for (Iterator<Resource> it = resources.iterator(); it.hasNext();) {
|
|
|
Resource re = it.next();
|
|
|
- if (re.getName().equals("优软商城后台-管理")) {
|
|
|
+ if (re.getName().equals("优软商城-管理员")) {
|
|
|
it.remove();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }*/
|
|
|
+ }
|
|
|
return resources;
|
|
|
}
|
|
|
+ public List<Resource> getAllChildResource(Long parentid) {
|
|
|
+ List<Resource> resourceList = resourceDao.findByParentid(parentid);
|
|
|
+ for (Resource res : resourceList) {
|
|
|
+ res.setChildren(getAllChildResource(res.getId()));
|
|
|
+ }
|
|
|
+ return resourceList;
|
|
|
+ }
|
|
|
|
|
|
}
|