yumeng пре 5 месеци
родитељ
комит
06deb2a920

+ 25 - 6
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KwaixiaodianItemGetController.java

@@ -102,15 +102,28 @@ public class KwaixiaodianItemGetController extends BaseController {
                 }
                 requestMap.put("companyId", companyId);
             } else if ("industry_sale_manager".equals(roleId)) { // 经理角色查看部门下所有成员数据
-                List<Long> userIds = kwaixiaodianItemGetService.getUserIds(userId);
+             /*   List<Long> userIds = kwaixiaodianItemGetService.getUserIds(userId);
                 if (Check.isNull(userIds)) {
                     throw new Exception("此用户未查询到部门成员信息");
                 }
-                requestMap.put("userIds", userIds);
+                requestMap.put("userIds", userIds);*/
+                Long companyId = kwaixiaodianItemGetService.getCompanyId(userId);
+                if (Check.isNull(companyId)) {
+                    throw new Exception("此用户未查询到归属公司");
+                }
+                requestMap.put("companyId", companyId);
+
             } else if ("industry_sale".equals(roleId)) { //   销售 查看自己的数据
-                List<Long> userIds = new ArrayList<>();
+            /*    List<Long> userIds = new ArrayList<>();
                 userIds.add(userId);
-                requestMap.put("userIds", userIds);
+                requestMap.put("userIds", userIds);*/
+
+                Long companyId = kwaixiaodianItemGetService.getCompanyId(userId);
+                if (Check.isNull(companyId)) {
+                    throw new Exception("此用户未查询到归属公司");
+                }
+                requestMap.put("companyId", companyId);
+
             } else if ("industry_courtship_manager".equals(roleId) || "industry_purchase_manager".equals(roleId)) { // 招商、采购经理角色查看部门下所有成员数据
 //                List<Long> courtshipPurchaseIds = kwaixiaodianItemGetService.getUserIds(userId);
 //                if (Check.isNull(courtshipPurchaseIds)) {
@@ -352,9 +365,15 @@ public class KwaixiaodianItemGetController extends BaseController {
                 }
                 requestMap.put("companyId", companyId);
             } else if ("industry_sale".equals(roleId)) { // 销售   查看自己的数据
-                List<Long> userIds = new ArrayList<>();
+               /* List<Long> userIds = new ArrayList<>();
                 userIds.add(userId);
-                requestMap.put("userIds", userIds);
+                requestMap.put("userIds", userIds);*/
+                companyId = kwaixiaodianItemGetService.getCompanyId(userId);
+                if (Check.isNull(companyId)) {
+                    throw new Exception("此用户未查询到归属公司");
+                }
+                requestMap.put("companyId", companyId);
+
             } else if ("industry_courtship_manager".equals(roleId) || "industry_purchase_manager".equals(roleId)) { // 招商、采购经理角色查看部门下所有成员数据
 //                List<Long> courtshipPurchaseIds = kwaixiaodianItemGetService.getUserIds(userId);
 //                if (Check.isNull(courtshipPurchaseIds)) {