客户信息补录

This commit is contained in:
zhonghua1
2026-01-09 22:10:31 +08:00
parent 34e352fbb6
commit 3c97a21baa
4 changed files with 107 additions and 4 deletions

View File

@@ -77,6 +77,20 @@ public class CustomerManagementController {
if (customerManagement.getId() == null || customerManagement.getId().trim().isEmpty()) {
throw new IllegalStateException("客户ID为空无法同步录音记录");
}
// 检查销售人员是否正在服务其他客户
String salesPhone = customerManagement.getSalesPhone();
if (salesPhone != null && !salesPhone.trim().isEmpty()) {
LambdaQueryWrapper<AudioManagement> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AudioManagement::getSalesPhone, salesPhone.trim())
.eq(AudioManagement::getServiceStatus, AudioManagementConstants.SERVICE_STATUS_IN_SERVICE);
long count = audioManagementService.count(queryWrapper);
if (count > 0) {
result.put("success", true);
result.put("message", isUpdate ? "客户信息更新成功" : "客户添加成功");
result.put("message", "该销售人员正在服务其他客户,无法创建新的服务记录");
return ResponseEntity.badRequest().body(result);
}
}
AudioManagement audioRecord = buildAudioRecordFromCustomer(customerManagement, now);
boolean audioSaved = audioManagementService.save(audioRecord);
if (!audioSaved) {