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
08a083cb
Commit
08a083cb
authored
Feb 10, 2023
by
zhangwanglin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务方式新增
parent
089f0e4d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
71 deletions
+62
-71
ChDisabAccountsDetailMapper.java
...hungraim/ltc/account/dao/ChDisabAccountsDetailMapper.java
+1
-1
AccountServiceImpl.java
...hungraim/ltc/account/service/impl/AccountServiceImpl.java
+53
-43
ChDisabAccountsDetailMapper.xml
...src/main/resources/mapper/ChDisabAccountsDetailMapper.xml
+6
-26
ChSrvTaskDetailMapper.xml
...rvice/src/main/resources/mapper/ChSrvTaskDetailMapper.xml
+1
-0
SrvTaskRespVO.java
.../java/com/hungraim/ltc/pojo/vo/account/SrvTaskRespVO.java
+1
-1
No files found.
account/account-service/src/main/java/com/hungraim/ltc/account/dao/ChDisabAccountsDetailMapper.java
View file @
08a083cb
...
@@ -16,7 +16,7 @@ import java.util.List;
...
@@ -16,7 +16,7 @@ import java.util.List;
@Repository
@Repository
public
interface
ChDisabAccountsDetailMapper
extends
BaseMapper
<
ChDisabDetailAccounts
>
{
public
interface
ChDisabAccountsDetailMapper
extends
BaseMapper
<
ChDisabDetailAccounts
>
{
List
<
OrganAccountsVO
>
getOrganAccountsList
(
@Param
(
"taskDetailIds"
)
List
<
String
>
taskDetailIds
,
String
status
);
List
<
OrganAccountsVO
>
getOrganAccountsList
(
String
taskDetailId
);
Page
<
SrvOrganAccountListResp
>
searchSrvOrganAccountList
(
Page
page
,
List
<
Long
>
organIds
,
SrvOrganListReq
req
);
Page
<
SrvOrganAccountListResp
>
searchSrvOrganAccountList
(
Page
page
,
List
<
Long
>
organIds
,
SrvOrganListReq
req
);
...
...
account/account-service/src/main/java/com/hungraim/ltc/account/service/impl/AccountServiceImpl.java
View file @
08a083cb
...
@@ -35,7 +35,6 @@ import java.text.ParseException;
...
@@ -35,7 +35,6 @@ import java.text.ParseException;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
@Service
@Service
@AllArgsConstructor
@AllArgsConstructor
...
@@ -475,50 +474,68 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
...
@@ -475,50 +474,68 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
@Override
public
void
organAccountTaskExecute
(
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
)
{
public
void
organAccountTaskExecute
(
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
)
{
List
<
String
>
taskDetailIdList
=
accountTaskExecuteReqVOS
.
stream
().
map
(
AccountTaskExecuteReqVO:
:
getTaskDetailId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isEmpty
(
accountTaskExecuteReqVOS
))
{
// 已完成
return
;
List
<
ChSrvTaskFinishItem
>
chSrvTaskFinishItems
=
chSrvTaskFinishItemMapper
.
selectList
(
new
LambdaQueryWrapper
<
ChSrvTaskFinishItem
>()
.
in
(
ChSrvTaskFinishItem:
:
getTaskDetailId
,
taskDetailIdList
));
for
(
AccountTaskExecuteReqVO
accountTaskExecuteReqVO
:
accountTaskExecuteReqVOS
)
{
// 一个任务下只要有一条服务完成就产生结算,多个服务完成算一条服务的结算(实际上结算详情有一条记录就产生结算费用)
List
<
ChSrvTaskFinishItem
>
chSrvTaskFinishItemStream
=
chSrvTaskFinishItems
.
stream
().
filter
(
s
->
s
.
getItemId
().
equals
(
Long
.
valueOf
(
accountTaskExecuteReqVO
.
getItemId
()))).
collect
(
Collectors
.
toList
());
String
planId
=
accountTaskExecuteReqVO
.
getPlanId
();
Integer
integer
=
chSrvTaskDetailMapper
.
updateSrvPlanById
(
planId
);
if
(
CollectionUtil
.
isNotEmpty
(
chSrvTaskFinishItemStream
))
{
return
;
}
ChSrvTaskFinishItem
chSrvTaskFinishItem
=
new
ChSrvTaskFinishItem
();
chSrvTaskFinishItem
.
setTaskDetailId
(
Long
.
valueOf
(
accountTaskExecuteReqVO
.
getTaskDetailId
()));
chSrvTaskFinishItem
.
setItemId
(
Long
.
valueOf
(
accountTaskExecuteReqVO
.
getItemId
()));
chSrvTaskFinishItemMapper
.
insert
(
chSrvTaskFinishItem
);
ChSrvTaskDetail
ca
=
new
ChSrvTaskDetail
();
ca
.
setStatus
((
short
)
4
);
ca
.
setTaskDetailId
(
Long
.
valueOf
(
accountTaskExecuteReqVO
.
getTaskDetailId
()));
chSrvTaskDetailMapper
.
updateById
(
ca
);
}
}
List
<
String
>
taskDetailIds
=
accountTaskExecuteReqVOS
.
stream
().
map
(
AccountTaskExecuteReqVO:
:
getTaskDetailId
).
collect
(
Collectors
.
toList
());
List
<
OrganAccountsVO
>
accountsList
=
chDisabAccountsDetailMapper
.
getOrganAccountsList
(
taskDetailIds
,
"4"
);
List
<
String
>
taskDetailIds
=
accountTaskExecuteReqVOS
.
stream
().
map
(
AccountTaskExecuteReqVO:
:
getTaskDetailId
).
distinct
().
collect
(
Collectors
.
toList
()
);
// 根据
机构,服务方式和时间查找结算表是否有数据,有数据进行累加
// 根据
任务id查找结算详情,还没有对应的任务数据说明还未发生过结算,进行插入详情表和结算表
List
<
ChDisabDetailAccounts
>
chDisabDetailList
=
chDisabAccountsDetailMapper
.
queryAccountByCondition
(
taskDetailIds
);
List
<
ChDisabDetailAccounts
>
chDisabDetailList
=
chDisabAccountsDetailMapper
.
queryAccountByCondition
(
taskDetailIds
);
// 详情表还没有对应的任务数据说明还未发生过结算,进行插入详情表和结算表
// 根据任务id分组,一个任务下会有多个项目,任务id相同
if
(
CollectionUtil
.
isEmpty
(
chDisabDetailList
)){
Map
<
String
,
List
<
AccountTaskExecuteReqVO
>>
accountTaskMap
=
accountTaskExecuteReqVOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
AccountTaskExecuteReqVO:
:
getTaskDetailId
));
for
(
Map
.
Entry
<
String
,
List
<
AccountTaskExecuteReqVO
>>
entry:
accountTaskMap
.
entrySet
())
{
String
taskDetailId
=
entry
.
getKey
();
// 已完成的任务,一个任务下有服务完成就产生结算,多个服务完成算一条服务的结算(实际上结算详情有一条记录就产生结算费用)
List
<
ChSrvTaskFinishItem
>
chSrvTaskFinishItems
=
chSrvTaskFinishItemMapper
.
selectList
(
new
LambdaQueryWrapper
<
ChSrvTaskFinishItem
>()
.
eq
(
ChSrvTaskFinishItem:
:
getTaskDetailId
,
taskDetailId
));
List
<
AccountTaskExecuteReqVO
>
accountTaskList
=
entry
.
getValue
();
// 处理具体的服务项目
for
(
AccountTaskExecuteReqVO
accountTaskExecuteReqVO
:
accountTaskList
)
{
// 已完成的任务更新ch_srv_plan状态
String
planId
=
accountTaskExecuteReqVO
.
getPlanId
();
Integer
integer
=
chSrvTaskDetailMapper
.
updateSrvPlanById
(
planId
);
if
(
CollectionUtil
.
isNotEmpty
(
chSrvTaskFinishItems
))
{
List
<
ChSrvTaskFinishItem
>
chSrvTaskFinishItemStream
=
chSrvTaskFinishItems
.
stream
()
.
filter
(
s
->
s
.
getItemId
().
equals
(
Long
.
valueOf
(
accountTaskExecuteReqVO
.
getItemId
()))).
collect
(
Collectors
.
toList
());
// 如果存在就不插入了
if
(
CollectionUtil
.
isNotEmpty
(
chSrvTaskFinishItemStream
))
{
return
;
}
}
ChSrvTaskFinishItem
chSrvTaskFinishItem
=
new
ChSrvTaskFinishItem
();
chSrvTaskFinishItem
.
setTaskDetailId
(
Long
.
valueOf
(
accountTaskExecuteReqVO
.
getTaskDetailId
()));
chSrvTaskFinishItem
.
setItemId
(
Long
.
valueOf
(
accountTaskExecuteReqVO
.
getItemId
()));
chSrvTaskFinishItemMapper
.
insert
(
chSrvTaskFinishItem
);
ChSrvTaskDetail
ca
=
new
ChSrvTaskDetail
();
ca
.
setStatus
((
short
)
4
);
ca
.
setTaskDetailId
(
Long
.
valueOf
(
accountTaskExecuteReqVO
.
getTaskDetailId
()));
chSrvTaskDetailMapper
.
updateById
(
ca
);
}
accountSave
(
taskDetailId
,
chDisabDetailList
);
}
}
private
void
accountSave
(
String
taskDetailId
,
List
<
ChDisabDetailAccounts
>
chDisabDetailList
)
{
if
(
CollectionUtil
.
isEmpty
(
chDisabDetailList
))
{
List
<
OrganAccountsVO
>
accountsList
=
chDisabAccountsDetailMapper
.
getOrganAccountsList
(
taskDetailId
);
for
(
OrganAccountsVO
accountsVO
:
accountsList
)
{
for
(
OrganAccountsVO
accountsVO
:
accountsList
)
{
ChDisabDetailAccounts
chDisabDetailAccounts
=
new
ChDisabDetailAccounts
();
ChDisabDetailAccounts
chDisabDetailAccounts
=
new
ChDisabDetailAccounts
();
chDisabDetailAccounts
.
setSrvOrganId
(
accountsVO
.
getSrvOrganId
());
chDisabDetailAccounts
.
setSrvOrganId
(
accountsVO
.
getSrvOrganId
());
//要判断是养老还是医疗,因为费用不一样
//要判断是养老还是医疗,因为费用不一样
BigDecimal
limit
=
BigDecimal
.
valueOf
(
0
);
BigDecimal
limit
=
BigDecimal
.
valueOf
(
0
);
BigDecimal
overallPercent
=
BigDecimal
.
valueOf
(
0.7
);
BigDecimal
overallPercent
=
BigDecimal
.
valueOf
(
0.7
);
BigDecimal
personalPercent
=
BigDecimal
.
valueOf
(
0.3
);
BigDecimal
personalPercent
=
BigDecimal
.
valueOf
(
0.3
);
// 养老机构护理,其限额为 50 元/人/天 由长期护理保险基金支付 70% 个人支付 30%
// 养老机构护理,其限额为 50 元/人/天 由长期护理保险基金支付 70% 个人支付 30%
if
(
"养老"
.
equals
(
accountsVO
.
getSrvModeName
()))
{
if
(
"养老"
.
equals
(
accountsVO
.
getSrvModeName
()))
{
limit
=
BigDecimal
.
valueOf
(
50
);
limit
=
BigDecimal
.
valueOf
(
50
);
// 医疗机构护理,原则上收治医疗护理需求为主的重度失能人员一级及以下医疗机构其限额为 80 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
// 医疗机构护理,原则上收治医疗护理需求为主的重度失能人员一级及以下医疗机构其限额为 80 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
}
else
if
(
"医疗"
.
equals
(
accountsVO
.
getSrvModeName
())&&
"1"
.
equals
(
accountsVO
.
getLevelCode
())
&&
accountsVO
.
getDisableLevelName
().
contains
(
"重度"
)){
// && accountsVO.getDisableLevelName().contains("重度")
}
else
if
(
"医疗"
.
equals
(
accountsVO
.
getSrvModeName
())
&&
"1"
.
equals
(
accountsVO
.
getLevelCode
()))
{
limit
=
BigDecimal
.
valueOf
(
80
);
limit
=
BigDecimal
.
valueOf
(
80
);
// 二级及以上医疗机构其限额为 100 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
// 二级及以上医疗机构其限额为 100 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
}
else
if
(
"医疗"
.
equals
(
accountsVO
.
getSrvModeName
())&&
(!
"1"
.
equals
(
accountsVO
.
getLevelCode
()))
&&
accountsVO
.
getDisableLevelName
().
contains
(
"重度"
))
{
}
else
if
(
"医疗"
.
equals
(
accountsVO
.
getSrvModeName
())
&&
(!
"1"
.
equals
(
accountsVO
.
getLevelCode
())))
{
limit
=
BigDecimal
.
valueOf
(
100
);
limit
=
BigDecimal
.
valueOf
(
100
);
}
else
{
}
else
{
return
;
return
;
}
}
chDisabDetailAccounts
.
setAccountsAllCost
(
limit
);
chDisabDetailAccounts
.
setAccountsAllCost
(
limit
);
...
@@ -528,10 +545,10 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
...
@@ -528,10 +545,10 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts
.
setAccountsPersonalCost
(
personalCost
);
chDisabDetailAccounts
.
setAccountsPersonalCost
(
personalCost
);
chDisabDetailAccounts
.
setModeName
(
accountsVO
.
getSrvModeName
());
chDisabDetailAccounts
.
setModeName
(
accountsVO
.
getSrvModeName
());
chDisabDetailAccounts
.
setCreationTime
(
new
Date
());
chDisabDetailAccounts
.
setCreationTime
(
new
Date
());
//结算时间为任务时间
//
结算时间为任务时间
chDisabDetailAccounts
.
setAccountsTime
(
DateUtils
.
strToTime
(
accountsVO
.
getSrvDate
()));
chDisabDetailAccounts
.
setAccountsTime
(
DateUtils
.
strToTime
(
accountsVO
.
getSrvDate
()));
chDisabDetailAccounts
.
setAccountsStartTime
(
DateUtils
.
strToTime
(
accountsVO
.
getSrvStartTime
()));
//
chDisabDetailAccounts.setAccountsStartTime(DateUtils.strToTime(accountsVO.getSrvStartTime()));
chDisabDetailAccounts
.
setAccountsEndTime
(
DateUtils
.
strToTime
(
accountsVO
.
getSrvEndTime
()));
//
chDisabDetailAccounts.setAccountsEndTime(DateUtils.strToTime(accountsVO.getSrvEndTime()));
chDisabDetailAccounts
.
setTaskDetailId
(
accountsVO
.
getTaskDetailId
());
chDisabDetailAccounts
.
setTaskDetailId
(
accountsVO
.
getTaskDetailId
());
chDisabDetailAccounts
.
setMedicalArea
(
accountsVO
.
getMedicalArea
());
chDisabDetailAccounts
.
setMedicalArea
(
accountsVO
.
getMedicalArea
());
chDisabDetailAccounts
.
setItemIds
(
accountsVO
.
getItemId
());
chDisabDetailAccounts
.
setItemIds
(
accountsVO
.
getItemId
());
...
@@ -540,13 +557,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
...
@@ -540,13 +557,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts
.
setAccountsId
(
chDisabAccounts
.
getAccountsId
());
chDisabDetailAccounts
.
setAccountsId
(
chDisabAccounts
.
getAccountsId
());
chDisabAccountsDetailMapper
.
insert
(
chDisabDetailAccounts
);
chDisabAccountsDetailMapper
.
insert
(
chDisabDetailAccounts
);
}
}
}
else
{
ChDisabDetailAccounts
chDisabDetailAccounts
=
new
ChDisabDetailAccounts
();
Long
accountsDetailId
=
chDisabDetailList
.
get
(
0
).
getAccountsDetailId
();
chDisabDetailAccounts
.
setAccountsDetailId
(
accountsDetailId
);
String
itemIds
=
chDisabDetailAccounts
.
getItemIds
();
chDisabDetailAccounts
.
setItemIds
(
itemIds
+
","
+
accountTaskExecuteReqVOS
.
get
(
0
).
getItemId
());
chDisabAccountsDetailMapper
.
updateById
(
chDisabDetailAccounts
);
}
}
}
}
...
...
account/account-service/src/main/resources/mapper/ChDisabAccountsDetailMapper.xml
View file @
08a083cb
...
@@ -12,9 +12,9 @@
...
@@ -12,9 +12,9 @@
disable.CERTI_CODE certiCode,
disable.CERTI_CODE certiCode,
--所在省市
--所在省市
apply.MEDICAL_AREA medicalArea,
apply.MEDICAL_AREA medicalArea,
mode1.MODE_ID
modeId,
program.SRV_MODE_ID
modeId,
--服务方式
--服务方式
mode1.mode_name
srvModeName,
DECODE(program.SRV_MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地')
srvModeName,
--护理机构名称
--护理机构名称
organ.srv_organ_id srvOrganId,
organ.srv_organ_id srvOrganId,
--护理机构名称
--护理机构名称
...
@@ -23,41 +23,21 @@
...
@@ -23,41 +23,21 @@
emp.emp_name empName,
emp.emp_name empName,
--任务时间
--任务时间
detail.SRV_DATE srvDate,
detail.SRV_DATE srvDate,
detail.SRV_START_TIME srvStartTime,
detail.SRV_END_TIME srvEndTime,
-- 机构等级
-- 机构等级
organ.LEVEL_CODE levelCode,
organ.LEVEL_CODE levelCode,
-- 失能等级
level1.DISABLE_LEVEL_NAME disableLevelName,
d.service_type_detailed_name itemName
,d.PARA_ID,
CSOP.ITEM_TIMES,
CSOP.ITEM_TIMES_TYPE,
CSTFI.ITEM_ID itemId
CSTFI.ITEM_ID itemId
from ch_srv_task_detail detail--服务计划
from ch_srv_task_detail detail--服务计划
left join ch_srv_task task on task.srv_task_id = detail.srv_task_id--服务计划详情
left join ch_srv_task task on task.srv_task_id = detail.srv_task_id--服务计划详情
left join ch_disable_info disable on task.disab_info_id = disable.disab_info_id--失能人员
left join ch_disable_info disable on task.disab_info_id = disable.disab_info_id--失能人员
left join CH_DEV.CH_DISABLE_APPLY apply on apply.apply_id = disable.apply_id
left join CH_DEV.CH_DISABLE_APPLY apply on apply.apply_id = disable.apply_id
left join ch_apr_task aprtask on disable.last_task_id = aprtask.task_id--评定任务
left join ch_srv_organ_emp emp on task.srv_emp_id = emp.emp_id--护理人员
left join ch_apr_report report on aprtask.task_id = report.task_id--评定报告
left join ch_srv_program program on task.program_id = program.program_id--服务方案
left join ch_srv_program program on task.program_id = program.program_id--服务方案
left join ch_srv_organ organ on program.srv_organ_id = organ.srv_organ_id--服务机构
left join ch_srv_organ organ on program.srv_organ_id = organ.srv_organ_id--服务机构
left join ch_cfg_srv_mode mode1 on program.srv_mode_id = mode1.mode_id--服务方式
left join ch_srv_organ_emp emp on task.srv_emp_id = emp.emp_id--护理人员
-- 失能等级
left join ch_cfg_srv_disable_level level1 on report.disable_level_id = level1.disable_level_id
LEFT JOIN CH_SRV_TASK_FINISH_ITEM CSTFI ON detail.TASK_DETAIL_ID = CSTFI.TASK_DETAIL_ID
LEFT JOIN CH_SRV_TASK_FINISH_ITEM CSTFI ON detail.TASK_DETAIL_ID = CSTFI.TASK_DETAIL_ID
LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = CSTFI.ITEM_ID
LEFT JOIN CH_SERVICE_TYPE_detailed d on d.service_type_detailed_id = CSOP.item_name
<where>
<where>
<if
test=
"status != null and status != ''"
>
detail.STATUS = '4'
AND detail.STATUS = #{status}
<if
test=
"taskDetailId != null and taskDetailId != ''"
>
</if>
AND detail.TASK_DETAIL_ID = #{taskDetailId}
<if
test=
"taskDetailIds != null and taskDetailIds.size() > 0"
>
AND detail.TASK_DETAIL_ID IN
<foreach
collection=
"taskDetailIds"
separator=
","
open=
"("
close=
")"
item=
"taskDetailId"
>
#{taskDetailId}
</foreach>
</if>
</if>
</where>
</where>
</select>
</select>
...
...
account/account-service/src/main/resources/mapper/ChSrvTaskDetailMapper.xml
View file @
08a083cb
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
plan.TASK_DETAIL_ID taskDetailId,
plan.TASK_DETAIL_ID taskDetailId,
plan.ITEM_NAME itemName,
plan.ITEM_NAME itemName,
emp.emp_name empName,
emp.emp_name empName,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName,
to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvDate,
to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvDate,
plan.IS_STATUS status
plan.IS_STATUS status
from ch_srv_plan plan
from ch_srv_plan plan
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/account/SrvTaskRespVO.java
View file @
08a083cb
...
@@ -32,6 +32,6 @@ public class SrvTaskRespVO {
...
@@ -32,6 +32,6 @@ public class SrvTaskRespVO {
private
Long
status
;
private
Long
status
;
private
String
srvModeName
;
}
}
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