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
43599d4f
Commit
43599d4f
authored
Apr 28, 2022
by
蔡镇泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
费用结算
parent
22ef61f1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
132 additions
and
18 deletions
+132
-18
SrvTaskMapper.java
...main/java/com/hungraim/ltc/account/dao/SrvTaskMapper.java
+1
-0
AccountService.java
...java/com/hungraim/ltc/account/service/AccountService.java
+1
-3
AccountServiceImpl.java
...hungraim/ltc/account/service/impl/AccountServiceImpl.java
+104
-14
ExpenseSettlementInfoBo.java
...hungraim/ltc/pojo/vo/account/ExpenseSettlementInfoBo.java
+4
-0
ExpenseSettlementVo.java
...com/hungraim/ltc/pojo/vo/account/ExpenseSettlementVo.java
+1
-1
ExpenseVo.java
...main/java/com/hungraim/ltc/pojo/vo/account/ExpenseVo.java
+21
-0
No files found.
account/account-service/src/main/java/com/hungraim/ltc/account/dao/SrvTaskMapper.java
View file @
43599d4f
...
...
@@ -28,6 +28,7 @@ public interface SrvTaskMapper extends BaseMapper<ChSrvTask> {
" t7.item_id "
+
//服务项目id
" t7.item_times "
+
//服务频次
" t7.planning_frequency "
+
//计划频次
" t7.planning_frequency_type "
+
//计划频次类型
" t8.srv_level_id "
+
//服务等级id
"FROM "
+
" ch_srv_task t1 "
+
...
...
account/account-service/src/main/java/com/hungraim/ltc/account/service/AccountService.java
View file @
43599d4f
...
...
@@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.hungraim.ltc.pojo.entity.account.ChDisabAccounts
;
import
com.hungraim.ltc.pojo.vo.account.*
;
import
java.util.List
;
public
interface
AccountService
extends
IService
<
ChDisabAccounts
>
{
/**
...
...
@@ -18,5 +16,5 @@ public interface AccountService extends IService<ChDisabAccounts> {
AccountOperVo
getSrvOrganDetail
(
Long
accountsId
);
List
<
ExpenseSettlementVo
>
expenseSettlement
(
ExpenseSettlementReq
req
);
ExpenseVo
expenseSettlement
(
ExpenseSettlementReq
req
);
}
account/account-service/src/main/java/com/hungraim/ltc/account/service/impl/AccountServiceImpl.java
View file @
43599d4f
...
...
@@ -10,7 +10,6 @@ import com.hungraim.ltc.account.service.BaseAccountService;
import
com.hungraim.ltc.api.AttachFeignService
;
import
com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach
;
import
com.hungraim.ltc.pojo.entity.account.ChDisabAccounts
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgramSet
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail
;
import
com.hungraim.ltc.pojo.vo.account.*
;
import
com.hungraim.ltc.util.*
;
...
...
@@ -76,7 +75,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
@Override
public
List
<
ExpenseSettlementVo
>
expenseSettlement
(
ExpenseSettlementReq
req
)
{
public
ExpenseVo
expenseSettlement
(
ExpenseSettlementReq
req
)
{
Page
<
ExpenseSettlementInfoBo
>
page
=
new
Page
<>(
req
.
getPageNum
(),
req
.
getPageSize
());
Page
<
ExpenseSettlementInfoBo
>
expenseSettlementInfo
=
srvTaskMapper
.
getExpenseSettlementInfo
(
page
,
req
);
List
<
ExpenseSettlementVo
>
vos
=
new
ArrayList
<>();
...
...
@@ -114,16 +113,26 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
Integer
srvTaskId
=
bo
.
getSrvTaskId
();
int
taskDetailsCount
=
taskDetailMapper
.
selectCount
(
new
LambdaQueryWrapper
<
ChSrvTaskDetail
>()
//计划次数
.
eq
(
ChSrvTaskDetail:
:
getSrvTaskId
,
srvTaskId
)
.
in
(
ChSrvTaskDetail:
:
getIllegalType
,
0
,
1
)
.
ne
(
ChSrvTaskDetail:
:
getStatus
,
3
));
List
<
ChSrvTaskDetail
>
taskDetails
=
taskDetailMapper
.
selectList
(
new
LambdaQueryWrapper
<
ChSrvTaskDetail
>()
.
eq
(
ChSrvTaskDetail:
:
getSrvTaskId
,
srvTaskId
)
.
in
(
ChSrvTaskDetail:
:
getIllegalType
,
0
,
1
)
.
eq
(
ChSrvTaskDetail:
:
getStatus
,
4
));
int
taskDetailsFinishCount
=
taskDetails
.
size
();
//完成次数
ChSrvProgramSet
chSrvProgramSet
=
programSetMapper
.
selectOne
(
new
LambdaQueryWrapper
<
ChSrvProgramSet
>()
.
eq
(
ChSrvProgramSet:
:
getProgramId
,
bo
.
getProgramId
())
.
eq
(
ChSrvProgramSet:
:
getIsConf
,
'1'
));
int
taskDetailsFinishCount
=
0
;
//完成次数
if
(
taskDetails
!=
null
&&
taskDetails
.
size
()
>
0
)
{
taskDetailsFinishCount
=
taskDetails
.
size
();
}
int
monPlanningFrequency
=
bo
.
getPlanningFrequency
();
//每月计划次数
if
(
bo
.
getPlanningFrequencyType
()
==
1
)
{
monPlanningFrequency
=
bo
.
getPlanningFrequency
();
}
else
if
(
bo
.
getPlanningFrequencyType
()
==
2
)
{
monPlanningFrequency
=
bo
.
getPlanningFrequency
()
*
30
;
}
else
if
(
bo
.
getPlanningFrequencyType
()
==
3
)
{
monPlanningFrequency
=
bo
.
getPlanningFrequency
()
*
4
;
}
BigDecimal
divide
=
BigDecimal
.
valueOf
(
taskDetailsFinishCount
).
divide
(
BigDecimal
.
valueOf
(
taskDetailsCount
),
2
,
BigDecimal
.
ROUND_DOWN
);
BigDecimal
divide1
=
BigDecimal
.
valueOf
(
bo
.
getItemTimes
()).
divide
(
BigDecimal
.
valueOf
(
bo
.
getPlanningFrequency
()
),
2
,
BigDecimal
.
ROUND_DOWN
);
BigDecimal
divide1
=
BigDecimal
.
valueOf
(
bo
.
getItemTimes
()).
divide
(
BigDecimal
.
valueOf
(
monPlanningFrequency
),
2
,
BigDecimal
.
ROUND_DOWN
);
if
(
divide
.
doubleValue
()
>
1
)
{
divide
=
BigDecimal
.
valueOf
(
1
);
}
...
...
@@ -133,10 +142,11 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BigDecimal
comp
=
divide
.
multiply
(
divide1
).
setScale
(
4
,
BigDecimal
.
ROUND_DOWN
);
//基护完成率
vo
.
setCompletionRateFoundationProtection
(
comp
.
multiply
(
BigDecimal
.
valueOf
(
100
)).
doubleValue
()
+
"%"
);
//巡护基护完成考核
BigDecimal
patrolAndBasicProtectionCompletedAssessment
=
null
;
//巡护基护完成考核
if
(
FndSrvMode
.
PATROL
.
getCode
().
equals
(
bo
.
getSrvModeId
()))
{
BigDecimal
patrolAndBasicProtectionCompletedAssessment
=
BigDecimal
.
valueOf
(
0.8
)
;
//巡护基护完成考核
if
(
FndSrvMode
.
PATROL
.
getCode
().
equals
(
bo
.
getSrvModeId
()))
{
//巡护
long
serviceTime
=
0
;
//服务时长/毫秒
int
serviceCount
=
0
;
//服务次数
if
(
taskDetails
!=
null
&&
taskDetails
.
size
()
>
0
)
{
for
(
ChSrvTaskDetail
taskDetail
:
taskDetails
)
{
long
l
=
taskDetail
.
getSrvEndTime
().
getTime
()
-
taskDetail
.
getSrvStartTime
().
getTime
();
serviceTime
+=
l
;
...
...
@@ -144,7 +154,11 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
serviceCount
++;
}
}
long
serviceTimeM
=
serviceTime
/
(
1000
*
60
*
60
);
//服务时长/小时
}
long
serviceTimeM
=
0
;
if
(
serviceTime
!=
0
)
{
serviceTimeM
=
serviceTime
/
(
1000
*
60
*
60
);
//服务时长/小时
}
boolean
serviceCountK
=
false
;
//服务次数考核
boolean
serviceTimeK
=
false
;
//服务时长考核
if
(
serviceCount
>=
6
)
{
...
...
@@ -170,7 +184,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
patrolAndBasicProtectionCompletedAssessment
=
BigDecimal
.
valueOf
(
0.9
);
vo
.
setPatrolAndBasicProtectionCompletedAssessment
(
"90%"
);
}
else
{
patrolAndBasicProtectionCompletedAssessment
=
BigDecimal
.
valueOf
(
0.8
);
vo
.
setPatrolAndBasicProtectionCompletedAssessment
(
"80%"
);
}
}
...
...
@@ -197,7 +210,16 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
vo
.
setStandardCareCost
(
"45元/人/天"
);
}
//照护费用
BigDecimal
careCosts
=
BigDecimal
.
valueOf
(
standardCareCost
).
multiply
(
BigDecimal
.
valueOf
(
effectiveSettlementDate
));
List
<
ChSrvTaskDetail
>
taskDetails2
=
taskDetailMapper
.
selectList
(
new
LambdaQueryWrapper
<
ChSrvTaskDetail
>()
.
eq
(
ChSrvTaskDetail:
:
getSrvTaskId
,
srvTaskId
)
.
in
(
ChSrvTaskDetail:
:
getIllegalType
,
0
,
2
)
.
eq
(
ChSrvTaskDetail:
:
getStatus
,
4
));
BigDecimal
careCosts
=
BigDecimal
.
valueOf
(
0
);
int
taskDetailsFinishCount2
=
0
;
if
(
taskDetails2
!=
null
&&
taskDetails2
.
size
()
>
0
)
{
taskDetailsFinishCount2
=
taskDetails2
.
size
();
careCosts
=
BigDecimal
.
valueOf
(
standardCareCost
).
multiply
(
BigDecimal
.
valueOf
(
taskDetails2
.
size
()));
}
if
(
FndSrvMode
.
PATROL
.
getCode
().
equals
(
bo
.
getSrvModeId
()))
{
//巡护
if
(
CfgSrvLevel
.
ONE
.
getCode
().
equals
(
bo
.
getSrvLevelId
()))
{
//服务等级
if
(
careCosts
.
intValue
()
>
600
)
{
...
...
@@ -215,11 +237,75 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
vo
.
setCareCosts
(
careCosts
.
doubleValue
());
//照护完成率
int
taskDetailsCount2
=
taskDetailMapper
.
selectCount
(
new
LambdaQueryWrapper
<
ChSrvTaskDetail
>()
//计划次数
.
eq
(
ChSrvTaskDetail:
:
getSrvTaskId
,
srvTaskId
)
.
in
(
ChSrvTaskDetail:
:
getIllegalType
,
0
,
2
)
.
ne
(
ChSrvTaskDetail:
:
getStatus
,
3
));
BigDecimal
divide2
=
BigDecimal
.
valueOf
(
taskDetailsFinishCount2
).
divide
(
BigDecimal
.
valueOf
(
taskDetailsCount2
),
2
,
BigDecimal
.
ROUND_DOWN
);
BigDecimal
divide3
=
BigDecimal
.
valueOf
(
bo
.
getItemTimes
()).
divide
(
BigDecimal
.
valueOf
(
monPlanningFrequency
),
2
,
BigDecimal
.
ROUND_DOWN
);
if
(
divide2
.
doubleValue
()
>
1
)
{
divide2
=
BigDecimal
.
valueOf
(
1
);
}
if
(
divide3
.
doubleValue
()
>
1
)
{
divide3
=
BigDecimal
.
valueOf
(
1
);
}
BigDecimal
comp2
=
divide2
.
multiply
(
divide3
).
setScale
(
4
,
BigDecimal
.
ROUND_DOWN
);
//照护完成率
vo
.
setCareCompletionRate
(
comp2
.
multiply
(
BigDecimal
.
valueOf
(
100
)).
doubleValue
()
+
"%"
);
//巡护照护完成考核
BigDecimal
patrolCareCompletionAssessment
=
BigDecimal
.
valueOf
(
0.8
);
//巡护照护完成考核
if
(
FndSrvMode
.
PATROL
.
getCode
().
equals
(
bo
.
getSrvModeId
()))
{
//巡护
long
serviceTime
=
0
;
//服务时长/毫秒
int
serviceCount
=
0
;
//服务次数
if
(
taskDetails2
!=
null
&&
taskDetails2
.
size
()
>
0
)
{
for
(
ChSrvTaskDetail
taskDetail
:
taskDetails2
)
{
long
l
=
taskDetail
.
getSrvEndTime
().
getTime
()
-
taskDetail
.
getSrvStartTime
().
getTime
();
serviceTime
+=
l
;
if
(
l
>
30
*
60
*
1000
)
{
serviceCount
++;
}
}
}
long
serviceTimeM
=
0
;
if
(
serviceTime
!=
0
)
{
serviceTimeM
=
serviceTime
/
(
1000
*
60
*
60
);
//服务时长/小时
}
boolean
serviceCountK
=
false
;
//服务次数考核
boolean
serviceTimeK
=
false
;
//服务时长考核
if
(
serviceCount
>=
6
)
{
serviceCountK
=
true
;
}
if
(
DisableLevel
.
ONE
.
getCode
().
equals
(
bo
.
getDisableLevelId
()))
{
if
(
serviceTimeM
>=
8
)
{
serviceTimeK
=
true
;
}
}
else
if
(
DisableLevel
.
TWO
.
getCode
().
equals
(
bo
.
getDisableLevelId
()))
{
if
(
serviceTimeM
>=
10
)
{
serviceTimeK
=
true
;
}
}
else
if
(
DisableLevel
.
THREE
.
getCode
().
equals
(
bo
.
getDisableLevelId
()))
{
if
(
serviceTimeM
>=
12
)
{
serviceTimeK
=
true
;
}
}
if
(
serviceCountK
&&
serviceTimeK
)
{
patrolCareCompletionAssessment
=
BigDecimal
.
valueOf
(
1
);
vo
.
setPatrolCareCompletionAssessment
(
"100%"
);
}
else
if
(
serviceCountK
||
serviceTimeK
)
{
patrolCareCompletionAssessment
=
BigDecimal
.
valueOf
(
0.9
);
vo
.
setPatrolCareCompletionAssessment
(
"90%"
);
}
else
{
vo
.
setPatrolCareCompletionAssessment
(
"80%"
);
}
}
//照护应拨费用
if
(
FndSrvMode
.
PATROL
.
getCode
().
equals
(
bo
.
getSrvModeId
()))
{
//巡护
BigDecimal
multiply
=
careCosts
.
multiply
(
comp2
).
multiply
(
patrolCareCompletionAssessment
).
multiply
(
BigDecimal
.
valueOf
(
0.9
)).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
);
vo
.
setCarePayable
(
multiply
.
doubleValue
());
}
else
if
(
FndSrvMode
.
HOME_CARE
.
getCode
().
equals
(
bo
.
getSrvModeId
())
||
FndSrvMode
.
HOSPITAL_NURSING
.
getCode
().
equals
(
bo
.
getSrvModeId
()))
{
//家护/院护
BigDecimal
multiply
=
careCosts
.
multiply
(
comp2
).
multiply
(
BigDecimal
.
valueOf
(
0.9
)).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
);
vo
.
setCarePayable
(
multiply
.
doubleValue
());
}
//应拨付总金额
vo
.
setTotalAmountDue
(
BigDecimal
.
valueOf
(
vo
.
getExpensesPayableFoundationProtection
()).
add
(
BigDecimal
.
valueOf
(
vo
.
getCarePayable
())).
doubleValue
());
vos
.
add
(
vo
);
...
...
@@ -248,8 +334,12 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
//应拨付总金额
totalAmountDue
=
totalAmountDue
.
add
(
BigDecimal
.
valueOf
(
vo
.
getTotalAmountDue
()));
}
ExpenseVo
expenseVo
=
new
ExpenseVo
();
expenseVo
.
setExpenseSettlements
(
vos
);
expenseVo
.
setTotal
(
totalVo
);
return
expenseVo
;
}
return
n
ull
;
return
n
ew
ExpenseVo
()
;
}
//求当月最后一天
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/account/ExpenseSettlementInfoBo.java
View file @
43599d4f
...
...
@@ -68,6 +68,10 @@ public class ExpenseSettlementInfoBo {
* 计划频次
*/
private
Integer
planningFrequency
;
/**
* 计划频次类型
*/
private
Integer
planningFrequencyType
;
/**
* 服务等级id
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/account/ExpenseSettlementVo.java
View file @
43599d4f
...
...
@@ -100,6 +100,6 @@ public class ExpenseSettlementVo {
/**
* 合计
*/
private
String
total
;
private
ExpenseSettlementTotalVo
total
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/account/ExpenseVo.java
0 → 100644
View file @
43599d4f
package
com
.
hungraim
.
ltc
.
pojo
.
vo
.
account
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
ExpenseVo
{
/**
* 费用结算
*/
private
List
<
ExpenseSettlementVo
>
expenseSettlements
;
/**
* 合计
*/
private
ExpenseSettlementTotalVo
total
;
}
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