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

Loading…
Cancel
Save