Browse Source

时间字段调整

晋江
OCEAN 2 months ago
parent
commit
6032e40865
4 changed files with 6 additions and 6 deletions
  1. +2
    -2
      tcp_server/config.toml
  2. +4
    -4
      tcp_server/src/main.rs
  3. BIN
      tcp_server/target/debug/tcp_server.exe
  4. BIN
      tcp_server/target/debug/tcp_server.pdb

+ 2
- 2
tcp_server/config.toml View File

@@ -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"


+ 4
- 4
tcp_server/src/main.rs View File

@@ -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 {
// 如果记录存在,执行更新操作


BIN
tcp_server/target/debug/tcp_server.exe View File


BIN
tcp_server/target/debug/tcp_server.pdb View File


Loading…
Cancel
Save