|
|
|
@ -944,21 +944,21 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
} else { |
|
|
|
|
updateWorkOrderForOthers(aftersalesWorkOrder, workOrderStatus); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
throw new CustomerException("当前登录人无工单操作权限!!!"); |
|
|
|
|
} |
|
|
|
|
//进行仓库限制
|
|
|
|
|
List<Long> warehouseIds = new ArrayList<>(); |
|
|
|
|
if (!Objects.isNull(myCurrentWarehouse)){ |
|
|
|
|
if (myCurrentWarehouse.getName().equals("职能中心仓")){ |
|
|
|
|
if (!Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
if (myCurrentWarehouse.getName().equals("职能中心仓")) { |
|
|
|
|
List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWarehouseList(); |
|
|
|
|
if (!warehouseList.isEmpty()) { |
|
|
|
|
warehouseIds.addAll(warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList())); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
warehouseIds.add(myCurrentWarehouse.getId()); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
//获取当前人所有仓权限信息
|
|
|
|
|
List<Long> warehouseIds1 = warehouseClient.getWarehouseIds(); |
|
|
|
|
if (!warehouseIds1.isEmpty()) { |
|
|
|
@ -970,7 +970,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class); |
|
|
|
|
IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity,warehouseIds); |
|
|
|
|
IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity, warehouseIds); |
|
|
|
|
if (iPage.getRecords().isEmpty()) { |
|
|
|
|
log.error(">>>>>>>>>>>>>>>>>>查询工单列表为空"); |
|
|
|
|
IPage<AftersalesWorkOrderVO> data = AftersalesWorkOrderWrapper.build().pageVO(iPage); |
|
|
|
@ -1717,7 +1717,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public boolean savaSurveyRecord(AftersalesWorkOrderDTO aftersalesWorkOrderDTO) { |
|
|
|
|
boolean b = this.judgeIsCustomerService(AuthUtil.getUser()); |
|
|
|
|
if (!b){ |
|
|
|
|
if (!b) { |
|
|
|
|
throw new ServiceException("当前登录人无回复权限!!!"); |
|
|
|
|
} |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
@ -1738,7 +1738,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
one.ifPresent(aftersalesProcessorEntity -> surveyRecordEntity.setProcessorId(aftersalesProcessorEntity.getId())); |
|
|
|
|
surveyRecordEntity.setAddDepartment(myCurrentWarehouse.getDepartmentName()); |
|
|
|
|
surveyRecordEntity.setProcessingResults(surveyRecordEntity.getContent()); |
|
|
|
|
if (!Objects.isNull(surveyRecordDTO.getPictureUrl())){ |
|
|
|
|
if (!Objects.isNull(surveyRecordDTO.getPictureUrl())) { |
|
|
|
|
surveyRecordEntity.setPictureUrl(surveyRecordDTO.getPictureUrl()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
@ -1909,7 +1909,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
R<List<String>> roleNames = sysClient.getRoleNames(user.getRoleId()); |
|
|
|
|
if (!roleNames.getData().isEmpty()) { |
|
|
|
|
boolean contains = roleNames.getData().contains("仓库客服"); |
|
|
|
|
if (!contains){ |
|
|
|
|
if (!contains) { |
|
|
|
|
throw new ServiceException("当前登录人无操作权限"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1928,7 +1928,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
} |
|
|
|
|
BigDecimal totalMoney = BigDecimal.ZERO; |
|
|
|
|
aftersalesProcessingResultsDTO.setWarehouseId(aftersalesWorkOrderDTO.getWarehouseId()); |
|
|
|
|
if (!Objects.isNull(aftersalesProcessingResultsDTO.getProcessingMoneyEntityList())){ |
|
|
|
|
if (!Objects.isNull(aftersalesProcessingResultsDTO.getProcessingMoneyEntityList())) { |
|
|
|
|
for (AftersalesProcessingMoneyEntity aftersalesProcessingMoneyEntity : aftersalesProcessingResultsDTO.getProcessingMoneyEntityList()) { |
|
|
|
|
BigDecimal money = aftersalesProcessingMoneyEntity.getMoney(); |
|
|
|
|
totalMoney = totalMoney.add(aftersalesProcessingMoneyEntity.getMoney()); |
|
|
|
@ -2075,7 +2075,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
List<AftersalesProcessorVO> list1 = new ArrayList<>(); |
|
|
|
|
if (ObjectUtils.isNotNull(processorEntityList)) { |
|
|
|
|
AftersalesProcessorVO processorVO = new AftersalesProcessorVO(); |
|
|
|
|
processorEntityList.forEach(f->{ |
|
|
|
|
processorEntityList.forEach(f -> { |
|
|
|
|
BeanUtil.copyProperties(f, processorVO); |
|
|
|
|
list1.add(processorVO); |
|
|
|
|
}); |
|
|
|
@ -2648,7 +2648,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
updateWorkOrderForManager(aftersalesWorkOrder, workOrderStatus); |
|
|
|
|
break; |
|
|
|
|
case "2": // 营业部客服
|
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)){ |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
//营业部客服未选择仓库进行作业
|
|
|
|
|
throw new ServiceException("请选择仓库"); |
|
|
|
|
} |
|
|
|
@ -2661,13 +2661,13 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
} else { |
|
|
|
|
updateWorkOrderForOthers(aftersalesWorkOrder, workOrderStatus); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
throw new CustomerException("当前登录人无工单操作权限!!!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class); |
|
|
|
|
List<AftersalesWorkOrderExcel> list = baseMapper.exportAllListOwn(workOrderEntity,ids); |
|
|
|
|
List<AftersalesWorkOrderExcel> list = baseMapper.exportAllListOwn(workOrderEntity, ids); |
|
|
|
|
|
|
|
|
|
return list; |
|
|
|
|
|
|
|
|
@ -2677,53 +2677,55 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
public List<List<String>> basicTitleBuild() { |
|
|
|
|
List<List<String>> title = new ArrayList<>(); |
|
|
|
|
List<String> head0 = new ArrayList<>(Arrays.asList("异常类型")); |
|
|
|
|
title.add(0,head0); |
|
|
|
|
title.add(0, head0); |
|
|
|
|
List<String> head1 = new ArrayList<>(Arrays.asList("发现节点")); |
|
|
|
|
title.add(1,head1); |
|
|
|
|
title.add(1, head1); |
|
|
|
|
List<String> head2 = new ArrayList<>(Arrays.asList("工单创建仓")); |
|
|
|
|
title.add(2,head2); |
|
|
|
|
title.add(2, head2); |
|
|
|
|
|
|
|
|
|
List<String> head3 = new ArrayList<>(Arrays.asList("工单号")); |
|
|
|
|
title.add(3,head3); |
|
|
|
|
title.add(3, head3); |
|
|
|
|
|
|
|
|
|
List<String> head4 = new ArrayList<>(Arrays.asList("运单号")); |
|
|
|
|
title.add(4,head4); |
|
|
|
|
title.add(4, head4); |
|
|
|
|
|
|
|
|
|
List<String> head5 = new ArrayList<>(Arrays.asList("订单自编号")); |
|
|
|
|
title.add(5,head5); |
|
|
|
|
title.add(5, head5); |
|
|
|
|
|
|
|
|
|
List<String> head6 = new ArrayList<>(Arrays.asList("包条码")); |
|
|
|
|
title.add(6,head6); |
|
|
|
|
title.add(6, head6); |
|
|
|
|
|
|
|
|
|
List<String> head7 = new ArrayList<>(Arrays.asList("品牌")); |
|
|
|
|
title.add(7,head7); |
|
|
|
|
title.add(7, head7); |
|
|
|
|
|
|
|
|
|
List<String> head8 = new ArrayList<>(Arrays.asList("运单商场")); |
|
|
|
|
title.add(8,head8); |
|
|
|
|
title.add(8, head8); |
|
|
|
|
|
|
|
|
|
List<String> head9= new ArrayList<>(Arrays.asList("一级品类")); |
|
|
|
|
title.add(9,head9); |
|
|
|
|
List<String> head9 = new ArrayList<>(Arrays.asList("一级品类")); |
|
|
|
|
title.add(9, head9); |
|
|
|
|
|
|
|
|
|
List<String> head10 = new ArrayList<>(Arrays.asList("工单状态")); |
|
|
|
|
title.add(10,head10); |
|
|
|
|
title.add(10, head10); |
|
|
|
|
|
|
|
|
|
List<String> head11 = new ArrayList<>(Arrays.asList("工单处理方")); |
|
|
|
|
title.add(11,head11); |
|
|
|
|
title.add(11, head11); |
|
|
|
|
|
|
|
|
|
List<String> head12 = new ArrayList<>(Arrays.asList("工单创建时间")); |
|
|
|
|
title.add(12,head12); |
|
|
|
|
title.add(12, head12); |
|
|
|
|
|
|
|
|
|
List<String> head13= new ArrayList<>(Arrays.asList("工单最晚处理时间")); |
|
|
|
|
title.add(13,head13); |
|
|
|
|
List<String> head13 = new ArrayList<>(Arrays.asList("工单最晚处理时间")); |
|
|
|
|
title.add(13, head13); |
|
|
|
|
|
|
|
|
|
List<String> head14= new ArrayList<>(Arrays.asList("工单最新处理时间")); |
|
|
|
|
title.add(14,head14); |
|
|
|
|
List<String> head14 = new ArrayList<>(Arrays.asList("工单最新处理时间")); |
|
|
|
|
title.add(14, head14); |
|
|
|
|
|
|
|
|
|
List<String> head15= new ArrayList<>(Arrays.asList("是否超时")); |
|
|
|
|
title.add(15,head15); |
|
|
|
|
List<String> head15 = new ArrayList<>(Arrays.asList("是否超时")); |
|
|
|
|
title.add(15, head15); |
|
|
|
|
|
|
|
|
|
List<String> head16= new ArrayList<>(Arrays.asList("营业部处理客服")); |
|
|
|
|
title.add(16,head16); |
|
|
|
|
List<String> head16 = new ArrayList<>(Arrays.asList("营业部处理客服")); |
|
|
|
|
title.add(16, head16); |
|
|
|
|
List<String> head17 = new ArrayList<>(Arrays.asList("总部处理客服")); |
|
|
|
|
title.add(17, head17); |
|
|
|
|
return title; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2757,7 +2759,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
updateWorkOrderForManager(aftersalesWorkOrder, workOrderStatus); |
|
|
|
|
break; |
|
|
|
|
case "2": // 营业部客服
|
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)){ |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
//营业部客服未选择仓库进行作业
|
|
|
|
|
throw new ServiceException("请选择仓库"); |
|
|
|
|
} |
|
|
|
@ -2770,22 +2772,22 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
} else { |
|
|
|
|
updateWorkOrderForOthers(aftersalesWorkOrder, workOrderStatus); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
throw new CustomerException("当前登录人无工单操作权限!!!"); |
|
|
|
|
} |
|
|
|
|
//进行仓库限制
|
|
|
|
|
//进行仓库限制
|
|
|
|
|
List<Long> warehouseIds = new ArrayList<>(); |
|
|
|
|
if (!Objects.isNull(myCurrentWarehouse)){ |
|
|
|
|
if (myCurrentWarehouse.getName().equals("职能中心仓")){ |
|
|
|
|
if (!Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
if (myCurrentWarehouse.getName().equals("职能中心仓")) { |
|
|
|
|
List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWarehouseList(); |
|
|
|
|
if (!warehouseList.isEmpty()) { |
|
|
|
|
warehouseIds.addAll(warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList())); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
warehouseIds.add(myCurrentWarehouse.getId()); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
//获取当前人所有仓权限信息
|
|
|
|
|
List<Long> warehouseIds1 = warehouseClient.getWarehouseIds(); |
|
|
|
|
if (!warehouseIds1.isEmpty()) { |
|
|
|
@ -2798,18 +2800,19 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
AftersalesWorkOrderDTO workOrderDTO = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderDTO.class); |
|
|
|
|
List<AftersalesWorkOrderVO> exportData = baseMapper.getBasicExportData(workOrderDTO,ids,warehouseIds); |
|
|
|
|
List<AftersalesWorkOrderVO> exportData = baseMapper.getBasicExportData(workOrderDTO, ids, warehouseIds); |
|
|
|
|
return exportData; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 判断是否是客服角色 |
|
|
|
|
* |
|
|
|
|
* @param user |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private boolean judgeIsCustomerService(BladeUser user){ |
|
|
|
|
private boolean judgeIsCustomerService(BladeUser user) { |
|
|
|
|
String roleName = user.getRoleName(); |
|
|
|
|
if (!Objects.isNull(roleName)){ |
|
|
|
|
if (!Objects.isNull(roleName)) { |
|
|
|
|
List<String> roleList = Arrays.asList(user.getRoleName().split(",")); |
|
|
|
|
List<DictBiz> warehouseType = DictBizCache.getList("after_sales_visits"); |
|
|
|
|
Optional<DictBiz> matchingDictBiz = warehouseType.stream() |
|
|
|
@ -2819,7 +2822,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
log.error("当前登录人角色信息错误!!!"); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|