|
|
|
@ -486,6 +486,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
//查询用户角色信息
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
String roleName = user.getRoleName(); |
|
|
|
|
|
|
|
|
|
String tenantId = user.getTenantId(); |
|
|
|
|
|
|
|
|
|
//查询客服岗位
|
|
|
|
@ -1241,9 +1242,31 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public AftersalesWorkOrderVO getSurveyRecord(AftersalesWorkOrderDTO aftersalesWorkOrderDTO) { |
|
|
|
|
|
|
|
|
|
AftersalesWorkOrderVO aftersalesWorkOrderVO = new AftersalesWorkOrderVO(); |
|
|
|
|
//查询用户角色信息
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
String roleName = user.getRoleName(); |
|
|
|
|
String tenantId = user.getTenantId(); |
|
|
|
|
//查询客服岗位
|
|
|
|
|
List<DictBiz> warehouseType = DictBizCache.getList("after_sales_visits"); |
|
|
|
|
if (warehouseType.isEmpty()) { |
|
|
|
|
throw new ServiceException("注意,注意!售后访问字典未配置!请配置!"); |
|
|
|
|
}else{ |
|
|
|
|
Optional<DictBiz> first = warehouseType.stream().filter(i -> { |
|
|
|
|
if (i.getDictValue().equals(roleName)) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}).findFirst(); |
|
|
|
|
if(first.isPresent()){ |
|
|
|
|
//存在
|
|
|
|
|
String dictValue = first.get().getDictKey(); |
|
|
|
|
switch (dictValue){ |
|
|
|
|
case "2": // 营业部客服
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if(ObjectUtils.isNull(myCurrentWarehouse)){ |
|
|
|
|
throw new ServiceException("请选择仓库信息!!"); |
|
|
|
|
throw new ServiceException("请选择仓库!"); |
|
|
|
|
} |
|
|
|
|
//查询是否必须回复
|
|
|
|
|
AftersalesProcessorEntity one = aftersalesProcessorService.getOne(Wrappers.<AftersalesProcessorEntity>query().lambda(). |
|
|
|
@ -1252,13 +1275,6 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
.eq(AftersalesProcessorEntity::getBusinessName, myCurrentWarehouse.getName()) |
|
|
|
|
.eq(AftersalesProcessorEntity::getTypesOf, ProcessorTypesOfStatusConstant.chulifang.getValue()) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
//查询调查数据
|
|
|
|
|
List<AftersaleSurveyRecordEntity> list = aftersaleSurveyRecordService.list(Wrappers.<AftersaleSurveyRecordEntity>query().lambda() |
|
|
|
|
.eq(AftersaleSurveyRecordEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId()) |
|
|
|
|
.eq(AftersaleSurveyRecordEntity::getDifference, "1") |
|
|
|
|
); |
|
|
|
|
AftersalesWorkOrderVO aftersalesWorkOrderVO = new AftersalesWorkOrderVO(); |
|
|
|
|
List<AftersalesProcessorVO> list1 = new ArrayList<>(); |
|
|
|
|
if(ObjectUtils.isNotNull(one)){ |
|
|
|
|
AftersalesProcessorVO processorVO = new AftersalesProcessorVO(); |
|
|
|
@ -1266,6 +1282,21 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
list1.add(processorVO); |
|
|
|
|
} |
|
|
|
|
aftersalesWorkOrderVO.setProcessorVOList(list1); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
//不存在
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if(ObjectUtils.isNull(myCurrentWarehouse)){ |
|
|
|
|
throw new ServiceException("请选择仓库!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//查询调查数据
|
|
|
|
|
List<AftersaleSurveyRecordEntity> list = aftersaleSurveyRecordService.list(Wrappers.<AftersaleSurveyRecordEntity>query().lambda() |
|
|
|
|
.eq(AftersaleSurveyRecordEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId()) |
|
|
|
|
.eq(AftersaleSurveyRecordEntity::getDifference, "1") |
|
|
|
|
); |
|
|
|
|
aftersalesWorkOrderVO.setSurveyRecordEntities(list); |
|
|
|
|
return aftersalesWorkOrderVO; |
|
|
|
|
} |
|
|
|
@ -1278,7 +1309,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
@Override |
|
|
|
|
public AftersalesWorkOrderVO getTrackRecord(AftersalesWorkOrderDTO aftersalesWorkOrderDTO) { |
|
|
|
|
List<AftersaleSurveyRecordEntity> list = aftersaleSurveyRecordService.list(Wrappers.<AftersaleSurveyRecordEntity>query().lambda() |
|
|
|
|
.eq(AftersaleSurveyRecordEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId()) |
|
|
|
|
.eq(AftersaleSurveyRecordEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId() ) |
|
|
|
|
.orderByDesc(AftersaleSurveyRecordEntity::getCreateTime) |
|
|
|
|
); |
|
|
|
|
AftersalesWorkOrderVO workOrderVO = new AftersalesWorkOrderVO(); |
|
|
|
|
workOrderVO.setSurveyRecordEntities(list); |
|
|
|
|