diff --git a/tcp_server/config.toml b/tcp_server/config.toml index bb25323..2054ad1 100644 --- a/tcp_server/config.toml +++ b/tcp_server/config.toml @@ -3,8 +3,8 @@ address = "127.0.0.1" port = 9090 [database] -#host = "10.180.4.100" -host = "192.168.0.100" +host = "10.180.4.100" +#host = "192.168.0.100" port = 5432 name = "Auseft_RL_WEB_3" user = "postgres" diff --git a/tcp_server/src/main.rs b/tcp_server/src/main.rs index 1a89bbd..4dd1328 100644 --- a/tcp_server/src/main.rs +++ b/tcp_server/src/main.rs @@ -600,13 +600,13 @@ async fn insert_record(client: &tokio_postgres::Client, info: &RecordInfo) -> Re // 解析时间字段 let check_time = info.check_time.as_deref() - .and_then(|s| NaiveDateTime::parse_from_str(s, "%Y-%m-%d %H:%M:%S").ok()); + .and_then(|s| NaiveDateTime::parse_from_str(s, "%Y-%m-%dT%H:%M:%S%.3f").ok()); let approve_time = info.approve_time.as_deref() - .and_then(|s| NaiveDateTime::parse_from_str(s, "%Y-%m-%d %H:%M:%S").ok()); + .and_then(|s| NaiveDateTime::parse_from_str(s, "%Y-%m-%dT%H:%M:%S%.3f").ok()); let hy_time = info.hy_time.as_deref() - .and_then(|s| NaiveDateTime::parse_from_str(s, "%Y-%m-%d %H:%M:%S").ok()); + .and_then(|s| NaiveDateTime::parse_from_str(s, "%Y-%m-%dT%H:%M:%S%.3f").ok()); let accept_time = info.accept_time.as_deref() - .and_then(|s| NaiveDateTime::parse_from_str(s, "%Y-%m-%d %H:%M:%S").ok()); + .and_then(|s| NaiveDateTime::parse_from_str(s, "%Y-%m-%dT%H:%M:%S%.3f").ok()); if exists { // 如果记录存在,执行更新操作 diff --git a/tcp_server/target/debug/tcp_server.exe b/tcp_server/target/debug/tcp_server.exe index 7abafbc..b4be464 100644 Binary files a/tcp_server/target/debug/tcp_server.exe and b/tcp_server/target/debug/tcp_server.exe differ diff --git a/tcp_server/target/debug/tcp_server.pdb b/tcp_server/target/debug/tcp_server.pdb index f27c5f2..b67b66a 100644 Binary files a/tcp_server/target/debug/tcp_server.pdb and b/tcp_server/target/debug/tcp_server.pdb differ