|
@@ -63,18 +63,14 @@ public class KwaixiaodianItemGetController extends BaseController {
|
|
|
private ISysUserService sysUserService;
|
|
|
|
|
|
|
|
|
-
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
return AjaxResult.success(kwaixiaodianItemGetService.selectKwaixiaodianItemGetById(id));
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody KwaixiaodianItemGet kwaixiaodianItemGet)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody KwaixiaodianItemGet kwaixiaodianItemGet) {
|
|
|
return toAjax(kwaixiaodianItemGetService.updateKwaixiaodianItemGet(kwaixiaodianItemGet));
|
|
|
}
|
|
|
|
|
@@ -96,17 +92,28 @@ public class KwaixiaodianItemGetController extends BaseController {
|
|
|
throw new Exception("此用户未查询到归属公司");
|
|
|
}
|
|
|
requestMap.put("companyId", companyId);
|
|
|
- } else if ("industry_sale_manager".equals(roleId) || "industry_courtship_manager".equals(roleId) || "industry_purchase_manager".equals(roleId)) { // 经理角色查看部门下所有成员数据
|
|
|
+ } else if ("industry_sale_manager".equals(roleId)) { // 经理角色查看部门下所有成员数据
|
|
|
List<Long> userIds = kwaixiaodianItemGetService.getUserIds(userId);
|
|
|
if (Check.isNull(userIds)) {
|
|
|
throw new Exception("此用户未查询到部门成员信息");
|
|
|
}
|
|
|
requestMap.put("userIds", userIds);
|
|
|
- } else if ("industry_sale".equals(roleId) || "industry_purchase".equals(roleId) || "industry_courtship".equals(roleId)) { // 销售 采购 招商 查看自己的数据
|
|
|
+ } else if ("industry_sale".equals(roleId)) { // 销售 查看自己的数据
|
|
|
List<Long> userIds = new ArrayList<>();
|
|
|
userIds.add(userId);
|
|
|
requestMap.put("userIds", userIds);
|
|
|
+ } else if ("industry_courtship_manager".equals(roleId) || "industry_purchase_manager".equals(roleId)) { // 招商、采购经理角色查看部门下所有成员数据
|
|
|
+ List<Long> courtshipPurchaseIds = kwaixiaodianItemGetService.getUserIds(userId);
|
|
|
+ if (Check.isNull(courtshipPurchaseIds)) {
|
|
|
+ throw new Exception("此用户未查询到部门成员信息");
|
|
|
+ }
|
|
|
+ requestMap.put("courtshipPurchaseIds", courtshipPurchaseIds);
|
|
|
+ } else if ("industry_purchase".equals(roleId) || "industry_courtship".equals(roleId)) { // 采购 招商 查看自己的数据
|
|
|
+ List<Long> courtshipPurchaseIds = new ArrayList<>();
|
|
|
+ courtshipPurchaseIds.add(userId);
|
|
|
+ requestMap.put("courtshipPurchaseIds", courtshipPurchaseIds);
|
|
|
}
|
|
|
+
|
|
|
if (!Check.isNull(itemId)) {
|
|
|
requestMap.put("itemId", itemId);
|
|
|
}
|