From 74ed0dfbff05fe0fde45e24973e847a81493c127 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 12 Nov 2024 17:15:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E6=8F=90BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AftersalesCustomerMallController.java | 1 + .../mapper/AftersalesWorkOrderMapper.java | 2 +- .../mapper/AftersalesWorkOrderMapper.xml | 8 +++ .../impl/AftersalesWorkOrderServiceImpl.java | 52 +++++++++++++++---- 4 files changed, 52 insertions(+), 11 deletions(-) diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesCustomerMallController.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesCustomerMallController.java index 3ce8c831e..0510bf2d2 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesCustomerMallController.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesCustomerMallController.java @@ -31,6 +31,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.core.secure.BladeUser; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java index 7f4e95795..1454da6bc 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java @@ -70,7 +70,7 @@ public interface AftersalesWorkOrderMapper extends BaseMapper pageListOwn(IPage page,@Param("param") AftersalesWorkOrderEntity workOrderEntity); + IPage pageListOwn(IPage page,@Param("param") AftersalesWorkOrderEntity workOrderEntity,@Param("warehouseIds") List warehouseIds); boolean updateList(@Param("list") List list); diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml index 17762225f..8c888b89f 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml @@ -187,6 +187,12 @@ and t.brand_name like concat('%',#{param.brandName},'%') and t.waybill_number like concat('%',#{param.waybillNumber},'%') and t.package_code like concat('%',#{param.packageCode},'%') + + and lap.business_id IN + + #{warehouseId} + + group by lawo.id ORDER BY lawo.create_time DESC @@ -301,6 +307,8 @@ GROUP BY a.id) AS t ON t.id = lawo.id LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id AND lapr.is_deleted = 0 + LEFT JOIN logpm_aftersales_processor AS lap ON lawo.id = lap.work_order_id AND lap.is_deleted = 0 + lawo.is_deleted = 0 and lawo.work_order_status = #{param.workOrderStatusNameS } 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 2cc4fa25c..de5fe2c24 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 @@ -902,7 +902,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl roleList = Arrays.asList(user.getRoleName().split(",")); String tenantId = user.getTenantId(); - + boolean b = judgeIsCustomerService(user); // 查询 状态条件 List warehouseType = DictBizCache.getList("after_sales_visits"); if (warehouseType.isEmpty()) { @@ -937,8 +937,23 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl warehouseIds = new ArrayList<>(); + if (!Objects.isNull(myCurrentWarehouse)){ + warehouseIds.add(myCurrentWarehouse.getId()); + }else { + //获取当前人所有仓权限信息 + List warehouseList = warehouseClient.getMyWarehouseList(); + if (!warehouseList.isEmpty()) { + warehouseIds.addAll(warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList())); + } + } + if (warehouseIds.isEmpty()) { + throw new CustomerException("当前登录人无仓库信息,请联系管理人员!!!"); + + } AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class); - IPage iPage = baseMapper.pageListOwn(page, workOrderEntity); + IPage iPage = baseMapper.pageListOwn(page, workOrderEntity,warehouseIds); if (iPage.getRecords().isEmpty()) { log.error(">>>>>>>>>>>>>>>>>>查询工单列表为空"); IPage data = AftersalesWorkOrderWrapper.build().pageVO(iPage); @@ -1050,14 +1065,6 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl aftersalesWorkOrder, Object workOrderStatus) { - // 对其他情况的工单状态更新逻辑 - // 优化后的代码根据实际情况进行填充 - BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if (ObjectUtils.isNotNull(myCurrentWarehouse)) { - aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId()); - } else { - throw new ServiceException("请选择仓库!"); - } //已处理 if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yichuli.getValue())) { aftersalesWorkOrder.remove("workOrderStatus"); @@ -2634,4 +2641,29 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl roleList = Arrays.asList(user.getRoleName().split(",")); + List warehouseType = DictBizCache.getList("after_sales_visits"); + Optional matchingDictBiz = warehouseType.stream() + .filter(i -> roleList.contains(i.getDictValue())) + .findFirst(); + if (matchingDictBiz.isPresent()) { + return true; + } + return false; + }else { + log.error("当前登录人角色信息错误!!!"); + } + return false; + } + + }