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
c09eff5e
Commit
c09eff5e
authored
Mar 07, 2023
by
zhangwanglin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
结算
parent
5b82c8d8
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
315 additions
and
21 deletions
+315
-21
AccountController.java
...om/hungraim/ltc/account/controller/AccountController.java
+10
-4
ChDisabAccountsDetailMapper.java
...hungraim/ltc/account/dao/ChDisabAccountsDetailMapper.java
+8
-2
AccountService.java
...java/com/hungraim/ltc/account/service/AccountService.java
+3
-1
AccountServiceImpl.java
...hungraim/ltc/account/service/impl/AccountServiceImpl.java
+152
-2
ChDisabAccountsDetailMapper.xml
...src/main/resources/mapper/ChDisabAccountsDetailMapper.xml
+48
-3
ChSrvTaskDetailMapper.xml
...rvice/src/main/resources/mapper/ChSrvTaskDetailMapper.xml
+7
-1
ChDisabDetailAccountsResp.java
...im/ltc/pojo/entity/account/ChDisabDetailAccountsResp.java
+3
-1
NursingRecordsRespVO.java
...ungraim/ltc/pojo/entity/account/NursingRecordsRespVO.java
+4
-0
NursingReqVO.java
...va/com/hungraim/ltc/pojo/entity/account/NursingReqVO.java
+26
-0
AccountTaskExecuteReqVO.java
...hungraim/ltc/pojo/vo/account/AccountTaskExecuteReqVO.java
+11
-0
OrganAccountsVO.java
...ava/com/hungraim/ltc/pojo/vo/account/OrganAccountsVO.java
+2
-0
SrvTaskRespVO.java
.../java/com/hungraim/ltc/pojo/vo/account/SrvTaskRespVO.java
+10
-0
AllocationSrvTaskVO.java
.../hungraim/ltc/pojo/vo/governance/AllocationSrvTaskVO.java
+1
-0
DateUtils.java
...n-core/src/main/java/com/hungraim/ltc/util/DateUtils.java
+16
-1
ChSrvPlanMapper.java
...java/com/hungraim/ltc/governance/dao/ChSrvPlanMapper.java
+1
-1
SrvTaskScheduledServiceImpl.java
...m/ltc/governance/service/SrvTaskScheduledServiceImpl.java
+1
-1
SrvTaskServiceImpl.java
...graim/ltc/governance/service/impl/SrvTaskServiceImpl.java
+8
-3
ChSrvPlanMapper.xml
...es/com/hungraim/ltc/governance/mapper/ChSrvPlanMapper.xml
+3
-0
SrvTaskMapper.xml
...rces/com/hungraim/ltc/governance/mapper/SrvTaskMapper.xml
+1
-1
No files found.
account/account-service/src/main/java/com/hungraim/ltc/account/controller/AccountController.java
View file @
c09eff5e
...
@@ -109,7 +109,7 @@ public class AccountController {
...
@@ -109,7 +109,7 @@ public class AccountController {
@PostMapping
(
"/organAccountTaskExecute"
)
@PostMapping
(
"/organAccountTaskExecute"
)
public
Result
organAccountTaskExecute
(
AccountTaskReqVO
accountTaskReqVO
){
public
Result
organAccountTaskExecute
(
AccountTaskReqVO
accountTaskReqVO
){
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
=
accountTaskReqVO
.
getAccountTaskList
();
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
=
accountTaskReqVO
.
getAccountTaskList
();
Result
result
=
accountService
.
organA
ccountTaskExecute
(
accountTaskExecuteReqVOS
);
Result
result
=
accountService
.
a
ccountTaskExecute
(
accountTaskExecuteReqVOS
);
return
result
;
return
result
;
}
}
...
@@ -257,12 +257,18 @@ public class AccountController {
...
@@ -257,12 +257,18 @@ public class AccountController {
/**
/**
* 查询护理记录
* 查询护理记录
*
*
* @param
taskDetailId 结算详情id
* @param
nursingReqVO
* @return
* @return
*/
*/
@GetMapping
(
"/queryNursingRecords"
)
@GetMapping
(
"/queryNursingRecords"
)
public
Result
<
Page
<
NursingRecordsRespVO
>>
queryNursingRecords
(
Integer
pageNum
,
Integer
pageSize
,
String
taskDetailId
)
{
public
Result
<
Page
<
NursingRecordsRespVO
>>
queryNursingRecords
(
NursingReqVO
nursingReqVO
)
{
Page
<
NursingRecordsRespVO
>
nursingRecordsRespVOList
=
accountService
.
queryNursingRecords
(
pageNum
,
pageSize
,
taskDetailId
);
if
(
StringUtils
.
isBlank
(
nursingReqVO
.
getModeName
())
||
StringUtils
.
isBlank
(
nursingReqVO
.
getAccountsTime
())
||
StringUtils
.
isBlank
(
nursingReqVO
.
getDisabInfoId
())
||
StringUtils
.
isBlank
(
nursingReqVO
.
getSrvOrganId
()))
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
Page
<
NursingRecordsRespVO
>
nursingRecordsRespVOList
=
accountService
.
queryNursingRecords
(
nursingReqVO
);
return
Result
.
success
(
nursingRecordsRespVOList
);
return
Result
.
success
(
nursingRecordsRespVOList
);
}
}
...
...
account/account-service/src/main/java/com/hungraim/ltc/account/dao/ChDisabAccountsDetailMapper.java
View file @
c09eff5e
...
@@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.pojo.entity.account.*
;
import
com.hungraim.ltc.pojo.entity.account.*
;
import
com.hungraim.ltc.pojo.vo.account.AccountExportDetailListResp
;
import
com.hungraim.ltc.pojo.vo.account.AccountExportDetailListResp
;
import
com.hungraim.ltc.pojo.vo.account.AccountTaskExecuteReqVO
;
import
com.hungraim.ltc.pojo.vo.account.OrganAccountsVO
;
import
com.hungraim.ltc.pojo.vo.account.OrganAccountsVO
;
import
com.hungraim.ltc.pojo.vo.account.SrvOrganListReq
;
import
com.hungraim.ltc.pojo.vo.account.SrvOrganListReq
;
import
com.hungraim.ltc.util.DateUtils
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -28,7 +28,7 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
...
@@ -28,7 +28,7 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
Page
<
ChDisabDetailAccountsResp
>
queryOrganAccountsDetail
(
Page
page
,
SrvOrganListReq
req
);
Page
<
ChDisabDetailAccountsResp
>
queryOrganAccountsDetail
(
Page
page
,
SrvOrganListReq
req
);
Page
<
NursingRecordsRespVO
>
queryNursingRecords
(
Page
page
,
String
taskDetailId
);
Page
<
NursingRecordsRespVO
>
queryNursingRecords
(
Page
page
,
NursingReqVO
req
);
OverallEduceDecreaseCostRespVO
queryOverallCostRecords
(
OverallCostReqVO
req
);
OverallEduceDecreaseCostRespVO
queryOverallCostRecords
(
OverallCostReqVO
req
);
...
@@ -39,6 +39,11 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
...
@@ -39,6 +39,11 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
ChDisabDetailAccounts
queryDisabDetailAccounts
(
String
srvOrganId
,
String
accountsTime
,
String
disabInfoId
,
String
srvModeName
);
ChDisabDetailAccounts
queryDisabDetailAccounts
(
String
srvOrganId
,
String
accountsTime
,
String
disabInfoId
,
String
srvModeName
);
List
<
OrganAccountsVO
>
queryPlanInfoByDetailId
(
String
taskDetailId
);
int
updateByPlanId
(
String
planId
);
int
selectByCondition
(
AccountTaskExecuteReqVO
accountTaskExecuteReqVO
);
}
}
\ No newline at end of file
account/account-service/src/main/java/com/hungraim/ltc/account/service/AccountService.java
View file @
c09eff5e
...
@@ -35,7 +35,7 @@ public interface AccountService extends IService<ChDisabAccounts> {
...
@@ -35,7 +35,7 @@ public interface AccountService extends IService<ChDisabAccounts> {
Page
<
NursingRecordsRespVO
>
queryNursingRecords
(
Integer
pageNum
,
Integer
pageSize
,
String
taskDetailId
);
Page
<
NursingRecordsRespVO
>
queryNursingRecords
(
NursingReqVO
nursingReqVO
);
OverallEduceDecreaseCostRespVO
queryOverallCostRecords
(
OverallCostReqVO
req
);
OverallEduceDecreaseCostRespVO
queryOverallCostRecords
(
OverallCostReqVO
req
);
...
@@ -49,6 +49,8 @@ public interface AccountService extends IService<ChDisabAccounts> {
...
@@ -49,6 +49,8 @@ public interface AccountService extends IService<ChDisabAccounts> {
Result
organAccountTaskExecute
(
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
);
Result
organAccountTaskExecute
(
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
);
Result
accountTaskExecute
(
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
);
void
otherPlaceHandler
(
String
programId
);
void
otherPlaceHandler
(
String
programId
);
int
deleteAccountsDetail
(
Long
accountsDetailId
,
Long
freeRdId
);
int
deleteAccountsDetail
(
Long
accountsDetailId
,
Long
freeRdId
);
...
...
account/account-service/src/main/java/com/hungraim/ltc/account/service/impl/AccountServiceImpl.java
View file @
c09eff5e
...
@@ -474,8 +474,20 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
...
@@ -474,8 +474,20 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
@Override
public
Page
<
NursingRecordsRespVO
>
queryNursingRecords
(
Integer
pageNum
,
Integer
pageSize
,
String
taskDetailId
)
{
public
Page
<
NursingRecordsRespVO
>
queryNursingRecords
(
NursingReqVO
nursingReqVO
)
{
return
chDisabAccountsDetailMapper
.
queryNursingRecords
(
new
Page
<>(
pageNum
,
pageSize
),
taskDetailId
);
String
modeName
=
nursingReqVO
.
getModeName
();
String
modeId
=
""
;
if
(
"医疗"
.
equals
(
modeName
)){
modeId
=
"1"
;
}
else
if
(
"养老"
.
equals
(
modeName
))
{
modeId
=
"2"
;
}
else
if
(
"上门"
.
equals
(
modeName
)){
modeId
=
"3"
;
}
else
if
(
"异地"
.
equals
(
modeName
)){
modeId
=
"4"
;
}
nursingReqVO
.
setModeId
(
modeId
);
return
chDisabAccountsDetailMapper
.
queryNursingRecords
(
new
Page
<>(
nursingReqVO
.
getPageNum
(),
nursingReqVO
.
getPageSize
()),
nursingReqVO
);
}
}
@Override
@Override
...
@@ -552,6 +564,123 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
...
@@ -552,6 +564,123 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
accountTaskExecute
(
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
)
{
log
.
info
(
"organAccountTaskExecute.accountTaskExecuteReqVOS:{}"
,
accountTaskExecuteReqVOS
);
if
(
CollectionUtil
.
isEmpty
(
accountTaskExecuteReqVOS
))
{
return
Result
.
failed
(
"参数不能为空"
);
}
// 根据任务id分组,一个任务下会有多个项目,任务id相同
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
<
AccountTaskExecuteReqVO
>
accountTaskList
=
entry
.
getValue
();
// 处理具体的服务项目
try
{
for
(
AccountTaskExecuteReqVO
accountTaskExecuteReqVO
:
accountTaskList
)
{
// 已申报的任务不允许再执行任务
String
srvDateYm
=
DateUtils
.
dateToStrYm
(
DateUtils
.
strToDate
(
accountTaskExecuteReqVO
.
getSrvDate
()));
accountTaskExecuteReqVO
.
setSrvDateYm
(
srvDateYm
);
int
count
=
chDisabAccountsDetailMapper
.
selectByCondition
(
accountTaskExecuteReqVO
);
if
(
count
>
0
){
return
Result
.
failed
(
"此任务已提交申报,不可再操作,请联系管理员"
);
}
// 已完成的任务更新ch_srv_plan状态
String
planId
=
accountTaskExecuteReqVO
.
getPlanId
();
Integer
integer
=
chSrvTaskDetailMapper
.
updateSrvPlanById
(
planId
);
if
(
integer
==
0
)
{
log
.
info
(
"更新任务计划表失败"
);
}
ChSrvTaskDetail
ca
=
new
ChSrvTaskDetail
();
ca
.
setStatus
((
short
)
4
);
ca
.
setTaskDetailId
(
Long
.
valueOf
(
accountTaskExecuteReqVO
.
getTaskDetailId
()));
chSrvTaskDetailMapper
.
updateById
(
ca
);
}
accountSave1
(
taskDetailId
,
accountTaskList
);
}
catch
(
Exception
e
)
{
log
.
info
(
"=====accountSave error:{}"
,
e
);
return
Result
.
failed
(
"服务异常"
);
}
}
return
Result
.
success
();
}
private
void
accountSave1
(
String
taskDetailId
,
List
<
AccountTaskExecuteReqVO
>
accountTaskList
)
{
// 已完成任务 已结算
List
<
OrganAccountsVO
>
accountsList
=
chDisabAccountsDetailMapper
.
queryPlanInfoByDetailId
(
taskDetailId
);
if
(
CollectionUtil
.
isNotEmpty
(
accountsList
))
{
return
;
}
AccountTaskExecuteReqVO
accountsVO
=
accountTaskList
.
get
(
0
);
ChDisabDetailAccounts
chDisabDetailAccounts
=
new
ChDisabDetailAccounts
();
String
srvOrganId
=
accountsVO
.
getSrvOrganId
();
// 结算时间为任务时间
Date
accountsTime
=
DateUtils
.
strToDate
(
accountsVO
.
getSrvDate
());
String
disabInfoId
=
accountsVO
.
getDisabInfoId
();
//要判断是养老还是医疗,因为费用不一样
BigDecimal
limit
=
BigDecimal
.
valueOf
(
0
);
BigDecimal
overallPercent
=
BigDecimal
.
valueOf
(
0.7
);
BigDecimal
personalPercent
=
BigDecimal
.
valueOf
(
0.3
);
String
srvModeName
=
accountsVO
.
getSrvModeName
();
// 养老机构护理,其限额为 50 元/人/天 由长期护理保险基金支付 70% 个人支付 30%
if
(
"养老"
.
equals
(
srvModeName
))
{
limit
=
BigDecimal
.
valueOf
(
50
);
// 医疗机构护理,原则上收治医疗护理需求为主的重度失能人员一级及以下医疗机构其限额为 80 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
}
else
if
(
"医疗"
.
equals
(
srvModeName
)
&&
"1"
.
equals
(
accountsVO
.
getLevelCode
()))
{
limit
=
BigDecimal
.
valueOf
(
80
);
// 二级及以上医疗机构其限额为 100 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
}
else
if
(
"医疗"
.
equals
(
srvModeName
)
&&
(!
"1"
.
equals
(
accountsVO
.
getLevelCode
())))
{
limit
=
BigDecimal
.
valueOf
(
100
);
}
// 根据护理机构、结算月份、失能人员id和服务方式查询表里是否有值
ChDisabDetailAccounts
chDisabDetailAccountsDTO
=
chDisabAccountsDetailMapper
.
queryDisabDetailAccounts
(
srvOrganId
,
DateUtils
.
dateToStrYm
(
accountsTime
),
disabInfoId
,
srvModeName
);
BigDecimal
overallCost
=
limit
.
multiply
(
overallPercent
);
BigDecimal
personalCost
=
limit
.
multiply
(
personalPercent
);
if
(
Objects
.
isNull
(
chDisabDetailAccountsDTO
)){
chDisabDetailAccounts
.
setAccountsAllCost
(
limit
);
chDisabDetailAccounts
.
setAccountsOverallCost
(
overallCost
);
chDisabDetailAccounts
.
setAccountsPersonalCost
(
personalCost
);
chDisabDetailAccounts
.
setModeName
(
accountsVO
.
getSrvModeName
());
chDisabDetailAccounts
.
setSrvOrganId
(
srvOrganId
);
chDisabDetailAccounts
.
setEmpId
(
accountsVO
.
getEmpId
());
chDisabDetailAccounts
.
setCreationTime
(
new
Date
());
chDisabDetailAccounts
.
setAccountsTime
(
accountsTime
);
chDisabDetailAccounts
.
setAccountsStartTime
(
DateUtils
.
getFirstDayOfMonth
(
DateUtils
.
strToDate
(
accountsVO
.
getSrvDate
())));
chDisabDetailAccounts
.
setAccountsEndTime
(
DateUtils
.
getlastDayOfMonth
(
DateUtils
.
strToDate
(
accountsVO
.
getSrvDate
())));
chDisabDetailAccounts
.
setMedicalArea
(
accountsVO
.
getMedicalArea
());
chDisabDetailAccounts
.
setDisabInfoId
(
disabInfoId
);
chDisabDetailAccounts
.
setStatus
((
short
)
0
);
chDisabDetailAccounts
.
setReissueAmount
(
BigDecimal
.
valueOf
(
0
));
chDisabDetailAccounts
.
setDeductionAmount
(
BigDecimal
.
valueOf
(
0
));
ChDisabAccounts
chDisabAccounts
=
getChDisabAccounts1
(
accountsVO
);
chDisabDetailAccounts
.
setAccountsId
(
chDisabAccounts
.
getAccountsId
());
chDisabAccountsDetailMapper
.
insert
(
chDisabDetailAccounts
);
String
planId
=
accountsVO
.
getPlanId
();
// 更新
chDisabAccountsDetailMapper
.
updateByPlanId
(
planId
);
}
else
{
BigDecimal
accountsAllCost
=
chDisabDetailAccountsDTO
.
getAccountsAllCost
();
BigDecimal
accountsOverallCost
=
chDisabDetailAccountsDTO
.
getAccountsOverallCost
();
BigDecimal
accountsPersonalCost
=
chDisabDetailAccountsDTO
.
getAccountsPersonalCost
();
chDisabDetailAccountsDTO
.
setAccountsAllCost
(
accountsAllCost
.
add
(
limit
));
chDisabDetailAccountsDTO
.
setAccountsOverallCost
(
accountsOverallCost
.
add
(
overallCost
));
chDisabDetailAccountsDTO
.
setAccountsPersonalCost
(
accountsPersonalCost
.
add
(
personalCost
));
chDisabAccountsDetailMapper
.
updateById
(
chDisabDetailAccountsDTO
);
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
organAccountTaskExecute
(
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
)
{
public
Result
organAccountTaskExecute
(
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
)
{
log
.
info
(
"organAccountTaskExecute.accountTaskExecuteReqVOS:{}"
,
accountTaskExecuteReqVOS
);
log
.
info
(
"organAccountTaskExecute.accountTaskExecuteReqVOS:{}"
,
accountTaskExecuteReqVOS
);
if
(
CollectionUtil
.
isEmpty
(
accountTaskExecuteReqVOS
))
{
if
(
CollectionUtil
.
isEmpty
(
accountTaskExecuteReqVOS
))
{
...
@@ -659,6 +788,27 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
...
@@ -659,6 +788,27 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
}
}
}
private
ChDisabAccounts
getChDisabAccounts1
(
AccountTaskExecuteReqVO
accountsVO
)
{
// 结算表 根据机构和结算时间 服务方式
ChDisabAccounts
chDisabAccounts
=
disabAccountsMapper
.
queryAccountByCondition
(
DateUtils
.
dateToStrYm
(
DateUtils
.
strToDate
(
accountsVO
.
getSrvDate
())),
accountsVO
.
getSrvModeName
(),
accountsVO
.
getSrvOrganId
(),
null
);
if
(
chDisabAccounts
==
null
)
{
chDisabAccounts
=
new
ChDisabAccounts
();
chDisabAccounts
.
setModeName
(
accountsVO
.
getSrvModeName
());
chDisabAccounts
.
setAccountsTime
(
DateUtils
.
strToDateMd
(
accountsVO
.
getSrvDate
()));
chDisabAccounts
.
setSrvOrganId
(
Long
.
valueOf
(
accountsVO
.
getSrvOrganId
()));
chDisabAccounts
.
setCreationTime
(
new
Date
());
chDisabAccounts
.
setAccountsStatus
((
short
)
0
);
BigDecimal
zero
=
BigDecimal
.
valueOf
(
0
);
chDisabAccounts
.
setAllCost
(
zero
);
chDisabAccounts
.
setOverallCost
(
zero
);
chDisabAccounts
.
setPersonalCost
(
zero
);
chDisabAccounts
.
setReissueAmountTotal
(
zero
);
chDisabAccounts
.
setDeductionAmountTotal
(
zero
);
disabAccountsMapper
.
insert
(
chDisabAccounts
);
}
return
chDisabAccounts
;
}
private
ChDisabAccounts
getChDisabAccounts
(
OrganAccountsVO
accountsVO
,
BigDecimal
limit
,
BigDecimal
overallCost
,
BigDecimal
personalCost
)
{
private
ChDisabAccounts
getChDisabAccounts
(
OrganAccountsVO
accountsVO
,
BigDecimal
limit
,
BigDecimal
overallCost
,
BigDecimal
personalCost
)
{
// 结算表 根据机构和结算时间 服务方式
// 结算表 根据机构和结算时间 服务方式
...
...
account/account-service/src/main/resources/mapper/ChDisabAccountsDetailMapper.xml
View file @
c09eff5e
...
@@ -14,7 +14,9 @@
...
@@ -14,7 +14,9 @@
d.TASK_DETAIL_ID taskDetailId,
d.TASK_DETAIL_ID taskDetailId,
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
o.SRV_ORGAN_NAME srvOrganName,
o.SRV_ORGAN_NAME srvOrganName,
o.SRV_ORGAN_ID srvOrganId,
info.REAL_NAME realName,
info.REAL_NAME realName,
info.DISAB_INFO_ID disabInfoId,
d.DEDUCTION_AMOUNT deductionAmount,
d.DEDUCTION_AMOUNT deductionAmount,
d.REISSUE_AMOUNT reissueAmount,
d.REISSUE_AMOUNT reissueAmount,
d.ACCOUNTS_DETAIL_ID accountsDetailId,
d.ACCOUNTS_DETAIL_ID accountsDetailId,
...
@@ -51,12 +53,16 @@
...
@@ -51,12 +53,16 @@
<select
id=
"queryNursingRecords"
resultType=
"com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO"
>
<select
id=
"queryNursingRecords"
resultType=
"com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO"
>
select organ.SRV_ORGAN_NAME srvOrganName,
select organ.SRV_ORGAN_NAME srvOrganName,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') modeName,
to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvPlanTime,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') modeName,
to_char(plan.CREATION_TIME,'yyyy-MM-dd HH24:mi:ss') executionTime,
to_char(plan.CREATION_TIME,'yyyy-MM-dd HH24:mi:ss') executionTime,
plan.item_name itemName
plan.item_name itemName
from CH_SRV_PLAN plan
from CH_SRV_PLAN plan
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID
where plan.TASK_DETAIL_ID = #{taskDetailId} and plan.IS_STATUS ='4'
where plan.DISAB_INFO_ID = #{req.disabInfoId}
and plan.SRV_ORGAN_ID = #{req.srvOrganId}
and plan.MODE_ID = #{req.modeId}
and plan.IS_STATUS ='4'
</select>
</select>
...
@@ -86,7 +92,7 @@
...
@@ -86,7 +92,7 @@
and info.REAL_NAME = #{realName}
and info.REAL_NAME = #{realName}
</if>
</if>
<if
test=
"accountsTime != null and accountsTime != ''"
>
<if
test=
"accountsTime != null and accountsTime != ''"
>
and to_char(detail.accounts_time,'yyyy-MM
-dd
') = #{accountsTime}
and to_char(detail.accounts_time,'yyyy-MM') = #{accountsTime}
</if>
</if>
<if
test=
"srvOrganName != null and srvOrganName != ''"
>
<if
test=
"srvOrganName != null and srvOrganName != ''"
>
and organ.SRV_ORGAN_NAME = #{srvOrganName}
and organ.SRV_ORGAN_NAME = #{srvOrganName}
...
@@ -137,6 +143,35 @@
...
@@ -137,6 +143,35 @@
</where>
</where>
</select>
</select>
<select
id=
"queryPlanInfoByDetailId"
resultType=
"com.hungraim.ltc.pojo.vo.account.OrganAccountsVO"
>
select
plan.TASK_DETAIL_ID taskDetailId,
plan.PLAN_ID planId,
--失能人员姓名
disable.real_name realName,
disable.DISAB_INFO_ID disabInfoId,
--身份证号
disable.CERTI_CODE certiCode,
--所在省市
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
--服务方式
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName,
--护理机构名称
plan.srv_organ_id srvOrganId,
--护理机构名称
organ.srv_organ_name srvOrganName,
--护理服务人员 Id
plan.EMP_ID empId,
--任务时间
plan.SRV_PLAN_TIME srvDate,
-- 机构等级
organ.LEVEL_CODE levelCode
from CH_SRV_PLAN plan
left join ch_srv_organ organ on plan.srv_organ_id = organ.srv_organ_id
left join ch_disable_info disable on plan.disab_info_id = disable.disab_info_id--失能人员
left join CH_DISABLE_APPLY apply on apply.apply_id = disable.apply_id
where plan.IS_STATUS = '4' and plan.IS_BILL = 1 and plan.TASK_DETAIL_ID = #{taskDetailId}
</select>
<select
id=
"queryAccountByCondition"
resultType=
"com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts"
>
<select
id=
"queryAccountByCondition"
resultType=
"com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts"
>
select * from CH_DISAB_ACCOUNTS_DETAIL t where t.MODE_NAME in ('养老','医疗')
select * from CH_DISAB_ACCOUNTS_DETAIL t where t.MODE_NAME in ('养老','医疗')
...
@@ -281,6 +316,16 @@
...
@@ -281,6 +316,16 @@
and d.MODE_NAME = #{srvModeName}
and d.MODE_NAME = #{srvModeName}
</select>
</select>
<update
id=
"updateByPlanId"
>
update CH_SRV_PLAN set IS_BILL =1 where PLAN_ID = #{planId}
</update>
<select
id=
"selectByCondition"
parameterType=
"com.hungraim.ltc.pojo.vo.account.AccountTaskExecuteReqVO"
resultType=
"java.lang.Integer"
>
select count(1) from CH_DISAB_ACCOUNTS_DETAIL detail where detail.STATUS = 1 and
detail.SRV_ORGAN_ID = #{srvOrganId} and detail.MODE_NAME=#{srvModeName} and detail.DISAB_INFO_ID = #{disabInfoId}
and to_char(detail.ACCOUNTS_TIME,'yyyy-MM')=#{srvDateYm}
</select>
</mapper>
</mapper>
account/account-service/src/main/resources/mapper/ChSrvTaskDetailMapper.xml
View file @
c09eff5e
...
@@ -9,12 +9,18 @@
...
@@ -9,12 +9,18 @@
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,
emp.emp_id empId,
info.DISAB_INFO_ID disabInfoId,
organ.SRV_ORGAN_NAME srvOrganName,
organ.SRV_ORGAN_NAME srvOrganName,
organ.SRV_ORGAN_ID srvOrganId,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName,
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,
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
organ.LEVEL_CODE levelCode
from ch_srv_plan plan
from ch_srv_plan plan
left join ch_disable_info info on plan.DISAB_INFO_ID = info.DISAB_INFO_ID
left join ch_disable_info info on plan.DISAB_INFO_ID = info.DISAB_INFO_ID
left join CH_DISABLE_APPLY apply on apply.APPLY_ID = info.APPLY_ID
left join ch_srv_organ_emp emp on plan.emp_id = emp.emp_id
left join ch_srv_organ_emp emp on plan.emp_id = emp.emp_id
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID
<where>
<where>
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/account/ChDisabDetailAccountsResp.java
View file @
c09eff5e
...
@@ -19,7 +19,6 @@ public class ChDisabDetailAccountsResp implements Serializable {
...
@@ -19,7 +19,6 @@ public class ChDisabDetailAccountsResp implements Serializable {
/**
/**
* 结算月份
* 结算月份
*/
*/
private
String
accountsTime
;
private
String
accountsTime
;
/**
/**
...
@@ -50,6 +49,7 @@ public class ChDisabDetailAccountsResp implements Serializable {
...
@@ -50,6 +49,7 @@ public class ChDisabDetailAccountsResp implements Serializable {
private
String
srvOrganName
;
private
String
srvOrganName
;
private
String
srvOrganId
;
private
String
realName
;
private
String
realName
;
...
@@ -61,6 +61,8 @@ public class ChDisabDetailAccountsResp implements Serializable {
...
@@ -61,6 +61,8 @@ public class ChDisabDetailAccountsResp implements Serializable {
private
String
accountsDetailId
;
private
String
accountsDetailId
;
private
String
disabInfoId
;
private
Integer
status
;
private
Integer
status
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/account/NursingRecordsRespVO.java
View file @
c09eff5e
...
@@ -23,6 +23,10 @@ public class NursingRecordsRespVO {
...
@@ -23,6 +23,10 @@ public class NursingRecordsRespVO {
/**
/**
*执行日期
*执行日期
**/
**/
private
String
srvPlanTime
;
/**
*执行日期
**/
private
String
executionTime
;
private
String
executionTime
;
/**
/**
*任务名称
*任务名称
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/account/NursingReqVO.java
0 → 100644
View file @
c09eff5e
package
com
.
hungraim
.
ltc
.
pojo
.
entity
.
account
;
import
com.hungraim.ltc.pojo.vo.BaseReq
;
import
lombok.Data
;
/**
* @author zwl
* @ClassName NursingReqVO
* @description
* @date 2023/3/6 18:00
**/
@Data
public
class
NursingReqVO
extends
BaseReq
{
private
String
accountsTime
;
private
String
disabInfoId
;
private
String
modeId
;
private
String
modeName
;
private
String
srvOrganId
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/account/AccountTaskExecuteReqVO.java
View file @
c09eff5e
...
@@ -12,6 +12,17 @@ public class AccountTaskExecuteReqVO {
...
@@ -12,6 +12,17 @@ public class AccountTaskExecuteReqVO {
private
String
itemId
;
private
String
itemId
;
private
String
srvOrganId
;
private
String
srvDate
;
private
String
srvDate
;
private
String
disabInfoId
;
private
String
srvModeName
;
private
String
levelCode
;
private
Long
empId
;
private
String
medicalArea
;
private
String
srvDateYm
;
}
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/account/OrganAccountsVO.java
View file @
c09eff5e
...
@@ -86,4 +86,6 @@ public class OrganAccountsVO {
...
@@ -86,4 +86,6 @@ public class OrganAccountsVO {
private
String
itemName
;
private
String
itemName
;
private
String
planId
;
}
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/account/SrvTaskRespVO.java
View file @
c09eff5e
...
@@ -21,6 +21,8 @@ public class SrvTaskRespVO {
...
@@ -21,6 +21,8 @@ public class SrvTaskRespVO {
// 护理人员
// 护理人员
private
String
empName
;
private
String
empName
;
private
String
empId
;
// 任务时间
// 任务时间
private
String
srvDate
;
private
String
srvDate
;
...
@@ -34,4 +36,12 @@ public class SrvTaskRespVO {
...
@@ -34,4 +36,12 @@ public class SrvTaskRespVO {
private
String
srvModeName
;
private
String
srvModeName
;
private
String
srvOrganId
;
private
String
disabInfoId
;
private
String
levelCode
;
private
String
medicalArea
;
}
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/governance/AllocationSrvTaskVO.java
View file @
c09eff5e
...
@@ -12,4 +12,5 @@ public class AllocationSrvTaskVO {
...
@@ -12,4 +12,5 @@ public class AllocationSrvTaskVO {
private
String
exitTime
;
private
String
exitTime
;
private
String
srvDate
;
private
String
srvDate
;
private
Long
srvTaskId
;
private
Long
srvTaskId
;
private
String
programId
;
}
}
common/common-core/src/main/java/com/hungraim/ltc/util/DateUtils.java
View file @
c09eff5e
...
@@ -189,7 +189,22 @@ public class DateUtils {
...
@@ -189,7 +189,22 @@ public class DateUtils {
return
null
;
return
null
;
}
}
}
}
/**
* 将短时间格式字符串转换为时间 yyyy-MM-dd HH:mm:ss
*
* @param strDate
* @return
*/
public
static
Date
strToDateMd
(
String
strDate
)
{
try
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
DATE_PATTERN_yyyy_MM_dd
);
ParsePosition
pos
=
new
ParsePosition
(
0
);
Date
strtodate
=
formatter
.
parse
(
strDate
,
pos
);
return
strtodate
;
}
catch
(
Throwable
e
)
{
return
null
;
}
}
/**
/**
* 字符串时间戳转日期
* 字符串时间戳转日期
*
*
...
...
governance/src/main/java/com/hungraim/ltc/governance/dao/ChSrvPlanMapper.java
View file @
c09eff5e
...
@@ -11,6 +11,6 @@ import java.util.List;
...
@@ -11,6 +11,6 @@ import java.util.List;
@Repository
@Repository
@Mapper
@Mapper
public
interface
ChSrvPlanMapper
extends
BaseMapper
<
ChSrvPlan
>
{
public
interface
ChSrvPlanMapper
extends
BaseMapper
<
ChSrvPlan
>
{
List
<
ChSrvPlan
>
queryPlan
(
String
programId
);
List
<
ChSrvPlan
>
queryPlan
(
String
programId
,
String
srvPlanTime
);
}
}
governance/src/main/java/com/hungraim/ltc/governance/service/SrvTaskScheduledServiceImpl.java
View file @
c09eff5e
...
@@ -18,7 +18,7 @@ public class SrvTaskScheduledServiceImpl {
...
@@ -18,7 +18,7 @@ public class SrvTaskScheduledServiceImpl {
@Autowired
@Autowired
private
SrvTaskService
srvTaskService
;
private
SrvTaskService
srvTaskService
;
@Scheduled
(
cron
=
"30
30 23
* * ?"
)
@Scheduled
(
cron
=
"30
05 19
* * ?"
)
public
void
timeAllocationSrvTask
()
{
public
void
timeAllocationSrvTask
()
{
log
.
info
(
"timeAllocationSrvTask========start"
);
log
.
info
(
"timeAllocationSrvTask========start"
);
srvTaskService
.
timeAllocationSrvTask
();
srvTaskService
.
timeAllocationSrvTask
();
...
...
governance/src/main/java/com/hungraim/ltc/governance/service/impl/SrvTaskServiceImpl.java
View file @
c09eff5e
...
@@ -146,7 +146,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
...
@@ -146,7 +146,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
//添加服务计划详情
//添加服务计划详情
Long
newSrvTaskId
=
chSrvTask
.
getSrvTaskId
();
Long
newSrvTaskId
=
chSrvTask
.
getSrvTaskId
();
this
.
insertTaskDetail
(
newSrvTaskId
,
taskDetails
);
this
.
insertTaskDetail
(
newSrvTaskId
,
taskDetails
);
saveSrvPlan
(
programId
);
saveSrvPlan
(
programId
,
null
);
//添加附件
//添加附件
// this.updateAttachs(srvTaskInfoVO.getListAttach(), chSrvTask.getSrvTaskId());
// this.updateAttachs(srvTaskInfoVO.getListAttach(), chSrvTask.getSrvTaskId());
}
else
{
}
else
{
...
@@ -169,9 +169,10 @@ public class SrvTaskServiceImpl implements SrvTaskService {
...
@@ -169,9 +169,10 @@ public class SrvTaskServiceImpl implements SrvTaskService {
}
}
public
void
saveSrvPlan
(
String
programId
){
public
void
saveSrvPlan
(
String
programId
,
String
srvPlanTime
){
List
<
ChSrvPlan
>
chSrvPlans
=
chSrvPlanMapper
.
queryPlan
(
programId
);
List
<
ChSrvPlan
>
chSrvPlans
=
chSrvPlanMapper
.
queryPlan
(
programId
,
srvPlanTime
);
for
(
ChSrvPlan
chSrvPlan
:
chSrvPlans
)
{
for
(
ChSrvPlan
chSrvPlan
:
chSrvPlans
)
{
chSrvPlan
.
setCreationTime
(
new
Date
());
chSrvPlanMapper
.
insert
(
chSrvPlan
);
chSrvPlanMapper
.
insert
(
chSrvPlan
);
}
}
}
}
...
@@ -223,6 +224,10 @@ public class SrvTaskServiceImpl implements SrvTaskService {
...
@@ -223,6 +224,10 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvTaskDetail
.
setSrvDate
(
DateUtils
.
strToDate
(
nextDay
));
//服务开始时间
chSrvTaskDetail
.
setSrvDate
(
DateUtils
.
strToDate
(
nextDay
));
//服务开始时间
chSrvTaskDetail
.
setStatus
((
short
)
0
);
//状态 未执行:0;执行中:1;已执行:2;已失效:3已完成4
chSrvTaskDetail
.
setStatus
((
short
)
0
);
//状态 未执行:0;执行中:1;已执行:2;已失效:3已完成4
chSrvTaskDetailMapper
.
insert
(
chSrvTaskDetail
);
chSrvTaskDetailMapper
.
insert
(
chSrvTaskDetail
);
// ch_srv_plan
String
programId
=
chSrvTask
.
getProgramId
();
saveSrvPlan
(
programId
,
nextDay
);
}
}
}
}
}
}
governance/src/main/resources/com/hungraim/ltc/governance/mapper/ChSrvPlanMapper.xml
View file @
c09eff5e
...
@@ -28,6 +28,9 @@
...
@@ -28,6 +28,9 @@
LEFT JOIN CH_SERVICE_TYPE_detailed d on d.service_type_detailed_id = CSOP.item_name
LEFT JOIN CH_SERVICE_TYPE_detailed d on d.service_type_detailed_id = CSOP.item_name
<where>
<where>
disable.SRV_MODE_ID in ('1','2') and program.program_id =#{programId}
disable.SRV_MODE_ID in ('1','2') and program.program_id =#{programId}
<if
test=
"srvPlanTime != null"
>
and to_char(detail.SRV_DATE,'yyyy-MM-dd') = #{srvPlanTime}
</if>
</where>
</where>
order by detail.SRV_DATE desc
order by detail.SRV_DATE desc
</select>
</select>
...
...
governance/src/main/resources/com/hungraim/ltc/governance/mapper/SrvTaskMapper.xml
View file @
c09eff5e
...
@@ -216,7 +216,7 @@
...
@@ -216,7 +216,7 @@
</where>
</where>
</select>
</select>
<select
id=
"getAllocationSrvTask"
resultType=
"com.hungraim.ltc.pojo.vo.governance.AllocationSrvTaskVO"
>
<select
id=
"getAllocationSrvTask"
resultType=
"com.hungraim.ltc.pojo.vo.governance.AllocationSrvTaskVO"
>
select t.SRV_TASK_ID,t.SRV_DATE,info.EXIT_TIME,info.EXIT_FLAG,info.EXIT_REASON_ID from CH_SRV_TASK t
select t.SRV_TASK_ID,t.SRV_DATE,info.EXIT_TIME,info.EXIT_FLAG,info.EXIT_REASON_ID
,t.program_id programId
from CH_SRV_TASK t
left join CH_DISABLE_INFO info on t.DISAB_INFO_ID = info.DISAB_INFO_ID
left join CH_DISABLE_INFO info on t.DISAB_INFO_ID = info.DISAB_INFO_ID
left join ch_apr_task aprtask on info.last_task_id = aprtask.task_id--评定任务
left join ch_apr_task aprtask on info.last_task_id = aprtask.task_id--评定任务
left join ch_apr_report report on aprtask.task_id = report.task_id--评定报告
left join ch_apr_report report on aprtask.task_id = report.task_id--评定报告
...
...
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