Browse Source

修改工单完结查询,编辑

single_db
caoyizhong 1 year ago
parent
commit
1b64a6ab31
  1. 3
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesProcessingResultsDTO.java
  2. 9
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java
  3. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml
  4. 14
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  5. 6
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesProcessingResultsServiceImpl.java
  6. 68
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

3
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesProcessingResultsDTO.java

@ -37,6 +37,7 @@ public class AftersalesProcessingResultsDTO extends AftersalesProcessingResult
* 处理结果类型
*/
private List<AftersalesProcessingMoneyEntity> processingMoneyEntityList;
//删除ID
private List<Long> assignList;
}

9
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java

@ -81,6 +81,15 @@ public class AftersalesWorkOrderDTO extends AftersalesWorkOrderEntity {
* 工单指派 ID
*/
private List<Long> assignList;
/**
* 赔款方删除集合
*/
private List<Long> assignListRecord;
/**
* 受款方删除集合
*/
private List<Long> assignListRecipient;
/**
* 处理结果

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml

@ -40,7 +40,7 @@
SELECT * FROM logpm_aftersales_appeal ${ew.customSqlSegment}
</select>
<select id="getListAppeal" resultType="com.logpm.aftersales.vo.AftersalesAppealVO">
SELECT
SELECT DISTINCT
laa.id ,
laa.appeal_people_name appealPeopleName,
laa.claimant,

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

@ -57,6 +57,7 @@
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)
LEFT JOIN logpm_aftersales_completion_record lacr on lacr.work_order_id = lawo.id and lacr.is_deleted = '0'
<where>
lawo.is_deleted = 0
<if test="param.id != null and param.id != '' ">and lawo.id = #{param.id } </if>
@ -83,12 +84,13 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.waybillMall != null and param.waybillMall != '' ">and lawo.waybill_mall = #{param.waybillMall } </if>
<if test="param.deliveryDriver != null and param.deliveryDriver != '' ">and lawo.delivery_driver = #{param.deliveryDriver } </if>
<if test="param.customerServiceState != null and param.customerServiceState == 30 "> and lawo.work_order_status in ('30','40') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 20 "> and lawo.work_order_status in ('30') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 10 "> and lawo.work_order_status in ('80','100') </if>
<if test="param.customerServiceId != null and param.customerServiceId != '' ">and lawo.customer_service_id = #{param.customerServiceId } </if>
<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 lawo.warehouse_id = #{param.warehouseId} </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus != 20">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>
@ -103,15 +105,15 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
</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.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 and param.handleStatus == 20 ">and lawo.work_order_status in (80,100) and lacr.warehouse_id=#{param.warehouseId} </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.warehouseId != null and param.warehouseId != '' and param.handleStatus != 20 "> 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>
<if test="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30,40) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100) and lacr.warehouse_id=#{param.warehouseId} </if>
ORDER BY lawo.create_time DESC
</where>

6
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesProcessingResultsServiceImpl.java

@ -121,8 +121,10 @@ public class AftersalesProcessingResultsServiceImpl extends BaseServiceImpl<Afte
}
});
}
if(ObjectUtil.isNotNull(aftersalesProcessingResults.getAssignList()) && ObjectUtil.isNotNull( aftersalesProcessingResults.getAssignList().get(0)) ){
//删除
aftersalesProcessingMoneyService.deleteLogic(aftersalesProcessingResults.getAssignList());
}
}
return true;

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

@ -577,7 +577,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState","30");
}else if(ObjectUtils.isNotNull( workOrderStatus ) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState","10");
}else if( ObjectUtils.isNull( workOrderStatus ) ){
aftersalesWorkOrder.put("customerIdentification", "1");
@ -621,11 +621,14 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
case "3": //职能客服 查询自己的待处理工单
if( ObjectUtils.isNotNull( workOrderStatus ) && "500".equals(workOrderStatus)){
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState","30");
aftersalesWorkOrder.put("customerServiceState","20");
aftersalesWorkOrder.put("customerServiceId",user.getUserId());
}else{
}else if(ObjectUtils.isNull(workOrderStatus)){
aftersalesWorkOrder.put("customerIdentification", "1");
}
}else if( ObjectUtils.isNotNull( workOrderStatus ) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus) ){
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState","10");
}
break;
}
}else{
@ -938,7 +941,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
);
//需要待回复的处理方
List<AftersalesProcessorVO> processorVOS = list.stream().map( i ->{
if(i.getProcessingStatus().equals(ProcessorProcessingStatusStatusConstant.daichuli.getValue())){
if(i.getProcessingStatus().equals(ProcessorProcessingStatusStatusConstant.daichuli.getValue()) || i.getProcessingStatus().equals(ProcessorProcessingStatusStatusConstant.yichuli.getValue())){
AftersalesProcessorVO processorVO = new AftersalesProcessorVO();
BeanUtil.copyProperties(i,processorVO);
return processorVO;
@ -1494,11 +1497,23 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
});
}else{
Optional<AftersalesProcessorEntity> first = list.stream().filter(i -> i.getBusinessId().equals(myCurrentWarehouse.getId()) && i.getBusinessName().equals(myCurrentWarehouse.getName())).findFirst();
//有包含的处理方
if(first.isPresent()){
AftersalesProcessorEntity processor = new AftersalesProcessorEntity();
processor.setProcessingStatus(ProcessorProcessingStatusStatusConstant.tijiaofang.getValue());
processor.setId(first.get().getId());
aftersalesProcessorService.updateById(processor);
}else{
//没有 修改为回复的状态
list.stream().forEach( i ->{
AftersalesProcessorEntity processor = new AftersalesProcessorEntity();
processor.setId(i.getId());
if(i.getProcessingStatus().equals(ProcessorProcessingStatusStatusConstant.daichuli.getValue())){
processor.setProcessingStatus(ProcessorProcessingStatusStatusConstant.weihuifuyichuli.getValue());
aftersalesProcessorService.updateById(processor);
}
});
}
@ -1682,42 +1697,47 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
//异常工单完结处理结果赔款方
if(!aftersalesWorkOrder.getCompletionRecordEntities().isEmpty()){
//删除全部赔付方信息
List<AftersalesCompletionRecordEntity> list = completionRecordService.list(Wrappers.<AftersalesCompletionRecordEntity>query().lambda()
.eq(AftersalesCompletionRecordEntity::getWorkOrderId, aftersalesWorkOrder.getId())
);
List<Long> collect = list.stream().map(AftersalesCompletionRecordEntity::getId).collect(Collectors.toList());
if(!collect.isEmpty()){
completionRecordService.deleteLogic(collect);
aftersalesWorkOrder.getCompletionRecordEntities().forEach(r ->{
if(ObjectUtils.isNotNull(r.getId())){
completionRecordService.updateById(r);
}else{
completionRecordService.save(r);
}
});
if(ObjectUtils.isNotNull( aftersalesWorkOrder.getAssignListRecord()) ){
completionRecordService.deleteLogic(aftersalesWorkOrder.getAssignListRecord());
}
completionRecordService.saveBatch(aftersalesWorkOrder.getCompletionRecordEntities());
}
//异常工单完结处理结果受款方
if(!aftersalesWorkOrder.getCompletionRecipientEntities().isEmpty()){
List<AftersalesCompletionRecipientEntity> list = completionRecipientService.list(Wrappers.<AftersalesCompletionRecipientEntity>query().lambda()
.eq(AftersalesCompletionRecipientEntity::getWorkOrderId, aftersalesWorkOrder.getId())
);
List<Long> collect = list.stream().map(AftersalesCompletionRecipientEntity::getId).collect(Collectors.toList());
if(!collect.isEmpty()){
completionRecipientService.deleteLogic(collect);
aftersalesWorkOrder.getCompletionRecipientEntities().forEach(r ->{
if(ObjectUtils.isNotNull( r.getId()) ){
//修改
completionRecipientService.updateById(r);
}else{
//新增
completionRecipientService.save(r);
}
});
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getAssignListRecipient())){
//删除
completionRecipientService.deleteLogic(aftersalesWorkOrder.getAssignListRecipient());
}
completionRecipientService.saveBatch(aftersalesWorkOrder.getCompletionRecipientEntities());
}
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getReasonArbitration())){
workOrderEntity.setId(aftersalesWorkOrder.getId());
workOrderEntity.setReasonArbitration(aftersalesWorkOrder.getReasonArbitration());
}
//修改工单状态
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getTypesOf())){
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjei.getValue());
return baseMapper.updateById(workOrderEntity) > 0;
} else {
return true;
}
return baseMapper.updateById(workOrderEntity) > 0;
}
/**

Loading…
Cancel
Save