From 28fc0d0e50248b9f59bb60cba781dd823ade55fb Mon Sep 17 00:00:00 2001 From: cst61 Date: Sat, 4 Apr 2026 14:34:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8F=92=E5=85=A5=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../controller/AudioManagementController.java | 19 +++++++++++++++---- src/main/resources/application.yml | 4 ++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 2ae07df..1fe8fe6 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.cst AIDriverEEBackend - 1.26032906.1-SNAPSHOT + 1.26040401.1-SNAPSHOT Langchain4j-rj Langchain4j-rj20250803 diff --git a/src/main/java/com/rj/controller/AudioManagementController.java b/src/main/java/com/rj/controller/AudioManagementController.java index 1ebbf22..e27bba5 100644 --- a/src/main/java/com/rj/controller/AudioManagementController.java +++ b/src/main/java/com/rj/controller/AudioManagementController.java @@ -511,8 +511,15 @@ public class AudioManagementController { customerManagementService.updateById(customerToUpdate); log.info("同步更新客户信息成功,客户ID: {}", customerToUpdate.getId()); } else { - log.warn("未找到对应的客户信息,无法同步更新。customerId: {}, customerPhone: {}", - audioManagement.getCustomerId(), audioManagement.getCustomerPhone()); + log.warn("未找到对应的客户信息,无法同步更新。customerId: {}, customerPhone: {}", + audioManagement.getCustomerId(), audioManagement.getCustomerPhone()); + + customerToUpdate = new CustomerManagement(); + customerToUpdate.setCustomerName(audioManagement.getCustomerName()); + customerToUpdate.setContact(audioManagement.getCustomerPhone()); + customerToUpdate.setDetailedAddress(audioManagement.getRemarks()); + customerToUpdate.setUpdateTime(LocalDateTime.now()); + customerManagementService.save(customerToUpdate); } } catch (Exception e) { // 客户信息更新失败不影响音频信息更新的结果,只记录日志 @@ -601,17 +608,21 @@ public class AudioManagementController { boolean success = audioManagementService.updateById(audio); - // 根据 customerId,把客户 customer_management 表的 recording_count 录音数加 1 + // 根据已校验的客户记录,将 customer_management.recording_count 加 1(无客户或查不到客户则跳过) + if (customer != null) { try { CustomerManagement customerForUpdate = new CustomerManagement(); customerForUpdate.setId(customer.getId()); customerForUpdate.setUpdateTime(LocalDateTime.now()); + Integer rc = customer.getRecordingCount(); + customerForUpdate.setRecordingCount(rc == null ? 1 : rc + 1); customerManagementService.updateById(customerForUpdate); - log.info("更新客户录音数成功,客户ID: {} ", customerId ); + log.info("更新客户录音数成功,客户ID: {}", customer.getId()); } catch (Exception e) { // 客户录音数更新失败不影响录音服务结束的结果,只记录日志 log.error("更新客户录音数时发生异常: {}", e.getMessage(), e); } + } if (success) { diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index c1af4e6..03dae46 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -91,8 +91,8 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver # tcpKeepAlive:TCP 层定期发保活包,降低 NAT/防火墙 idle 断连(常见约 15 分钟)概率 -# url: jdbc:mysql://124.221.59.58:3309/ai_smart_ee?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&tcpKeepAlive=true&socketTimeout=60000&connectTimeout=30000&autoReconnect=true&failOverReadOnly=false&maxReconnects=3&initialTimeout=2 - url: jdbc:mysql://192.168.1.44:3309/ai_smart_ee?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tcpKeepAlive=true&autoReconnect=true&failOverReadOnly=false&maxReconnects=3&initialTimeout=2&connectTimeout=30000&socketTimeout=60000 +# url: jdbc:mysql://124.221.59.58:3309/ai_smart_ee?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true&tcpKeepAlive=true&socketTimeout=60000&connectTimeout=30000&autoReconnect=true&failOverReadOnly=false&maxReconnects=3&initialTimeout=2 + url: jdbc:mysql://192.168.1.44:3309/ai_smart_ee?useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&tcpKeepAlive=true&autoReconnect=true&failOverReadOnly=false&maxReconnects=3&initialTimeout=2&connectTimeout=30000&socketTimeout=60000 username: root password: cstcom.123! # password: ChangAndb.123!