Browse Source

修改工单查询

single_db
caoyizhong 1 year ago
parent
commit
18b664717a
  1. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java
  2. 8
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  3. 24
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  4. 29
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

4
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java

@ -283,6 +283,10 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
* 处理仓库名称
*/
private String completionName;
/**
* 品牌名称
*/
private String brandName;

8
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -201,6 +201,14 @@ public class AftersalesWorkOrderController extends BladeController {
if(ObjectUtils.isNull(aftersalesWorkOrderDTO.getId())){
throw new ServiceException("异常工单ID不能为空");
}
try{
if(ObjectUtils.isNull(aftersalesWorkOrderDTO.getSurveyRecordDTO().getContent())){
throw new ServiceException("内容不能为空!!");
}
}catch (Exception e ){
log.info("内容不能为空!!");
throw new ServiceException("内容不能为空!!");
}
return R.status(aftersalesWorkOrderService.savaSurveyRecord(aftersalesWorkOrderDTO));
}

24
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -54,10 +54,11 @@
select DISTINCT lawo.id,lawo.work_order_type,lawo.discovery_node,lawo.work_order_number,lawo.waybill_number,lawo.order_code,lawo.train_number,lawo.first,
lawo.secondary,lawo.vehicle_route,lawo.deliver_goods_time,lawo.discovery_time,lawo.warehousing_time,lawo.waybill_mall,lawo.remarks,lawo.delivery_time,
lawo.delivery_driver,lawo.work_order_status,lawo.problem_description,lawo.responsible_person,lawo.processed_by,lawo.create_time,
lawo.customer_service_name customerServiceName
lawo.customer_service_name customerServiceName,lawo.warehouse_id warehouseId,lawo.brand_name brandName
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)
<where>
lawo.is_deleted = 0
<if test="param.id != null and param.id != '' ">and lawo.id = #{param.id } </if>
<if test="param.workOrderType != null and param.workOrderType != '' ">and lawo.work_order_type = #{param.workOrderType } </if>
<if test="param.initiationIdentification != null and param.initiationIdentification != '' ">and lawo.initiation_identification = #{param.initiationIdentification } </if>
@ -87,7 +88,7 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.customerServiceName != null and param.customerServiceName != '' ">and lawo.customer_service_name = #{param.customerServiceName } </if>
<if test="param.waybillMallId != null and param.waybillMallId != '' ">and lawo.waybill_mall_id = #{param.waybillMallId } </if>
<if test="param.problemDescription != null and param.problemDescription != '' ">and lawo.problem_description = #{param.problemDescription} </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus == null ">and lawo.warehouse_id = #{param.warehouseId} </if>
<if test="param.warehouseId != null and param.warehouseId != '' ">and lawo.warehouse_id = #{param.warehouseId} </if>
<if test="param.personResponsible != null and param.personResponsible != '' ">and lawo.person_responsible = #{param.personResponsible } </if>
<if test="param.processNumber != null and param.processNumber != '' ">and lawo.process_number = #{param.processNumber } </if>
<if test="param.reviewedBy != null and param.reviewedBy != '' ">and lawo.reviewed_by = #{param.reviewedBy } </if>
@ -96,18 +97,21 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.processedBy != null and param.processedBy != '' ">and lawo.processed_by = #{param.processedBy} </if>
<if test="param.investigationProcess != null and param.investigationProcess != '' ">and lawo.investigation_process = #{param.investigationProcess } </if>
<if test="param.relatedWorkOrdersId != null and param.relatedWorkOrdersId != '' ">and lawo.related_work_orders_id = #{param.relatedWorkOrdersId } </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.customerServiceState == 10 ">and lawo.work_order_status in( #{param.workOrderStatus }) </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != ''">and lawo.work_order_status in( #{param.workOrderStatus }) </if>
<if test="param.customerIdentification != null and param.customerIdentification == 1 ">
and lawo.work_order_status IN ( '10', '20', '21', '30', '40', '50', '60', '70', '80', '90' ,'100','110')
</if>
<if test="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30) and lap.processing_status = '4' and lap.business_id = #{param.warehouseId} </if>
<if test="param.handleStatus!= null and param.handleStatus == 10 ">and lawo.warehouse_id = #{param.warehouseId} </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.customerServiceState == null ">and lawo.work_order_status in( #{param.workOrderStatus }) </if>
or 1 = 1
<if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.customerServiceState == null "> and lawo.work_order_status in ( #{param.workOrderStatus }) and lap.types_of = '2' and lap.business_id = #{param.warehouseId} </if>
<if test="param.handleStatus!= null and param.handleStatus == 10 ">and lap.types_of = '2' and lap.business_id = #{param.warehouseId} </if>
<if test="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30) and lap.processing_status = '4' and lap.business_id = #{param.warehouseId} </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100) and lap.processing_status = '4' and lap.business_id = #{param.warehouseId} </if>
<!-- <if test="param.handleStatus!= null and param.handleStatus == 10 ">and lawo.warehouse_id = #{param.warehouseId} </if>-->
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100) and lap.processing_status = '4' </if>
<if test="param.handleStatus != null "> or 1=1 </if>
<if test="param.warehouseId != null and param.warehouseId != '' "> and lap.business_id = #{param.warehouseId} </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.handleStatus != 40 "> and lawo.work_order_status in ( #{param.workOrderStatus }) </if>
<!-- <if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.customerServiceState == null "> and lawo.work_order_status in ( #{param.workOrderStatus }) and lap.types_of = '2' </if>-->
<if test="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10','20' ) and lap.types_of = '2' and lap.processing_status in ('1') </if>
<if test="param.handleStatus!= null and param.handleStatus == 10 ">and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100) and lap.processing_status = '4' </if>
ORDER BY lawo.create_time DESC
</where>

29
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -594,6 +594,14 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus","30");
}
//待处理
if(ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.daichuli.getValue())){
aftersalesWorkOrder.put("handleStatus","40");
}
//处理中
if(ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.chulizhong.getValue())){
aftersalesWorkOrder.put("handleStatus","50");
}
//已完结
if(ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())){
aftersalesWorkOrder.remove("workOrderStatus");
@ -1263,13 +1271,22 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
//不是处理方
if(aftersalesWorkOrderDTO.getProcessorEntityList().isEmpty()){
//没有 全部
List<AftersalesProcessorEntity> collect = list.stream().filter(i -> "1".equals(i.getProcessingStatus())).collect(Collectors.toList());
// List<AftersalesProcessorEntity> collect = list.stream().filter(i -> "1".equals(i.getProcessingStatus())).collect(Collectors.toList());
//添加待回复信息
collect.forEach( i ->{
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO,i,surveyRecordEntity);
//添加待回复信息
aftersalesReplyingPartyService.save(replyingPartyEntity);
list.forEach( i ->{
//没有处理方,修改已回复的处理方为待回复
if(ProcessorProcessingStatusStatusConstant.yichuli.getValue().equals(i.getProcessingStatus())){
//已处理
AftersalesProcessorEntity processor = new AftersalesProcessorEntity();
processor.setId(i.getId());
processor.setProcessingStatus(ProcessorProcessingStatusStatusConstant.daichuli.getValue());
aftersalesProcessorService.updateById(processor);
}
if(ProcessorProcessingStatusStatusConstant.daichuli.getValue().equals(i.getProcessingStatus())){
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO,i,surveyRecordEntity);
//添加待回复信息
aftersalesReplyingPartyService.save(replyingPartyEntity);
}
});
}else{

Loading…
Cancel
Save