@ -309,6 +309,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersaleSurveyRecord . setTypesOf ( "1" ) ;
aftersaleSurveyRecord . setDifference ( "1" ) ;
aftersaleSurveyRecord . setWorkOrderId ( aftersalesWorkOrder . getId ( ) ) ;
aftersaleSurveyRecord . setProcessingResults ( surveyRecordDTO . getContent ( ) ) ;
aftersaleSurveyRecordService . save ( aftersaleSurveyRecord ) ;
}
//添加责任方 处理方
@ -586,6 +587,14 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder . remove ( "workOrderStatus" ) ;
aftersalesWorkOrder . put ( "handleStatus" , "30" ) ;
}
if ( ObjectUtils . isNotNull ( workOrderStatus ) & & workOrderStatus . equals ( WorkOrderStatusConstant . yiwanjei . getValue ( ) ) ) {
aftersalesWorkOrder . remove ( "workOrderStatus" ) ;
aftersalesWorkOrder . put ( "handleStatus" , "20" ) ;
}
// if( ObjectUtils.isNull(workOrderStatus)){
// aftersalesWorkOrder.put("handleStatus","10");
// }
break ;
case "3" : //职能客服 查询自己的待处理工单
if ( ObjectUtils . isNotNull ( workOrderStatus ) & & "500" . equals ( workOrderStatus ) ) {
@ -1221,12 +1230,14 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
if ( ObjectUtils . isNotNull ( myCurrentWarehouse ) ) {
one = list . stream ( ) . filter ( i - > i . getBusinessId ( ) . equals ( myCurrentWarehouse . getId ( ) ) & & i . getBusinessName ( ) . equals ( myCurrentWarehouse . getName ( ) ) ) . findFirst ( ) ;
one . ifPresent ( aftersalesProcessorEntity - > surveyRecordEntity . setProcessorId ( aftersalesProcessorEntity . getId ( ) ) ) ;
surveyRecordEntity . setAddDepartment ( myCurrentWarehouse . getName ( ) ) ;
surveyRecordEntity . setAddDepartment ( myCurrentWarehouse . getDepartmentName ( ) ) ;
surveyRecordEntity . setProcessingResults ( surveyRecordEntity . getContent ( ) ) ;
} else {
log . info ( "客服回复!!!{}" , user . getUserName ( ) ) ;
surveyRecordEntity . setProcessorId ( user . getUserId ( ) ) ;
R < String > deptName = sysClient . getDeptName ( Long . valueOf ( user . getDeptId ( ) ) ) ;
surveyRecordEntity . setAddDepartment ( deptName . getData ( ) ) ;
surveyRecordEntity . setProcessingResults ( surveyRecordEntity . getContent ( ) ) ;
}
//添加回复信息
surveyRecordEntity . setDifference ( "1" ) ;
@ -1250,6 +1261,9 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
} else {
//添加或修改新的处理方
surveyRecordDTO . setId ( surveyRecordEntity . getId ( ) ) ;
surveyRecordDTO . setFollowWarehouseName ( surveyRecordEntity . getFollowWarehouseName ( ) ) ;
surveyRecordDTO . setFollowWarehouseId ( surveyRecordEntity . getFollowWarehouseId ( ) ) ;
chuLiFang ( aftersalesWorkOrderDTO , myCurrentWarehouse , user , list , surveyRecordDTO ) ;
}
@ -1276,6 +1290,20 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
//添加或修改新的处理方
chuLiFang ( aftersalesWorkOrderDTO , myCurrentWarehouse , user , list , surveyRecordDTO ) ;
//修改处理方待回复信息
List < AftersalesReplyingPartyEntity > list1 = aftersalesReplyingPartyService . list ( Wrappers . < AftersalesReplyingPartyEntity > query ( ) . lambda ( )
. eq ( AftersalesReplyingPartyEntity : : getWorkOrderId , aftersalesWorkOrderDTO . getId ( ) )
. eq ( AftersalesReplyingPartyEntity : : getFollowWarehouseId , myCurrentWarehouse . getId ( ) )
. eq ( AftersalesReplyingPartyEntity : : getDifference , '1' )
) ;
list1 . forEach ( i - > {
AftersalesReplyingPartyEntity replyingPartyEntity = new AftersalesReplyingPartyEntity ( ) ;
replyingPartyEntity . setId ( i . getId ( ) ) ;
replyingPartyEntity . setDifference ( "2" ) ;
replyingPartyEntity . setProcessedById ( user . getUserId ( ) ) ;
replyingPartyEntity . setProcessedByName ( user . getUserName ( ) ) ;
aftersalesReplyingPartyService . updateById ( replyingPartyEntity ) ;
} ) ;
}
return true ;
@ -1289,7 +1317,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
* @param list
* @param surveyRecordDTO
* /
private void chuLiFang ( AftersalesWorkOrderDTO aftersalesWorkOrderDTO , BasicdataWarehouseEntity myCurrentWarehouse , BladeUser user , List < AftersalesProcessorEntity > list , AftersaleSurveyRecordDTO surveyRecordDTO ) {
@Transactional ( rollbackFor = Exception . class )
public void chuLiFang ( AftersalesWorkOrderDTO aftersalesWorkOrderDTO , BasicdataWarehouseEntity myCurrentWarehouse , BladeUser user , List < AftersalesProcessorEntity > list , AftersaleSurveyRecordDTO surveyRecordDTO ) {
if ( ! aftersalesWorkOrderDTO . getProcessorEntityList ( ) . isEmpty ( ) ) {
aftersalesWorkOrderDTO . getProcessorEntityList ( ) . forEach ( i - > {
Optional < AftersalesProcessorEntity > first = list . stream ( ) . filter ( a - > a . getBusinessId ( ) . equals ( i . getBusinessId ( ) ) ) . findFirst ( ) ;
@ -1307,7 +1336,18 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
//添加指定处理结果
//处理方
addSurveRecord ( aftersalesWorkOrderDTO , user , i ) ;
//判断是否新添加指派记录
AftersalesProcessorEntity one = aftersalesProcessorService . getOne ( Wrappers . < AftersalesProcessorEntity > query ( ) . lambda ( )
. eq ( AftersalesProcessorEntity : : getBusinessId , i . getBusinessId ( ) )
. eq ( AftersalesProcessorEntity : : getWorkOrderId , i . getWorkOrderId ( ) )
. eq ( AftersalesProcessorEntity : : getProcessingStatus , "1" )
. eq ( AftersalesProcessorEntity : : getTypesOf , "2" )
) ;
if ( ObjectUtils . isNull ( one ) ) {
//添操作记录
addSurveRecord ( aftersalesWorkOrderDTO , user , i ) ;
}
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity ( aftersalesWorkOrderDTO , i , surveyRecordDTO ) ;
//添加待回复信息
aftersalesReplyingPartyService . save ( replyingPartyEntity ) ;
@ -1315,16 +1355,20 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
} else {
//没有 全部
List < AftersalesProcessorEntity > collect = list . stream ( ) . filter ( i - > "1" . equals ( i . getProcessingStatus ( ) ) ) . collect ( Collectors . toList ( ) ) ;
List < AftersalesProcessorEntity > collect = list . stream ( ) . filter ( i - > "2" . equals ( i . getTypesOf ( ) ) ) . collect ( Collectors . toList ( ) ) ;
//
//添加待回复信息
collect . forEach ( i - > {
//修改处理方 处理状态
updateProcessor ( ProcessorProcessingStatusStatusConstant . daichuli . getValue ( ) , i ) ;
//添加指定处理结果
addSurveRecord ( aftersalesWorkOrderDTO , user , i ) ;
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity ( aftersalesWorkOrderDTO , i , surveyRecordDTO ) ;
//添加待回复信息
aftersalesReplyingPartyService . save ( replyingPartyEntity ) ;
if ( ! i . getBusinessId ( ) . toString ( ) . equals ( myCurrentWarehouse . getId ( ) . toString ( ) ) ) {
//修改处理方 处理状态
updateProcessor ( ProcessorProcessingStatusStatusConstant . daichuli . getValue ( ) , i ) ;
//添加指定处理结果
addSurveRecord ( aftersalesWorkOrderDTO , user , i ) ;
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity ( aftersalesWorkOrderDTO , i , surveyRecordDTO ) ;
//添加待回复信息
aftersalesReplyingPartyService . save ( replyingPartyEntity ) ;
}
} ) ;
}
@ -1460,6 +1504,9 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
if ( ObjectUtils . isNull ( myCurrentWarehouse ) ) {
throw new ServiceException ( "请选择仓库!" ) ;
}
//TODO 待处理!!
//查询是否必须回复
AftersalesProcessorEntity one = aftersalesProcessorService . getOne ( Wrappers . < AftersalesProcessorEntity > query ( ) . lambda ( ) .
eq ( AftersalesProcessorEntity : : getWorkOrderId , aftersalesWorkOrderDTO . getId ( ) )
@ -1703,7 +1750,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
int comparisonResult = reduce . compareTo ( BigDecimal . ZERO ) ;
if ( comparisonResult > 0 ) {
//金额大于0
workOrderEntity . setWorkOrderStatus ( WorkOrderStatusConstant . lipeijineweichu . getValue ( ) ) ;
workOrderEntity . setWorkOrderStatus ( WorkOrderStatusConstant . yichuli . getValue ( ) ) ;
} else {
workOrderEntity . setWorkOrderStatus ( WorkOrderStatusConstant . yichuli . getValue ( ) ) ;
}