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
ae1da1de
Commit
ae1da1de
authored
Mar 22, 2023
by
zengxiaoli@yeah.net
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/uat_ch_master' into dev_20230322_护理机构人员审核_zxl
parents
821ce0f6
afc08e18
Show whitespace changes
Inline
Side-by-side
Showing
70 changed files
with
1070 additions
and
361 deletions
+1070
-361
AccountController.java
...om/hungraim/ltc/account/controller/AccountController.java
+31
-6
ChDisabAccountsDetailMapper.java
...hungraim/ltc/account/dao/ChDisabAccountsDetailMapper.java
+2
-4
AccountService.java
...java/com/hungraim/ltc/account/service/AccountService.java
+0
-1
AccountServiceImpl.java
...hungraim/ltc/account/service/impl/AccountServiceImpl.java
+31
-153
ChDisabAccountsDetailMapper.xml
...src/main/resources/mapper/ChDisabAccountsDetailMapper.xml
+24
-49
ChDisabAccountsMapper.xml
...rvice/src/main/resources/mapper/ChDisabAccountsMapper.xml
+1
-1
ChDisabFreeRdInfoMapper.xml
...ice/src/main/resources/mapper/ChDisabFreeRdInfoMapper.xml
+4
-0
ChSrvTaskDetailMapper.xml
...rvice/src/main/resources/mapper/ChSrvTaskDetailMapper.xml
+3
-0
DisableController.java
...n/java/com/hungraim/ltc/controller/DisableController.java
+21
-3
SrvOrganController.java
.../java/com/hungraim/ltc/controller/SrvOrganController.java
+4
-2
ChSrvSendInfoMapper.java
...c/main/java/com/hungraim/ltc/dao/ChSrvSendInfoMapper.java
+18
-0
DisableExitMapper.java
...src/main/java/com/hungraim/ltc/dao/DisableExitMapper.java
+22
-0
DisableInfoMapper.java
...src/main/java/com/hungraim/ltc/dao/DisableInfoMapper.java
+12
-0
DisableService.java
...rc/main/java/com/hungraim/ltc/service/DisableService.java
+2
-0
DisableServiceImpl.java
...ava/com/hungraim/ltc/service/impl/DisableServiceImpl.java
+51
-4
SrvOrganEmpServiceImpl.java
...com/hungraim/ltc/service/impl/SrvOrganEmpServiceImpl.java
+14
-14
ChSrvOrganEmpMapper.xml
...service/src/main/resources/mapper/ChSrvOrganEmpMapper.xml
+1
-1
DisableInfoMapper.xml
...y-service/src/main/resources/mapper/DisableInfoMapper.xml
+26
-9
TaskController.java
...main/java/com/hungraim/ltc/controller/TaskController.java
+4
-4
DisableInfoMapper.java
...src/main/java/com/hungraim/ltc/dao/DisableInfoMapper.java
+1
-0
TaskMapper.java
...ervice/src/main/java/com/hungraim/ltc/dao/TaskMapper.java
+6
-1
TaskService.java
...e/src/main/java/com/hungraim/ltc/service/TaskService.java
+1
-1
TaskServiceImpl.java
...n/java/com/hungraim/ltc/service/impl/TaskServiceImpl.java
+66
-8
ChAssessAccountsMapper.xml
...vice/src/main/resources/mapper/ChAssessAccountsMapper.xml
+1
-1
ChAssessDetailAccountsMapper.xml
...rc/main/resources/mapper/ChAssessDetailAccountsMapper.xml
+3
-3
ChDisableEvaluateMapper.xml
...ice/src/main/resources/mapper/ChDisableEvaluateMapper.xml
+21
-1
AuthController.java
...main/java/com/hungraim/ltc/controller/AuthController.java
+8
-3
NursingReqVO.java
...va/com/hungraim/ltc/pojo/entity/account/NursingReqVO.java
+2
-1
OverallCostListRespVO.java
...ngraim/ltc/pojo/entity/account/OverallCostListRespVO.java
+2
-0
OverallCostReqVO.java
...om/hungraim/ltc/pojo/entity/account/OverallCostReqVO.java
+2
-0
ChAssessDetailAccountsResp.java
...tc/pojo/entity/assessment/ChAssessDetailAccountsResp.java
+6
-0
ChDisableApply.java
.../com/hungraim/ltc/pojo/entity/disable/ChDisableApply.java
+9
-0
ChDisableExit.java
...a/com/hungraim/ltc/pojo/entity/disable/ChDisableExit.java
+37
-0
ChDisableInfo.java
...a/com/hungraim/ltc/pojo/entity/disable/ChDisableInfo.java
+9
-0
ChSrvSend.java
...com/hungraim/ltc/pojo/entity/serviceManage/ChSrvSend.java
+1
-1
ReportUpdateVO.java
...rc/main/java/com/hungraim/ltc/pojo/vo/ReportUpdateVO.java
+2
-0
AssessAccountsExportResp.java
...ungraim/ltc/pojo/vo/account/AssessAccountsExportResp.java
+3
-0
SrvOrganListReq.java
...ava/com/hungraim/ltc/pojo/vo/account/SrvOrganListReq.java
+2
-0
SrvTaskReqVO.java
...n/java/com/hungraim/ltc/pojo/vo/account/SrvTaskReqVO.java
+2
-0
AprEmpExportVO.java
...a/com/hungraim/ltc/pojo/vo/assessment/AprEmpExportVO.java
+6
-0
AssessIdAndCostVO.java
...om/hungraim/ltc/pojo/vo/assessment/AssessIdAndCostVO.java
+2
-0
ReportDetailVO.java
...a/com/hungraim/ltc/pojo/vo/assessment/ReportDetailVO.java
+5
-0
TaskReportVO.java
...ava/com/hungraim/ltc/pojo/vo/assessment/TaskReportVO.java
+1
-0
SrvOrganEmpExportVo.java
...com/hungraim/ltc/pojo/vo/disable/SrvOrganEmpExportVo.java
+20
-2
ProgramSetAndProjectVo.java
...ngraim/ltc/pojo/vo/governance/ProgramSetAndProjectVo.java
+1
-1
CsoftSecurityUtil.java
...rc/main/java/com/hungraim/ltc/util/CsoftSecurityUtil.java
+14
-4
DateUtils.java
...n-core/src/main/java/com/hungraim/ltc/util/DateUtils.java
+21
-0
RedisCache.java
...-core/src/main/java/com/hungraim/ltc/util/RedisCache.java
+240
-0
RedisLock.java
...redis/src/main/java/com/hungraim/ltc/redis/RedisLock.java
+115
-0
AprOrganController.java
...ungraim/ltc/governance/controller/AprOrganController.java
+4
-2
BuildBedController.java
...ungraim/ltc/governance/controller/BuildBedController.java
+18
-1
SrvProgramController.java
...graim/ltc/governance/controller/SrvProgramController.java
+11
-3
SrvTaskController.java
...hungraim/ltc/governance/controller/SrvTaskController.java
+6
-5
SrvTaskScheduledController.java
...ltc/governance/controller/SrvTaskScheduledController.java
+47
-0
ChSrvProgramMapper.java
...a/com/hungraim/ltc/governance/dao/ChSrvProgramMapper.java
+6
-0
ChSrvSendMapper.java
...java/com/hungraim/ltc/governance/dao/ChSrvSendMapper.java
+2
-0
DisableInfoMapper.java
...va/com/hungraim/ltc/governance/dao/DisableInfoMapper.java
+10
-3
SrvSendMapper.java
...n/java/com/hungraim/ltc/governance/dao/SrvSendMapper.java
+3
-2
DisableInfoServie.java
...om/hungraim/ltc/governance/service/DisableInfoServie.java
+1
-1
SrvTaskScheduledServiceImpl.java
...m/ltc/governance/service/SrvTaskScheduledServiceImpl.java
+0
-28
SrvTaskService.java
...a/com/hungraim/ltc/governance/service/SrvTaskService.java
+1
-1
DisableInfoServieImpl.java
...im/ltc/governance/service/impl/DisableInfoServieImpl.java
+2
-2
SrvSendServiceImpl.java
...graim/ltc/governance/service/impl/SrvSendServiceImpl.java
+6
-1
SrvTaskServiceImpl.java
...graim/ltc/governance/service/impl/SrvTaskServiceImpl.java
+32
-12
ChSrvOrganProjectMapper.xml
...ungraim/ltc/governance/mapper/ChSrvOrganProjectMapper.xml
+7
-3
ChSrvProgramMapper.xml
...com/hungraim/ltc/governance/mapper/ChSrvProgramMapper.xml
+14
-4
ChSrvSendMapper.xml
...es/com/hungraim/ltc/governance/mapper/ChSrvSendMapper.xml
+7
-0
SrvSend.xml
.../resources/com/hungraim/ltc/governance/mapper/SrvSend.xml
+7
-6
SrvTaskMapper.xml
...rces/com/hungraim/ltc/governance/mapper/SrvTaskMapper.xml
+6
-3
SrvTaskScheduledService.java
.../hungraim/ltc/system/service/SrvTaskScheduledService.java
+0
-6
No files found.
account/account-service/src/main/java/com/hungraim/ltc/account/controller/AccountController.java
View file @
ae1da1de
...
...
@@ -8,6 +8,7 @@ import com.hungraim.ltc.pojo.vo.account.*;
import
com.hungraim.ltc.util.FileUtils
;
import
com.hungraim.ltc.util.Result
;
import
com.hungraim.ltc.util.ResultCode
;
import
com.hungraim.ltc.util.TokenParsingUtil
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -129,7 +130,11 @@ public class AccountController {
* @return 返回
*/
@GetMapping
(
"/getSrvTaskList"
)
public
Result
<
Page
<
SrvTaskRespVO
>>
getSrvTaskList
(
SrvTaskReqVO
srvTaskReqVO
)
{
public
Result
<
Page
<
SrvTaskRespVO
>>
getSrvTaskList
(
@RequestHeader
(
"Authorization"
)
String
token
,
SrvTaskReqVO
srvTaskReqVO
)
{
long
srvOrganId
=
TokenParsingUtil
.
TokenParsing
(
token
,
"srvOrganId"
);
if
(
srvOrganId
!=
0
)
{
srvTaskReqVO
.
setSrvOrganId
(
srvOrganId
);
}
return
Result
.
success
(
accountService
.
getSrvTaskList
(
srvTaskReqVO
));
}
...
...
@@ -141,9 +146,13 @@ public class AccountController {
* @return 返回
*/
@GetMapping
(
"/searchSrvOrganAccountList"
)
public
Result
<
Page
<
SrvOrganAccountListResp
>>
searchSrvOrganAccountList
(
SrvOrganListReq
srvOrganListReq
)
{
public
Result
<
Page
<
SrvOrganAccountListResp
>>
searchSrvOrganAccountList
(
@RequestHeader
(
"Authorization"
)
String
token
,
SrvOrganListReq
srvOrganListReq
)
{
List
<
String
>
list
=
Arrays
.
asList
(
"1"
);
srvOrganListReq
.
setAccountsStatusList
(
list
);
long
srvOrganId
=
TokenParsingUtil
.
TokenParsing
(
token
,
"srvOrganId"
);
if
(
srvOrganId
!=
0
)
{
srvOrganListReq
.
setSrvOrganId
(
srvOrganId
);
}
return
Result
.
success
(
accountService
.
searchSrvOrganAccountList
(
srvOrganListReq
));
}
...
...
@@ -154,9 +163,13 @@ public class AccountController {
* @return 返回
*/
@GetMapping
(
"/searchSrvOrganReviewList"
)
public
Result
<
Page
<
SrvOrganAccountListResp
>>
searchSrvOrganReviewList
(
SrvOrganListReq
srvOrganListReq
)
{
public
Result
<
Page
<
SrvOrganAccountListResp
>>
searchSrvOrganReviewList
(
@RequestHeader
(
"Authorization"
)
String
token
,
SrvOrganListReq
srvOrganListReq
)
{
List
<
String
>
list
=
Arrays
.
asList
(
"2"
,
"3"
,
"4"
);
srvOrganListReq
.
setAccountsStatusList
(
list
);
long
srvOrganId
=
TokenParsingUtil
.
TokenParsing
(
token
,
"srvOrganId"
);
if
(
srvOrganId
!=
0
)
{
srvOrganListReq
.
setSrvOrganId
(
srvOrganId
);
}
return
Result
.
success
(
accountService
.
searchSrvOrganAccountList
(
srvOrganListReq
));
}
...
...
@@ -203,9 +216,13 @@ public class AccountController {
* @return
*/
@GetMapping
(
"/queryAccountsDeclareList"
)
public
Result
<
Page
<
ChDisabDetailAccountsResp
>>
queryAccountsDeclareList
(
Integer
pageNum
,
Integer
pageSize
,
SrvOrganListReq
srvOrganListReq
)
{
public
Result
<
Page
<
ChDisabDetailAccountsResp
>>
queryAccountsDeclareList
(
@RequestHeader
(
"Authorization"
)
String
token
,
Integer
pageNum
,
Integer
pageSize
,
SrvOrganListReq
srvOrganListReq
)
{
List
<
String
>
accountsStatusList
=
Arrays
.
asList
(
"0"
,
"1"
);
srvOrganListReq
.
setAccountsStatusList
(
accountsStatusList
);
long
srvOrganId
=
TokenParsingUtil
.
TokenParsing
(
token
,
"srvOrganId"
);
if
(
srvOrganId
!=
0
)
{
srvOrganListReq
.
setSrvOrganId
(
srvOrganId
);
}
Page
<
ChDisabDetailAccountsResp
>
chAssessDetailAccounts
=
accountService
.
queryOrganAccountsDetail
(
pageNum
,
pageSize
,
srvOrganListReq
);
return
Result
.
success
(
chAssessDetailAccounts
);
}
...
...
@@ -216,9 +233,13 @@ public class AccountController {
* @return
*/
@GetMapping
(
"/queryDelayAccountList"
)
public
Result
<
Page
<
ChDisabDetailAccountsResp
>>
queryDelayAccountList
(
Integer
pageNum
,
Integer
pageSize
,
SrvOrganListReq
srvOrganListReq
)
{
public
Result
<
Page
<
ChDisabDetailAccountsResp
>>
queryDelayAccountList
(
@RequestHeader
(
"Authorization"
)
String
token
,
Integer
pageNum
,
Integer
pageSize
,
SrvOrganListReq
srvOrganListReq
)
{
List
<
String
>
list
=
Arrays
.
asList
(
"1"
,
"2"
);
srvOrganListReq
.
setAccountsStatusList
(
list
);
long
srvOrganId
=
TokenParsingUtil
.
TokenParsing
(
token
,
"srvOrganId"
);
if
(
srvOrganId
!=
0
)
{
srvOrganListReq
.
setSrvOrganId
(
srvOrganId
);
}
Page
<
ChDisabDetailAccountsResp
>
chAssessDetailAccounts
=
accountService
.
queryOrganAccountsDetail
(
pageNum
,
pageSize
,
srvOrganListReq
);
return
Result
.
success
(
chAssessDetailAccounts
);
}
...
...
@@ -320,7 +341,11 @@ public class AccountController {
}
@GetMapping
(
"/queryOverallCostList"
)
public
Result
<
Page
<
OverallCostListRespVO
>>
queryOverallCostList
(
OverallCostReqVO
req
)
{
public
Result
<
Page
<
OverallCostListRespVO
>>
queryOverallCostList
(
@RequestHeader
(
"Authorization"
)
String
token
,
OverallCostReqVO
req
)
{
long
srvOrganId
=
TokenParsingUtil
.
TokenParsing
(
token
,
"srvOrganId"
);
if
(
srvOrganId
!=
0
)
{
req
.
setSrvOrganId
(
srvOrganId
);
}
Page
<
OverallCostListRespVO
>
overallCostRecords
=
accountService
.
queryFreeRdInfo
(
req
);
return
Result
.
success
(
overallCostRecords
);
}
...
...
account/account-service/src/main/java/com/hungraim/ltc/account/dao/ChDisabAccountsDetailMapper.java
View file @
ae1da1de
...
...
@@ -17,12 +17,8 @@ import java.util.List;
@Repository
public
interface
ChDisabAccountsDetailMapper
extends
BaseMapper
<
ChDisabDetailAccounts
>
{
List
<
OrganAccountsVO
>
getOrganAccountsList
(
String
taskDetailId
);
List
<
AccountExportDetailListResp
>
searchSrvOrganAccountDetailExport
(
SrvOrganListReq
req
);
List
<
ChDisabDetailAccounts
>
queryAccountByCondition
(
@Param
(
"taskDetailIds"
)
List
<
String
>
taskDetailIds
);
List
<
OrganAccountsVO
>
getOtherPlaceList
(
String
programId
);
...
...
@@ -30,6 +26,8 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
Page
<
NursingRecordsRespVO
>
queryNursingRecords
(
Page
page
,
NursingReqVO
req
);
Page
<
NursingRecordsRespVO
>
queryNursingRecordsGoDoor
(
Page
page
,
NursingReqVO
req
);
OverallEduceDecreaseCostRespVO
queryOverallCostRecords
(
OverallCostReqVO
req
);
...
...
account/account-service/src/main/java/com/hungraim/ltc/account/service/AccountService.java
View file @
ae1da1de
...
...
@@ -47,7 +47,6 @@ public interface AccountService extends IService<ChDisabAccounts> {
int
updateChDisabAccounts
(
int
id
);
Result
organAccountTaskExecute
(
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
);
Result
accountTaskExecute
(
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
);
...
...
account/account-service/src/main/java/com/hungraim/ltc/account/service/impl/AccountServiceImpl.java
View file @
ae1da1de
...
...
@@ -17,7 +17,6 @@ import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgCostStandard;
import
com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach
;
import
com.hungraim.ltc.pojo.entity.account.*
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskFinishItem
;
import
com.hungraim.ltc.pojo.vo.account.*
;
import
com.hungraim.ltc.util.*
;
import
lombok.AllArgsConstructor
;
...
...
@@ -476,18 +475,14 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
public
Page
<
NursingRecordsRespVO
>
queryNursingRecords
(
NursingReqVO
nursingReqVO
)
{
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"
;
Page
<
NursingRecordsRespVO
>
nursingRecordsRespVOPage
=
null
;
if
(
"上门"
.
equals
(
modeName
)){
nursingRecordsRespVOPage
=
chDisabAccountsDetailMapper
.
queryNursingRecordsGoDoor
(
new
Page
<>(
nursingReqVO
.
getPageNum
(),
nursingReqVO
.
getPageSize
()),
nursingReqVO
);
}
else
{
nursingReqVO
.
setModeId
(
"医疗"
.
equals
(
modeName
)
?
"1"
:
"2"
);
nursingRecordsRespVOPage
=
chDisabAccountsDetailMapper
.
queryNursingRecords
(
new
Page
<>(
nursingReqVO
.
getPageNum
(),
nursingReqVO
.
getPageSize
()),
nursingReqVO
);
}
nursingReqVO
.
setModeId
(
modeId
);
return
chDisabAccountsDetailMapper
.
queryNursingRecords
(
new
Page
<>(
nursingReqVO
.
getPageNum
(),
nursingReqVO
.
getPageSize
()),
nursingReqVO
);
return
nursingRecordsRespVOPage
;
}
@Override
...
...
@@ -528,7 +523,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts
.
setDeductionAmount
(
deductionAmount
.
add
(
amountOfMoney
));
deductionAmountTotal
=
deductionAmountTotal
.
add
(
amountOfMoney
);
}
chDisabDetailAccounts
.
setRemarks
(
req
.
getRemarks
());
int
result
=
chDisabAccountsDetailMapper
.
updateById
(
chDisabDetailAccounts
);
chDisabAccounts
.
setReissueAmountTotal
(
reissueAmountTotal
);
chDisabAccounts
.
setDeductionAmountTotal
(
deductionAmountTotal
);
...
...
@@ -539,6 +533,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabFreeRdInfo
.
setAccountsDetailId
(
accountsDetailId
);
chDisabFreeRdInfo
.
setAccountsId
(
accountsId
);
chDisabFreeRdInfo
.
setCreationTime
(
new
Date
());
chDisabFreeRdInfo
.
setRemarks
(
req
.
getRemarks
());
chDisabFreeRdInfoMapper
.
insert
(
chDisabFreeRdInfo
);
return
result
;
}
...
...
@@ -660,8 +655,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
String
planId
=
accountsVO
.
getPlanId
();
// 更新
chDisabAccountsDetailMapper
.
updateByPlanId
(
planId
);
}
else
{
BigDecimal
accountsAllCost
=
chDisabDetailAccountsDTO
.
getAccountsAllCost
();
BigDecimal
accountsOverallCost
=
chDisabDetailAccountsDTO
.
getAccountsOverallCost
();
...
...
@@ -675,119 +668,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
organAccountTaskExecute
(
List
<
AccountTaskExecuteReqVO
>
accountTaskExecuteReqVOS
)
{
log
.
info
(
"organAccountTaskExecute.accountTaskExecuteReqVOS:{}"
,
accountTaskExecuteReqVOS
);
if
(
CollectionUtil
.
isEmpty
(
accountTaskExecuteReqVOS
))
{
return
Result
.
failed
(
"参数不能为空"
);
}
List
<
String
>
taskDetailIds
=
accountTaskExecuteReqVOS
.
stream
().
map
(
AccountTaskExecuteReqVO:
:
getTaskDetailId
).
distinct
().
collect
(
Collectors
.
toList
());
// 根据任务id查找结算详情,还没有对应的任务数据说明还未发生过结算,进行插入详情表和结算表
List
<
ChDisabDetailAccounts
>
chDisabDetailList
=
chDisabAccountsDetailMapper
.
queryAccountByCondition
(
taskDetailIds
);
// 根据任务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
<
ChSrvTaskFinishItem
>
chSrvTaskFinishItems
=
chSrvTaskFinishItemMapper
.
selectList
(
new
LambdaQueryWrapper
<
ChSrvTaskFinishItem
>()
.
eq
(
ChSrvTaskFinishItem:
:
getTaskDetailId
,
taskDetailId
));
List
<
AccountTaskExecuteReqVO
>
accountTaskList
=
entry
.
getValue
();
// 处理具体的服务项目
try
{
for
(
AccountTaskExecuteReqVO
accountTaskExecuteReqVO
:
accountTaskList
)
{
// 已完成的任务更新ch_srv_plan状态
String
planId
=
accountTaskExecuteReqVO
.
getPlanId
();
Integer
integer
=
chSrvTaskDetailMapper
.
updateSrvPlanById
(
planId
);
if
(
integer
==
0
){
log
.
info
(
"更新任务计划表失败"
);
}
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
))
{
log
.
info
(
"chSrvTaskFinishItemStream is totEmpty:{}"
,
chSrvTaskFinishItemStream
);
return
Result
.
success
();
}
}
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
);
}
catch
(
Exception
e
)
{
log
.
info
(
"=====accountSave error:{}"
,
e
);
return
Result
.
failed
(
"服务异常"
);
}
}
return
Result
.
success
();
}
private
void
accountSave
(
String
taskDetailId
,
List
<
ChDisabDetailAccounts
>
chDisabDetailList
)
{
if
(
CollectionUtil
.
isEmpty
(
chDisabDetailList
))
{
List
<
OrganAccountsVO
>
accountsList
=
chDisabAccountsDetailMapper
.
getOrganAccountsList
(
taskDetailId
);
for
(
OrganAccountsVO
accountsVO
:
accountsList
)
{
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
);
}
else
{
break
;
}
// 根据护理机构、结算月份、失能人员id和服务方式查询表里是否有值
// ChDisabDetailAccounts chDisabDetailAccountsDTO = chDisabAccountsDetailMapper.queryDisabDetailAccounts(srvOrganId, DateUtils.dateToStrYm(accountsTime), disabInfoId, srvModeName);
chDisabDetailAccounts
.
setAccountsAllCost
(
limit
);
BigDecimal
overallCost
=
limit
.
multiply
(
overallPercent
);
chDisabDetailAccounts
.
setAccountsOverallCost
(
overallCost
);
BigDecimal
personalCost
=
limit
.
multiply
(
personalPercent
);
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.setTaskDetailId(accountsVO.getTaskDetailId());
chDisabDetailAccounts
.
setMedicalArea
(
accountsVO
.
getMedicalArea
());
chDisabDetailAccounts
.
setDisabInfoId
(
disabInfoId
);
chDisabDetailAccounts
.
setStatus
((
short
)
0
);
chDisabDetailAccounts
.
setReissueAmount
(
BigDecimal
.
valueOf
(
0
));
chDisabDetailAccounts
.
setDeductionAmount
(
BigDecimal
.
valueOf
(
0
));
ChDisabAccounts
chDisabAccounts
=
getChDisabAccounts
(
accountsVO
,
limit
,
overallCost
,
personalCost
);
chDisabDetailAccounts
.
setAccountsId
(
chDisabAccounts
.
getAccountsId
());
chDisabAccountsDetailMapper
.
insert
(
chDisabDetailAccounts
);
}
}
}
private
ChDisabAccounts
getChDisabAccounts1
(
AccountTaskExecuteReqVO
accountsVO
)
{
// 结算表 根据机构和结算时间 服务方式
ChDisabAccounts
chDisabAccounts
=
disabAccountsMapper
.
queryAccountByCondition
(
DateUtils
.
dateToStrYm
(
DateUtils
.
strToDate
(
accountsVO
.
getSrvDate
())),
accountsVO
.
getSrvModeName
(),
accountsVO
.
getSrvOrganId
(),
null
);
...
...
@@ -810,30 +690,9 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
private
ChDisabAccounts
getChDisabAccounts
(
OrganAccountsVO
accountsVO
,
BigDecimal
limit
,
BigDecimal
overallCost
,
BigDecimal
personalCost
)
{
// 结算表 根据机构和结算时间 服务方式
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
.
strToTime
(
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
;
}
@Override
public
void
otherPlaceHandler
(
String
programId
){
List
<
OrganAccountsVO
>
accountsList
=
chDisabAccountsDetailMapper
.
getOtherPlaceList
(
programId
);
/*
List<OrganAccountsVO> accountsList = chDisabAccountsDetailMapper.getOtherPlaceList(programId);
for (OrganAccountsVO accountsVO : accountsList) {
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setSrvOrganId(accountsVO.getSrvOrganId());
...
...
@@ -854,10 +713,10 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId());
chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId());
ChDisabAccounts
chDisabAccounts
=
getChDisabAccounts
(
accountsVO
,
limit
,
zero
,
zero
);
ChDisabAccounts chDisabAccounts = getChDisabAccounts
1(accountsVO
);
chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId());
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
}
}
*/
}
@Override
...
...
@@ -934,10 +793,14 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BigDecimal
accountsAllCost
=
chDisabDetailAccountDTO
.
getAccountsAllCost
();
BigDecimal
accountsOverallCost
=
chDisabDetailAccountDTO
.
getAccountsOverallCost
();
BigDecimal
accountsPersonalCost
=
chDisabDetailAccountDTO
.
getAccountsPersonalCost
();
BigDecimal
deductionAmount
=
chDisabDetailAccountDTO
.
getDeductionAmount
();
BigDecimal
reissueAmount
=
chDisabDetailAccountDTO
.
getReissueAmount
();
ChDisabAccounts
chDisabAccountDTO
=
disabAccountsMapper
.
selectById
(
accountsId
);
BigDecimal
allCost
=
chDisabAccountDTO
.
getAllCost
();
BigDecimal
overallCost
=
chDisabAccountDTO
.
getOverallCost
();
BigDecimal
personalCost
=
chDisabAccountDTO
.
getPersonalCost
();
BigDecimal
deductionAmountTotal
=
chDisabAccountDTO
.
getDeductionAmountTotal
();
BigDecimal
reissueAmountTotal
=
chDisabAccountDTO
.
getReissueAmountTotal
();
Short
accountsStatus
=
chDisabAccountDTO
.
getAccountsStatus
();
if
(
accountsStatus
>
1
)
{
log
.
info
(
"{},已完成审核"
,
accountsDetailId
);
...
...
@@ -948,11 +811,15 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
allCost
=
allCost
.
subtract
(
accountsAllCost
);
overallCost
=
overallCost
.
subtract
(
accountsOverallCost
);
personalCost
=
personalCost
.
subtract
(
accountsPersonalCost
);
BigDecimal
deductionAmountTotalSub
=
deductionAmountTotal
.
subtract
(
deductionAmount
);
BigDecimal
reissueAmountTotalSub
=
reissueAmountTotal
.
subtract
(
reissueAmount
);
ChDisabAccounts
chDisabAccount
=
new
ChDisabAccounts
();
chDisabAccount
.
setAllCost
(
allCost
);
chDisabAccount
.
setOverallCost
(
overallCost
);
chDisabAccount
.
setPersonalCost
(
personalCost
);
chDisabAccount
.
setAccountsId
(
accountsId
);
chDisabAccount
.
setDeductionAmountTotal
(
deductionAmountTotalSub
);
chDisabAccount
.
setReissueAmountTotal
(
reissueAmountTotalSub
);
disabAccountsMapper
.
updateById
(
chDisabAccount
);
// 恢复
}
else
if
(
status
==
1
){
...
...
@@ -960,18 +827,23 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
//结算记录
Date
accountsTime
=
chDisabDetailAccountDTO
.
getAccountsTime
();
Boolean
aBoolean
=
DateUtils
.
inCurrentMonth
(
accountsTime
);
// 同一个月
if
(
aBoolean
){
allCost
=
allCost
.
add
(
accountsAllCost
);
overallCost
=
overallCost
.
add
(
accountsOverallCost
);
personalCost
=
personalCost
.
add
(
accountsPersonalCost
);
BigDecimal
reissueAmountAdd
=
reissueAmountTotal
.
add
(
reissueAmount
);
BigDecimal
deductionAmountAdd
=
deductionAmountTotal
.
add
(
deductionAmount
);
ChDisabAccounts
chDisabAccount
=
new
ChDisabAccounts
();
chDisabAccount
.
setAllCost
(
allCost
);
chDisabAccount
.
setOverallCost
(
overallCost
);
chDisabAccount
.
setPersonalCost
(
personalCost
);
chDisabAccount
.
setAccountsId
(
accountsId
);
chDisabAccount
.
setReissueAmountTotal
(
reissueAmountAdd
);
chDisabAccount
.
setDeductionAmountTotal
(
deductionAmountAdd
);
disabAccountsMapper
.
updateById
(
chDisabAccount
);
}
else
{
// 结算
表加一个是否暂缓字段 1
暂缓
// 结算
到其他月份 结算表加一个是否暂缓字段 2
暂缓
ChDisabAccounts
chDisabAccounts
=
disabAccountsMapper
.
queryAccountByCondition
(
DateUtils
.
dateToStrYm
(
new
Date
()),
chDisabDetailAccountDTO
.
getModeName
(),
chDisabDetailAccountDTO
.
getSrvOrganId
(),
2
);
if
(
chDisabAccounts
==
null
)
{
chDisabAccounts
=
new
ChDisabAccounts
();
...
...
@@ -995,6 +867,10 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BigDecimal
allCost1
=
chDisabAccounts
.
getAllCost
();
BigDecimal
overallCost1
=
chDisabAccounts
.
getOverallCost
();
BigDecimal
personalCost1
=
chDisabAccounts
.
getPersonalCost
();
BigDecimal
deductionAmountTotal1
=
chDisabAccounts
.
getDeductionAmountTotal
();
BigDecimal
reissueAmountTotal1
=
chDisabAccounts
.
getReissueAmountTotal
();
BigDecimal
deduction
=
deductionAmountTotal1
.
add
(
deductionAmount
);
BigDecimal
reissue
=
reissueAmountTotal1
.
add
(
reissueAmount
);
allCost1
=
allCost1
.
add
(
accountsAllCost
);
overallCost1
=
overallCost1
.
add
(
accountsOverallCost
);
personalCost1
=
personalCost1
.
add
(
accountsPersonalCost
);
...
...
@@ -1003,6 +879,8 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabAccount
.
setOverallCost
(
overallCost1
);
chDisabAccount
.
setPersonalCost
(
personalCost1
);
chDisabAccount
.
setAccountsId
(
accountsId
);
chDisabAccount
.
setReissueAmountTotal
(
reissue
);
chDisabAccount
.
setDeductionAmountTotal
(
deduction
);
disabAccountsMapper
.
updateById
(
chDisabAccount
);
}
}
...
...
account/account-service/src/main/resources/mapper/ChDisabAccountsDetailMapper.xml
View file @
ae1da1de
...
...
@@ -31,10 +31,13 @@
<if
test=
"req.accountsId != null and req.accountsId != ''"
>
and d.ACCOUNTS_ID = #{req.accountsId}
</if>
<if
test=
"req.modeId != null and req.modeId != ''"
>
and DECODE(d.mode_name, '医疗','1','养老', '2','上门','3', '异地', '4') = #{req.modeId}
</if>
<if
test=
"req.accountsStatus != null and req.accountsStatus != ''"
>
and d.status = #{req.accountsStatus}
</if>
<if
test=
"req.srvOrganId != null and req.srvOrganId != ''"
>
<if
test=
"req.srvOrganId != null and req.srvOrganId != ''
and req.srvOrganId!=0
"
>
and d.SRV_ORGAN_ID = #{req.srvOrganId}
</if>
...
...
@@ -54,7 +57,7 @@
<select
id=
"queryNursingRecords"
resultType=
"com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO"
>
select organ.SRV_ORGAN_NAME srvOrganName,
to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvPlanTime,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门'
, '4', '异地'
) modeName,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门') modeName,
to_char(plan.CREATION_TIME,'yyyy-MM-dd HH24:mi:ss') executionTime,
plan.item_name itemName
from CH_SRV_PLAN plan
...
...
@@ -65,6 +68,24 @@
and plan.IS_STATUS ='4'
</select>
<select
id=
"queryNursingRecordsGoDoor"
resultType=
"com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO"
>
select
organ.SRV_ORGAN_NAME srvOrganName,
to_char(detail.SRV_DATE,'yyyy-MM-dd') srvPlanTime,
'上门' modeName,
to_char(item.FCD,'yyyy-MM-dd HH24:mi:ss') executionTime,
service.SERVICE_TYPE_DETAILED_NAME itemName
from CH_SRV_TASK_FINISH_ITEM item
left join CH_SRV_TASK_DETAIL detail on detail.TASK_DETAIL_ID = item.TASK_DETAIL_ID
left join CH_SRV_TASK task on task.SRV_TASK_ID = detail.SRV_TASK_ID
LEFT JOIN CH_SRV_ORGAN_EMP m ON m.EMP_ID = task.SRV_EMP_ID
LEFT JOIN CH_SRV_ORGAN organ ON organ.SRV_ORGAN_ID = m.SRV_ORGAN_ID
LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID
left join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME
where to_char(detail.SRV_DATE, 'yyyy-MM') = #{req.accountsTime} and task.DISAB_INFO_ID = #{req.disabInfoId} and organ.SRV_ORGAN_ID = #{req.srvOrganId}
</select>
...
...
@@ -104,44 +125,7 @@
</where>
</select>
<select
id=
"getOrganAccountsList"
resultType=
"com.hungraim.ltc.pojo.vo.account.OrganAccountsVO"
>
select
detail.TASK_DETAIL_ID taskDetailId,
--失能人员姓名
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,
program.SRV_MODE_ID modeId,
--服务方式
DECODE(program.SRV_MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName,
--护理机构名称
organ.srv_organ_id srvOrganId,
--护理机构名称
organ.srv_organ_name srvOrganName,
--护理服务人员 Id
emp.EMP_ID empId,
--任务时间
detail.SRV_DATE srvDate,
-- 机构等级
organ.LEVEL_CODE levelCode
from ch_srv_task_detail detail--服务计划
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_APPLY apply on apply.apply_id = disable.apply_id
left join ch_srv_organ_emp emp on task.srv_emp_id = emp.emp_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_TASK_FINISH_ITEM CSTFI ON detail.TASK_DETAIL_ID = CSTFI.TASK_DETAIL_ID
<where>
detail.STATUS = '4'
<if
test=
"taskDetailId != null and taskDetailId != ''"
>
AND detail.TASK_DETAIL_ID = #{taskDetailId}
</if>
</where>
</select>
<select
id=
"queryPlanInfoByDetailId"
resultType=
"com.hungraim.ltc.pojo.vo.account.OrganAccountsVO"
>
select
...
...
@@ -173,16 +157,7 @@
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 * from CH_DISAB_ACCOUNTS_DETAIL t where t.MODE_NAME in ('养老','医疗')
<if
test=
"taskDetailIds != null and taskDetailIds.size() > 0"
>
AND t.TASK_DETAIL_ID IN
<foreach
collection=
"taskDetailIds"
separator=
","
open=
"("
close=
")"
item=
"taskDetailId"
>
#{taskDetailId}
</foreach>
</if>
</select>
<!--查询评估信息-->
<select
id=
"getAssessAccountsList"
resultType=
"com.hungraim.ltc.pojo.vo.account.AssessAccountsVO"
>
...
...
account/account-service/src/main/resources/mapper/ChDisabAccountsMapper.xml
View file @
ae1da1de
...
...
@@ -59,7 +59,7 @@
#{organId}
</foreach>
</if>
<if
test=
'req.srvOrganId != null'
>
<if
test=
"req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0"
>
AND t2.SRV_ORGAN_ID = #{req.srvOrganId}
</if>
<if
test=
"req.accountsTime != null and req.accountsTime != ''"
>
...
...
account/account-service/src/main/resources/mapper/ChDisabFreeRdInfoMapper.xml
View file @
ae1da1de
...
...
@@ -14,6 +14,7 @@
organ.SRV_ORGAN_NAME srvOrganName,
rd.AMOUNT_OF_MONEY amountOfMoney,
rd.FREE_RD_ID freeRdId,
rd.REMARKS remarks,
d.ACCOUNTS_STATUS accountsStatus
from CH_DISAB_FREE_RD_INFO rd left join
CH_DISAB_ACCOUNTS_DETAIL detail on
...
...
@@ -32,6 +33,9 @@
<if
test=
"req.srvOrganName != null and req.srvOrganName != ''"
>
and organ.SRV_ORGAN_NAME = #{req.srvOrganName}
</if>
<if
test=
"req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0"
>
AND organ.SRV_ORGAN_ID = #{req.srvOrganId}
</if>
<if
test=
"req.certiCode != null and req.certiCode != ''"
>
and info.certi_Code = #{req.certiCode}
</if>
...
...
account/account-service/src/main/resources/mapper/ChSrvTaskDetailMapper.xml
View file @
ae1da1de
...
...
@@ -36,6 +36,9 @@
<if
test=
"req.srvDate != null and req.srvDate != ''"
>
AND to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') = #{req.srvDate}
</if>
<if
test=
"req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0"
>
AND organ.SRV_ORGAN_ID = #{req.srvOrganId}
</if>
</where>
</select>
...
...
apply/apply-service/src/main/java/com/hungraim/ltc/controller/DisableController.java
View file @
ae1da1de
...
...
@@ -500,19 +500,22 @@ public class DisableController {
/**
* 失能人员信息退出列表
*
* @param pageNum 当前页
* @param pageSize 每页几条数据
* @return 失能人员信息列表
*/
@RequestMapping
(
"/disableInfoList"
)
public
Result
<
Page
<
DisableInfoListVo
>>
disableInfoList
(
Integer
pageNum
,
Integer
pageSize
,
Long
srvOrganId
,
String
certiCode
,
String
realName
,
String
svrModelId
)
{
if
(
pageNum
==
null
||
pageNum
<
1
||
srvOrganId
==
null
||
srvOrganId
==
0
)
{
public
Result
<
Page
<
DisableInfoListVo
>>
disableInfoList
(
@RequestHeader
(
"Authorization"
)
String
token
,
Integer
pageNum
,
Integer
pageSize
,
Long
srvOrganId
,
String
certiCode
,
String
realName
,
String
svrModelId
)
{
if
(
pageNum
==
null
||
pageNum
<
1
)
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
if
(
pageSize
==
null
||
pageSize
<
1
)
{
pageSize
=
10
;
}
long
srvOrganIdL
=
TokenParsingUtil
.
TokenParsing
(
token
,
"srvOrganId"
);
if
(
srvOrganIdL
!=
0
)
{
srvOrganId
=
new
Long
(
srvOrganIdL
);
}
Page
<
DisableInfoListVo
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
page
=
disableService
.
getDisableInfoList
(
page
,
srvOrganId
,
certiCode
,
realName
,
svrModelId
);
return
Result
.
success
(
page
);
...
...
@@ -538,4 +541,19 @@ public class DisableController {
}
/**
* 失能人员信息退出历史列表
*
* @param disableInfoId
* @return 失能人员信息退出历史列表
*/
@RequestMapping
(
"/getDisableExitHis"
)
public
Result
<
List
<
ChDisableExit
>>
getDisableExitHis
(
Integer
disableInfoId
)
{
if
(
disableInfoId
==
null
)
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
List
<
ChDisableExit
>
disableExitHis
=
disableService
.
getDisableExitHis
(
disableInfoId
);
return
Result
.
success
(
disableExitHis
);
}
}
apply/apply-service/src/main/java/com/hungraim/ltc/controller/SrvOrganController.java
View file @
ae1da1de
...
...
@@ -91,7 +91,8 @@ public class SrvOrganController {
@PostMapping
(
"/srvOrgan"
)
public
Result
saveSrvOrgan
(
SrvOrganVo
srvOrganVo
)
{
//null == srvOrganVo.getLevelCode() || null == srvOrganVo.getBunk() || || StrUtil.isBlank(srvOrganVo.getPermitId())
if
(
StrUtil
.
isBlank
(
srvOrganVo
.
getOrganId
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictArea
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptArea
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptStreet
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptStreet
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvOrganName
())
||
null
==
srvOrganVo
.
getOrganTypeId
()
||
StrUtil
.
isBlank
(
srvOrganVo
.
getLinkName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getLinkTel
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvType
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getUnifiedSocialCreditCode
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvType
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAccName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankAccCode
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankAccName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankNo
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictWebsite
())
||
null
==
srvOrganVo
.
getCardType
()
||
null
==
srvOrganVo
.
getFileDataList
()
||
srvOrganVo
.
getFileDataList
().
size
()
<
3
)
{
// || StrUtil.isBlank(srvOrganVo.getAcptStreet()) || StrUtil.isBlank(srvOrganVo.getAcptStreet())
if
(
StrUtil
.
isBlank
(
srvOrganVo
.
getOrganId
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictArea
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptArea
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvOrganName
())
||
null
==
srvOrganVo
.
getOrganTypeId
()
||
StrUtil
.
isBlank
(
srvOrganVo
.
getLinkName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getLinkTel
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvType
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getUnifiedSocialCreditCode
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvType
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAccName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankAccCode
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankAccName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankNo
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictWebsite
())
||
null
==
srvOrganVo
.
getCardType
()
||
null
==
srvOrganVo
.
getFileDataList
()
||
srvOrganVo
.
getFileDataList
().
size
()
<
3
)
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
// 参数校验通过,调用service添加护理机构
...
...
@@ -112,7 +113,8 @@ public class SrvOrganController {
@PostMapping
(
"/updateSrvOrgan"
)
public
Result
updateSrvOrgan
(
SrvOrganVo
srvOrganVo
)
{
//StrUtil.isBlank(srvOrganVo.getPermitId()) || null == srvOrganVo.getLevelCode() || null == srvOrganVo.getBunk() ||
if
(
null
==
srvOrganVo
.
getSrvOrganId
()
||
StrUtil
.
isBlank
(
srvOrganVo
.
getOrganId
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictArea
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptArea
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptStreet
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptStreet
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvOrganName
())
||
null
==
srvOrganVo
.
getOrganTypeId
()
||
StrUtil
.
isBlank
(
srvOrganVo
.
getLinkName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getLinkTel
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvType
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getUnifiedSocialCreditCode
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvType
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAccName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankAccCode
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankAccName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankNo
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictWebsite
())
||
null
==
srvOrganVo
.
getCardType
()
||
null
==
srvOrganVo
.
getFileDataList
()
||
srvOrganVo
.
getFileDataList
().
size
()
<
3
)
{
// || StrUtil.isBlank(srvOrganVo.getAcptStreet()) || StrUtil.isBlank(srvOrganVo.getAcptStreet())
if
(
null
==
srvOrganVo
.
getSrvOrganId
()
||
StrUtil
.
isBlank
(
srvOrganVo
.
getOrganId
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getDistrictArea
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAcptArea
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictProvincial
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictCity
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvOrganName
())
||
null
==
srvOrganVo
.
getOrganTypeId
()
||
StrUtil
.
isBlank
(
srvOrganVo
.
getLinkName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getLinkTel
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvType
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getUnifiedSocialCreditCode
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getSrvType
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getAccName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankAccCode
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankAccName
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankNo
())
||
StrUtil
.
isBlank
(
srvOrganVo
.
getBankDistrictWebsite
())
||
null
==
srvOrganVo
.
getCardType
()
||
null
==
srvOrganVo
.
getFileDataList
()
||
srvOrganVo
.
getFileDataList
().
size
()
<
3
)
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
// 参数校验通过,调用service修改护理机构
...
...
apply/apply-service/src/main/java/com/hungraim/ltc/dao/ChSrvSendInfoMapper.java
0 → 100644
View file @
ae1da1de
package
com
.
hungraim
.
ltc
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetailDelete
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
/**
* @author zwl
* @ClassName ChSrvSendMapper
* @description
* @date 2023/3/13 18:40
**/
@Mapper
@Repository
public
interface
ChSrvSendInfoMapper
extends
BaseMapper
<
ChSrvSend
>
{
}
apply/apply-service/src/main/java/com/hungraim/ltc/dao/DisableExitMapper.java
0 → 100644
View file @
ae1da1de
package
com
.
hungraim
.
ltc
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.pojo.entity.disable.ChDisableExit
;
import
com.hungraim.ltc.pojo.entity.disable.ChDisableInfo
;
import
com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
/**
* 失能人员退出Mapper
*
* @author
*/
@Mapper
@Repository
public
interface
DisableExitMapper
extends
BaseMapper
<
ChDisableExit
>
{
}
apply/apply-service/src/main/java/com/hungraim/ltc/dao/DisableInfoMapper.java
View file @
ae1da1de
...
...
@@ -3,12 +3,16 @@ package com.hungraim.ltc.dao;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.pojo.entity.disable.ChDisableInfo
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend
;
import
com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo
;
import
com.hungraim.ltc.pojo.vo.governance.ProgramListVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* 失能人员信息Mapper
*
...
...
@@ -29,4 +33,12 @@ public interface DisableInfoMapper extends BaseMapper<ChDisableInfo> {
int
deleteSrvSend
(
Integer
disableInfoId
,
String
exitTime
);
int
updateSrvProgramById
(
ChSrvProgram
chSrvProgram
);
int
updateSrvSendById
(
ChSrvSend
chSrvSend
);
int
insertSrvSend
(
Integer
disableInfoId
);
}
apply/apply-service/src/main/java/com/hungraim/ltc/service/DisableService.java
View file @
ae1da1de
...
...
@@ -184,4 +184,6 @@ public interface DisableService {
int
disableInfoExit
(
Integer
disableInfoId
,
Integer
exitReasonId
,
Integer
applyId
,
Integer
srvOrganId
,
Integer
programId
,
String
exitTime
);
List
<
ChDisableExit
>
getDisableExitHis
(
Integer
disableInfoId
);
}
apply/apply-service/src/main/java/com/hungraim/ltc/service/impl/DisableServiceImpl.java
View file @
ae1da1de
...
...
@@ -18,6 +18,9 @@ import com.hungraim.ltc.pojo.entity.disable.*;
import
com.hungraim.ltc.pojo.entity.riskLevel.ChDisableRiskLevel
;
import
com.hungraim.ltc.pojo.entity.riskLevel.ChSrvorganRiskLevel
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChCfgPara
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail
;
import
com.hungraim.ltc.pojo.vo.disable.*
;
import
com.hungraim.ltc.pojo.vo.governance.ProgramListVo
;
import
com.hungraim.ltc.pojo.vo.system.AttachUpdateVo
;
...
...
@@ -58,11 +61,16 @@ public class DisableServiceImpl implements DisableService {
private
final
AttachFeignService
attachFeignService
;
private
final
ChDisableInfoChangeMapper
chDisableInfoChangeMapper
;
private
final
DisableInfoHisMapper
disableInfoHisMapper
;
private
final
DisableExitMapper
disableExitMapper
;
private
final
OrganService
organService
;
private
final
ChSrvSendInfoMapper
chSrvSendInfoMapper
;
@Autowired
private
ChDisableRiskLevelMapper
chDisableRiskLevelMapper
;
/**
* 获取机构ids
*
...
...
@@ -593,16 +601,55 @@ public class DisableServiceImpl implements DisableService {
chDisableInfo
.
setExitSrvOrganId
(
srvOrganId
);
int
result
=
disableInfoMapper
.
updateById
(
chDisableInfo
);
boolean
now
=
DateUtils
.
isNow
(
date
);
if
(
now
)
{
ChSrvProgram
chSrvProgram
=
new
ChSrvProgram
();
chSrvProgram
.
setProgramId
(
chSrvProgram
.
getProgramId
());
chSrvProgram
.
setDisabInfoId
(
Long
.
valueOf
(
disableInfoId
));
chSrvProgram
.
setProgStatus
(
2
);
chSrvProgram
.
setEndReason
(
"失能人员退出,终止方案"
);
disableInfoMapper
.
updateSrvProgramById
(
chSrvProgram
);
ChSrvSend
chSrvSend
=
new
ChSrvSend
();
chSrvSend
.
setDisabInfoId
(
Long
.
valueOf
(
disableInfoId
));
chSrvSend
.
setEndTime
(
date
);
// 4, 转入医保 5, 异地
if
(
exitReasonId
==
4
||
exitReasonId
==
5
){
// chSrvSend.setStatus((short)3);
// disableInfoMapper.updateSrvSendById(chSrvSend);
// 1, 死亡
}
else
if
(
exitReasonId
==
1
){
chSrvSend
.
setStatus
((
short
)
3
);
disableInfoMapper
.
updateSrvSendById
(
chSrvSend
);
}
else
{
chSrvSend
.
setStatus
((
short
)
3
);
disableInfoMapper
.
updateSrvSendById
(
chSrvSend
);
disableInfoMapper
.
insertSrvSend
(
disableInfoId
);
}
if
(
exitReasonId
==
3
||
exitReasonId
==
4
||
exitReasonId
==
5
||
exitReasonId
==
6
||
exitReasonId
==
7
){
}
// 解除护理机构分配
// delete from CH_SRV_SEND where DISAB_INFO_ID = '327'
disableInfoMapper
.
deleteSrvSend
(
disableInfoId
,
exitTime
);
// disableInfoMapper.deleteSrvSend(disableInfoId,exitTime);
// }
ChDisableExit
chDisableExit
=
new
ChDisableExit
();
chDisableExit
.
setDisabInfoId
(
disableInfoId
);
chDisableExit
.
setExitReasonId
(
exitReasonId
);
chDisableExit
.
setExitTime
(
date
);
chDisableExit
.
setSrvOrganId
(
srvOrganId
);
disableExitMapper
.
insert
(
chDisableExit
);
return
result
;
}
return
result
;
@Override
public
List
<
ChDisableExit
>
getDisableExitHis
(
Integer
disableInfoId
)
{
List
<
ChDisableExit
>
chDisableExits
=
disableExitMapper
.
selectList
(
new
LambdaQueryWrapper
<
ChDisableExit
>().
eq
(
ChDisableExit:
:
getDisabInfoId
,
disableInfoId
));
return
chDisableExits
;
}
}
apply/apply-service/src/main/java/com/hungraim/ltc/service/impl/SrvOrganEmpServiceImpl.java
View file @
ae1da1de
...
...
@@ -153,20 +153,20 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
List
<
Long
>
organIds
=
organService
.
getOrganIds
(
organId
,
isInvolveChild
);
List
<
SrvOrganEmpExportVo
>
srvOrganEmpExportList
=
chSrvOrganEmpApplyMapper
.
getSrvOrganEmpApplyExportList
(
organIds
,
srvOrganId
,
empName
,
srvOrganName
,
certifNum
,
isLock
,
empType
);
for
(
SrvOrganEmpExportVo
record
:
srvOrganEmpExportList
)
{
StringBuilder
stringBuilder
=
new
StringBuilder
();
if
(
record
==
null
){
break
;
}
if
(
StringUtils
.
isEmpty
(
record
.
getProvincial
())){
stringBuilder
.
append
(
"--"
);
}
else
if
(
record
.
getProvincial
().
equals
(
record
.
getCity
())){
stringBuilder
.
append
(
record
.
getProvincial
());
}
else
{
stringBuilder
.
append
(
record
.
getProvincial
()).
append
(
record
.
getCity
());
}
record
.
setProvinCialcityArea
(
stringBuilder
.
toString
());
}
//
for (SrvOrganEmpExportVo record : srvOrganEmpExportList) {
//
StringBuilder stringBuilder = new StringBuilder();
//
if(record == null){
//
break;
//
}
//
if(StringUtils.isEmpty(record.getProvincial())){
//
stringBuilder.append("--");
//
}else if( record.getProvincial().equals(record.getCity())){
//
stringBuilder.append(record.getProvincial());
//
}else {
//
stringBuilder.append(record.getProvincial()).append(record.getCity());
//
}
//
record.setProvinCialcityArea(stringBuilder.toString());
//
}
ExportParams
exportParams
=
new
ExportParams
();
exportParams
.
setType
(
ExcelType
.
XSSF
);
// 对应xlsx
Workbook
workbook
=
ExcelExportUtil
.
exportExcel
(
exportParams
,
SrvOrganEmpExportVo
.
class
,
srvOrganEmpExportList
);
...
...
apply/apply-service/src/main/resources/mapper/ChSrvOrganEmpMapper.xml
View file @
ae1da1de
...
...
@@ -99,7 +99,7 @@
T5.ORGAN_NAME organName,
T4.UNIFIED_SOCIAL_CREDIT_CODE unifiedSocialCreditCode,
T1.EMP_NAME empName,
T1.GENDER
gender,
DECODE(T1.gender, 'M','男','F', '女','N', '不确定')
gender,
T1.AGE age,
T1.CERTIF_TYPE certifType,
T1.CERTIF_NUM certifNum,
...
...
apply/apply-service/src/main/resources/mapper/DisableInfoMapper.xml
View file @
ae1da1de
...
...
@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.hungraim.ltc.dao.DisableInfoMapper"
>
<select
id=
"getDisableInfoList"
resultType=
"com.hungraim.ltc.pojo.vo.disable.DisableInfoListVo"
>
SELECT T1.PROGRAM_ID programId,
SELECT
distinct
T1.PROGRAM_ID programId,
T1.SRV_ORGAN_ID srvOrganId,
T1.DISAB_INFO_ID disabInfoId,
T5.DISTRICT_PROVINCIAL districtProvincial,
...
...
@@ -16,8 +16,6 @@
T2.ACPT_AREA acptArea,
T2.ACPT_STREET acptStreet,
T2.ACPT_ADDRESS acptAddress,
T6.DISABLE_LEVEL_NAME realLevel,
T4.FINISH_TIME assessDate,
T7.MODE_NAME svrModelName,
T5.SRV_ORGAN_NAME svrOrganName,
T1.PROG_STATUS progStatus,
...
...
@@ -34,21 +32,22 @@
FROM CH_DISABLE_INFO T2
INNER JOIN CH_SRV_PROGRAM T1 ON T1.DISAB_INFO_ID = T2.DISAB_INFO_ID
LEFT JOIN CH_CFG_SRV_MODE T7 ON T2.SRV_MODE_ID = T7.MODE_ID
LEFT JOIN CH_APR_REPORT T3 ON T2.LAST_TASK_ID = T3.TASK_ID
LEFT JOIN CH_CFG_SRV_DISABLE_LEVEL T6 ON T3.DISABLE_LEVEL_ID = T6.DISABLE_LEVEL_ID
LEFT JOIN CH_APR_TASK T4 ON T3.TASK_ID = T4.TASK_ID
LEFT JOIN CH_SRV_ORGAN T5 ON T1.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
WHERE
T1.SRV_ORGAN_ID = #{srvOrganId}
<where>
1=1
<if
test=
"srvOrganId != null and srvOrganId != '' and srvOrganId!=0"
>
and T1.SRV_ORGAN_ID = #{srvOrganId}
</if>
<if
test=
"certiCode != null and certiCode != ''"
>
and T2.CERTI_CODE = #{certiCode}
</if>
<if
test=
"realName != null and realName != ''"
>
and T2.real_name
= #{realName}
and T2.real_name
like CONCAT(CONCAT('%',#{realName}) ,'%')
</if>
<if
test=
"svrModelId != null and svrModelId != ''"
>
and T7.MODE_ID = #{svrModelId}
</if>
</where>
</select>
<update
id=
"updateChSrvProgram"
>
...
...
@@ -60,4 +59,21 @@
<delete
id=
"deleteSrvSend"
>
delete from CH_SRV_SEND where DISAB_INFO_ID = #{disableInfoId}
</delete>
<update
id=
"updateSrvProgramById"
parameterType=
"com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram"
>
update CH_SRV_PROGRAM g set g.PROG_STATUS ='2',g.END_REASON = #{endReason} where
g.DISAB_INFO_ID =#{disabInfoId} and g.PROGRAM_DATE
<![CDATA[ < ]]>
sysdate
</update>
<update
id=
"updateSrvSendById"
parameterType=
"com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend"
>
update CH_SRV_SEND s set s.STATUS ='3',s.end_time = #{endTime} where
s.DISAB_INFO_ID = #{disabInfoId}
</update>
<insert
id=
"insertSrvSend"
>
insert INTO ch_srv_send(SRV_SEND_ID,DISAB_INFO_ID,FCD,STATUS) values
((SELECT max(srv_send_id)+1 id from CH_SRV_SEND),#{disableInfoId},SYSDATE,0)
</insert>
</mapper>
\ No newline at end of file
assessment/assessment-service/src/main/java/com/hungraim/ltc/controller/TaskController.java
View file @
ae1da1de
...
...
@@ -692,14 +692,14 @@ public class TaskController {
* @param city 失能人员所在市
* @param area 失能人员所在区
* @param organName 评定机构名称
* @param
n
ame 评定人员姓名
* @param
realN
ame 评定人员姓名
* @param tel 评定人员手机号码
* @param groupLeader 是否组长0组长,1非组长
*/
@GetMapping
(
"/aprEmpExport"
)
public
void
aprEmpExport
(
String
provincial
,
String
city
,
String
area
,
String
organName
,
String
name
,
String
tel
,
String
groupLeader
,
HttpServletResponse
response
){
Workbook
workbook
=
taskService
.
aprEmpExport
(
provincial
,
city
,
area
,
organName
,
n
ame
,
tel
,
groupLeader
);
public
void
aprEmpExport
(
String
provincial
,
String
city
,
String
area
,
String
organName
,
String
realName
,
String
tel
,
String
certiCode
,
String
isLock
,
String
empType
,
String
groupLeader
,
HttpServletResponse
response
){
Workbook
workbook
=
taskService
.
aprEmpExport
(
provincial
,
city
,
area
,
organName
,
realN
ame
,
tel
,
certiCode
,
isLock
,
empType
,
groupLeader
);
// 命名表格
String
fileName
=
"aprEmp.xlsx"
;
FileUtils
.
exportResponse
(
workbook
,
fileName
,
response
);
...
...
assessment/assessment-service/src/main/java/com/hungraim/ltc/dao/DisableInfoMapper.java
View file @
ae1da1de
...
...
@@ -13,4 +13,5 @@ import org.springframework.stereotype.Repository;
@Mapper
@Repository
public
interface
DisableInfoMapper
extends
BaseMapper
<
ChDisableInfo
>
{
}
assessment/assessment-service/src/main/java/com/hungraim/ltc/dao/TaskMapper.java
View file @
ae1da1de
...
...
@@ -3,6 +3,7 @@ package com.hungraim.ltc.dao;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.pojo.entity.assessment.ChAprTask
;
import
com.hungraim.ltc.pojo.entity.disable.ChDisableInfo
;
import
com.hungraim.ltc.pojo.vo.assessment.*
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -75,5 +76,9 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
Page
<
TaskGroupInfoByPageVO
>
taskGroupInfoListByPage
(
String
aprEmpId
,
String
appointStartTime
,
String
appointEndTime
,
String
queryBeginDate
,
String
queryEndDate
,
String
groupNo
,
Integer
pageNo
,
Integer
pageSize
);
List
<
AprEmpExportVO
>
aprEmpExportList
(
String
provincial
,
String
city
,
String
area
,
String
organName
,
String
name
,
String
tel
,
String
groupLeader
);
List
<
AprEmpExportVO
>
aprEmpExportList
(
String
provincial
,
String
city
,
String
area
,
String
organName
,
String
name
,
String
tel
,
String
certiCode
,
String
isLock
,
String
empType
,
String
groupLeader
);
int
insertSrvSend
(
Integer
disableInfoId
);
ChDisableInfo
selectDisableBycertiCode
(
@Param
(
"certiCode"
)
String
certiCode
);
}
assessment/assessment-service/src/main/java/com/hungraim/ltc/service/TaskService.java
View file @
ae1da1de
...
...
@@ -88,7 +88,7 @@ public interface TaskService {
Map
taskReportFractionDtlQueryList
();
Workbook
aprEmpExport
(
String
provincial
,
String
city
,
String
area
,
String
organName
,
String
name
,
String
tel
,
String
groupLeader
);
Workbook
aprEmpExport
(
String
provincial
,
String
city
,
String
area
,
String
organName
,
String
name
,
String
tel
,
String
certiCode
,
String
isLock
,
String
empType
,
String
groupLeader
);
void
assessAccount
(
ReportDetailVO
reportDetailVo
);
...
...
assessment/assessment-service/src/main/java/com/hungraim/ltc/service/impl/TaskServiceImpl.java
View file @
ae1da1de
...
...
@@ -16,6 +16,7 @@ import com.hungraim.ltc.pojo.entity.assessment.*;
import
com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel
;
import
com.hungraim.ltc.pojo.entity.disable.ChDisableApply
;
import
com.hungraim.ltc.pojo.entity.disable.ChDisableInfo
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail
;
import
com.hungraim.ltc.pojo.vo.ReportUpdateVO
;
import
com.hungraim.ltc.pojo.vo.account.AssessAccountsExportResp
;
...
...
@@ -28,6 +29,7 @@ import com.hungraim.ltc.service.TppesApiException;
import
com.hungraim.ltc.util.*
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
net.sf.jsqlparser.expression.LongValue
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -73,6 +75,7 @@ public class TaskServiceImpl implements TaskService {
/**
* 评定任务分配列表
*
...
...
@@ -215,6 +218,11 @@ public class TaskServiceImpl implements TaskService {
task
.
setFinishTime
(
new
Date
());
task
.
setTaskStatus
(
3
);
// 已完成
taskMapper
.
updateById
(
task
);
if
(
2
==
reportDetailVO
.
getEvaluateType
()){
ChAprTask
chAprTask
=
taskMapper
.
selectById
(
reportDetailVO
.
getTaskId
());
Integer
disableInfoId
=
chAprTask
.
getDisableInfoId
();
taskMapper
.
insertSrvSend
(
disableInfoId
);
}
return
Result
.
success
();
}
...
...
@@ -228,8 +236,9 @@ public class TaskServiceImpl implements TaskService {
Integer
person2
=
reportDetailVo
.
getPerson2
();
String
evaluateTime
=
reportDetailVo
.
getEvaluateTime
();
Date
evaluateDate
=
DateUtils
.
strToDate
(
evaluateTime
);
List
<
ChDisableInfo
>
chDisableInfos
=
disableInfoMapper
.
selectList
(
new
LambdaQueryWrapper
<
ChDisableInfo
>().
eq
(
ChDisableInfo:
:
getApplyId
,
reportDetailVo
.
getApplyId
()));
Integer
srvModeId
=
chDisableInfos
.
get
(
0
).
getSrvModeId
();
String
certiCode
=
reportDetailVo
.
getCertiCode
();
ChDisableInfo
chDisableInfo
=
taskMapper
.
selectDisableBycertiCode
(
certiCode
);
Integer
srvModeId
=
chDisableInfo
.
getSrvModeId
();
// 根据评定机构id和评估结算时间查找表里有没有数据,有数据直接累加费用
// 评定人员结算表插入
if
(
person1
!=
null
)
{
...
...
@@ -239,7 +248,7 @@ public class TaskServiceImpl implements TaskService {
Integer
aprOrganId
=
chAprEmp
.
getAprOrganId
();
chAssessDetailAccounts
.
setAprOrganId
(
String
.
valueOf
(
aprOrganId
));
chAssessDetailAccounts
.
setApplyId
(
reportDetailVo
.
getApplyId
(
));
chAssessDetailAccounts
.
setApplyId
(
String
.
valueOf
(
chDisableInfo
.
getApplyId
()
));
chAssessDetailAccounts
.
setCreationTime
(
new
Date
());
chAssessDetailAccounts
.
setAccountsTime
(
evaluateDate
);
chAssessDetailAccounts
.
setAssessTime
(
evaluateDate
);
...
...
@@ -249,16 +258,19 @@ public class TaskServiceImpl implements TaskService {
String
assessCost
=
aprempTypeIdS
==
1
?
"100"
:
"150"
;
chAssessDetailAccounts
.
setAssessCost
(
assessCost
);
Long
assessAccountsId
=
saveAssess
(
aprOrganId
,
assessCost
,
srvModeId
,
evaluateDate
);
if
(
assessAccountsId
!=
null
){
chAssessDetailAccounts
.
setAssessAccountsId
(
assessAccountsId
);
chAssessAccountsDetailMapper
.
insert
(
chAssessDetailAccounts
);
}
}
if
(
person2
!=
null
)
{
ChAssessDetailAccounts
chAssessDetailAccounts
=
new
ChAssessDetailAccounts
();
chAssessDetailAccounts
.
setEmpId
(
String
.
valueOf
(
person2
));
ChAprEmp
chAprEmp
=
aprEmpMapper
.
selectById
(
person2
);
Integer
aprOrganId
=
chAprEmp
.
getAprOrganId
();
chAssessDetailAccounts
.
setAprOrganId
(
String
.
valueOf
(
aprOrganId
));
chAssessDetailAccounts
.
setApplyId
(
reportDetailVo
.
getApplyId
(
));
chAssessDetailAccounts
.
setApplyId
(
String
.
valueOf
(
chDisableInfo
.
getApplyId
()
));
chAssessDetailAccounts
.
setCreationTime
(
new
Date
());
chAssessDetailAccounts
.
setAccountsTime
(
evaluateDate
);
chAssessDetailAccounts
.
setAssessTime
(
evaluateDate
);
...
...
@@ -268,16 +280,22 @@ public class TaskServiceImpl implements TaskService {
String
assessCost
=
aprempTypeIdS
==
1
?
"100"
:
"150"
;
chAssessDetailAccounts
.
setAssessCost
(
assessCost
);
Long
assessAccountsId
=
saveAssess
(
aprOrganId
,
assessCost
,
srvModeId
,
evaluateDate
);
if
(
assessAccountsId
!=
null
)
{
chAssessDetailAccounts
.
setAssessAccountsId
(
assessAccountsId
);
chAssessAccountsDetailMapper
.
insert
(
chAssessDetailAccounts
);
}
}
}
private
Long
saveAssess
(
Integer
aprOrganId
,
String
assessCost
,
Integer
modeId
,
Date
evaluateDate
)
{
Long
assessAccountsId
;
Long
assessAccountsId
=
null
;
AssessIdAndCostVO
assessIdAndCostVO
=
chAssessAccountsMapper
.
queryAssessByOrganIdAndTime
(
String
.
valueOf
(
aprOrganId
),
DateUtils
.
dateToStrYm
(
evaluateDate
),
String
.
valueOf
(
modeId
));
if
(
assessIdAndCostVO
!=
null
&&
assessIdAndCostVO
.
getAccountsStatus
()==
2
){
log
.
info
(
"{},已完成审核,不再进行评估结算"
,
assessIdAndCostVO
.
getAssessAccountsId
());
return
assessAccountsId
;
}
if
(
assessIdAndCostVO
==
null
)
{
ChAssessAccounts
chAssessAccounts
=
new
ChAssessAccounts
();
chAssessAccounts
.
setAccountsTime
(
evaluateDate
);
...
...
@@ -348,6 +366,19 @@ public class TaskServiceImpl implements TaskService {
chAprReport
.
setEvaluateTime
(
evaluateDate
);
chAprReport
.
setEvaluateType
(
vo
.
getEvaluateType
());
aprReportMapper
.
updateById
(
chAprReport
);
// 2023-3-20 新增
// 更新评定任务状态为已完成,并记录完成时间
ChAprTask
task
=
new
ChAprTask
();
task
.
setTaskId
(
chAprReport
.
getTaskId
());
task
.
setFinishTime
(
new
Date
());
task
.
setTaskStatus
(
3
);
// 已完成
taskMapper
.
updateById
(
task
);
if
(
2
==
vo
.
getEvaluateType
()){
ChAprTask
chAprTask
=
taskMapper
.
selectById
(
chAprReport
.
getTaskId
());
Integer
disableInfoId
=
chAprTask
.
getDisableInfoId
();
taskMapper
.
insertSrvSend
(
disableInfoId
);
}
//附件上传
this
.
updateAttachs
(
vo
.
getFileDataList
(),
chAprReport
.
getReportId
().
longValue
());
//修改鉴定报告人员(有就update,没有就insert)
...
...
@@ -402,7 +433,14 @@ public class TaskServiceImpl implements TaskService {
}
}
// 评估结算
ReportDetailVO
reportDetailVO
=
new
ReportDetailVO
();
reportDetailVO
.
setCertiCode
(
vo
.
getCertiCode
());
reportDetailVO
.
setPerson1
(
vo
.
getPerson1
());
reportDetailVO
.
setPerson2
(
vo
.
getPerson2
());
reportDetailVO
.
setDisableLevelId
(
vo
.
getDisableLevelId
());
reportDetailVO
.
setEvaluateTime
(
vo
.
getEvaluateTime
());
assessAccount
(
reportDetailVO
);
}
/**
...
...
@@ -447,8 +485,28 @@ public class TaskServiceImpl implements TaskService {
taskMapper
.
updateById
(
task
);
//更新失能人员信息
ChDisableInfo
chDisableInfo
=
disableInfoMapper
.
selectById
(
task
.
getDisableInfoId
());
if
(
chDisableInfo
!=
null
){
chDisableInfo
.
setLastTaskId
(
task
.
getTaskId
());
disableInfoMapper
.
updateById
(
chDisableInfo
);
}
//插入评定任报告 2023-03-20
ChAprReport
report
=
new
ChAprReport
();
report
.
setTaskId
(
task
.
getTaskId
());
report
.
setEffTime
(
new
Date
());
report
.
setFcd
(
new
Date
());
report
.
setStatus
(
0
);
aprReportMapper
.
insert
(
report
);
ChAprPersonInfo
person1Info
=
new
ChAprPersonInfo
();
person1Info
.
setReportId
(
report
.
getReportId
());
if
(
StringUtils
.
isNotEmpty
(
empId
))
{
person1Info
.
setEmpId
(
Integer
.
parseInt
(
empId
));
}
person1Info
.
setFcd
(
new
Date
());
personInfoMapper
.
insert
(
person1Info
);
//生成组
ChAprTaskPush
taskPush
=
new
ChAprTaskPush
();
taskPush
.
setAssignTime
(
new
Date
());
...
...
@@ -815,8 +873,8 @@ public class TaskServiceImpl implements TaskService {
}
@Override
public
Workbook
aprEmpExport
(
String
provincial
,
String
city
,
String
area
,
String
organName
,
String
name
,
String
tel
,
String
groupLeader
)
{
List
<
AprEmpExportVO
>
aprEmpExportList
=
taskMapper
.
aprEmpExportList
(
provincial
,
city
,
area
,
organName
,
name
,
tel
,
groupLeader
);
public
Workbook
aprEmpExport
(
String
provincial
,
String
city
,
String
area
,
String
organName
,
String
name
,
String
tel
,
String
certiCode
,
String
isLock
,
String
empType
,
String
groupLeader
)
{
List
<
AprEmpExportVO
>
aprEmpExportList
=
taskMapper
.
aprEmpExportList
(
provincial
,
city
,
area
,
organName
,
name
,
tel
,
certiCode
,
isLock
,
empType
,
groupLeader
);
for
(
AprEmpExportVO
record
:
aprEmpExportList
)
{
StringBuilder
stringBuilder
=
new
StringBuilder
();
if
(
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
record
.
getDistrictProvincial
())){
...
...
assessment/assessment-service/src/main/resources/mapper/ChAssessAccountsMapper.xml
View file @
ae1da1de
...
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"com.hungraim.ltc.dao.ChAssessAccountsMapper"
>
<select
id=
"queryAssessByOrganIdAndTime"
resultType=
"com.hungraim.ltc.pojo.vo.assessment.AssessIdAndCostVO"
>
select a.ASSESS_ACCOUNTS_ID assessAccountsId,a.ASSESS_ALL_COST assessAllCost from
select a.ASSESS_ACCOUNTS_ID assessAccountsId,a.ASSESS_ALL_COST assessAllCost
,a.ACCOUNTS_STATUS accountsStatus
from
CH_ASSESS_ACCOUNTS a where a.APR_ORGAN_ID = #{aprOrganId}
and to_char(a.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime}
and a.MODE_ID = #{modeId}
...
...
assessment/assessment-service/src/main/resources/mapper/ChAssessDetailAccountsMapper.xml
View file @
ae1da1de
...
...
@@ -11,6 +11,7 @@
organ.organ_name assessOrganName,
to_char(d.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
(select type.APREMP_NAME from CH_CFG_APREMP_TYPE type where type.APREMP_TYPE_ID = emp.APREMP_TYPE_ID_S) aprempTypeS,
to_char(d.assess_time,'yyyy-MM-dd') assessTime,
emp.REAL_NAME empName
from CH_ASSESS_ACCOUNTS_DETAIL d
...
...
@@ -23,12 +24,13 @@ from CH_ASSESS_ACCOUNTS_DETAIL d
<select
id=
"assessAccountDetailExport"
resultType=
"com.hungraim.ltc.pojo.vo.account.AssessAccountsExportResp"
>
SELECT
t2.REAL_NAME realName,
(select type.APREMP_NAME from CH_CFG_APREMP_TYPE type where type.APREMP_TYPE_ID = t4.APREMP_TYPE_ID_S) aprempTypeS,
t3.ORGAN_NAME organName,
to_char(t1.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
t1.ASSESS_COST assessCost,
to_char(t1.assess_time,'yyyy-MM-dd') assessTime,
t4.REAL_NAME empName,
(select district_name from ch_fnd_district dis where t2.MEDICAL_AREA = dis.district_code) medicalArea
,
(select district_name from ch_fnd_district dis where t2.MEDICAL_AREA = dis.district_code) medicalArea
FROM
CH_ASSESS_ACCOUNTS_DETAIL t1
left join CH_DISABLE_APPLY t2 on t1.APPLY_ID = t2.APPLY_ID
...
...
@@ -36,7 +38,5 @@ FROM
left join CH_APR_EMP t4 on t4.EMP_ID = t1.EMP_ID
where t1.ASSESS_ACCOUNTS_ID = #{assessAccountsId}
</select>
</mapper>
assessment/assessment-service/src/main/resources/mapper/ChDisableEvaluateMapper.xml
View file @
ae1da1de
...
...
@@ -151,6 +151,7 @@
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.acpt_srv_area = dis.DISTRICT_CODE) acptSrvArea,
info.ACPT_SRV_ADDRESS acptSrvAddress,--接受服务地址详细地址
info.ACPT_ADDRESS acptAddress,--接受评定详细地址
info.ADRESS_DETAIL operAddress,
lev.DISABLE_LEVEL_NAME riskLevel,
report.EFF_TIME effTime,report.EVALUATE_TYPE
FROM ch_apr_report report
...
...
@@ -494,7 +495,9 @@
emp.AGE age,
emp.certi_code certiCode,
emp.tel tel,
DECODE(emp.Group_leader, '0','组长','1', '非组长') groupLeader
DECODE(emp.EMP_TYPE, '0','评定人员','1', '管理人员','2','医生','3','护士') empType,
DECODE(emp.Group_leader, '0','组长','1', '非组长') groupLeader,
DECODE(emp.IS_LOCK, '0','有效','1', '失效') isLock
FROM ch_apr_emp emp
LEFT JOIN ch_apr_organ organ ON emp.apr_organ_id = organ.apr_organ_id
LEFT JOIN ch_srv_organ srvOrgan ON organ.organ_id = srvOrgan.srv_organ_id
...
...
@@ -515,15 +518,31 @@
<if
test=
"name != null and name != ''"
>
and emp.real_name like CONCAT(CONCAT('%',#{name}) ,'%')
</if>
<if
test=
"certiCode != null and certiCode != ''"
>
and emp.certi_code = #{certiCode}
</if>
<if
test=
"tel != null and tel != ''"
>
and emp.tel = #{tel}
</if>
<if
test=
"groupLeader != null and groupLeader != ''"
>
and emp.group_leader = #{groupLeader}
</if>
<if
test=
"empType != null and empType != ''"
>
and emp.emp_type = #{empType}
</if>
<if
test=
"isLock != null and isLock != ''"
>
and emp.is_lock = #{isLock}
</if>
</where>
</select>
<insert
id=
"insertSrvSend"
>
insert INTO ch_srv_send(SRV_SEND_ID,DISAB_INFO_ID,FCD,STATUS) values
((SELECT max(srv_send_id)+1 id from CH_SRV_SEND),#{disableInfoId},SYSDATE,0)
</insert>
<select
id=
"selectDisableBycertiCode"
resultType=
"com.hungraim.ltc.pojo.entity.disable.ChDisableInfo"
>
select * from CH_DISABLE_INFO info where info.CERTI_CODE = #{certiCode} and rownum = 1 order by info.FCD desc
</select>
</mapper>
\ No newline at end of file
auth-service/src/main/java/com/hungraim/ltc/controller/AuthController.java
View file @
ae1da1de
...
...
@@ -6,6 +6,7 @@ import com.hungraim.ltc.util.Result;
import
com.hungraim.ltc.util.ResultCode
;
import
lombok.AllArgsConstructor
;
import
lombok.SneakyThrows
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.security.jwt.JwtHelper
;
import
org.springframework.security.oauth2.common.OAuth2AccessToken
;
...
...
@@ -30,14 +31,18 @@ public class AuthController {
private
final
RedisTemplate
redisTemplate
;
private
final
TokenEndpoint
tokenEndpoint
;
@Autowired
private
CsoftSecurityUtil
csoftSecurityUtil
;
@PostMapping
(
"/token"
)
@SneakyThrows
public
Result
<
OAuth2AccessToken
>
postAccessToken
(
Principal
principal
,
@RequestParam
Map
<
String
,
String
>
parameters
)
{
public
Result
<
OAuth2AccessToken
>
postAccessToken
(
Principal
principal
,
@RequestParam
Map
<
String
,
String
>
parameters
,
String
publicKeyString
)
{
String
password
=
parameters
.
get
(
"password"
);
if
(
FALSE
.
equals
(
password
)){
return
Result
.
failed
(
ResultCode
.
USER_LOGIN_ERROR
);
}
String
decrypt
=
CsoftSecurityUtil
.
decryptRSADefault
(
password
);
String
decrypt
=
csoftSecurityUtil
.
decryptRSADefault
(
password
,
publicKeyString
);
parameters
.
put
(
"password"
,
decrypt
);
OAuth2AccessToken
oAuth2AccessToken
=
tokenEndpoint
.
postAccessToken
(
principal
,
parameters
).
getBody
();
return
Result
.
success
(
oAuth2AccessToken
);
...
...
@@ -49,7 +54,7 @@ public class AuthController {
*/
@GetMapping
(
"/genKeyPair"
)
public
Result
<
String
>
genKeyPair
()
{
Map
keyMap
=
C
softSecurityUtil
.
createKeyPairs
();
Map
keyMap
=
c
softSecurityUtil
.
createKeyPairs
();
return
Result
.
success
(
keyMap
.
get
(
0
).
toString
());
}
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/account/NursingReqVO.java
View file @
ae1da1de
...
...
@@ -16,10 +16,11 @@ public class NursingReqVO extends BaseReq {
private
String
disabInfoId
;
private
String
modeId
;
private
String
modeName
;
private
String
modeId
;
private
String
srvOrganId
;
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/account/OverallCostListRespVO.java
View file @
ae1da1de
...
...
@@ -65,4 +65,6 @@ public class OverallCostListRespVO {
private
String
srvOrganName
;
private
String
accountsStatus
;
private
String
remarks
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/account/OverallCostReqVO.java
View file @
ae1da1de
...
...
@@ -32,4 +32,6 @@ public class OverallCostReqVO extends BaseReq {
private
Integer
dealType
;
private
Long
srvOrganId
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/assessment/ChAssessDetailAccountsResp.java
View file @
ae1da1de
...
...
@@ -37,6 +37,11 @@ public class ChAssessDetailAccountsResp implements Serializable {
*/
private
String
medicalArea
;
/**
* 评定资质
*/
private
String
aprempTypeS
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/disable/ChDisableApply.java
View file @
ae1da1de
...
...
@@ -628,6 +628,15 @@ public class ChDisableApply extends PageInfo implements Serializable {
private
Integer
exitFlag
;
/**
* 1, 死亡
* 2, "复评未通过" },//需要重新首次录入-->评估
* 3, 退保
* 4, 转入医保
* 5, 异地
* 6, 更换其他机构
* 7, 其他
**/
private
Integer
exitReasonId
;
private
Integer
exitSrvOrganId
;
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/disable/ChDisableExit.java
0 → 100644
View file @
ae1da1de
package
com
.
hungraim
.
ltc
.
pojo
.
entity
.
disable
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.KeySequence
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
/**
* @author zwl
* @ClassName ChDisableExit
* @description
* @date 2023/3/10 16:20
**/
@Data
@TableName
(
"CH_DISABLE_EXIT"
)
@KeySequence
(
value
=
"SEQ_CH_DISABLE_EXIT"
)
public
class
ChDisableExit
{
@TableId
(
value
=
"DISAB_EXIT_ID"
,
type
=
IdType
.
INPUT
)
private
Integer
disabExitId
;
private
Integer
disabInfoId
;
private
Integer
srvOrganId
;
private
Integer
exitReasonId
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
exitTime
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/disable/ChDisableInfo.java
View file @
ae1da1de
...
...
@@ -130,6 +130,15 @@ public class ChDisableInfo extends PageInfo implements Serializable {
private
String
tel
;
private
String
acptSrvArea
;
private
Integer
exitFlag
;
/**
* 1, 死亡
* 2, "复评未通过" },//需要重新首次录入-->评估
* 3, 退保
* 4, 转入医保
* 5, 异地
* 6, 更换其他机构
* 7, 其他
**/
private
Integer
exitReasonId
;
private
Integer
exitSrvOrganId
;
private
java
.
util
.
Date
exitTime
;
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/serviceManage/ChSrvSend.java
View file @
ae1da1de
...
...
@@ -93,7 +93,7 @@ public class ChSrvSend implements Serializable {
private
Long
lcu
;
/**
* 服务分配状态 未分配 0 已分配 1 已终止 2
* 服务分配状态 未分配 0 已分配 1 已终止 2
已退出 3
*/
private
Short
status
;
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/ReportUpdateVO.java
View file @
ae1da1de
...
...
@@ -22,6 +22,8 @@ public class ReportUpdateVO {
Integer
disableLevelId
;
String
polNo
;
String
remark
;
String
certiCode
;
String
applyId
;
Integer
evaluateType
;
List
<
ChFndAttach
>
fileDataList
;
List
<
ChAprReportFraction
>
chAprReportFractions
;
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/account/AssessAccountsExportResp.java
View file @
ae1da1de
...
...
@@ -24,6 +24,9 @@ public class AssessAccountsExportResp {
@Excel
(
name
=
"评定人员姓名"
,
width
=
20
)
private
String
empName
;
@Excel
(
name
=
"评定资质"
,
width
=
20
)
private
String
aprempTypeS
;
@Excel
(
name
=
"评估时间"
,
width
=
20
)
private
String
assessTime
;
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/account/SrvOrganListReq.java
View file @
ae1da1de
...
...
@@ -24,6 +24,8 @@ public class SrvOrganListReq extends BaseReq {
*/
private
Long
srvOrganId
;
private
String
modeId
;
/**
* 护理机构id
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/account/SrvTaskReqVO.java
View file @
ae1da1de
...
...
@@ -18,4 +18,6 @@ public class SrvTaskReqVO extends BaseReq {
private
String
status
;
private
String
srvOrganName
;
private
Long
srvOrganId
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/assessment/AprEmpExportVO.java
View file @
ae1da1de
...
...
@@ -41,9 +41,15 @@ public class AprEmpExportVO {
@Excel
(
name
=
"评定人员手机号码"
,
width
=
20
)
private
String
tel
;
@Excel
(
name
=
"人员类型"
,
width
=
20
)
private
String
empType
;
@Excel
(
name
=
"是否组长"
)
private
String
groupLeader
;
@Excel
(
name
=
"状态"
)
private
String
isLock
;
private
String
districtCity
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/assessment/AssessIdAndCostVO.java
View file @
ae1da1de
...
...
@@ -10,4 +10,6 @@ public class AssessIdAndCostVO {
private
Long
assessAccountsId
;
private
BigDecimal
assessAllCost
;
private
Integer
accountsStatus
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/assessment/ReportDetailVO.java
View file @
ae1da1de
...
...
@@ -15,7 +15,12 @@ public class ReportDetailVO {
Integer
person3
;
String
evaluateTime
;
Integer
disableLevelId
;
/**
* 现住址
*/
String
operAddress
;
String
applyId
;
String
certiCode
;
String
polNo
;
String
remark
;
Integer
evaluateType
;
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/assessment/TaskReportVO.java
View file @
ae1da1de
...
...
@@ -56,6 +56,7 @@ public class TaskReportVO {
private
String
adressDistrictProvincial
;
private
String
adressDistrictCity
;
private
String
adressDistrictCode
;
private
String
operAddress
;
//失能人员接受评定地址
private
String
acptProvincial
;
private
String
acptCity
;
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/disable/SrvOrganEmpExportVo.java
View file @
ae1da1de
...
...
@@ -15,8 +15,10 @@ public class SrvOrganEmpExportVo {
@Excel
(
name
=
"适用机构名称"
,
width
=
20
)
private
String
organName
;
/*
@Excel(name = "机构地址",width = 20)
private String provinCialcityArea;
*/
@Excel
(
name
=
"护理机构名称"
,
width
=
20
)
private
String
srvOrganName
;
...
...
@@ -24,8 +26,24 @@ public class SrvOrganEmpExportVo {
@Excel
(
name
=
"统一社会信用代码"
,
width
=
20
)
private
String
unifiedSocialCreditCode
;
@Excel
(
name
=
"联系人姓名"
,
width
=
20
)
private
String
linkName
;
@Excel
(
name
=
"护理人员姓名"
,
width
=
20
)
private
String
empName
;
@Excel
(
name
=
"护理人员性别"
)
private
String
gender
;
@Excel
(
name
=
"护理人员年龄"
)
private
String
age
;
@Excel
(
name
=
"护理人员证件号码"
,
width
=
20
)
private
String
certifNum
;
@Excel
(
name
=
"护理人员手机号码"
,
width
=
20
)
private
String
mobilePhone
;
/* @Excel(name = "联系人姓名",width = 20)
private String linkName;*/
@Excel
(
name
=
"联系人电话"
,
width
=
20
)
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/governance/ProgramSetAndProjectVo.java
View file @
ae1da1de
...
...
@@ -60,7 +60,7 @@ public class ProgramSetAndProjectVo {
/**
* 是否配置 (是:1;否:0)
*/
private
Short
isConf
=
1
;
private
Short
isConf
;
/**
* 计划频次
...
...
common/common-core/src/main/java/com/hungraim/ltc/util/CsoftSecurityUtil.java
View file @
ae1da1de
...
...
@@ -20,7 +20,9 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.TreeMap
;
import
java.util.concurrent.TimeUnit
;
import
javax.annotation.Resource
;
import
javax.crypto.BadPaddingException
;
import
javax.crypto.Cipher
;
import
javax.crypto.IllegalBlockSizeException
;
...
...
@@ -37,6 +39,7 @@ import org.apache.commons.codec.digest.DigestUtils;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.stereotype.Component
;
/**
* @Description: 中研通用加密工具 RSA+ASE+SHA256(非对称加密(对称秘钥),对称加密数据,Sha256消息摘要,RSA签名)
...
...
@@ -44,11 +47,15 @@ import com.alibaba.fastjson.JSONObject;
* @version 1.0
*/
@Slf4j
@Component
public
class
CsoftSecurityUtil
{
private
static
Map
<
Integer
,
String
>
keyMap
=
new
HashMap
<>();
// 用于封装随机产生的公钥与私钥
@Resource
private
RedisCache
redisCache
;
// 加密数据和秘钥的编码方式
public
static
final
String
UTF_8
=
"UTF-8"
;
...
...
@@ -304,7 +311,7 @@ public class CsoftSecurityUtil {
* 创建RSA的公钥和私钥示例 将生成的公钥和私钥用Base64编码后打印出来
* @throws NoSuchAlgorithmException
*/
public
static
Map
createKeyPairs
()
{
public
Map
createKeyPairs
()
{
try
{
KeyPairGenerator
keyPairGenerator
=
KeyPairGenerator
.
getInstance
(
"RSA"
);
keyPairGenerator
.
initialize
(
2048
);
...
...
@@ -315,6 +322,9 @@ public class CsoftSecurityUtil {
RSAPrivateKey
privateKey
=
(
RSAPrivateKey
)
keyPair
.
getPrivate
();
String
publicKeyString
=
new
String
(
Base64
.
encodeBase64
(
publicKey
.
getEncoded
()));
String
privateKeyString
=
new
String
(
Base64
.
encodeBase64
((
privateKey
.
getEncoded
())));
log
.
info
(
"公钥:{}"
,
publicKeyString
);
log
.
info
(
"私钥:{}"
,
privateKeyString
);
redisCache
.
setCacheObject
(
publicKeyString
,
privateKeyString
,
1
,
TimeUnit
.
DAYS
);
keyMap
.
put
(
0
,
publicKeyString
);
//0表示公钥
keyMap
.
put
(
1
,
privateKeyString
);
//1表示私钥
}
catch
(
NoSuchAlgorithmException
e
){
...
...
@@ -337,13 +347,13 @@ public class CsoftSecurityUtil {
* @throws IllegalBlockSizeException
* @throws BadPaddingException
*/
public
static
String
decryptRSADefault
(
String
data
)
throws
InvalidKeySpecException
,
NoSuchAlgorithmException
,
NoSuchPaddingException
,
InvalidKeyException
,
IllegalBlockSizeException
,
BadPaddingException
,
UnsupportedEncodingException
{
public
String
decryptRSADefault
(
String
data
,
String
publicKeyString
)
throws
InvalidKeySpecException
,
NoSuchAlgorithmException
,
NoSuchPaddingException
,
InvalidKeyException
,
IllegalBlockSizeException
,
BadPaddingException
,
UnsupportedEncodingException
{
KeyFactory
keyFactory
=
KeyFactory
.
getInstance
(
RSA_ALGORITHM_NOPADDING
);
byte
[]
privateKeyArray
=
keyMap
.
get
(
1
).
getBytes
();
String
privateKeyString
=
redisCache
.
getCacheObject
(
publicKeyString
);
byte
[]
privateKeyArray
=
privateKeyString
.
getBytes
();
byte
[]
dataArray
=
data
.
getBytes
();
PKCS8EncodedKeySpec
pkcs8EncodedKeySpec
=
new
PKCS8EncodedKeySpec
(
Base64
.
decodeBase64
(
privateKeyArray
));
PrivateKey
privateKey
=
keyFactory
.
generatePrivate
(
pkcs8EncodedKeySpec
);
Cipher
cipher
=
Cipher
.
getInstance
(
RSA_ALGORITHM_NOPADDING
);
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
privateKey
);
return
new
String
(
cipher
.
doFinal
(
Base64
.
decodeBase64
(
dataArray
)),
UTF_8
);
...
...
common/common-core/src/main/java/com/hungraim/ltc/util/DateUtils.java
View file @
ae1da1de
...
...
@@ -945,4 +945,25 @@ public class DateUtils {
return
dateString
;
}
/**
* 判断日期是不是今天
* @param date
* @return 是返回true,不是返回false
*/
public
static
boolean
isNow
(
Date
date
)
{
// 当前时间
Date
now
=
new
Date
();
SimpleDateFormat
sf
=
new
SimpleDateFormat
(
DATE_PATTERN_yyyy_MM_dd
);
//获取今天的日期
String
nowDay
=
sf
.
format
(
now
);
//对比的时间
String
day
=
sf
.
format
(
date
);
return
day
.
equals
(
nowDay
);
}
}
common/common-core/src/main/java/com/hungraim/ltc/util/RedisCache.java
0 → 100644
View file @
ae1da1de
package
com
.
hungraim
.
ltc
.
util
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.BoundSetOperations
;
import
org.springframework.data.redis.core.HashOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.ValueOperations
;
import
org.springframework.stereotype.Component
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
/**
* @author root
*/
@Component
public
class
RedisCache
{
@Autowired
public
RedisTemplate
redisTemplate
;
/**
* 缓存基本的对象,Integer、String、实体类等
*
* @param key 缓存的键值
* @param value 缓存的值
*/
public
<
T
>
void
setCacheObject
(
final
String
key
,
final
T
value
)
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
);
}
/**
* 缓存基本的对象,Integer、String、实体类等
*
* @param key 缓存的键值
* @param value 缓存的值
* @param timeout 时间
* @param timeUnit 时间颗粒度
*/
public
<
T
>
void
setCacheObject
(
final
String
key
,
final
T
value
,
final
Integer
timeout
,
final
TimeUnit
timeUnit
)
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
timeout
,
timeUnit
);
}
/**
* 设置有效时间
*
* @param key Redis键
* @param timeout 超时时间
* @return true=设置成功;false=设置失败
*/
public
boolean
expire
(
final
String
key
,
final
long
timeout
)
{
return
expire
(
key
,
timeout
,
TimeUnit
.
SECONDS
);
}
/**
* 设置有效时间
*
* @param key Redis键
* @param timeout 超时时间
* @param unit 时间单位
* @return true=设置成功;false=设置失败
*/
public
boolean
expire
(
final
String
key
,
final
long
timeout
,
final
TimeUnit
unit
)
{
return
redisTemplate
.
expire
(
key
,
timeout
,
unit
);
}
/**
* 获得缓存的基本对象。
*
* @param key 缓存键值
* @return 缓存键值对应的数据
*/
public
<
T
>
T
getCacheObject
(
final
String
key
)
{
ValueOperations
<
String
,
T
>
operation
=
redisTemplate
.
opsForValue
();
return
operation
.
get
(
key
);
}
/**
* 删除单个对象
*
* @param key
*/
public
boolean
deleteObject
(
final
String
key
)
{
return
redisTemplate
.
delete
(
key
);
}
/**
* 删除集合对象
*
* @param collection 多个对象
* @return
*/
public
long
deleteObject
(
final
Collection
collection
)
{
return
redisTemplate
.
delete
(
collection
);
}
/**
* 缓存List数据
*
* @param key 缓存的键值
* @param dataList 待缓存的List数据
* @return 缓存的对象
*/
public
<
T
>
long
setCacheList
(
final
String
key
,
final
List
<
T
>
dataList
)
{
Long
count
=
redisTemplate
.
opsForList
().
rightPushAll
(
key
,
dataList
);
return
count
==
null
?
0
:
count
;
}
/**
* 获得缓存的list对象
*
* @param key 缓存的键值
* @return 缓存键值对应的数据
*/
public
<
T
>
List
<
T
>
getCacheList
(
final
String
key
)
{
return
redisTemplate
.
opsForList
().
range
(
key
,
0
,
-
1
);
}
/**
* 缓存Set
*
* @param key 缓存键值
* @param dataSet 缓存的数据
* @return 缓存数据的对象
*/
public
<
T
>
BoundSetOperations
<
String
,
T
>
setCacheSet
(
final
String
key
,
final
Set
<
T
>
dataSet
)
{
BoundSetOperations
<
String
,
T
>
setOperation
=
redisTemplate
.
boundSetOps
(
key
);
Iterator
<
T
>
it
=
dataSet
.
iterator
();
while
(
it
.
hasNext
())
{
setOperation
.
add
(
it
.
next
());
}
return
setOperation
;
}
/**
* 获得缓存的set
*
* @param key
* @return
*/
public
<
T
>
Set
<
T
>
getCacheSet
(
final
String
key
)
{
return
redisTemplate
.
opsForSet
().
members
(
key
);
}
/**
* 缓存Map
*
* @param key
* @param dataMap
*/
public
<
T
>
void
setCacheMap
(
final
String
key
,
final
Map
<
String
,
T
>
dataMap
)
{
if
(
dataMap
!=
null
)
{
redisTemplate
.
opsForHash
().
putAll
(
key
,
dataMap
);
}
}
/**
* 获得缓存的Map
*
* @param key
* @return
*/
public
<
T
>
Map
<
String
,
T
>
getCacheMap
(
final
String
key
)
{
return
redisTemplate
.
opsForHash
().
entries
(
key
);
}
/**
* 往Hash中存入数据
*
* @param key Redis键
* @param hKey Hash键
* @param value 值
*/
public
<
T
>
void
setCacheMapValue
(
final
String
key
,
final
String
hKey
,
final
T
value
)
{
redisTemplate
.
opsForHash
().
put
(
key
,
hKey
,
value
);
}
/**
* 获取Hash中的数据
*
* @param key Redis键
* @param hKey Hash键
* @return Hash中的对象
*/
public
<
T
>
T
getCacheMapValue
(
final
String
key
,
final
String
hKey
)
{
HashOperations
<
String
,
String
,
T
>
opsForHash
=
redisTemplate
.
opsForHash
();
return
opsForHash
.
get
(
key
,
hKey
);
}
/**
* 删除Hash中的数据
*
* @param key
* @param hkey
*/
public
void
delCacheMapValue
(
final
String
key
,
final
String
hkey
)
{
HashOperations
hashOperations
=
redisTemplate
.
opsForHash
();
hashOperations
.
delete
(
key
,
hkey
);
}
/**
* 获取多个Hash中的数据
*
* @param key Redis键
* @param hKeys Hash键集合
* @return Hash对象集合
*/
public
<
T
>
List
<
T
>
getMultiCacheMapValue
(
final
String
key
,
final
Collection
<
Object
>
hKeys
)
{
return
redisTemplate
.
opsForHash
().
multiGet
(
key
,
hKeys
);
}
/**
* 获得缓存的基本对象列表
*
* @param pattern 字符串前缀
* @return 对象列表
*/
public
Collection
<
String
>
keys
(
final
String
pattern
)
{
return
redisTemplate
.
keys
(
pattern
);
}
}
common/common-redis/src/main/java/com/hungraim/ltc/redis/RedisLock.java
0 → 100644
View file @
ae1da1de
package
com
.
hungraim
.
ltc
.
redis
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.concurrent.TimeUnit
;
/**
* @author zwl
* @ClassName RedisLock
* @description
* @date 2023/3/19 22:04
**/
@Component
public
class
RedisLock
{
@Autowired
private
RedisTemplate
redisTemplate
;
/**
* 查询
*
* @param key 键
* @return 值
*/
public
Object
get
(
Object
key
)
{
return
redisTemplate
.
opsForValue
().
get
(
key
);
}
/**
* 保存
*
* @param key 键
* @param value 值
* @param expire 失效时长
* @param unit 失效时长的单位
*/
public
void
set
(
Object
key
,
Object
value
,
long
expire
,
TimeUnit
unit
)
{
if
(
expire
>
0
)
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
expire
,
unit
);
}
}
/**
* 线程等待
*
* @param millis
*/
private
void
sleep
(
long
millis
)
{
try
{
Thread
.
sleep
(
millis
);
}
catch
(
InterruptedException
e
)
{
// do nothing
}
}
/**
* 尝试加锁
*
* @param key
* @param expireMilliseconds 锁超时时长,单位:毫秒
* @param retryTimes 重试次数,每秒重试 1 次
* @return
*/
public
boolean
tryLock
(
Object
key
,
long
expireMilliseconds
,
long
retryTimes
)
{
for
(
long
i
=
1
;
i
<=
retryTimes
;
i
++)
{
if
(
tryLock
(
key
,
expireMilliseconds
))
{
return
true
;
}
else
if
(
i
!=
retryTimes
)
{
sleep
(
1000
);
}
}
return
false
;
}
/**
* 尝试加锁
*
* @param key
* @param expireMilliseconds 锁超时时长,单位:毫秒
* @return
*/
public
boolean
tryLock
(
Object
key
,
long
expireMilliseconds
)
{
String
expireAt
=
String
.
valueOf
(
System
.
currentTimeMillis
()
+
expireMilliseconds
+
1
);
Boolean
acquire
=
redisTemplate
.
opsForValue
().
setIfAbsent
(
key
,
expireAt
,
expireMilliseconds
,
TimeUnit
.
MILLISECONDS
);
if
(
acquire
!=
null
)
{
return
acquire
;
}
else
{
return
false
;
}
}
/**
* 删除锁
*
* @param key
* @return
*/
public
boolean
delLock
(
Object
key
)
{
return
redisTemplate
.
delete
(
key
);
}
/**
* 删除缓存
*
* @param key
* @return
*/
public
boolean
delete
(
Object
key
)
{
return
redisTemplate
.
delete
(
key
);
}
}
governance/src/main/java/com/hungraim/ltc/governance/controller/AprOrganController.java
View file @
ae1da1de
...
...
@@ -125,7 +125,8 @@ public class AprOrganController {
if
(
chAprOrgan
.
getOrganTypeId
()
==
null
)
{
//机构类型id
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
if
(
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptProvincial
())
||
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptCity
())
||
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptArea
())
||
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptAddress
())
||
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptStreet
()))
{
//机构详细地址
//|| StringUtils.isBlank(chAprOrgan.getAcptStreet())
if
(
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptProvincial
())
||
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptCity
())
||
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptArea
())
||
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptAddress
())
)
{
//机构详细地址
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
if
(
StringUtils
.
isBlank
(
chAprOrgan
.
getLinkName
()))
{
//机构联系人姓名
...
...
@@ -178,7 +179,8 @@ public class AprOrganController {
if
(
chAprOrgan
.
getOrganTypeId
()
==
null
)
{
//机构类型id
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
if
(
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptArea
())
||
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptAddress
())
||
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptStreet
()))
{
//机构详细地址
//|| StringUtils.isBlank(chAprOrgan.getAcptStreet())
if
(
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptArea
())
||
StringUtils
.
isBlank
(
chAprOrgan
.
getAcptAddress
())
)
{
//机构详细地址
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
if
(
StringUtils
.
isBlank
(
chAprOrgan
.
getLinkName
()))
{
//机构联系人姓名
...
...
governance/src/main/java/com/hungraim/ltc/governance/controller/BuildBedController.java
View file @
ae1da1de
package
com
.
hungraim
.
ltc
.
governance
.
controller
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.governance.dao.ChSrvSendMapper
;
import
com.hungraim.ltc.governance.service.*
;
import
com.hungraim.ltc.pojo.entity.account.ChPunchDetailsVO
;
import
com.hungraim.ltc.pojo.entity.disable.ChDisableInfo
;
...
...
@@ -45,6 +47,9 @@ public class BuildBedController {
@Autowired
private
IRemoveBedService
removeBedService
;
@Autowired
private
ChSrvSendMapper
chSrvSendMapper
;
/**
* 建床管理列表
...
...
@@ -209,7 +214,9 @@ public class BuildBedController {
if
(
StrUtil
.
isBlankIfStr
(
disableInfoVo
.
getDisableInfoId
()))
{
return
Result
.
failed
(
"失能人员id不能为空"
);
}
Page
<
DisableInfoVo
>
disableInfoVos
=
disableInfoServie
.
querySrvYet
(
disableInfoVo
.
getDisableInfoId
(),
disableInfoVo
.
getCurrent
(),
disableInfoVo
.
getLimit
());
Integer
status
=
disableInfoVo
.
getStatus
();
Integer
sendId
=
disableInfoVo
.
getSrvSendId
();
Page
<
DisableInfoVo
>
disableInfoVos
=
disableInfoServie
.
querySrvYet
(
disableInfoVo
.
getDisableInfoId
(),
disableInfoVo
.
getCurrent
(),
disableInfoVo
.
getLimit
(),
status
,
sendId
);
long
total
=
disableInfoVos
.
getTotal
();
List
<
DisableInfoVo
>
records
=
disableInfoVos
.
getRecords
();
Map
map
=
new
HashMap
<>();
...
...
@@ -232,6 +239,13 @@ public class BuildBedController {
if
(
chSrvSend
.
getDisabInfoId
()
==
null
||
chSrvSend
.
getSrvOrganId
()
==
null
||
chSrvSend
.
getSrvModeId
()
==
null
)
{
return
Result
.
failed
(
"参数不全!"
);
}
List
<
ChSrvSend
>
chSrvSendsList
=
chSrvSendMapper
.
selectList
(
new
LambdaQueryWrapper
<
ChSrvSend
>()
.
eq
(
ChSrvSend:
:
getDisabInfoId
,
disabInfoId
)
.
eq
(
ChSrvSend:
:
getStatus
,
(
short
)
1
));
if
(
chSrvSendsList
.
size
()
>
0
)
{
return
Result
.
failed
(
"已分配护理机构,请先终止或退出再操作"
);
}
chSrvSend
.
setAllotTime
(
new
Date
());
chSrvSend
.
setStatus
(
Short
.
valueOf
(
"1"
));
if
(
chrSrvVo
.
getSrvSendId
()
==
null
)
{
...
...
@@ -240,6 +254,8 @@ public class BuildBedController {
id
=
0L
;
}
chSrvSend
.
setSrvSendId
(++
id
);
}
else
{
chSrvSend
.
setSrvSendId
(
chrSrvVo
.
getSrvSendId
());
}
sendService
.
saveOrUpdate
(
chSrvSend
);
}
...
...
@@ -260,6 +276,7 @@ public class BuildBedController {
return
Result
.
failed
(
"提交失败,服务分配记录不存在"
);
}
chSrvSend
.
setStopTime
(
saveStopTime
.
getStopTime
());
chSrvSend
.
setStatus
((
short
)
2
);
sendService
.
updateById
(
chSrvSend
);
return
Result
.
success
(
true
);
}
...
...
governance/src/main/java/com/hungraim/ltc/governance/controller/SrvProgramController.java
View file @
ae1da1de
...
...
@@ -16,7 +16,11 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.TreeSet
;
import
java.util.stream.Collectors
;
@RestController
@RequestMapping
(
"/api.governance/srvProgram"
)
...
...
@@ -71,7 +75,7 @@ public class SrvProgramController {
* @return 返回个人照护方案列表
*/
@RequestMapping
(
"/programSetList"
)
public
Result
getProgramSetList
(
Integer
pageNum
,
Integer
pageSize
,
Long
disabInfoId
,
Long
srvOrganId
)
{
public
Result
getProgramSetList
(
Integer
pageNum
,
Integer
pageSize
,
Long
disabInfoId
,
Long
srvOrganId
,
String
status
)
{
if
(
pageNum
==
null
||
pageNum
<
1
||
disabInfoId
==
null
||
disabInfoId
==
0
||
srvOrganId
==
null
||
srvOrganId
==
0
)
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
...
...
@@ -79,7 +83,11 @@ public class SrvProgramController {
pageSize
=
10
;
}
Page
<
ProgramListVo
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
page
=
srvProgramService
.
getProgramSetList
(
page
,
disabInfoId
,
srvOrganId
,
null
);
page
=
srvProgramService
.
getProgramSetList
(
page
,
disabInfoId
,
srvOrganId
,
status
);
List
<
ProgramListVo
>
records
=
page
.
getRecords
();
records
=
records
.
stream
().
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparingLong
(
ProgramListVo:
:
getProgramId
))),
ArrayList:
:
new
));
page
.
setRecords
(
records
);
return
Result
.
success
(
page
);
}
...
...
@@ -144,7 +152,7 @@ public class SrvProgramController {
}
else
{
List
<
ProgramSetAndProjectVo
>
programSetAndProjectVos
=
programDetailVo
.
getProgramSetAndProjectVos
();
for
(
ProgramSetAndProjectVo
programSetAndProjectVo
:
programSetAndProjectVos
)
{
if
(
programSetAndProjectVo
.
getIsConf
().
intValue
()
==
1
&&
programSetAndProjectVo
.
getPlanningFrequency
()
==
null
)
{
if
(
programSetAndProjectVo
.
getIsConf
().
intValue
()
==
1
&&
programSetAndProjectVo
.
getPlanningFrequency
()
==
null
&&
programSetAndProjectVo
.
getPlanningFrequencyType
()!=
2
)
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
}
...
...
governance/src/main/java/com/hungraim/ltc/governance/controller/SrvTaskController.java
View file @
ae1da1de
...
...
@@ -2,8 +2,6 @@ package com.hungraim.ltc.governance.controller;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.governance.service.SrvTaskService
;
import
com.hungraim.ltc.pojo.vo.account.SrvTaskReqVO
;
import
com.hungraim.ltc.pojo.vo.account.SrvTaskRespVO
;
import
com.hungraim.ltc.pojo.vo.governance.*
;
import
com.hungraim.ltc.util.Result
;
import
com.hungraim.ltc.util.ResultCode
;
...
...
@@ -11,7 +9,6 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
...
...
@@ -149,8 +146,12 @@ public class SrvTaskController {
* 根据计划开始时间每天执行当天计划
**/
@GetMapping
(
"timeAllocationSrvTask"
)
public
void
timeAllocationSrvTask
()
{
srvTaskService
.
timeAllocationSrvTask
();
public
Result
timeAllocationSrvTask
(
String
dateStr
)
{
if
(
StringUtils
.
isEmpty
(
dateStr
))
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
srvTaskService
.
timeAllocationSrvTask
(
dateStr
);
return
Result
.
success
();
}
}
governance/src/main/java/com/hungraim/ltc/governance/controller/SrvTaskScheduledController.java
0 → 100644
View file @
ae1da1de
package
com
.
hungraim
.
ltc
.
governance
.
controller
;
import
com.hungraim.ltc.governance.service.SrvTaskService
;
import
com.hungraim.ltc.redis.RedisLock
;
import
com.hungraim.ltc.util.DateUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
/**
* @author zwl
* @ClassName SrvTaskScheduledController
* @description
* @date 2023/3/9 21:08
**/
@Component
@EnableAsync
@Slf4j
public
class
SrvTaskScheduledController
{
@Autowired
private
SrvTaskService
srvTaskService
;
@Autowired
private
RedisLock
redisLock
;
public
static
final
String
JOB_KEY
=
"redis.job.task:srvTask"
;
@Scheduled
(
cron
=
"0 35 23 * * ?"
)
public
void
timeAllocationSrvTask
()
{
boolean
flag
=
redisLock
.
tryLock
(
JOB_KEY
,
1000
*
30
);
if
(
flag
){
String
nextDay
=
DateUtils
.
getNextDay
();
log
.
info
(
"timeAllocationSrvTask========start:{}"
,
nextDay
);
srvTaskService
.
timeAllocationSrvTask
(
nextDay
);
log
.
info
(
"timeAllocationSrvTask========end:{}"
);
}
}
}
governance/src/main/java/com/hungraim/ltc/governance/dao/ChSrvProgramMapper.java
View file @
ae1da1de
...
...
@@ -10,6 +10,8 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Mapper
@Repository
public
interface
ChSrvProgramMapper
extends
BaseMapper
<
ChSrvProgram
>
{
...
...
@@ -42,4 +44,7 @@ public interface ChSrvProgramMapper extends BaseMapper<ChSrvProgram> {
*/
ProgramDetailVo
getProgramDetailWithAdd
(
@Param
(
"disabInfoId"
)
Long
disabInfoId
,
@Param
(
"srvOrganId"
)
Long
srvOrganId
);
List
<
ChSrvProgram
>
getProgramEndProgram
();
}
\ No newline at end of file
governance/src/main/java/com/hungraim/ltc/governance/dao/ChSrvSendMapper.java
View file @
ae1da1de
...
...
@@ -23,4 +23,5 @@ public interface ChSrvSendMapper extends BaseMapper<ChSrvSend> {
*/
Page
<
SvrSendListVo
>
selectSrvSendList
(
Page
<
SvrSendListVo
>
page
,
@Param
(
"srvOrganId"
)
Long
srvOrganId
,
@Param
(
"realName"
)
String
realName
,
@Param
(
"realTel"
)
String
realTel
,
@Param
(
"programStatus"
)
String
programStatus
);
int
updateSrvSendInfo
(
Long
disabInfoId
);
}
\ No newline at end of file
governance/src/main/java/com/hungraim/ltc/governance/dao/DisableInfoMapper.java
View file @
ae1da1de
...
...
@@ -12,7 +12,7 @@ import org.apache.ibatis.annotations.Select;
public
interface
DisableInfoMapper
extends
BaseMapper
<
ChDisableInfo
>
{
@Select
(
"select s.real_name,"
+
@Select
(
"
<script>
select s.real_name,"
+
"i.SRV_SEND_ID,"
+
" j.acpt_provincial,"
+
" j.acpt_city,"
+
...
...
@@ -38,6 +38,13 @@ public interface DisableInfoMapper extends BaseMapper<ChDisableInfo> {
" on s.disab_info_id = i.disab_info_id"
+
" left join ch_srv_organ j"
+
" on i.SRV_ORGAN_ID = j.SRV_ORGAN_ID"
+
" where i.disab_info_id=#{disableInfoId}"
)
Page
<
DisableInfoVo
>
querySrvYet
(
Page
page
,
Integer
disableInfoId
);
" where i.disab_info_id=#{disableInfoId} "
+
" <if test='status!=null and status !=\"\" '>"
+
" and i.status =#{status} "
+
" </if>"
+
" <if test='sendId!=null and sendId !=\"\" '>"
+
" and i.srv_send_id =#{sendId} "
+
" </if>"
+
" </script>"
)
Page
<
DisableInfoVo
>
querySrvYet
(
Page
page
,
Integer
disableInfoId
,
Integer
status
,
Integer
sendId
);
}
governance/src/main/java/com/hungraim/ltc/governance/dao/SrvSendMapper.java
View file @
ae1da1de
...
...
@@ -31,6 +31,7 @@ public interface SrvSendMapper extends BaseMapper<ChSrvSend> {
Page
<
SrvSendVO
>
selectSendList
(
Page
<
SrvSendVO
>
page
,
@Param
(
"disableInfo"
)
ChDisableInfo
disableInfo
,
@Param
(
"chSrvOrgan"
)
ChSrvOrgan
chSrvOrgan
,
@Param
(
"chSrvSend"
)
ChSrvSend
chSrvSend
);
@Select
(
"select permit_id from ch_srv_organ where srv_organ_id=#{organId} "
)
String
selectByOrganId
(
Integer
organId
);
...
...
@@ -51,8 +52,8 @@ public interface SrvSendMapper extends BaseMapper<ChSrvSend> {
" left join ch_apr_report o"
+
" on i.task_id = o.task_id left join CH_CFG_SRV_DISABLE_LEVEL l on l.disable_level_id = o.disable_level_id "
+
" left join ch_disable_apply a on a.apply_id = s.apply_id "
+
" where s.disab_info_id=#{disableInfoId}"
)
DisableInfoTaskVO
selectBydisableInfoId
(
Integer
disableInfoId
);
" where s.disab_info_id=#{disableInfoId}
order by o.fcd desc
"
)
List
<
DisableInfoTaskVO
>
selectBydisableInfoId
(
Integer
disableInfoId
);
@Select
(
"select s.real_name,"
+
" s.certi_code,"
+
...
...
governance/src/main/java/com/hungraim/ltc/governance/service/DisableInfoServie.java
View file @
ae1da1de
...
...
@@ -10,7 +10,7 @@ import com.hungraim.ltc.pojo.vo.governance.DisableInfoVo;
public
interface
DisableInfoServie
extends
IService
<
ChDisableInfo
>
{
Page
<
DisableInfoVo
>
querySrvYet
(
Integer
disableInfoId
,
int
current
,
int
limit
);
Page
<
DisableInfoVo
>
querySrvYet
(
Integer
disableInfoId
,
int
current
,
int
limit
,
Integer
status
,
Integer
sendId
);
...
...
governance/src/main/java/com/hungraim/ltc/governance/service/SrvTaskScheduledServiceImpl.java
deleted
100644 → 0
View file @
821ce0f6
package
com
.
hungraim
.
ltc
.
governance
.
service
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
/**
* @author zwl
* @ClassName SrvTaskScheduledServiceImpl
* @description
* @date 2023/3/2 14:37
**/
@Service
@Slf4j
public
class
SrvTaskScheduledServiceImpl
{
@Autowired
private
SrvTaskService
srvTaskService
;
@Scheduled
(
cron
=
"30 30 23 * * ?"
)
public
void
timeAllocationSrvTask
()
{
log
.
info
(
"timeAllocationSrvTask========start"
);
srvTaskService
.
timeAllocationSrvTask
();
log
.
info
(
"timeAllocationSrvTask========end:{}"
);
}
}
governance/src/main/java/com/hungraim/ltc/governance/service/SrvTaskService.java
View file @
ae1da1de
...
...
@@ -33,6 +33,6 @@ public interface SrvTaskService {
void
addOrUpdateSrvTask
(
SrvTaskInfoListVO
param
);
void
timeAllocationSrvTask
();
void
timeAllocationSrvTask
(
String
dateStr
);
}
governance/src/main/java/com/hungraim/ltc/governance/service/impl/DisableInfoServieImpl.java
View file @
ae1da1de
...
...
@@ -15,8 +15,8 @@ public class DisableInfoServieImpl extends ServiceImpl<DisableInfoMapper, ChDisa
@Override
public
Page
<
DisableInfoVo
>
querySrvYet
(
Integer
disableInfoId
,
int
current
,
int
limit
)
{
public
Page
<
DisableInfoVo
>
querySrvYet
(
Integer
disableInfoId
,
int
current
,
int
limit
,
Integer
status
,
Integer
sendId
)
{
Page
<
SrvSendVO
>
page
=
new
Page
<>(
current
,
limit
);
return
this
.
baseMapper
.
querySrvYet
(
page
,
disableInfoId
);
return
this
.
baseMapper
.
querySrvYet
(
page
,
disableInfoId
,
status
,
sendId
);
}
}
governance/src/main/java/com/hungraim/ltc/governance/service/impl/SrvSendServiceImpl.java
View file @
ae1da1de
...
...
@@ -41,7 +41,12 @@ public class SrvSendServiceImpl extends ServiceImpl<SrvSendMapper, ChSrvSend> im
@Override
public
DisableInfoTaskVO
selectTaskById
(
Integer
disableInfoId
,
Integer
srvOrganId
)
{
DisableInfoTaskVO
disableInfoTaskVO
=
sendMapper
.
selectBydisableInfoId
(
disableInfoId
);
List
<
DisableInfoTaskVO
>
disableInfoTaskList
=
sendMapper
.
selectBydisableInfoId
(
disableInfoId
);
DisableInfoTaskVO
disableInfoTaskVO
=
null
;
if
(
disableInfoTaskList
.
size
()
>
0
){
disableInfoTaskVO
=
disableInfoTaskList
.
get
(
0
);
}
if
(
srvOrganId
!=
null
)
{
String
s
=
sendMapper
.
selectByOrganId
(
srvOrganId
);
disableInfoTaskVO
.
setPermitId
(
s
);
...
...
governance/src/main/java/com/hungraim/ltc/governance/service/impl/SrvTaskServiceImpl.java
View file @
ae1da1de
package
com
.
hungraim
.
ltc
.
governance
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -7,12 +8,13 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.api.AccountFeignService
;
import
com.hungraim.ltc.api.AttachFeignService
;
import
com.hungraim.ltc.governance.dao.ChSrvPlanMapper
;
import
com.hungraim.ltc.governance.dao.ChSrvTaskDetailMapper
;
import
com.hungraim.ltc.governance.dao.SrvTaskMapper
;
import
com.hungraim.ltc.governance.dao.*
;
import
com.hungraim.ltc.governance.service.SrvSendService
;
import
com.hungraim.ltc.governance.service.SrvTaskService
;
import
com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach
;
import
com.hungraim.ltc.pojo.entity.governance.ChSrvPlan
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvSend
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTask
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail
;
import
com.hungraim.ltc.pojo.vo.governance.*
;
...
...
@@ -40,8 +42,9 @@ public class SrvTaskServiceImpl implements SrvTaskService {
private
final
AttachFeignService
attachFeignService
;
private
final
ChSrvPlanMapper
chSrvPlanMapper
;
private
final
AccountFeignService
accountFeignService
;
private
final
ChSrvProgramMapper
chSrvProgramMapper
;
private
final
ChSrvSendMapper
chSrvSendMapper
;
private
final
SrvSendService
sendService
;
/**
* 服务计划制定列表
...
...
@@ -204,29 +207,46 @@ public class SrvTaskServiceImpl implements SrvTaskService {
return
srvTaskMapper
.
getSrvOrganEmpList
(
page
,
organId
,
name
,
certiType
,
certifNum
);
}
@Override
public
void
timeAllocationSrvTask
()
{
public
void
timeAllocationSrvTask
(
String
dateStr
)
{
List
<
ChSrvProgram
>
programEndProgram
=
chSrvProgramMapper
.
getProgramEndProgram
();
if
(
CollectionUtil
.
isNotEmpty
(
programEndProgram
))
{
for
(
ChSrvProgram
chSrvProgram
:
programEndProgram
)
{
chSrvProgram
.
setProgramId
(
chSrvProgram
.
getProgramId
());
chSrvProgram
.
setEndReason
(
"方案时间已到期,自动终止"
);
chSrvProgram
.
setProgStatus
(
2
);
chSrvProgramMapper
.
updateById
(
chSrvProgram
);
Long
disabInfoId
=
chSrvProgram
.
getDisabInfoId
();
ChSrvSend
chSrvSend
=
new
ChSrvSend
();
// chSrvSend.setStatus((short)2);
// chSrvSend.setEndTime(new Date());
chSrvSend
.
setDisabInfoId
(
disabInfoId
);
chSrvSendMapper
.
updateSrvSendInfo
(
disabInfoId
);
}
}
// 查询需要执行的计划
List
<
AllocationSrvTaskVO
>
chSrvTasks
=
srvTaskMapper
.
getAllocationSrvTask
();
// 生成计划任务 CH_SRV_TASK_DETAIL
for
(
AllocationSrvTaskVO
chSrvTask
:
chSrvTasks
)
{
Long
srvTaskId
=
chSrvTask
.
getSrvTaskId
();
String
nextDay
=
DateUtils
.
getNextDay
();
// 根据任务id和服务时间查询是否已经生成过计划,已经生成了就不需要再生成了,已退出
int
chSrvTaskDetailCount
=
chSrvTaskDetailMapper
.
getSrvTaskDetail
(
String
.
valueOf
(
srvTaskId
),
nextDay
);
.
getSrvTaskDetail
(
String
.
valueOf
(
srvTaskId
),
dateStr
);
if
(
chSrvTaskDetailCount
>
0
)
{
log
.
info
(
"{},已经有计划任务了"
,
nextDay
);
return
;
log
.
info
(
"{},已经有计划任务了"
,
dateStr
);
continue
;
}
ChSrvTaskDetail
chSrvTaskDetail
=
new
ChSrvTaskDetail
();
chSrvTaskDetail
.
setSrvTaskId
(
srvTaskId
);
//taskId
chSrvTaskDetail
.
setSrvDate
(
DateUtils
.
strToDate
(
nextDay
));
//服务开始时间
chSrvTaskDetail
.
setSrvDate
(
DateUtils
.
strToDate
(
dateStr
));
//服务开始时间
chSrvTaskDetail
.
setStatus
((
short
)
0
);
//状态 未执行:0;执行中:1;已执行:2;已失效:3已完成4
chSrvTaskDetailMapper
.
insert
(
chSrvTaskDetail
);
// ch_srv_plan
String
programId
=
chSrvTask
.
getProgramId
();
saveSrvPlan
(
programId
,
nextDay
);
saveSrvPlan
(
programId
,
dateStr
);
}
}
...
...
governance/src/main/resources/com/hungraim/ltc/governance/mapper/ChSrvOrganProjectMapper.xml
View file @
ae1da1de
...
...
@@ -52,14 +52,18 @@
CATEGORY_TYPE,
CH_SRV_ORGAN_PROJECT.ITEM_TIMES,
ITEM_TIMES_TYPE,
CH_SRV_ORGAN_PROJECT.ITEM_PRICE,
CH_SRV_ORGAN_PROJECT.IS_CONF IS_NEED
CH_SRV_ORGAN_PROJECT.ITEM_PRICE
<if
test=
"programId == null"
>
,CH_SRV_ORGAN_PROJECT.IS_CONF IS_CONF
</if>
<if
test=
"programId != null"
>
,
SET_ID,
PLANNING_FREQUENCY,
PLANNING_FREQUENCY_TYPE,
CH_SRV_PROGRAM_SET.REMARK
CH_SRV_PROGRAM_SET.REMARK,
NVL(CH_SRV_PROGRAM_SET.IS_CONF, '0') IS_CONF
</if>
FROM CH_SRV_ORGAN_PROJECT
<if
test=
"programId != null"
>
...
...
governance/src/main/resources/com/hungraim/ltc/governance/mapper/ChSrvProgramMapper.xml
View file @
ae1da1de
...
...
@@ -68,7 +68,7 @@
LEFT JOIN CH_CFG_SRV_DISABLE_LEVEL T6 ON T3.DISABLE_LEVEL_ID = T6.DISABLE_LEVEL_ID
LEFT JOIN CH_APR_TASK T4 ON T3.TASK_ID = T4.TASK_ID
LEFT JOIN CH_SRV_ORGAN T5 ON T1.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
WHERE T1.PROGRAM_ID = #{programId}
WHERE T1.PROGRAM_ID = #{programId}
and rownum =1
</select>
<select
id=
"getProgramDetailWithAdd"
resultMap=
"ProgramSetDetailVoMap"
>
SELECT NULL PROGRAM_ID,
...
...
@@ -106,6 +106,7 @@
LEFT JOIN CH_SRV_ORGAN T5 ON T1.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
WHERE T1.DISAB_INFO_ID = #{disabInfoId}
AND T1.SRV_ORGAN_ID = #{srvOrganId}
AND ROWNUM = 1
</select>
<select
id=
"getProgramList"
resultType=
"com.hungraim.ltc.pojo.vo.governance.ProgramListVo"
>
...
...
@@ -127,7 +128,9 @@
T4.FINISH_TIME assessDate,
T7.MODE_NAME svrModelName,
T5.SRV_ORGAN_NAME svrOrganName,
T1.PROG_STATUS progStatus,
<if
test=
"programStatus != null and programStatus != ''"
>
#{programStatus} progStatus,
</if>
T1.EFF_TIME effTime
FROM CH_SRV_PROGRAM T1
INNER JOIN CH_DISABLE_INFO T2 ON T1.DISAB_INFO_ID = T2.DISAB_INFO_ID
...
...
@@ -138,8 +141,14 @@
LEFT JOIN CH_SRV_ORGAN T5 ON T1.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
WHERE T1.DISAB_INFO_ID = #{disabInfoId}
AND T1.SRV_ORGAN_ID = #{srvOrganId}
<!--
<if test="programStatus != null and programStatus != ''">
T1.PROG_STATUS = #{programStatus}
</if>
AND
T1.PROG_STATUS = #{programStatus}
</if>
-->
</select>
<select
id=
"getProgramEndProgram"
resultType=
"com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram"
>
select * from CH_SRV_PROGRAM g where
<![CDATA[ sysdate > g.PROGRAM_EDN_DATE and PROG_STATUS <> 2 ]]>
</select>
</mapper>
\ No newline at end of file
governance/src/main/resources/com/hungraim/ltc/governance/mapper/ChSrvSendMapper.xml
View file @
ae1da1de
...
...
@@ -68,4 +68,10 @@
</where>
ORDER BY T1.EFF_TIME DESC
</select>
<update
id=
"updateSrvSendInfo"
>
update CH_SRV_SEND p set p.status = '2',p.end_time = sysdate where
p.DISAB_INFO_ID = #{disabInfoId}
</update>
</mapper>
\ No newline at end of file
governance/src/main/resources/com/hungraim/ltc/governance/mapper/SrvSend.xml
View file @
ae1da1de
...
...
@@ -22,7 +22,7 @@
<!--查询服务分配信息列表-->
<select
id=
"selectSendList"
resultMap=
"sendresultMap"
>
SELECT
s.srv_send_id,
distinct
s.srv_send_id,
i.disab_info_id,
o.organ_id,
o.ORGAN_NAME,
...
...
@@ -41,15 +41,16 @@
ch_disable_info i
LEFT JOIN ch_srv_send s ON s.disab_info_id = i.disab_info_id
LEFT JOIN ch_fnd_organ o ON i.organ_id = o.organ_id
LEFT JOIN
CH_APR_TASK
t ON i.disab_info_id = t.DISABLE_INFO_ID
left join ch_apr_report report on t.task_id = report.task_id
LEFT JOIN
(select * from CH_APR_TASK where APR_TYPE
<![CDATA[ <>]]>
2)
t ON i.disab_info_id = t.DISABLE_INFO_ID
--
left join ch_apr_report report on t.task_id = report.task_id
<where>
t.TASK_STATUS = 3 and report.DISABLE_LEVEL_ID in ('3','4','5')
and sysdate
<![CDATA[ > ]]>
report.PUBLICITY_END_TIME
t.TASK_STATUS = 3 --and report.DISABLE_LEVEL_ID in ('3','4','5')
--and sysdate
<![CDATA[ > ]]>
report.PUBLICITY_END_TIME
and t.task_id in (select distinct TASK_ID from CH_APR_REPORT report where report.DISABLE_LEVEL_ID in ('3','4','5')
and sysdate
<![CDATA[ > ]]>
report.PUBLICITY_END_TIME)
<if
test=
"chSrvOrgan.organId != null and chSrvOrgan.organId != ''"
>
AND o.organ_id = #{chSrvOrgan.organId}
</if>
<if
test=
"disableInfo.realName != null and disableInfo.realName != ''"
>
AND i.real_name LIKE CONCAT(CONCAT('%',#{disableInfo.realName}),'%')
</if>
...
...
governance/src/main/resources/com/hungraim/ltc/governance/mapper/SrvTaskMapper.xml
View file @
ae1da1de
...
...
@@ -220,9 +220,11 @@
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_report report on aprtask.task_id = report.task_id--评定报告
where t.SRV_DATE
<![CDATA[ < ]]>
sysdate and
(info.EXIT_TIME
<![CDATA[ > ]]>
sysdate or info.EXIT_TIME is null)
and sysdate
<![CDATA[ > ]]>
report.PUBLICITY_END_TIME
left join CH_SRV_PROGRAM program on program.DISAB_INFO_ID = info.DISAB_INFO_ID
where
<![CDATA[ t.SRV_DATE < sysdate and
(info.EXIT_TIME >
sysdate or info.EXIT_TIME is null)
and sysdate
< program.PROGRAM_EDN_DATE
and
sysdate
>
report.PUBLICITY_END_TIME and program.PROG_STATUS
<
>'2' and t.STATUS
<
>'2' ]]>
</select>
</mapper>
\ No newline at end of file
system/system-admin-service/src/main/java/com/hungraim/ltc/system/service/SrvTaskScheduledService.java
deleted
100644 → 0
View file @
821ce0f6
package
com
.
hungraim
.
ltc
.
system
.
service
;
public
interface
SrvTaskScheduledService
{
void
timeAllocationSrvTask
();
}
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