@ -30,6 +30,7 @@ import com.logpm.aftersales.dto.AftersaleSurveyRecordDTO;
import com.logpm.aftersales.dto.AftersalesPersonResponsibleDTO ;
import com.logpm.aftersales.dto.AftersalesPersonResponsibleDTO ;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO ;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO ;
import com.logpm.aftersales.entity.* ;
import com.logpm.aftersales.entity.* ;
import com.logpm.aftersales.mapper.AftersalesAppealMapper ;
import com.logpm.aftersales.service.* ;
import com.logpm.aftersales.service.* ;
import com.logpm.aftersales.vo.* ;
import com.logpm.aftersales.vo.* ;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel ;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel ;
@ -57,6 +58,7 @@ import org.springblade.system.entity.DictBiz;
import org.springblade.system.entity.User ;
import org.springblade.system.entity.User ;
import org.springblade.system.feign.ISysClient ;
import org.springblade.system.feign.ISysClient ;
import org.springblade.system.feign.IUserSearchClient ;
import org.springblade.system.feign.IUserSearchClient ;
import org.springframework.context.annotation.Lazy ;
import org.springframework.scheduling.annotation.Async ;
import org.springframework.scheduling.annotation.Async ;
import org.springframework.stereotype.Service ;
import org.springframework.stereotype.Service ;
import com.baomidou.mybatisplus.core.metadata.IPage ;
import com.baomidou.mybatisplus.core.metadata.IPage ;
@ -100,6 +102,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
private final IDistributionDeliveryListClient distributionDeliveryListClient ;
private final IDistributionDeliveryListClient distributionDeliveryListClient ;
private final IAftersalesCustomerMallService aftersalesCustomerMallService ;
private final IAftersalesCustomerMallService aftersalesCustomerMallService ;
private final AftersalesAppealMapper aftersalesAppealService ;
private final ISysClient sysClient ;
private final ISysClient sysClient ;
@ -567,14 +571,16 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
Object workOrderStatus = aftersalesWorkOrder . get ( "workOrderStatus" ) ;
Object workOrderStatus = aftersalesWorkOrder . get ( "workOrderStatus" ) ;
switch ( dictValue ) {
switch ( dictValue ) {
case "1" : //客服经理 查询全部待处理工单
case "1" : //客服经理 查询全部待处理工单
//待处理
if ( ObjectUtils . isNotNull ( workOrderStatus ) & & "500" . equals ( workOrderStatus ) ) {
if ( ObjectUtils . isNotNull ( workOrderStatus ) & & "500" . equals ( workOrderStatus ) ) {
aftersalesWorkOrder . remove ( "workOrderStatus" ) ;
aftersalesWorkOrder . remove ( "workOrderStatus" ) ;
aftersalesWorkOrder . put ( "customerServiceState" , "30" ) ;
aftersalesWorkOrder . put ( "customerServiceState" , "30" ) ;
} else {
} else if ( ObjectUtils . isNotNull ( workOrderStatus ) & & WorkOrderStatusConstant . yiwanjei . getValue ( ) . equals ( workOrderStatus ) ) {
aftersalesWorkOrder . put ( "customerServiceState" , "10" ) ;
} else if ( ObjectUtils . isNull ( workOrderStatus ) ) {
aftersalesWorkOrder . put ( "customerIdentification" , "1" ) ;
aftersalesWorkOrder . put ( "customerIdentification" , "1" ) ;
}
}
break ;
break ;
case "2" : // 营业部客服
case "2" : // 营业部客服
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient . getMyCurrentWarehouse ( ) ;
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient . getMyCurrentWarehouse ( ) ;
@ -583,14 +589,21 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
} else {
} else {
throw new ServiceException ( "请选择仓库!" ) ;
throw new ServiceException ( "请选择仓库!" ) ;
}
}
//已处理
if ( ObjectUtils . isNotNull ( workOrderStatus ) & & workOrderStatus . equals ( WorkOrderStatusConstant . yichuli . getValue ( ) ) ) {
if ( ObjectUtils . isNotNull ( workOrderStatus ) & & workOrderStatus . equals ( WorkOrderStatusConstant . yichuli . getValue ( ) ) ) {
aftersalesWorkOrder . remove ( "workOrderStatus" ) ;
aftersalesWorkOrder . remove ( "workOrderStatus" ) ;
aftersalesWorkOrder . put ( "handleStatus" , "30" ) ;
aftersalesWorkOrder . put ( "handleStatus" , "30" ) ;
}
}
//已完结
if ( ObjectUtils . isNotNull ( workOrderStatus ) & & workOrderStatus . equals ( WorkOrderStatusConstant . yiwanjei . getValue ( ) ) ) {
if ( ObjectUtils . isNotNull ( workOrderStatus ) & & workOrderStatus . equals ( WorkOrderStatusConstant . yiwanjei . getValue ( ) ) ) {
aftersalesWorkOrder . remove ( "workOrderStatus" ) ;
aftersalesWorkOrder . remove ( "workOrderStatus" ) ;
aftersalesWorkOrder . put ( "handleStatus" , "20" ) ;
aftersalesWorkOrder . put ( "handleStatus" , "20" ) ;
}
}
//全部
if ( ObjectUtils . isNotNull ( workOrderStatus ) & & "1000" . equals ( workOrderStatus ) ) {
aftersalesWorkOrder . remove ( "workOrderStatus" ) ;
aftersalesWorkOrder . put ( "handleStatus" , "10" ) ;
}
// if( ObjectUtils.isNull(workOrderStatus)){
// if( ObjectUtils.isNull(workOrderStatus)){
// aftersalesWorkOrder.put("handleStatus","10");
// aftersalesWorkOrder.put("handleStatus","10");
// }
// }
@ -1604,6 +1617,19 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
* /
* /
@Override
@Override
public boolean updateCompletionEnd ( AftersalesWorkOrderDTO aftersalesWorkOrder ) {
public boolean updateCompletionEnd ( AftersalesWorkOrderDTO aftersalesWorkOrder ) {
if ( ObjectUtils . isNotNull ( aftersalesWorkOrder . getTypesOf ( ) ) & & "1" . equals ( aftersalesWorkOrder . getTypesOf ( ) ) ) {
//查询是否已处理
AftersalesAppealEntity aftersalesAppealEntity1 = aftersalesAppealService . selectById ( aftersalesWorkOrder . getAppealId ( ) ) ;
if ( "0" . equals ( aftersalesAppealEntity1 . getTypesOf ( ) ) ) {
//修改申述成立
AftersalesAppealEntity aftersalesAppealEntity = new AftersalesAppealEntity ( ) ;
aftersalesAppealEntity . setId ( aftersalesWorkOrder . getAppealId ( ) ) ;
aftersalesAppealEntity . setTypesOf ( "1" ) ;
aftersalesAppealService . updateById ( aftersalesAppealEntity ) ;
} else {
throw new ServiceException ( "已处理!" ) ;
}
}
//异常工单完结处理结果赔款方
//异常工单完结处理结果赔款方
if ( ! aftersalesWorkOrder . getCompletionRecordEntities ( ) . isEmpty ( ) ) {
if ( ! aftersalesWorkOrder . getCompletionRecordEntities ( ) . isEmpty ( ) ) {
@ -1612,7 +1638,9 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
. eq ( AftersalesCompletionRecordEntity : : getWorkOrderId , aftersalesWorkOrder . getId ( ) )
. eq ( AftersalesCompletionRecordEntity : : getWorkOrderId , aftersalesWorkOrder . getId ( ) )
) ;
) ;
List < Long > collect = list . stream ( ) . map ( AftersalesCompletionRecordEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
List < Long > collect = list . stream ( ) . map ( AftersalesCompletionRecordEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
completionRecordService . deleteLogic ( collect ) ;
if ( ! collect . isEmpty ( ) ) {
completionRecordService . deleteLogic ( collect ) ;
}
completionRecordService . saveBatch ( aftersalesWorkOrder . getCompletionRecordEntities ( ) ) ;
completionRecordService . saveBatch ( aftersalesWorkOrder . getCompletionRecordEntities ( ) ) ;
}
}
//异常工单完结处理结果受款方
//异常工单完结处理结果受款方
@ -1621,11 +1649,26 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
. eq ( AftersalesCompletionRecipientEntity : : getWorkOrderId , aftersalesWorkOrder . getId ( ) )
. eq ( AftersalesCompletionRecipientEntity : : getWorkOrderId , aftersalesWorkOrder . getId ( ) )
) ;
) ;
List < Long > collect = list . stream ( ) . map ( AftersalesCompletionRecipientEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
List < Long > collect = list . stream ( ) . map ( AftersalesCompletionRecipientEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
completionRecipientService . deleteLogic ( collect ) ;
if ( ! collect . isEmpty ( ) ) {
completionRecipientService . deleteLogic ( collect ) ;
}
completionRecipientService . saveBatch ( aftersalesWorkOrder . getCompletionRecipientEntities ( ) ) ;
completionRecipientService . saveBatch ( aftersalesWorkOrder . getCompletionRecipientEntities ( ) ) ;
}
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity ( ) ;
if ( ObjectUtils . isNotNull ( aftersalesWorkOrder . getReasonArbitration ( ) ) ) {
workOrderEntity . setId ( aftersalesWorkOrder . getId ( ) ) ;
workOrderEntity . setReasonArbitration ( aftersalesWorkOrder . getReasonArbitration ( ) ) ;
}
}
return true ;
//修改工单状态
if ( ObjectUtils . isNotNull ( aftersalesWorkOrder . getTypesOf ( ) ) ) {
workOrderEntity . setWorkOrderStatus ( WorkOrderStatusConstant . yiwanjei . getValue ( ) ) ;
return baseMapper . updateById ( workOrderEntity ) > 0 ;
} else {
return true ;
}
}
}
/ * *
/ * *
@ -1752,7 +1795,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
//金额大于0
//金额大于0
workOrderEntity . setWorkOrderStatus ( WorkOrderStatusConstant . yichuli . getValue ( ) ) ;
workOrderEntity . setWorkOrderStatus ( WorkOrderStatusConstant . yichuli . getValue ( ) ) ;
} else {
} else {
workOrderEntity . setWorkOrderStatus ( WorkOrderStatusConstant . yichuli . getValue ( ) ) ;
workOrderEntity . setWorkOrderStatus ( WorkOrderStatusConstant . lipeijineweichu . getValue ( ) ) ;
}
}
baseMapper . updateById ( workOrderEntity ) ;
baseMapper . updateById ( workOrderEntity ) ;
//修改未回复的处理方改为 6
//修改未回复的处理方改为 6
@ -1784,6 +1827,28 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
return true ;
return true ;
}
}
/ * *
* 修改申述状态数据
* @param aftersalesAppeal
* @return
* /
@Override
public boolean updateByIdAppel ( AftersalesAppealEntity aftersalesAppeal ) {
BladeUser user = AuthUtil . getUser ( ) ;
aftersalesAppeal . setProcessedByName ( user . getUserName ( ) ) ;
aftersalesAppeal . setProcessedById ( user . getUserId ( ) ) ;
aftersalesAppeal . setProcessedDate ( new Date ( ) ) ;
if ( ObjectUtils . isNotNull ( aftersalesAppeal . getTypesOf ( ) ) & & "3" . equals ( aftersalesAppeal . getTypesOf ( ) ) ) {
//取消订单申述
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity ( ) ;
workOrderEntity . setId ( aftersalesAppeal . getWorkOrderId ( ) ) ;
workOrderEntity . setWorkOrderStatus ( WorkOrderStatusConstant . yiwanjei . getValue ( ) ) ;
baseMapper . updateById ( workOrderEntity ) ;
}
return aftersalesAppealService . updateById ( aftersalesAppeal ) > 0 ;
}
/ * *
/ * *
* 添加处理处理方信息
* 添加处理处理方信息
* @param aftersalesWorkOrderDTO
* @param aftersalesWorkOrderDTO