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
7a705b27
Commit
7a705b27
authored
Feb 28, 2023
by
zhangwanglin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_nursing_records_20230214' into dev_ch_master
parents
4bcf4c27
0b8de90a
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
274 additions
and
29 deletions
+274
-29
AccountController.java
...om/hungraim/ltc/account/controller/AccountController.java
+6
-4
ChDisabFreeRdInfoMapper.java
...com/hungraim/ltc/account/dao/ChDisabFreeRdInfoMapper.java
+23
-0
AccountService.java
...java/com/hungraim/ltc/account/service/AccountService.java
+3
-1
AccountServiceImpl.java
...hungraim/ltc/account/service/impl/AccountServiceImpl.java
+52
-10
ChDisabFreeRdInfoMapper.xml
...ice/src/main/resources/mapper/ChDisabFreeRdInfoMapper.xml
+49
-0
DisableController.java
...n/java/com/hungraim/ltc/controller/DisableController.java
+5
-1
ChDisabFreeRdInfo.java
...m/hungraim/ltc/pojo/entity/account/ChDisabFreeRdInfo.java
+43
-0
OverallCostListRespVO.java
...ngraim/ltc/pojo/entity/account/OverallCostListRespVO.java
+4
-0
DateUtils.java
...n-core/src/main/java/com/hungraim/ltc/util/DateUtils.java
+14
-0
SrvTaskFeignService.java
...c/main/java/com/hungraim/ltc/api/SrvTaskFeignService.java
+19
-0
SrvTaskController.java
...hungraim/ltc/governance/controller/SrvTaskController.java
+1
-0
SrvTaskServiceImpl.java
...graim/ltc/governance/service/impl/SrvTaskServiceImpl.java
+8
-9
ChSrvTaskDetailMapper.xml
.../hungraim/ltc/governance/mapper/ChSrvTaskDetailMapper.xml
+4
-2
SrvTaskMapper.xml
...rces/com/hungraim/ltc/governance/mapper/SrvTaskMapper.xml
+4
-2
pom.xml
system/system-admin-service/pom.xml
+6
-0
SrvTaskScheduledController.java
...raim/ltc/system/Scheduled/SrvTaskScheduledController.java
+30
-0
bootstrap.yml
system/system-admin-service/src/main/resources/bootstrap.yml
+3
-0
No files found.
account/account-service/src/main/java/com/hungraim/ltc/account/controller/AccountController.java
View file @
7a705b27
...
...
@@ -202,7 +202,8 @@ public class AccountController {
*/
@GetMapping
(
"/queryAccountsDeclareList"
)
public
Result
<
Page
<
ChDisabDetailAccountsResp
>>
queryAccountsDeclareList
(
Integer
pageNum
,
Integer
pageSize
,
SrvOrganListReq
srvOrganListReq
)
{
srvOrganListReq
.
setAccountsStatus
(
"0"
);
List
<
String
>
accountsStatusList
=
Arrays
.
asList
(
"0"
,
"1"
);
srvOrganListReq
.
setAccountsStatusList
(
accountsStatusList
);
Page
<
ChDisabDetailAccountsResp
>
chAssessDetailAccounts
=
accountService
.
queryOrganAccountsDetail
(
pageNum
,
pageSize
,
srvOrganListReq
);
return
Result
.
success
(
chAssessDetailAccounts
);
}
...
...
@@ -298,11 +299,11 @@ public class AccountController {
* @param accountsDetailId 结算详情id
*/
@DeleteMapping
(
"/deleteAccountsDetail"
)
public
Result
deleteAccountsDetail
(
Long
accountsDetailId
)
{
public
Result
deleteAccountsDetail
(
Long
accountsDetailId
,
Long
freeRdId
)
{
if
(
null
==
accountsDetailId
)
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
int
result
=
accountService
.
deleteAccountsDetail
(
accountsDetailId
);
int
result
=
accountService
.
deleteAccountsDetail
(
accountsDetailId
,
freeRdId
);
if
(
result
>
0
){
return
Result
.
success
();
}
else
{
...
...
@@ -312,7 +313,8 @@ public class AccountController {
@GetMapping
(
"/queryOverallCostList"
)
public
Result
<
Page
<
OverallCostListRespVO
>>
queryOverallCostList
(
OverallCostReqVO
req
)
{
Page
<
OverallCostListRespVO
>
overallCostRecords
=
accountService
.
queryOverallCostList
(
req
);
// Page<OverallCostListRespVO> overallCostRecords = accountService.queryOverallCostList(req);
Page
<
OverallCostListRespVO
>
overallCostRecords
=
accountService
.
queryFreeRdInfo
(
req
);
return
Result
.
success
(
overallCostRecords
);
}
...
...
account/account-service/src/main/java/com/hungraim/ltc/account/dao/ChDisabFreeRdInfoMapper.java
0 → 100644
View file @
7a705b27
package
com
.
hungraim
.
ltc
.
account
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.pojo.entity.account.ChDisabFreeRdInfo
;
import
com.hungraim.ltc.pojo.entity.account.OverallCostListRespVO
;
import
com.hungraim.ltc.pojo.entity.account.OverallCostReqVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
/**
* @author zwl
* @ClassName ChDisabFreeRdInfoMapper
* @description
* @date 2023/2/27 20:59
**/
@Repository
@Mapper
public
interface
ChDisabFreeRdInfoMapper
extends
BaseMapper
<
ChDisabFreeRdInfo
>
{
Page
<
OverallCostListRespVO
>
queryFreeRdInfo
(
Page
page
,
OverallCostReqVO
req
);
}
account/account-service/src/main/java/com/hungraim/ltc/account/service/AccountService.java
View file @
7a705b27
...
...
@@ -39,6 +39,8 @@ public interface AccountService extends IService<ChDisabAccounts> {
Page
<
OverallCostListRespVO
>
queryOverallCostList
(
OverallCostReqVO
req
);
Page
<
OverallCostListRespVO
>
queryFreeRdInfo
(
OverallCostReqVO
req
);
int
overallCostSubmit
(
OverallCostSubmitReqVO
req
);
int
updateChDisabAccounts
(
int
id
);
...
...
@@ -48,7 +50,7 @@ public interface AccountService extends IService<ChDisabAccounts> {
void
otherPlaceHandler
(
String
programId
);
int
deleteAccountsDetail
(
Long
accountsDetailId
);
int
deleteAccountsDetail
(
Long
accountsDetailId
,
Long
freeRdId
);
int
accountsFreeCommit
(
Long
accountsDetailId
);
...
...
account/account-service/src/main/java/com/hungraim/ltc/account/service/impl/AccountServiceImpl.java
View file @
7a705b27
...
...
@@ -50,6 +50,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
private
final
ChCfgCareServiceMapper
chCfgCareServiceMapper
;
private
final
ChCfgCostStandardMapper
chCfgCostStandardMapper
;
private
final
ChDisabAccountsDetailMapper
chDisabAccountsDetailMapper
;
private
final
ChDisabFreeRdInfoMapper
chDisabFreeRdInfoMapper
;
...
...
@@ -75,6 +76,9 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabAccounts
.
setPersonalCost
(
BigDecimal
.
valueOf
(
0
));
chDisabAccounts
.
setReissueAmountTotal
(
BigDecimal
.
valueOf
(
0
));
chDisabAccounts
.
setDeductionAmountTotal
(
BigDecimal
.
valueOf
(
0
));
HashMap
map
=
new
HashMap
();
map
.
put
(
"ACCOUNTS_ID"
,
accountsId
);
chDisabFreeRdInfoMapper
.
deleteByMap
(
map
);
}
//待审核
if
(
accountsStatus
==
1
)
{
...
...
@@ -492,12 +496,23 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
@Override
public
Page
<
OverallCostListRespVO
>
queryFreeRdInfo
(
OverallCostReqVO
req
)
{
req
.
setDealType
((
null
==
req
.
getDealType
()
||
0
==
req
.
getDealType
())
?
null
:
req
.
getDealType
());
Page
<
OverallCostListRespVO
>
overallCostListRespVOPage
=
chDisabFreeRdInfoMapper
.
queryFreeRdInfo
(
new
Page
<>(
req
.
getPageNum
(),
req
.
getPageSize
()),
req
);
return
overallCostListRespVOPage
;
}
@Override
public
int
overallCostSubmit
(
OverallCostSubmitReqVO
req
){
ChDisabDetailAccounts
chDisabDetailAccounts
=
new
ChDisabDetailAccounts
();
int
dealType
=
req
.
getDealType
();
chDisabDetailAccounts
.
setAccountsDetailId
(
req
.
getAccountsDetailId
());
Long
accountsDetailId
=
req
.
getAccountsDetailId
();
chDisabDetailAccounts
.
setAccountsDetailId
(
accountsDetailId
);
Long
accountsId
=
req
.
getAccountsId
();
ChDisabAccounts
chDisabAccounts
=
disabAccountsMapper
.
selectById
(
accountsId
);
ChDisabDetailAccounts
chDisabDetailAccountsDTO
=
chDisabAccountsDetailMapper
.
selectById
(
accountsDetailId
);
BigDecimal
deductionAmount
=
chDisabDetailAccountsDTO
.
getDeductionAmount
();
BigDecimal
reissueAmount
=
chDisabDetailAccountsDTO
.
getReissueAmount
();
BigDecimal
deductionAmountTotal
=
chDisabAccounts
.
getDeductionAmountTotal
();
BigDecimal
reissueAmountTotal
=
chDisabAccounts
.
getReissueAmountTotal
();
chDisabDetailAccounts
.
setDealType
(
dealType
);
...
...
@@ -505,11 +520,11 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BigDecimal
amountOfMoney
=
new
BigDecimal
(
amountOfMoneyStr
);
if
(
dealType
==
1
){
// 补发
chDisabDetailAccounts
.
setReissueAmount
(
amountOfMoney
);
chDisabDetailAccounts
.
setReissueAmount
(
reissueAmount
.
add
(
amountOfMoney
)
);
reissueAmountTotal
=
reissueAmountTotal
.
add
(
amountOfMoney
);
}
else
if
(
dealType
==
2
){
// 扣减
chDisabDetailAccounts
.
setDeductionAmount
(
amountOfMoney
);
chDisabDetailAccounts
.
setDeductionAmount
(
deductionAmount
.
add
(
amountOfMoney
)
);
deductionAmountTotal
=
deductionAmountTotal
.
add
(
amountOfMoney
);
}
chDisabDetailAccounts
.
setRemarks
(
req
.
getRemarks
());
...
...
@@ -517,6 +532,13 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabAccounts
.
setReissueAmountTotal
(
reissueAmountTotal
);
chDisabAccounts
.
setDeductionAmountTotal
(
deductionAmountTotal
);
disabAccountsMapper
.
updateById
(
chDisabAccounts
);
ChDisabFreeRdInfo
chDisabFreeRdInfo
=
new
ChDisabFreeRdInfo
();
chDisabFreeRdInfo
.
setDealType
(
dealType
);
chDisabFreeRdInfo
.
setAmountOfMoney
(
amountOfMoney
);
chDisabFreeRdInfo
.
setAccountsDetailId
(
accountsDetailId
);
chDisabFreeRdInfo
.
setAccountsId
(
accountsId
);
chDisabFreeRdInfo
.
setCreationTime
(
new
Date
());
chDisabFreeRdInfoMapper
.
insert
(
chDisabFreeRdInfo
);
return
result
;
}
...
...
@@ -682,13 +704,33 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
int
deleteAccountsDetail
(
Long
accountsDetailId
){
ChDisabDetailAccounts
chDisabDetailAccounts
=
new
ChDisabDetailAccounts
();
chDisabDetailAccounts
.
setDeductionAmount
(
BigDecimal
.
valueOf
(
0
));
chDisabDetailAccounts
.
setReissueAmount
(
BigDecimal
.
valueOf
(
0
));
chDisabDetailAccounts
.
setDealType
(
0
);
chDisabDetailAccounts
.
setAccountsDetailId
(
accountsDetailId
);
int
result
=
chDisabAccountsDetailMapper
.
updateById
(
chDisabDetailAccounts
);
public
int
deleteAccountsDetail
(
Long
accountsDetailId
,
Long
freeRdId
){
ChDisabFreeRdInfo
chDisabFreeRdInfo
=
chDisabFreeRdInfoMapper
.
selectById
(
freeRdId
);
BigDecimal
amountOfMoney
=
chDisabFreeRdInfo
.
getAmountOfMoney
();
int
freeDealType
=
chDisabFreeRdInfo
.
getDealType
();
ChDisabDetailAccounts
chDisabDetailAccountsDTO
=
chDisabAccountsDetailMapper
.
selectById
(
accountsDetailId
);
BigDecimal
deductionAmount
=
chDisabDetailAccountsDTO
.
getDeductionAmount
();
BigDecimal
reissueAmount
=
chDisabDetailAccountsDTO
.
getReissueAmount
();
Long
accountsId
=
chDisabDetailAccountsDTO
.
getAccountsId
();
ChDisabAccounts
chDisabAccountDTO
=
disabAccountsMapper
.
selectById
(
accountsId
);
BigDecimal
reissueAmountTotal
=
chDisabAccountDTO
.
getReissueAmountTotal
();
BigDecimal
deductionAmountTotal
=
chDisabAccountDTO
.
getDeductionAmountTotal
();
if
(
freeDealType
==
1
)
{
// 删除减掉补发
BigDecimal
reissueAmountSubtract
=
reissueAmountTotal
.
subtract
(
amountOfMoney
);
chDisabAccountDTO
.
setReissueAmountTotal
(
reissueAmountSubtract
);
BigDecimal
subtract
=
reissueAmount
.
subtract
(
amountOfMoney
);
chDisabDetailAccountsDTO
.
setReissueAmount
(
subtract
);
}
else
if
(
freeDealType
==
2
)
{
// 删除减掉扣减
BigDecimal
deductionAmountSubtract
=
deductionAmountTotal
.
subtract
(
amountOfMoney
);
chDisabAccountDTO
.
setDeductionAmountTotal
(
deductionAmountSubtract
);
BigDecimal
subtract
=
deductionAmount
.
subtract
(
amountOfMoney
);
chDisabDetailAccountsDTO
.
setDeductionAmount
(
subtract
);
}
disabAccountsMapper
.
updateById
(
chDisabAccountDTO
);
int
result
=
chDisabAccountsDetailMapper
.
updateById
(
chDisabDetailAccountsDTO
);
chDisabFreeRdInfoMapper
.
deleteById
(
freeRdId
);
return
result
;
}
...
...
account/account-service/src/main/resources/mapper/ChDisabFreeRdInfoMapper.xml
0 → 100644
View file @
7a705b27
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.hungraim.ltc.account.dao.ChDisabFreeRdInfoMapper"
>
<select
id=
"queryFreeRdInfo"
resultType=
"com.hungraim.ltc.pojo.entity.account.OverallCostListRespVO"
>
select
info.REAL_NAME realName,
info.CERTI_CODE certiCode,
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
detail.ACCOUNTS_DETAIL_ID accountsDetailId,
detail.ACCOUNTS_START_TIME svrStartTime,
detail.ACCOUNTS_END_TIME svrEndTime,
rd.DEAL_TYPE dealType,
organ.SRV_ORGAN_NAME srvOrganName,
rd.AMOUNT_OF_MONEY amountOfMoney,
rd.FREE_RD_ID freeRdId,
d.ACCOUNTS_STATUS accountsStatus
from CH_DISAB_FREE_RD_INFO rd left join
CH_DISAB_ACCOUNTS_DETAIL detail on
rd.ACCOUNTS_DETAIL_ID = detail.ACCOUNTS_DETAIL_ID
left join CH_DISAB_ACCOUNTS d on d.ACCOUNTS_ID = detail.ACCOUNTS_ID
left join CH_DISABLE_INFO info on info.DISAB_INFO_ID = detail.DISAB_INFO_ID
left join CH_DISABLE_APPLY apply on apply.APPLY_ID = info.APPLY_ID
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = detail.SRV_ORGAN_ID
<where>
<if
test=
"req.realName != null and req.realName != ''"
>
and info.REAL_NAME = #{req.realName}
</if>
<if
test=
"req.accountsTime != null and req.accountsTime != ''"
>
and to_char(detail.accounts_time,'yyyy-MM-dd') = #{req.accountsTime}
</if>
<if
test=
"req.srvOrganName != null and req.srvOrganName != ''"
>
and organ.SRV_ORGAN_NAME = #{req.srvOrganName}
</if>
<if
test=
"req.certiCode != null and req.certiCode != ''"
>
and info.certi_Code = #{req.certiCode}
</if>
<if
test=
"req.dealType != null"
>
and rd.DEAL_TYPE = #{req.dealType}
</if>
</where>
order by rd.CREATION_TIME desc
</select>
</mapper>
\ No newline at end of file
apply/apply-service/src/main/java/com/hungraim/ltc/controller/DisableController.java
View file @
7a705b27
...
...
@@ -493,7 +493,7 @@ public class DisableController {
}
/**
* 失能人员信息列表
* 失能人员信息
退出
列表
*
* @param pageNum 当前页
...
...
@@ -513,6 +513,10 @@ public class DisableController {
return
Result
.
success
(
page
);
}
/**
* 失能人员退出
*/
@RequestMapping
(
"/disableInfoExit"
)
public
Result
disableInfoExit
(
Integer
disableInfoId
,
Integer
exitReasonId
,
Integer
applyId
,
Integer
srvOrganId
,
Integer
programId
,
String
exitTime
)
{
if
(
disableInfoId
==
null
||
exitReasonId
==
null
||
applyId
==
null
)
{
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/account/ChDisabFreeRdInfo.java
0 → 100644
View file @
7a705b27
package
com
.
hungraim
.
ltc
.
pojo
.
entity
.
account
;
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
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* @author zwl
* @ClassName ChDisabFreeRdInfo
* @description
* @date 2023/2/28 8:43
**/
@Data
@TableName
(
"CH_DISAB_FREE_RD_INFO"
)
@KeySequence
(
"SEQ_CH_DISAB_FREE_RD_INFO"
)
public
class
ChDisabFreeRdInfo
implements
Serializable
{
@TableId
(
value
=
"FREE_RD_ID"
,
type
=
IdType
.
INPUT
)
private
Long
freeRdId
;
private
Long
accountsDetailId
;
private
Long
accountsId
;
private
Date
creationTime
;
private
int
dealType
;
private
BigDecimal
amountOfMoney
;
private
String
remarks
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/account/OverallCostListRespVO.java
View file @
7a705b27
...
...
@@ -17,6 +17,8 @@ public class OverallCostListRespVO {
*/
private
String
realName
;
private
Long
freeRdId
;
/**
*身份证号
...
...
@@ -61,4 +63,6 @@ public class OverallCostListRespVO {
private
String
accountsOverallCost
;
private
String
srvOrganName
;
private
String
accountsStatus
;
}
common/common-core/src/main/java/com/hungraim/ltc/util/DateUtils.java
View file @
7a705b27
...
...
@@ -8,6 +8,7 @@ import java.text.ParsePosition;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.GregorianCalendar
;
import
java.util.TimeZone
;
public
class
DateUtils
{
...
...
@@ -916,4 +917,17 @@ public class DateUtils {
return
false
;
}
public
static
String
getNextDay
(){
Date
date
=
new
Date
();
//取时间
Calendar
calendar
=
new
GregorianCalendar
();
calendar
.
setTime
(
date
);
// 1表示明天,-1表示昨天
calendar
.
add
(
Calendar
.
DATE
,
1
);
date
=
calendar
.
getTime
();
// 这个时间就是明天
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
dateString
=
formatter
.
format
(
date
);
return
dateString
;
}
}
governance/src/main/java/com/hungraim/ltc/api/SrvTaskFeignService.java
0 → 100644
View file @
7a705b27
package
com
.
hungraim
.
ltc
.
api
;
import
com.hungraim.ltc.util.Result
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
/**
* @author zwl
* @ClassName SrvTaskFeignService
* @description
* @date 2023/2/27 15:11
**/
@FeignClient
(
"LTC-GOVERNANCE-SERVICE"
)
public
interface
SrvTaskFeignService
{
@GetMapping
(
"/api.governance/srvTask/timeAllocationSrvTask"
)
Result
timeAllocationSrvTask
();
}
governance/src/main/java/com/hungraim/ltc/governance/controller/SrvTaskController.java
View file @
7a705b27
...
...
@@ -11,6 +11,7 @@ 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
;
...
...
governance/src/main/java/com/hungraim/ltc/governance/service/impl/SrvTaskServiceImpl.java
View file @
7a705b27
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.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -17,7 +15,6 @@ import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import
com.hungraim.ltc.pojo.entity.governance.ChSrvPlan
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTask
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskFinishItem
;
import
com.hungraim.ltc.pojo.vo.governance.*
;
import
com.hungraim.ltc.pojo.vo.system.AttachUpdateVo
;
import
com.hungraim.ltc.util.AttachType
;
...
...
@@ -144,6 +141,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvTask
.
setDisabInfoId
(
Long
.
parseLong
(
disabInfoId
));
// 失能人员id
chSrvTask
.
setSrvEmpId
(
Long
.
parseLong
(
srvTaskInfoVO
.
getSrvEmpId
()));
//服务人员id
chSrvTask
.
setStatus
((
short
)
1
);
//状态 未分配:0;已分配:1;已终止2
chSrvTask
.
setSrvDate
(
DateUtils
.
strToDate
(
taskDetails
.
get
(
0
)));
srvTaskMapper
.
insert
(
chSrvTask
);
//添加服务计划详情
Long
newSrvTaskId
=
chSrvTask
.
getSrvTaskId
();
...
...
@@ -212,15 +210,16 @@ public class SrvTaskServiceImpl implements SrvTaskService {
// 生成计划任务 CH_SRV_TASK_DETAIL
for
(
AllocationSrvTaskVO
chSrvTask
:
chSrvTasks
)
{
Long
srvTaskId
=
chSrvTask
.
getSrvTaskId
();
// 根据任务id和服务时间查询是否已经生成过计划,已经生成了就不需要再生成了
List
<
ChSrvTaskDetail
>
chSrvTaskDetailList
=
chSrvTaskDetailMapper
.
selectList
(
new
QueryWrapper
<
ChSrvTaskDetail
>().
eq
(
"srv_task_id"
,
srvTaskId
));
if
(
CollectionUtil
.
isNotEmpty
(
chSrvTaskDetailList
)){
String
nextDay
=
DateUtils
.
getNextDay
();
// 根据任务id和服务时间查询是否已经生成过计划,已经生成了就不需要再生成了,已退出
int
chSrvTaskDetailCount
=
chSrvTaskDetailMapper
.
getSrvTaskDetail
(
String
.
valueOf
(
srvTaskId
),
nextDay
);
if
(
chSrvTaskDetailCount
>
0
)
{
return
;
}
ChSrvTaskDetail
chSrvTaskDetail
=
new
ChSrvTaskDetail
();
chSrvTaskDetail
.
setSrvTaskId
(
srvTaskId
);
//taskId
chSrvTaskDetail
.
setSrvDate
(
new
Date
(
));
//服务开始时间
chSrvTaskDetail
.
setSrvDate
(
DateUtils
.
strToDate
(
nextDay
));
//服务开始时间
chSrvTaskDetail
.
setStatus
((
short
)
0
);
//状态 未执行:0;执行中:1;已执行:2;已失效:3已完成4
chSrvTaskDetailMapper
.
insert
(
chSrvTaskDetail
);
}
...
...
governance/src/main/resources/com/hungraim/ltc/governance/mapper/ChSrvTaskDetailMapper.xml
View file @
7a705b27
...
...
@@ -57,7 +57,8 @@
ILLEGALRE_NAME, ILLEGALRE_TIME, ACCOUNT_SIGN, TASK_DETAIL_TYPE
</sql>
<select
id=
"getSrvTaskDetail"
>
select count(*) from CH_SRV_TASK_DETAIL t where t.SRV_TASK_ID = #{srvTaskId} and to_char(t.SRV_DATE) = #{srvDate}
<select
id=
"getSrvTaskDetail"
resultType=
"java.lang.Integer"
>
select count(0) from CH_SRV_TASK_DETAIL t where t.SRV_TASK_ID = #{srvTaskId}
and to_char(t.SRV_DATE,'yyyy-MM-dd') = #{srvDate}
</select>
</mapper>
\ No newline at end of file
governance/src/main/resources/com/hungraim/ltc/governance/mapper/SrvTaskMapper.xml
View file @
7a705b27
...
...
@@ -214,9 +214,10 @@
</where>
</select>
<select
id=
"getAllocationSrvTask"
resultType=
"com.hungraim.ltc.pojo.vo.governance.AllocationSrvTaskVO"
>
select t.SRV_TASK_ID,t.SRV_DATE,
sysdate,
info.EXIT_TIME,info.EXIT_FLAG,info.EXIT_REASON_ID from CH_SRV_TASK t
select t.SRV_TASK_ID,t.SRV_DATE,info.EXIT_TIME,info.EXIT_FLAG,info.EXIT_REASON_ID from CH_SRV_TASK t
left join CH_DISABLE_INFO info on t.DISAB_INFO_ID = info.DISAB_INFO_ID
where t.STATUS =1 and info.DISAB_INFO_ID = '327' and sysdate > t.SRV_DATE
where t.SRV_DATE
<![CDATA[ < ]]>
sysdate and
(info.EXIT_TIME
<![CDATA[ > ]]>
sysdate or info.EXIT_TIME is null)
</select>
</mapper>
\ No newline at end of file
system/system-admin-service/pom.xml
View file @
7a705b27
...
...
@@ -65,6 +65,12 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
com.hungraim.ltc
</groupId>
<artifactId>
governance
</artifactId>
<version>
0.0.1
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
<build>
...
...
system/system-admin-service/src/main/java/com/hungraim/ltc/system/Scheduled/SrvTaskScheduledController.java
0 → 100644
View file @
7a705b27
package
com
.
hungraim
.
ltc
.
system
.
Scheduled
;
import
com.hungraim.ltc.api.AttachFeignService
;
import
com.hungraim.ltc.api.SrvTaskFeignService
;
import
com.hungraim.ltc.util.Result
;
import
lombok.AllArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
/**
* @author zwl
* @ClassName SrvTaskScheduledController
* @description
* @date 2023/2/27 15:23
**/
@Component
@AllArgsConstructor
public
class
SrvTaskScheduledController
{
private
final
SrvTaskFeignService
srvTaskFeignService
;
// 表示每天3点5分执行
@Scheduled
(
cron
=
"30 32 19 * * ?"
)
public
void
timeAllocationSrvTask
()
{
Result
result
=
srvTaskFeignService
.
timeAllocationSrvTask
();
System
.
out
.
println
();
}
}
system/system-admin-service/src/main/resources/bootstrap.yml
View file @
7a705b27
spring
:
main
:
#允许存在多个Feign调用相同Service的接口
allow-bean-definition-overriding
:
true
devtools
:
restart
:
enabled
:
true
...
...
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