|
|
@@ -16,6 +16,7 @@ import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.customer.bo.BusinessListBo;
|
|
|
import com.goafanti.customer.bo.FollowBusinessBo;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -39,6 +40,13 @@ public class RestrictProjectServiceImpl extends BaseMybatisDao<RestrictProjectMa
|
|
|
@Resource
|
|
|
private BusinessProjectMapper businessProjectMapper;
|
|
|
|
|
|
+ @Value(value = "${yxzj_max}")
|
|
|
+ private Integer YXZJ_MAX = null;
|
|
|
+ @Value(value = "${yxy_max}")
|
|
|
+ private Integer YXY_MAX = null;
|
|
|
+ @Value(value = "${yxjl_max}")
|
|
|
+ private Integer YXJL_MAX = null;
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
@@ -263,4 +271,26 @@ public class RestrictProjectServiceImpl extends BaseMybatisDao<RestrictProjectMa
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean checkMax() {
|
|
|
+ int i = userMapper.checkUserMax(TokenManager.getAdminId());
|
|
|
+ int limitmax=100;
|
|
|
+ //加入限定项目的数量
|
|
|
+ int rpCount =restrictProjectMapper.selectPrivateByAid(TokenManager.getAdminId());
|
|
|
+ i=i+rpCount+1;
|
|
|
+ if (TokenManager.hasRole(AFTConstants.SALESMAN_DIRECTOR)){
|
|
|
+ if(limitmax<YXZJ_MAX)limitmax = YXZJ_MAX;
|
|
|
+ } else if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)){
|
|
|
+ if(limitmax<YXJL_MAX)limitmax = YXJL_MAX;
|
|
|
+
|
|
|
+ } else if (TokenManager.hasRole(AFTConstants.SALESMAN)){
|
|
|
+ if(limitmax<YXY_MAX)limitmax = YXY_MAX;
|
|
|
+
|
|
|
+ }
|
|
|
+ if (i >= limitmax) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|