Commit 74d88477 by 杨阔

修改大模型以及时间问题

parent 10c00f24
......@@ -46,7 +46,7 @@ public class BailianController {
headers.setBearerAuth(apiKey);
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 8192);
......@@ -101,7 +101,7 @@ public class BailianController {
headers.setBearerAuth(apiKey);
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 500);
......@@ -164,7 +164,7 @@ public class BailianController {
headers.setBearerAuth(apiKey);
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 1000);
......
......@@ -746,7 +746,7 @@ public class VisitPlanController {
// 构建请求体
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 2000);
......@@ -870,7 +870,7 @@ public class VisitPlanController {
// 构建请求体
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 3000);
......
......@@ -29,4 +29,6 @@ public class VisitPlanRequest {
private String plan;
private Map<String, Object> customerInfo;
private String username;
}
......@@ -290,8 +290,8 @@ public class Customer {
@PrePersist
protected void onCreate() {
createdAt = LocalDateTime.now();
updatedAt = LocalDateTime.now();
createdAt = LocalDateTime.now(java.time.ZoneId.of("Asia/Shanghai"));
updatedAt = LocalDateTime.now(java.time.ZoneId.of("Asia/Shanghai"));
if (id == null || id.isEmpty()) {
id = String.valueOf(System.currentTimeMillis());
}
......@@ -299,6 +299,6 @@ public class Customer {
@PreUpdate
protected void onUpdate() {
updatedAt = LocalDateTime.now();
updatedAt = LocalDateTime.now(java.time.ZoneId.of("Asia/Shanghai"));
}
}
\ No newline at end of file
......@@ -40,6 +40,6 @@ public class DialogContext {
@PrePersist
protected void onCreate() {
createdAt = LocalDateTime.now();
createdAt = LocalDateTime.now(java.time.ZoneId.of("Asia/Shanghai"));
}
}
\ No newline at end of file
package com.example.customervisit.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
......
......@@ -34,6 +34,6 @@ public class VisitPlanDetail {
@PrePersist
protected void onCreate() {
createdAt = LocalDateTime.now();
createdAt = LocalDateTime.now(java.time.ZoneId.of("Asia/Shanghai"));
}
}
\ No newline at end of file
......@@ -31,7 +31,11 @@ public class VisitReview {
@Column(name = "created_by")
private String createdBy;
@CreationTimestamp
@Column(name = "created_at", updatable = false)
private LocalDateTime createdAt;
@PrePersist
protected void onCreate() {
createdAt = LocalDateTime.now(java.time.ZoneId.of("Asia/Shanghai"));
}
}
\ No newline at end of file
......@@ -31,7 +31,11 @@ public class VisitSimulation {
@Column(name = "created_by")
private String createdBy;
@CreationTimestamp
@Column(name = "created_at", updatable = false)
private LocalDateTime createdAt;
@PrePersist
protected void onCreate() {
createdAt = LocalDateTime.now(java.time.ZoneId.of("Asia/Shanghai"));
}
}
......@@ -48,7 +48,7 @@ public class DeepSeekServiceImpl implements DeepSeekService {
headers.setBearerAuth(apiKey);
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 8192);
......@@ -108,7 +108,7 @@ public class DeepSeekServiceImpl implements DeepSeekService {
headers.setBearerAuth(apiKey);
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 500);
......@@ -175,7 +175,7 @@ public class DeepSeekServiceImpl implements DeepSeekService {
headers.setBearerAuth(apiKey);
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 1000);
......
......@@ -29,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.HashMap;
......@@ -267,7 +268,7 @@ public class IntentAnalyzeServiceImpl implements IntentAnalyzeService {
headers.setBearerAuth(apiKey);
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 8192);
......@@ -404,7 +405,7 @@ public class IntentAnalyzeServiceImpl implements IntentAnalyzeService {
headers.setBearerAuth(apiKey);
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 50);
......@@ -447,7 +448,7 @@ public class IntentAnalyzeServiceImpl implements IntentAnalyzeService {
headers.setBearerAuth(apiKey);
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 2000);
......@@ -543,9 +544,11 @@ public class IntentAnalyzeServiceImpl implements IntentAnalyzeService {
// 使用前端传递的时间戳,如果没有则使用当前时间
if (timestamp != null && !timestamp.trim().isEmpty()) {
try {
DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE_TIME;
LocalDateTime dateTime = LocalDateTime.parse(timestamp, formatter);
userMessage.setCreatedAt(dateTime);
// 使用 OffsetDateTime 来正确处理时区信息
DateTimeFormatter formatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
OffsetDateTime offsetDateTime = OffsetDateTime.parse(timestamp, formatter);
// 转换为上海时区的 LocalDateTime
userMessage.setCreatedAt(offsetDateTime.atZoneSameInstant(java.time.ZoneId.of("Asia/Shanghai")).toLocalDateTime());
} catch (DateTimeParseException e) {
// 如果解析失败,不设置,使用数据库默认值
}
......
......@@ -178,7 +178,7 @@ public class VisitSimulationServiceImpl implements VisitSimulationService {
headers.setBearerAuth(apiKey);
ObjectNode requestBody = objectMapper.createObjectNode();
requestBody.put("model", "qwen3");
requestBody.put("model", "kt_qwen");
requestBody.put("temperature", 0.7);
requestBody.put("max_tokens", 2000);
......
......@@ -3,7 +3,7 @@ spring:
name: customer-visit
datasource:
url: jdbc:mysql://localhost:3306/customer_visit?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
url: jdbc:mysql://localhost:3306/customer_visit?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useLegacyDatetimeCode=false
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
......@@ -18,10 +18,16 @@ spring:
format_sql: true
hbm2ddl:
foreign_keys: false
jdbc:
time_zone: Asia/Shanghai
connection:
time_zone: Asia/Shanghai
jackson:
time-zone: Asia/Shanghai
date-format: yyyy-MM-dd HH:mm:ss
deserialization:
adjust-dates-to-context-time-zone: false
servlet:
multipart:
......@@ -48,4 +54,4 @@ kt:
# 外部接口配置
external-api:
kt-userinfo-url: http://kt-uat-crm-common.tst.cp.xcloud.legendkaitian.com/userinfo/query/oneDimensionByItCode
kt-customer-url: http://kt-uat-crm-common.tst.cp.xcloud.legendkaitian.com/common/esdataimprot/query/customerByItCode
\ No newline at end of file
kt-customer-url: http://kt-uat-crm-common.tst.cp.xcloud.legendkaitian.com/common/esdataimprot/query/customerByItCode
......@@ -3,7 +3,7 @@ spring:
name: customer-visit
datasource:
url: jdbc:mysql://tidb.legendkaitian.com:4000/aisandbox?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
url: jdbc:mysql://tidb.legendkaitian.com:4000/aisandbox?useSSL=false&serverTimezone=Asia/Shanghai&useLegacyDatetimeCode=false
username: aisandbox
password: yUQ1C48VG1zl6WYi
driver-class-name: com.mysql.cj.jdbc.Driver
......@@ -18,10 +18,16 @@ spring:
format_sql: true
hbm2ddl:
foreign_keys: false
jdbc:
time_zone: Asia/Shanghai
connection:
time_zone: Asia/Shanghai
jackson:
time-zone: Asia/Shanghai
date-format: yyyy-MM-dd HH:mm:ss
deserialization:
adjust-dates-to-context-time-zone: false
servlet:
multipart:
......
......@@ -3,7 +3,7 @@ spring:
name: customer-visit
datasource:
url: jdbc:mysql://etl-tst.kt.lenovo.com:4000/aisandbox?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
url: jdbc:mysql://etl-tst.kt.lenovo.com:4000/aisandbox?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useLegacyDatetimeCode=false
username: aisandbox
password: Unzt9npj3I1lOWh4
driver-class-name: com.mysql.cj.jdbc.Driver
......@@ -18,10 +18,16 @@ spring:
format_sql: true
hbm2ddl:
foreign_keys: false
jdbc:
time_zone: Asia/Shanghai
connection:
time_zone: Asia/Shanghai
jackson:
time-zone: Asia/Shanghai
date-format: yyyy-MM-dd HH:mm:ss
deserialization:
adjust-dates-to-context-time-zone: false
servlet:
multipart:
......@@ -48,4 +54,4 @@ kt:
# 外部接口配置
external-api:
kt-userinfo-url: http://kt-uat-crm-common.tst.cp.xcloud.legendkaitian.com/userinfo/query/oneDimensionByItCode
kt-customer-url: http://kt-uat-crm-common.tst.cp.xcloud.legendkaitian.com/common/esdataimprot/query/customerByItCode
\ No newline at end of file
kt-customer-url: http://kt-uat-crm-common.tst.cp.xcloud.legendkaitian.com/common/esdataimprot/query/customerByItCode
......@@ -4,5 +4,8 @@ spring:
application:
name: customer-visit
profiles:
active: ${SPRING_PROFILES_ACTIVE:prod}
active: ${SPRING_PROFILES_ACTIVE:dev}
# JVM 时区设置
jvm:
timezone: Asia/Shanghai
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment