Commit 74d88477 by 杨阔

修改大模型以及时间问题

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