|
|
@@ -529,6 +529,15 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
|
|
|
// if (StringUtils.isBlank(bo.getPlatformCode())) {
|
|
|
// bo.setPlatformCode(PlatformContext.getPlatform());
|
|
|
// }
|
|
|
+ // 强制处理 isHighSeas 参数逻辑
|
|
|
+ Object isHighSeas = StringUtils.isNotBlank(bo.getIsHighSeas()) ? bo.getIsHighSeas() : bo.getParams().get("isHighSeas");
|
|
|
+ if (isHighSeas == null) {
|
|
|
+ // 如果没传,默认当做有效客户处理
|
|
|
+ bo.setIsHighSeas("false");
|
|
|
+ } else {
|
|
|
+ bo.setIsHighSeas(String.valueOf(isHighSeas));
|
|
|
+ }
|
|
|
+
|
|
|
Page<CustomerListVo> page = baseMapper.selectCustomerListPage(pageQuery.build(), bo);
|
|
|
|
|
|
// 补充业务员名称和信用等级名称
|
|
|
@@ -619,9 +628,6 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
|
|
|
lqw.orderByDesc(CustomerInfo::getId);
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getCustomerNo()), CustomerInfo::getCustomerNo, bo.getCustomerNo());
|
|
|
lqw.eq(bo.getBelongCompanyId() != null, CustomerInfo::getBelongCompanyId, bo.getBelongCompanyId());
|
|
|
- lqw.eq(bo.getSalesPersonId() != null, CustomerInfo::getSalesPersonId, bo.getSalesPersonId());
|
|
|
- lqw.eq(bo.getServiceStaffId() != null, CustomerInfo::getServiceStaffId, bo.getServiceStaffId());
|
|
|
- lqw.eq(bo.getBelongingDepartmentId() != null, CustomerInfo::getBelongingDepartmentId, bo.getBelongingDepartmentId());
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), CustomerInfo::getCompanyName, bo.getCompanyName());
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getCustomerName()), CustomerInfo::getCustomerName, bo.getCustomerName());
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getBusinessCustomerName()), CustomerInfo::getBusinessCustomerName, bo.getBusinessCustomerName());
|
|
|
@@ -645,6 +651,21 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getProvincialCityCounty()), CustomerInfo::getProvincialCityCounty, bo.getProvincialCityCounty());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), CustomerInfo::getStatus, bo.getStatus());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getPlatformCode()), CustomerInfo::getPlatformCode, bo.getPlatformCode());
|
|
|
+ lqw.eq(bo.getSalesPersonId() != null, CustomerInfo::getSalesPersonId, bo.getSalesPersonId());
|
|
|
+ lqw.eq(bo.getServiceStaffId() != null, CustomerInfo::getServiceStaffId, bo.getServiceStaffId());
|
|
|
+ lqw.eq(bo.getBelongingDepartmentId() != null, CustomerInfo::getBelongingDepartmentId, bo.getBelongingDepartmentId());
|
|
|
+ Object isHighSeasObj = StringUtils.isNotBlank(bo.getIsHighSeas()) ? bo.getIsHighSeas() : bo.getParams().get("isHighSeas");
|
|
|
+ String isHighSeasStr = (isHighSeasObj != null) ? StringUtils.lowerCase(String.valueOf(isHighSeasObj)) : "false";
|
|
|
+
|
|
|
+ if ("true".equals(isHighSeasStr)) {
|
|
|
+ // 公海客户:负责人和客服均为空(或为0)
|
|
|
+ lqw.and(w -> w.and(a -> a.isNull(CustomerInfo::getSalesPersonId).or().eq(CustomerInfo::getSalesPersonId, 0))
|
|
|
+ .and(b -> b.isNull(CustomerInfo::getServiceStaffId).or().eq(CustomerInfo::getServiceStaffId, 0)));
|
|
|
+ } else {
|
|
|
+ // 有效客户:负责人不为空(且不为0) OR 客服不为空(且不为0)
|
|
|
+ lqw.and(w -> w.and(a -> a.isNotNull(CustomerInfo::getSalesPersonId).ne(CustomerInfo::getSalesPersonId, 0))
|
|
|
+ .or(b -> b.isNotNull(CustomerInfo::getServiceStaffId).ne(CustomerInfo::getServiceStaffId, 0)));
|
|
|
+ }
|
|
|
return lqw;
|
|
|
}
|
|
|
|
|
|
@@ -1282,7 +1303,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
|
|
|
customerInfo.setBelongingDepartmentId(deptId);
|
|
|
updateList.add(customerInfo);
|
|
|
} else {
|
|
|
- log.warn("客户 ID: {} 的销售信息不存在,跳过更新", customerId);
|
|
|
+ log.warn("客户 ID: {} 不存在,跳过更新", customerId);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1293,8 +1314,8 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
|
|
|
updateList.size(), salesPersonId, deptId);
|
|
|
return updateList.size();
|
|
|
} else {
|
|
|
- log.error("批量更新销售信息失败");
|
|
|
- throw new ServiceException("批量更新销售信息失败");
|
|
|
+ log.error("批量更新客户信息失败");
|
|
|
+ throw new ServiceException("批量更新客户信息失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1334,7 +1355,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
|
|
|
customerInfo.setServiceStaffId(serviceStaffId);
|
|
|
updateList.add(customerInfo);
|
|
|
} else {
|
|
|
- log.warn("客户 ID: {} 的销售信息不存在,跳过更新", customerId);
|
|
|
+ log.warn("客户 ID: {} 不存在,跳过更新", customerId);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1345,8 +1366,8 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
|
|
|
updateList.size(), serviceStaffId);
|
|
|
return updateList.size();
|
|
|
} else {
|
|
|
- log.error("批量更新销售信息失败");
|
|
|
- throw new ServiceException("批量更新销售信息失败");
|
|
|
+ log.error("批量更新客户信息失败");
|
|
|
+ throw new ServiceException("批量更新客户信息失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1437,18 +1458,12 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
|
|
|
}
|
|
|
|
|
|
// 更新销售负责人和客服
|
|
|
- salesInfo.setSalesPersonId(claimBo.getSalesPersonId());
|
|
|
- salesInfo.setServiceStaffId(claimBo.getServiceStaffId());
|
|
|
- boolean flag = customerSalesInfoMapper.updateById(salesInfo) > 0;
|
|
|
-
|
|
|
- if (flag) {
|
|
|
- // 认领成功后,将客户主表状态改为有效 (通常 0 代表有效/正常)
|
|
|
- CustomerInfo customer = new CustomerInfo();
|
|
|
- customer.setId(customerId);
|
|
|
- customer.setStatus("0"); // 设置为有效客户
|
|
|
- baseMapper.updateById(customer);
|
|
|
- }
|
|
|
- return flag;
|
|
|
+ CustomerInfo customer = new CustomerInfo();
|
|
|
+ customer.setId(customerId);
|
|
|
+ customer.setSalesPersonId(claimBo.getSalesPersonId());
|
|
|
+ customer.setServiceStaffId(claimBo.getServiceStaffId());
|
|
|
+ customer.setStatus("0"); // 认领成功后,将客户主表状态改为有效
|
|
|
+ return baseMapper.updateById(customer) > 0;
|
|
|
}
|
|
|
|
|
|
@Override
|