|
@@ -49,6 +49,7 @@ import com.jtgh.yjpt.common.Utils;
|
|
|
import com.jtgh.yjpt.controller.BaseController;
|
|
|
import com.jtgh.yjpt.entity.BaseEntity;
|
|
|
import com.jtgh.yjpt.entity.aqpjjgxx.AqpjjgxxEntity;
|
|
|
+import com.jtgh.yjpt.entity.auth.RoleEntity;
|
|
|
import com.jtgh.yjpt.entity.auth.UserEntity;
|
|
|
import com.jtgh.yjpt.entity.common.CodeEntity;
|
|
|
import com.jtgh.yjpt.entity.common.JsfxxwhEntity;
|
|
@@ -538,5 +539,52 @@ public class AuthenticateController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 用户权限:系统管理员、省级行政人员、市级行政人员、县级行政人员、企业用户
|
|
|
+ */
|
|
|
+ public BusinessContext UserAuth(){
|
|
|
+ BusinessContext bc = new BusinessContext();
|
|
|
+ String rtnStr = "";
|
|
|
+
|
|
|
+ UserEntity user = authenticateService.checkSession();
|
|
|
+
|
|
|
+ if(user.getSfjyr().equals("Y")){
|
|
|
+ rtnStr = "企业用户";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+
|
|
|
+ //判断是否管理员
|
|
|
+ Boolean isAdmin = false;
|
|
|
+ List<RoleEntity> roleList = user.getRoles();
|
|
|
+ for(RoleEntity role : roleList){
|
|
|
+ if(role.getName().equals("admin"))
|
|
|
+ isAdmin = true;
|
|
|
+ }
|
|
|
+ if(isAdmin){
|
|
|
+ rtnStr = "系统管理员";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ //------行政人员
|
|
|
+ //判断所在地深度:省、市、县
|
|
|
+ CodeEntity parentSzd = user.getSzd().getParent();
|
|
|
+ if(parentSzd!=null){
|
|
|
+ if(parentSzd.getParent()==null){
|
|
|
+ rtnStr="市级行政人员";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ rtnStr="县级行政人员";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ //parent 为null 省级
|
|
|
+ rtnStr ="省级行政人员";
|
|
|
+ }//end if else
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ bc.setResult(rtnStr);
|
|
|
+ return bc;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|