Browse Source

工单修复账号多角色

visual
汤建军 3 months ago
parent
commit
523e307622
  1. 45
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

45
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -898,7 +898,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
if (user == null) {
throw new ServiceException("用户信息获取失败");
}
String roleName = user.getRoleName();
List<String> roleList = Arrays.asList(user.getRoleName().split(","));
String tenantId = user.getTenantId();
// 查询 状态条件
@ -911,29 +911,30 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
if (Func.isEmpty(myCurrentWarehouse)) {
log.warn(">>>>myCurrentWarehouse {}", myCurrentWarehouse);
}
Optional<DictBiz> matchingDictBiz = warehouseType.stream()
.filter(i -> i.getDictValue().equals(roleName))
.findFirst();
Object workOrderStatus = aftersalesWorkOrder.get("workOrderStatus");
if (matchingDictBiz.isPresent()) {
String dictValue = matchingDictBiz.get().getDictKey();
switch (dictValue) {
case "1": // 客服经理
updateWorkOrderForManager(aftersalesWorkOrder, workOrderStatus);
break;
case "2": // 营业部客服
updateWorkOrderForSales(aftersalesWorkOrder, workOrderStatus);
break;
case "3": // 职能客服
updateWorkOrderForFunctional(aftersalesWorkOrder, workOrderStatus, user.getUserId());
break;
if (!roleList.isEmpty()) {
Optional<DictBiz> matchingDictBiz = warehouseType.stream()
.filter(i -> roleList.contains(i.getDictValue()))
.findFirst();
Object workOrderStatus = aftersalesWorkOrder.get("workOrderStatus");
if (matchingDictBiz.isPresent()) {
String dictValue = matchingDictBiz.get().getDictKey();
switch (dictValue) {
case "1": // 客服经理
updateWorkOrderForManager(aftersalesWorkOrder, workOrderStatus);
break;
case "2": // 营业部客服
updateWorkOrderForSales(aftersalesWorkOrder, workOrderStatus);
break;
case "3": // 职能客服
updateWorkOrderForFunctional(aftersalesWorkOrder, workOrderStatus, user.getUserId());
break;
}
} else {
updateWorkOrderForOthers(aftersalesWorkOrder, workOrderStatus);
}
} else {
updateWorkOrderForOthers(aftersalesWorkOrder, workOrderStatus);
}else {
throw new CustomerException("当前登录人无工单操作权限!!!");
}
AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class);
IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity);
if (iPage.getRecords().isEmpty()) {

Loading…
Cancel
Save