Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
long-tern-care-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hubin
long-tern-care-service
Commits
64ece249
Commit
64ece249
authored
May 09, 2023
by
zhangwanglin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务时长
parent
05056064
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
AccountServiceImpl.java
...hungraim/ltc/account/service/impl/AccountServiceImpl.java
+56
-0
NursingRecordsRespVO.java
...ungraim/ltc/pojo/entity/account/NursingRecordsRespVO.java
+3
-0
No files found.
account/account-service/src/main/java/com/hungraim/ltc/account/service/impl/AccountServiceImpl.java
View file @
64ece249
...
@@ -24,6 +24,7 @@ import com.hungraim.ltc.pojo.vo.disable.PlaceOtherVO;
...
@@ -24,6 +24,7 @@ import com.hungraim.ltc.pojo.vo.disable.PlaceOtherVO;
import
com.hungraim.ltc.util.*
;
import
com.hungraim.ltc.util.*
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -473,6 +474,16 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
...
@@ -473,6 +474,16 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
Page
<
NursingRecordsRespVO
>
nursingRecordsRespVOPage
=
null
;
Page
<
NursingRecordsRespVO
>
nursingRecordsRespVOPage
=
null
;
if
(
"上门"
.
equals
(
modeName
)){
if
(
"上门"
.
equals
(
modeName
)){
nursingRecordsRespVOPage
=
chDisabAccountsDetailMapper
.
queryNursingRecordsGoDoor
(
new
Page
<>(
nursingReqVO
.
getPageNum
(),
nursingReqVO
.
getPageSize
()),
nursingReqVO
);
nursingRecordsRespVOPage
=
chDisabAccountsDetailMapper
.
queryNursingRecordsGoDoor
(
new
Page
<>(
nursingReqVO
.
getPageNum
(),
nursingReqVO
.
getPageSize
()),
nursingReqVO
);
List
<
NursingRecordsRespVO
>
records
=
nursingRecordsRespVOPage
.
getRecords
();
for
(
NursingRecordsRespVO
record
:
records
)
{
String
srvStartTime
=
record
.
getSrvStartTime
();
String
srvEndTime
=
record
.
getSrvEndTime
();
if
(
StringUtils
.
isNotEmpty
(
srvStartTime
)
&&
StringUtils
.
isNotEmpty
(
srvEndTime
))
{
String
time
=
dateDiff
(
srvStartTime
,
srvEndTime
,
"yyyy-MM-dd HH:mm:ss"
,
"min"
);
record
.
setIntervalTime
(
time
);
}
}
}
else
{
}
else
{
nursingReqVO
.
setModeId
(
"医疗"
.
equals
(
modeName
)
?
"1"
:
"2"
);
nursingReqVO
.
setModeId
(
"医疗"
.
equals
(
modeName
)
?
"1"
:
"2"
);
nursingRecordsRespVOPage
=
chDisabAccountsDetailMapper
.
queryNursingRecords
(
new
Page
<>(
nursingReqVO
.
getPageNum
(),
nursingReqVO
.
getPageSize
()),
nursingReqVO
);
nursingRecordsRespVOPage
=
chDisabAccountsDetailMapper
.
queryNursingRecords
(
new
Page
<>(
nursingReqVO
.
getPageNum
(),
nursingReqVO
.
getPageSize
()),
nursingReqVO
);
...
@@ -480,6 +491,51 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
...
@@ -480,6 +491,51 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
return
nursingRecordsRespVOPage
;
return
nursingRecordsRespVOPage
;
}
}
/**
* 计算2个时间相差的天数、小时、分钟、秒
* @param startTime 开始时间
* @param endTime 截止时间
* @param format 时间格式 yyyy-MM-dd HH:mm:ss
* @param str 返回的数据为:day-天、hour-小时、min-分钟、second-秒
* @return
*/
public
static
String
dateDiff
(
String
startTime
,
String
endTime
,
String
format
,
String
str
)
{
// 按照传入的格式生成一个simpledateformate对象
SimpleDateFormat
sd
=
new
SimpleDateFormat
(
format
);
long
nd
=
1000
*
24
*
60
*
60
;
// 一天的毫秒数
long
nh
=
1000
*
60
*
60
;
// 一小时的毫秒数
long
nm
=
1000
*
60
;
// 一分钟的毫秒数
long
ns
=
1000
;
// 一秒钟的毫秒数
long
diff
;
long
day
=
0
;
long
hour
=
0
;
long
min
=
0
;
long
second
=
0
;
// 获得两个时间的毫秒时间差异
try
{
diff
=
sd
.
parse
(
endTime
).
getTime
()
-
sd
.
parse
(
startTime
).
getTime
();
// 计算差多少天
day
=
diff
/
nd
;
// 计算差多少小时
hour
=
diff
/
nh
;
// 计算差多少分钟
min
=
diff
/
nm
;
// 计算差多少秒
second
=
diff
/
ns
;
// 输出结果
System
.
out
.
println
(
"时间相差:"
+
day
+
"天"
+
(
hour
-
day
*
24
)
+
"小时"
+
(
min
-
day
*
24
*
60
)
+
"分钟"
+
second
+
"秒。"
);
/*System.out.println("hour=" + hour + ",min=" + min);*/
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
String
time
=
min
+
"分钟"
+
(
second
-
min
*
60
)
+
"秒"
;
return
time
;
}
@Override
@Override
public
OverallEduceDecreaseCostRespVO
queryOverallCostRecords
(
OverallCostReqVO
req
)
{
public
OverallEduceDecreaseCostRespVO
queryOverallCostRecords
(
OverallCostReqVO
req
)
{
return
chDisabAccountsDetailMapper
.
queryOverallCostRecords
(
req
);
return
chDisabAccountsDetailMapper
.
queryOverallCostRecords
(
req
);
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/account/NursingRecordsRespVO.java
View file @
64ece249
...
@@ -41,5 +41,8 @@ public class NursingRecordsRespVO {
...
@@ -41,5 +41,8 @@ public class NursingRecordsRespVO {
private
String
realName
;
private
String
realName
;
private
String
intervalTime
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment