Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
RIT_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박권수
2021-09-15 22:39:38 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
62110d32487fb3dabc49bc44a554e2e2df127603
62110d32
2 parents
245eba24
75e74463
Merge branch 'server' into web
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
server/package.json
server/src/models/patientInfo.js
server/src/util/DataProcess.js
server/yarn.lock
server/package.json
View file @
62110d3
...
...
@@ -20,6 +20,7 @@
"@koa/cors"
:
"^3.1.0"
,
"firebase-admin"
:
"^9.11.1"
,
"moment"
:
"^2.29.1"
,
"moment-timezone"
:
"^0.5.33"
,
"mqtt"
:
"^4.2.6"
,
"node-cron"
:
"^3.0.0"
},
...
...
server/src/models/patientInfo.js
View file @
62110d3
const
mongoose
=
require
(
'mongoose'
);
const
moment
=
require
(
'moment'
);
require
(
'moment-timezone'
);
const
Schema
=
mongoose
.
Schema
;
...
...
@@ -35,9 +36,9 @@ PatientInfoSchema.methods.setUseYn = function(useYn) {
};
PatientInfoSchema
.
methods
.
updateInfo
=
function
(
info
)
{
const
date
=
moment
(
new
Date
()).
format
(
'YYYY-MM-DD hh
:mm'
);
const
date
=
moment
.
tz
(
'Asia/Seoul'
).
format
(
'YYYY-MM-DD HH
:mm'
);
if
(
this
.
info
.
length
)
this
.
info
=
this
.
info
.
concat
(
'\n\n'
,
`
${
date
}
➡
${
info
}
`
);
this
.
info
=
this
.
info
.
concat
(
'\n\n'
,
`
${
date
}
->
${
info
}
`
);
else
this
.
info
=
`
${
date
}
➡
${
info
}
`
;
};
...
...
server/src/util/DataProcess.js
View file @
62110d3
...
...
@@ -86,7 +86,7 @@ const transPublishingTopicAndMessage = async(bottleId) => {
const
bottleMedicine
=
await
BottleMedicine
.
findOne
({
bottleId
,
useYn
:
'Y'
});
const
takeMedicineHist
=
await
TakeMedicineHist
.
find
({
bmId
:
bottleMedicine
.
_id
}).
sort
(
(
a
,
b
)
=>
a
.
takeDate
<
b
.
takeDate
)[
0
];
}).
sort
(
{
takeDate
:
'asc'
}
)[
0
];
const
message
=
'res/'
+
await
transDate
(
takeMedicineHist
.
takeDate
)
+
'/'
+
bottleMedicine
.
dosage
;
...
...
server/yarn.lock
View file @
62110d3
...
...
@@ -2549,7 +2549,7 @@ minimist@^1.1.0, minimist@^1.2.5:
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
moment-timezone@^0.5.31:
moment-timezone@^0.5.31
, moment-timezone@^0.5.33
:
version "0.5.33"
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.33.tgz#b252fd6bb57f341c9b59a5ab61a8e51a73bbd22c"
integrity sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==
...
...
Please
register
or
login
to post a comment