From 523e3076226746ff05148bba2644055c9eca8646 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 28 Oct 2024 10:33:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E4=BF=AE=E5=A4=8D=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E5=A4=9A=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AftersalesWorkOrderServiceImpl.java | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index a4347d4c2..d8b2fcb93 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -898,7 +898,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl roleList = Arrays.asList(user.getRoleName().split(",")); String tenantId = user.getTenantId(); // 查询 状态条件 @@ -911,29 +911,30 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl>>>myCurrentWarehouse {}", myCurrentWarehouse); } - - Optional matchingDictBiz = warehouseType.stream() - .filter(i -> i.getDictValue().equals(roleName)) - .findFirst(); - - Object workOrderStatus = aftersalesWorkOrder.get("workOrderStatus"); - if (matchingDictBiz.isPresent()) { - String dictValue = matchingDictBiz.get().getDictKey(); - switch (dictValue) { - case "1": // 客服经理 - updateWorkOrderForManager(aftersalesWorkOrder, workOrderStatus); - break; - case "2": // 营业部客服 - updateWorkOrderForSales(aftersalesWorkOrder, workOrderStatus); - break; - case "3": // 职能客服 - updateWorkOrderForFunctional(aftersalesWorkOrder, workOrderStatus, user.getUserId()); - break; + if (!roleList.isEmpty()) { + Optional matchingDictBiz = warehouseType.stream() + .filter(i -> roleList.contains(i.getDictValue())) + .findFirst(); + Object workOrderStatus = aftersalesWorkOrder.get("workOrderStatus"); + if (matchingDictBiz.isPresent()) { + String dictValue = matchingDictBiz.get().getDictKey(); + switch (dictValue) { + case "1": // 客服经理 + updateWorkOrderForManager(aftersalesWorkOrder, workOrderStatus); + break; + case "2": // 营业部客服 + updateWorkOrderForSales(aftersalesWorkOrder, workOrderStatus); + break; + case "3": // 职能客服 + updateWorkOrderForFunctional(aftersalesWorkOrder, workOrderStatus, user.getUserId()); + break; + } + } else { + updateWorkOrderForOthers(aftersalesWorkOrder, workOrderStatus); } - } else { - updateWorkOrderForOthers(aftersalesWorkOrder, workOrderStatus); + }else { + throw new CustomerException("当前登录人无工单操作权限!!!"); } - AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class); IPage iPage = baseMapper.pageListOwn(page, workOrderEntity); if (iPage.getRecords().isEmpty()) {