Selaa lähdekoodia

feature:修改用户权限、修改客户导入

ZZH-wl 1 vuosi sitten
vanhempi
commit
9c0e37784f

+ 13 - 13
opms_admin/app/service/sys_user_datascope.go

@@ -132,16 +132,16 @@ func (s *UserService) GetDataScope(userInfo *request.UserInfo) (dataScope g.Map,
 	}
 
 	// 产品线数据权限
-	lineSrv, _ := NewLineService(s.Ctx)
-	productLineList, err := lineSrv.getCurrentUserProductAuth(userId)
-	if err != nil {
-		return nil, err
-	}
+	//lineSrv, _ := NewLineService(s.Ctx)
+	//productLineList, err := lineSrv.getCurrentUserProductAuth(userId)
+	//if err != nil {
+	//	return nil, err
+	//}
 	// 大项目授权数据权限
-	isBigProject, err := lineSrv.getCurrentUserBigProjectAuth(userId)
-	if err != nil {
-		return nil, err
-	}
+	//isBigProject, err := lineSrv.getCurrentUserBigProjectAuth(userId)
+	//if err != nil {
+	//	return nil, err
+	//}
 
 	// 地区数据权限
 	//regionSrv, _ := NewRegionService(s.Ctx)
@@ -207,10 +207,10 @@ func (s *UserService) GetDataScope(userInfo *request.UserInfo) (dataScope g.Map,
 		userIdArr.Add(userId)
 	}
 	//dataScope = g.Map{"userIds": userIdArr.Slice(), "cust_city_id": regionList, "product_line": productLineList}
-	dataScope = g.Map{"userIds": userIdArr.Slice(), "product_line": productLineList}
-	if isBigProject != "" {
-		dataScope["is_big"] = isBigProject
-	}
+	dataScope = g.Map{"userIds": userIdArr.Slice()}
+	//if isBigProject != "" {
+	//	dataScope["is_big"] = isBigProject
+	//}
 	dataScope["roles"] = userInfo.Roles
 	dataScope["posts"] = userInfo.Posts
 	return dataScope, nil

+ 3 - 3
opms_parent/app/service/cust/cust_customer.go

@@ -359,11 +359,11 @@ func (s *CustomerService) Import(ctx context.Context, req *contract.ExcelImportR
 			for _, tree := range treeList {
 				if tree.DistName == data.CustProvince {
 					province = tree
-					if data.CustCity != "" {
+					if data.CustCity != "" && province.Children != nil {
 						for _, cityData := range province.Children {
 							if cityData.DistName == data.CustCity {
 								city = cityData
-								if data.CustRegion != "" {
+								if data.CustRegion != "" && city.Children != nil {
 									for _, RegionData := range cityData.Children {
 										if RegionData.DistName == data.CustRegion {
 											region = RegionData
@@ -375,7 +375,7 @@ func (s *CustomerService) Import(ctx context.Context, req *contract.ExcelImportR
 					}
 				}
 			}
-			if (province.Id == 0) || (city.Id == 0 && data.CustCity != "") || (region.Id == 0 && data.CustRegion != "") {
+			if (province == nil) || (city == nil && data.CustCity != "") || (region == nil && data.CustRegion != "") {
 				return myerrors.TipsError("省市区填写错误,请检查后重试")
 			}