|
|
|
@ -902,7 +902,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
} |
|
|
|
|
List<String> roleList = Arrays.asList(user.getRoleName().split(",")); |
|
|
|
|
String tenantId = user.getTenantId(); |
|
|
|
|
|
|
|
|
|
boolean b = judgeIsCustomerService(user); |
|
|
|
|
// 查询 状态条件
|
|
|
|
|
List<DictBiz> warehouseType = DictBizCache.getList("after_sales_visits"); |
|
|
|
|
if (warehouseType.isEmpty()) { |
|
|
|
@ -937,8 +937,23 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
}else { |
|
|
|
|
throw new CustomerException("当前登录人无工单操作权限!!!"); |
|
|
|
|
} |
|
|
|
|
//进行仓库限制
|
|
|
|
|
List<Long> warehouseIds = new ArrayList<>(); |
|
|
|
|
if (!Objects.isNull(myCurrentWarehouse)){ |
|
|
|
|
warehouseIds.add(myCurrentWarehouse.getId()); |
|
|
|
|
}else { |
|
|
|
|
//获取当前人所有仓权限信息
|
|
|
|
|
List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWarehouseList(); |
|
|
|
|
if (!warehouseList.isEmpty()) { |
|
|
|
|
warehouseIds.addAll(warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (warehouseIds.isEmpty()) { |
|
|
|
|
throw new CustomerException("当前登录人无仓库信息,请联系管理人员!!!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class); |
|
|
|
|
IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity); |
|
|
|
|
IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity,warehouseIds); |
|
|
|
|
if (iPage.getRecords().isEmpty()) { |
|
|
|
|
log.error(">>>>>>>>>>>>>>>>>>查询工单列表为空"); |
|
|
|
|
IPage<AftersalesWorkOrderVO> data = AftersalesWorkOrderWrapper.build().pageVO(iPage); |
|
|
|
@ -1050,14 +1065,6 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void updateWorkOrderForOthers(Map<String, Object> aftersalesWorkOrder, Object workOrderStatus) { |
|
|
|
|
// 对其他情况的工单状态更新逻辑
|
|
|
|
|
// 优化后的代码根据实际情况进行填充
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (ObjectUtils.isNotNull(myCurrentWarehouse)) { |
|
|
|
|
aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId()); |
|
|
|
|
} else { |
|
|
|
|
throw new ServiceException("请选择仓库!"); |
|
|
|
|
} |
|
|
|
|
//已处理
|
|
|
|
|
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yichuli.getValue())) { |
|
|
|
|
aftersalesWorkOrder.remove("workOrderStatus"); |
|
|
|
@ -2634,4 +2641,29 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
return list; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 判断是否是客服角色 |
|
|
|
|
* @param user |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private boolean judgeIsCustomerService(BladeUser user){ |
|
|
|
|
String roleName = user.getRoleName(); |
|
|
|
|
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() |
|
|
|
|
.filter(i -> roleList.contains(i.getDictValue())) |
|
|
|
|
.findFirst(); |
|
|
|
|
if (matchingDictBiz.isPresent()) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}else { |
|
|
|
|
log.error("当前登录人角色信息错误!!!"); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|