From 022b1522b56eebdede977a78e0906891b65d774b Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 07 一月 2025 21:20:55 +0800
Subject: [PATCH] gx
---
app.js | 28 +++++++++++++++++++++++++---
1 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/app.js b/app.js
index d97bce9..7ce52c2 100644
--- a/app.js
+++ b/app.js
@@ -383,10 +383,10 @@
image:body.image,
request_doctor:body.requestDoctor,
request_department:body.requestDepartment,
- request_date:body.requestDate,
+ request_date:getDateString(body.requestDate),
exam_department:body.examDepartment,
diagnostician_doctor:body.diagnosticianDoctor,
- check_date:body.checkDate,
+ check_date:getDateString(body.checkDate),
check_result:body.checkResult,
diagnosis:body.diagnosis,
exam_type_id:body.examTypeId,
@@ -408,7 +408,7 @@
}
catch(err){
logger.info(`血流量设备上报结果,请求报错`)
- res.status(400).json({ retCode: "-1", msg: "请求出错了" });
+ res.status(400).json({ retCode: "-1", msg: "请求出错了11" });
}
@@ -510,3 +510,25 @@
return age;
}
+
+/**
+ * 时间戳转string 输出: "2024-01-08 00:00:00" (假设时区为东八区)
+ * @param {*} date
+ */
+function getDateString(date){
+ try{
+ if(date){
+ let timestamp = 1734624000000;
+ let d = new Date(timestamp);
+ return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')} ${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}:${String(d.getSeconds()).padStart(2, '0')}`;
+ }else{
+ return ''
+ }
+ }
+ catch(err){
+ console.log(err)
+ return ''
+ }
+
+
+}
\ No newline at end of file
--
Gitblit v1.8.0