diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesSettlementEntity.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesSettlementEntity.java index 33463b8b0..8e06a48ff 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesSettlementEntity.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesSettlementEntity.java @@ -1,5 +1,6 @@ package com.logpm.aftersales.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import lombok.Data; @@ -68,7 +69,14 @@ public class AftersalesSettlementEntity extends TenantEntity { private Date overTime; - + @TableField(exist=false) + private String workOrderNumbers; + @TableField(exist=false) + private String orderCodes; + @TableField(exist=false) + private Date startCreateTime; + @TableField(exist=false) + private Date endCreateTime; diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java index f8bc575e2..d8d104013 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java @@ -19,15 +19,14 @@ package com.logpm.aftersales.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - -import java.math.BigDecimal; -import java.util.Date; +import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; +import java.util.Date; + /** * 客服异常工单 实体类 * @@ -332,6 +331,15 @@ public class AftersalesWorkOrderEntity extends TenantEntity { /** * 金额总和 */ + @TableField(exist=false) + private String workOrderNumbers; + @TableField(exist=false) + private String orderCodes; + @TableField(exist=false) + private Date startCreateTime; + @TableField(exist=false) + private Date endCreateTime; + @TableField(exist=false) private String totalAmountNum; @TableField(exist=false) 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/dto/AftersalesAppealDTO.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesAppealDTO.java index d7ab92fe8..fe27fa427 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesAppealDTO.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesAppealDTO.java @@ -21,6 +21,7 @@ import com.logpm.aftersales.entity.AftersalesAppealPeopleEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.Date; import java.util.List; /** @@ -66,5 +67,12 @@ public class AftersalesAppealDTO extends AftersalesAppealEntity { */ private Long createUserId; + /** 范围查找工单 */ + private String workOrderNumbers; + /** 范围查找订单 */ + private String orderCodes; + /** 范围查找创建时间 */ + private Date startCreateTime; + private Date endCreateTime; } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml index e8189e8cd..778bc19b8 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml @@ -57,6 +57,21 @@ LEFT JOIN logpm_aftersales_completion_record lacr on laa.work_order_id = lacr.work_order_id LEFT JOIN logpm_aftersales_work_order lawo ON lawo.id = lacr.work_order_id laa.is_deleted = 0 + + and lawo.work_order_number in + + #{workOrderNumber} + + + + and lawo.order_code in + + #{orderCode} + + + + and lawo.create_time between #{param.startCreateTime} and #{param.endCreateTime} + and (lacr.warehouse_id = #{param.warehouseId } or laa.create_user = #{param.createUserId}) 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 74ea58671..9bd148bfc 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 @@ -96,9 +96,6 @@ GROUP_CONCAT(DISTINCT lapr.compensation_method) AS compensationMethods FROM logpm_aftersales_work_order lawo - LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id - AND lap.types_of = '2' - AND lap.conditions IN ( 1, 2 ) LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id AND lacr.is_deleted = '0' LEFT JOIN (SELECT @@ -117,8 +114,24 @@ 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_number in + + #{workOrderNumber} + + + + and lawo.order_code in + + #{orderCode} + + + + and lawo.create_time between #{param.startCreateTime} and #{param.endCreateTime} + and lawo.work_order_status = #{param.workOrderStatusNameS } and lawo.id = #{param.id } and lawo.work_order_type = #{param.workOrderType } @@ -147,7 +160,6 @@ and lawo.customer_service_name like concat('%', #{param.customerServiceName },'%') and lawo.waybill_mall_id = #{param.waybillMallId } and lawo.problem_description = #{param.problemDescription} - and (lap.warehouse_id = #{param.warehouseId} OR lap.business_id = #{param.warehouseId}) and lawo.person_responsible = #{param.personResponsible } and lawo.process_number = #{param.processNumber } and lawo.reviewed_by = #{param.reviewedBy } @@ -160,10 +172,9 @@ and lawo.work_order_status IN ( '10', '20', '21', '30', '40', '50', '60', '70', '80', '90' ,'100','110') - and lawo.work_order_status in ('10') and lap.types_of = '2' and lap.processing_status in ('1') - and lawo.work_order_status in ('20') and lap.types_of = '2' - and lawo.work_order_status in (21,30) and lap.processing_status = '4' - and lap.types_of = '2' + and lawo.work_order_status in ('10') + and lawo.work_order_status in ('20') + and lawo.work_order_status in (21,30) and lawo.work_order_status in (80,100,70) and lawo.work_order_type = #{param.workOrderType } and lawo.discovery_node = #{param.discoveryNode } @@ -177,6 +188,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 @@ -291,6 +308,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 } @@ -559,6 +578,21 @@ lap.conditions != '3' and lap.is_deleted = 0 and law.id is not null and lap.processing_status in ('1','3') and lap.types_of = '2' and law.work_order_status in ('10','20','30') + + and law.work_order_number in + + #{workOrderNumber} + + + + and law.order_code in + + #{orderCode} + + + + and law.create_time between #{param.startCreateTime} and #{param.endCreateTime} + and law.work_order_status = #{param.workOrderStatusNameS } and law.operator = #{param.operator } and law.work_order_status = #{param.workOrderStatus} @@ -686,6 +720,21 @@ LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lapr.work_order_id lawo.work_order_status = 90 and lap.is_deleted = 0 + + and lawo.work_order_number in + + #{workOrderNumber} + + + + and lawo.order_code in + + #{orderCode} + + + + and lawo.create_time between #{param.startCreateTime} and #{param.endCreateTime} + and lap.business_id =#{param.businessId} and lap.business_name LIKE CONCAT( #{param.businessName}, '%') and lawo.work_order_number LIKE CONCAT( #{param.workOrderNumber}, '%') 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; + } + + }