自动插入客户信息

This commit is contained in:
2026-04-04 14:34:55 +08:00
parent aba24953d9
commit 28fc0d0e50
3 changed files with 18 additions and 7 deletions

View File

@@ -10,7 +10,7 @@
</parent> </parent>
<groupId>com.cst</groupId> <groupId>com.cst</groupId>
<artifactId>AIDriverEEBackend</artifactId> <artifactId>AIDriverEEBackend</artifactId>
<version>1.26032906.1-SNAPSHOT</version> <version>1.26040401.1-SNAPSHOT</version>
<name>Langchain4j-rj</name> <name>Langchain4j-rj</name>
<description>Langchain4j-rj20250803</description> <description>Langchain4j-rj20250803</description>
<url/> <url/>

View File

@@ -511,8 +511,15 @@ public class AudioManagementController {
customerManagementService.updateById(customerToUpdate); customerManagementService.updateById(customerToUpdate);
log.info("同步更新客户信息成功客户ID: {}", customerToUpdate.getId()); log.info("同步更新客户信息成功客户ID: {}", customerToUpdate.getId());
} else { } else {
log.warn("未找到对应的客户信息无法同步更新。customerId: {}, customerPhone: {}", log.warn("未找到对应的客户信息无法同步更新。customerId: {}, customerPhone: {}",
audioManagement.getCustomerId(), audioManagement.getCustomerPhone()); 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) { } catch (Exception e) {
// 客户信息更新失败不影响音频信息更新的结果,只记录日志 // 客户信息更新失败不影响音频信息更新的结果,只记录日志
@@ -601,17 +608,21 @@ public class AudioManagementController {
boolean success = audioManagementService.updateById(audio); boolean success = audioManagementService.updateById(audio);
// 根据 customerId把客户 customer_management 表的 recording_count 录音数加 1 // 根据已校验的客户记录,将 customer_management.recording_count 加 1(无客户或查不到客户则跳过)
if (customer != null) {
try { try {
CustomerManagement customerForUpdate = new CustomerManagement(); CustomerManagement customerForUpdate = new CustomerManagement();
customerForUpdate.setId(customer.getId()); customerForUpdate.setId(customer.getId());
customerForUpdate.setUpdateTime(LocalDateTime.now()); customerForUpdate.setUpdateTime(LocalDateTime.now());
Integer rc = customer.getRecordingCount();
customerForUpdate.setRecordingCount(rc == null ? 1 : rc + 1);
customerManagementService.updateById(customerForUpdate); customerManagementService.updateById(customerForUpdate);
log.info("更新客户录音数成功客户ID: {} ", customerId ); log.info("更新客户录音数成功客户ID: {}", customer.getId());
} catch (Exception e) { } catch (Exception e) {
// 客户录音数更新失败不影响录音服务结束的结果,只记录日志 // 客户录音数更新失败不影响录音服务结束的结果,只记录日志
log.error("更新客户录音数时发生异常: {}", e.getMessage(), e); log.error("更新客户录音数时发生异常: {}", e.getMessage(), e);
} }
}
if (success) { if (success) {

View File

@@ -91,8 +91,8 @@ spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
# tcpKeepAliveTCP 层定期发保活包,降低 NAT/防火墙 idle 断连(常见约 15 分钟)概率 # tcpKeepAliveTCP 层定期发保活包,降低 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://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&serverTimezone=Asia/Shanghai&tcpKeepAlive=true&autoReconnect=true&failOverReadOnly=false&maxReconnects=3&initialTimeout=2&connectTimeout=30000&socketTimeout=60000 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 username: root
password: cstcom.123! password: cstcom.123!
# password: ChangAndb.123! # password: ChangAndb.123!