|
|
@@ -1,10 +1,14 @@
|
|
|
package com.goafanti.customer.service.impl;
|
|
|
|
|
|
+import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.dao.UserArchivesMapper;
|
|
|
+import com.goafanti.common.dao.UserMapper;
|
|
|
import com.goafanti.common.model.OrganizationContactBook;
|
|
|
+import com.goafanti.common.model.User;
|
|
|
import com.goafanti.common.model.UserArchives;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
+import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.customer.bo.UserArchivesDetails;
|
|
|
import com.goafanti.customer.service.CustomerService;
|
|
|
import com.goafanti.customer.service.UserArchivesService;
|
|
|
@@ -29,7 +33,8 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
|
|
|
private UserArchivesMapper userArchivesMapper;
|
|
|
@Resource
|
|
|
private CustomerService customerService;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private UserMapper userMapper;
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@@ -61,6 +66,20 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
|
|
|
return user;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean checkPermission(String id) {
|
|
|
+ User user = userMapper.selectByPrimaryKey(id);
|
|
|
+ if (user.getAid().equals(TokenManager.getAdminId())){
|
|
|
+ return false;
|
|
|
+ }else {
|
|
|
+ if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)&&!TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)
|
|
|
+ &&!TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 通过ID查询单条数据
|
|
|
*
|